Bladeren bron

Added Restore All button

TC pushbot 5 4 jaren geleden
bovenliggende
commit
abbffd7f59
2 gewijzigde bestanden met toevoegingen van 14 en 2 verwijderingen
  1. 2 1
      backup.go
  2. 12 1
      web/SystemAO/disk/disk_restore.html

+ 2 - 1
backup.go

@@ -142,7 +142,8 @@ func backup_listRestorable(w http.ResponseWriter, r *http.Request) {
 	}
 
 	result := hybridBackup.RestorableReport{
-		ParentUID: restorableReport.ParentUID,
+		ParentUID:       restorableReport.ParentUID,
+		RestorableFiles: []*hybridBackup.RestorableFile{},
 	}
 
 	if paretnfsh.Hierarchy == "user" {

+ 12 - 1
web/SystemAO/disk/disk_restore.html

@@ -134,6 +134,7 @@
         </div>
         <div class="ui divider" style="margin-top: 8px; margin-bottom: 8px;"></div>
         <br>
+            <div class="ui tiny green button" onclick="restoreAll();">Restore All</div>
            <button class="ui right floated button" onclick="ao_module_close();">Close</button>
         <br>
     </div>
@@ -238,7 +239,7 @@
                             $("#openfolder").show();
                         }
 
-                        $("#succ").slideDown('fast').delay(10000).slideUp('fast');
+                        $("#succ").finish().stop().slideDown('fast').delay(10000).slideUp('fast');
                         listRestorableFiles(vrootID[0]);
                     }
                    
@@ -264,6 +265,7 @@
                     if (data.error !== undefined){
                         $("#error").find(".reason").texxt(data.error);
                     }else{
+                      
                         //Sort the result by latest first
                         data.RestorableFiles.sort(function(a, b) {
                             return b.DeleteTime - a.DeleteTime;
@@ -334,6 +336,15 @@
                 }
             })
         }
+
+        function restoreAll(){
+            if (confirm("Confirm restore all files from backup?")){
+                $(".restorableFile").each(function(){
+                    //Restore this file
+                    restoreThisFile($(this));
+                });
+            }
+        }
     </script>
 </body>
 </html>