mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-12 00:16:37 +08:00
fix: Fix issue with duplicate nodes appearing after adding a node. (#8828)
This commit is contained in:
parent
06d88219c2
commit
a36c0eb22f
1 changed files with 17 additions and 18 deletions
|
@ -33,38 +33,37 @@ const em = defineEmits(['update:withDockerRestart', 'submit']);
|
||||||
interface DialogProps {
|
interface DialogProps {
|
||||||
syncList: string;
|
syncList: string;
|
||||||
}
|
}
|
||||||
|
const emit = () => {
|
||||||
|
em('update:withDockerRestart', false);
|
||||||
|
em('submit');
|
||||||
|
};
|
||||||
const acceptParams = async (props: DialogProps): Promise<void> => {
|
const acceptParams = async (props: DialogProps): Promise<void> => {
|
||||||
if (props.syncList.indexOf('SyncSystemProxy') === -1) {
|
if (props.syncList.indexOf('SyncSystemProxy') === -1) {
|
||||||
em('update:withDockerRestart', false);
|
emit();
|
||||||
em('submit');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await getSettingInfo()
|
try {
|
||||||
.then((res) => {
|
const res = await getSettingInfo();
|
||||||
if (res.data.proxyType === '' || res.data.proxyType === 'close') {
|
if (res.data.proxyType === '' || res.data.proxyType === 'close') {
|
||||||
em('update:withDockerRestart', false);
|
emit();
|
||||||
em('submit');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
})
|
} catch (error) {
|
||||||
.catch(() => {
|
emit();
|
||||||
em('update:withDockerRestart', false);
|
|
||||||
em('submit');
|
|
||||||
return;
|
return;
|
||||||
});
|
}
|
||||||
|
|
||||||
let searchXSetting;
|
let searchXSetting;
|
||||||
const xpackModules = import.meta.glob('../../xpack/api/modules/setting.ts', { eager: true });
|
const xpackModules = import.meta.glob('../../xpack/api/modules/setting.ts', { eager: true });
|
||||||
if (xpackModules['../../xpack/api/modules/setting.ts']) {
|
if (xpackModules['../../xpack/api/modules/setting.ts']) {
|
||||||
searchXSetting = xpackModules['../../xpack/api/modules/setting.ts']['searchXSetting'] || {};
|
searchXSetting = xpackModules['../../xpack/api/modules/setting.ts']['searchXSetting'] || {};
|
||||||
const res = await searchXSetting();
|
const res = await searchXSetting();
|
||||||
if (!res) {
|
if (!res) {
|
||||||
em('update:withDockerRestart', false);
|
emit();
|
||||||
em('submit');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (res.data.proxyDocker === '') {
|
if (res.data.proxyDocker === '') {
|
||||||
em('update:withDockerRestart', false);
|
emit();
|
||||||
em('submit');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
open.value = true;
|
open.value = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue