graphs: show old backup size and location if > 1GB

This commit is contained in:
Girish Ramakrishnan
2023-08-01 18:35:11 +05:30
parent 0722692210
commit e65c1fb718
4 changed files with 9 additions and 2 deletions
+1
View File
@@ -84,6 +84,7 @@
<p ng-show="disk.volume" ng-bind-html="'system.diskUsage.volumeContent' | tr:{ name: disk.volume.name }"></p>
<div ng-repeat="content in disk.contents" class="disk-content">
<span class="color-indicator" style="background-color: {{ content.color }};">&nbsp;</span>
<span ng-show="content.type === 'cloudron-backup-default'">{{ content.path }} (Old Backups)</span>
<span ng-show="content.type === 'standard'">{{ content.label || content.id }}</span>
<span ng-show="content.type === 'swap'">{{ content.id }}</span>
<span ng-show="content.type === 'app'">
+5 -1
View File
@@ -85,14 +85,18 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
disk.contents.forEach(function (content) { if (content.path === disk.mountpoint) disk.volume = $scope.volumesById[content.id]; });
disk.contents = disk.contents.filter(function (content) { return content.path !== disk.mountpoint; });
// only show old backups if the size is significant
disk.contents = disk.contents.filter(function (content) { return content.id !== 'cloudron-backup-default' || content.usage > 1024*1024*1024; });
disk.contents.forEach(function (content) {
content.color = getNextColor();
if (content.type === 'app') {
content.app = Client.getInstalledAppsByAppId()[content.id];
if (!content.app) content.uninstalled = true;
} else if (content.type === 'volume') {
content.volume = $scope.volumesById[content.id];
}
if (content.type === 'volume') content.volume = $scope.volumesById[content.id];
usageOther -= content.usage;
});