Commit 3bfb461d authored by Lukas Burgey's avatar Lukas Burgey

Rework the key upload form

parent 2176844d
......@@ -10,12 +10,9 @@
<div class="mat-typography" style="margin-bottom: 50px;">
<h2>Key Management</h2>
<div style="margin-bottom: 15px;">
<p>
These are your currently uploaded SSH public keys.
</p>
</div>
<p>
These are your currently uploaded SSH public keys.
</p>
<div style="margin-bottom: 35px;">
<mat-table [dataSource]="sshKeyTable">
<ng-container matColumnDef="name">
......@@ -42,17 +39,8 @@
</mat-table>
</div>
<!-- uploading section -->
<div>
<div *ngIf="upload; then uploading else not_uploading"></div>
<ng-template #not_uploading>
<p>
You can upload more SSH public keys to use for accessing services.
</p>
<button mat-raised-button color="primary" (click)="upload = true">
Upload more
</button>
</ng-template>
<ng-template #uploading>
<div style="height: 80px;">
<div *ngIf="upload; else notUploading">
<form (ngSubmit)="uploadKey()" #sshKeyForm="ngForm">
<mat-form-field>
<input matInput placeholder="Name" required [(ngModel)]="formKey.name" name="name">
......@@ -63,10 +51,18 @@
<button mat-raised-button color="primary" type="submit" [disabled]="!sshKeyForm.form.valid">
Upload key
</button>
<button matInput mat-icon-button (click)="resetKeyUpload()" matTooltip="Abort key upload">
<button mat-icon-button type="button" (click)="resetKeyUpload()" matTooltip="Abort key upload">
<mat-icon>cancel</mat-icon>
</button>
</form>
</div>
<ng-template #notUploading>
<p>
You can upload more SSH public keys to use for accessing services.
</p>
<button mat-raised-button color="primary" (click)="upload = true">
Upload more
</button>
</ng-template>
</div>
</div>
......
......@@ -43,6 +43,7 @@ export class AccountComponent implements OnInit {
this.dialog.open(
ProfileComponent,
{
width: '80%',
data: {
user: user,
}
......
......@@ -17,8 +17,10 @@ export class DialogService {
credentialsDialog: MatDialogRef<any>;
messageDialog: MatDialogRef<any>;
defaultWidth = '700px';
settings = {
width: '80%',
width: this.defaultWidth,
};
constructor(
......@@ -29,6 +31,7 @@ export class DialogService {
this.profileDialog = this.dialog.open(
ProfileComponent,
{
width: this.defaultWidth,
data: {
user: user,
}
......@@ -47,6 +50,7 @@ export class DialogService {
this.questionnaireDialog = this.dialog.open(
QuestionnaireComponent,
{
width: '80%',
data: {
stateItem: stateItem,
}
......@@ -58,6 +62,7 @@ export class DialogService {
this.credentialsDialog = this.dialog.open(
CredentialsComponent,
{
width: this.defaultWidth,
data: {
stateItem: stateItem,
}
......@@ -69,6 +74,7 @@ export class DialogService {
this.messageDialog = this.dialog.open(
MessageComponent,
{
width: this.defaultWidth,
data: {
stateItem: stateItem,
}
......
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