Action button added

This commit is contained in:
piotrpekala7 2021-02-26 16:41:01 +01:00
parent 96f4600706
commit 06926c53af
3 changed files with 18 additions and 4 deletions

View File

@ -36,17 +36,21 @@
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
<mat-cell *matCellDef="let row" style="text-align: right">
<button mat-icon-button (click)="startServer(row)" *ngIf="row.location === 'local' && getServerStatus(row) === 'stopped'">
<button mat-icon-button matTooltip="Go to projects" matTooltipClass="custom-tooltip" (click)="openProjects(row)" *ngIf="getServerStatus(row) === 'running' || row.location === 'remote' || row.location === 'bundled'">
<mat-icon aria-label="Go to projects">arrow_forward</mat-icon>
</button>
<button mat-icon-button matTooltip="Start server" matTooltipClass="custom-tooltip" (click)="startServer(row)" *ngIf="row.location === 'local' && getServerStatus(row) === 'stopped'">
<mat-icon aria-label="Start server">play_arrow</mat-icon>
</button>
<button mat-icon-button (click)="stopServer(row)" *ngIf="row.location === 'local' && getServerStatus(row) === 'running'">
<button mat-icon-button matTooltip="Stop server" matTooltipClass="custom-tooltip" (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)">
<button mat-icon-button matTooltip="Remove server" matTooltipClass="custom-tooltip" (click)="deleteServer(row)">
<mat-icon aria-label="Remove server">delete</mat-icon>
</button>
</mat-cell>

View File

@ -35,7 +35,8 @@ export class ServersComponent implements OnInit, OnDestroy {
private electronService: ElectronService,
private childProcessService: ChildProcessService,
private bottomSheet: MatBottomSheet,
private route : ActivatedRoute
private route : ActivatedRoute,
private router: Router
) {}
getServers() {
@ -107,6 +108,10 @@ export class ServersComponent implements OnInit, OnDestroy {
this.startServer(server);
}
openProjects(server) {
this.router.navigate(['/server', server.id, 'projects']);
}
createModal() {
const dialogRef = this.dialog.open(AddServerDialogComponent, {
width: '350px',

View File

@ -20,4 +20,9 @@ export class RecentlyOpenedProjectService {
getProjectId() : string {
return this.projectId;
}
removeData() {
this.serverId = '';
this.projectId = ''
}
}