TRIX-21 Remove fingerprint from SSH key editor

This commit is contained in:
Dragos 2021-05-31 11:24:59 +03:00
parent 79f1a01aea
commit cd4ff88673
4 changed files with 7 additions and 7 deletions

View File

@ -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));
}
// ----------------------------------------------------------------------------------------------------------------

View File

@ -37,9 +37,9 @@ export class AccountService
}
// ----------------------------------------------------------------------------------------------------------------
addKey(name: string, key: string, fingerprint: string): Observable<UserKey>
addKey(name: string, key: string): Observable<UserKey>
{
return this.httpClient.post<UserKey>(`/api/my/keys`, { name, key, fingerprint });
return this.httpClient.post<UserKey>(`/api/my/keys`, { name, key });
}
// ----------------------------------------------------------------------------------------------------------------

View File

@ -10,11 +10,10 @@
<div class="mt-3">
<input type="text" class="form-control" formControlName="name" placeholder="Name" [appAutofocus]="true" [appAutofocusDelay]="600">
<textarea rows="4" class="form-control" formControlName="key" placeholder="SSH key"></textarea>
<input type="text" class="form-control" formControlName="fingerprint" placeholder="Fingerprint">
</div>
<div class="d-flex justify-content-end align-items-center mt-5">
<button class="btn btn-info" (click)="saveChanges()" [disabled]="editorForm.invalid">Save changes</button>
<button class="btn btn-info" (click)="saveChanges()" [disabled]="editorForm.invalid">Add key</button>
</div>
</div>
</fieldset>

View File

@ -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);