Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
baas
Commits
1cf8bfc0
Commit
1cf8bfc0
authored
Nov 10, 2015
by
Efthymia Bika
Browse files
Change backups map key
Now key form is Cloud/Backup Name
parent
a69a9b14
Changes
5
Hide whitespace changes
Inline
Side-by-side
baas/activity.html
View file @
1cf8bfc0
...
...
@@ -51,11 +51,11 @@
var
li
=
$
(
"
<li></li>
"
)
.
attr
(
"
class
"
,
"
clearfix backup-box
"
)
.
attr
(
"
id
"
,
"
box_
"
+
backup
.
name
);
var
a
=
$
(
"
<a>
"
+
backup
.
name
+
"
</a>
"
)
var
a
=
$
(
"
<a>
"
+
backup
.
cloud
+
"
/
"
+
backup
.
name
+
"
</a>
"
)
.
attr
(
"
href
"
,
"
#
"
)
.
attr
(
"
id
"
,
"
box_a_
"
+
backup
.
name
)
.
attr
(
"
class
"
,
"
left
"
)
.
attr
(
"
onclick
"
,
"
go_to_backup('
"
+
backup
.
name
+
"
')
"
);
.
attr
(
"
onclick
"
,
"
go_to_backup('
"
+
backup
.
cloud
+
"
/
"
+
backup
.
name
+
"
')
"
);
li
.
append
(
a
);
...
...
@@ -63,7 +63,7 @@
.
attr
(
"
href
"
,
"
#
"
)
.
attr
(
"
class
"
,
"
right
"
)
.
click
(
function
()
{
if
(
confirm
(
"
Are you sure you want to delete
"
+
backup
.
name
+
'
?
'
+
if
(
confirm
(
"
Are you sure you want to delete
"
+
backup
.
cloud
+
"
/
"
+
backup
.
name
+
'
?
'
+
"
\n
NOTE: To actually remove backup sets from remote
"
+
"
container you have to manually purge it.
"
))
{
delete_backup
(
backup
);
...
...
baas/backup-list.html
View file @
1cf8bfc0
...
...
@@ -10,14 +10,9 @@
populate_clouds
(
""
);
}
if
(
typeof
selected_backup
!=
'
undefined
'
)
{
$
.
each
(
backups
,
function
(
i
,
backup
)
{
if
(
backup
.
name
==
selected_backup
)
{
$
(
"
#selected-bar
"
).
html
(
backup
.
name
);
$
(
"
#selected-bar
"
).
show
();
load_backup
(
backup
);
return
;
}
});
$
(
"
#selected-bar
"
).
html
(
selected_backup
);
$
(
"
#selected-bar
"
).
show
();
load_backup
(
backups
[
selected_backup
]);
}
else
{
$
(
"
#selected-bar
"
).
hide
();
load_backup
();
...
...
baas/backup.js
View file @
1cf8bfc0
...
...
@@ -104,11 +104,11 @@ function save_backup_set() {
container
=
backup_set
.
container
;
backup_set
.
exclude
=
exclude
;
backup_set
.
include
=
include
;
if
(
typeof
backups
[
backup_name
]
!=
'
undefined
'
&&
typeof
backups
[
backup_name
].
first_backup
!=
'
undefined
'
)
{
backup_set
.
first_backup
=
backups
[
backup_name
].
first_backup
;
if
(
typeof
backups
[
cloud
+
"
/
"
+
backup_name
]
!=
'
undefined
'
&&
typeof
backups
[
cloud
+
"
/
"
+
backup_name
].
first_backup
!=
'
undefined
'
)
{
backup_set
.
first_backup
=
backups
[
cloud
+
"
/
"
+
backup_name
].
first_backup
;
}
backups
[
backup_name
]
=
backup_set
;
backups
[
cloud
+
"
/
"
+
backup_name
]
=
backup_set
;
render_backup_sets
(
""
);
write_conf_file
(
BACKUP_CONF_FILE
,
backups
);
...
...
@@ -117,7 +117,7 @@ function save_backup_set() {
}
function
delete_backup
(
backup
)
{
delete
backups
[
backup
.
name
];
delete
backups
[
backup
.
cloud
+
"
/
"
+
backup
.
name
];
render_backup_sets
(
""
);
write_conf_file
(
BACKUP_CONF_FILE
,
backups
);
$
(
"
.tabs
"
).
hide
();
...
...
@@ -126,8 +126,10 @@ function delete_backup(backup) {
function
write_first_backup
()
{
var
backup_name
=
$
(
"
#backup-name
"
).
val
().
replace
(
/^
\s
+|
\s
+$/gm
,
''
);
var
cloud
=
$
(
"
#cloud
"
).
val
();
var
first_backup
=
null
;
backups
[
backup_name
].
first_backup
=
new
Date
();
backups
[
cloud
+
"
/
"
+
backup_name
].
first_backup
=
new
Date
();
write_conf_file
(
BACKUP_CONF_FILE
,
backups
);
}
baas/dup_calls.js
View file @
1cf8bfc0
...
...
@@ -125,6 +125,13 @@ function run_duplicity(restore) {
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
+
"
'
"
;
...
...
@@ -154,7 +161,7 @@ function run_duplicity(restore) {
$
(
"
#msg
"
).
html
(
""
);
$
(
"
#msg
"
).
removeClass
(
"
panel
"
);
if
(
!
restore
&&
typeof
backups
[
selected_backup
].
first_backup
==
'
undefined
'
)
{
typeof
backups
[
cloud
+
"
/
"
+
selected_backup
].
first_backup
==
'
undefined
'
)
{
write_first_backup
();
}
}
...
...
@@ -180,7 +187,7 @@ function run_duplicity(restore) {
$
(
"
#msg
"
).
html
(
""
);
$
(
"
#msg
"
).
removeClass
(
"
panel
"
);
if
(
!
restore
&&
typeof
backups
[
container_name
].
first_backup
==
'
undefined
'
)
{
typeof
backups
[
cloud
+
"
/
"
+
container_name
].
first_backup
==
'
undefined
'
)
{
write_first_backup
();
}
}
...
...
baas/restore.html
View file @
1cf8bfc0
...
...
@@ -13,7 +13,7 @@
hide_error_divs
();
function
load_field_values
()
{
$
(
"
#res-backup-name
"
).
val
(
selected_backup
);
$
(
"
#res-backup-name
"
).
val
(
backups
[
selected_backup
].
name
);
$
(
"
#res-cloud
"
).
val
(
backups
[
selected_backup
].
cloud
);
$
(
"
#res-passphrase
"
).
val
(
backups
[
selected_backup
].
passphrase
);
if
(
typeof
g_res_directory
!=
'
undefined
'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment