@c8y/ng1-modules 1021.81.0 → 1022.4.2
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/alarmsEventsExplorer/alarmsEventsTimelinesConfig/alarmsEventsTimelinesConfig.html +1 -1
- package/assetPropertyWidget/img/asset-properties-widget-pr.png +0 -0
- package/assetPropertyWidget/views/config.html +1 -1
- package/assetTable/assetTable2/img/asset-table-widget-pr.png +0 -0
- package/assetTable/img/asset-table-widget-pr.png +0 -0
- package/core/core/services/audits.js +1 -1
- package/core/core/services/deviceShell.js +1 -1
- package/core/core/services/retentions.js +1 -1
- package/core/core/services/tenant.js +1 -1
- package/core/core/services/user.js +1 -1
- package/core/cumulocity.json +0 -1
- package/core/locales/de.po +481 -720
- package/core/locales/es.po +431 -671
- package/core/locales/fr.po +510 -751
- package/core/locales/ja_JP.po +503 -740
- package/core/locales/ko.po +431 -671
- package/core/locales/nl.po +433 -672
- package/core/locales/pl.po +431 -672
- package/core/locales/pt_BR.po +528 -768
- package/core/locales/zh_CN.po +431 -671
- package/core/locales/zh_TW.po +431 -671
- package/core/ui/properties/propertySelector.html +156 -109
- package/core/ui/services/measurementsReport.js +1 -1
- package/core/ui/views/auditList.html +2 -2
- package/core/ui/views/eventList.html +2 -2
- package/core/ui/views/filePicker.html +1 -1
- package/dataBroker/connectors/connectors.service.js +1 -1
- package/dataPointExplorer/img/data-points-graph-widget-pr.png +0 -0
- package/dataPointExplorer/views/widgetConfig.html +92 -94
- package/device-protocol-canbus/canbus-device.provider.js +1 -1
- package/device-protocol-canopen/canopen-device.provider.js +1 -1
- package/device-protocol-modbus/modbus-device.provider.js +1 -1
- package/device-protocol-opcua/opcua-device.provider.js +1 -1
- package/device-protocol-profibus/profibus-device.provider.js +1 -1
- package/device-protocols/device-protocol-import-button.component.js +1 -1
- package/device-protocols/object-mapping.component.js +1 -1
- package/device-protocols/object-mapping.html +1 -1
- package/deviceDatabase4/detail/device-type-detail.component.js +1 -1
- package/deviceDatabase4/device-database.service.js +1 -1
- package/deviceDatabase4/device-type-list.component.js +1 -1
- package/deviceDatabase4/modals/configure-discrete-io.html +1 -1
- package/deviceDatabase4/modals/configure-register.html +1 -1
- package/deviceDatabase4/modals/import-device-type.component.js +1 -1
- package/deviceDetail/cumulocity.json +1 -2
- package/deviceStatusWidget/deviceStatus.component.js +1 -1
- package/deviceStatusWidget/ownerStatus.html +2 -2
- package/deviceStatusWidget/requiredAvailabilityIntervalSetting.html +4 -4
- package/devicemanagement-eventList/index.js +1 -1
- package/enterpriseEdition/cumulocity.json +0 -13
- package/enterpriseEdition/enterpriseEdition.module.js +1 -1
- package/eventList/img/events-list-widget-pr.png +0 -0
- package/eventList/views/eventListConfig.html +39 -32
- package/export/cumulocity.json +0 -1
- package/export/index.js +1 -1
- package/export/services/config.js +1 -1
- package/htmlWidget/index.js +1 -1
- package/kpi/img/data-points-list-widget-pr.png +0 -0
- package/kpi/views/gaugeConfig.html +28 -34
- package/kpi/views/listConfig.html +14 -18
- package/kpi/views/pieChartConfig.html +30 -36
- package/modbusConfiguration4/fieldbus-device-list.component.js +1 -1
- package/modbusWidget4/modbus-widget.service.js +1 -1
- package/modbusWidget4/widget-config.component.js +1 -1
- package/modbusWidget4/widget-config.html +74 -84
- package/package.json +11 -13
- package/propertiesLibrary/index.js +1 -1
- package/roles/list/rolesList.html +0 -2
- package/scada/views/componentConfig.html +23 -23
- package/scada/views/mapping.html +41 -39
- package/smartRules/controllers/add.js +1 -1
- package/smartRules/controllers/list.js +1 -1
- package/smartRules/list/smartRulesList.component.js +1 -1
- package/smartRules/list/smartRulesList.html +2 -2
- package/smartRules/services/smartRules.js +1 -1
- package/smartRules/views/add.html +32 -10
- package/smartRules/views/list.html +4 -3
- package/trafficLightWidget/states-mapping.html +82 -69
- package/administration-config/administration-config.module.js +0 -1
- package/administration-config/cumulocity.json +0 -13
- package/asset-notes/assetNotes.component.js +0 -1
- package/asset-notes/assetNotes.html +0 -93
- package/asset-notes/assetNotes.module.js +0 -1
- package/asset-notes/assetNotes.service.js +0 -1
- package/asset-notes/cumulocity.json +0 -13
- package/core/ui/forms/ssh-key-input.html +0 -33
- package/core/ui/forms/ssh-key-input.js +0 -1
- package/devicemanagement-deviceListMap/controllers/deviceListMap.js +0 -1
- package/devicemanagement-deviceListMap/cumulocity.json +0 -19
- package/devicemanagement-deviceListMap/index.js +0 -1
- package/devicemanagement-deviceListMap/views/index.html +0 -21
- package/enterpriseEdition/customBranding/brandingConfiguration.constants.js +0 -1
- package/enterpriseEdition/customBranding/brandingConfiguration.service.js +0 -1
- package/enterpriseEdition/customBranding/brandingConfigurationForm.component.js +0 -1
- package/enterpriseEdition/customBranding/brandingConfigurationForm.html +0 -141
- package/enterpriseEdition/customBranding/brandingConfigurationUi.provider.js +0 -1
- package/enterpriseEdition/customBranding/brandingDeploy.service.js +0 -1
- package/enterpriseEdition/customBranding/brandingProcessExecution.component.js +0 -1
- package/enterpriseEdition/customBranding/brandingProcessExecution.html +0 -120
- package/enterpriseEdition/customBranding/custom-branding.module.js +0 -1
- package/enterpriseEdition/customBranding/microservice.value.js +0 -1
- package/enterpriseEdition/ui-assets/index.js +0 -1
- package/enterpriseEdition/ui-assets/public-options.service.js +0 -1
- package/enterpriseEdition/ui-assets/static-assets.service.js +0 -1
- package/enterpriseEdition/ui-assets/ui-assets.service.js +0 -1
- package/export/controllers/list.js +0 -1
- package/export/views/list.html +0 -298
- package/remoteAccess/clients/remoteAccessClients.service.js +0 -1
- package/remoteAccess/clients/terminal/index.html +0 -30
- package/remoteAccess/clients/terminal/index.js +0 -1
- package/remoteAccess/clients/terminal/shell-adapter.js +0 -1
- package/remoteAccess/clients/terminal/style.css +0 -25
- package/remoteAccess/clients/terminal/telnet-negotiator.js +0 -1
- package/remoteAccess/clients/vnc/vncClient.html +0 -60
- package/remoteAccess/clients/vnc/vncClient.js +0 -1
- package/remoteAccess/cumulocity.json +0 -69
- package/remoteAccess/remoteAccess.module.js +0 -1
- package/remoteAccess/remoteAccess.service.js +0 -1
- package/remoteAccess/remoteAccessEndpointCard/remoteAccessEndpointCard.component.js +0 -1
- package/remoteAccess/remoteAccessEndpointCard/remoteAccessEndpointCard.html +0 -89
- package/remoteAccess/remoteAccessEndpointModal/remoteAccessEndpointModal.component.js +0 -1
- package/remoteAccess/remoteAccessEndpointModal/remoteAccessEndpointModal.html +0 -484
- package/remoteAccess/remoteAccessEndpointModal/suggestedIPAddressTemplate.html +0 -8
- package/remoteAccess/remoteAccessEndpointsList/remoteAccessEndpointsList.component.js +0 -1
- package/remoteAccess/remoteAccessEndpointsList/remoteAccessEndpointsList.html +0 -75
- package/remoteAccess/remoteAccessSettings/remoteAccessSettings.component.js +0 -1
- package/remoteAccess/remoteAccessSettings/remoteAccessSettings.html +0 -37
- package/remoteAccess/remoteAccessUI.provider.js +0 -1
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
<div ng-form="gaugeForm" ng-controller="kpiConfigCtrl" class="
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
<div ng-form="gaugeForm" ng-controller="kpiConfigCtrl" class="no-card-context bg-inherit">
|
|
2
|
+
<c8y-data-point-list
|
|
3
|
+
max-select-count="1"
|
|
4
|
+
datapoints="config.datapoints"
|
|
5
|
+
ng-model="config"
|
|
6
|
+
dont-save="true"
|
|
7
|
+
no-chart
|
|
8
|
+
allow-adding-data-points-from-context-mo-only="dashboard.deviceType && dashboard.deviceTypeValue"
|
|
9
|
+
class="bg-inherit"
|
|
10
|
+
></c8y-data-point-list>
|
|
11
|
+
|
|
12
|
+
<fieldset class="c8y-fieldset">
|
|
13
|
+
<legend>{{ 'Decimal places' | translate }}</legend>
|
|
14
|
+
<div class="form-group form-group-sm m-b-16">
|
|
15
|
+
<input
|
|
16
|
+
name="decimalPlaces"
|
|
17
|
+
ng-model="config.fractionSize"
|
|
18
|
+
ng-init="config.fractionSize = (config.fractionSize === undefined || config.fractionSize === null ? 2 : config.fractionSize)"
|
|
19
|
+
type="number"
|
|
20
|
+
ng-min="0"
|
|
21
|
+
ng-max="10"
|
|
22
|
+
step="1"
|
|
23
|
+
c8y-model-options="{unsetWhenNull: true}"
|
|
24
|
+
class="form-control"
|
|
25
|
+
placeholder="{{ 'e.g.' | translate}} 2"
|
|
26
|
+
/>
|
|
27
|
+
<c8y-error-feedback field="gaugeForm.decimalPlaces"></c8y-error-feedback>
|
|
13
28
|
</div>
|
|
14
|
-
|
|
15
|
-
<div class="card-header separator">
|
|
16
|
-
<div class="card-title h4">{{ 'Decimal places' | translate }}</div>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="form-group p-t-8">
|
|
19
|
-
<label translate class="sr-only">Decimal places</label>
|
|
20
|
-
<input
|
|
21
|
-
name="decimalPlaces"
|
|
22
|
-
ng-model="config.fractionSize"
|
|
23
|
-
ng-init="config.fractionSize = (config.fractionSize === undefined || config.fractionSize === null ? 2 : config.fractionSize)"
|
|
24
|
-
type="number"
|
|
25
|
-
ng-min="0"
|
|
26
|
-
ng-max="10"
|
|
27
|
-
step="1"
|
|
28
|
-
c8y-model-options="{unsetWhenNull: true}"
|
|
29
|
-
class="form-control"
|
|
30
|
-
placeholder="{{ 'e.g.' | translate}} 2"
|
|
31
|
-
/>
|
|
32
|
-
<c8y-error-feedback field="gaugeForm.decimalPlaces"></c8y-error-feedback>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
29
|
+
</fieldset>
|
|
36
30
|
</div>
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
<div ng-controller="kpiConfigCtrl">
|
|
2
2
|
<div
|
|
3
3
|
ng-controller="listConfigCtrl"
|
|
4
|
-
class="no-card-context
|
|
5
|
-
style="height: calc(100vh - 422px)"
|
|
4
|
+
class="no-card-context"
|
|
6
5
|
>
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
no-chart
|
|
12
|
-
class="bg-level-1"
|
|
13
|
-
allow-adding-data-points-from-context-mo-only="dashboard.deviceType && dashboard.deviceTypeValue"
|
|
14
|
-
></c8y-data-point-list>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="col-md-6 p-r-24 inner-scroll">
|
|
17
|
-
<div class="card-header separator sticky-top bg-level-0">
|
|
18
|
-
<span class="card-title">{{ 'Column visibility' | translate }}</span>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="form-group p-t-8">
|
|
21
|
-
<label class="c8y-checkbox">
|
|
6
|
+
<fieldset class="c8y-fieldset">
|
|
7
|
+
<legend>{{ 'Column visibility' | translate }}</legend>
|
|
8
|
+
<div class="form-group d-flex flex-wrap gap-16">
|
|
9
|
+
<label class="c8y-checkbox m-t-8">
|
|
22
10
|
<input
|
|
23
11
|
type="checkbox"
|
|
24
12
|
ng-model="config.options.kpi"
|
|
@@ -67,6 +55,14 @@
|
|
|
67
55
|
<span>{{ 'Asset' | translate }}</span>
|
|
68
56
|
</label>
|
|
69
57
|
</div>
|
|
70
|
-
</
|
|
58
|
+
</fieldset>
|
|
59
|
+
|
|
60
|
+
<c8y-data-point-list
|
|
61
|
+
ng-model="config"
|
|
62
|
+
datapoints="config.options.dataPoints"
|
|
63
|
+
no-chart
|
|
64
|
+
class="bg-inherit"
|
|
65
|
+
allow-adding-data-points-from-context-mo-only="dashboard.deviceType && dashboard.deviceTypeValue"
|
|
66
|
+
></c8y-data-point-list>
|
|
71
67
|
</div>
|
|
72
68
|
</div>
|
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
<div ng-controller="kpiConfigCtrl" class="
|
|
1
|
+
<div ng-controller="kpiConfigCtrl" class="no-card-context bg-inherit">
|
|
2
2
|
<div ng-controller="pieChartConfigCtrl" class="alert alert-warning m-t-8 center-block" ng-show="differentUnits" translate>
|
|
3
3
|
Measurements with different units are selected.
|
|
4
4
|
</div>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
|
|
6
|
+
<c8y-data-point-list
|
|
7
|
+
basic-list
|
|
8
|
+
ng-model="config"
|
|
9
|
+
datapoints="config.datapoints"
|
|
10
|
+
allow-adding-data-points-from-context-mo-only="dashboard.deviceType && dashboard.deviceTypeValue"
|
|
11
|
+
dont-save="true"
|
|
12
|
+
class="bg-inherit"
|
|
13
|
+
></c8y-data-point-list>
|
|
14
|
+
|
|
15
|
+
<fieldset ng-controller="pieChartConfigCtrl" class="c8y-fieldset">
|
|
16
|
+
<legend translate>Pie Chart Options</legend>
|
|
17
|
+
<div class="form-group d-flex gap-16 flex-wrap m-b-16">
|
|
18
|
+
<label class="c8y-checkbox m-t-8">
|
|
19
|
+
<input type="checkbox" ng-model="config.pieChartOptions.showTooltips" />
|
|
20
|
+
<span></span>
|
|
21
|
+
<span translate>Show tooltips</span>
|
|
22
|
+
</label>
|
|
23
|
+
<label class="c8y-checkbox">
|
|
24
|
+
<input type="checkbox" ng-model="config.pieChartOptions.showLabels" />
|
|
25
|
+
<span></span>
|
|
26
|
+
<span translate>Show percentages</span>
|
|
27
|
+
</label>
|
|
28
|
+
<label class="c8y-checkbox">
|
|
29
|
+
<input type="checkbox" ng-model="config.pieChartOptions.showLegend" />
|
|
30
|
+
<span></span>
|
|
31
|
+
<span translate>Show legend</span>
|
|
32
|
+
</label>
|
|
15
33
|
</div>
|
|
16
|
-
|
|
17
|
-
<div ng-controller="pieChartConfigCtrl">
|
|
18
|
-
<div class="card-header separator">
|
|
19
|
-
<div class="card-title h4" translate>Pie Chart Options</div>
|
|
20
|
-
</div>
|
|
21
|
-
<div class="form-group p-t-8">
|
|
22
|
-
<label class="c8y-checkbox">
|
|
23
|
-
<input type="checkbox" ng-model="config.pieChartOptions.showTooltips" />
|
|
24
|
-
<span></span>
|
|
25
|
-
<span translate>Show tooltips</span>
|
|
26
|
-
</label>
|
|
27
|
-
<label class="c8y-checkbox">
|
|
28
|
-
<input type="checkbox" ng-model="config.pieChartOptions.showLabels" />
|
|
29
|
-
<span></span>
|
|
30
|
-
<span translate>Show percentages</span>
|
|
31
|
-
</label>
|
|
32
|
-
<label class="c8y-checkbox">
|
|
33
|
-
<input type="checkbox" ng-model="config.pieChartOptions.showLegend" />
|
|
34
|
-
<span></span>
|
|
35
|
-
<span translate>Show legend</span>
|
|
36
|
-
</label>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
34
|
+
</fieldset>
|
|
41
35
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},e=Object.prototype,s=e.hasOwnProperty,d=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",o=t.toStringTag||"@@toStringTag";function i(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(u){i=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o,i,a,c,t=t&&t.prototype instanceof g?t:g,t=Object.create(t.prototype),r=new O(r||[]);return d(t,"_invoke",{value:(o=e,i=n,a=r,c=f,function(e,t){if(c===h)throw Error("Generator is already running");if(c===y){if("throw"===e)throw t;return{value:u,done:!0}}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n){n=function e(t,n){var r=n.method,o=t.iterator[r];if(o===u)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=u,e(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;r=l(o,t.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,v;o=r.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=u),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}(n,a);if(n){if(n===v)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===f)throw c=y,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=h;n=l(o,i,a);if("normal"===n.type){if(c=a.done?y:p,n.arg===v)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(c=y,a.method="throw",a.arg=n.arg)}})}),t}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var f="suspendedStart",p="suspendedYield",h="executing",y="completed",v={};function g(){}function m(){}function _(){}var t={},b=(i(t,r,function(){return this}),Object.getPrototypeOf),b=b&&b(b(S([]))),w=(b&&b!==e&&s.call(b,r)&&(t=b),_.prototype=g.prototype=Object.create(t));function E(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function x(a,c){var t;d(this,"_invoke",{value:function(n,r){function e(){return new c(function(e,t){!function t(e,n,r,o){var i,e=l(a[e],a,n);if("throw"!==e.type)return(n=(i=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,r,o)},function(e){t("throw",e,r,o)}):c.resolve(n).then(function(e){i.value=e,r(i)},function(e){return t("throw",e,r,o)});o(e.arg)}(n,r,e,t)})}return t=t?t.then(e,e):e()}})}function D(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function S(t){if(t||""===t){var n,e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n<t.length;)if(s.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=u,e.done=!0,e}).next=e}throw new TypeError(_typeof(t)+" is not iterable")}return d(w,"constructor",{value:m.prototype=_,configurable:!0}),d(_,"constructor",{value:m,configurable:!0}),m.displayName=i(_,o,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,i(e,o,"GeneratorFunction")),e.prototype=Object.create(w),e},a.awrap=function(e){return{__await:e}},E(x.prototype),i(x.prototype,n,function(){return this}),a.AsyncIterator=x,a.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var i=new x(c(e,t,n,r),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},E(w),i(w,o,"Generator"),i(w,r,function(){return this}),i(w,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,n=Object(e),r=[];for(t in n)r.push(t);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=S,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(N),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=u)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=u),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&s.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}var i=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n,r,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(n=o.completion).type&&(r=n.arg,N(o)),r}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=u),v}},a}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,n){var r=c.apply(e,a);function o(e){asyncGeneratorStep(r,t,n,o,i,"next",e)}function i(e){asyncGeneratorStep(r,t,n,o,i,"throw",e)}o(void 0)})}}(()=>{function e(o,n,i,a,c,u,s,d,r,l){var e,f=this;function t(){return(t=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var n;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=f.mode,t.adding=!0,t.protocol=n;try{f.expandedId="",f.reloadDevices(),i.success(l("Child device changes saved."))}catch(e){t.adding=!1,i.danger(l("Failed to change child device."))}o.$apply();case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,n,r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=f.mode,n=f.device,(r=f.newDevice).adding=!0,r.protocol=t,e.prev=3,y())return e.next=7,a.create(n,r);e.next=9;break;case 7:e.next=27;break;case 9:if(v())return e.next=12,c.create(n,r);e.next=14;break;case 12:e.next=27;break;case 14:if(g())return e.next=17,u.create(n,r);e.next=19;break;case 17:e.next=27;break;case 19:if(m())return e.next=22,s.create(n,r);e.next=24;break;case 22:e.next=27;break;case 24:if(b())return e.next=27,d.create(n,r);e.next=27;break;case 27:h(),f.reloadDevices(),i.success(l("New child device added.")),e.next=33;break;case 30:e.prev=30,e.t0=e.catch(3),f.newDevice.adding=!1,i.danger(l("Failed to add new child device."));case 33:o.$apply();case 34:case"end":return e.stop()}},e,null,[[3,30]])}))).apply(this,arguments)}function h(){f.expandedId="",_.unset(f,"newDevice"),f[e].$setPristine(),document.getElementsByName("vm.".concat(e))[0].reset()}function y(){return"modbus"===f.tab}function v(){return"canbus"===f.tab}function g(){return"opcua"===f.tab}function m(){return"profibus"===f.tab}function b(){return"canopen"===f.tab}_.assign(f,{$onInit:function(){e="new".concat(f.mode,"DeviceForm"),f.expandedId=""},shouldShowSection:function(){var e=f.device,t=f.mode,n=!1;y()?"TCP"===t?n=r.supportsOperation(e,"c8y_ModbusDevice"):"RTU"===t&&(n=r.supportsOperation(e,"c8y_ModbusDevice")&&e.c8y_SerialConfiguration):v()&&"CAN"===t?n=r.supportsOperation(e,"c8y_CanDevice"):m()&&"Profibus"===t?n=r.supportsOperation(e,"c8y_ProfibusDevice"):b()&&"CANopen"===t&&(n=r.supportsOperation(e,"c8y_CANopenAddDevice"));return n},isModbusTab:y,isCanBusTab:v,isOPCUATab:g,isProfibusTab:m,isCanOpenTab:b,invalid:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(f.mode,"DeviceForm");return(e=>{var t,n,r,o,i=f.mode,a=f.fieldErrors;"TCP"===i||"RTU"===i?(o=f[e],(r=o.address)&&(n=r.$modelValue,"TCP"===i?(o=o.ipAddress,t=o.$modelValue,_.isUndefined(n)||r.$setValidity(a.ADDRESS_INVALID,(e=>e<=247||255===e)(n)),t=n&&t&&_.some(f.devices,{address:n,ipAddress:t,protocol:"TCP"}),r.$setValidity(a.ADDRESSES_IN_USE,!t),o.$setValidity(a.ADDRESSES_IN_USE,!t)):"RTU"===i&&(o=n&&_.some(f.devices,{address:n,protocol:"RTU"}),r.$setValidity(a.ADDRESS_IN_USE,!o)))):"CANopen"===i&&(t=f[e].nodeId)&&(n=t.$modelValue)&&(r=(e=>1<=e&&e<=127)(n),o=(t=>f.devices.find(function(e){return!(!e||!e.nodeId)&&e.nodeId===t}))(n),r?o?(t.$setValidity(a.NODE_OUT_OF_RANGE,!0),t.$setValidity(a.NODE_IN_USE,!1)):(t.$setValidity(a.NODE_OUT_OF_RANGE,!0),t.$setValidity(a.NODE_IN_USE,!0)):(t.$setValidity(a.NODE_OUT_OF_RANGE,!1),t.$setValidity(a.NODE_IN_USE,!0)))})(t),n.invalid(f,t,e)},getFieldValidationHints:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(f.mode,"DeviceForm"),t=_.get(f,"".concat(t,".").concat(e));if(t)return n.validationHints(t,f.fieldErrorsToMessages);return""},isFormInvalid:function(){return _.get(f,"".concat(e,".$invalid"))||_.get(f,"newDevice.adding")},startAddingNewDevice:function(){f.newDevice={name:null,deviceType:null,address:null}},addNewDevice:function(){return p.apply(this,arguments)},clearNewDevice:h,filterByMode:function(){if(y())return function(e){return _.get(e,"protocol")===f.mode};if(b())return function(e){return e.nodeId};return function(){return!0}},updateDevice:function(e){return t.apply(this,arguments)},startEditDevice:function(e){var t=_.cloneDeep(e);t.adding=!1,_.isUndefined(t.deviceType)||(e=f.deviceConfigurationOptions,t.deviceType=_.find(e.types,function(e){return e.name===t.deviceType}));return t},isEditFormInvalid:function(e,t){return _.get(f,"".concat(e,".$invalid"))||_.get(t,"adding")},toggle:function(e){f.expandedId===e?f.expandedId="":f.expandedId=e},clearEditDevice:function(){f.expandedId=""},getFormName:function(e){if(e)return e=e.id,"vm.form".concat(_.toString(e));return"vm.form"},getDeviceFormName:function(e){return"form".concat(e.id)},expandedId:void 0})}e.$inject=["$rootScope","c8yBase","c8yAlert","c8yModbusDevice","c8yCanbusDevice","c8yOPCUADevice","c8yProfibusDevice","c8yCanopenDevice","c8yDevices","gettext"],angular.module("c8y.modbusConfiguration4").component("c8yFieldbusDeviceList",{templateUrl:":::PLUGIN_PATH:::/fieldbus-device-list.html",bindings:{tab:"@",mode:"@",fieldErrors:"<",fieldErrorsToMessages:"<",deviceConfigurationOptions:"<",device:"<",devices:"<",reloadDevices:"<",onClickDelete:"<",navigateToDetail:"<"},controllerAs:"vm",controller:e})})();
|
|
1
|
+
function _regenerator(){var p,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.toStringTag||"@@toStringTag";function t(e,n,r,t){var i,o,a,c,d,u,s,f,l,n=n&&n.prototype instanceof y?n:y,n=Object.create(n.prototype);return _regeneratorDefine2(n,"_invoke",(i=e,o=r,s=t||[],f=!1,l={p:u=0,n:0,v:p,a:v,f:v.bind(p,4),d:function(e,n){return a=e,c=0,d=p,l.n=n,_}},function(e,n,r){if(1<u)throw TypeError("Generator is already running");for(f&&1===n&&v(n,r),c=n,d=r;(g=c<2?p:d)||!f;){a||(c?c<3?(1<c&&(l.n=-1),v(c,d)):l.n=d:l.v=d);try{if(u=2,a){if(g=a[e=c?e:"next"]){if(!(g=g.call(a,d)))throw TypeError("iterator result is not an object");if(!g.done)return g;d=g.value,c<2&&(c=0)}else 1===c&&(g=a.return)&&g.call(a),c<2&&(d=TypeError("The iterator does not provide a '"+e+"' method"),c=1);a=p}else if((g=(f=l.n<0)?d:i.call(o,l))!==_)break}catch(e){a=p,c=1,d=e}finally{u=1}}return{value:g,done:f}}),!0),n;function v(e,n){for(c=e,d=n,g=0;!f&&u&&!r&&g<s.length;g++){var r,t=s[g],i=l.p,o=t[2];3<e?(r=o===n)&&(d=t[(c=t[4])?5:c=3],t[4]=t[5]=p):t[0]<=i&&((r=e<2&&i<t[1])?(c=0,l.v=n,l.n=t[1]):i<o&&(r=e<3||t[0]>n||o<n)&&(t[4]=e,t[5]=n,l.n=o,c=0))}if(r||1<e)return _;throw f=!0,n}}var _={};function y(){}function i(){}function o(){}var g=Object.getPrototypeOf,e=[][n]?g(g([][n]())):(_regeneratorDefine2(g={},n,function(){return this}),g),a=o.prototype=y.prototype=Object.create(e);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,_regeneratorDefine2(e,r,"GeneratorFunction")),e.prototype=Object.create(a),e}return _regeneratorDefine2(a,"constructor",i.prototype=o),_regeneratorDefine2(o,"constructor",i),_regeneratorDefine2(o,r,i.displayName="GeneratorFunction"),_regeneratorDefine2(a),_regeneratorDefine2(a,r,"Generator"),_regeneratorDefine2(a,n,function(){return this}),_regeneratorDefine2(a,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:t,m:c}})()}function _regeneratorDefine2(e,n,r,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(_regeneratorDefine2=function(e,n,r,t){n?i?i(e,n,{value:r,enumerable:!t,configurable:!t,writable:!t}):e[n]=r:((t=function(n,r){_regeneratorDefine2(e,n,function(e){return this._invoke(n,r,e)})})("next",0),t("throw",1),t("return",2))})(e,n,r,t)}function asyncGeneratorStep(e,n,r,t,i,o,a){try{var c=e[o](a),d=c.value}catch(e){return void r(e)}c.done?n(d):Promise.resolve(d).then(t,i)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(n,r){var t=c.apply(e,a);function i(e){asyncGeneratorStep(t,n,r,i,o,"next",e)}function o(e){asyncGeneratorStep(t,n,r,i,o,"throw",e)}i(void 0)})}}(()=>{function e(i,r,o,a,c,d,u,s,t,f){var e,l=this;function n(){return(n=_asyncToGenerator(_regenerator().m(function e(n){var r;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:r=l.mode,n.adding=!0,n.protocol=r;try{l.expandedId="",l.reloadDevices(),o.success(f("Child device changes saved."))}catch(e){n.adding=!1,o.danger(f("Failed to change child device."))}i.$apply();case 1:return e.a(2)}},e)}))).apply(this,arguments)}function v(){return(v=_asyncToGenerator(_regenerator().m(function e(){var n,r,t;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:if(n=l.mode,r=l.device,(t=l.newDevice).adding=!0,t.protocol=n,e.p=1,y())return e.n=2,a.create(r,t);e.n=3;break;case 2:e.n=10;break;case 3:if(g())return e.n=4,c.create(r,t);e.n=5;break;case 4:e.n=10;break;case 5:if(D())return e.n=6,d.create(r,t);e.n=7;break;case 6:e.n=10;break;case 7:if(b())return e.n=8,u.create(r,t);e.n=9;break;case 8:e.n=10;break;case 9:if(m())return e.n=10,s.create(r,t);e.n=10;break;case 10:p(),l.reloadDevices(),o.success(f("New child device added.")),e.n=12;break;case 11:e.p=11,l.newDevice.adding=!1,o.danger(f("Failed to add new child device."));case 12:i.$apply();case 13:return e.a(2)}},e,null,[[1,11]])}))).apply(this,arguments)}function p(){l.expandedId="",_.unset(l,"newDevice"),l[e].$setPristine(),document.getElementsByName("vm.".concat(e))[0].reset()}function y(){return"modbus"===l.tab}function g(){return"canbus"===l.tab}function D(){return"opcua"===l.tab}function b(){return"profibus"===l.tab}function m(){return"canopen"===l.tab}_.assign(l,{$onInit:function(){e="new".concat(l.mode,"DeviceForm"),l.expandedId=""},shouldShowSection:function(){var e=l.device,n=l.mode,r=!1;y()?"TCP"===n?r=t.supportsOperation(e,"c8y_ModbusDevice"):"RTU"===n&&(r=t.supportsOperation(e,"c8y_ModbusDevice")&&e.c8y_SerialConfiguration):g()&&"CAN"===n?r=t.supportsOperation(e,"c8y_CanDevice"):b()&&"Profibus"===n?r=t.supportsOperation(e,"c8y_ProfibusDevice"):m()&&"CANopen"===n&&(r=t.supportsOperation(e,"c8y_CANopenAddDevice"));return r},isModbusTab:y,isCanBusTab:g,isOPCUATab:D,isProfibusTab:b,isCanOpenTab:m,invalid:function(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(l.mode,"DeviceForm");return(e=>{var n,r,t,i,o=l.mode,a=l.fieldErrors;"TCP"===o||"RTU"===o?(i=l[e],(t=i.address)&&(r=t.$modelValue,"TCP"===o?(i=i.ipAddress,n=i.$modelValue,_.isUndefined(r)||t.$setValidity(a.ADDRESS_INVALID,(e=>e<=247||255===e)(r)),n=r&&n&&_.some(l.devices,{address:r,ipAddress:n,protocol:"TCP"}),t.$setValidity(a.ADDRESSES_IN_USE,!n),i.$setValidity(a.ADDRESSES_IN_USE,!n)):"RTU"===o&&(i=r&&_.some(l.devices,{address:r,protocol:"RTU"}),t.$setValidity(a.ADDRESS_IN_USE,!i)))):"CANopen"===o&&(n=l[e].nodeId)&&(r=n.$modelValue)&&(t=(e=>1<=e&&e<=127)(r),i=(n=>!!l.devices&&l.devices.find(function(e){return!(!e||!e.nodeId)&&e.nodeId===n}))(r),t?i?(n.$setValidity(a.NODE_OUT_OF_RANGE,!0),n.$setValidity(a.NODE_IN_USE,!1)):(n.$setValidity(a.NODE_OUT_OF_RANGE,!0),n.$setValidity(a.NODE_IN_USE,!0)):(n.$setValidity(a.NODE_OUT_OF_RANGE,!1),n.$setValidity(a.NODE_IN_USE,!0)))})(n),r.invalid(l,n,e)},getFieldValidationHints:function(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(l.mode,"DeviceForm"),n=_.get(l,"".concat(n,".").concat(e));if(n)return r.validationHints(n,l.fieldErrorsToMessages);return""},isFormInvalid:function(){return _.get(l,"".concat(e,".$invalid"))||_.get(l,"newDevice.adding")},startAddingNewDevice:function(){l.newDevice={name:null,deviceType:null,address:null}},addNewDevice:function(){return v.apply(this,arguments)},clearNewDevice:p,filterByMode:function(){if(y())return function(e){return _.get(e,"protocol")===l.mode};if(m())return function(e){return e.nodeId};return function(){return!0}},updateDevice:function(e){return n.apply(this,arguments)},startEditDevice:function(e){var n=_.cloneDeep(e);n.adding=!1,_.isUndefined(n.deviceType)||(e=l.deviceConfigurationOptions,n.deviceType=_.find(e.types,function(e){return e.name===n.deviceType}));return n},isEditFormInvalid:function(e,n){return _.get(l,"".concat(e,".$invalid"))||_.get(n,"adding")},toggle:function(e){l.expandedId===e?l.expandedId="":l.expandedId=e},clearEditDevice:function(){l.expandedId=""},getFormName:function(e){if(e)return e=e.id,"vm.form".concat(_.toString(e));return"vm.form"},getDeviceFormName:function(e){return"form".concat(e.id)},expandedId:void 0})}e.$inject=["$rootScope","c8yBase","c8yAlert","c8yModbusDevice","c8yCanbusDevice","c8yOPCUADevice","c8yProfibusDevice","c8yCanopenDevice","c8yDevices","gettext"],angular.module("c8y.modbusConfiguration4").component("c8yFieldbusDeviceList",{templateUrl:":::PLUGIN_PATH:::/fieldbus-device-list.html",bindings:{tab:"@",mode:"@",fieldErrors:"<",fieldErrorsToMessages:"<",deviceConfigurationOptions:"<",device:"<",devices:"<",reloadDevices:"<",onClickDelete:"<",navigateToDetail:"<"},controllerAs:"vm",controller:e})})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},e=Object.prototype,s=e.hasOwnProperty,l=Object.defineProperty||function(e,t,r){e[t]=r.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",o=t.toStringTag||"@@toStringTag";function i(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(u){i=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o,i,a,c,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype),n=new j(n||[]);return l(t,"_invoke",{value:(o=e,i=r,a=n,c=p,function(e,t){if(c===g)throw Error("Generator is already running");if(c===h){if("throw"===e)throw t;return{value:u,done:!0}}for(a.method=e,a.arg=t;;){var r=a.delegate;if(r){r=function e(t,r){var n=r.method,o=t.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=u,e(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;n=f(o,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,d;o=n.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,d):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}(r,a);if(r){if(r===d)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===p)throw c=h,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=g;r=f(o,i,a);if("normal"===r.type){if(c=a.done?h:y,r.arg===d)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=h,a.method="throw",a.arg=r.arg)}})}),t}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var p="suspendedStart",y="suspendedYield",g="executing",h="completed",d={};function m(){}function v(){}function b(){}var t={},_=(i(t,n,function(){return this}),Object.getPrototypeOf),_=_&&_(_(x([]))),w=(_&&_!==e&&s.call(_,n)&&(t=_),b.prototype=m.prototype=Object.create(t));function E(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function T(a,c){var t;l(this,"_invoke",{value:function(r,n){function e(){return new c(function(e,t){!function t(e,r,n,o){var i,e=f(a[e],a,r);if("throw"!==e.type)return(r=(i=e.arg).value)&&"object"==_typeof(r)&&s.call(r,"__await")?c.resolve(r.__await).then(function(e){t("next",e,n,o)},function(e){t("throw",e,n,o)}):c.resolve(r).then(function(e){i.value=e,n(i)},function(e){return t("throw",e,n,o)});o(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}})}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function x(t){if(t||""===t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(s.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=u,e.done=!0,e}).next=e}throw new TypeError(_typeof(t)+" is not iterable")}return l(w,"constructor",{value:v.prototype=b,configurable:!0}),l(b,"constructor",{value:v,configurable:!0}),v.displayName=i(b,o,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,i(e,o,"GeneratorFunction")),e.prototype=Object.create(w),e},a.awrap=function(e){return{__await:e}},E(T.prototype),i(T.prototype,r,function(){return this}),a.AsyncIterator=T,a.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var i=new T(c(e,t,r,n),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},E(w),i(w,o,"Generator"),i(w,n,function(){return this}),i(w,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,r=Object(e),n=[];for(t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=x,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=u)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return i.type="throw",i.arg=r,n.next=e,t&&(n.method="next",n.arg=u),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(r=o.completion).type&&(n=r.arg,S(o)),n}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=u),d}},a}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=c.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}(()=>{function e(c,e,t,u,s,l){var r=e.MODBUS_DEVICE_FRAGMENT,n=e.PROFIBUS_DEVICE_FRAGMENT;return{getConfigModel:function(e){return o.apply(this,arguments)},updateConfigModel:function(e,t){_.set(e,"categoriesConfig",_.map(t,function(e){return{name:e.name,label:e.label,elements:_.compact(_.map(e.elements,function(e){return e.show?_.pick(e,["refId","label","type"]):void 0}))}})),_.unset(e,"coils"),_.unset(e,"registers")},getWidgetModel:function(e){return h.apply(this,arguments)},isAtLeastOneElementSelected:function(e){return _.some(e,function(e){return _.some(e.elements,"show")})},isDiscreteIOSelectedInConfig:window.c8y_testing&&g,isRegisterSelectedInConfig:window.c8y_testing&&y};function o(){return(o=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=_.get(t,"device"))return e.next=4,b(r);e.next=6;break;case 4:return r=e.sent,e.abrupt("return",function(){return i.apply(this,arguments)}({fieldbusDevice:r,widgetConfig:t}));case 6:return e.abrupt("return",c.resolve([]));case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function i(){return(i=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r,n,o,i,a;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fieldbusDevice,n=t.widgetConfig,e.next=3,w(r);case 3:if(o=e.sent,i=m({fieldbusDevice:r,deviceType:o}),_.isEmpty(i))return e.abrupt("return",[]);e.next=7;break;case 7:return a=_.groupBy(i,E),e.abrupt("return",_(n).chain().get("categoriesConfig",[]).map(function(e){var t=_.get(a,e.name);_.defaults(e,{label:e.name||l("Uncategorized")});t=_.flow([f,p])({categoryConfigElements:e.elements,deviceType:o,elements:i,categoryElements:t,widgetConfig:n}).categoryConfigElements;return e.elements=t,e}).thru(function(e){return T({categoriesConfig:e,categories:a,deviceType:o,widgetConfig:n})}).value());case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function f(e){var t=e.categoryConfigElements,r=e.deviceType,n=e.elements,o=e.categoryElements,e=e.widgetConfig;return{categoryConfigElements:_.map(t,function(e){var t=e.refId,t=s.findElementBestMatchingRefId(n,t,e.type);if(t)return _.defaults(e,{name:t.name,type:t.meta.type.value,typeLabel:s.getElementTypeLabel(t,r),show:!0,label:t.name})}),deviceType:r,elements:n,categoryElements:o,widgetConfig:e}}function p(e){var t=e.categoryConfigElements,r=e.deviceType,n=e.elements,o=e.categoryElements,i=e.widgetConfig;return{categoryConfigElements:[].concat(_toConsumableArray(t),_toConsumableArray(_(o).filter(function(e){return!_.find(t,{refId:s.getElementRefId(e)})}).map(function(e){return{refId:s.getElementRefId(e),label:e.name,show:a(e,i),name:e.name,type:e.meta.type.value,typeLabel:s.getElementTypeLabel(e,r)}}).value())),deviceType:r,elements:n,categoryElements:o,widgetConfig:i}}function a(e,t){return(e.meta.type===s.ElementType.REGISTER?y:g)(e,t)}function y(e,t){var r=e.id,n=e.input,o=e.number,e=e.startBit,t=t.registers;return _.includes(t,r)||_.includes(t,[n,o,e].join(","))||_.includes(t,o)||!!_.find(t,{number:o,startBit:e})}function g(e,t){var r=e.id,n=e.input,e=e.number,t=t.coils;return _.includes(t,r)||_.includes(t,[n,e].join(","))||_.includes(t,e)}function h(){return(h=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r,n,o,i,a;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=_.get(t,"device.id"),r=u.detailRealtime(o),n=r.then(w),o=function(){return d.apply(this,arguments)}(o,t).then(function(e){return _.get(t,"categoriesConfig",e)}),e.next=6,c.all({fieldbusDevice:r,deviceType:n,categoriesConfig:o});case 6:return r=e.sent,n=r.fieldbusDevice,o=r.categoriesConfig,i=m({fieldbusDevice:n,deviceType:r.deviceType}),a=_.map(o,function(e){return _.defaults(_objectSpread(_objectSpread({},e),{},{elements:_(e.elements).map(function(e){var t=s.findElementBestMatchingRefId(i,e.refId,e.type);return t?_.defaults(_objectSpread(_objectSpread({},e),t),{label:t.name,show:!0}):e}).filter("show").value()}),{label:e.name})}),e.abrupt("return",{device:n,categories:a});case 13:case"end":return e.stop()}},e)}))).apply(this,arguments)}function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r){var n,o,i;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(t);case 2:return n=e.sent,e.next=5,w(n);case 5:return o=e.sent,i=m({fieldbusDevice:n,deviceType:o}),i=_.groupBy(i,E),e.abrupt("return",T({categoriesConfig:[],categories:i,deviceType:o,widgetConfig:r}));case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function m(e){var t=e.fieldbusDevice,e=s.getElementsWithMeta(e.deviceType);return _.has(t,r)||_.has(t,n)?e:_.filter(e,v)}function v(e){return e.meta.type===s.ElementType.REGISTER&&!e.input}function b(e){return s.isFieldbusDevice(e)?c.resolve(e):u.detail(t.getId(e)).then(t.getResData)}function w(e){return s.getDeviceTypeFromDevice(e)}function E(e){return _.get(e,"category","")}function T(e){var r=e.categoriesConfig,t=e.categories,n=e.deviceType,o=e.widgetConfig;return[].concat(_toConsumableArray(r),_toConsumableArray(_(t).pickBy(function(e,t){return!_.find(r,{name:t})}).map(function(e,t){return{name:t,label:t||l("Uncategorized"),elements:_.map(e,function(e){return{refId:s.getElementRefId(e),label:e.name,show:a(e,o),name:e.name,type:e.meta.type.value,typeLabel:s.getElementTypeLabel(e,n)}})}}).value()))}}e.$inject=["$q","fieldbusConstants","c8yBase","c8yDevices","c8yDeviceDatabase","gettext"],angular.module("c8y.modbusWidget4").factory("modbusWidgetSvc",e)})();
|
|
1
|
+
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _regenerator(){var g,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",r=e.toStringTag||"@@toStringTag";function n(e,t,r,n){var o,i,a,c,u,f,l,s,y,t=t&&t.prototype instanceof d?t:d,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(o=e,i=r,l=n||[],s=!1,y={p:f=0,n:0,v:g,a:p,f:p.bind(g,4),d:function(e,t){return a=e,c=0,u=g,y.n=t,m}},function(e,t,r){if(1<f)throw TypeError("Generator is already running");for(s&&1===t&&p(t,r),c=t,u=r;(_=c<2?g:u)||!s;){a||(c?c<3?(1<c&&(y.n=-1),p(c,u)):y.n=u:y.v=u);try{if(f=2,a){if(_=a[e=c?e:"next"]){if(!(_=_.call(a,u)))throw TypeError("iterator result is not an object");if(!_.done)return _;u=_.value,c<2&&(c=0)}else 1===c&&(_=a.return)&&_.call(a),c<2&&(u=TypeError("The iterator does not provide a '"+e+"' method"),c=1);a=g}else if((_=(s=y.n<0)?u:o.call(i,y))!==m)break}catch(e){a=g,c=1,u=e}finally{f=1}}return{value:_,done:s}}),!0),t;function p(e,t){for(c=e,u=t,_=0;!s&&f&&!r&&_<l.length;_++){var r,n=l[_],o=y.p,i=n[2];3<e?(r=i===t)&&(u=n[(c=n[4])?5:c=3],n[4]=n[5]=g):n[0]<=o&&((r=e<2&&o<n[1])?(c=0,y.v=t,y.n=n[1]):o<i&&(r=e<3||n[0]>t||i<t)&&(n[4]=e,n[5]=t,y.n=i,c=0))}if(r||1<e)return m;throw s=!0,t}}var m={};function d(){}function o(){}function i(){}var _=Object.getPrototypeOf,e=[][t]?_(_([][t]())):(_regeneratorDefine2(_={},t,function(){return this}),_),a=i.prototype=d.prototype=Object.create(e);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,_regeneratorDefine2(e,r,"GeneratorFunction")),e.prototype=Object.create(a),e}return _regeneratorDefine2(a,"constructor",o.prototype=i),_regeneratorDefine2(i,"constructor",o),_regeneratorDefine2(i,r,o.displayName="GeneratorFunction"),_regeneratorDefine2(a),_regeneratorDefine2(a,r,"Generator"),_regeneratorDefine2(a,t,function(){return this}),_regeneratorDefine2(a,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:n,m:c}})()}function _regeneratorDefine2(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(_regeneratorDefine2=function(e,t,r,n){t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:((n=function(t,r){_regeneratorDefine2(e,t,function(e){return this._invoke(t,r,e)})})("next",0),n("throw",1),n("return",2))})(e,t,r,n)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=c.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}(()=>{function e(c,e,t,u,f,l){var r=e.MODBUS_DEVICE_FRAGMENT,n=e.PROFIBUS_DEVICE_FRAGMENT;return{getConfigModel:function(e){return o.apply(this,arguments)},updateConfigModel:function(e,t){_.set(e,"categoriesConfig",_.map(t,function(e){return{name:e.name,label:e.label,elements:_.compact(_.map(e.elements,function(e){return e.show?_.pick(e,["refId","label","type"]):void 0}))}})),_.unset(e,"coils"),_.unset(e,"registers")},getWidgetModel:function(e){return m.apply(this,arguments)},isAtLeastOneElementSelected:function(e){return _.some(e,function(e){return _.some(e.elements,"show")})},isDiscreteIOSelectedInConfig:window.c8y_testing&&g,isRegisterSelectedInConfig:window.c8y_testing&&p};function o(){return(o=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:if(r=_.get(t,"device"))return e.n=1,h(r);e.n=2;break;case 1:return r=e.v,e.a(2,function(){return i.apply(this,arguments)}({fieldbusDevice:r,widgetConfig:t}));case 2:return e.a(2,c.resolve([]))}},e)}))).apply(this,arguments)}function i(){return(i=_asyncToGenerator(_regenerator().m(function e(t){var r,n,o,i,a;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return r=t.fieldbusDevice,n=t.widgetConfig,e.n=1,w(r);case 1:if(o=e.v,i=b({fieldbusDevice:r,deviceType:o}),_.isEmpty(i))return e.a(2,[]);e.n=2;break;case 2:return a=_.groupBy(i,T),e.a(2,_(n).chain().get("categoriesConfig",[]).map(function(e){var t=_.get(a,e.name);_.defaults(e,{label:e.name||l("Uncategorized")});t=_.flow([s,y])({categoryConfigElements:e.elements,deviceType:o,elements:i,categoryElements:t,widgetConfig:n}).categoryConfigElements;return e.elements=t,e}).thru(function(e){return E({categoriesConfig:e,categories:a,deviceType:o,widgetConfig:n})}).value())}},e)}))).apply(this,arguments)}function s(e){var t=e.categoryConfigElements,r=e.deviceType,n=e.elements,o=e.categoryElements,e=e.widgetConfig;return{categoryConfigElements:_.map(t,function(e){var t=e.refId,t=f.findElementBestMatchingRefId(n,t,e.type);if(t)return _.defaults(e,{name:t.name,type:t.meta.type.value,typeLabel:f.getElementTypeLabel(t,r),show:!0,label:t.name})}),deviceType:r,elements:n,categoryElements:o,widgetConfig:e}}function y(e){var t=e.categoryConfigElements,r=e.deviceType,n=e.elements,o=e.categoryElements,i=e.widgetConfig;return{categoryConfigElements:[].concat(_toConsumableArray(t),_toConsumableArray(_(o).filter(function(e){return!_.find(t,{refId:f.getElementRefId(e)})}).map(function(e){return{refId:f.getElementRefId(e),label:e.name,show:a(e,i),name:e.name,type:e.meta.type.value,typeLabel:f.getElementTypeLabel(e,r)}}).value())),deviceType:r,elements:n,categoryElements:o,widgetConfig:i}}function a(e,t){return(e.meta.type===f.ElementType.REGISTER?p:g)(e,t)}function p(e,t){var r=e.id,n=e.input,o=e.number,e=e.startBit,t=t.registers;return _.includes(t,r)||_.includes(t,[n,o,e].join(","))||_.includes(t,o)||!!_.find(t,{number:o,startBit:e})}function g(e,t){var r=e.id,n=e.input,e=e.number,t=t.coils;return _.includes(t,r)||_.includes(t,[n,e].join(","))||_.includes(t,e)}function m(){return(m=_asyncToGenerator(_regenerator().m(function e(t){var r,n,o,i,a;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return o=_.get(t,"device.id"),r=u.detailRealtime(o),n=r.then(w),o=function(){return d.apply(this,arguments)}(o,t).then(function(e){return _.get(t,"categoriesConfig",e)}),e.n=1,c.all({fieldbusDevice:r,deviceType:n,categoriesConfig:o});case 1:return r=e.v,n=r.fieldbusDevice,o=r.categoriesConfig,i=b({fieldbusDevice:n,deviceType:r.deviceType}),a=_.map(o,function(e){return _.defaults(_objectSpread(_objectSpread({},e),{},{elements:_(e.elements).map(function(e){var t=f.findElementBestMatchingRefId(i,e.refId,e.type);return t?_.defaults(_objectSpread(_objectSpread({},e),t),{label:t.name,show:!0}):e}).filter("show").value()}),{label:e.name})}),e.a(2,{device:n,categories:a})}},e)}))).apply(this,arguments)}function d(){return(d=_asyncToGenerator(_regenerator().m(function e(t,r){var n,o,i;return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,h(t);case 1:return n=e.v,e.n=2,w(n);case 2:return o=e.v,i=b({fieldbusDevice:n,deviceType:o}),i=_.groupBy(i,T),e.a(2,E({categoriesConfig:[],categories:i,deviceType:o,widgetConfig:r}))}},e)}))).apply(this,arguments)}function b(e){var t=e.fieldbusDevice,e=f.getElementsWithMeta(e.deviceType);return _.has(t,r)||_.has(t,n)?e:_.filter(e,v)}function v(e){return e.meta.type===f.ElementType.REGISTER&&!e.input}function h(e){return f.isFieldbusDevice(e)?c.resolve(e):u.detail(t.getId(e)).then(t.getResData)}function w(e){return f.getDeviceTypeFromDevice(e)}function T(e){return _.get(e,"category","")}function E(e){var r=e.categoriesConfig,t=e.categories,n=e.deviceType,o=e.widgetConfig;return[].concat(_toConsumableArray(r),_toConsumableArray(_(t).pickBy(function(e,t){return!_.find(r,{name:t})}).map(function(e,t){return{name:t,label:t||l("Uncategorized"),elements:_.map(e,function(e){return{refId:f.getElementRefId(e),label:e.name,show:a(e,o),name:e.name,type:e.meta.type.value,typeLabel:f.getElementTypeLabel(e,n)}})}}).value()))}}e.$inject=["$q","fieldbusConstants","c8yBase","c8yDevices","c8yDeviceDatabase","gettext"],angular.module("c8y.modbusWidget4").factory("modbusWidgetSvc",e)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _regenerator(){var d,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function r(e,t,n,r){var o,i,a,c,f,u,g,l,s,t=t&&t.prototype instanceof _?t:_,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(o=e,i=n,g=r||[],l=!1,s={p:u=0,n:0,v:d,a:p,f:p.bind(d,4),d:function(e,t){return a=e,c=0,f=d,s.n=t,y}},function(e,t,n){if(1<u)throw TypeError("Generator is already running");for(l&&1===t&&p(t,n),c=t,f=n;(v=c<2?d:f)||!l;){a||(c?c<3?(1<c&&(s.n=-1),p(c,f)):s.n=f:s.v=f);try{if(u=2,a){if(v=a[e=c?e:"next"]){if(!(v=v.call(a,f)))throw TypeError("iterator result is not an object");if(!v.done)return v;f=v.value,c<2&&(c=0)}else 1===c&&(v=a.return)&&v.call(a),c<2&&(f=TypeError("The iterator does not provide a '"+e+"' method"),c=1);a=d}else if((v=(l=s.n<0)?f:o.call(i,s))!==y)break}catch(e){a=d,c=1,f=e}finally{u=1}}return{value:v,done:l}}),!0),t;function p(e,t){for(c=e,f=t,v=0;!l&&u&&!n&&v<g.length;v++){var n,r=g[v],o=s.p,i=r[2];3<e?(n=i===t)&&(f=r[(c=r[4])?5:c=3],r[4]=r[5]=d):r[0]<=o&&((n=e<2&&o<r[1])?(c=0,s.v=t,s.n=r[1]):o<i&&(n=e<3||r[0]>t||i<t)&&(r[4]=e,r[5]=t,s.n=i,c=0))}if(n||1<e)return y;throw l=!0,t}}var y={};function _(){}function o(){}function i(){}var v=Object.getPrototypeOf,e=[][t]?v(v([][t]())):(_regeneratorDefine2(v={},t,function(){return this}),v),a=i.prototype=_.prototype=Object.create(e);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,_regeneratorDefine2(e,n,"GeneratorFunction")),e.prototype=Object.create(a),e}return _regeneratorDefine2(a,"constructor",o.prototype=i),_regeneratorDefine2(i,"constructor",o),_regeneratorDefine2(i,n,o.displayName="GeneratorFunction"),_regeneratorDefine2(a),_regeneratorDefine2(a,n,"Generator"),_regeneratorDefine2(a,t,function(){return this}),_regeneratorDefine2(a,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:r,m:c}})()}function _regeneratorDefine2(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(_regeneratorDefine2=function(e,t,n,r){t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:((r=function(t,n){_regeneratorDefine2(e,t,function(e){return this._invoke(t,n,e)})})("next",0),r("throw",1),r("return",2))})(e,t,n,r)}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),f=c.value}catch(e){return void n(e)}c.done?t(f):Promise.resolve(f).then(r,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,n){var r=c.apply(e,a);function o(e){asyncGeneratorStep(r,t,n,o,i,"next",e)}function i(e){asyncGeneratorStep(r,t,n,o,i,"throw",e)}o(void 0)})}}(()=>{function e(t,n){var e,r,o=this;function i(){return(i=_asyncToGenerator(_regenerator().m(function e(){return _regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.getConfigModel(o.config);case 1:o.categoriesConfig=e.v,t.$apply();case 2:return e.a(2)}},e)}))).apply(this,arguments)}_.assign(o,{$doCheck:function(){_.isEqual(e,o.config.device)||(e=o.config.device,function(){i.apply(this,arguments)}());_.isEqual(r,o.categoriesConfig)||(r=_.cloneDeep(o.categoriesConfig),(()=>{var e;if(r)return e=n.isAtLeastOneElementSelected(r),o.modbusWidgetConfigForm.modbusWidgetValidation.$setValidity("at-least-one-field-selected",e),o.atLeastOneElementSelected=e})()&&n.updateConfigModel(o.config,r))}})}e.$inject=["$rootScope","modbusWidgetSvc"],angular.module("c8y.modbusWidget4").component("c8yModbusWidgetConfig",{templateUrl:":::PLUGIN_PATH:::/widget-config.html",bindings:{config:"<"},controllerAs:"vm",controller:e})})();
|
|
@@ -2,94 +2,84 @@
|
|
|
2
2
|
<div ng-if="vm.categoriesConfig.length === 0" class="alert alert-warning" translate>
|
|
3
3
|
No categories available.
|
|
4
4
|
</div>
|
|
5
|
-
|
|
6
|
-
<div ui-sortable="{handle: '.handle-category'}" ng-model="vm.categoriesConfig">
|
|
7
|
-
<div class="panel panel-default" ng-repeat="category in vm.categoriesConfig">
|
|
8
|
-
<div class="panel-heading">
|
|
9
|
-
<div class="d-flex">
|
|
10
|
-
<div class="handle-category">
|
|
11
|
-
<i c8y-icon="bars" style="cursor:move;"></i>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
<div class="ui-sortable-title">
|
|
15
|
-
<label class="editable" ng-if="category.name">
|
|
16
|
-
<input
|
|
17
|
-
class="form-control"
|
|
18
|
-
style="max-width:calc({{ category.label.length || 10 }} * 1ch + 14px)"
|
|
19
|
-
ng-model="category.label"
|
|
20
|
-
/>
|
|
21
|
-
<span>{{ category.label }}</span>
|
|
22
|
-
</label>
|
|
23
|
-
<label class="editable text-muted" ng-if="!category.name">
|
|
24
|
-
<span>{{ category.label | translate }}</span>
|
|
25
|
-
</label>
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
<div class="ui-sortable-actions text-right">
|
|
29
|
-
<button class="btn btn-link" ng-click="category.isCollapsed = !category.isCollapsed">
|
|
30
|
-
<i c8y-icon="chevron-down" ng-if="category.isCollapsed"></i>
|
|
31
|
-
<i c8y-icon="chevron-up" ng-if="!category.isCollapsed"></i>
|
|
32
|
-
</button>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
<div class="panel-body" uib-collapse="category.isCollapsed">
|
|
37
|
-
<table class="table table-vertical-middle form-group">
|
|
38
|
-
<thead>
|
|
39
|
-
<th style="width:5%;"></th>
|
|
40
|
-
<th style="width:5%;">
|
|
41
|
-
<label>{{ 'Show' | translate }}</label>
|
|
42
|
-
</th>
|
|
43
|
-
<th style="width:34%;">
|
|
44
|
-
<label>{{ 'Label' | translate }}</label>
|
|
45
|
-
</th>
|
|
46
|
-
<th style="width:28%;">
|
|
47
|
-
<label>{{ 'Name' | translate }}</label>
|
|
48
|
-
</th>
|
|
49
|
-
<th style="width:28%;">
|
|
50
|
-
<label>{{ 'Type' | translate }}</label>
|
|
51
|
-
</th>
|
|
52
|
-
</thead>
|
|
53
|
-
<tbody ui-sortable="{handle: '.handle-property'}" ng-model="category.elements">
|
|
54
|
-
<tr class="property" ng-repeat="element in category.elements">
|
|
55
|
-
<td class="handle-property" style="width:5%;">
|
|
56
|
-
<i c8y-icon="bars" style="cursor:move;"></i>
|
|
57
|
-
</td>
|
|
58
|
-
<td style="width:5%; vertical-align:middle;">
|
|
59
|
-
<label class="c8y-checkbox input-sm" style="line-height:30px;">
|
|
60
|
-
<input type="checkbox" ng-model="element.show" />
|
|
61
|
-
<span></span>
|
|
62
|
-
</label>
|
|
63
|
-
</td>
|
|
64
|
-
<td style="width:34%;">
|
|
65
|
-
<label class="editable">
|
|
66
|
-
<input
|
|
67
|
-
class="form-control"
|
|
68
|
-
style="max-width:calc({{ element.label.length || 10 }} * 1ch + 14px)"
|
|
69
|
-
ng-model="element.label"
|
|
70
|
-
/>
|
|
71
|
-
<span>{{ element.label }}</span>
|
|
72
|
-
</label>
|
|
73
|
-
</td>
|
|
74
|
-
<td style="width:28%;">
|
|
75
|
-
{{ element.name }}
|
|
76
|
-
</td>
|
|
77
|
-
<td style="width:28%;">
|
|
78
|
-
{{ element.typeLabel | translate }}
|
|
79
|
-
</td>
|
|
80
|
-
</tr>
|
|
81
|
-
</tbody>
|
|
82
|
-
</table>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
<input type="hidden" name="modbusWidgetValidation" ng-model="vm.modbusWidgetValidation" />
|
|
88
|
-
|
|
89
5
|
<div
|
|
90
6
|
ng-if="vm.categoriesConfig.length > 0 && !vm.atLeastOneElementSelected"
|
|
91
7
|
class="alert alert-warning"
|
|
92
8
|
>
|
|
93
9
|
<span translate>At least one field needs to be selected.</span>
|
|
94
10
|
</div>
|
|
11
|
+
<div ui-sortable="{handle: '.handle-category'}" ng-model="vm.categoriesConfig">
|
|
12
|
+
<fieldset class="c8y-fieldset" ng-repeat="category in vm.categoriesConfig">
|
|
13
|
+
<legend>
|
|
14
|
+
<label class="editable" ng-if="category.name">
|
|
15
|
+
<input
|
|
16
|
+
class="form-control input-sm"
|
|
17
|
+
style="width:calc({{ category.label.length || 10 }} * 1ch);"
|
|
18
|
+
ng-model="category.label"
|
|
19
|
+
/>
|
|
20
|
+
<span>{{ category.label }}</span>
|
|
21
|
+
</label>
|
|
22
|
+
<label class="editable text-muted" ng-if="!category.name">
|
|
23
|
+
<span>{{ category.label | translate }}</span>
|
|
24
|
+
</label>
|
|
25
|
+
</legend>
|
|
26
|
+
|
|
27
|
+
<table class="table table-vertical-middle table-condensed bg-inherit" style="table-layout: fixed;">
|
|
28
|
+
<colgroup>
|
|
29
|
+
<col style="width:5%;" />
|
|
30
|
+
<col style="width:7%;" />
|
|
31
|
+
<col style="width:34%;" />
|
|
32
|
+
<col style="width:28%;" />
|
|
33
|
+
<col style="width:26%;" />
|
|
34
|
+
</colgroup>
|
|
35
|
+
<thead>
|
|
36
|
+
<th></th>
|
|
37
|
+
<th>
|
|
38
|
+
<span>{{ 'Show' | translate }}</span>
|
|
39
|
+
</th>
|
|
40
|
+
<th>
|
|
41
|
+
<span>{{ 'Label' | translate }}</sp>
|
|
42
|
+
</th>
|
|
43
|
+
<th>
|
|
44
|
+
<span>{{ 'Name' | translate }}</span>
|
|
45
|
+
</th>
|
|
46
|
+
<th>
|
|
47
|
+
<span>{{ 'Type' | translate }}</spa>
|
|
48
|
+
</th>
|
|
49
|
+
</thead>
|
|
50
|
+
<tbody ui-sortable="{handle: '.handle-property'}" ng-model="category.elements">
|
|
51
|
+
<tr class="property" ng-repeat="element in category.elements">
|
|
52
|
+
<td class="handle-property">
|
|
53
|
+
<i c8y-icon="bars" style="cursor:move;"></i>
|
|
54
|
+
</td>
|
|
55
|
+
<td style="vertical-align:middle;">
|
|
56
|
+
<label class="c8y-checkbox input-sm" style="line-height:30px;">
|
|
57
|
+
<input type="checkbox" ng-model="element.show" />
|
|
58
|
+
<span></span>
|
|
59
|
+
</label>
|
|
60
|
+
</td>
|
|
61
|
+
<td>
|
|
62
|
+
<label class="editable">
|
|
63
|
+
<input
|
|
64
|
+
class="form-control input-sm"
|
|
65
|
+
style="max-width:calc({{ element.label.length || 10 }} * 1ch + 14px)"
|
|
66
|
+
ng-model="element.label"
|
|
67
|
+
/>
|
|
68
|
+
<span>{{ element.label }}</span>
|
|
69
|
+
</label>
|
|
70
|
+
</td>
|
|
71
|
+
<td>
|
|
72
|
+
{{ element.name }}
|
|
73
|
+
</td>
|
|
74
|
+
<td>
|
|
75
|
+
{{ element.typeLabel | translate }}
|
|
76
|
+
</td>
|
|
77
|
+
</tr>
|
|
78
|
+
</tbody>
|
|
79
|
+
</table>
|
|
80
|
+
</fieldset>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<input type="hidden" name="modbusWidgetValidation" ng-model="vm.modbusWidgetValidation" />
|
|
84
|
+
|
|
95
85
|
</ng-form>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c8y/ng1-modules",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1022.4.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Cumulocity",
|
|
6
6
|
"description": "AngularJS modules for Cumulocity IoT applications.",
|
|
@@ -17,44 +17,42 @@
|
|
|
17
17
|
"angular-i18n": "1.8.3",
|
|
18
18
|
"angular-leaflet-directive": "0.10.0",
|
|
19
19
|
"angular-messages": "1.8.3",
|
|
20
|
+
"angular-qrcode": "7.2.0",
|
|
20
21
|
"angular-route": "1.8.3",
|
|
21
22
|
"angular-sanitize": "1.8.3",
|
|
22
23
|
"angular-schema-form": "0.8.14",
|
|
23
24
|
"angular-ui-ace": "0.2.3",
|
|
24
25
|
"angular-ui-bootstrap": "2.5.6",
|
|
25
26
|
"angular-ui-sortable": "0.15.1",
|
|
26
|
-
"angular-qrcode": "7.2.0",
|
|
27
27
|
"angularjs-nvd3-directives": "0.0.8",
|
|
28
28
|
"bootstrap": "3.4.1",
|
|
29
29
|
"cometd": "4.0.8",
|
|
30
|
-
"ip.js": "1.2.2",
|
|
31
30
|
"d3": "3.5.5",
|
|
31
|
+
"dompurify": "3.2.5",
|
|
32
32
|
"fast-text-encoding": "1.0.6",
|
|
33
33
|
"file-saver": "2.0.5",
|
|
34
34
|
"ini": "5.0.0",
|
|
35
|
+
"ip.js": "1.2.2",
|
|
35
36
|
"jquery": "3.6.0",
|
|
36
37
|
"jquery-ui": "1.13.0",
|
|
37
38
|
"leaflet": "1.9.4",
|
|
38
|
-
"libphonenumber-js": "1.11.
|
|
39
|
+
"libphonenumber-js": "1.11.19",
|
|
39
40
|
"lodash": "4.17.21",
|
|
40
41
|
"moment": "2.30.1",
|
|
41
42
|
"ng-csv": "0.3.6",
|
|
42
|
-
"noVNC": "https://github.com/novnc/noVNC/archive/v0.6.2.tar.gz",
|
|
43
43
|
"nvd3": "1.1.15",
|
|
44
44
|
"objectpath": "1.1.0",
|
|
45
|
-
"payment": "2.4.
|
|
45
|
+
"payment": "2.4.7",
|
|
46
46
|
"tv4": "1.3.0",
|
|
47
47
|
"ui-select": "0.19.8",
|
|
48
|
-
"
|
|
49
|
-
"xterm-addon-fit": "0.8.0",
|
|
50
|
-
"zip-js": "0.0.3",
|
|
51
|
-
"dompurify": "3.1.3"
|
|
48
|
+
"zip-js": "0.0.3"
|
|
52
49
|
},
|
|
53
50
|
"devDependencies": {
|
|
54
|
-
"jest-junit": "16.0.0",
|
|
55
|
-
"fs-extra": "^11.2.0",
|
|
56
|
-
"npm-packlist": "1.1.11",
|
|
57
51
|
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
|
52
|
+
"@types/angular": "1.8.9",
|
|
53
|
+
"fs-extra": "^11.3.0",
|
|
54
|
+
"jest-junit": "16.0.0",
|
|
55
|
+
"npm-packlist": "10.0.0",
|
|
58
56
|
"uglify-js": "3.19.3"
|
|
59
57
|
},
|
|
60
58
|
"peerDependencies": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{function e(e,t,r,i){var o="properties-library",n=i("Properties library"),a={parent:i("Settings"),name:n,routerLinkExact:!1,path:o,icon:"book-shelf",priority:1100},c="/".concat(o),o='<c8y-json-schema-objects-list filters="filters"></c8y-json-schema-objects-list>',i=[{name:i("Inventory"),icon:"cubes",template:o,controller:l({MANAGED_OBJECTS:!0}),priority:4e3},{name:i("Alarm"),icon:"bell",template:o,controller:l({ALARMS:!0}),priority:3e3},{name:i("Event"),icon:"
|
|
1
|
+
(()=>{function e(e,t,r,i){var o="properties-library",n=i("Properties library"),a={parent:i("Settings"),name:n,routerLinkExact:!1,path:o,icon:"book-shelf",priority:1100},c="/".concat(o),o='<c8y-json-schema-objects-list filters="filters"></c8y-json-schema-objects-list>',i=[{name:i("Inventory"),icon:"cubes",template:o,controller:l({MANAGED_OBJECTS:!0}),priority:4e3},{name:i("Alarm"),icon:"bell",template:o,controller:l({ALARMS:!0}),priority:3e3},{name:i("Event"),icon:"online1",template:o,controller:l({EVENTS:!0}),priority:2e3},{name:i("Tenant"),icon:"c8y-sub-tenants",template:o,controller:l({TENANTS:!0}),priority:1e3,showIfPermissions:{anyRole:["ROLE_TENANT_MANAGEMENT_READ"]}}];function l(t){function e(e){e.filters={appliesTo:t}}return e.$inject=["$scope"],e}e.addNavigation(a),t.addTitle(c,{data:_.constant({title:n})}),_.forEach(i,function(e){r.when(c,e)})}e.$inject=["c8yNavigatorProvider","c8yTitleProvider","c8yViewsProvider","gettext"],angular.module("c8y.propertiesLibrary",[]).config(e)})();
|
|
@@ -214,12 +214,10 @@
|
|
|
214
214
|
<div class="card-header separator">
|
|
215
215
|
<div class="card-icon">
|
|
216
216
|
<i
|
|
217
|
-
class="text-gray-darker"
|
|
218
217
|
c8y-icon="connected-people"
|
|
219
218
|
ng-if="role.customProperties"
|
|
220
219
|
></i>
|
|
221
220
|
<i
|
|
222
|
-
class="text-gray-darker"
|
|
223
221
|
c8y-icon="insurance-agent"
|
|
224
222
|
ng-if="!role.customProperties"
|
|
225
223
|
></i>
|