archive: add button to download the config

This commit is contained in:
Girish Ramakrishnan
2024-12-11 09:50:54 +01:00
parent 65f507bc75
commit 96f2c6e2aa
3 changed files with 3 additions and 2 deletions

View File

@@ -794,6 +794,7 @@
</td>
<td class="text-right no-wrap" style="vertical-align: middle;">
<button class="btn btn-xs btn-default" ng-click="archiveRestore.show(archive)" uib-tooltip="Restore from Archive"><i class="fas fa-history"></i></button>
<button class="btn btn-xs btn-default" ng-click="downloadConfig(archive)" uib-tooltip="{{ 'backups.listing.tooltipDownloadBackupConfig' | tr }}"><i class="fas fa-file-alt"></i></button>
<button class="btn btn-xs btn-danger" ng-click="archiveDelete.ask(archive)" uib-tooltip="Delete Archive"><i class="fa fa-trash-alt"></i></button>
</td>
</tr>

View File

@@ -501,7 +501,7 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat
document.body.removeChild(element);
}
$scope.downloadConfig = function (backup) {
$scope.downloadConfig = function (backup) { // can also be a archive object
// secrets and tokens already come with placeholder characters we remove them
var tmp = {
remotePath: backup.remotePath,

View File

@@ -17,7 +17,7 @@ const assert = require('assert'),
safe = require('safetydance'),
uuid = require('uuid');
const ARCHIVE_FIELDS = [ 'archives.id', 'backupId', 'archives.creationTime', 'backups.appConfigJson', '(archives.icon IS NOT NULL) AS hasIcon', '(archives.appStoreIcon IS NOT NULL) AS hasAppStoreIcon' ];
const ARCHIVE_FIELDS = [ 'archives.id', 'backupId', 'archives.creationTime', 'backups.remotePath', 'backups.appConfigJson', '(archives.icon IS NOT NULL) AS hasIcon', '(archives.appStoreIcon IS NOT NULL) AS hasAppStoreIcon' ];
function postProcess(result) {
assert.strictEqual(typeof result, 'object');