show spinner when loading dashboards

This commit is contained in:
2023-03-01 19:05:10 +01:00
parent 71410801dc
commit d9daf561bf
2 changed files with 10 additions and 4 deletions

View File

@@ -1,9 +1,16 @@
<style>
.spinner {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<div class="toolbar"> <div class="toolbar">
<button mat-button (click)="createNewDashboard()">New</button> <button mat-button (click)="createNewDashboard()">New</button>
</div> </div>
<div *ngIf="loading"> <div *ngIf="loading" class="spinner">
loading <mat-spinner></mat-spinner>
</div> </div>
<div *ngIf="!loading"> <div *ngIf="!loading">
<table mat-table [dataSource]="dataSource" > <table mat-table [dataSource]="dataSource" >

View File

@@ -62,7 +62,6 @@ public class DashboardController {
produces = MediaType.APPLICATION_JSON_VALUE) produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody @ResponseBody
public DashboardList getDashboards() throws IOException { public DashboardList getDashboards() throws IOException {
final List<Dashboard> dashboards = new ArrayList<>(Files.list(baseDir)// final List<Dashboard> dashboards = new ArrayList<>(Files.list(baseDir)//
.filter(p -> p.getFileName().toString().endsWith(".json"))// .filter(p -> p.getFileName().toString().endsWith(".json"))//
.map(FileUtils::readSilent)// .map(FileUtils::readSilent)//