diff --git a/README.md b/README.md index a572c25b..e6c27278 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,10 @@ panel - [无畏云加速](https://su.sctes.com/register?code=8st689ujpmm2p) +- [AnyCast.Ai](https://www.anycast.ai/) + +- [迅捷盾](https://console.fastdun.com/) + ### DevOps - [极狐GitLab](https://www.jihulab.com/) diff --git a/app/http/controllers/safe_controller.go b/app/http/controllers/safe_controller.go index c11c8d52..53c8a4a8 100644 --- a/app/http/controllers/safe_controller.go +++ b/app/http/controllers/safe_controller.go @@ -55,7 +55,10 @@ func (r *SafeController) GetFirewallRules(ctx http.Context) { out := tools.ExecShell("firewall-cmd --list-all 2>&1") match := regexp.MustCompile(`ports: (.*)`).FindStringSubmatch(out) if len(match) == 0 { - Success(ctx, nil) + Success(ctx, http.Json{ + "total": 0, + "items": []map[string]string{}, + }) return } ports := strings.Split(match[1], " ") @@ -89,7 +92,10 @@ func (r *SafeController) GetFirewallRules(ctx http.Context) { } else { out := tools.ExecShell("ufw status | grep -v '(v6)' | grep ALLOW | awk '{print $1}'") if len(out) == 0 { - Success(ctx, nil) + Success(ctx, http.Json{ + "total": 0, + "items": []map[string]string{}, + }) return } var rules []map[string]string