@c8y/ng1-modules 1018.208.0 → 1018.210.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/administration-homeAdministration/home-administration.component.js +1 -1
- package/administration-homeAdministration/home-administration.template.html +19 -15
- package/core/core/services/measurements.js +1 -1
- package/core/cumulocity.json +0 -2
- package/core/ui/directives/auditList.js +1 -1
- package/core/ui/services/util.js +1 -1
- package/devicemanagement-deviceNetwork/views/network.html +19 -0
- package/package.json +1 -1
- package/smartRules/controllers/list.js +1 -1
- package/smartRules/list/smartRulesList.component.js +1 -1
- package/smartRules/list/smartRulesList.html +86 -38
- package/smartRules/services/smartRules.js +1 -1
- package/smartRules/views/list.html +99 -46
- package/administration-eventProcessing/cumulocity.json +0 -23
- package/administration-eventProcessing/details/eventProcessingRuleAlarms.component.js +0 -1
- package/administration-eventProcessing/details/eventProcessingRuleAlarms.html +0 -8
- package/administration-eventProcessing/details/eventProcessingRuleDetails.component.js +0 -1
- package/administration-eventProcessing/details/eventProcessingRuleDetails.html +0 -206
- package/administration-eventProcessing/details/eventProcessingRuleMetrics.component.js +0 -1
- package/administration-eventProcessing/details/eventProcessingRuleMetrics.html +0 -21
- package/administration-eventProcessing/details/eventProcessingRuleNotifications.component.js +0 -1
- package/administration-eventProcessing/details/eventProcessingRuleNotifications.html +0 -57
- package/administration-eventProcessing/details/eventProcessingRuleTitle.component.js +0 -1
- package/administration-eventProcessing/details/eventProcessingRuleTitle.html +0 -40
- package/administration-eventProcessing/details/eventProcessingRulesExamples.component.js +0 -1
- package/administration-eventProcessing/details/eventProcessingRulesExamples.html +0 -82
- package/administration-eventProcessing/index.js +0 -1
- package/administration-eventProcessing/list/eventProcessingRulesList.component.js +0 -1
- package/administration-eventProcessing/list/eventProcessingRulesList.html +0 -175
- package/administration-eventProcessing/services/eventProcessing.js +0 -1
- package/core/core/services/cepModule.js +0 -1
- package/core/core/services/cepModuleExamples.js +0 -1
- package/notifications/cumulocity.json +0 -11
- package/notifications/index.js +0 -1
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
<div>
|
|
2
2
|
<div ng-if="vm.canSeeSection()">
|
|
3
3
|
<div ng-show="vm.loadingStatus.inProgress">
|
|
4
|
-
<c8y-rectangle-spinner
|
|
5
|
-
></c8y-rectangle-spinner>
|
|
4
|
+
<c8y-rectangle-spinner></c8y-rectangle-spinner>
|
|
6
5
|
</div>
|
|
7
6
|
|
|
8
7
|
<div ng-show="!vm.loadingStatus.inProgress && vm.loadingStatus.done && vm.loadingStatus.error">
|
|
9
|
-
<div
|
|
8
|
+
<div
|
|
9
|
+
class="alert alert-warning"
|
|
10
|
+
translate
|
|
11
|
+
>
|
|
12
|
+
Could not load smart rules list.
|
|
13
|
+
</div>
|
|
10
14
|
</div>
|
|
11
15
|
|
|
12
16
|
<div ng-show="!vm.loadingStatus.inProgress && vm.loadingStatus.done && !vm.loadingStatus.error">
|
|
13
17
|
<c8y-ui-empty-state
|
|
14
|
-
ng-show="vm.rules.length === 0"
|
|
15
18
|
[icon]="'c8y-smart-rules'"
|
|
16
19
|
[title]="'No smart rules defined.' | translate"
|
|
20
|
+
ng-show="vm.rules.length === 0"
|
|
17
21
|
>
|
|
18
22
|
<p c8y-guide-docs>
|
|
19
23
|
<small translate>
|
|
@@ -24,13 +28,27 @@
|
|
|
24
28
|
</p>
|
|
25
29
|
</c8y-ui-empty-state>
|
|
26
30
|
|
|
27
|
-
<div
|
|
28
|
-
|
|
31
|
+
<div
|
|
32
|
+
class="smart-rules-list"
|
|
33
|
+
ng-show="vm.rules.length > 0"
|
|
34
|
+
>
|
|
35
|
+
<div
|
|
36
|
+
class="card-group"
|
|
37
|
+
ng-class="vm.listClass"
|
|
38
|
+
>
|
|
29
39
|
<div class="smart-rules-list-head page-sticky-header p-t-8 p-b-8">
|
|
30
|
-
<label
|
|
40
|
+
<label
|
|
41
|
+
class="smart-rule-group"
|
|
42
|
+
translate
|
|
43
|
+
ng-if="vm.context.context === 'group'"
|
|
44
|
+
>
|
|
31
45
|
Group
|
|
32
46
|
</label>
|
|
33
|
-
<label
|
|
47
|
+
<label
|
|
48
|
+
class="smart-rule-group"
|
|
49
|
+
translate
|
|
50
|
+
ng-if="vm.context.context === 'device'"
|
|
51
|
+
>
|
|
34
52
|
Device
|
|
35
53
|
</label>
|
|
36
54
|
<label
|
|
@@ -40,17 +58,29 @@
|
|
|
40
58
|
>
|
|
41
59
|
State
|
|
42
60
|
</label>
|
|
43
|
-
<label
|
|
61
|
+
<label
|
|
62
|
+
class="smart-rule-children"
|
|
63
|
+
translate
|
|
64
|
+
ng-if="vm.children.length > 0"
|
|
65
|
+
>
|
|
44
66
|
Children
|
|
45
67
|
</label>
|
|
46
|
-
<label
|
|
68
|
+
<label
|
|
69
|
+
class="smart-rule-description"
|
|
70
|
+
translate
|
|
71
|
+
>
|
|
72
|
+
Smart rule
|
|
73
|
+
</label>
|
|
47
74
|
</div>
|
|
48
75
|
|
|
49
76
|
<div
|
|
50
77
|
class="col-xs-12 col-sm-6 col-md-4 col-lg-3"
|
|
51
78
|
ng-repeat="rule in vm.rules | orderBy:'name'"
|
|
52
79
|
>
|
|
53
|
-
<div
|
|
80
|
+
<div
|
|
81
|
+
class="card-flip-container"
|
|
82
|
+
ng-class="{ flipping: vm.isFlipped }"
|
|
83
|
+
>
|
|
54
84
|
<div
|
|
55
85
|
class="card-flip smart-rule-list-card"
|
|
56
86
|
ng-class="{ flipped: vm.isFlipped, active: vm.isOpen[rule.id] }"
|
|
@@ -59,29 +89,36 @@
|
|
|
59
89
|
<div
|
|
60
90
|
class="card-actions collapsible"
|
|
61
91
|
ng-class="{ expanded: vm.isOpen[rule.id] }"
|
|
62
|
-
ng-if="vm.canAddRules() || vm.canModify(rule)
|
|
92
|
+
ng-if="vm.canAddRules() || vm.canModify(rule)"
|
|
63
93
|
>
|
|
64
94
|
<button
|
|
65
95
|
class="btn btn-link btn-collapse"
|
|
66
|
-
type="button"
|
|
67
|
-
title="{{ 'Details' | translate }}"
|
|
68
96
|
ng-class="{ active: vm.isOpen[rule.id] }"
|
|
97
|
+
title="{{ 'Details' | translate }}"
|
|
98
|
+
type="button"
|
|
69
99
|
ng-click="vm.isOpen[rule.id] = !vm.isOpen[rule.id]"
|
|
70
100
|
>
|
|
71
101
|
<i c8y-icon="chevron-down"></i>
|
|
72
102
|
</button>
|
|
73
|
-
<div
|
|
103
|
+
<div
|
|
104
|
+
class="btn-group"
|
|
105
|
+
is-open="ctrl.open"
|
|
106
|
+
uib-dropdown
|
|
107
|
+
>
|
|
74
108
|
<button
|
|
75
109
|
class="dropdown-toggle c8y-dropdown"
|
|
76
110
|
title="{{ 'Actions' | translate }}"
|
|
111
|
+
aria-haspopup="true"
|
|
77
112
|
type="button"
|
|
78
113
|
data-toggle="dropdown"
|
|
79
|
-
aria-haspopup="true"
|
|
80
114
|
uib-dropdown-toggle
|
|
81
115
|
>
|
|
82
116
|
<i c8y-icon="ellipsis-v"></i>
|
|
83
117
|
</button>
|
|
84
|
-
<ul
|
|
118
|
+
<ul
|
|
119
|
+
class="dropdown-menu dropdown-menu-right"
|
|
120
|
+
uib-dropdown-menu
|
|
121
|
+
>
|
|
85
122
|
<li ng-if="vm.canModify(rule) && !vm.disableEditAndCreate">
|
|
86
123
|
<button
|
|
87
124
|
title="{{ 'Edit smart rule' | translate }}"
|
|
@@ -111,16 +148,6 @@
|
|
|
111
148
|
{{ 'Delete' | translate }}
|
|
112
149
|
</button>
|
|
113
150
|
</li>
|
|
114
|
-
<li class="divider" ng-if="vm.canInspect()"></li>
|
|
115
|
-
<li ng-if="vm.canInspect()">
|
|
116
|
-
<a
|
|
117
|
-
ng-href="/apps/administration#/eventprocessing/{{ rule.cepModuleId }}"
|
|
118
|
-
title="{{ 'Inspect smart rule' | translate }}"
|
|
119
|
-
>
|
|
120
|
-
<i c8y-icon="c8y-smart-rules c8y-icon-mono"></i>
|
|
121
|
-
{{ 'Inspect' | translate }}
|
|
122
|
-
</a>
|
|
123
|
-
</li>
|
|
124
151
|
</ul>
|
|
125
152
|
</div>
|
|
126
153
|
</div>
|
|
@@ -156,8 +183,8 @@
|
|
|
156
183
|
|
|
157
184
|
<button
|
|
158
185
|
class="btn c8y-btn-checkbox m-r-0"
|
|
159
|
-
type="button"
|
|
160
186
|
ng-class="{ active: rule.enabled && vm.hasSource(rule) }"
|
|
187
|
+
type="button"
|
|
161
188
|
ng-click="vm.toggleRuleActivationForContextMO(rule)"
|
|
162
189
|
>
|
|
163
190
|
<i
|
|
@@ -167,10 +194,16 @@
|
|
|
167
194
|
'dlt-c8y-icon-ban text-danger': !rule.enabled || !vm.hasSource(rule)
|
|
168
195
|
}"
|
|
169
196
|
></i>
|
|
170
|
-
<span
|
|
197
|
+
<span
|
|
198
|
+
translate
|
|
199
|
+
ng-if="rule.enabled && vm.hasSource(rule)"
|
|
200
|
+
>
|
|
171
201
|
Active`rule`
|
|
172
202
|
</span>
|
|
173
|
-
<span
|
|
203
|
+
<span
|
|
204
|
+
translate
|
|
205
|
+
ng-if="!rule.enabled || !vm.hasSource(rule)"
|
|
206
|
+
>
|
|
174
207
|
Inactive`rule`
|
|
175
208
|
</span>
|
|
176
209
|
</button>
|
|
@@ -182,20 +215,26 @@
|
|
|
182
215
|
>
|
|
183
216
|
<div class="list-icon">
|
|
184
217
|
<i
|
|
218
|
+
ng-class="vm.statusClass(rule)"
|
|
185
219
|
c8y-icon="{{ vm.statusIcon(rule) }}"
|
|
186
220
|
uib-tooltip="{{ vm.status(rule) | translate }}"
|
|
187
221
|
tooltip-popup-delay="500"
|
|
188
222
|
tooltip-append-to-body="true"
|
|
189
|
-
ng-class="vm.statusClass(rule)"
|
|
190
223
|
></i>
|
|
191
224
|
</div>
|
|
192
|
-
<div
|
|
225
|
+
<div
|
|
226
|
+
class="card-icon"
|
|
227
|
+
ng-class="vm.statusClass(rule)"
|
|
228
|
+
>
|
|
193
229
|
<i c8y-icon="{{ vm.statusIcon(rule) }}"></i>
|
|
194
230
|
<span>{{ vm.status(rule) | translate }}</span>
|
|
195
231
|
</div>
|
|
196
232
|
</div>
|
|
197
233
|
|
|
198
|
-
<div
|
|
234
|
+
<div
|
|
235
|
+
class="smart-rule-children"
|
|
236
|
+
ng-if="vm.children.length > 0"
|
|
237
|
+
>
|
|
199
238
|
<label translate>Children</label>
|
|
200
239
|
<c8y-child-assets-selector
|
|
201
240
|
ng-if="::vm.canApplyOnChildren(rule)"
|
|
@@ -225,7 +264,10 @@
|
|
|
225
264
|
<div class="smart-rule-name">
|
|
226
265
|
{{ rule.name }}
|
|
227
266
|
</div>
|
|
228
|
-
<small
|
|
267
|
+
<small
|
|
268
|
+
class="smart-rule-information text-muted"
|
|
269
|
+
ng-show="vm.type(rule)"
|
|
270
|
+
>
|
|
229
271
|
{{ vm.type(rule) }}
|
|
230
272
|
</small>
|
|
231
273
|
</div>
|
|
@@ -233,8 +275,8 @@
|
|
|
233
275
|
<div class="card-actions-group">
|
|
234
276
|
<button
|
|
235
277
|
class="btn-flip"
|
|
236
|
-
type="button"
|
|
237
278
|
title="{{ 'Details' | translate }}"
|
|
279
|
+
type="button"
|
|
238
280
|
ng-click="vm.isFlipped = !vm.isFlipped"
|
|
239
281
|
>
|
|
240
282
|
<i c8y-icon="reply"></i>
|
|
@@ -242,7 +284,10 @@
|
|
|
242
284
|
</button>
|
|
243
285
|
</div>
|
|
244
286
|
</div>
|
|
245
|
-
<div
|
|
287
|
+
<div
|
|
288
|
+
class="card card-back"
|
|
289
|
+
uib-collapse="!vm.isOpen[rule.id]"
|
|
290
|
+
>
|
|
246
291
|
<div class="card-header-actions">
|
|
247
292
|
<div class="smart-list-icon-label">
|
|
248
293
|
<span class="dot">
|
|
@@ -275,7 +320,10 @@
|
|
|
275
320
|
<div class="legend form-block">
|
|
276
321
|
{{ 'History of changes' | translate }}
|
|
277
322
|
</div>
|
|
278
|
-
<div
|
|
323
|
+
<div
|
|
324
|
+
c8y-audit-list
|
|
325
|
+
filter="{source: rule.id}"
|
|
326
|
+
></div>
|
|
279
327
|
</div>
|
|
280
328
|
</div>
|
|
281
329
|
</div>
|
|
@@ -283,8 +331,8 @@
|
|
|
283
331
|
<div class="card-actions-group">
|
|
284
332
|
<button
|
|
285
333
|
class="btn-flip"
|
|
286
|
-
type="button"
|
|
287
334
|
title="{{ 'Back' | translate }}"
|
|
335
|
+
type="button"
|
|
288
336
|
ng-click="vm.isFlipped = !vm.isFlipped"
|
|
289
337
|
>
|
|
290
338
|
<i c8y-icon="reply"></i>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(u,i,a,o,r,c,t,n,l,s){var d=a.url("service/smartrule"),f="".concat(d,"/smartrules"),
|
|
1
|
+
"use strict";!function(){function e(u,i,a,o,r,c,t,n,l,s){var d=a.url("service/smartrule"),f="".concat(d,"/smartrules"),p=["id","self","cepModuleId","lastUpdated","creationTime"],h=["type","cepModuleId","creationTime","lastUpdated"];return{permissionsCfgs:{create:[{anyRole:["ROLE_INVENTORY_ADMIN","ROLE_INVENTORY_CREATE"]},{anyRole:["ROLE_CEP_MANAGEMENT_ADMIN","ROLE_SMARTRULE_ADMIN"]}]},getEmpty:function(e){var t=e||r.getContext(),n={type:"c8y_SmartRule",name:"",enabled:!0,config:{}};t.context&&t.id&&(n.c8y_Context=t,n.type="c8y_PrivateSmartRule");return n},list:function(){return i.get(f).then(a.getResData).then(_.property("rules")).then(m)},listByContext:function(e){return i.get(S({moId:e})).then(a.getResData).then(_.property("rules")).then(m)},detail:function(e){var t=v({id:e});return i.get(t).then(a.getResData)},save:function(e,t,n){var r;r=e.id?g(e):function(e,t,n){var r=v(e,!0);return function(e,t,n){return e.ruleTemplateName=t.name,function(e,t){var n=u.when(e);return e.c8y_Context||t.mo?(e.enabledSources=[],e.disabledSources=void 0,n=y(e,t.mo,t.withChildren)):(e.enabledSources=void 0,e.disabledSources=[]),n}(e,n)}(e,t,n).then(_.partial(i.post,r)).then(a.getResData)}(e,t,n);return r},remove:function(e){var t=v(e,!0);return i.delete(t)},hasSource:function(e,t){var n=t&&t.id||t;if(!n)return!1;if(e.disabledSources)return!I(e.disabledSources,n);if(e.enabledSources)return I(e.enabledSources,n);return!0},activate:function(e,t,n){return y(e,t,n).then(g)},deactivate:function(e,t,n){return function(n,e,t){return b(e,t).then(function(e){return _.forEach(e,function(t){_.isArray(n.enabledSources)&&I(n.enabledSources,t)&&_.remove(n.enabledSources,function(e){return _.toString(e)===_.toString(t)}),_.isArray(n.disabledSources)&&!I(n.disabledSources,t)&&n.disabledSources.push(t)}),n})}(e,t,n).then(g)},addNewWithUI:R,addNewForInputAlarmAndOutputUserWithUI:function(e,t){return R({inputAlarm:e,outputUser:t})},addNewForInputDataPointWithUI:function(e){return R({inputDataPoint:e})},addNewForOutputOperationWithUI:function(e){return R({outputOperation:{template:function(e){return a.cleanFields(e,["id","self","status","deviceId","creationTime","failureReason"])}(e)}})},createInstanceWithUI:U,createInstanceWithUIByName:function(e,t){return n.getTemplateByName(e).then(function(e){return U(e,t)})},editWithUI:function(e){return D(e,void 0)},cloneWithUI:function(e){return t.current().then(_.partial(A,e)).then(D)}};function m(e){return u.all(_.map(e,function(t){return n.getTemplateForRule(t).then(function(e){return _.isUndefined(e)?null:t})})).then(_.flatten).then(_.filter)}function v(e,t){var n=_.get(e,"c8y_Context.id"),r=t&&n?S({moId:n}):f;return e.id&&(r+="/".concat(e.id)),r}function S(e){return"".concat(d,"/managedObjects/").concat(e.moId,"/smartrules")}function g(e){var t=v(e,!0),n=a.cleanFields(e,h);return i.put(t,n)}function y(n,e,t){return b(e,t).then(function(e){return _.forEach(e,function(t){_.isArray(n.enabledSources)&&!I(n.enabledSources,t)&&n.enabledSources.push(t),_.isArray(n.disabledSources)&&I(n.disabledSources,t)&&_.remove(n.disabledSources,function(e){return _.toString(e)===_.toString(t)})}),n})}function b(e,t){var n=e&&e.id||e,r=[];return n&&(r.push(u.when(n)),r.push(function(e,t){var n=[];!0!==t&&!0!==t.assets||n.push(o.childAssets(e));!0!==t&&!0!==t.devices||n.push(o.childDevices(e));return u.all(n).then(_.flattenDeep).then(_.partialRight(_.map,"id"))}(n,t))),u.all(r).then(_.flattenDeep)}function I(e,t){var n=t.id||t;return _.some(e,function(e){return _.toString(e)===_.toString(n)})}function R(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0,n=2<arguments.length?arguments[2]:void 0;return c({title:l("Add global smart rule"),templateUrl:":::PLUGIN_PATH:::/views/add.html",controller:"SmartRuleAddCtrl",ariaLabelledBy:"modal-title",ariaDescribedBy:"modal-body",size:"lg",resolve:{context:function(){return _.cloneDeep(e)},ruleInitialObj:function(){return _.cloneDeep(n)},ruleTemplatesFilterFn:function(){return t}}})}function U(e,t){return D(t,e)}function A(e,t){var n=_.cloneDeep(e);return(n=a.cleanFields(n,p)).name=s.getString("Duplicate of {{name}}",n),t&&(n.owner=t.id),n}function D(e,t){return c({templateUrl:":::PLUGIN_PATH:::/views/edit.html",controller:"SmartRuleEditCtrl",size:"sm",resolve:{ruleTemplate:function(){return _.cloneDeep(t)},rule:function(){return _.cloneDeep(e)}}})}}e.$inject=["$q","$http","c8yBase","c8yInventory","c8yUiUtil","c8yModal","c8yUser","smartRuleTemplatesSvc","gettext","gettextCatalog"],angular.module("c8y.smartRules").factory("smartRulesSvc",e)}();
|
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
<div ng-if="canSeeSection()">
|
|
3
3
|
<c8y-breadcrumbs-set>
|
|
4
4
|
<c8y-breadcrumbs-item
|
|
5
|
-
label="{{ 'Global smart rules' | translate }}"
|
|
6
5
|
icon="c8y-smart-rules"
|
|
6
|
+
label="{{ 'Global smart rules' | translate }}"
|
|
7
7
|
></c8y-breadcrumbs-item>
|
|
8
8
|
<c8y-breadcrumbs-item
|
|
9
|
-
label="{{ 'Configuration' | translate }}"
|
|
10
9
|
icon="c8y-tools"
|
|
10
|
+
label="{{ 'Configuration' | translate }}"
|
|
11
11
|
></c8y-breadcrumbs-item>
|
|
12
12
|
</c8y-breadcrumbs-set>
|
|
13
13
|
<c8y-ui-action-bar-set>
|
|
14
|
-
<li
|
|
14
|
+
<li
|
|
15
|
+
class="navbar-form hidden-xs"
|
|
16
|
+
action-bar-position="left"
|
|
17
|
+
>
|
|
15
18
|
<c8y-list-display-control
|
|
16
19
|
list-length="rules.length"
|
|
17
20
|
on-list-class-change="vm.listClass = listClass"
|
|
@@ -21,8 +24,8 @@
|
|
|
21
24
|
<c8y-if-allowed cfg="smartRulesSvc.permissionsCfgs.create">
|
|
22
25
|
<button
|
|
23
26
|
class="btn btn-link"
|
|
24
|
-
type="button"
|
|
25
27
|
title="{{ 'Add smart rule' | translate }}"
|
|
28
|
+
type="button"
|
|
26
29
|
ng-click="add()"
|
|
27
30
|
>
|
|
28
31
|
<i c8y-icon="plus-circle"></i>
|
|
@@ -34,8 +37,8 @@
|
|
|
34
37
|
<c8y-if-allowed any-app="['devicemanagement']">
|
|
35
38
|
<a
|
|
36
39
|
class="btn btn-link"
|
|
37
|
-
type="button"
|
|
38
40
|
title="{{ 'Open in Device management' | translate }}"
|
|
41
|
+
type="button"
|
|
39
42
|
target="_blank"
|
|
40
43
|
rel="noopener noreferrer"
|
|
41
44
|
ng-href="{{ getLinkToDM() }}"
|
|
@@ -57,21 +60,26 @@
|
|
|
57
60
|
</div>
|
|
58
61
|
|
|
59
62
|
<div ng-if="!loadingStatus.inProgress && loadingStatus.done && loadingStatus.error">
|
|
60
|
-
<div
|
|
63
|
+
<div
|
|
64
|
+
class="alert alert-warning"
|
|
65
|
+
translate
|
|
66
|
+
>
|
|
67
|
+
Could not load smart rules list.
|
|
68
|
+
</div>
|
|
61
69
|
</div>
|
|
62
70
|
|
|
63
71
|
<div ng-if="!loadingStatus.inProgress && loadingStatus.done && !loadingStatus.error">
|
|
64
72
|
<!-- empty state -->
|
|
65
73
|
<c8y-ui-empty-state
|
|
66
|
-
ng-if="rules.length === 0"
|
|
67
74
|
[icon]="'c8y-smart-rules'"
|
|
68
75
|
[title]="'No smart rules to display.' | translate"
|
|
69
76
|
[subtitle]="'Click below to add your first smart rule.' | translate"
|
|
77
|
+
ng-if="rules.length === 0"
|
|
70
78
|
>
|
|
71
79
|
<button
|
|
72
80
|
class="btn btn-primary"
|
|
73
|
-
type="button"
|
|
74
81
|
title="{{ 'Add smart rule' | translate }}"
|
|
82
|
+
type="button"
|
|
75
83
|
ng-click="add()"
|
|
76
84
|
>
|
|
77
85
|
{{ 'Add smart rule' | translate }}
|
|
@@ -85,18 +93,44 @@
|
|
|
85
93
|
</p>
|
|
86
94
|
</c8y-ui-empty-state>
|
|
87
95
|
|
|
88
|
-
<div
|
|
89
|
-
|
|
96
|
+
<div
|
|
97
|
+
class="smart-rules-list"
|
|
98
|
+
ng-if="rules.length > 0"
|
|
99
|
+
>
|
|
100
|
+
<div
|
|
101
|
+
class="card-group"
|
|
102
|
+
ng-class="vm.listClass"
|
|
103
|
+
>
|
|
90
104
|
<div class="smart-rules-list-head page-sticky-header p-t-8">
|
|
91
|
-
<label
|
|
92
|
-
|
|
105
|
+
<label
|
|
106
|
+
class="smart-rule-group text-center p-t-4"
|
|
107
|
+
translate
|
|
108
|
+
>
|
|
109
|
+
Status
|
|
110
|
+
</label>
|
|
111
|
+
<label
|
|
112
|
+
class="smart-rule-children p-t-4"
|
|
113
|
+
ng-if="children.length > 0"
|
|
114
|
+
translate
|
|
115
|
+
>
|
|
93
116
|
Children
|
|
94
117
|
</label>
|
|
95
|
-
<label
|
|
118
|
+
<label
|
|
119
|
+
class="smart-rule-description p-t-4"
|
|
120
|
+
translate
|
|
121
|
+
>
|
|
122
|
+
Smart rule
|
|
123
|
+
</label>
|
|
96
124
|
</div>
|
|
97
125
|
|
|
98
|
-
<div
|
|
99
|
-
|
|
126
|
+
<div
|
|
127
|
+
class="col-xs-12 col-sm-6 col-md-4"
|
|
128
|
+
ng-repeat="rule in rules | orderBy:'name'"
|
|
129
|
+
>
|
|
130
|
+
<div
|
|
131
|
+
class="card-flip-container"
|
|
132
|
+
ng-class="{ flipping: isFlipped }"
|
|
133
|
+
>
|
|
100
134
|
<div
|
|
101
135
|
class="card-flip smart-rule-list-card"
|
|
102
136
|
ng-class="{ flipped: isFlipped, active: isOpen[rule.id] }"
|
|
@@ -105,13 +139,13 @@
|
|
|
105
139
|
<div
|
|
106
140
|
class="card-actions collapsible"
|
|
107
141
|
ng-class="{ expanded: isOpen[rule.id] }"
|
|
108
|
-
ng-show="canAddRules() || canModify(rule)
|
|
142
|
+
ng-show="canAddRules() || canModify(rule)"
|
|
109
143
|
>
|
|
110
144
|
<button
|
|
111
145
|
class="btn btn-link btn-collapse"
|
|
112
|
-
type="button"
|
|
113
|
-
title="{{ 'Details' | translate }}"
|
|
114
146
|
ng-class="{ active: isOpen[rule.id] }"
|
|
147
|
+
title="{{ 'Details' | translate }}"
|
|
148
|
+
type="button"
|
|
115
149
|
ng-click="isOpen[rule.id] = !isOpen[rule.id]"
|
|
116
150
|
>
|
|
117
151
|
<i c8y-icon="chevron-down"></i>
|
|
@@ -124,19 +158,23 @@
|
|
|
124
158
|
>
|
|
125
159
|
<button
|
|
126
160
|
class="dropdown-toggle c8y-dropdown"
|
|
127
|
-
type="button"
|
|
128
161
|
title="{{ 'Actions' | translate }}"
|
|
129
|
-
data-toggle="dropdown"
|
|
130
162
|
aria-haspopup="true"
|
|
163
|
+
type="button"
|
|
164
|
+
data-toggle="dropdown"
|
|
131
165
|
uib-dropdown-toggle
|
|
132
166
|
>
|
|
133
167
|
<i c8y-icon="ellipsis-v"></i>
|
|
134
168
|
</button>
|
|
135
|
-
<ul
|
|
169
|
+
<ul
|
|
170
|
+
class="dropdown-menu dropdown-menu-right"
|
|
171
|
+
role="list"
|
|
172
|
+
uib-dropdown-menu
|
|
173
|
+
>
|
|
136
174
|
<li ng-if="canModify(rule)">
|
|
137
175
|
<button
|
|
138
|
-
type="button"
|
|
139
176
|
title="{{ 'Edit smart rule' | translate }}"
|
|
177
|
+
type="button"
|
|
140
178
|
ng-click="edit(rule)"
|
|
141
179
|
>
|
|
142
180
|
<i c8y-icon="pencil"></i>
|
|
@@ -145,8 +183,8 @@
|
|
|
145
183
|
</li>
|
|
146
184
|
<li ng-if="canAddRules(rule)">
|
|
147
185
|
<button
|
|
148
|
-
type="button"
|
|
149
186
|
title="{{ 'Duplicate smart rule' | translate }}"
|
|
187
|
+
type="button"
|
|
150
188
|
ng-click="clone(rule)"
|
|
151
189
|
>
|
|
152
190
|
<i c8y-icon="copy"></i>
|
|
@@ -155,25 +193,14 @@
|
|
|
155
193
|
</li>
|
|
156
194
|
<li ng-if="canModify(rule)">
|
|
157
195
|
<button
|
|
158
|
-
type="button"
|
|
159
196
|
title="{{ 'Delete smart rule' | translate }}"
|
|
197
|
+
type="button"
|
|
160
198
|
ng-click="remove(rule)"
|
|
161
199
|
>
|
|
162
200
|
<i c8y-icon="delete"></i>
|
|
163
201
|
{{ 'Delete' | translate }}
|
|
164
202
|
</button>
|
|
165
203
|
</li>
|
|
166
|
-
<li class="divider" role="separator" ng-if="canInspect()"></li>
|
|
167
|
-
<li ng-if="canInspect()">
|
|
168
|
-
<a
|
|
169
|
-
ng-href="/apps/administration#/eventprocessing/{{ rule.cepModuleId }}"
|
|
170
|
-
title="{{ 'Inspect smart rule' | translate }}"
|
|
171
|
-
type="button"
|
|
172
|
-
>
|
|
173
|
-
<i c8y-icon="c8y-smart-rules c8y-icon-mono"></i>
|
|
174
|
-
{{ 'Inspect' | translate }}
|
|
175
|
-
</a>
|
|
176
|
-
</li>
|
|
177
204
|
</ul>
|
|
178
205
|
</div>
|
|
179
206
|
</div>
|
|
@@ -210,8 +237,8 @@
|
|
|
210
237
|
|
|
211
238
|
<button
|
|
212
239
|
class="btn c8y-btn-checkbox m-r-0"
|
|
213
|
-
type="button"
|
|
214
240
|
ng-class="{ active: hasSource(rule) }"
|
|
241
|
+
type="button"
|
|
215
242
|
ng-click="toggleRuleActivationForContextMO(rule)"
|
|
216
243
|
>
|
|
217
244
|
<i
|
|
@@ -220,8 +247,18 @@
|
|
|
220
247
|
'dlt-c8y-icon-ban text-danger': !hasSource(rule)
|
|
221
248
|
}"
|
|
222
249
|
></i>
|
|
223
|
-
<span
|
|
224
|
-
|
|
250
|
+
<span
|
|
251
|
+
translate
|
|
252
|
+
ng-if="hasSource(rule)"
|
|
253
|
+
>
|
|
254
|
+
Active`rule`
|
|
255
|
+
</span>
|
|
256
|
+
<span
|
|
257
|
+
translate
|
|
258
|
+
ng-if="!hasSource(rule)"
|
|
259
|
+
>
|
|
260
|
+
Inactive`rule`
|
|
261
|
+
</span>
|
|
225
262
|
</button>
|
|
226
263
|
</div>
|
|
227
264
|
|
|
@@ -231,14 +268,17 @@
|
|
|
231
268
|
>
|
|
232
269
|
<div class="list-icon">
|
|
233
270
|
<i
|
|
271
|
+
ng-class="statusClass(rule)"
|
|
234
272
|
c8y-icon="{{ statusIcon(rule) }}"
|
|
235
273
|
uib-tooltip="{{ status(rule) | translate }}"
|
|
236
274
|
tooltip-popup-delay="500"
|
|
237
275
|
tooltip-append-to-body="true"
|
|
238
|
-
ng-class="statusClass(rule)"
|
|
239
276
|
></i>
|
|
240
277
|
</div>
|
|
241
|
-
<div
|
|
278
|
+
<div
|
|
279
|
+
class="card-icon"
|
|
280
|
+
ng-class="statusClass(rule)"
|
|
281
|
+
>
|
|
242
282
|
<i c8y-icon="{{ statusIcon(rule) }}"></i>
|
|
243
283
|
<span class="text-default">
|
|
244
284
|
{{ status(rule) | translate }}
|
|
@@ -246,7 +286,10 @@
|
|
|
246
286
|
</div>
|
|
247
287
|
</div>
|
|
248
288
|
|
|
249
|
-
<div
|
|
289
|
+
<div
|
|
290
|
+
class="smart-rule-children"
|
|
291
|
+
ng-if="children.length > 0"
|
|
292
|
+
>
|
|
250
293
|
<label translate>Children</label>
|
|
251
294
|
<c8y-child-assets-selector
|
|
252
295
|
ng-if="::canApplyOnChildren(rule)"
|
|
@@ -286,8 +329,8 @@
|
|
|
286
329
|
<div class="card-actions-group separator">
|
|
287
330
|
<button
|
|
288
331
|
class="btn-flip"
|
|
289
|
-
type="button"
|
|
290
332
|
title="{{ 'Details' | translate }}"
|
|
333
|
+
type="button"
|
|
291
334
|
ng-click="isFlipped = !isFlipped"
|
|
292
335
|
>
|
|
293
336
|
<i c8y-icon="reply"></i>
|
|
@@ -295,7 +338,10 @@
|
|
|
295
338
|
</button>
|
|
296
339
|
</div>
|
|
297
340
|
</div>
|
|
298
|
-
<div
|
|
341
|
+
<div
|
|
342
|
+
class="card card-back"
|
|
343
|
+
uib-collapse="!isOpen[rule.id]"
|
|
344
|
+
>
|
|
299
345
|
<div class="card-header-actions">
|
|
300
346
|
<div class="smart-list-icon-label">
|
|
301
347
|
<span class="dot">
|
|
@@ -328,11 +374,18 @@
|
|
|
328
374
|
</dl>
|
|
329
375
|
</div>
|
|
330
376
|
|
|
331
|
-
<div
|
|
377
|
+
<div
|
|
378
|
+
class="col-sm-9"
|
|
379
|
+
ng-if="isOpen[rule.id] || isFlipped"
|
|
380
|
+
>
|
|
332
381
|
<div class="legend form-block">
|
|
333
382
|
{{ 'History of changes' | translate }}
|
|
334
383
|
</div>
|
|
335
|
-
<div
|
|
384
|
+
<div
|
|
385
|
+
class="m-b-16"
|
|
386
|
+
c8y-audit-list
|
|
387
|
+
filter="{source: rule.id}"
|
|
388
|
+
></div>
|
|
336
389
|
</div>
|
|
337
390
|
</div>
|
|
338
391
|
</div>
|
|
@@ -340,8 +393,8 @@
|
|
|
340
393
|
<div class="card-actions-group separator">
|
|
341
394
|
<button
|
|
342
395
|
class="btn-flip"
|
|
343
|
-
type="button"
|
|
344
396
|
title="{{ 'Back' | translate }}"
|
|
397
|
+
type="button"
|
|
345
398
|
ng-click="isFlipped = !isFlipped"
|
|
346
399
|
>
|
|
347
400
|
<i c8y-icon="reply"></i>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Administrator Event processing",
|
|
3
|
-
"ngModules": [
|
|
4
|
-
"c8y.eventProcessing"
|
|
5
|
-
],
|
|
6
|
-
"category": "Administration",
|
|
7
|
-
"description": "Administrators can define and update realtime event processing rules. Adds items to the navigator and allows create, deletion and update of rules. Rule execution can be debugged.",
|
|
8
|
-
"js": [
|
|
9
|
-
"index.js",
|
|
10
|
-
"list/eventProcessingRulesList.component.js",
|
|
11
|
-
"details/eventProcessingRuleDetails.component.js",
|
|
12
|
-
"details/eventProcessingRuleTitle.component.js",
|
|
13
|
-
"details/eventProcessingRuleAlarms.component.js",
|
|
14
|
-
"details/eventProcessingRuleNotifications.component.js",
|
|
15
|
-
"details/eventProcessingRuleMetrics.component.js",
|
|
16
|
-
"details/eventProcessingRulesExamples.component.js",
|
|
17
|
-
"services/eventProcessing.js"
|
|
18
|
-
],
|
|
19
|
-
"folderName": "eventProcessing",
|
|
20
|
-
"appsInclude": [
|
|
21
|
-
"administration"
|
|
22
|
-
]
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";!function(){function e(n){var t=this;_.assign(t,{$onChanges:function(e){e.rule&&t.rule&&n.getAlarmListFilters(t.rule).then(function(e){t.alarmListFilters=e})}})}e.$inject=["eventProcessingSvc"],angular.module("c8y.eventProcessing").component("c8yEventProcessingRuleAlarms",{bindings:{rule:"<"},templateUrl:":::PLUGIN_PATH:::/details/eventProcessingRuleAlarms.html",controller:e,controllerAs:"vm"})}();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";!function(){function e(n,t,e,o,i,s,l,c,a,r,u){var d,g,m,f=this,h=e.moduleId,p={left:{"grid__col--fullspan":!1,hidden:!1},right:{"grid__col--fullspan":!1,hidden:!1}},v={mode:"sql",useWrapMode:!0,showGutter:!0,onLoad:function(e){(g=e).$blockScrolling=1/0}};function E(){h?i.detail(h).then(D):D({name:u.getString("newmodule`KEEP_ORIGINAL`"),status:"DEPLOYED",isNew:!0})}function D(e){(f.module=e).isNew||(f.loadedName=f.module.name),f.moduleDeployed="DEPLOYED"===f.module.status,d=_.cloneDeep(e),m||(m=n.$on("$locationChangeStart",$))}function w(e){var n=f.module.body;n=n?"".concat(n,"\n\n"):"",f.module.body=n+e.value}function P(){f.moduleForm.aceEditor.$setDirty()}function y(e){var n=_.get(e,"data",e),t=_.get(n,"message",""),o=_.get(t.match(/\[((\s|\S)+)\]/),1);if(o){var i=g.find(o,{wrap:!0,preventScroll:!0}),s=t.match(/at line (\d+) column (\d+)/),l=_.toNumber(_.get(s,1,1))-1,a=_.toNumber(_.get(s,2,0)),r={row:_.get(i,"start.row",0)+l,column:_.get(i,"start.column",0)+a};g&&(g.gotoLine(r.row+1,r.column,!0),function(e,n,t,o){var i=g.session.getAnnotations();i.push({row:e,column:n,text:t,type:o||"error"}),g.session.setAnnotations(i)}(r.row,r.column,u.getString(t),"error"))}else c.danger(u.getString(t),n)}function S(e){h?E():t.path("eventprocessing/".concat(e.id))}function $(e,n){var t;return d.id&&!_.isEqual(d,f.module)&&(e.preventDefault(),t=s({title:r("Discard changes"),body:r("You are about to leave this page and discard the changes made. Do you want to proceed?"),status:"warning",labels:{ok:r("Discard")}}).then(function(){d=_.cloneDeep(f.module),o.location.href=n})),t}_.assign(f,{panelClasses:p,aceEditorStyles:{height:"100%",width:"100%","min-height":"50vh"},aceEditorOptions:v,isSmartRuleModule:i.isSmartRuleModule,$onInit:function(){a.redirectToRootIfPluginDisabled().then(E),a.getPermissions().then(function(e){return _.assign(f,{permissions:e})})},onModuleDeployedChanged:function(e){f.module.status=e?"DEPLOYED":"NOT_DEPLOYED"},expand:function(e){_.forEach(p,function(e){e["grid__col--fullspan"]=!1,e.hidden=!0}),p[e]["grid__col--fullspan"]=!0,p[e].hidden=!1},collapse:function(){_.forEach(p,function(e){e["grid__col--fullspan"]=!1,e.hidden=!1})},isExpanded:function(e){return!0===p[e]["grid__col--fullspan"]},browseExamples:function(){return l.open({component:"c8yEventProcessingRulesExamples",size:"lg"}).result.then(w).then(P)},save:function(e,n){g.session.clearAnnotations(),i.save(e,{silentError:!0}).then(S).then(function(){c.success(u.getString('Module "{{name}}" saved.',e)),n.$setPristine(),f.loadedName=f.module.name}).catch(y)},cancel:function(){t.path("eventprocessing")}})}e.$inject=["$scope","$location","$routeParams","$window","c8yCepModule","c8yModal","$uibModal","c8yAlert","eventProcessingSvc","gettext","gettextCatalog"],angular.module("c8y.eventProcessing").component("c8yEventProcessingRuleDetails",{templateUrl:":::PLUGIN_PATH:::/details/eventProcessingRuleDetails.html",controller:e,controllerAs:"vm"})}();
|