Commit 81d149ae authored by Efthymia Bika's avatar Efthymia Bika
Browse files

Disable button when backup is running

parent 0cb95309
......@@ -121,14 +121,20 @@
}
}
function check_fields(restore) {
if(!restore) {
return(check_directory("directory")
&& check_cloud()
&& check_backup_name()
&& check_passphrase());
function disable_buttons(disable) {
$("#backup_button").attr("disabled", disable);
if(disable) {
$("#backup_button").attr("onclick", "");
} else {
$("#backup_button").attr("onclick", "if(check_fields()) backup(false);");
}
return check_directory("res-directory");
}
function check_fields() {
return(check_directory("directory")
&& check_cloud()
&& check_backup_name()
&& check_passphrase());
}
function go_to_restore() {
......@@ -272,12 +278,12 @@
<div class="clearfix">
<div class="small-6 columns">
<a id="backup_button" class="button radius left small"
onclick="if(check_fields(false)) backup(false);">
onclick="if(check_fields()) backup(false);">
<i class="fa fa-cloud-upload"></i>&nbsp;Backup Now</a>
</div>
<div class="small-6 columns">
<a id="save_button" class="button radius right small success"
onclick="if(check_fields(false)) save_backup_set();">
onclick="if(check_fields()) save_backup_set();">
<i class="fa fa-floppy-o"></i>&nbsp;Save</a>
</div>
<div class="small-3 columns">
......
......@@ -7,6 +7,7 @@ function backup(restore) {
save_backup_set();
disable_form(true);
disable_actions(false);
disable_buttons(true);
}
run_duplicity(restore);
}
......@@ -156,6 +157,7 @@ function run_duplicity(restore) {
}
}
}
disable_buttons(false);
write_conf_file(BACKUP_CONF_FILE, backups);
$("#loader").hide();
}
......
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