Display progress when server is starting

This commit is contained in:
Piotr Pekala 2019-05-30 06:21:36 -07:00
parent 2a56441ce9
commit 80338f194b
2 changed files with 7 additions and 2 deletions

View File

@ -13,8 +13,9 @@
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
<mat-cell *matCellDef="let row">
<a [routerLink]="['/server', row.id, 'projects']" class="table-link">{{ row.name }}</a></mat-cell
>
<a *ngIf="getServerStatus(row) === 'running'" [routerLink]="['/server', row.id, 'projects']" class="table-link">{{ row.name }}</a>
<span *ngIf="getServerStatus(row) != 'running'">{{ row.name }}</span>
</mat-cell>
</ng-container>
<ng-container matColumnDef="location">
@ -42,6 +43,8 @@
<button mat-icon-button (click)="stopServer(row)" *ngIf="row.location === 'local' && getServerStatus(row) === 'running'">
<mat-icon aria-label="Stop server">stop</mat-icon>
</button>
<mat-spinner [diameter]="24" *ngIf="row.location === 'local' && getServerStatus(row) === 'starting'"></mat-spinner>
<button mat-icon-button (click)="deleteServer(row)">
<mat-icon aria-label="Remove server">delete</mat-icon>

View File

@ -98,10 +98,12 @@ export class ServersComponent implements OnInit, OnDestroy {
}
async startServer(server: Server) {
server.status = "starting";
await this.serverManagement.start(server);
}
async stopServer(server: Server) {
server.status = "stopped";
await this.serverManagement.stop(server);
}
}