feat: 防火墙增加重启按钮 (#3364)

Refs #3345
This commit is contained in:
ssongliu 2023-12-18 11:42:13 +08:00 committed by GitHub
parent 0a4e48c057
commit cbe1e9b4e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 3 deletions

View File

@ -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 {

View File

@ -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"
]

View File

@ -15069,6 +15069,7 @@
"enum": [
"start",
"stop",
"restart",
"disablePing",
"enablePing"
]

View File

@ -1132,6 +1132,7 @@ definitions:
enum:
- start
- stop
- restart
- disablePing
- enablePing
type: string

View File

@ -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:

View File

@ -1791,6 +1791,7 @@ const message = {
unUsed: '未使用',
firewallHelper: '{0}系統防火墻',
firewallNotStart: '當前未開啟系統防火墻請先開啟',
restartFirewallHelper: '該操作將對當前防火牆進行重啟操作是否繼續',
stopFirewallHelper: '系統防火墻關閉後服務器將失去安全防護是否繼續',
startFirewallHelper: '系統防火墻開啟後可以更好的防護服務器安全是否繼續',
noPing: ' ping',

View File

@ -1791,6 +1791,7 @@ const message = {
unUsed: '未使用',
firewallHelper: '{0}系统防火墙',
firewallNotStart: '当前未开启系统防火墙请先开启',
restartFirewallHelper: '该操作将对当前防火墙进行重启操作是否继续',
stopFirewallHelper: '系统防火墙关闭后服务器将失去安全防护是否继续',
startFirewallHelper: '系统防火墙开启后可以更好的防护服务器安全是否继续',
noPing: ' ping',

View File

@ -22,6 +22,10 @@
{{ $t('commons.button.start') }}
</el-button>
</span>
<el-divider direction="vertical" />
<el-button type="primary" @click="onOperate('restart')" link>
{{ $t('container.restart') }}
</el-button>
<span v-if="onPing !== 'None'">
<el-divider direction="vertical" />
<el-button type="primary" link>{{ $t('firewall.noPing') }}</el-button>
@ -73,6 +77,8 @@ const loadBaseInfo = async (search: boolean) => {
})
.catch(() => {
emit('update:loading', false);
emit('update:maskShow', true);
emit('update:name', '-');
});
};