File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
frontend/src/views/host/file-management/delete Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -211,9 +211,11 @@ func (f *FileService) Create(op request.FileCreate) error {
211211}
212212
213213func (f * FileService ) Delete (op request.FileDelete ) error {
214- excludeDir := global .CONF .System .DataDir
215- if strings .Contains (op .Path , ".1panel_clash" ) || op .Path == excludeDir {
216- return buserr .New (constant .ErrPathNotDelete )
214+ if op .IsDir {
215+ excludeDir := global .CONF .System .DataDir
216+ if strings .Contains (op .Path , ".1panel_clash" ) || op .Path == excludeDir {
217+ return buserr .New (constant .ErrPathNotDelete )
218+ }
217219 }
218220 fo := files .NewFileOp ()
219221 recycleBinStatus , _ := settingRepo .Get (settingRepo .WithByKey ("FileRecycleBin" ))
Original file line number Diff line number Diff line change @@ -89,11 +89,11 @@ const getStatus = async () => {
8989const onConfirm = async () => {
9090 const pros = [];
9191 for (const s of files .value ) {
92- if (s [' path' ].indexOf (' .1panel_clash' ) > - 1 ) {
93- MsgWarning (i18n .global .t (' file.clashDeleteAlert' ));
94- return ;
95- }
9692 if (s [' isDir' ]) {
93+ if (s [' path' ].indexOf (' .1panel_clash' ) > - 1 ) {
94+ MsgWarning (i18n .global .t (' file.clashDeleteAlert' ));
95+ return ;
96+ }
9797 const pathRes = await loadBaseDir ();
9898 if (s [' path' ] === pathRes .data ) {
9999 MsgWarning (i18n .global .t (' file.panelInstallDir' ));
You can’t perform that action at this time.
0 commit comments