mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-07 17:10:07 +08:00
parent
230d04dd75
commit
cfc48733f0
@ -515,11 +515,6 @@ func (u *FirewallService) updatePingStatus(enable string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("update ping status failed, err: %v", stdout)
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ func (u *SSHService) LoadLog(req dto.SearchSSHLog) (*dto.SSHLog, error) {
|
|||||||
case constant.StatusSuccess:
|
case constant.StatusSuccess:
|
||||||
commandItem = fmt.Sprintf("cat %s | grep -a Accepted %s", file.Name, command)
|
commandItem = fmt.Sprintf("cat %s | grep -a Accepted %s", file.Name, command)
|
||||||
case constant.StatusFailed:
|
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:
|
default:
|
||||||
commandItem = fmt.Sprintf("cat %s | grep -aE \"(Failed password for|Connection closed by authenticating user|Accepted)\" | grep -v 'invalid' %s", file.Name, command)
|
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 位!")
|
fmt.Println("\n错误:面板密码仅支持字母、数字、特殊字符(!@#$%*_,.?),长度 8-30 位!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else if len(newPassword) < 6 {
|
}
|
||||||
|
if len(newPassword) < 6 {
|
||||||
fmt.Println("错误:请输入 6 位以上密码!")
|
fmt.Println("错误:请输入 6 位以上密码!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -173,7 +174,7 @@ func port() {
|
|||||||
newPortStr, _ := reader.ReadString('\n')
|
newPortStr, _ := reader.ReadString('\n')
|
||||||
newPortStr = strings.Trim(newPortStr, "\n")
|
newPortStr = strings.Trim(newPortStr, "\n")
|
||||||
newPort, err := strconv.Atoi(strings.TrimSpace(newPortStr))
|
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 之间!")
|
fmt.Println("错误:输入的端口号必须在 1 到 65535 之间!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -109,13 +109,13 @@ export const getSSHConf = () => {
|
|||||||
return http.get<string>(`/hosts/ssh/conf`);
|
return http.get<string>(`/hosts/ssh/conf`);
|
||||||
};
|
};
|
||||||
export const operateSSH = (operation: string) => {
|
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) => {
|
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) => {
|
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) => {
|
export const generateSecret = (params: Host.SSHGenerate) => {
|
||||||
return http.post(`/hosts/ssh/generate`, params);
|
return http.post(`/hosts/ssh/generate`, params);
|
||||||
|
@ -78,13 +78,15 @@
|
|||||||
v-model="form.file"
|
v-model="form.file"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<LogFile
|
<div style="width: 100%">
|
||||||
ref="logRef"
|
<LogFile
|
||||||
:config="logConfig"
|
ref="logRef"
|
||||||
:default-button="false"
|
:config="logConfig"
|
||||||
v-if="mode === 'log' && showLog"
|
:default-button="false"
|
||||||
:style="'height: calc(100vh - 370px);min-height: 200px'"
|
v-if="mode === 'log' && showLog"
|
||||||
/>
|
:style="'height: calc(100vh - 370px);min-height: 200px'"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -253,7 +253,7 @@ function checkCidr(rule: any, value: any, callback: any) {
|
|||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
const reg =
|
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)) {
|
if (!reg.test(value)) {
|
||||||
return callback(new Error(i18n.global.t('commons.rule.formatErr')));
|
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) {
|
switch (dialogData.value.rowData.type) {
|
||||||
case 'database':
|
case 'database':
|
||||||
type = i18n.global.t('database.database');
|
type = i18n.global.t('database.database');
|
||||||
|
if (dialogData.value.rowData!.dbName === 'all') {
|
||||||
|
MsgInfo(i18n.global.t('cronjob.allOptionHelper', [type]));
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'app':
|
case 'app':
|
||||||
type = i18n.global.t('app.app');
|
type = i18n.global.t('app.app');
|
||||||
|
if (dialogData.value.rowData!.appID === 'all') {
|
||||||
|
MsgInfo(i18n.global.t('cronjob.allOptionHelper', [type]));
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'website':
|
case 'website':
|
||||||
type = i18n.global.t('website.website');
|
type = i18n.global.t('website.website');
|
||||||
|
if (dialogData.value.rowData!.website === 'all') {
|
||||||
|
MsgInfo(i18n.global.t('cronjob.allOptionHelper', [type]));
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (currentRecord.value.file.indexOf(',') !== -1) {
|
if (currentRecord.value.file.indexOf(',') !== -1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user