瀏覽代碼

Fixed GUI issue on restore ui

TC pushbot 5 4 年之前
父節點
當前提交
1b9bef9002
共有 2 個文件被更改,包括 15 次插入6 次删除
  1. 0 3
      backup.go
  2. 15 3
      web/SystemAO/disk/disk_restore.html

+ 0 - 3
backup.go

@@ -2,7 +2,6 @@ package main
 
 import (
 	"encoding/json"
-	"log"
 	"net/http"
 	"path/filepath"
 
@@ -146,8 +145,6 @@ func backup_listRestorable(w http.ResponseWriter, r *http.Request) {
 		ParentUID: restorableReport.ParentUID,
 	}
 
-	log.Println(paretnfsh)
-
 	if paretnfsh.Hierarchy == "user" {
 		//The file system is user based. Filter out those file that is not belong to this user
 		for _, restorableFile := range restorableReport.RestorableFiles {

+ 15 - 3
web/SystemAO/disk/disk_restore.html

@@ -94,12 +94,12 @@
                 </div>
             </h4>
        </div>
-       <div id="succ" class="ui green inverted segment" style="display:none;">
+       <div id="succ" class="ui green segment" style="display:none;">
         <h4 class="ui header">
             <i class="checkmark icon"></i>
             <div class="content">
                 File Restored
-                <div class="sub reason header openfolder" style="color: white;"><span style="cursor: pointer" onclick="handleOpenRestoreLocation()"><i class="ui folder icon"></i> Open Restore Location</span></div>
+                <div class="sub reason header openfolder"><a style="cursor: pointer" onclick="handleOpenRestoreLocation()"><i class="ui folder open icon"></i> Open Location</a></div>
             </div>
         </h4>
        </div>
@@ -226,7 +226,6 @@
                 method: "POST",
                 data: {"bdid": filedata.BackupDiskUID, "relpath": filedata.RelpathOnDisk},
                 success: function(data){
-                    $("#succ").slideDown('fast').delay(10000).slideUp('fast');
                     if (data.error !== undefined){
                         alert("Restore failed: " + data.error);
                     }else{
@@ -238,6 +237,9 @@
                         }else{
                             $("#openfolder").show();
                         }
+
+                        $("#succ").slideDown('fast').delay(10000).slideUp('fast');
+                        listRestorableFiles(vrootID[0]);
                     }
                    
                 }
@@ -317,6 +319,16 @@
                             </div>`);
                         });
 
+                        if (data.RestorableFiles.length == 0){
+                            $("#restorableList").html(`<div class="item">
+                            <img class="ui mini image nointeract" src="../../img/system/file-notfound.svg">
+                            <div class="content">
+                                No Restorable File(s) for this virtual disk.
+                            </div>
+                            </div>`);
+
+                        }
+
                         $(".hiddenfile").hide();
                     }
                 }