mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
Backup dialog
This commit is contained in:
parent
9868ae47e5
commit
8a75897e20
2 changed files with 51 additions and 4 deletions
|
|
@ -223,6 +223,11 @@ pre.uci-changes del {
|
|||
float: none;
|
||||
}
|
||||
|
||||
.input-error {
|
||||
border-color: #cf0000 !important;
|
||||
box-shadow: 0 0 5px rgba(207, 0, 0, 0.4) !important;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
body {
|
||||
font-size: 13px;
|
||||
|
|
|
|||
|
|
@ -209,10 +209,52 @@ L.ui.view.extend({
|
|||
},
|
||||
|
||||
handleBackupDownload: function() {
|
||||
var form = $('#btn_backup').parent();
|
||||
|
||||
form.find('[name=sessionid]').val(L.globals.sid);
|
||||
form.submit();
|
||||
L.ui.dialog(
|
||||
L.tr('Save configuration to computer'), [
|
||||
$('<label/>').text(L.tr("Please add a comment describing this configuration") + ": "),
|
||||
$('<textarea>')
|
||||
.addClass('form-control')
|
||||
.attr("name", "comment")
|
||||
.attr("placeholder", L.tr("Comments..")),
|
||||
$('<label/>')
|
||||
.text(L.tr("Create a password to protect your configuration: ")),
|
||||
$('<br/>'),
|
||||
$('<label/>')
|
||||
.text(L.tr("New password") + ": "),
|
||||
$("<input/>")
|
||||
.addClass("form-control")
|
||||
.attr("type", "password")
|
||||
.attr("id", "backup_password"),
|
||||
$('<label/>')
|
||||
.text(L.tr("Re-type password") + ": "),
|
||||
$("<input/>")
|
||||
.addClass("form-control")
|
||||
.attr("type", "password")
|
||||
.attr("id", "backup_password_repeat"),
|
||||
], {
|
||||
style: 'confirm',
|
||||
confirm: function() {
|
||||
var form = $('#btn_backup').parent();
|
||||
var password = $('#backup_password').val();
|
||||
var password2 = $('#backup_password_repeat').val();
|
||||
|
||||
if(password != password2){
|
||||
$("#backup_password").addClass("input-error");
|
||||
$("#backup_password_repeat").addClass("input-error");
|
||||
return 1;
|
||||
} else {
|
||||
$("#backup_password").removeClass("input-error");
|
||||
$("#backup_password_repeat").removeClass("input-error");
|
||||
}
|
||||
|
||||
form.find('[name=sessionid]').val(L.globals.sid);
|
||||
form.find('[name=password]').val(password);
|
||||
form.find('[name=password2]').val(password2);
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
},
|
||||
|
||||
handleReset: function() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue