|
@@ -59,6 +59,12 @@
|
|
overflow-y: scroll;
|
|
overflow-y: scroll;
|
|
padding-right: 4px;
|
|
padding-right: 4px;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ #snapshotList{
|
|
|
|
+ max-height: 300px;
|
|
|
|
+ overflow-y: scroll;
|
|
|
|
+ padding-right: 4px;
|
|
|
|
+ }
|
|
|
|
|
|
.timeleft{
|
|
.timeleft{
|
|
width: 30px;
|
|
width: 30px;
|
|
@@ -120,14 +126,22 @@
|
|
<i class="icon remove"></i>
|
|
<i class="icon remove"></i>
|
|
</button>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div id="snapshotList" class="ui middle aligned divided list">
|
|
|
|
+ <div class="item">
|
|
|
|
+ <img class="ui mini image nointeract" src="../../img/system/drive-backup.svg">
|
|
|
|
+ <div class="content">
|
|
|
|
+ No Restorable Snapshot(s) for this virtual disk.
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<div id="restorableList" class="ui middle aligned divided list">
|
|
<div id="restorableList" class="ui middle aligned divided list">
|
|
<div class="item">
|
|
<div class="item">
|
|
- <img class="ui mini image nointeract" src="../../img/system/file-notfound.svg">
|
|
|
|
- <div class="content">
|
|
|
|
|
|
+ <img class="ui mini image nointeract" src="../../img/system/file-notfound.svg">
|
|
|
|
+ <div class="content">
|
|
No Restorable File(s) for this virtual disk.
|
|
No Restorable File(s) for this virtual disk.
|
|
- </div>
|
|
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
+ </div>
|
|
<div class="ui checkbox">
|
|
<div class="ui checkbox">
|
|
<input type="checkbox" name="showhidden" autocomplete="false" onchange="toggleHiddenFiles(this.checked);">
|
|
<input type="checkbox" name="showhidden" autocomplete="false" onchange="toggleHiddenFiles(this.checked);">
|
|
<label>Show hidden / cache files</label>
|
|
<label>Show hidden / cache files</label>
|
|
@@ -164,7 +178,12 @@
|
|
filedata = JSON.parse(decodeURIComponent(filedata));
|
|
filedata = JSON.parse(decodeURIComponent(filedata));
|
|
console.log(filedata);
|
|
console.log(filedata);
|
|
//Show information on page
|
|
//Show information on page
|
|
- $("#fileinfo").find(".filename").text(filedata.Filename + ` (${ao_module_utils.formatBytes(filedata.Filesize, 2)})`);
|
|
|
|
|
|
+ if (filedata.IsSnapshot){
|
|
|
|
+ $("#fileinfo").find(".filename").text("Snapshot " + filedata.Filename);
|
|
|
|
+ }else{
|
|
|
|
+ $("#fileinfo").find(".filename").text(filedata.Filename + ` (${ao_module_utils.formatBytes(filedata.Filesize, 2)})`);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
//Hide the filename in relpath
|
|
//Hide the filename in relpath
|
|
var shortenRelpath = filedata.RelpathOnDisk.split("/");
|
|
var shortenRelpath = filedata.RelpathOnDisk.split("/");
|
|
@@ -176,6 +195,14 @@
|
|
$("#fileinfo").find(".restorePoint").html('<i class="ui refresh icon"></i> Restore to ' + (filedata.RestorePoint));
|
|
$("#fileinfo").find(".restorePoint").html('<i class="ui refresh icon"></i> Restore to ' + (filedata.RestorePoint));
|
|
$("#fileinfo").find(".deleteRemainingTime").html('<i class="ui red remove icon"></i> Auto delete in '+ secondsToHms(filedata.RemainingTime));
|
|
$("#fileinfo").find(".deleteRemainingTime").html('<i class="ui red remove icon"></i> Auto delete in '+ secondsToHms(filedata.RemainingTime));
|
|
|
|
|
|
|
|
+ if (filedata.IsSnapshot){
|
|
|
|
+ $("#fileinfo").find(".deleteRemainingTime").hide();
|
|
|
|
+ $("#fileinfo").find(".deleteTime").hide();
|
|
|
|
+ }else{
|
|
|
|
+ $("#fileinfo").find(".deleteRemainingTime").show();
|
|
|
|
+ $("#fileinfo").find(".deleteTime").show();
|
|
|
|
+ }
|
|
|
|
+
|
|
$("#fileinfo").slideDown('fast');
|
|
$("#fileinfo").slideDown('fast');
|
|
}
|
|
}
|
|
|
|
|
|
@@ -265,15 +292,49 @@
|
|
if (data.error !== undefined){
|
|
if (data.error !== undefined){
|
|
$("#error").find(".reason").texxt(data.error);
|
|
$("#error").find(".reason").texxt(data.error);
|
|
}else{
|
|
}else{
|
|
-
|
|
|
|
- //Sort the result by latest first
|
|
|
|
- data.RestorableFiles.sort(function(a, b) {
|
|
|
|
|
|
+
|
|
|
|
+ //Filter out the restorable snapshot and files
|
|
|
|
+ let restorableFiles = [];
|
|
|
|
+ let restorableSnapshots = [];
|
|
|
|
+
|
|
|
|
+ data.RestorableFiles.forEach(file => {
|
|
|
|
+ if (file.IsSnapshot){
|
|
|
|
+ restorableSnapshots.push(file);
|
|
|
|
+ }else{
|
|
|
|
+ restorableFiles.push(file);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ //Sort the result by latest first (file only)
|
|
|
|
+ restorableFiles.sort(function(a, b) {
|
|
return b.DeleteTime - a.DeleteTime;
|
|
return b.DeleteTime - a.DeleteTime;
|
|
});
|
|
});
|
|
|
|
+ restorableSnapshots.sort(function(a, b) {
|
|
|
|
+ return b.Filename > a.Filename;
|
|
|
|
+ });
|
|
|
|
|
|
- //Display the result
|
|
|
|
|
|
+ //Display the reuslt for restorableSnapshot
|
|
|
|
+ $("#snapshotList").html("");
|
|
|
|
+ restorableSnapshots.forEach(snapshot => {
|
|
|
|
+ let snapshotData = encodeURIComponent(JSON.stringify(snapshot));
|
|
|
|
+ $("#snapshotList").append(`<div class="item restorableFile" filedata="${snapshotData}">
|
|
|
|
+ <div class="right floated content">
|
|
|
|
+ <div class="ui tiny button" onclick="showFileInfo(this.parentNode.parentNode)">Info</div>
|
|
|
|
+ <div class="ui tiny green button" onclick="restoreThisFile($(this).parent().parent());">Restore</div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="content">
|
|
|
|
+ <p style="word-break: break-all; font-size: 97%"><img class="ui mini spaced image nointeract" src="../../img/system/drive-backup.svg">
|
|
|
|
+ Snapshot ${snapshot.Filename}
|
|
|
|
+ </p>
|
|
|
|
+ </div>
|
|
|
|
+ </div>`);
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ //Display the result for restorableFile
|
|
$("#restorableList").html("");
|
|
$("#restorableList").html("");
|
|
- data.RestorableFiles.forEach(fileObject => {
|
|
|
|
|
|
+ restorableFiles.forEach(fileObject => {
|
|
let thisFileData = encodeURIComponent(JSON.stringify(fileObject));
|
|
let thisFileData = encodeURIComponent(JSON.stringify(fileObject));
|
|
|
|
|
|
var timerIcon = "100.svg";
|
|
var timerIcon = "100.svg";
|
|
@@ -321,7 +382,7 @@
|
|
</div>`);
|
|
</div>`);
|
|
});
|
|
});
|
|
|
|
|
|
- if (data.RestorableFiles.length == 0){
|
|
|
|
|
|
+ if (restorableFiles.length == 0){
|
|
$("#restorableList").html(`<div class="item">
|
|
$("#restorableList").html(`<div class="item">
|
|
<img class="ui mini image nointeract" src="../../img/system/file-notfound.svg">
|
|
<img class="ui mini image nointeract" src="../../img/system/file-notfound.svg">
|
|
<div class="content">
|
|
<div class="content">
|
|
@@ -330,10 +391,12 @@
|
|
</div>`);
|
|
</div>`);
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- $(".hiddenfile").hide();
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $(".hiddenfile").hide();
|
|
}
|
|
}
|
|
|
|
+
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|