Commit 72a5b0b0 authored by Efthymia Bika's avatar Efthymia Bika
Browse files

Restore single file

parent 05e8f720
......@@ -11,7 +11,20 @@
}
});
hide_error_divs();
function load_field_values() {
if(typeof selected_backup != 'undefined') {
$("#res-backup-name").val(selected_backup);
$("#res-cloud").val(backups[selected_backup].cloud);
$("#res-passphrase").val(backups[selected_backup].passphrase);
$("#res-directory").html(g_res_directory);
$("#res-file").val(g_res_file);
$("#timestamp").val(g_timestamp);
}
}
load_field_values();
function check_res_backup_name() {
var backup_name = $('#res-backup-name').val().replace(/^\s+|\s+$/gm,'');
if(!backup_name) {
......
function go_to_restore(name) {
g_res_directory = path.join(get_user_home(), "Backups");
var time_path = $("#time-path").val();
if(time_path != "/") time_path += "/";
if(time_path.startsWith("/")) time_path = time_path.replace("/", "");
g_res_file = time_path + name;
g_timestamp = selected_date;
$("#restore-tab-link").trigger("click");
}
function show_contents_by_date(error, stdout, stderr) {
$("#time-contents").empty();
......@@ -40,20 +52,9 @@ function show_contents_by_date(error, stdout, stderr) {
$("#loader").hide();
}
function go_to_restore(name) {
$("#res-directory").html(path.join(get_user_home(), "Backups"));
var time_path = $("#time-path").val();
if(time_path != "/") time_path += "/";
if(time_path.startsWith("/")) time_path = time_path.replace("/", "");
$("#res-file").val(time_path + name);
$("#timestamp").val(selected_date);
$("#restore_details_link").trigger("click");
}
function show_rest_icon(name) {
$("#rest_icon_" + name).removeClass("hide");
$("#rest_icon_" + name).addClass("fa fa-cloud-download");
$("#rest_icon_" + name).addClass("fa fa-download");
}
var init_path = "";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment