Commit f907eb30 authored by Efthymia Bika's avatar Efthymia Bika
Browse files

Name must start with Backup_

parent 071db3c7
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
var errors = { var errors = {
backup_name_empty: 'Provide a Backup Name', backup_name_empty: 'Provide a Backup Name',
backup_name_illegal: 'Invalid Entry. Allowed characters [A-Za-z0-9-_]', backup_name_illegal: 'Invalid Entry. Name must start with '
+ '\'Backup_\' and followed by characters [A-Za-z0-9-_]',
cloud_empty: 'Select cloud configuration', cloud_empty: 'Select cloud configuration',
dir_not_chosen : 'Provide a local directory', dir_not_chosen : 'Provide a local directory',
res_file_illegal: 'Invalid Entry. Provide a valid file name', res_file_illegal: 'Invalid Entry. Provide a valid file name',
...@@ -89,7 +90,7 @@ ...@@ -89,7 +90,7 @@
$('#backup-name-error small').show(); $('#backup-name-error small').show();
return false; return false;
} else { } else {
var pattern = /^[\w.\-]+$/; var pattern = /^Backup_[\w.\-]+$/;
if(!backup_name.match(pattern)) { if(!backup_name.match(pattern)) {
$('#backup-name-error small').text(errors.backup_name_illegal); $('#backup-name-error small').text(errors.backup_name_illegal);
$('#backup-name-error small').show(); $('#backup-name-error small').show();
...@@ -272,7 +273,9 @@ ...@@ -272,7 +273,9 @@
</div> </div>
<div class="small-9 columns error" id="backup-name-error"> <div class="small-9 columns error" id="backup-name-error">
<input type="text" id="backup-name" <input type="text" id="backup-name"
placeholder="Backup Name [A-Za-z0-9-_]" onchange="check_backup_name();"> placeholder="Backup_[A-Za-z0-9-_]"
value="Backup_"
onchange="check_backup_name();">
<small class="error"></small> <small class="error"></small>
</div> </div>
</div> </div>
......
...@@ -42,7 +42,7 @@ function load_backup(backup) { ...@@ -42,7 +42,7 @@ function load_backup(backup) {
$("#include").val(backup.include); $("#include").val(backup.include);
} else { } else {
container = ""; container = "";
$("#backup-name").val(''); $("#backup-name").val('Backup_');
$("#directory").html(''); $("#directory").html('');
$("#res-directory").html(''); $("#res-directory").html('');
$("#cloud").val(''); $("#cloud").val('');
...@@ -85,7 +85,7 @@ function save_backup_set() { ...@@ -85,7 +85,7 @@ function save_backup_set() {
backup_set.local_dir = directory; backup_set.local_dir = directory;
backup_set.cloud = cloud; backup_set.cloud = cloud;
backup_set.passphrase = passphrase; backup_set.passphrase = passphrase;
backup_set.container = "Backup_" + backup_name; backup_set.container = backup_name;
container = backup_set.container; container = backup_set.container;
backup_set.exclude = exclude; backup_set.exclude = exclude;
backup_set.include = include; backup_set.include = include;
......
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