mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 22:18:07 +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)
|
stdout, err := cmd.Execf("%s systemctl %s %s", sudo, operation, serviceName)
|
||||||
if err != nil {
|
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 fmt.Errorf("%s %s failed, stdout: %s, err: %v", operation, serviceName, stdout, err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -86,7 +86,7 @@ const logSearch = reactive({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
terminalSocket.value!.send('close conn');
|
terminalSocket.value?.send('close conn');
|
||||||
open.value = false;
|
open.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ const onClean = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
terminalSocket.value!.send('close conn');
|
terminalSocket.value?.send('close conn');
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
@ -132,7 +132,7 @@ const loadTooltip = () => {
|
|||||||
return i18n.global.t('commons.button.' + (screenfull.isFullscreen ? 'quitFullscreen' : 'fullscreen'));
|
return i18n.global.t('commons.button.' + (screenfull.isFullscreen ? 'quitFullscreen' : 'fullscreen'));
|
||||||
};
|
};
|
||||||
const handleClose = async () => {
|
const handleClose = async () => {
|
||||||
terminalSocket.value!.send('close conn');
|
terminalSocket.value?.send('close conn');
|
||||||
logVisible.value = false;
|
logVisible.value = false;
|
||||||
};
|
};
|
||||||
watch(logVisible, (val) => {
|
watch(logVisible, (val) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user