From 8a0aa168d241b111fb4c2f87e69de0a91bd9a642 Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Fri, 9 Sep 2022 18:39:56 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E5=A2=9E=E5=8A=A0=E5=8F=AF=E8=A7=A3?= =?UTF-8?q?=E5=8E=8B=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/modules/en.ts | 1 + frontend/src/lang/modules/zh.ts | 1 + frontend/src/views/host/file-management/index.vue | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index e33dfbf94..dcdcfb2a0 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -243,5 +243,6 @@ export default { move: 'Move', copy: 'Cpoy', calculate: 'Calculate', + canNotDeCompress: 'Can not DeCompress this File', }, }; diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 1b668b302..06d364feb 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -243,5 +243,6 @@ export default { move: '移动', copy: '复制', calculate: '计算', + canNotDeCompress: '无法解压此文件', }, }; diff --git a/frontend/src/views/host/file-management/index.vue b/frontend/src/views/host/file-management/index.vue index 3f1cbd9ed..de56a32d8 100644 --- a/frontend/src/views/host/file-management/index.vue +++ b/frontend/src/views/host/file-management/index.vue @@ -205,6 +205,7 @@ import CodeEditor from './code-editor/index.vue'; import Wget from './wget/index.vue'; import Move from './move/index.vue'; import Download from './download/index.vue'; +import { Mimetypes } from '@/global/mimetype'; const data = ref(); let selects = ref([]); @@ -399,6 +400,11 @@ const closeCompress = () => { }; const openDeCompress = (item: File.File) => { + if (Mimetypes.get(item.mimeType) == undefined) { + ElMessage.warning(i18n.global.t('file.canNotDeCompress')); + return; + } + deCompressPage.open = true; deCompressPage.name = item.name; deCompressPage.path = item.path; @@ -526,6 +532,9 @@ const buttons = [ { label: i18n.global.t('file.deCompress'), click: openDeCompress, + disabled: (row: File.File) => { + return row.isDir; + }, }, { label: i18n.global.t('file.rename'),