Selaa lähdekoodia

Added click reachable force delete button

Toby Chui 3 vuotta sitten
vanhempi
commit
649ca6113b

+ 9 - 1
file_system.go

@@ -1980,7 +1980,15 @@ func system_fs_handleOpr(w http.ResponseWriter, r *http.Request) {
 				srcFshAbs.MkdirAll(trashDir, 0755)
 				hidden.HideFile(filepath.Dir(trashDir))
 				hidden.HideFile(trashDir)
-				srcFshAbs.Rename(rsrcFile, trashDir+filepath.Base(rsrcFile)+"."+common.Int64ToString(time.Now().Unix()))
+				err = srcFshAbs.Rename(rsrcFile, trashDir+filepath.Base(rsrcFile)+"."+common.Int64ToString(time.Now().Unix()))
+				if err != nil {
+					if srcFsh.RequireBuffer {
+						common.SendErrorResponse(w, "Incompatible File System Type: Try SHIFT + DELETE to delete file permanently")
+					} else {
+						common.SendErrorResponse(w, "Failed to move file to trash")
+					}
+					return
+				}
 			} else if operation == "unzip" {
 				//Unzip the file to destination
 

+ 6 - 2
web/SystemAO/file_system/file_explorer.html

@@ -829,12 +829,16 @@
 
                 </div>
                 <div class="popupbuttons whiteTheme allowHover" style="color: #2bbbdf !important;" onclick="deleteFile(true);";>
-                <i class="recycle icon"></i> <span locale="opr/remove/confirm">Move to Trash</span>
+                    <i class="recycle icon"></i> <span locale="opr/remove/confirm">Move to Trash</span>
+                </div>
+                <div class="popupbuttons whiteTheme allowHover" style="background-color: #ff7a7a !important;" onclick="hideAllPopupWindows(); forceDelete();">
+                    <i class="trash icon"></i> <span locale="opr/per-remove/title">Delete Permanently</span>
                 </div>
                 <div class="popupbuttons whiteTheme allowHover" onclick="cancelDelete();hideAllPopupWindows();">
                     <i class="remove icon"></i> <span locale="opr/remove/cancel">Cancel</span>
                 </div>
-
+                
+              
             </div>
         </div>
 

+ 6 - 0
web/SystemAO/locale/file_explorer.json

@@ -158,6 +158,8 @@
                 "message/Preference value too long. Preference value can only store maximum 1024 characters.":"設定值太長。設定值只能夠少於 1024 字元",
                 "message/User not logged in":"使用者未登入",
                 "message/Folder not exists":"找不到資料夾",
+                "message/Failed to move file to trash":"無法移動到資源回收箱",
+                "message/Incompatible File System Type: Try SHIFT + DELETE to delete file permanently":"檔案系統不支援檔案回收:請使用 SHIFT + DELETE 以永久移除檔案",
 
                 "message/noMatchResults":"找不到匹配的檔案",
                 "message/noMatchResultsDesc":"伺服器找不到與此關鍵字匹配的檔案",
@@ -364,6 +366,8 @@
                 "message/Preference value too long. Preference value can only store maximum 1024 characters.":"設定值太長。設定值只能夠少於 1024 字元",
                 "message/User not logged in":"使用者未登入",
                 "message/Folder not exists":"找不到資料夾",
+                "message/Failed to move file to trash":"無法移動到資源回收箱",
+                "message/Incompatible File System Type: Try SHIFT + DELETE to delete file permanently":"檔案系統不支援檔案回收:請使用 SHIFT + DELETE 以永久移除檔案",
 
                 "message/noMatchResults":"找不到匹配的檔案",
                 "message/noMatchResultsDesc":"伺服器找不到與此關鍵字匹配的檔案",
@@ -567,6 +571,8 @@
                 "message/Preference value too long. Preference value can only store maximum 1024 characters.":"设定值太长。设定值只能够少于 1024 字元",
                 "message/User not logged in":"使用者未登入",
                 "message/Folder not exists":"找不到资料夹", 
+                "message/Failed to move file to trash":"无法移动到资源回收箱",
+                "message/Incompatible File System Type: Try SHIFT + DELETE to delete file permanently":"档案系统不支援文件回收:请使用 SHIFT + DELETE 以永久移除文件",
 
                 "message/noMatchResults":"找不到匹配的文件",
                 "message/noMatchResultsDesc":"伺服器找不到与此关键字匹配的文件",