Commit 778f776d authored by Efthymia Bika's avatar Efthymia Bika
Browse files

Add status field to backup set

Display status on activity page
parent 936a7056
......@@ -80,11 +80,26 @@
var last_p = $("<span>Last : " + last + " </span>");
li.append(last_p);
}
if(typeof backup.last_status != 'undefined') {
li.append("<br>");
li.append("<br>");
var status_p = $("<span>Status : " + backup.last_status + " </span>");
li.append(status_p);
var loader = $("<i></i>")
.attr("class", "fa fa-spinner fa-pulse");
li.append(loader);
if(backup.last_status != "Running") {
loader.hide();
}
}
ul.append(li);
$("#backup-table").append(ul);
});
}
window.setInterval(function() {
render_backup_sets("");
}, 3000);
</script>
</head>
......
......@@ -48,6 +48,23 @@ function build_win_commands() {
function run_duplicity(restore) {
var container_name = "";
if(restore) {
container_name = $("#res-backup-name").val();
} else {
container_name = $("#backup-name").val();
}
var cloud = "";
if(restore) {
cloud = $("#res-cloud").val();
} else {
cloud = $("#cloud").val();
}
backups[cloud + "/" + container_name].last_status = "Running";
write_conf_file(BACKUP_CONF_FILE, backups);
var file_arg = "";
if(restore) {
var file_to_restore = $("#res-file").val();
......@@ -118,20 +135,6 @@ function run_duplicity(restore) {
directory = $("#directory").html();
}
var container_name = "";
if(restore) {
container_name = $("#res-backup-name").val();
} else {
container_name = $("#backup-name").val();
}
var cloud = "";
if(restore) {
cloud = $("#res-cloud").val();
} else {
cloud = $("#cloud").val();
}
var log_file = path.join(BAAS_LOG_DIR, "dup_" + new Date().toISOString() + ".log");
var log_arg = " --log-file '" + log_file + "' ";
......@@ -141,9 +144,11 @@ function run_duplicity(restore) {
$("#msg").addClass("panel");
disable_form(false);
disable_actions(true);
backups[cloud + "/" + container_name].last_status = "Fail";
} else {
$("#msg").html("");
$("#msg").removeClass("panel");
backups[cloud + "/" + container_name].last_status = "Success";
if(!restore) {
backups[cloud + "/" + container_name].last_backup = new Date();
if(typeof backups[cloud + "/" + container_name].first_backup == 'undefined') {
......
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