File tree 2 files changed +9
-7
lines changed
frontend/src/views/host/file-management/delete
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 {
211
211
}
212
212
213
213
func (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
+ }
217
219
}
218
220
fo := files .NewFileOp ()
219
221
recycleBinStatus , _ := settingRepo .Get (settingRepo .WithByKey ("FileRecycleBin" ))
Original file line number Diff line number Diff line change @@ -89,11 +89,11 @@ const getStatus = async () => {
89
89
const onConfirm = async () => {
90
90
const pros = [];
91
91
for (const s of files .value ) {
92
- if (s [' path' ].indexOf (' .1panel_clash' ) > - 1 ) {
93
- MsgWarning (i18n .global .t (' file.clashDeleteAlert' ));
94
- return ;
95
- }
96
92
if (s [' isDir' ]) {
93
+ if (s [' path' ].indexOf (' .1panel_clash' ) > - 1 ) {
94
+ MsgWarning (i18n .global .t (' file.clashDeleteAlert' ));
95
+ return ;
96
+ }
97
97
const pathRes = await loadBaseDir ();
98
98
if (s [' path' ] === pathRes .data ) {
99
99
MsgWarning (i18n .global .t (' file.panelInstallDir' ));
You can’t perform that action at this time.
0 commit comments