mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
fix: 解决系统别名导致无法修改开机自启的问题 (#2849)
This commit is contained in:
parent
e8ee373fc4
commit
ac97d3c05a
@ -109,6 +109,12 @@ func (u *SSHService) OperateSSH(operation string) error {
|
||||
}
|
||||
stdout, err := cmd.Execf("%s systemctl %s %s", sudo, operation, serviceName)
|
||||
if err != nil {
|
||||
if strings.Contains(stdout, "alias name or linked unit file") {
|
||||
stdout, err := cmd.Execf("%s systemctl %s ssh", sudo, operation)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s ssh(alias name or linked unit file) failed, stdout: %s, err: %v", operation, stdout, err)
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("%s %s failed, stdout: %s, err: %v", operation, serviceName, stdout, err)
|
||||
}
|
||||
return nil
|
||||
|
@ -86,7 +86,7 @@ const logSearch = reactive({
|
||||
});
|
||||
|
||||
const handleClose = () => {
|
||||
terminalSocket.value!.send('close conn');
|
||||
terminalSocket.value?.send('close conn');
|
||||
open.value = false;
|
||||
};
|
||||
|
||||
|
@ -155,7 +155,7 @@ const onClean = async () => {
|
||||
};
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
terminalSocket.value!.send('close conn');
|
||||
terminalSocket.value?.send('close conn');
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
|
@ -132,7 +132,7 @@ const loadTooltip = () => {
|
||||
return i18n.global.t('commons.button.' + (screenfull.isFullscreen ? 'quitFullscreen' : 'fullscreen'));
|
||||
};
|
||||
const handleClose = async () => {
|
||||
terminalSocket.value!.send('close conn');
|
||||
terminalSocket.value?.send('close conn');
|
||||
logVisible.value = false;
|
||||
};
|
||||
watch(logVisible, (val) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user