From 3cbaa052c8671b199eedbb6563e59eb7c27bbc74 Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 5 Jul 2023 09:54:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=80=BB=E8=BE=91=20(#1532)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/file-list/index.vue | 58 ++++++++++++++++--- frontend/src/lang/modules/en.ts | 1 + frontend/src/lang/modules/tw.ts | 1 + frontend/src/lang/modules/zh.ts | 1 + frontend/src/views/app-store/apps/index.vue | 41 ++++++++----- frontend/src/views/host/ssh/index.vue | 8 +-- frontend/src/views/host/ssh/session/index.vue | 2 +- 7 files changed, 84 insertions(+), 28 deletions(-) diff --git a/frontend/src/components/file-list/index.vue b/frontend/src/components/file-list/index.vue index 09ab96d98..42ea438a4 100644 --- a/frontend/src/components/file-list/index.vue +++ b/frontend/src/components/file-list/index.vue @@ -11,7 +11,7 @@
- + @@ -67,6 +67,22 @@
+
+
+ {{ $t('file.currentSelect') }} + + +
+ {{ selectRow.path }} +
+
+
+
+
+ {{ $t('commons.button.cancel') }} + {{ $t('commons.button.confirm') }} +
+
@@ -78,11 +94,12 @@ import BreadCrumbs from '@/components/bread-crumbs/index.vue'; import BreadCrumbItem from '@/components/bread-crumbs/bread-crumbs-item.vue'; import { onMounted, onUpdated, reactive, ref } from 'vue'; -let rowName = ref(''); -let data = ref(); -let loading = ref(false); -let paths = ref([]); -let req = reactive({ path: '/', expand: true, page: 1, pageSize: 300 }); +const rowName = ref(''); +const data = ref(); +const loading = ref(false); +const paths = ref([]); +const req = reactive({ path: '/', expand: true, page: 1, pageSize: 300 }); +const selectRow = ref(); const popoverVisible = ref(false); @@ -100,9 +117,20 @@ const props = defineProps({ const em = defineEmits(['choose']); const checkFile = (row: any) => { - rowName.value = row.name; - em('choose', row.path); + selectRow.value = row; + rowName.value = selectRow.value.name; +}; + +const selectFile = () => { + if (selectRow.value) { + em('choose', selectRow.value.path); + } + closePage(); +}; + +const closePage = () => { popoverVisible.value = false; + selectRow.value = {}; }; const open = async (row: File.File) => { @@ -116,6 +144,7 @@ const open = async (row: File.File) => { } search(req); } + rowName.value = ''; }; const jump = async (index: number) => { @@ -172,4 +201,17 @@ onUpdated(() => { top: 10px; } } +.file-list-bottom { + margin-top: 10px; + .path { + width: 250px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .button { + margin-top: 10px; + float: right; + } +} diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 524ff0e33..016e4c0d2 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -867,6 +867,7 @@ const message = { searchHelper: 'Support wildcards such as *', uploadFailed: '[{0}] File Upload file', fileUploadStart: 'Uploading [{0}]....', + currentSelect: 'Current Select: ', }, ssh: { sshAlert: diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 2c6acb97c..bd3b139b7 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -837,6 +837,7 @@ const message = { searchHelper: '支持 * 等通配符', uploadFailed: '[{0}] 文件上傳失敗', fileUploadStart: '正在上傳[{0}]....', + currentSelect: '當前選中: ', }, ssh: { sshAlert: '列表數據根據登錄時間排序,但請註意,切換時區或其他操作可能導致登錄日誌的時間出現偏差。', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 825309e45..b096f9e10 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -837,6 +837,7 @@ const message = { searchHelper: '支持 * 等通配符', uploadFailed: '[{0}] 文件上传失败', fileUploadStart: '正在上传[{0}]....', + currentSelect: '当前选中: ', }, ssh: { sshAlert: '列表数据根据登录时间排序,但请注意,切换时区或其他操作可能导致登录日志的时间出现偏差。', diff --git a/frontend/src/views/app-store/apps/index.vue b/frontend/src/views/app-store/apps/index.vue index 3960e1d0f..62a53a316 100644 --- a/frontend/src/views/app-store/apps/index.vue +++ b/frontend/src/views/app-store/apps/index.vue @@ -45,7 +45,16 @@