Commit e960ef1e authored by Lukas Burgey's avatar Lukas Burgey

Fix the ssh key display

Previously we displayed an empty list. We hide the list now.
parent 7f5a76f9
<input type="file" #file style="display: none;" (change)="onFilesAdded()" accept=".pub"/>
<div class="mat-typography" style="margin-bottom: 50px;">
<h2>SSH Key Management</h2>
<p>
These are your current SSH public keys.
</p>
<div style="margin-bottom: 50px;">
<mat-table [dataSource]="sshKeys">
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
<mat-cell *matCellDef="let element">{{ element.name}}</mat-cell>
</ng-container>
<ng-container matColumnDef="key">
<mat-header-cell *matHeaderCellDef>Key</mat-header-cell>
<mat-cell style="font-size: 11px;" *matCellDef="let element">{{ element.key }}</mat-cell>
</ng-container>
<ng-container matColumnDef="action">
<mat-header-cell *matHeaderCellDef>Delete</mat-header-cell>
<mat-cell *matCellDef="let element">
<button *ngIf="keyDeleteable(element)" mat-icon-button matTooltip="Delete key" (click)="userService.removeSshKey(element)">
<mat-icon>delete_forever</mat-icon>
</button>
<button *ngIf="!keyDeleteable(element)" mat-icon-button matTooltip="This key is provided by the Proxy. It cannot be deleted." [disabled]="true" (click)="userService.removeSshKey(element)">
<mat-icon>delete_forever</mat-icon>
</button>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="columns"></mat-header-row>
<mat-row *matRowDef="let row; columns: columns;"></mat-row>
</mat-table>
<div>
<div *ngIf="(sshKeys.connect(null) | async).length > 0; else noKeys">
<p>
These are your current SSH public keys.
</p>
<div style="margin-bottom: 50px;">
<mat-table [dataSource]="sshKeys">
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
<mat-cell *matCellDef="let element">{{ element.name}}</mat-cell>
</ng-container>
<ng-container matColumnDef="key">
<mat-header-cell *matHeaderCellDef>Key</mat-header-cell>
<mat-cell style="font-size: 11px;" *matCellDef="let element">{{ element.key }}</mat-cell>
</ng-container>
<ng-container matColumnDef="action">
<mat-header-cell *matHeaderCellDef>Delete</mat-header-cell>
<mat-cell *matCellDef="let element">
<button *ngIf="keyDeleteable(element)" mat-icon-button matTooltip="Delete key" (click)="userService.removeSshKey(element)">
<mat-icon>delete_forever</mat-icon>
</button>
<button *ngIf="!keyDeleteable(element)" mat-icon-button matTooltip="This key is provided by the Proxy. It cannot be deleted." [disabled]="true" (click)="userService.removeSshKey(element)">
<mat-icon>delete_forever</mat-icon>
</button>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="columns"></mat-header-row>
<mat-row *matRowDef="let row; columns: columns;"></mat-row>
</mat-table>
</div>
</div>
<ng-template #noKeys>
<div>
<p>
Please upload at least one SSH public key to use the Portal.
</p>
</div>
</ng-template>
</div>
<!-- uploading section -->
<div>
......@@ -49,7 +60,7 @@
</div>
<ng-template #notUploading>
<p>
You can upload or enter more SSH public keys to use for accessing services.
You can upload a key file or enter an SSH public key.
</p>
<button mat-raised-button color="primary" (click)="upload = true" style="margin-right: 15px;">
Enter key
......
......@@ -28,10 +28,11 @@ export class SshkeysComponent implements OnInit {
constructor(
public userService: UserService,
) { }
) {
this.sshKeys = new SSHKeysDataSource(this.userService);
}
ngOnInit() {
this.sshKeys = new SSHKeysDataSource(this.userService);
this.resetKeyUpload();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment