mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 14:57:16 +08:00
feat: 同步前端修改
This commit is contained in:
@@ -190,6 +190,9 @@ func (c *Fail2banController) List(ctx http.Context) http.Response {
|
||||
endIndex = len(jails)
|
||||
}
|
||||
pagedJails := jails[startIndex:endIndex]
|
||||
if pagedJails == nil {
|
||||
pagedJails = []Jail{}
|
||||
}
|
||||
|
||||
return controllers.Success(ctx, http.Json{
|
||||
"total": len(jails),
|
||||
@@ -363,7 +366,7 @@ func (c *Fail2banController) BanList(ctx http.Context) http.Response {
|
||||
return check
|
||||
}
|
||||
|
||||
name := ctx.Request().Query("name")
|
||||
name := ctx.Request().Input("name")
|
||||
if len(name) == 0 {
|
||||
return controllers.Error(ctx, http.StatusUnprocessableEntity, "缺少参数")
|
||||
}
|
||||
@@ -384,9 +387,9 @@ func (c *Fail2banController) BanList(ctx http.Context) http.Response {
|
||||
}
|
||||
|
||||
return controllers.Success(ctx, http.Json{
|
||||
"currentlyBan": currentlyBan,
|
||||
"totalBan": totalBan,
|
||||
"bannedIpList": list,
|
||||
"currently_ban": currentlyBan,
|
||||
"total_ban": totalBan,
|
||||
"baned_list": list,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -288,10 +288,10 @@ func Plugin() {
|
||||
route.Post("stop", fail2banController.Stop)
|
||||
route.Post("restart", fail2banController.Restart)
|
||||
route.Post("reload", fail2banController.Reload)
|
||||
route.Get("list", fail2banController.List)
|
||||
route.Post("add", fail2banController.Add)
|
||||
route.Post("delete", fail2banController.Delete)
|
||||
route.Get("ban", fail2banController.BanList)
|
||||
route.Get("jails", fail2banController.List)
|
||||
route.Post("jails", fail2banController.Add)
|
||||
route.Delete("jails", fail2banController.Delete)
|
||||
route.Get("jails/{name}", fail2banController.BanList)
|
||||
route.Post("unban", fail2banController.Unban)
|
||||
route.Post("whiteList", fail2banController.SetWhiteList)
|
||||
route.Get("whiteList", fail2banController.GetWhiteList)
|
||||
|
||||
Reference in New Issue
Block a user