From cbe1e9b4e1cef72ef40ad8a4b4563dafe28c21df Mon Sep 17 00:00:00 2001
From: ssongliu <73214554+ssongliu@users.noreply.github.com>
Date: Mon, 18 Dec 2023 11:42:13 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E9=98=B2=E7=81=AB=E5=A2=99=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E9=87=8D=E5=90=AF=E6=8C=89=E9=92=AE=20(#3364)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Refs #3345
---
backend/app/dto/firewall.go | 2 +-
cmd/server/docs/docs.go | 5 +++--
cmd/server/docs/swagger.json | 1 +
cmd/server/docs/swagger.yaml | 1 +
frontend/src/lang/modules/en.ts | 1 +
frontend/src/lang/modules/tw.ts | 1 +
frontend/src/lang/modules/zh.ts | 1 +
frontend/src/views/host/firewall/status/index.vue | 6 ++++++
8 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/backend/app/dto/firewall.go b/backend/app/dto/firewall.go
index c1f5e6d7d..e9f8952fc 100644
--- a/backend/app/dto/firewall.go
+++ b/backend/app/dto/firewall.go
@@ -16,7 +16,7 @@ type RuleSearch struct {
}
type FirewallOperation struct {
- Operation string `json:"operation" validate:"required,oneof=start stop disablePing enablePing"`
+ Operation string `json:"operation" validate:"required,oneof=start stop restart disablePing enablePing"`
}
type PortRuleOperate struct {
diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go
index b4be0567c..67f05d522 100644
--- a/cmd/server/docs/docs.go
+++ b/cmd/server/docs/docs.go
@@ -1,5 +1,5 @@
-// Package docs GENERATED BY SWAG; DO NOT EDIT
-// This file was generated by swaggo/swag
+// Code generated by swaggo/swag. DO NOT EDIT.
+
package docs
import "github.com/swaggo/swag"
@@ -15076,6 +15076,7 @@ const docTemplate = `{
"enum": [
"start",
"stop",
+ "restart",
"disablePing",
"enablePing"
]
diff --git a/cmd/server/docs/swagger.json b/cmd/server/docs/swagger.json
index 18b52a8d0..0e5aebd82 100644
--- a/cmd/server/docs/swagger.json
+++ b/cmd/server/docs/swagger.json
@@ -15069,6 +15069,7 @@
"enum": [
"start",
"stop",
+ "restart",
"disablePing",
"enablePing"
]
diff --git a/cmd/server/docs/swagger.yaml b/cmd/server/docs/swagger.yaml
index 712e5140b..26c908338 100644
--- a/cmd/server/docs/swagger.yaml
+++ b/cmd/server/docs/swagger.yaml
@@ -1132,6 +1132,7 @@ definitions:
enum:
- start
- stop
+ - restart
- disablePing
- enablePing
type: string
diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts
index 738a27302..5c6432555 100644
--- a/frontend/src/lang/modules/en.ts
+++ b/frontend/src/lang/modules/en.ts
@@ -1907,6 +1907,7 @@ const message = {
unUsed: 'Unused',
firewallHelper: '{0} System firewall',
firewallNotStart: 'The system firewall is not enabled at present, please enable it first!',
+ restartFirewallHelper: 'This operation will restart the current firewall. Do you want to continue?',
stopFirewallHelper:
'After the system firewall is disabled, the server loses security protection. Do you want to continue?',
startFirewallHelper:
diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts
index a325b50a0..c16e808f8 100644
--- a/frontend/src/lang/modules/tw.ts
+++ b/frontend/src/lang/modules/tw.ts
@@ -1791,6 +1791,7 @@ const message = {
unUsed: '未使用',
firewallHelper: '{0}系統防火墻',
firewallNotStart: '當前未開啟系統防火墻,請先開啟!',
+ restartFirewallHelper: '該操作將對當前防火牆進行重啟操作,是否繼續?',
stopFirewallHelper: '系統防火墻關閉後,服務器將失去安全防護,是否繼續?',
startFirewallHelper: '系統防火墻開啟後,可以更好的防護服務器安全,是否繼續?',
noPing: '禁 ping',
diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts
index 3583b1340..2af5e9b07 100644
--- a/frontend/src/lang/modules/zh.ts
+++ b/frontend/src/lang/modules/zh.ts
@@ -1791,6 +1791,7 @@ const message = {
unUsed: '未使用',
firewallHelper: '{0}系统防火墙',
firewallNotStart: '当前未开启系统防火墙,请先开启!',
+ restartFirewallHelper: '该操作将对当前防火墙进行重启操作,是否继续?',
stopFirewallHelper: '系统防火墙关闭后,服务器将失去安全防护,是否继续?',
startFirewallHelper: '系统防火墙开启后,可以更好的防护服务器安全,是否继续?',
noPing: '禁 ping',
diff --git a/frontend/src/views/host/firewall/status/index.vue b/frontend/src/views/host/firewall/status/index.vue
index 894799bf1..aa94adc82 100644
--- a/frontend/src/views/host/firewall/status/index.vue
+++ b/frontend/src/views/host/firewall/status/index.vue
@@ -22,6 +22,10 @@
{{ $t('commons.button.start') }}
+
+
+ {{ $t('container.restart') }}
+
{{ $t('firewall.noPing') }}
@@ -73,6 +77,8 @@ const loadBaseInfo = async (search: boolean) => {
})
.catch(() => {
emit('update:loading', false);
+ emit('update:maskShow', true);
+ emit('update:name', '-');
});
};