mirror of https://github.com/1Panel-dev/1Panel
feat: 服务升级重启等操作时取消前端定时请求 (#2801)
parent
4b69d77d3c
commit
dedfe1e1e1
|
@ -134,6 +134,7 @@ const onUpgrade = async () => {
|
|||
}).then(async () => {
|
||||
globalStore.isLoading = true;
|
||||
await upgrade(upgradeVersion.value);
|
||||
globalStore.isOnRestart = true;
|
||||
drawerVisible.value = false;
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
search();
|
||||
|
|
|
@ -22,6 +22,7 @@ export const GlobalStore = defineStore({
|
|||
footer: true,
|
||||
},
|
||||
isFullScreen: false,
|
||||
isOnRestart: false,
|
||||
agreeLicense: false,
|
||||
hasNewVersion: false,
|
||||
ignoreCaptcha: true,
|
||||
|
|
|
@ -17,6 +17,7 @@ export interface GlobalState {
|
|||
// assemblySize: string; // small | default | large
|
||||
themeConfig: ThemeConfigProp;
|
||||
isFullScreen: boolean;
|
||||
isOnRestart: boolean;
|
||||
agreeLicense: boolean;
|
||||
hasNewVersion: boolean;
|
||||
ignoreCaptcha: boolean;
|
||||
|
|
|
@ -381,7 +381,7 @@ const onLoadBaseInfo = async (isInit: boolean, range: string) => {
|
|||
appRef.value.acceptParams();
|
||||
if (isInit) {
|
||||
timer = setInterval(async () => {
|
||||
if (isActive.value) {
|
||||
if (isActive.value && !globalStore.isOnRestart) {
|
||||
await onLoadCurrentInfo();
|
||||
}
|
||||
}, 3000);
|
||||
|
@ -550,6 +550,7 @@ const restart = async (type: string) => {
|
|||
type: 'info',
|
||||
},
|
||||
).then(async () => {
|
||||
globalStore.isOnRestart = true;
|
||||
MsgSuccess(i18n.global.t('home.operationSuccess'));
|
||||
await systemRestart(type);
|
||||
});
|
||||
|
|
|
@ -315,6 +315,7 @@ const loadLanguage = async () => {
|
|||
};
|
||||
|
||||
onMounted(() => {
|
||||
globalStore.isOnRestart = false;
|
||||
loginVerify();
|
||||
loadLanguage();
|
||||
document.title = globalStore.themeConfig.panelName;
|
||||
|
|
|
@ -82,6 +82,7 @@ const getStatus = async () => {
|
|||
};
|
||||
|
||||
onMounted(() => {
|
||||
globalStore.isOnRestart = false;
|
||||
getStatus();
|
||||
screenWidth.value = document.body.clientWidth;
|
||||
window.onresize = () => {
|
||||
|
|
Loading…
Reference in New Issue