From cfc48733f0cb31345ee80374a48f5905259058b6 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 12 Dec 2023 22:46:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=A4=87=E4=BB=BD=E6=89=80=E6=9C=89=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=8F=90=E7=A4=BA=20(#3291)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #3290 --- backend/app/service/firewall.go | 5 ----- backend/app/service/ssh.go | 2 +- cmd/server/cmd/update.go | 5 +++-- frontend/src/api/modules/host.ts | 6 +++--- .../src/views/container/compose/create/index.vue | 16 +++++++++------- .../src/views/container/network/create/index.vue | 2 +- frontend/src/views/cronjob/record/index.vue | 12 ++++++++++++ 7 files changed, 29 insertions(+), 19 deletions(-) diff --git a/backend/app/service/firewall.go b/backend/app/service/firewall.go index 256d04dd2..28541f418 100644 --- a/backend/app/service/firewall.go +++ b/backend/app/service/firewall.go @@ -515,11 +515,6 @@ func (u *FirewallService) updatePingStatus(enable string) error { if err != nil { return fmt.Errorf("update ping status failed, err: %v", stdout) } - handle := "-A" - if enable == "1" { - handle = "-D" - } - _, _ = cmd.Execf("%s ip6tables %s INPUT -p icmpv6 --icmpv6-type echo-request -j DROP", cmd.SudoHandleCmd(), handle) return nil } diff --git a/backend/app/service/ssh.go b/backend/app/service/ssh.go index 0b2ab9ea1..63502d65b 100644 --- a/backend/app/service/ssh.go +++ b/backend/app/service/ssh.go @@ -320,7 +320,7 @@ func (u *SSHService) LoadLog(req dto.SearchSSHLog) (*dto.SSHLog, error) { case constant.StatusSuccess: commandItem = fmt.Sprintf("cat %s | grep -a Accepted %s", file.Name, command) case constant.StatusFailed: - commandItem = fmt.Sprintf("cat %s | grep -aE 'Failed password for|Connection closed by authenticating user' | grep -a 'preauth' %s", file.Name, command) + commandItem = fmt.Sprintf("cat %s | grep -aE 'Failed password for|Connection closed by authenticating user' %s", file.Name, command) default: commandItem = fmt.Sprintf("cat %s | grep -aE \"(Failed password for|Connection closed by authenticating user|Accepted)\" | grep -v 'invalid' %s", file.Name, command) } diff --git a/cmd/server/cmd/update.go b/cmd/server/cmd/update.go index 80a0fd479..706862cc5 100644 --- a/cmd/server/cmd/update.go +++ b/cmd/server/cmd/update.go @@ -128,7 +128,8 @@ func password() { fmt.Println("\n错误:面板密码仅支持字母、数字、特殊字符(!@#$%*_,.?),长度 8-30 位!") return } - } else if len(newPassword) < 6 { + } + if len(newPassword) < 6 { fmt.Println("错误:请输入 6 位以上密码!") return } @@ -173,7 +174,7 @@ func port() { newPortStr, _ := reader.ReadString('\n') newPortStr = strings.Trim(newPortStr, "\n") newPort, err := strconv.Atoi(strings.TrimSpace(newPortStr)) - if err != nil || newPort < 0 || newPort > 65535 { + if err != nil || newPort < 1 || newPort > 65535 { fmt.Println("错误:输入的端口号必须在 1 到 65535 之间!") return } diff --git a/frontend/src/api/modules/host.ts b/frontend/src/api/modules/host.ts index 70e1b3b50..8cab4e3f5 100644 --- a/frontend/src/api/modules/host.ts +++ b/frontend/src/api/modules/host.ts @@ -109,13 +109,13 @@ export const getSSHConf = () => { return http.get(`/hosts/ssh/conf`); }; export const operateSSH = (operation: string) => { - return http.post(`/hosts/ssh/operate`, { operation: operation }); + return http.post(`/hosts/ssh/operate`, { operation: operation }, TimeoutEnum.T_40S); }; export const updateSSH = (params: Host.SSHUpdate) => { - return http.post(`/hosts/ssh/update`, params); + return http.post(`/hosts/ssh/update`, params, TimeoutEnum.T_40S); }; export const updateSSHByfile = (file: string) => { - return http.post(`/hosts/ssh/conffile/update`, { file: file }); + return http.post(`/hosts/ssh/conffile/update`, { file: file }, TimeoutEnum.T_40S); }; export const generateSecret = (params: Host.SSHGenerate) => { return http.post(`/hosts/ssh/generate`, params); diff --git a/frontend/src/views/container/compose/create/index.vue b/frontend/src/views/container/compose/create/index.vue index 3d6c3c347..3dee9e7be 100644 --- a/frontend/src/views/container/compose/create/index.vue +++ b/frontend/src/views/container/compose/create/index.vue @@ -78,13 +78,15 @@ v-model="form.file" /> - +
+ +
diff --git a/frontend/src/views/container/network/create/index.vue b/frontend/src/views/container/network/create/index.vue index 7028cf89b..5a3eac14d 100644 --- a/frontend/src/views/container/network/create/index.vue +++ b/frontend/src/views/container/network/create/index.vue @@ -253,7 +253,7 @@ function checkCidr(rule: any, value: any, callback: any) { callback(); } const reg = - /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\/([0-9]|[1-2][0-9]|3[0-2]))?$/; + /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\/([0-9]|[1-2][0-9]|3[0-2]))$/; if (!reg.test(value)) { return callback(new Error(i18n.global.t('commons.rule.formatErr'))); } diff --git a/frontend/src/views/cronjob/record/index.vue b/frontend/src/views/cronjob/record/index.vue index 484d7ee5a..8c42dba66 100644 --- a/frontend/src/views/cronjob/record/index.vue +++ b/frontend/src/views/cronjob/record/index.vue @@ -618,12 +618,24 @@ const onDownload = async (record: any, backupID: number) => { switch (dialogData.value.rowData.type) { case 'database': type = i18n.global.t('database.database'); + if (dialogData.value.rowData!.dbName === 'all') { + MsgInfo(i18n.global.t('cronjob.allOptionHelper', [type])); + return; + } break; case 'app': type = i18n.global.t('app.app'); + if (dialogData.value.rowData!.appID === 'all') { + MsgInfo(i18n.global.t('cronjob.allOptionHelper', [type])); + return; + } break; case 'website': type = i18n.global.t('website.website'); + if (dialogData.value.rowData!.website === 'all') { + MsgInfo(i18n.global.t('cronjob.allOptionHelper', [type])); + return; + } break; } if (currentRecord.value.file.indexOf(',') !== -1) {