From 4c8fc1defa796fb5370db940f908fb0304514e77 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Fri, 14 Apr 2023 15:08:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=98=B2=E7=81=AB=E5=A2=99=E7=A9=BA?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20(#625)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/app-status/index.vue | 24 -- frontend/src/lang/modules/en.ts | 2 + frontend/src/lang/modules/zh.ts | 1 + frontend/src/styles/common.scss | 22 ++ frontend/src/views/host/firewall/ip/index.vue | 173 ++++++++------ .../src/views/host/firewall/port/index.vue | 219 ++++++++++-------- .../src/views/host/firewall/status/index.vue | 2 +- 7 files changed, 254 insertions(+), 189 deletions(-) diff --git a/frontend/src/components/app-status/index.vue b/frontend/src/components/app-status/index.vue index fc3315e80..1877a5721 100644 --- a/frontend/src/components/app-status/index.vue +++ b/frontend/src/components/app-status/index.vue @@ -161,27 +161,3 @@ onMounted(() => { onCheck(); }); - - diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 9f8b8559c..08ec2d5c1 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1227,6 +1227,8 @@ const message = { 'This certificate has been associated with the following websites, and the renewal will be applied to these websites simultaneously', }, firewall: { + notSupport: + 'No system firewall detected (firewalld or ufw). Please refer to the official documentation for installation.', ccDeny: 'CC Protection', ipWhiteList: 'IP Whitelist', ipBlockList: 'IP Blacklist', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 93176dea6..1bd7ebf0d 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1220,6 +1220,7 @@ const message = { createAcme: '创建账户', }, firewall: { + notSupport: '未检测到系统防火墙(firewalld 或者 ufw),请参考官方文档进行安装', ccDeny: 'CC 防护', ipWhiteList: 'IP 白名单', ipBlockList: 'IP 黑名单', diff --git a/frontend/src/styles/common.scss b/frontend/src/styles/common.scss index 4437b7ed8..98f62fcf9 100644 --- a/frontend/src/styles/common.scss +++ b/frontend/src/styles/common.scss @@ -302,3 +302,25 @@ .table-link:hover { opacity: 0.6; } + +.app-warn { + text-align: center; + margin-top: 100px; + span:first-child { + color: #bbbfc4; + } + + span:nth-child(2) { + color: $primary-color; + cursor: pointer; + } + + span:nth-child(2):hover { + color: #74a4f3; + } + + img { + width: 300px; + height: 300px; + } +} \ No newline at end of file diff --git a/frontend/src/views/host/firewall/ip/index.vue b/frontend/src/views/host/firewall/ip/index.vue index 2c894c6a1..5979ad397 100644 --- a/frontend/src/views/host/firewall/ip/index.vue +++ b/frontend/src/views/host/firewall/ip/index.vue @@ -2,83 +2,109 @@
- - {{ $t('firewall.firewallNotStart') }} - +
+ + {{ $t('firewall.firewallNotStart') }} + - - - + +
@@ -102,6 +128,7 @@ const loading = ref(); const activeTag = ref('address'); const selects = ref([]); const searchName = ref(); +const fireName = ref(); const maskShow = ref(true); const fireStatus = ref('running'); @@ -153,6 +180,10 @@ const onOpenDialog = async ( dialogRef.value!.acceptParams(params); }; +const toDoc = () => { + window.open('https://1panel.cn/docs/user_manual/hosts/firewall/', '_blank'); +}; + const onChangeStatus = async (row: Host.RuleInfo, status: string) => { let operation = status === 'accept' @@ -244,7 +275,9 @@ const buttons = [ ]; onMounted(() => { - loading.value = true; - fireStatuRef.value.acceptParams(); + if (fireName.value !== '-') { + loading.value = true; + fireStatuRef.value.acceptParams(); + } }); diff --git a/frontend/src/views/host/firewall/port/index.vue b/frontend/src/views/host/firewall/port/index.vue index b5bae2a47..3060e4a16 100644 --- a/frontend/src/views/host/firewall/port/index.vue +++ b/frontend/src/views/host/firewall/port/index.vue @@ -3,6 +3,7 @@ +
+ + {{ $t('firewall.firewallNotStart') }} + - - {{ $t('firewall.firewallNotStart') }} - - - - + +
@@ -192,6 +218,9 @@ const onOpenDialog = async ( const quickJump = () => { router.push({ name: 'ContainerSetting' }); }; +const toDoc = () => { + window.open('https://1panel.cn/docs/user_manual/hosts/firewall/', '_blank'); +}; const onChangeStatus = async (row: Host.RuleInfo, status: string) => { let operation = @@ -300,7 +329,9 @@ const buttons = [ ]; onMounted(() => { - loading.value = true; - fireStatuRef.value.acceptParams(); + if (fireName.value !== '-') { + loading.value = true; + fireStatuRef.value.acceptParams(); + } }); diff --git a/frontend/src/views/host/firewall/status/index.vue b/frontend/src/views/host/firewall/status/index.vue index cd80aee19..8b24eb659 100644 --- a/frontend/src/views/host/firewall/status/index.vue +++ b/frontend/src/views/host/firewall/status/index.vue @@ -91,7 +91,7 @@ const onOperate = async (operation: string) => { loadBaseInfo(true); }) .catch(() => { - emit('update:loading', false); + loadBaseInfo(true); }); }) .catch(() => {