mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 00:09:16 +08:00
parent
230d04dd75
commit
cfc48733f0
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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>
|
||||
|
@ -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')));
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user