491 [FEAT] Allow disks to be hidden/archived

- Add archived to device type & db
- Add archive/unarchive handlers to webapp backend
- Add archive toggle & styling to webapp frontend
This commit is contained in:
Sam
2025-02-21 09:23:48 +01:00
parent a58f9445c1
commit 600cd153e0
24 changed files with 390 additions and 25 deletions
@@ -1,4 +1,3 @@
<div *ngIf="summaryData; else emptyDashboard">
<div class="flex flex-col flex-auto w-full p-8 xs:p-2">
@@ -11,7 +10,15 @@
</div>
<!-- Action buttons -->
<div class="flex items-center">
<button matTooltip="not yet implemented" class="xs:hidden" mat-stroked-button>
<button class="xs:hidden" mat-stroked-button
[color]="showArchived ? 'primary' : null"
(click)="showArchived=!showArchived">
<mat-icon class="icon-size-20"
[color]="showArchived ? 'primary' : null"
[svgIcon]="'archive'"></mat-icon>
<span class="ml-2">Archived</span>
</button>
<button matTooltip="not yet implemented" class="ml-2 xs:hidden" mat-stroked-button>
<mat-icon class="icon-size-20"
[svgIcon]="'save'"></mat-icon>
<span class="ml-2">Export</span>
@@ -31,6 +38,12 @@
<mat-icon [svgIcon]="'more_vert'"></mat-icon>
</button>
<mat-menu #actionsMenu="matMenu">
<button mat-menu-item (click)="showArchived=!showArchived">
<mat-icon class="icon-size-20"
[color]="showArchived ? 'primary' : null"
[svgIcon]="'archive'"></mat-icon>
<span class="ml-2">Archived</span>
</button>
<button mat-menu-item
matTooltip="not yet implemented">
<mat-icon class="icon-size-20"
@@ -49,13 +62,16 @@
<div class="flex flex-wrap w-full" *ngFor="let hostId of hostGroups | keyvalue">
<h3 class="ml-4" *ngIf="hostId.key">{{hostId.key}}</h3>
<h3 class="ml-4" *ngIf="hostId.key">{{ hostId.key }}</h3>
<div class="flex flex-wrap w-full">
<app-dashboard-device (deviceDeleted)="onDeviceDeleted($event)"
class="flex gt-sm:w-1/2 min-w-80 p-4"
*ngFor="let deviceSummary of (deviceSummariesForHostGroup(hostId.value) | deviceSort:config.dashboard_sort:config.dashboard_display )"
[deviceWWN]="deviceSummary.device.wwn"
[deviceSummary]="deviceSummary"></app-dashboard-device>
<ng-container *ngFor="let deviceSummary of (deviceSummariesForHostGroup(hostId.value) | deviceSort:config.dashboard_sort:config.dashboard_display )">
<app-dashboard-device *ngIf="showArchived || !deviceSummary.device.archived"
(deviceArchived)="onDeviceArchived($event)"
(deviceUnarchived)="onDeviceUnarchived($event)"
(deviceDeleted)="onDeviceDeleted($event)"
class="flex gt-sm:w-1/2 min-w-80 p-4"
[deviceSummary]="deviceSummary"></app-dashboard-device>
</ng-container>
</div>
</div>
@@ -67,13 +83,13 @@
<div class="flex items-center justify-between">
<div class="flex flex-col">
<div class="font-bold text-md text-secondary uppercase tracking-wider mr-4">Temperature</div>
<div class="text-sm text-hint font-medium">Temperature history for each device </div>
<div class="text-sm text-hint font-medium">Temperature history for each device</div>
</div>
<div>
<button class="h-8 min-h-8 px-2"
mat-button
[matMenuTriggerFor]="tempRangeMenu">
<span class="font-medium text-sm text-hint">{{tempDurationKey}}</span>
<span class="font-medium text-sm text-hint">{{ tempDurationKey }}</span>
</button>
<mat-menu #tempRangeMenu="matMenu">
<button (click)="changeSummaryTempDuration('forever')" mat-menu-item>forever</button>
@@ -109,7 +125,8 @@
src="assets/images/dashboard-placeholder.png">
<h1>No Devices Detected!</h1>
<p style="max-width:700px;">Scrutiny includes a Collector agent that you must run on all of your systems. The Collector is responsible for detecting connected storage devices and collecting S.M.A.R.T data on a configurable schedule.</p>
<p style="max-width:700px;">Scrutiny includes a Collector agent that you must run on all of your systems. The Collector is responsible for detecting connected storage
devices and collecting S.M.A.R.T data on a configurable schedule.</p>
<p><br/>You can trigger the Collector manually by running the following command, then refreshing this page:</p>
<code>scrutiny-collector-metrics run</code>