Browse Source

notify and notifyThreshold input added

benc1 2 years ago
parent
commit
c65eae173e

+ 13 - 1
ng/src/app/components/service-check-form/service-check-form.component.html

@@ -7,7 +7,7 @@
       </div>
     </div>
     <div class="row mb-2">
-      <label class="col-sm-3 form-check-label" [for]="'Active_' + serviceCheck.id"> Active </label>
+      <label class="col-sm-3 form-check-label" [for]="'Active_' + serviceCheck.id">Active</label>
       <div class="col-sm-9">
         <input class="form-check-input" formControlName="active" type="checkbox" value="" [id]="'Active_' + serviceCheck.id" />
       </div>
@@ -30,6 +30,18 @@
         <input type="text" formControlName="url" class="form-control" [id]="'Url_' + serviceCheck.id" />
       </div>
     </div>
+    <div class="row mb-2">
+      <label [for]="'Notify_' + serviceCheck.id" class="col-sm-3 col-form-label">Notify</label>
+      <div class="col-sm-9">
+        <input type="checkbox" formControlName="notify" class="form-check-input" [id]="'Notify_' + serviceCheck.id" />
+      </div>
+    </div>
+    <div class="row mb-2">
+      <label [for]="'NotifyThreshold_' + serviceCheck.id" class="col-sm-3 col-form-label">Notify Threshold</label>
+      <div class="col-sm-9">
+        <input type="text" formControlName="notifyThreshold" class="form-control" [id]="'NotifyThreshold_' + serviceCheck.id" />
+      </div>
+    </div>
   </div>
   <div class="col-5 h-100 overflow-auto">
     <ul formArrayName="checks" class="list-group">

+ 2 - 2
ng/src/app/components/service-check-form/service-check-form.component.scss

@@ -1,4 +1,4 @@
 .form-row-service-check {
-  max-height: 220px;
-  height: 220px;
+  max-height: 320px;
+  height: 320px;
 }

+ 3 - 1
ng/src/app/components/service-check-form/service-check-form.component.ts

@@ -29,7 +29,9 @@ export class ServiceCheckFormComponent implements OnInit {
     url: '', //constant for defaultValues
     interval: 10, //constant for defaultValues
     timeout: 10, //constant for defaultValuess
-    checks: this.formBuilder.array([])
+    checks: this.formBuilder.array([]),
+    notify: true,
+    notifyThreshold: 3
   });
 
   constructor(private formBuilder: FormBuilder, private serviceApi: ServiceApiService) {}