fix: Node switchover is cancelled when the master node unbinds the li… (#8253)

This commit is contained in:
ssongliu 2025-03-26 15:47:34 +08:00 committed by GitHub
parent 1b2f19560e
commit 732bbd8951
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 27 additions and 16 deletions

View file

@ -139,7 +139,6 @@ const handleBeforeClose = (done: () => void) => {
};
const handleClose = () => {
console.log('321321');
localOpenPage.value = false;
globalStore.isFullScreen = false;
emit('close');

View file

@ -1434,6 +1434,7 @@ const message = {
proxyPort: '代理端口',
proxyPasswdKeep: '记住密码',
proxyDocker: 'Docker 代理',
proxyDockerHelper: '将代理服务器配置同步至 Docker支持离线服务器拉取镜像等操作',
apiInterface: 'API 接口',
apiInterfaceClose: '关闭后将不能使用 API 接口进行访问是否继续',
apiInterfaceHelper: '提供面板支持 API 接口访问',

View file

@ -28,8 +28,8 @@
{{ $t('menu.msgCenter') }}
<el-tag class="msg-tag" v-if="taskCount !== 0" size="small" round>{{ taskCount }}</el-tag>
</div>
<el-divider v-if="nodes.length > 0" class="divider" />
<div v-if="nodes.length > 0" class="mt-2 mb-2">
<el-divider v-if="nodes.length > 0 && globalStore.isMasterProductPro" class="divider" />
<div v-if="nodes.length > 0 && globalStore.isMasterProductPro" class="mt-2 mb-2">
<div class="dropdown-item" @click="changeNode('local')">
{{ $t('xpack.node.master') }}
</div>
@ -90,6 +90,10 @@ const loadCurrentName = () => {
};
const loadNodes = async () => {
if (!globalStore.isMasterProductPro) {
globalStore.currentNode = 'local';
return;
}
await listNodeOptions()
.then((res) => {
if (!res) {

View file

@ -339,6 +339,7 @@ const login = (formEl: FormInstance | undefined) => {
globalStore.currentNode = 'local';
MsgSuccess(i18n.t('commons.msg.loginSuccess'));
router.push({ name: 'home' });
document.onkeydown = null;
} catch (res) {
if (res.code === 401) {
if (res.message === 'ErrCaptchaCode') {
@ -374,6 +375,7 @@ const mfaLogin = async (auto: boolean) => {
MsgSuccess(i18n.t('commons.msg.loginSuccess'));
globalStore.currentNode = 'local';
router.push({ name: 'home' });
document.onkeydown = null;
} catch (res) {
if (res.code === 401) {
errMfaInfo.value = true;

View file

@ -288,18 +288,23 @@ const handleMFA = async () => {
ElMessageBox.confirm(i18n.global.t('setting.mfaClose'), i18n.global.t('setting.mfa'), {
confirmButtonText: i18n.global.t('commons.button.confirm'),
cancelButtonText: i18n.global.t('commons.button.cancel'),
}).then(async () => {
loading.value = true;
await updateSetting({ key: 'MFAStatus', value: 'Disable' })
.then(() => {
loading.value = false;
search();
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
})
.catch(() => {
loading.value = false;
});
});
})
.then(async () => {
loading.value = true;
await updateSetting({ key: 'MFAStatus', value: 'Disable' })
.then(() => {
loading.value = false;
search();
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
})
.catch(() => {
loading.value = false;
search();
});
})
.catch(() => {
search();
});
};
const onChangeEntrance = () => {

View file

@ -64,7 +64,7 @@ const onSave = async (formEl: FormInstance | undefined) => {
type: 'info',
},
).then(async () => {
await updateFail2ban({ key: 'logPath', value: form.logPath })
await updateFail2ban({ key: 'logpath', value: form.logPath })
.then(async () => {
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
loading.value = false;