From 833a3e1a4fb80597dc1190c7572e5bdbf696140a Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:53:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=87=E4=BB=B6=E6=94=B6=E8=97=8F?= =?UTF-8?q?=E5=A4=B9=E5=A2=9E=E5=8A=A0=E5=BF=AB=E9=80=9F=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=20(#2642)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/file.go | 5 +- frontend/src/api/interface/file.ts | 1 + frontend/src/components/compose-log/index.vue | 2 +- .../src/views/host/file-management/index.vue | 75 ++++++++++++++++--- 4 files changed, 71 insertions(+), 12 deletions(-) diff --git a/backend/app/service/file.go b/backend/app/service/file.go index 2d7b20264..ecefd04c8 100644 --- a/backend/app/service/file.go +++ b/backend/app/service/file.go @@ -140,7 +140,10 @@ func (f *FileService) Delete(op request.FileDelete) error { return fo.DeleteFile(op.Path) } } - return NewIRecycleBinService().Create(request.RecycleBinCreate{SourcePath: op.Path}) + if err := NewIRecycleBinService().Create(request.RecycleBinCreate{SourcePath: op.Path}); err != nil { + return err + } + return favoriteRepo.Delete(favoriteRepo.WithByPath(op.Path)) } func (f *FileService) BatchDelete(op request.FileBatchDelete) error { diff --git a/frontend/src/api/interface/file.ts b/frontend/src/api/interface/file.ts index e22d73ae0..768ce5e34 100644 --- a/frontend/src/api/interface/file.ts +++ b/frontend/src/api/interface/file.ts @@ -168,5 +168,6 @@ export namespace File { path: string; isDir: boolean; isTxt: boolean; + name: string; } } diff --git a/frontend/src/components/compose-log/index.vue b/frontend/src/components/compose-log/index.vue index be2541b96..b4dc6d141 100644 --- a/frontend/src/components/compose-log/index.vue +++ b/frontend/src/components/compose-log/index.vue @@ -37,7 +37,7 @@ :placeholder="$t('commons.msg.noneData')" :indent-with-tab="true" :tabSize="4" - style="margin-top: 10px; height: calc(100vh - 375px)" + style="margin-top: 10px; height: calc(100vh - 200px)" :lineWrapping="true" :matchBrackets="true" theme="cobalt" diff --git a/frontend/src/views/host/file-management/index.vue b/frontend/src/views/host/file-management/index.vue index b40c4c807..81e28ebfe 100644 --- a/frontend/src/views/host/file-management/index.vue +++ b/frontend/src/views/host/file-management/index.vue @@ -98,9 +98,35 @@
- - {{ $t('file.favorite') }} - + + +
+ + + + + +
+
+ {{ $t('file.recycleBin') }} @@ -254,7 +280,14 @@