@c8y/ng1-modules 1018.0.29 → 1018.0.31
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/core/ui/properties/computedProperties.provider.js +1 -1
- package/core/ui/properties/computedPropertyConfigModal.html +40 -35
- package/core/ui/properties/lastMeasurementConfig.html +8 -7
- package/core/ui/properties/schemaPropertySelector.html +24 -21
- package/dataPointExplorer/views/widgetConfig.html +1 -1
- package/dataPointTable/views/widgetConfig.html +1 -1
- package/kpi/views/listConfig.html +25 -7
- package/package.json +1 -1
- package/scada/views/componentConfig.html +63 -34
- package/scada/views/mapping.html +112 -101
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function t(c){t.$inject=["$injector","c8yModal"];var i,a=new WeakMap,f={},u={},p={};function s(t,e,r){var o=f[t],n=_.isArray(e)?e:e.$inject;void 0===n&&(n=c.annotate(e));var i=_.includes(n,"config");if(o)throw new Error('Computed property "'.concat(t,'" already registered'));if(i){if(p[t])throw new Error('Computed property factory "'.concat(t,'" already registered'));p[t]={config:r,property:e}}f[t]={config:r,property:e}}function e(o,t){var n=p[t];if(!n)throw new Error('Computed property factory "'.concat(t,'" is not registered'));return{create:function(t,e){if(u[t])throw new Error('Computed property "'.concat(t,'" already registered'));return u[t]={getter:o.invoke(n.property,void 0,{config:e}),config:n.config},!0},attach:function(t,e,r){d(t,e,{getter:o.invoke(n.property,void 0,{config:r})})}}}function r(r){_.forEach(f,function(e,t){u[t]||(u[t]={_lazy:!0,getter:function(){var t=this._getter;return t||(this._getter=r.invoke(e.property,void 0,{config:!1}),t=this._getter),t},config:e.config})})}function g(t,e){if(_.isArray(e))return function(e,t){var c=_.keys(p),a=_.union(_.keys(u),c);_(t).filter("computed").map(function(t){var e=_.last(t.id.split("!!")),r=(t.config||{})._id||String(Math.random()).substr(2),o=t.config||{},n=_.includes(a,e),i=e+(_.includes(c,e)?"_".concat(r):"");return(t.config=o)._id=r,n&&(t.keyPath=[i]),{key:e,keyPath:i,isFactory:_.includes(c,e),config:o,exists:n}}).filter("exists").forEach(function(t){t.isFactory?i(t.key).attach(e,t.keyPath,t.config):g(e,t.key)})}(t,e),t;var r=e;if(r){var o=u[r];if(!o)throw new Error('Computed property "'.concat(r,'" is not registered.'));d(t,r,o)}else!function(i){_.forEach(u,function(e,r){var t=function(t){return t&&d(i,r,e)},o=(e.config||{}).attachIf,n=(o=o||_.constant(!0))(i);_.isFunction(_.get(n,"then"))?n.then(t):t(n)})}(t);return t}function d(t,e,r){if(_.isObjectLike(t)){if(!_.has(t,e)){var o=r._lazy?r.getter():r.getter,n=o.detach||_.noop,i=a.get(t);i||(i=[],a.set(t,i)),i.push(function(t){n(t),delete t[e]}),Object.defineProperty(t,e,{enumerable:!1,configurable:!0,get:function(){return o(this)}})}}else console.warn("[Computed properties] Managed object is not an object")}function l(e){var r=this,t=a.get(e);_.forEach(t,function(t){try{t.call(r,e)}catch(t){console.error("Error detaching computed property",t)}}),a.delete(e)}function t(t,n){var o=_.partial(r,t);return{register:function(t,e,r){s(t,e,r),o()},attach:g,detach:l,factory:i=_.partial(e,t),init:o,edit:function(t){var e=_.last(t.id.split("!!")),r=p[e];if(!r)throw new Error("".concat(e," is not a factory computed property."));var o=_.get(r,"config.configTemplateUrl");return n({templateUrl:":::PLUGIN_PATH:::/ui/properties/computedPropertyConfigModal.html",controller:"ComputedPropertyConfigCtrl",size:"
|
|
1
|
+
"use strict";!function(){function t(c){t.$inject=["$injector","c8yModal"];var i,a=new WeakMap,f={},u={},p={};function s(t,e,r){var o=f[t],n=_.isArray(e)?e:e.$inject;void 0===n&&(n=c.annotate(e));var i=_.includes(n,"config");if(o)throw new Error('Computed property "'.concat(t,'" already registered'));if(i){if(p[t])throw new Error('Computed property factory "'.concat(t,'" already registered'));p[t]={config:r,property:e}}f[t]={config:r,property:e}}function e(o,t){var n=p[t];if(!n)throw new Error('Computed property factory "'.concat(t,'" is not registered'));return{create:function(t,e){if(u[t])throw new Error('Computed property "'.concat(t,'" already registered'));return u[t]={getter:o.invoke(n.property,void 0,{config:e}),config:n.config},!0},attach:function(t,e,r){d(t,e,{getter:o.invoke(n.property,void 0,{config:r})})}}}function r(r){_.forEach(f,function(e,t){u[t]||(u[t]={_lazy:!0,getter:function(){var t=this._getter;return t||(this._getter=r.invoke(e.property,void 0,{config:!1}),t=this._getter),t},config:e.config})})}function g(t,e){if(_.isArray(e))return function(e,t){var c=_.keys(p),a=_.union(_.keys(u),c);_(t).filter("computed").map(function(t){var e=_.last(t.id.split("!!")),r=(t.config||{})._id||String(Math.random()).substr(2),o=t.config||{},n=_.includes(a,e),i=e+(_.includes(c,e)?"_".concat(r):"");return(t.config=o)._id=r,n&&(t.keyPath=[i]),{key:e,keyPath:i,isFactory:_.includes(c,e),config:o,exists:n}}).filter("exists").forEach(function(t){t.isFactory?i(t.key).attach(e,t.keyPath,t.config):g(e,t.key)})}(t,e),t;var r=e;if(r){var o=u[r];if(!o)throw new Error('Computed property "'.concat(r,'" is not registered.'));d(t,r,o)}else!function(i){_.forEach(u,function(e,r){var t=function(t){return t&&d(i,r,e)},o=(e.config||{}).attachIf,n=(o=o||_.constant(!0))(i);_.isFunction(_.get(n,"then"))?n.then(t):t(n)})}(t);return t}function d(t,e,r){if(_.isObjectLike(t)){if(!_.has(t,e)){var o=r._lazy?r.getter():r.getter,n=o.detach||_.noop,i=a.get(t);i||(i=[],a.set(t,i)),i.push(function(t){n(t),delete t[e]}),Object.defineProperty(t,e,{enumerable:!1,configurable:!0,get:function(){return o(this)}})}}else console.warn("[Computed properties] Managed object is not an object")}function l(e){var r=this,t=a.get(e);_.forEach(t,function(t){try{t.call(r,e)}catch(t){console.error("Error detaching computed property",t)}}),a.delete(e)}function t(t,n){var o=_.partial(r,t);return{register:function(t,e,r){s(t,e,r),o()},attach:g,detach:l,factory:i=_.partial(e,t),init:o,edit:function(t){var e=_.last(t.id.split("!!")),r=p[e];if(!r)throw new Error("".concat(e," is not a factory computed property."));var o=_.get(r,"config.configTemplateUrl");return n({templateUrl:":::PLUGIN_PATH:::/ui/properties/computedPropertyConfigModal.html",controller:"ComputedPropertyConfigCtrl",size:"sm",resolve:{options:function(){return{configTemplateUrl:o,computedProperty:e,configSchema:_.isObjectLike(t.configSchema)&&t.configSchema,config:angular.copy(t.config)||{},prop:t}}}})},listFactories:function(){return _.map(p,function(t,e){return{id:e,config:_.clone(t.config)}})}}}return{register:s,$get:t}}function e(t){t.init()}e.$inject=["c8yComputedProperties"],t.$inject=["$injector"],angular.module("c8y.ui").provider("c8yComputedProperties",t).run(e)}();
|
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
<div class="modal
|
|
2
|
-
<
|
|
3
|
-
</div>
|
|
4
|
-
<div class="modal-body" id="modal-body">
|
|
5
|
-
<h4>
|
|
1
|
+
<div class="c8y-viewport-modal">
|
|
2
|
+
<div class="modal-header dialog-header">
|
|
6
3
|
<i c8y-icon="bolt"></i>
|
|
7
|
-
|
|
8
|
-
</
|
|
4
|
+
<div id="modal-title-property" class="h4" translate>Computed property configuration</div>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="modal-inner-scroll">
|
|
7
|
+
<p class="text-center bg-level-0 text-medium text-16 p-t-16 p-b-16 sticky-top separator-bottom"
|
|
8
|
+
style="z-index: 110;">
|
|
9
|
+
{{ computedProperty}}
|
|
10
|
+
</p>
|
|
11
|
+
<div class="modal-body no-card-context p-t-16" id="modal-body-property">
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
13
|
+
<form name="configForm" novalidate>
|
|
14
|
+
<div ng-if="configTemplateUrl" ng-include="configTemplateUrl"></div>
|
|
15
|
+
<c8y-schema-form
|
|
16
|
+
ng-if="configSchema"
|
|
17
|
+
schema="configSchema"
|
|
18
|
+
form="['*']"
|
|
19
|
+
model="config"
|
|
20
|
+
></c8y-schema-form>
|
|
21
|
+
</form>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="modal-footer">
|
|
25
|
+
<button
|
|
26
|
+
class="btn btn-default"
|
|
27
|
+
type="button"
|
|
28
|
+
title="{{ 'Cancel' | translate }}"
|
|
29
|
+
ng-click="$dismiss()"
|
|
30
|
+
>
|
|
31
|
+
{{ 'Cancel' | translate }}
|
|
32
|
+
</button>
|
|
33
|
+
<button
|
|
34
|
+
class="btn btn-primary"
|
|
35
|
+
type="button"
|
|
36
|
+
title="{{ 'Save' | translate }}"
|
|
37
|
+
ng-click="$close(config)"
|
|
38
|
+
ng-disabled="configForm.$invalid"
|
|
39
|
+
>
|
|
40
|
+
{{ 'Save' | translate }}
|
|
41
|
+
</button>
|
|
42
|
+
</div>
|
|
38
43
|
</div>
|
|
@@ -22,13 +22,14 @@
|
|
|
22
22
|
|
|
23
23
|
<div class="form-group">
|
|
24
24
|
<label for="returnTypeField" translate>Return type</label>
|
|
25
|
-
<select
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
<div class="c8y-select-wrapper">
|
|
26
|
+
<select
|
|
27
|
+
id="returnTypeField"
|
|
28
|
+
class="form-control"
|
|
29
|
+
ng-model="config.resultType"
|
|
30
|
+
ng-options="resultType.value as (resultType.label | translate) for resultType in resultTypes.values()"
|
|
31
|
+
></select>
|
|
32
|
+
</div>
|
|
32
33
|
</div>
|
|
33
34
|
</ng-form>
|
|
34
35
|
</div>
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
<div class="form-group m-16">
|
|
7
7
|
<div class="input-group input-group-search">
|
|
8
8
|
<input
|
|
9
|
-
type="search"
|
|
10
9
|
class="form-control"
|
|
11
|
-
|
|
10
|
+
type="search"
|
|
12
11
|
ng-model="search"
|
|
12
|
+
placeholder="{{ 'Filter properties' | translate }}"
|
|
13
13
|
/>
|
|
14
14
|
<span class="input-group-addon">
|
|
15
15
|
<i c8y-icon="search" ng-show="search.length === 0 || !search"></i>
|
|
16
16
|
<i
|
|
17
17
|
c8y-icon="times"
|
|
18
18
|
class="text-muted"
|
|
19
|
-
ng-show="search.length > 0"
|
|
20
19
|
ng-click="search = ''"
|
|
20
|
+
ng-show="search.length > 0"
|
|
21
21
|
></i>
|
|
22
22
|
</span>
|
|
23
23
|
</div>
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
|
|
40
40
|
<div
|
|
41
41
|
class="modal-inner-scroll container-fluid"
|
|
42
|
-
id="modal-body"
|
|
43
42
|
style="max-height: calc(100vh - 340px)"
|
|
43
|
+
id="modal-body"
|
|
44
44
|
>
|
|
45
45
|
<div class="row">
|
|
46
46
|
<div
|
|
@@ -49,21 +49,24 @@
|
|
|
49
49
|
>
|
|
50
50
|
<div class="col-xs-2">
|
|
51
51
|
<span ng-switch="selectSingle">
|
|
52
|
-
<label ng-switch-when="true"
|
|
52
|
+
<label class="c8y-radio" ng-switch-when="true">
|
|
53
53
|
<input
|
|
54
|
-
name="property"
|
|
55
54
|
type="radio"
|
|
55
|
+
aria-label="{{ property.label }}"
|
|
56
|
+
id="radio-{{ property.keyPath.join('.') }}"
|
|
57
|
+
name="property"
|
|
56
58
|
ng-model="properties.selected"
|
|
57
59
|
ng-value="property"
|
|
58
60
|
/>
|
|
59
61
|
<span></span>
|
|
60
62
|
</label>
|
|
61
|
-
<label
|
|
63
|
+
<label class="c8y-checkbox" ng-switch-default>
|
|
62
64
|
<input
|
|
63
65
|
type="checkbox"
|
|
64
|
-
|
|
66
|
+
aria-label="{{ property.label }}"
|
|
67
|
+
id="checkbox-{{ property.keyPath.join('.') }}"
|
|
65
68
|
ng-change="onSelectProperty(property)"
|
|
66
|
-
|
|
69
|
+
ng-model="property.__active"
|
|
67
70
|
/>
|
|
68
71
|
<span></span>
|
|
69
72
|
</label>
|
|
@@ -71,22 +74,22 @@
|
|
|
71
74
|
</div>
|
|
72
75
|
<div
|
|
73
76
|
class="col-xs-5 text-truncate"
|
|
74
|
-
title="{{ property.label | translate }}"
|
|
75
77
|
ng-class="{ strong: isComplexProperty(property) }"
|
|
78
|
+
title="{{ property.label | translate }}"
|
|
76
79
|
>
|
|
77
80
|
<span>
|
|
78
81
|
<button
|
|
79
82
|
class="btn btn-dot"
|
|
80
83
|
type="button"
|
|
81
|
-
aria-label="{{
|
|
82
|
-
'Complex property. Subproperties are listed below.`tooltip`' | translate
|
|
83
|
-
}}"
|
|
84
84
|
uib-tooltip="{{
|
|
85
85
|
'Complex property. Subproperties are listed below.`tooltip`' | translate
|
|
86
86
|
}}"
|
|
87
|
+
tooltip-append-to-body="true"
|
|
87
88
|
tooltip-placement="right"
|
|
88
89
|
tooltip-popup-delay="500"
|
|
89
|
-
|
|
90
|
+
aria-label="{{
|
|
91
|
+
'Complex property. Subproperties are listed below.`tooltip`' | translate
|
|
92
|
+
}}"
|
|
90
93
|
ng-if="isComplexProperty(property) && isAtLeastOneSubpropertyListed(property)"
|
|
91
94
|
>
|
|
92
95
|
<i c8y-icon="tags" class="text-info"></i>
|
|
@@ -94,25 +97,25 @@
|
|
|
94
97
|
<button
|
|
95
98
|
class="btn btn-dot"
|
|
96
99
|
type="button"
|
|
97
|
-
aria-label="{{ 'Complex property.`tooltip`' | translate }}"
|
|
98
100
|
uib-tooltip="{{ 'Complex property.`tooltip`' | translate }}"
|
|
99
|
-
tooltip-placement="right"
|
|
100
101
|
tooltip-append-to-body="true"
|
|
102
|
+
tooltip-placement="right"
|
|
103
|
+
aria-label="{{ 'Complex property.`tooltip`' | translate }}"
|
|
101
104
|
ng-if="isComplexProperty(property) && !isAtLeastOneSubpropertyListed(property)"
|
|
102
105
|
>
|
|
103
|
-
<i class="text-info"
|
|
106
|
+
<i c8y-icon="tag" class="text-info"></i>
|
|
104
107
|
</button>
|
|
105
108
|
<button
|
|
106
109
|
class="btn btn-dot"
|
|
107
110
|
type="button"
|
|
108
|
-
aria-label="{{ 'Computed property.`tooltip`' | translate }}"
|
|
109
111
|
uib-tooltip="{{ 'Computed property.`tooltip`' | translate }}"
|
|
112
|
+
tooltip-append-to-body="true"
|
|
110
113
|
tooltip-placement="right"
|
|
111
114
|
tooltip-popup-delay="500"
|
|
112
|
-
|
|
115
|
+
aria-label="{{ 'Computed property.`tooltip`' | translate }}"
|
|
113
116
|
ng-show="property.computed"
|
|
114
117
|
>
|
|
115
|
-
<i class="text-primary-light"
|
|
118
|
+
<i c8y-icon="bolt" class="text-primary-light"></i>
|
|
116
119
|
</button>
|
|
117
120
|
</span>
|
|
118
121
|
{{ property.label | translate }}
|
|
@@ -137,8 +140,8 @@
|
|
|
137
140
|
class="btn btn-primary"
|
|
138
141
|
type="button"
|
|
139
142
|
title="{{ 'Select' | translate }}"
|
|
140
|
-
ng-disabled="selectIsDisabled()"
|
|
141
143
|
ng-click="close()"
|
|
144
|
+
ng-disabled="selectIsDisabled()"
|
|
142
145
|
>
|
|
143
146
|
{{ 'Select' | translate }}
|
|
144
147
|
</button>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
ng-controller="DataPointWidgetConfigCtrl"
|
|
3
3
|
ng-init="disableLocalStorage = true"
|
|
4
4
|
class="row no-card-context d-flex"
|
|
5
|
-
style="height: calc(100vh -
|
|
5
|
+
style="height: calc(100vh - 422px);"
|
|
6
6
|
>
|
|
7
7
|
<div class="col-md-5 bg-level-1 a-s-stretch inner-scroll">
|
|
8
8
|
<div class="p-l-24 bg-inherit p-t-8">
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
ng-controller="DataPointWidgetConfigCtrl"
|
|
3
3
|
ng-init="disableLocalStorage = true"
|
|
4
4
|
class="row no-card-context d-flex"
|
|
5
|
-
style="height: calc(100vh -
|
|
5
|
+
style="height: calc(100vh - 422px);"
|
|
6
6
|
>
|
|
7
7
|
<div class="col-md-5 bg-level-1 a-s-stretch inner-scroll">
|
|
8
8
|
<div class="p-l-24 bg-inherit p-t-8">
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div
|
|
3
3
|
ng-controller="listConfigCtrl"
|
|
4
4
|
class="no-card-context row m-l-0 m-r-0"
|
|
5
|
-
style="height: calc(100vh -
|
|
5
|
+
style="height: calc(100vh - 422px)"
|
|
6
6
|
>
|
|
7
7
|
<div class="col-md-6 p-l-24 inner-scroll bg-level-1">
|
|
8
8
|
<c8y-data-point-list
|
|
@@ -19,32 +19,50 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
<div class="form-group p-t-8">
|
|
21
21
|
<label class="c8y-checkbox">
|
|
22
|
-
<input
|
|
22
|
+
<input
|
|
23
|
+
type="checkbox"
|
|
24
|
+
ng-model="config.options.kpi"
|
|
25
|
+
/>
|
|
23
26
|
<span></span>
|
|
24
27
|
<span>{{ 'Label' | translate }}</span>
|
|
25
28
|
</label>
|
|
26
29
|
<label class="c8y-checkbox">
|
|
27
|
-
<input
|
|
30
|
+
<input
|
|
31
|
+
type="checkbox"
|
|
32
|
+
ng-model="config.options.target"
|
|
33
|
+
/>
|
|
28
34
|
<span></span>
|
|
29
35
|
<span>{{ 'Target' | translate }}</span>
|
|
30
36
|
</label>
|
|
31
37
|
<label class="c8y-checkbox">
|
|
32
|
-
<input
|
|
38
|
+
<input
|
|
39
|
+
type="checkbox"
|
|
40
|
+
ng-model="config.options.current"
|
|
41
|
+
/>
|
|
33
42
|
<span></span>
|
|
34
43
|
<span>{{ 'Current' | translate }}</span>
|
|
35
44
|
</label>
|
|
36
45
|
<label class="c8y-checkbox">
|
|
37
|
-
<input
|
|
46
|
+
<input
|
|
47
|
+
type="checkbox"
|
|
48
|
+
ng-model="config.options.diff"
|
|
49
|
+
/>
|
|
38
50
|
<span></span>
|
|
39
51
|
<span>{{ 'Diff' | translate }}</span>
|
|
40
52
|
</label>
|
|
41
53
|
<label class="c8y-checkbox">
|
|
42
|
-
<input
|
|
54
|
+
<input
|
|
55
|
+
type="checkbox"
|
|
56
|
+
ng-model="config.options.diffPercentage"
|
|
57
|
+
/>
|
|
43
58
|
<span></span>
|
|
44
59
|
<span>{{ 'Diff %' | translate }}</span>
|
|
45
60
|
</label>
|
|
46
61
|
<label class="c8y-checkbox">
|
|
47
|
-
<input
|
|
62
|
+
<input
|
|
63
|
+
type="checkbox"
|
|
64
|
+
ng-model="config.options.asset"
|
|
65
|
+
/>
|
|
48
66
|
<span></span>
|
|
49
67
|
<span>{{ 'Asset' | translate }}</span>
|
|
50
68
|
</label>
|
package/package.json
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
<div
|
|
2
|
-
|
|
1
|
+
<div
|
|
2
|
+
ng-controller="ScadaWidgetConfigCtrl as ctrl"
|
|
3
|
+
class="p-t-8"
|
|
4
|
+
>
|
|
5
|
+
<div>
|
|
3
6
|
<label>
|
|
4
7
|
<span translate>SVG</span>
|
|
5
8
|
<button
|
|
@@ -14,7 +17,10 @@
|
|
|
14
17
|
></button>
|
|
15
18
|
</label>
|
|
16
19
|
|
|
17
|
-
<div
|
|
20
|
+
<div
|
|
21
|
+
class="alert alert-info text-left"
|
|
22
|
+
ng-show="svgTooltipVisible"
|
|
23
|
+
>
|
|
18
24
|
<p translate>
|
|
19
25
|
For placeholder to be recognized it needs to be used at least once in curly braces with no
|
|
20
26
|
other expression, for example,
|
|
@@ -59,44 +65,54 @@
|
|
|
59
65
|
</div>
|
|
60
66
|
|
|
61
67
|
<div class="form-group">
|
|
62
|
-
<label translate>Select code sanitization option</label>
|
|
68
|
+
<label for="sanitization" translate>Select code sanitization option</label>
|
|
63
69
|
<div class="c8y-select-wrapper">
|
|
64
70
|
<select
|
|
65
71
|
class="form-control"
|
|
72
|
+
id="sanitization"
|
|
66
73
|
ng-model="config.sanitization"
|
|
67
74
|
ng-init="config.sanitization = config.sanitization || 'strict'"
|
|
68
75
|
>
|
|
69
|
-
<option
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
<option
|
|
77
|
+
value="strict"
|
|
78
|
+
translate
|
|
79
|
+
>strict`code sanitization`</option>
|
|
80
|
+
<option
|
|
81
|
+
value="lax"
|
|
82
|
+
translate
|
|
83
|
+
>lax`code sanitization`</option>
|
|
84
|
+
<option
|
|
85
|
+
value="none"
|
|
86
|
+
translate
|
|
87
|
+
>none`code sanitization`</option>
|
|
72
88
|
</select>
|
|
73
89
|
</div>
|
|
74
90
|
</div>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
91
|
+
<div class="form-group">
|
|
92
|
+
<file-picker
|
|
93
|
+
files="ctrl.files"
|
|
94
|
+
multiple="false"
|
|
95
|
+
display-drop-zone="false"
|
|
96
|
+
on-file-selected="ctrl.onSelectFile(ctrl.files[0].file)"
|
|
97
|
+
></file-picker>
|
|
98
|
+
<input type="hidden" />
|
|
99
|
+
</div>
|
|
84
100
|
</div>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
<div class="form-group p-t-16">
|
|
102
|
+
<label class="input-group">{{ 'Preview' | translate }}</label>
|
|
103
|
+
<span
|
|
104
|
+
id="helpBlock"
|
|
105
|
+
class="help-block m-b-8"
|
|
106
|
+
translate
|
|
107
|
+
>SVG content will be sanitized.</span>
|
|
108
|
+
<span
|
|
109
|
+
ng-show="ctrl.loading"
|
|
110
|
+
class="m-l-4"
|
|
111
|
+
>
|
|
112
|
+
<i
|
|
113
|
+
c8y-icon="spinner"
|
|
114
|
+
class="icon-spin"
|
|
115
|
+
></i>
|
|
100
116
|
</span>
|
|
101
117
|
<div ng-switch="!!(ctrl.device && forms.componentForm.mapping.$valid && config.mapping)">
|
|
102
118
|
<div
|
|
@@ -107,11 +123,24 @@
|
|
|
107
123
|
device="ctrl.device"
|
|
108
124
|
devices="ctrl.devices"
|
|
109
125
|
device-ids="config.deviceIds"
|
|
110
|
-
style="height: 200px"
|
|
111
126
|
></div>
|
|
112
|
-
<div
|
|
113
|
-
|
|
127
|
+
<div
|
|
128
|
+
ng-switch-default
|
|
129
|
+
class="alert alert-info"
|
|
130
|
+
translate
|
|
131
|
+
>
|
|
132
|
+
Select a device and fill all mappings to preview an SVG.
|
|
114
133
|
</div>
|
|
115
134
|
</div>
|
|
116
135
|
</div>
|
|
136
|
+
<div
|
|
137
|
+
c8y-scada-mapping
|
|
138
|
+
name="mapping"
|
|
139
|
+
ng-model="config.mapping"
|
|
140
|
+
device="ctrl.device"
|
|
141
|
+
devices="ctrl.devices"
|
|
142
|
+
device-ids="config.deviceIds"
|
|
143
|
+
on-device-ids-change="ctrl.onDeviceIdsChange()"
|
|
144
|
+
></div>
|
|
145
|
+
|
|
117
146
|
</div>
|
package/scada/views/mapping.html
CHANGED
|
@@ -1,102 +1,113 @@
|
|
|
1
|
-
<
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
ng-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
<div class="svg-mappings">
|
|
2
|
+
<label>{{ 'Mappings' | translate }}</label>
|
|
3
|
+
<ul class="c8y-list__group c8y-list__group--strip">
|
|
4
|
+
<li class="c8y-list__item" ng-repeat="mapping in mappings | orderBy:'placeholder'">
|
|
5
|
+
<div class="c8y-list__item__block d-block">
|
|
6
|
+
<div class="c8y-list__item__body">
|
|
7
|
+
<div class="row">
|
|
8
|
+
<div class="col-md-4">
|
|
9
|
+
<label class="text-label-small d-block" translate>Placeholder</label>
|
|
10
|
+
<div class="text-medium">
|
|
11
|
+
<i
|
|
12
|
+
c8y-icon="exclamation-circle"
|
|
13
|
+
class="m-r-4 text-danger"
|
|
14
|
+
ng-show="hasError[mapping.placeholder]"
|
|
15
|
+
></i>
|
|
16
|
+
<span title="{{ mapping.placeholder }}">
|
|
17
|
+
{{ mapping.placeholder }}
|
|
18
|
+
</span>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="col-md-8">
|
|
22
|
+
<label class="text-label-small d-block" translate>Target</label>
|
|
23
|
+
<div class="form-group-sm form-group">
|
|
24
|
+
<span ng-show="!devices.length">---</span>
|
|
25
|
+
<span
|
|
26
|
+
class="text-truncate"
|
|
27
|
+
title="{{ devices[0].name }}"
|
|
28
|
+
ng-show="devices.length == 1"
|
|
29
|
+
>
|
|
30
|
+
{{ devices[0].name }}
|
|
31
|
+
</span>
|
|
32
|
+
<div class="c8y-select-wrapper" ng-show="devices.length > 1">
|
|
33
|
+
<select
|
|
34
|
+
class="form-control"
|
|
35
|
+
ng-change="onDeviceIdsChange()"
|
|
36
|
+
ng-model="deviceIds[mapping.placeholder]"
|
|
37
|
+
ng-options="device.id as device.name for device in devices"
|
|
38
|
+
required
|
|
39
|
+
></select>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="col-md-4" ng-switch="!!mapping.config.configSchema">
|
|
44
|
+
<label class="text-label-small d-block" translate>Mapped to</label>
|
|
45
|
+
<button
|
|
46
|
+
class="btn btn-sm btn-default text-truncate"
|
|
47
|
+
type="button"
|
|
48
|
+
title=" {{ humanizeValue(mapping) }}"
|
|
49
|
+
ng-click="editComputedProperty(mapping)"
|
|
50
|
+
ng-switch-when="true"
|
|
51
|
+
>
|
|
52
|
+
<i c8y-icon="bolt"></i>
|
|
53
|
+
<span>
|
|
54
|
+
{{ humanizeValue(mapping) }}
|
|
55
|
+
</span>
|
|
56
|
+
</button>
|
|
57
|
+
<div class="form-control-static">
|
|
58
|
+
<span class="text-truncate" title="{{ humanizeValue(mapping) }}" ng-switch-default>
|
|
59
|
+
{{ humanizeValue(mapping) }}
|
|
60
|
+
</span>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<div class="col-md-4">
|
|
64
|
+
<label class="text-label-small d-block" translate>Current value</label>
|
|
65
|
+
<div class="form-control-static" title="{{ propertyValueFor(mapping) }}">
|
|
66
|
+
<span class="text-truncate text-monospace">
|
|
67
|
+
{{ propertyValueFor(mapping) }}
|
|
68
|
+
</span>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="col-md-4">
|
|
72
|
+
<label class="text-label-small d-block" translate>Actions</label>
|
|
73
|
+
<button
|
|
74
|
+
class="btn btn-default btn-sm"
|
|
75
|
+
type="button"
|
|
76
|
+
uib-tooltip="{{ 'Clear mapping' | translate }}"
|
|
77
|
+
tooltip-append-to-body="true"
|
|
78
|
+
tooltip-popup-delay="500"
|
|
79
|
+
aria-label="{{ 'Clear mapping' | translate }}"
|
|
80
|
+
ng-click="clearMapping(mapping)"
|
|
81
|
+
ng-disabled="!mapping.config"
|
|
82
|
+
>
|
|
83
|
+
<i c8y-icon="delete-document"></i>
|
|
84
|
+
</button>
|
|
85
|
+
<button
|
|
86
|
+
class="btn btn-default btn-sm"
|
|
87
|
+
type="button"
|
|
88
|
+
uib-tooltip="{{ 'Assign fieldbus property' | translate }}"
|
|
89
|
+
tooltip-append-to-body="true"
|
|
90
|
+
tooltip-popup-delay="500"
|
|
91
|
+
aria-label="{{ 'Assign fieldbus property' | translate }}"
|
|
92
|
+
ng-click="setFieldbusMapping(mapping)"
|
|
93
|
+
>
|
|
94
|
+
<i c8y-icon="tasks"></i>
|
|
95
|
+
</button>
|
|
96
|
+
<button
|
|
97
|
+
class="btn btn-default btn-sm"
|
|
98
|
+
type="button"
|
|
99
|
+
uib-tooltip="{{ 'Assign device property' | translate }}"
|
|
100
|
+
tooltip-append-to-body="true"
|
|
101
|
+
tooltip-popup-delay="500"
|
|
102
|
+
aria-label="{{ 'Assign device property' | translate }}"
|
|
103
|
+
ng-click="setMapping(mapping)"
|
|
104
|
+
>
|
|
105
|
+
<i c8y-icon="edit"></i>
|
|
106
|
+
</button>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
49
109
|
</div>
|
|
50
|
-
</
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
title="{{ humanizeValue(mapping) }}"
|
|
55
|
-
>
|
|
56
|
-
<a
|
|
57
|
-
ng-switch-when="true"
|
|
58
|
-
class="btn btn-xs btn-default"
|
|
59
|
-
href=""
|
|
60
|
-
ng-click="editComputedProperty(mapping)"
|
|
61
|
-
>
|
|
62
|
-
<i c8y-icon="bolt"></i>
|
|
63
|
-
{{ humanizeValue(mapping) }}
|
|
64
|
-
</a>
|
|
65
|
-
<span ng-switch-default>{{ humanizeValue(mapping) }}</span>
|
|
66
|
-
</td>
|
|
67
|
-
<td class="text-truncate">
|
|
68
|
-
<span title=" {{ propertyValueFor(mapping) }}">
|
|
69
|
-
{{ propertyValueFor(mapping) }}
|
|
70
|
-
</span>
|
|
71
|
-
</td>
|
|
72
|
-
<td>
|
|
73
|
-
<div class="d-flex flex-end">
|
|
74
|
-
<button
|
|
75
|
-
type="button"
|
|
76
|
-
class="btn btn-danger btn-xs showOnHover pull-right"
|
|
77
|
-
title="{{ 'Clear mapping' | translate }}"
|
|
78
|
-
ng-click="clearMapping(mapping)"
|
|
79
|
-
>
|
|
80
|
-
<i c8y-icon="scissors"></i>
|
|
81
|
-
</button>
|
|
82
|
-
<button
|
|
83
|
-
type="button"
|
|
84
|
-
class="btn btn-primary btn-xs showOnHover pull-right"
|
|
85
|
-
title="{{ 'Assign fieldbus property' | translate }}"
|
|
86
|
-
ng-click="setFieldbusMapping(mapping)"
|
|
87
|
-
>
|
|
88
|
-
<i c8y-icon="tasks"></i>
|
|
89
|
-
</button>
|
|
90
|
-
<button
|
|
91
|
-
type="button"
|
|
92
|
-
class="btn btn-primary btn-xs showOnHover pull-right"
|
|
93
|
-
title="{{ 'Assign device property' | translate }}"
|
|
94
|
-
ng-click="setMapping(mapping)"
|
|
95
|
-
>
|
|
96
|
-
<i c8y-icon="pencil"></i>
|
|
97
|
-
</button>
|
|
98
|
-
</div>
|
|
99
|
-
</td>
|
|
100
|
-
</tr>
|
|
101
|
-
</tbody>
|
|
102
|
-
</table>
|
|
110
|
+
</div>
|
|
111
|
+
</li>
|
|
112
|
+
</ul>
|
|
113
|
+
</div>
|