import { Component, OnInit } from '@angular/core';
-import { FormControl, Validators } from '@angular/forms';
+import { UntypedFormControl, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { CdForm } from '~/app/shared/forms/cd-form';
import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
import { CdValidators } from '~/app/shared/forms/cd-validators';
+import { CdTableFetchDataContext } from '~/app/shared/models/cd-table-fetch-data-context';
import { FinishedTask } from '~/app/shared/models/finished-task';
import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
this.pageURL = 'hosts';
}
this.createForm();
- this.hostService.list('false').subscribe((resp: any[]) => {
+ const hostContext = new CdTableFetchDataContext(() => undefined);
+ this.hostService.list(hostContext.toParams(), 'false').subscribe((resp: any[]) => {
this.hostnames = resp.map((host) => {
return host['hostname'];
});
private createForm() {
this.hostForm = new CdFormGroup({
- hostname: new FormControl('', {
+ hostname: new UntypedFormControl('', {
validators: [
Validators.required,
CdValidators.custom('uniqueName', (hostname: string) => {
})
]
}),
- addr: new FormControl('', {
+ addr: new UntypedFormControl('', {
validators: [CdValidators.ip()]
}),
- labels: new FormControl([]),
- maintenance: new FormControl(false)
+ labels: new UntypedFormControl([]),
+ maintenance: new UntypedFormControl(false)
});
}