archive: download the config
This commit is contained in:
@@ -501,7 +501,7 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat
|
||||
document.body.removeChild(element);
|
||||
}
|
||||
|
||||
$scope.downloadConfig = function (backup) { // can also be a archive object
|
||||
$scope.downloadConfig = function (backup, isArchive) { // can also be a archive object
|
||||
// secrets and tokens already come with placeholder characters we remove them
|
||||
var tmp = {
|
||||
remotePath: backup.remotePath,
|
||||
@@ -512,7 +512,13 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat
|
||||
if ($scope.backupConfig[k] !== SECRET_PLACEHOLDER) tmp[k] = $scope.backupConfig[k];
|
||||
});
|
||||
|
||||
var filename = 'cloudron-backup-config-' + (new Date()).toISOString().replace(/:|T/g,'-').replace(/\..*/,'') + ' (' + $scope.config.adminFqdn + ')' + '.json';
|
||||
let filename;
|
||||
if (isArchive) {
|
||||
filename = `${backup.appConfig.fqdn}-archive-config-${(new Date(backup.creationTime)).toISOString().split('T')[0]}.json`;
|
||||
} else {
|
||||
filename = `${$scope.config.adminFqdn}-backup-config-${(new Date(backup.creationTime)).toISOString().split('T')[0]}.json`;
|
||||
}
|
||||
|
||||
download(filename, JSON.stringify(tmp, null, 4));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user