Avoid shoing empty disk usage entries for uninstalled apps

This commit is contained in:
Johannes Zellner
2022-10-14 12:31:45 +02:00
parent 5b24cdaf77
commit ac446d5bd5
3 changed files with 10 additions and 3 deletions

View File

@@ -941,7 +941,8 @@
"usageInfo": "{{ available | prettyDiskSize }}</b> of <b>{{ size | prettyDiskSize }}</b> available",
"diskContent": "This {{ type }} disk contains",
"notAvailableYet": "Not available yet",
"usedInfo": "{{ used }} used of {{ size }}"
"usedInfo": "{{ used }} used of {{ size }}",
"uninstalledApp": "Uninstalled app"
},
"systemMemory": {
"title": "System Memory",

View File

@@ -82,7 +82,10 @@
<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 === 'standard'">{{ content.label || content.id }}</span>
<span ng-show="content.type === 'app'"><a href="https://{{ content.app.fqdn }}" target="_blank">{{ content.app.label || content.app.fqdn }}</a></span>
<span ng-show="content.type === 'app'">
<a href="https://{{ content.app.fqdn }}" target="_blank" ng-hide="content.uninstalled">{{ content.app.label || content.app.fqdn }}</a>
<span ng-show="content.uninstalled">{{ 'system.diskUsage.uninstalledApp' | tr }}</span>
</span>
<span ng-show="content.type === 'volume'"><a href="/#/volumes">{{ content.volume.name }}</a></span>
<small class="text-muted">{{ content.usage | prettyDiskSize }}</small>
</div>

View File

@@ -82,7 +82,10 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
disk.contents.forEach(function (content) {
content.color = getNextColor();
if (content.type === 'app') content.app = Client.getInstalledAppsByAppId()[content.id];
if (content.type === 'app') {
content.app = Client.getInstalledAppsByAppId()[content.id];
if (!content.app) content.uninstalled = true;
}
if (content.type === 'volume') content.volume = $scope.volumesById[content.id];
usageOther -= content.usage;