mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-15 10:14:44 +08:00
parent
b562d9f8e8
commit
464392f7e1
@ -82,7 +82,7 @@ export const DownloadFile = (params: File.FileDownload) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const ComputeDirSize = (params: File.DirSizeReq) => {
|
export const ComputeDirSize = (params: File.DirSizeReq) => {
|
||||||
return http.post<File.DirSizeRes>('files/size', params);
|
return http.post<File.DirSizeRes>('files/size', params, TimeoutEnum.T_5M);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const FileKeys = () => {
|
export const FileKeys = () => {
|
||||||
|
@ -260,7 +260,13 @@
|
|||||||
<el-table-column :label="$t('file.size')" prop="size" max-width="50" sortable>
|
<el-table-column :label="$t('file.size')" prop="size" max-width="50" sortable>
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<span v-if="row.isDir">
|
<span v-if="row.isDir">
|
||||||
<el-button type="primary" link small @click="getDirSize(row, $index)">
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
small
|
||||||
|
@click="getDirSize(row, $index)"
|
||||||
|
:loading="btnLoading == $index"
|
||||||
|
>
|
||||||
<span v-if="row.dirSize == undefined">
|
<span v-if="row.dirSize == undefined">
|
||||||
{{ $t('file.calculate') }}
|
{{ $t('file.calculate') }}
|
||||||
</span>
|
</span>
|
||||||
@ -381,6 +387,7 @@ const initData = () => ({
|
|||||||
});
|
});
|
||||||
let req = reactive(initData());
|
let req = reactive(initData());
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
|
let btnLoading = ref(-1);
|
||||||
const paths = ref<FilePaths[]>([]);
|
const paths = ref<FilePaths[]>([]);
|
||||||
let pathWidth = ref(0);
|
let pathWidth = ref(0);
|
||||||
const history: string[] = [];
|
const history: string[] = [];
|
||||||
@ -631,7 +638,7 @@ const getDirSize = async (row: any, index: number) => {
|
|||||||
const req = {
|
const req = {
|
||||||
path: row.path,
|
path: row.path,
|
||||||
};
|
};
|
||||||
loading.value = true;
|
btnLoading.value = index;
|
||||||
await ComputeDirSize(req)
|
await ComputeDirSize(req)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
let newData = [...data.value];
|
let newData = [...data.value];
|
||||||
@ -639,7 +646,7 @@ const getDirSize = async (row: any, index: number) => {
|
|||||||
data.value = newData;
|
data.value = newData;
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
loading.value = false;
|
btnLoading.value = -1;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user