feat: upgrade frontend
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Contributors / contributors (push) Has been cancelled
Sync / sync-to-jihulab (push) Has been cancelled
Run Tests / tests (macos) (push) Has been cancelled
Run Tests / tests (ubuntu) (push) Has been cancelled
Run Tests / tests (windows) (push) Has been cancelled

This commit is contained in:
naiba 2024-12-25 21:02:54 +08:00
parent 7d15838548
commit 87e01a532e
5 changed files with 9 additions and 9 deletions

View File

@ -101,8 +101,8 @@ func authenticator() func(c *gin.Context) (interface{}, error) {
return nil, jwt.ErrFailedAuthentication
}
model.ClearIP(singleton.DB, realip, model.BlockIDUnknownUser)
model.ClearIP(singleton.DB, realip, int64(user.ID))
model.UnblockIP(singleton.DB, realip, model.BlockIDUnknownUser)
model.UnblockIP(singleton.DB, realip, int64(user.ID))
return utils.Itoa(user.ID), nil
}
}
@ -172,7 +172,7 @@ func optionalAuthMiddleware(mw *jwt.GinJWTMiddleware) func(c *gin.Context) {
identity := mw.IdentityHandler(c)
if identity != nil {
model.ClearIP(singleton.DB, c.GetString(model.CtxKeyRealIPStr), model.BlockIDToken)
model.UnblockIP(singleton.DB, c.GetString(model.CtxKeyRealIPStr), model.BlockIDToken)
c.Set(mw.IdentityKey, identity)
} else {
if err := model.BlockIP(singleton.DB, c.GetString(model.CtxKeyRealIPStr), model.WAFBlockReasonTypeBruteForceToken, model.BlockIDToken); err != nil {

View File

@ -69,7 +69,7 @@ func batchDeleteBlockedAddress(c *gin.Context) (any, error) {
return nil, err
}
if err := model.BatchClearIP(singleton.DB, utils.Unique(list)); err != nil {
if err := model.BatchUnblockIP(singleton.DB, utils.Unique(list)); err != nil {
return nil, newGormError("%v", err)
}

View File

@ -76,7 +76,7 @@ func CheckIP(db *gorm.DB, ip string) error {
return nil
}
func ClearIP(db *gorm.DB, ip string, uid int64) error {
func UnblockIP(db *gorm.DB, ip string, uid int64) error {
if ip == "" {
return nil
}
@ -87,7 +87,7 @@ func ClearIP(db *gorm.DB, ip string, uid int64) error {
return db.Unscoped().Delete(&WAF{}, "ip = ? and block_identifier = ?", ipBinary, uid).Error
}
func BatchClearIP(db *gorm.DB, ip []string) error {
func BatchUnblockIP(db *gorm.DB, ip []string) error {
if len(ip) < 1 {
return nil
}

View File

@ -45,7 +45,7 @@ func (a *authHandler) Check(ctx context.Context) (uint64, error) {
}
singleton.UserLock.RUnlock()
model.ClearIP(singleton.DB, ip, model.BlockIDgRPC)
model.UnblockIP(singleton.DB, ip, model.BlockIDgRPC)
var clientUUID string
if value, ok := md["client_uuid"]; ok {

View File

@ -2,14 +2,14 @@
name: "OfficialAdmin"
repository: "https://github.com/nezhahq/admin-frontend"
author: "nezhahq"
version: "v1.4.2"
version: "v1.4.3"
isadmin: true
isofficial: true
- path: "user-dist"
name: "Official"
repository: "https://github.com/hamster1963/nezha-dash-v1"
author: "hamster1963"
version: "v1.8.1"
version: "v1.9.3"
isofficial: true
- path: "nazhua-dist"
name: "Nazhua"