mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-21 12:56:13 +08:00
parent
6c4c0f7595
commit
64bc92a7fd
1 changed files with 15 additions and 1 deletions
|
@ -1097,7 +1097,7 @@ const buttons = [
|
||||||
label: i18n.global.t('file.deCompress'),
|
label: i18n.global.t('file.deCompress'),
|
||||||
click: openDeCompress,
|
click: openDeCompress,
|
||||||
disabled: (row: File.File) => {
|
disabled: (row: File.File) => {
|
||||||
return row.isDir;
|
return !isDecompressFile(row);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1137,6 +1137,20 @@ const buttons = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const isDecompressFile = (row: File.File) => {
|
||||||
|
if (row.isDir) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (getFileType(row.extension) === 'compress') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (row.mimeType == 'application/octet-stream') {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return Mimetypes.get(row.mimeType) != undefined;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (router.currentRoute.value.query.path) {
|
if (router.currentRoute.value.query.path) {
|
||||||
req.path = String(router.currentRoute.value.query.path);
|
req.path = String(router.currentRoute.value.query.path);
|
||||||
|
|
Loading…
Add table
Reference in a new issue