mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
feat(wip): node selector supports sse
This commit is contained in:
parent
ed0dca6820
commit
bc70567dc1
31 changed files with 176 additions and 166 deletions
|
@ -1,10 +1,10 @@
|
|||
package settings
|
||||
|
||||
import (
|
||||
"github.com/0xJacky/Nginx-UI/api"
|
||||
"github.com/0xJacky/Nginx-UI/query"
|
||||
"github.com/0xJacky/Nginx-UI/settings"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/uozi-tech/cosy"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
@ -19,7 +19,7 @@ func GetBanLoginIP(c *gin.Context) {
|
|||
b.ExpiredAt.Gte(time.Now().Unix()),
|
||||
b.Attempts.Gte(settings.AuthSettings.MaxAttempts)).Find()
|
||||
if err != nil {
|
||||
api.ErrHandler(c, err)
|
||||
cosy.ErrHandler(c, err)
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, banIps)
|
||||
|
@ -29,7 +29,7 @@ func RemoveBannedIP(c *gin.Context) {
|
|||
var json struct {
|
||||
IP string `json:"ip"`
|
||||
}
|
||||
if !api.BindAndValid(c, &json) {
|
||||
if !cosy.BindAndValid(c, &json) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ func RemoveBannedIP(c *gin.Context) {
|
|||
_, err := b.Where(b.IP.Eq(json.IP)).Delete()
|
||||
|
||||
if err != nil {
|
||||
api.ErrHandler(c, err)
|
||||
cosy.ErrHandler(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue