backups: deleted apps must also be displayed in contents

This commit is contained in:
Girish Ramakrishnan
2024-03-14 16:06:38 +01:00
parent 771b797a23
commit 49941a34b9
3 changed files with 19 additions and 7 deletions
+14 -5
View File
@@ -783,14 +783,23 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat
});
$scope.backups.forEach(function (backup) {
backup.contents = [];
backup.contents = []; // { id, label, fqdn }
backup.dependsOn.forEach(function (appBackupId) {
let match = appBackupId.match(/app_(.*?)_.*/); // *? means non-greedy
if (!match) return;
if (match[1].indexOf('.') !== -1) { // newer backups have fqdn in them
if (appsByFqdn[match[1]]) backup.contents.push(appsByFqdn[match[1]]);
if (!match) return; // for example, 'mail'
const app = appsById[match[1]];
if (app) {
backup.contents.push({
id: app.id,
label: app.label,
fqdn: app.fqdn
});
} else {
if (appsById[match[1]]) backup.contents.push(appsById[match[1]]);
backup.contents.push({
id: match[1],
label: null,
fqdn: null
});
}
});
});