1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 00:09:16 +08:00

fix: 优化计划任务备份所有下载提示 (#3291)

Refs #3290
This commit is contained in:
ssongliu 2023-12-12 22:46:09 +08:00 committed by GitHub
parent 230d04dd75
commit cfc48733f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 19 deletions

View File

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

View File

@ -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)
}

View File

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

View File

@ -109,13 +109,13 @@ export const getSSHConf = () => {
return http.get<string>(`/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);

View File

@ -78,13 +78,15 @@
v-model="form.file"
/>
</div>
<LogFile
ref="logRef"
:config="logConfig"
:default-button="false"
v-if="mode === 'log' && showLog"
:style="'height: calc(100vh - 370px);min-height: 200px'"
/>
<div style="width: 100%">
<LogFile
ref="logRef"
:config="logConfig"
:default-button="false"
v-if="mode === 'log' && showLog"
:style="'height: calc(100vh - 370px);min-height: 200px'"
/>
</div>
</el-form-item>
</el-form>
</el-col>

View File

@ -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')));
}

View File

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