mirror of https://github.com/1Panel-dev/1Panel
fix: 多个文件同时计算大小,计算状态独自显示 (#5851)
parent
cae0a6118f
commit
cbb119117b
|
@ -265,7 +265,7 @@
|
||||||
link
|
link
|
||||||
small
|
small
|
||||||
@click="getDirSize(row, $index)"
|
@click="getDirSize(row, $index)"
|
||||||
:loading="btnLoading == $index"
|
:loading="btnLoading.includes($index)"
|
||||||
>
|
>
|
||||||
<span v-if="row.dirSize == undefined">
|
<span v-if="row.dirSize == undefined">
|
||||||
{{ $t('file.calculate') }}
|
{{ $t('file.calculate') }}
|
||||||
|
@ -387,7 +387,7 @@ const initData = () => ({
|
||||||
});
|
});
|
||||||
let req = reactive(initData());
|
let req = reactive(initData());
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
let btnLoading = ref(-1);
|
let btnLoading = ref([]);
|
||||||
const paths = ref<FilePaths[]>([]);
|
const paths = ref<FilePaths[]>([]);
|
||||||
let pathWidth = ref(0);
|
let pathWidth = ref(0);
|
||||||
const history: string[] = [];
|
const history: string[] = [];
|
||||||
|
@ -638,7 +638,7 @@ const getDirSize = async (row: any, index: number) => {
|
||||||
const req = {
|
const req = {
|
||||||
path: row.path,
|
path: row.path,
|
||||||
};
|
};
|
||||||
btnLoading.value = index;
|
btnLoading.value.push(index);
|
||||||
await ComputeDirSize(req)
|
await ComputeDirSize(req)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
let newData = [...data.value];
|
let newData = [...data.value];
|
||||||
|
@ -646,7 +646,7 @@ const getDirSize = async (row: any, index: number) => {
|
||||||
data.value = newData;
|
data.value = newData;
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
btnLoading.value = -1;
|
btnLoading.value = btnLoading.value.filter((item) => item !== index);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue