|
|
@@ -1,4 +1,5 @@
|
|
|
import { Component, ViewChild } from '@angular/core';
|
|
|
+import { ValidationErrors } from '@angular/forms';
|
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
|
import { faAngleRight, faPlus, faSave, faServer, faTrashAlt } from '@fortawesome/free-solid-svg-icons';
|
|
|
import { NgbAccordion, NgbPanelChangeEvent } from '@ng-bootstrap/ng-bootstrap';
|
|
|
@@ -7,7 +8,7 @@ import { ServiceCheckFormComponent } from 'src/app/components/service-check-form
|
|
|
import { ComponentService } from 'src/app/services/component.service';
|
|
|
import { ServiceApiService } from 'src/app/services/service-api.service';
|
|
|
import { ServerApiService } from 'src/app/services/server-api.service';
|
|
|
-import { ValidationErrors } from '@angular/forms';
|
|
|
+import { ToastService } from 'src/app/services/toast.service';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-admin-service-checks-page',
|
|
|
@@ -33,7 +34,8 @@ export class AdminServiceChecksPageComponent {
|
|
|
private cmpService: ComponentService,
|
|
|
route: ActivatedRoute,
|
|
|
private router: Router,
|
|
|
- private serviceApi: ServiceApiService
|
|
|
+ private serviceApi: ServiceApiService,
|
|
|
+ private toastService: ToastService
|
|
|
) {
|
|
|
apiService.serverConfigs$.subscribe(data => {
|
|
|
this.serverConfigs = data;
|
|
|
@@ -128,7 +130,7 @@ export class AdminServiceChecksPageComponent {
|
|
|
if (error.type === 'validation') {
|
|
|
const invalid: ValidationErrors = error.errors;
|
|
|
Object.entries(invalid).forEach(entry => {
|
|
|
- this.cmpService.openConfirmModal({ buttonTitles: { no: null, yes: 'OK' }, modalContent: { title: entry[0], message: entry[1] } });
|
|
|
+ this.toastService.error(entry[1], entry[0], 180000);
|
|
|
});
|
|
|
}
|
|
|
console.error(error);
|