add new server issue 1357

This commit is contained in:
gustavao
2021-08-26 18:16:07 -05:00
parent 2b99e5f8b9
commit 9d4726e7dd
3 changed files with 71 additions and 9 deletions
@@ -1,8 +1,24 @@
<mat-form-field id="server-selector">
<mat-label>Server</mat-label>
<mat-select [formControl]="serverSelector">
<mat-option *ngFor="let server of servers" [value]="server">
{{ server }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-label>Server</mat-label>
<mat-select [formControl]="serverSelector">
<div class="sticky">
<form [formGroup]="form" (ngSubmit)="setNewServer()">
<div class="actions">
<mat-form-field class="ml" fxFlexAlign="start">
<span matPrefix><mat-icon>language</mat-icon></span>
<mat-label>Add new server</mat-label>
<input matInput type="text" autocomplete="off" formControlName="url">
<mat-error *ngIf="form.controls.url.hasError('required')">
Url <strong>is required</strong>
</mat-error>
</mat-form-field>
<button type="submit" [disabled]="form.invalid" class="ml" mat-raised-button color="primary">Add</button>
</div>
</form>
</div>
<mat-option *ngFor="let server of servers" [value]="server">
{{ server }}
</mat-option>
</mat-select>
</mat-form-field>