Add a setting for repeating notifications or not
This commit is contained in:
@@ -55,6 +55,7 @@ export interface AppConfig {
|
||||
notify_level?: MetricsNotifyLevel
|
||||
status_filter_attributes?: MetricsStatusFilterAttributes
|
||||
status_threshold?: MetricsStatusThreshold
|
||||
repeat_notifications?: boolean
|
||||
}
|
||||
|
||||
}
|
||||
@@ -82,7 +83,8 @@ export const appConfig: AppConfig = {
|
||||
metrics: {
|
||||
notify_level: MetricsNotifyLevel.Fail,
|
||||
status_filter_attributes: MetricsStatusFilterAttributes.All,
|
||||
status_threshold: MetricsStatusThreshold.Both
|
||||
status_threshold: MetricsStatusThreshold.Both,
|
||||
repeat_notifications: true
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+10
@@ -84,6 +84,16 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col mt-5 gt-md:flex-row">
|
||||
<mat-form-field class="flex-auto gt-xs:pr-3 gt-md:pr-3">
|
||||
<mat-label>Repeat Notifications</mat-label>
|
||||
<mat-select [(ngModel)]=repeatNotifications>
|
||||
<mat-option [value]=true>Always</mat-option>
|
||||
<mat-option [value]=false>Only when the value has changed</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</mat-dialog-content>
|
||||
|
||||
+4
-1
@@ -28,6 +28,7 @@ export class DashboardSettingsComponent implements OnInit {
|
||||
theme: string;
|
||||
statusThreshold: number;
|
||||
statusFilterAttributes: number;
|
||||
repeatNotifications: boolean;
|
||||
|
||||
// Private
|
||||
private _unsubscribeAll: Subject<void>;
|
||||
@@ -55,6 +56,7 @@ export class DashboardSettingsComponent implements OnInit {
|
||||
|
||||
this.statusFilterAttributes = config.metrics.status_filter_attributes;
|
||||
this.statusThreshold = config.metrics.status_threshold;
|
||||
this.repeatNotifications = config.metrics.repeat_notifications;
|
||||
|
||||
});
|
||||
|
||||
@@ -70,7 +72,8 @@ export class DashboardSettingsComponent implements OnInit {
|
||||
theme: this.theme as Theme,
|
||||
metrics: {
|
||||
status_filter_attributes: this.statusFilterAttributes as MetricsStatusFilterAttributes,
|
||||
status_threshold: this.statusThreshold as MetricsStatusThreshold
|
||||
status_threshold: this.statusThreshold as MetricsStatusThreshold,
|
||||
repeat_notifications: this.repeatNotifications
|
||||
}
|
||||
}
|
||||
this._configService.config = newSettings
|
||||
|
||||
Reference in New Issue
Block a user