Show analyze disk button if no disk data is available yet

This commit is contained in:
Johannes Zellner
2022-10-13 02:19:38 +02:00
parent 9534bfa9d5
commit d898c16ceb
2 changed files with 11 additions and 1 deletions

View File

@@ -57,7 +57,12 @@
<div class="card">
<div class="row" ng-show="disks.busy">
<div class="col-md-12 text-center">
<h2><i class="fa fa-circle-notch fa-spin"></i></h2>
<h2 style="margin: 60px 0;"><i class="fa fa-circle-notch fa-spin"></i></h2>
</div>
</div>
<div class="row" ng-show="!disks.busy && !disks.ts">
<div class="col-md-12 text-center">
<button class="btn btn-primary" style="margin: 60px 0;" ng-click="disks.refresh()" ng-disabled="disks.busyRefresh"><i class="fas fa-sync-alt fa-spin" ng-show="disks.busyRefresh"></i> Analyze Disk</button>
</div>
</div>
<div ng-hide="disks.busy" class="ng-hide">

View File

@@ -38,6 +38,11 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
Client.diskUsage(function (error, result) {
if (error) return console.error('Failed to refresh disk usage.', error);
if (!result.usage) {
$scope.disks.busy = false;
return;
}
$scope.disks.ts = result.usage.ts;
// [ { filesystem, type, size, used, available, capacity, mountpoint }]