From 567b2b54f83fe7be7824a49b209107b73457935e Mon Sep 17 00:00:00 2001 From: jingrow Date: Sun, 26 Oct 2025 15:47:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=AE=89=E8=A3=85=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=B8=8A=E4=BC=A0=E5=90=8E=E5=A2=9E=E5=8A=A0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=B7=B2=E4=B8=8A=E4=BC=A0=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/views/dev/AppInstaller.vue | 48 +++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/apps/jingrow/frontend/src/views/dev/AppInstaller.vue b/apps/jingrow/frontend/src/views/dev/AppInstaller.vue index ff61f12..02b0abc 100644 --- a/apps/jingrow/frontend/src/views/dev/AppInstaller.vue +++ b/apps/jingrow/frontend/src/views/dev/AppInstaller.vue @@ -20,14 +20,13 @@ :file-list="fileList" :max="1" accept=".zip,.tar.gz,.tgz,.gz" - :show-file-list="false" :on-before-upload="beforeUpload" :on-change="handleFileChange" :custom-request="customUpload" :disabled="uploading" > -
+
@@ -41,6 +40,29 @@ + +
+ + + + {{ t('File Name') }}: {{ fileList[0].name }} + + {{ t('Size') }}: {{ formatFileSize(fileList[0].file.size) }} + + + {{ t('Extension Package') }} + + + +
+
@@ -112,7 +134,8 @@ import { ref, onMounted, h } from 'vue' import { NIcon, NButton, NSpace, NCard, NUpload, NUploadDragger, NText, NP, - NFormItem, NInput, NModal, NProgress, NDataTable, useMessage, type UploadFileInfo, type DataTableColumns + NFormItem, NInput, NModal, NProgress, NDataTable, useMessage, NAlert, NTag, + type UploadFileInfo, type DataTableColumns } from 'naive-ui' import { Icon } from '@iconify/vue' import axios from 'axios' @@ -390,6 +413,15 @@ const clearFiles = () => { uploadRef.value?.clear() } +// 格式化文件大小 +const formatFileSize = (bytes: number): string => { + if (bytes === 0) return '0 B' + const k = 1024 + const sizes = ['B', 'KB', 'MB', 'GB'] + const i = Math.floor(Math.log(bytes) / Math.log(k)) + return Math.round(bytes / Math.pow(k, i) * 100) / 100 + ' ' + sizes[i] +} + // 本地App相关方法 const loadLocalApps = async () => { loadingLocalApps.value = true @@ -487,6 +519,16 @@ onMounted(() => { border-color: #3b82f6; } +.file-info-card { + margin-top: 16px; +} + +.file-info-header { + display: flex; + align-items: center; + gap: 8px; +} + .upload-content { padding: 40px 20px; text-align: center;