Skip to content

Commit

Permalink
corrected fix in select tag for severity
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed Jun 16, 2023
1 parent 3a434e6 commit eccb196
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions widget/alarm/raise-alarm.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h4 class="card-title">Specify alarm</h4>
</label>
<div class="c8y-select-wrapper">
<select
name="severity"
class="form-control"
(change)="selectionChanged($event)"
[(ngModel)]="alarm.severity"
Expand Down
9 changes: 5 additions & 4 deletions widget/raise-alarm-plugin-config.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ import {
<label class="text-truncate" [title]="'Severity'">
{{ "Alarm Severity" }}
</label>
<p>{{config.severity}}</p>
<div class="c8y-select-wrapper">
<select
name="severity"
class="form-control"
(change)="selectionChanged($event)"
[(ngModel)]="config.severity"
>
<option
*ngFor="let entry of severities"
[style.background]="entry"
[style.background]="entry" [ngValue]="entry"
>
{{ entry }}
{{entry}}
</option>
</select>
</div>
Expand Down Expand Up @@ -75,6 +75,7 @@ export class RaiseAlarmPluginConfig
severities: string[] = ["CRITICAL", "MAJOR", "MINOR", "WARNING"];

constructor(private alert: AlertService) {}

ngOnInit(): void {
console.log(`Current config is: `, this.config);
}
Expand All @@ -92,6 +93,6 @@ export class RaiseAlarmPluginConfig
}

selectionChanged(e) {
console.log(e);
console.log("Changed configuration", e);
}
}

0 comments on commit eccb196

Please sign in to comment.