|
|
@@ -1,5 +1,5 @@
|
|
|
import { Component, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core';
|
|
|
-import { faSave } from '@fortawesome/free-solid-svg-icons';
|
|
|
+import { faSave, faServer } from '@fortawesome/free-solid-svg-icons';
|
|
|
import { ServiceApiService } from '../../services/service-api.service';
|
|
|
import { ServerApiService } from '../../services/server-api.service';
|
|
|
import { ServiceCheckFormComponent } from '../../components/service-check-form/service-check-form.component';
|
|
|
@@ -8,16 +8,23 @@ import { ServiceCheckFormComponent } from '../../components/service-check-form/s
|
|
|
selector: 'app-admin-panel',
|
|
|
templateUrl: './admin-panel.component.html',
|
|
|
styleUrls: ['./admin-panel.component.scss'],
|
|
|
- host: { class: 'd-flex flex-column h-100 overflow-auto' }
|
|
|
+ host: { class: 'd-flex flex-column h-100' }
|
|
|
})
|
|
|
export class AdminPanelComponent implements OnInit {
|
|
|
@ViewChildren(ServiceCheckFormComponent) formChilds!: QueryList<ServiceCheckFormComponent>;
|
|
|
public serverConfigs: ServerConfig[] = [];
|
|
|
public serviceChecks: HttpCheckConfig[] = [];
|
|
|
- public fa = { save: faSave };
|
|
|
+ public fa = { save: faSave, server: faServer };
|
|
|
+
|
|
|
+ public activeId = 0;
|
|
|
|
|
|
constructor(private serviceApi: ServiceApiService, apiService: ServerApiService) {
|
|
|
- apiService.serverConfigs$.subscribe(data => (this.serverConfigs = data));
|
|
|
+ apiService.serverConfigs$.subscribe(data => {
|
|
|
+ this.serverConfigs = data;
|
|
|
+ if (data.length > 0) {
|
|
|
+ this.fetchServiceChecks(data[this.activeId].id);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
ngOnInit(): void {}
|