mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-10 09:02:42 +08:00
feat: 守护进程增加加载状态 (#4201)
Refs https://github.com/1Panel-dev/1Panel/issues/4129
This commit is contained in:
parent
8f24432a01
commit
825ebd19fb
1 changed files with 8 additions and 4 deletions
|
@ -18,7 +18,7 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #main v-if="showTable">
|
<template #main v-if="showTable">
|
||||||
<ComplexTable :data="data" :class="{ mask: !supervisorStatus.isRunning }">
|
<ComplexTable :data="data" :class="{ mask: !supervisorStatus.isRunning }" v-loading="dataLoading">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:label="$t('commons.table.name')"
|
:label="$t('commons.table.name')"
|
||||||
fix
|
fix
|
||||||
|
@ -175,6 +175,7 @@ const supervisorStatus = ref({
|
||||||
isRunning: false,
|
isRunning: false,
|
||||||
init: true,
|
init: true,
|
||||||
});
|
});
|
||||||
|
const dataLoading = ref(false);
|
||||||
|
|
||||||
const setting = () => {
|
const setting = () => {
|
||||||
setSuperVisor.value = true;
|
setSuperVisor.value = true;
|
||||||
|
@ -213,8 +214,9 @@ const search = async () => {
|
||||||
if (!supervisorStatus.value.isExist) {
|
if (!supervisorStatus.value.isExist) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loading.value = true;
|
|
||||||
let needLoadStatus = false;
|
let needLoadStatus = false;
|
||||||
|
dataLoading.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await GetSupervisorProcess();
|
const res = await GetSupervisorProcess();
|
||||||
data.value = res.data;
|
data.value = res.data;
|
||||||
|
@ -229,8 +231,10 @@ const search = async () => {
|
||||||
if (supervisorStatus.value.isRunning && needLoadStatus) {
|
if (supervisorStatus.value.isRunning && needLoadStatus) {
|
||||||
setTimeout(loadStatus, 1000);
|
setTimeout(loadStatus, 1000);
|
||||||
}
|
}
|
||||||
} catch (error) {}
|
} catch (error) {
|
||||||
loading.value = false;
|
} finally {
|
||||||
|
dataLoading.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadStatus = async () => {
|
const loadStatus = async () => {
|
||||||
|
|
Loading…
Reference in a new issue