mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-20 05:27:56 +00:00
Merge pull request #419 from GNS3/Display-progress-when-server-is-starting
Display progress when server is starting #390
This commit is contained in:
commit
3a358d199c
@ -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' || row.location === 'remote'" [routerLink]="['/server', row.id, 'projects']" class="table-link">{{ row.name }}</a>
|
||||
<span *ngIf="getServerStatus(row) != 'running' && row.location !== 'remote'">{{ 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>
|
||||
|
@ -49,6 +49,9 @@ export class ServersComponent implements OnInit, OnDestroy {
|
||||
if(!server) {
|
||||
return;
|
||||
}
|
||||
if(serverStatus.status === 'starting') {
|
||||
server.status = 'starting';
|
||||
}
|
||||
if(serverStatus.status === 'stopped') {
|
||||
server.status = 'stopped';
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import { Subject } from 'rxjs';
|
||||
|
||||
export interface ServerStateEvent {
|
||||
serverName: string;
|
||||
status: "started" | "errored" | "stopped" | "stderr";
|
||||
status: "starting" | "started" | "errored" | "stopped" | "stderr";
|
||||
message: string;
|
||||
}
|
||||
|
||||
@ -29,6 +29,12 @@ export class ServerManagementService implements OnDestroy {
|
||||
}
|
||||
|
||||
async start(server: Server) {
|
||||
var startingEvent : ServerStateEvent = {
|
||||
serverName: server.name,
|
||||
status: "starting",
|
||||
message: ''
|
||||
};
|
||||
this.serverStatusChanged.next(startingEvent);
|
||||
return await this.electronService.remote.require('./local-server.js').startLocalServer(server);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user