mirror of
https://github.com/unraid/webgui.git
synced 2026-05-03 00:09:27 -05:00
feat: add flashbackup functions to Update.page
This commit is contained in:
@@ -133,4 +133,37 @@ function diagnostics(file) {
|
||||
}
|
||||
});
|
||||
}
|
||||
function cleanUpFlashBackup(zip) {
|
||||
if (document.hasFocus()) {
|
||||
$('div.spinner').hide('slow');
|
||||
$.post('/webGui/include/Download.php', {
|
||||
cmd: 'unlink',
|
||||
file: zip,
|
||||
});
|
||||
} else {
|
||||
setTimeout(function() {
|
||||
cleanUpFlashBackup(zip);
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
function flashBackup() {
|
||||
$('div.spinner').show('slow');
|
||||
$.post('/webGui/include/Download.php', { cmd: 'backup' }, function(zip) {
|
||||
if (zip) {
|
||||
location = '/'+zip;
|
||||
setTimeout(function() {
|
||||
cleanUpFlashBackup(zip);
|
||||
}, 6000);
|
||||
} else {
|
||||
$('div.spinner').hide('slow');
|
||||
swal({
|
||||
title: "_(Creation error)_",
|
||||
text: "_(Insufficient free disk space available)_",
|
||||
type: 'error',
|
||||
html: true,
|
||||
confirmButtonText: "_(Ok)_",
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user