diff --git a/app/src/app/account/account.component.ts b/app/src/app/account/account.component.ts index 0cc16dc..181ea7e 100644 --- a/app/src/app/account/account.component.ts +++ b/app/src/app/account/account.component.ts @@ -71,6 +71,8 @@ export class AccountComponent implements OnInit, OnDestroy }; const modalRef = this.modalService.show(SshKeyEditorComponent, modalConfig); + + modalRef.content.save.pipe(first()).subscribe(sshKey => this.userKeys.push(sshKey)); } // ---------------------------------------------------------------------------------------------------------------- diff --git a/app/src/app/account/helpers/account.service.ts b/app/src/app/account/helpers/account.service.ts index 4fc8df8..cad7ba7 100644 --- a/app/src/app/account/helpers/account.service.ts +++ b/app/src/app/account/helpers/account.service.ts @@ -37,9 +37,9 @@ export class AccountService } // ---------------------------------------------------------------------------------------------------------------- - addKey(name: string, key: string, fingerprint: string): Observable + addKey(name: string, key: string): Observable { - return this.httpClient.post(`/api/my/keys`, { name, key, fingerprint }); + return this.httpClient.post(`/api/my/keys`, { name, key }); } // ---------------------------------------------------------------------------------------------------------------- diff --git a/app/src/app/account/ssh-key-editor/ssh-key-editor.component.html b/app/src/app/account/ssh-key-editor/ssh-key-editor.component.html index bac6aae..6947dd6 100644 --- a/app/src/app/account/ssh-key-editor/ssh-key-editor.component.html +++ b/app/src/app/account/ssh-key-editor/ssh-key-editor.component.html @@ -10,11 +10,10 @@
-
- +
diff --git a/app/src/app/account/ssh-key-editor/ssh-key-editor.component.ts b/app/src/app/account/ssh-key-editor/ssh-key-editor.component.ts index 7160fc7..dbe8da3 100644 --- a/app/src/app/account/ssh-key-editor/ssh-key-editor.component.ts +++ b/app/src/app/account/ssh-key-editor/ssh-key-editor.component.ts @@ -40,8 +40,7 @@ export class SshKeyEditorComponent implements OnInit, OnDestroy this.editorForm = this.fb.group( { name: [null, Validators.required], - key: [null, Validators.required], - fingerprint: [null, Validators.required] + key: [null, Validators.required] }); } @@ -56,7 +55,7 @@ export class SshKeyEditorComponent implements OnInit, OnDestroy { const sshKey = this.editorForm.getRawValue(); - this.accountService.addKey(sshKey.name, sshKey.key, sshKey.fingerprint) + this.accountService.addKey(sshKey.name, sshKey.key) .subscribe(response => { this.save.next(response);