Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
filter fix, and set atRisk in config
Browse files Browse the repository at this point in the history
  • Loading branch information
CaribouJohn committed Jul 27, 2021
1 parent 0d61d1e commit fed3b3c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "device-control-widget",
"version": "1.0.13",
"version": "1.0.16",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class DeviceControlWidget implements OnDestroy, OnInit {

//filter names
this.widgetHelper.getWidgetConfig().filteredAssets = this.widgetHelper.getWidgetConfig().filteredAssets.filter(mo => {
if (this.widgetHelper.getWidgetConfig().deviceFilter === '') {
if (this.widgetHelper.getWidgetConfig().deviceFilter === undefined || this.widgetHelper.getWidgetConfig().deviceFilter === '') {
return true;
}
return mo.name.toLowerCase().includes(this.widgetHelper.getWidgetConfig().deviceFilter.toLowerCase());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ <h4 translate>Select or upload an icon to represent the devices.</h4>
</span>
</label>
</div>
<div class="form-check-inline col-lg-2">
<label class="label-with-help" class="form-check-label" for="showatRisk" translate>
<input class="form-check-input" type="checkbox" name="showatRisk"
[(ngModel)]="widgetHelper.getWidgetConfig().atRisk"
(ngModelChange)="onConfigChanged()" /> Show at risk only<span class="help-icon">
<img src="{{CONST_HELP_IMAGE_FILE}}" alt="help tooltip"
title="Only show at risk devices.">
</span>
</label>
</div>
</div>

<div class="row form-group">
Expand Down

0 comments on commit fed3b3c

Please sign in to comment.