@c8y/ng1-modules 1018.499.5 → 1018.500.18

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.
Files changed (31) hide show
  1. package/NOTICES +1271 -2026
  2. package/app-status/app-instances/app-instances.html +1 -1
  3. package/app-status/app-tenant-subscriptions-list/app-tenant-subscriptions-list.html +21 -20
  4. package/core/core/services/dynamicGroups.js +1 -1
  5. package/core/locales/de.po +72 -36
  6. package/core/locales/en.po +6 -0
  7. package/core/locales/es.po +258 -36
  8. package/core/locales/fr.po +255 -33
  9. package/core/locales/ja_JP.po +255 -33
  10. package/core/locales/ko.po +270 -48
  11. package/core/locales/nl.po +255 -33
  12. package/core/locales/pl.po +257 -35
  13. package/core/locales/pt_BR.po +284 -62
  14. package/core/locales/zh_CN.po +255 -33
  15. package/core/locales/zh_TW.po +255 -33
  16. package/core/ui/configurable-device-list-columns/configurable-columns.service.js +1 -1
  17. package/core/ui/schemaForm/schemaForm.component.js +1 -1
  18. package/device-protocol-lwm2m/lwm2mDetail.html +38 -6
  19. package/device-protocol-lwm2m/lwm2mResource.html +79 -16
  20. package/device-protocol-modbus/modbus-device.provider.js +1 -1
  21. package/deviceDatabase4/modals/configure-discrete-io.component.js +1 -1
  22. package/deviceDatabase4/modals/configure-register.component.js +1 -1
  23. package/deviceStatusWidget/availability.html +4 -4
  24. package/deviceStatusWidget/deviceStatus.component.js +1 -1
  25. package/deviceStatusWidget/deviceStatus.html +39 -2
  26. package/deviceStatusWidget/requiredAvailabilityIntervalSetting.html +65 -25
  27. package/export/views/timespan.html +27 -8
  28. package/modbusConfiguration4/fieldbus-config.component.js +1 -1
  29. package/package.json +2 -2
  30. package/smartRules/directives/smartRuleParamInputKpi.js +1 -1
  31. package/tenantLicenses/index.js +1 -1
@@ -1,66 +1,100 @@
1
1
  <div ng-form="vm.availabilityForm">
2
- <div class="d-flex gap-8 a-i-center" style="min-height: 36px">
3
- <p class="col-xs-5 text-12 p-0 text-medium flex-no-shrink" ng-hide="vm.isEditMode" translate>
2
+ <div
3
+ class="d-flex gap-8 a-i-center separator-top"
4
+ style="min-height: 36px"
5
+ >
6
+ <p
7
+ class="col-xs-5 text-12 p-0 text-medium flex-no-shrink"
8
+ ng-hide="vm.isEditMode"
9
+ translate
10
+ >
4
11
  Required interval
5
12
  </p>
6
- <div class="flex-grow d-flex" ng-hide="vm.isEditMode">
13
+ <div
14
+ class=" d-flex flex-grow a-i-center"
15
+ ng-hide="vm.isEditMode"
16
+ >
7
17
  <span>{{ vm.responseInterval || '---' }}</span>
8
- <span class="m-l-4" translate translate-n="vm.responseInterval" translate-plural="minutes">
18
+ <span
19
+ class="m-l-4"
20
+ translate
21
+ translate-n="vm.responseInterval"
22
+ translate-plural="minutes"
23
+ >
9
24
  minute
10
25
  </span>
11
26
  <button
12
27
  class="btn btn-dot m-l-auto"
13
- type="button"
14
28
  aria-label="{{ 'Edit' | translate }}"
15
29
  uib-tooltip="{{ 'Edit' | translate }}"
16
30
  tooltip-popup-delay="500"
17
31
  tooltip-trigger="'mouseenter'"
18
32
  tooltip-append-to-body="true"
33
+ type="button"
19
34
  ng-hide="!!vm.status.maintenanceStatus"
20
35
  ng-click="vm.toggleEdit()"
21
36
  >
22
37
  <i c8y-icon="pencil"></i>
23
38
  </button>
24
39
  </div>
25
- <div ng-show="vm.isEditMode" class="fit-w">
26
- <div class="input-group" ng-class="{ 'has-error': vm.invalid('required_availability') }">
40
+ <div
41
+ class="fit-w"
42
+ ng-show="vm.isEditMode"
43
+ >
44
+ <div
45
+ class="input-group"
46
+ ng-class="{ 'has-error': vm.invalid('required_availability') }"
47
+ >
27
48
  <input
28
- id="required_availability"
29
- name="required_availability"
30
49
  class="form-control"
50
+ id="required_availability"
51
+ uib-tooltip="{{ vm.validationHints(vm.availabilityForm.required_availability) }}"
52
+ tooltip-popup-delay="500"
53
+ tooltip-append-to-body="true"
31
54
  placeholder="{{ 'e.g.' | translate }} 1"
55
+ name="required_availability"
32
56
  ng-disabled="vm.device.c8y_RequiredAvailability.responseInterval < 0 || !vm.isEditMode"
33
57
  ng-model="vm.responseInterval"
34
58
  ng-keyup="vm.keyHandler($event)"
35
59
  c8y-number
36
60
  c8y-max="vm.maxRequiredIntervalLimit"
37
61
  c8y-min="0"
38
- uib-tooltip="{{ vm.validationHints(vm.availabilityForm.required_availability) }}"
39
- tooltip-popup-delay="500"
40
- tooltip-append-to-body="true"
41
62
  />
42
63
  <div class="input-group-btn">
43
64
  <button
44
65
  class="btn btn-dot"
45
- type="button"
46
- aria-label="{{ 'Save' | translate }}"
47
66
  ng-class="{ 'btn-pending': vm.saveInProgress }"
67
+ aria-label="{{ 'Save' | translate }}"
68
+ type="button"
48
69
  ng-disabled="vm.saveInProgress || vm.availabilityForm.$invalid || !!vm.status.maintenanceStatus"
49
70
  ng-click="vm.save()"
50
71
  >
51
- <span title="{{ 'Save' | translate }}" ng-hide="vm.saveInProgress" class="text-success">
72
+ <span
73
+ class="text-success"
74
+ title="{{ 'Save' | translate }}"
75
+ ng-hide="vm.saveInProgress"
76
+ >
52
77
  <i c8y-icon="check"></i>
53
78
  </span>
54
- <span title="{{ 'Saving' | translate }}…" ng-show="vm.saveInProgress">
55
- <i c8y-icon="circle-o-notch" class="icon-spin"></i>
79
+ <span
80
+ title="{{ 'Saving' | translate }}…"
81
+ ng-show="vm.saveInProgress"
82
+ >
83
+ <i
84
+ class="icon-spin"
85
+ c8y-icon="circle-o-notch"
86
+ ></i>
56
87
  </span>
57
88
  </button>
58
89
  </div>
59
- <div class="input-group-btn" ng-show="vm.isEditMode">
90
+ <div
91
+ class="input-group-btn"
92
+ ng-show="vm.isEditMode"
93
+ >
60
94
  <button
61
95
  class="btn btn-dot btn-dot--danger"
62
- type="button"
63
96
  title="{{ 'Cancel' | translate }}"
97
+ type="button"
64
98
  ng-disabled="vm.saveInProgress || !!vm.status.maintenanceStatus"
65
99
  ng-click="vm.resetEdit()"
66
100
  >
@@ -73,28 +107,34 @@
73
107
  </div>
74
108
 
75
109
  <div ng-if="vm.device.c8y_Availability && vm.device.c8y_RequiredAvailability">
76
- <div class="d-flex gap-8 a-i-center separator-top" style="min-height: 36px">
77
- <p for="maintenance" class="col-xs-5 text-12 p-0 text-medium flex-no-shrink" translate>
110
+ <div
111
+ class="d-flex gap-8 a-i-center separator-top"
112
+ style="min-height: 36px"
113
+ >
114
+ <p
115
+ class="col-xs-5 text-12 p-0 text-medium flex-no-shrink"
116
+ for="maintenance"
117
+ translate
118
+ >
78
119
  Maintenance
79
120
  </p>
80
121
  <div class="flex-grow d-flex a-i-center">
81
122
  <label
123
+ class="c8y-switch c8y-switch--inline"
82
124
  uib-tooltip="{{ 'Enable/disable maintenance' | translate }}"
83
125
  tooltip-popup-delay="500"
84
126
  tooltip-append-to-body="true"
85
- class="c8y-switch c8y-switch--inline"
86
127
  >
87
128
  <input
88
- id="maintenance"
89
129
  title="{{ 'Enable/disable maintenance' | translate }}"
90
130
  aria-label="{{ 'Enable/disable maintenance' | translate }}"
131
+ id="maintenance"
91
132
  type="checkbox"
92
133
  ng-click="vm.switchMaintenance(vm.device)"
93
134
  ng-checked="vm.status.maintenanceStatus"
94
135
  data-cy="requiredAvailabilityIntervalSetting--switchMaintenance"
95
136
  />
96
- <span>
97
- </span>
137
+ <span></span>
98
138
  </label>
99
139
  </div>
100
140
  </div>
@@ -1,14 +1,14 @@
1
1
  <div class="row export-timespan">
2
2
  <div class="form-group">
3
3
  <div class="col-sm-4 col-xs-12">
4
- <div class="c8y-select-wrapper" >
4
+ <div class="c8y-select-wrapper">
5
5
  <select
6
6
  aria-label="{{ 'Time range' | translate }}"
7
7
  class="form-control input-sm"
8
8
  ng-model="timespan.dateType"
9
9
  ng-options="key as (label | translate) for (key, label) in types"
10
10
  ></select>
11
- <span ></span>
11
+ <span></span>
12
12
  </div>
13
13
  </div>
14
14
  <button
@@ -16,7 +16,9 @@
16
16
  class="btn-help btn-help--sm"
17
17
  type="button"
18
18
  aria-label="{{ 'Help' | translate }}"
19
- uib-popover="{{ 'From midnight last month to now. More in documentation.' | translate }}"
19
+ uib-popover="{{
20
+ 'From midnight last month to now. For details refer to the user documentation.' | translate
21
+ }}"
20
22
  popover-placement="right"
21
23
  popover-trigger="'focus'"
22
24
  ></button>
@@ -25,7 +27,9 @@
25
27
  class="btn-help btn-help--sm"
26
28
  type="button"
27
29
  aria-label="{{ 'Help' | translate }}"
28
- uib-popover="{{ 'From midnight last week to now. More in documentation.' | translate }}"
30
+ uib-popover="{{
31
+ 'From midnight last week to now. For details refer to the user documentation.' | translate
32
+ }}"
29
33
  popover-placement="right"
30
34
  popover-trigger="'focus'"
31
35
  ></button>
@@ -34,16 +38,26 @@
34
38
  class="btn-help btn-help--sm"
35
39
  type="button"
36
40
  aria-label="{{ 'Help' | translate }}"
37
- uib-popover="{{ 'From midnight last year to now. More in documentation.' | translate }}"
41
+ uib-popover="{{
42
+ 'From midnight last year to now. For details refer to the user documentation.' | translate
43
+ }}"
38
44
  popover-placement="right"
39
45
  popover-trigger="'focus'"
40
46
  ></button>
41
47
  </div>
42
- <div class="col-xs-12" ng-if="timespan.dateType === 'CUSTOM'">
48
+ <div
49
+ class="col-xs-12"
50
+ ng-if="timespan.dateType === 'CUSTOM'"
51
+ >
43
52
  <div class="row">
44
53
  <div class="col-sm-6 col-xs-12">
45
54
  <div class="timespan-label">
46
- <label class="small" translate>From`date`</label>
55
+ <label
56
+ class="small"
57
+ translate
58
+ >
59
+ From`date`
60
+ </label>
47
61
  </div>
48
62
  <div class="d-inline-block">
49
63
  <c8y-date-time-picker
@@ -56,7 +70,12 @@
56
70
  </div>
57
71
  <div class="col-sm-6 col-xs-12">
58
72
  <div class="timespan-label">
59
- <label class="small" translate>To`date`</label>
73
+ <label
74
+ class="small"
75
+ translate
76
+ >
77
+ To`date`
78
+ </label>
60
79
  </div>
61
80
  <div class="d-inline-block">
62
81
  <c8y-date-time-picker
@@ -1 +1 @@
1
- "use strict";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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var i;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function _iterableToArrayLimit(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,a,s=[],u=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;u=!1}else for(;!(u=(n=o.call(i)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);i=i.call(e,t||"default");if("object"!==_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(e,r,t,i,o,a,n,s,u,c,d,l,y,f,p,v){var g,m=this,b=t.deviceId,A={types:[]},I={IS_REQUIRED:"required",ADDRESS_IN_USE:"address-in-use",ADDRESSES_IN_USE:"addresses-in-use",ADDRESS_INVALID:"address-invalid",POLLING_RATE_LARGER_THAN_TRANSMIT_RATE:"polling-rate-larger-than-transmit-rate",ONLY_NATURAL_NUMBERS_ALLOWED:"only-natural-numbers-allowed",IPADDRESS_INVALID_FORMAT:"ip",INVALID_URL:"invalid-url",NODE_IN_USE:"node-in-use",NODE_OUT_OF_RANGE:"node-out-of-range",IP_RANGE:"ip-range",PORT_INVALID:"port-invalid",IP_RANGE_MAXLIMIT:"ip-range-maxlimit",ENGINEID_IN_USE:"engineid-in-use",IS_MIN:"min"};_defineProperty(g={},I.IS_REQUIRED,p("This field is required.")),_defineProperty(g,I.ADDRESS_IN_USE,p("This address is already in use.")),_defineProperty(g,I.ADDRESSES_IN_USE,p("These addresses are already in use.")),_defineProperty(g,I.ADDRESS_INVALID,p("Addresses from 248 up to 254 are not allowed.")),_defineProperty(g,I.POLLING_RATE_LARGER_THAN_TRANSMIT_RATE,p("Polling rate must be equal to or smaller than transmit rate.")),_defineProperty(g,I.ONLY_NATURAL_NUMBERS_ALLOWED,p("Only natural numbers allowed.")),_defineProperty(g,I.IPADDRESS_INVALID_FORMAT,p("The IP address format is invalid.")),_defineProperty(g,I.INVALID_URL,p("The URL format is invalid. The only supported protocols are http, https and opc.tcp.")),_defineProperty(g,I.NODE_IN_USE,p("This node id is already in use.")),_defineProperty(g,I.IP_RANGE,p("Invalid IP address range.")),_defineProperty(g,I.PORT_INVALID,p("Invalid port number.")),_defineProperty(g,I.IP_RANGE_MAXLIMIT,p("Max. 30 IP addresses in total allowed.")),_defineProperty(g,I.NODE_OUT_OF_RANGE,p("Only node ID(s) between 1 and 127 are allowed.")),_defineProperty(g,I.ENGINEID_IN_USE,p("This engine ID is already in use.")),_defineProperty(g,I.IS_MIN,p("Value cannot be lower than minimum."));function S(){var i=m.device,e={},t=(_.assign(m,{hasSerialConfigOperation:s.supportsOperation(i,"c8y_SerialConfiguration"),hasFieldBusConfigOperation:(t=i,O()&&s.supportsOperation(t,"c8y_CanConfiguration")||h()&&s.supportsOperation(t,"c8y_ModbusConfiguration")||L()&&s.supportsOperation(t,"c8y_OPCUAConfiguration")||M()&&s.supportsOperation(t,"c8y_ProfibusConfiguration")||U()&&s.supportsOperation(t,"c8y_CANopenConfiguration")||w()&&s.supportsOperation(t,"c8y_SNMPConfiguration")),serialConfiguration:_.get(i,"c8y_SerialConfiguration",{}),fieldbusConfiguration:function(e){var t={};e&&(h()?t=e.c8y_ModbusConfiguration:O()?t=e.c8y_CanConfiguration:L()?(e.c8y_OPCUAGateway&&(e.c8y_OPCUAGateway.transmitRate=e.c8y_OPCUAGateway.transmitRate||0,_.unset(e,"c8y_OPCUAGateway.userIdentityPassword")),t=e.c8y_OPCUAGateway):M()?(_.defaultsDeep(e,{c8y_ProfibusConfiguration:{baudRate:p("automatic")}}),t=e.c8y_ProfibusConfiguration):U()?t=e.c8y_CANopenConfiguration:w()&&(e.c8y_SNMPGateway&&(e.c8y_SNMPGateway.transmitRate=e.c8y_SNMPGateway.transmitRate||0,_.unset(e,"c8y_SNMPGateway.userIdentityPassword")),t=e.c8y_SNMPGateway));return t}(i)}),(w()||h())&&(e={pageSize:2e3}),m.tab);return d.getAvailableDeviceTypes({fieldbusType:t},e).then(function(e){var t=d.getFieldbusVersionFromDevice(i);_.set(m.fieldbusConfiguration,"maxFieldbusVersion",t),A.types=_.filter(e,function(e){return e.fieldbusVersion<=t})})}function P(){e={pageSize:1,fragmentType:"c8y_SnmpAutoDiscovery",status:"EXECUTING"},e=n.timeOrderFilter(e||{}),_.assign(e,_.pick(t,"deviceId")),e.revert=!0;var e;return a.list(e).then(D).then(T)}function D(e){var i,t,n=_slicedToArray(e,1)[0];return!!n&&(m.autoDiscoveryInProgress=!0,i=r.defer(),e="operation".concat(n.id),t="/operations/".concat(n.deviceId),l.getStatus(e,t)&&l.destroySubscription(e,t),l.addListener(e,t,"UPDATE",function(e,t){t.id===n.id&&(t.status===a.status.SUCCESSFUL||t.status===a.status.FAILED?i.resolve(t):i.notify(t))}),l.start(e,t),r.when({completed:i.promise}))}function N(){return s.childDevices(b).then(function(e){e=w()?_.orderBy(e,["name"],["asc"]):e;m.devices=_.map(e,function(e){var t,i,n,r,o,a;return h()&&e.c8y_ModbusDevice?(a=R({device:o=e,fieldbusDeviceFragment:"c8y_ModbusDevice"}),a={id:o.id,name:o.name,deviceType:_.get(a,"name"),address:o.c8y_ModbusDevice.address,ipAddress:o.c8y_ModbusDevice.ipAddress,protocol:o.c8y_ModbusDevice.protocol}):O()&&e.c8y_CanDevice?(r=R({device:o=e,fieldbusDeviceFragment:"c8y_CanDevice"}),a={id:o.id,name:o.name,deviceType:_.get(r,"name")}):L()&&e.c8y_OPCUADevice?(n=R({device:r=e,fieldbusDeviceFragment:"c8y_OPCUADevice"}),a={id:r.id,name:r.name,deviceType:_.get(n,"name"),directoryPath:r.c8y_OPCUADevice.browsePath}):M()&&e.c8y_ProfibusDevice?(i=R({device:n=e,fieldbusDeviceFragment:"c8y_ProfibusDevice"}),a={id:n.id,name:n.name,deviceType:_.get(i,"name")}):U()&&e.c8y_CANopenDevice?(t=R({device:i=e,fieldbusDeviceFragment:"c8y_CANopenDevice"}),a={id:i.id,name:i.name,deviceType:_.get(t,"name"),nodeId:i.c8y_CANopenDevice.nodeId}):w()&&e.c8y_SNMPDevice&&(e=R({device:t=e,fieldbusDeviceFragment:"c8y_SNMPDevice"}),a={id:t.id,name:t.name,deviceType:_.get(e,"name"),ipAddress:t.c8y_SNMPDevice.ipAddress,port:t.c8y_SNMPDevice.port,version:t.c8y_SNMPDevice.version,auth:_.get(t.c8y_SNMPDevice,"auth",{})}),a})})}function R(e){var t=e.device,i=e.fieldbusDeviceFragment;return _(A.types).find(function(e){e=e.id;return _.get(t,"".concat(i,".type"))==="/inventory/managedObjects/".concat(e)})}function C(){var e=m.fieldbusCommunicationForm;e.$setPristine(),e.$setUntouched()}function E(e){var t,e=e.split("-").map(function(e){return e.trim()}),i=f.validation.ip.pattern,n=f.validation.ipV6.pattern;if(2===e.length){var e=_slicedToArray(e,2),r=e[0],e=e[1],i=i.test(r)&&i.test(e),n=n.test(r)&&n.test(e);if(i||n)try{t=new o.Ip.Range(r,e)}catch(e){}}return t}function T(e){e.completed.then(function(e){e.status===a.status.SUCCESSFUL?(c.success(p("Autodiscovery completed.")),m.autoDiscoveryInProgress=!1):e.status===a.status.FAILED&&(e.failureReason?c.danger(v.getString('Autodiscovery failed due to: "{{ failureReason | translate }}".',e)):c.danger(p("Autodiscovery failed.")),m.autoDiscoveryInProgress=!1)},_.noop,function(){c.success(p("Autodiscovery in progress."))}).then(N)}function h(){return"modbus"===m.tab}function O(){return"canbus"===m.tab}function L(){return"opcua"===m.tab}function M(){return"profibus"===m.tab}function U(){return"canopen"===m.tab}function w(){return"snmp"===m.tab}_.assign(m,{$onInit:function(){s.detail(b).then(n.getResData).then(function(e){h()?_.defaults(e.c8y_SerialConfiguration,{baudRate:19200,dataBits:8,parity:"E",stopBits:1}):O()&&(m.serialConfigurationOptions.baudRates=[1e5,125e3,25e4,5e5,1e6]),m.device=e}).then(S).then(N).then(P)},shouldShowSerialPanel:function(){return h()&&_.get(m,"device.c8y_SerialConfiguration")},isModbusTab:h,isCanBusTab:O,isOPCUATab:L,isProfibusTab:M,isCanOpenTab:U,isSNMPTab:w,getFieldValidationHints:_.curryRight(n.validationHints)(g),serialConfigurationOptions:{baudRates:[110,300,600,1200,2400,4800,9600,14400,19200,38400,57600,115200,25e4,460800,5e5,921600,1e6],dataBits:[8],parities:["N","E","O"],stopBits:[1,2]},fieldbusConfigurationOptions:{baudRates:[{value:1e3,label:"1 Mbit/s"},{value:800,label:"800 kbit/s"},{value:500,label:"500 kbit/s"},{value:250,label:"250 kbit/s"},{value:125,label:"125 kbit/s"},{value:50,label:"50 kbit/s"},{value:20,label:"20 kbit/s"},{value:10,label:"10 kbit/s"}]},deviceConfigurationOptions:A,fieldErrors:I,fieldErrorsToMessages:g,saveSerialConfig:function(){!function(e){return a.create({deviceId:e.id,description:p("Set serial configuration"),c8y_SerialConfiguration:e.c8y_SerialConfiguration})}(m.device).then(function(){return c.success(p("Settings will be applied."))})},saveFieldbusConfig:function(){!function(e){var t=r.resolve();h()&&e.c8y_ModbusConfiguration?t=function(e){return a.create({deviceId:e.id,description:p("Set modbus configuration"),c8y_ModbusConfiguration:_.omit(e.c8y_ModbusConfiguration,["maxFieldbusVersion"])})}(e):O()?t=function(e){return a.create({deviceId:e.id,description:p("Set CAN Bus configuration"),c8y_CanConfiguration:_.omit(e.c8y_CanConfiguration,["maxFieldbusVersion"])})}(e):L()?t=function(e){var t=e.c8y_OPCUAGateway.transmitRate,e=_.merge(_.cloneDeep(e),{c8y_OPCUAGateway:{transmitRate:0===t?void 0:t}});return s.update(_.pick(e,["id","c8y_OPCUAGateway"]))}(e):M()?t=function(e){return a.create({deviceId:e.id,description:p("Set Profibus configuration"),c8y_ProfibusConfiguration:_.pick(e.c8y_ProfibusConfiguration,["transmitRate","slaveAddress"])})}(e):U()?t=function(e){return a.create({deviceId:e.id,description:p("Set CAN Open configuration"),c8y_CANopenConfiguration:_.omit(e.c8y_CANopenConfiguration,["maxFieldbusVersion"])})}(e):w()&&(t=function(e){var t=e.c8y_SNMPGateway.transmitRate,e=_.merge(_.cloneDeep(e),{c8y_SNMPGateway:{transmitRate:0===t?void 0:t}});return s.update(_.pick(e,["id","c8y_SNMPGateway"])).then(C)}(e));return t}(m.device).then(function(){return c.success(p("Settings will be applied."))})},invalid:function(e,t){(h()||L())&&!function(e){var e=m[e],t=e.pollingRate;{var i,n,r;t&&(e=e.transmitRate,n=i=!0,r=t.$modelValue<=e.$modelValue,L()&&0===e.$modelValue&&(r=!0),(!_.isInteger(e.$modelValue)||e.$modelValue<=0)&&(i=!1),(!_.isInteger(t.$modelValue)||t.$modelValue<=0)&&(n=!1),e.$setValidity(I.ONLY_NATURAL_NUMBERS_ALLOWED,i),e.$setValidity(I.POLLING_RATE_LARGER_THAN_TRANSMIT_RATE,r),t.$setValidity(I.ONLY_NATURAL_NUMBERS_ALLOWED,n),t.$setValidity(I.POLLING_RATE_LARGER_THAN_TRANSMIT_RATE,r))}}(e);L()&&!function(e){var e=m[e].OPCUAUrl,t=f.validation.opcuaBrowsePath.pattern,i=e.$modelValue;e.$setValidity(I.INVALID_URL,!i||t.test(i))}(e);w()&&!function(e){var e=m[e].ipRange,t=e.$modelValue;t&&(t=t.split(",").map(function(e){return e.trim()}),t=_.every(t,E),e.$setValidity(I.IP_RANGE,t),t)&&!function(e){var t=e.$modelValue,i=!0,n=!0,r=BigInt(30);{var o;t&&(o=BigInt(0),t=t.split(","),_.forEach(t,function(e){e=E(e);e||(i=!1),o+=BigInt(e.countIps())}),r<o||o<-r)&&(n=!1)}e.$setValidity(I.IP_RANGE,i),e.$setValidity(I.IP_RANGE_MAXLIMIT,n)}(e)}(e);return n.invalid(m,e,t)},reloadDevices:N,onClickDelete:function(e){u({title:p("Delete device"),body:v.getString('You are about to delete device "{{name}}". Do you want to proceed?',e),size:"sm",labels:{ok:p("Delete")},status:"danger"}).then(function(){return s.remove(e)}).then(function(){return U()?y.onRemove(m.device,e):r.resolve()}).then(function(){m.devices=_.without(m.devices,e),s.update({id:m.device.id}),c.success(p("Device deleted."))}).catch(function(e){e&&c.danger(e)})},navigateToDetail:function(e){i.url("device/".concat(e.id))},triggerAutodiscovery:function(e){m.autoDiscoveryInProgress=!0;e=e.ipRange.$modelValue;e&&(e={deviceId:b,description:p("Autodiscovery request"),c8y_SnmpAutoDiscovery:{ipRange:e}},a.createWithNotifications(e).then(T))},autoDiscoveryInProgress:!1,canTriggerAutodiscovery:function(e){return m.autoDiscoveryInProgress||e.ipRange.$dirty||_.isEmpty(e.ipRange.$modelValue)}})}e.$inject=["$rootScope","$q","$routeParams","$location","$window","c8yDeviceControl","c8yBase","c8yDevices","c8yModal","c8yAlert","c8yDeviceDatabase","c8yRealtime","c8yCanopenDevice","c8yConfig","gettext","gettextCatalog"],angular.module("c8y.modbusConfiguration4").component("c8yFieldbusConfig",{templateUrl:":::PLUGIN_PATH:::/fieldbus-config.html",bindings:{tab:"@"},controllerAs:"vm",controller:e})}();
1
+ "use strict";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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var i;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function _iterableToArrayLimit(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,a,s=[],u=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;u=!1}else for(;!(u=(n=o.call(i)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);i=i.call(e,t||"default");if("object"!==_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(e,r,t,i,o,a,n,s,u,c,d,l,y,f,p,v){var g=this,m=t.deviceId,b={types:[]},A={IS_REQUIRED:"required",ADDRESS_IN_USE:"address-in-use",ADDRESSES_IN_USE:"addresses-in-use",ADDRESS_INVALID:"address-invalid",POLLING_RATE_LARGER_THAN_TRANSMIT_RATE:"polling-rate-larger-than-transmit-rate",ONLY_NATURAL_NUMBERS_ALLOWED:"only-natural-numbers-allowed",IPADDRESS_INVALID_FORMAT:"ip",INVALID_URL:"invalid-url",NODE_IN_USE:"node-in-use",NODE_OUT_OF_RANGE:"node-out-of-range",IP_RANGE:"ip-range",PORT_INVALID:"port-invalid",IP_RANGE_MAXLIMIT:"ip-range-maxlimit",ENGINEID_IN_USE:"engineid-in-use",IS_MIN:"min"},I=(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(I={},A.IS_REQUIRED,p("This field is required.")),A.ADDRESS_IN_USE,p("This address is already in use.")),A.ADDRESSES_IN_USE,p("These addresses are already in use.")),A.ADDRESS_INVALID,p("Addresses from 248 up to 254 are not allowed.")),A.POLLING_RATE_LARGER_THAN_TRANSMIT_RATE,p("Polling rate must be equal to or smaller than transmit rate.")),A.ONLY_NATURAL_NUMBERS_ALLOWED,p("Only natural numbers allowed.")),A.IPADDRESS_INVALID_FORMAT,p("The IP address format is invalid.")),A.INVALID_URL,p("The URL format is invalid. The only supported protocols are http, https and opc.tcp.")),A.NODE_IN_USE,p("This node id is already in use.")),A.IP_RANGE,p("Invalid IP address range.")),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(I,A.PORT_INVALID,p("Invalid port number.")),A.IP_RANGE_MAXLIMIT,p("Max. 30 IP addresses in total allowed.")),A.NODE_OUT_OF_RANGE,p("Only node ID(s) between 1 and 127 are allowed.")),A.ENGINEID_IN_USE,p("This engine ID is already in use.")),A.IS_MIN,p("Value cannot be lower than minimum.")));function S(){var i=g.device,e={},t=(_.assign(g,{hasSerialConfigOperation:s.supportsOperation(i,"c8y_SerialConfiguration"),hasFieldBusConfigOperation:(t=i,O()&&s.supportsOperation(t,"c8y_CanConfiguration")||h()&&s.supportsOperation(t,"c8y_ModbusConfiguration")||L()&&s.supportsOperation(t,"c8y_OPCUAConfiguration")||M()&&s.supportsOperation(t,"c8y_ProfibusConfiguration")||U()&&s.supportsOperation(t,"c8y_CANopenConfiguration")||w()&&s.supportsOperation(t,"c8y_SNMPConfiguration")),serialConfiguration:_.get(i,"c8y_SerialConfiguration",{}),fieldbusConfiguration:function(e){var t={};e&&(h()?t=e.c8y_ModbusConfiguration:O()?t=e.c8y_CanConfiguration:L()?(e.c8y_OPCUAGateway&&(e.c8y_OPCUAGateway.transmitRate=e.c8y_OPCUAGateway.transmitRate||0,_.unset(e,"c8y_OPCUAGateway.userIdentityPassword")),t=e.c8y_OPCUAGateway):M()?(_.defaultsDeep(e,{c8y_ProfibusConfiguration:{baudRate:p("automatic")}}),t=e.c8y_ProfibusConfiguration):U()?t=e.c8y_CANopenConfiguration:w()&&(e.c8y_SNMPGateway&&(e.c8y_SNMPGateway.transmitRate=e.c8y_SNMPGateway.transmitRate||0,_.unset(e,"c8y_SNMPGateway.userIdentityPassword")),t=e.c8y_SNMPGateway));return t}(i)}),(w()||h())&&(e={pageSize:2e3}),g.tab);return d.getAvailableDeviceTypes({fieldbusType:t},e).then(function(e){var t=d.getFieldbusVersionFromDevice(i);_.set(g.fieldbusConfiguration,"maxFieldbusVersion",t),b.types=_.filter(e,function(e){return e.fieldbusVersion<=t})})}function P(){e={pageSize:1,fragmentType:"c8y_SnmpAutoDiscovery",status:"EXECUTING"},e=n.timeOrderFilter(e||{}),_.assign(e,_.pick(t,"deviceId")),e.revert=!0;var e;return a.list(e).then(D).then(T)}function D(e){var i,t,n=_slicedToArray(e,1)[0];return!!n&&(g.autoDiscoveryInProgress=!0,i=r.defer(),e="operation".concat(n.id),t="/operations/".concat(n.deviceId),l.getStatus(e,t)&&l.destroySubscription(e,t),l.addListener(e,t,"UPDATE",function(e,t){t.id===n.id&&(t.status===a.status.SUCCESSFUL||t.status===a.status.FAILED?i.resolve(t):i.notify(t))}),l.start(e,t),r.when({completed:i.promise}))}function N(){return s.childDevices(m).then(function(e){e=w()?_.orderBy(e,["name"],["asc"]):e;g.devices=_.map(e,function(e){var t,i,n,r,o,a;return h()&&e.c8y_ModbusDevice?(a=R({device:o=e,fieldbusDeviceFragment:"c8y_ModbusDevice"}),a={id:o.id,name:o.name,deviceType:_.get(a,"name"),address:o.c8y_ModbusDevice.address,ipAddress:o.c8y_ModbusDevice.ipAddress,protocol:o.c8y_ModbusDevice.protocol}):O()&&e.c8y_CanDevice?(r=R({device:o=e,fieldbusDeviceFragment:"c8y_CanDevice"}),a={id:o.id,name:o.name,deviceType:_.get(r,"name")}):L()&&e.c8y_OPCUADevice?(n=R({device:r=e,fieldbusDeviceFragment:"c8y_OPCUADevice"}),a={id:r.id,name:r.name,deviceType:_.get(n,"name"),directoryPath:r.c8y_OPCUADevice.browsePath}):M()&&e.c8y_ProfibusDevice?(i=R({device:n=e,fieldbusDeviceFragment:"c8y_ProfibusDevice"}),a={id:n.id,name:n.name,deviceType:_.get(i,"name")}):U()&&e.c8y_CANopenDevice?(t=R({device:i=e,fieldbusDeviceFragment:"c8y_CANopenDevice"}),a={id:i.id,name:i.name,deviceType:_.get(t,"name"),nodeId:i.c8y_CANopenDevice.nodeId}):w()&&e.c8y_SNMPDevice&&(e=R({device:t=e,fieldbusDeviceFragment:"c8y_SNMPDevice"}),a={id:t.id,name:t.name,deviceType:_.get(e,"name"),ipAddress:t.c8y_SNMPDevice.ipAddress,port:t.c8y_SNMPDevice.port,version:t.c8y_SNMPDevice.version,auth:_.get(t.c8y_SNMPDevice,"auth",{})}),a})})}function R(e){var t=e.device,i=e.fieldbusDeviceFragment;return _(b.types).find(function(e){e=e.id;return _.get(t,"".concat(i,".type"))==="/inventory/managedObjects/".concat(e)})}function C(){var e=g.fieldbusCommunicationForm;e.$setPristine(),e.$setUntouched()}function E(e){var t,e=e.split("-").map(function(e){return e.trim()}),i=f.validation.ip.pattern,n=f.validation.ipV6.pattern;if(2===e.length){var e=_slicedToArray(e,2),r=e[0],e=e[1],i=i.test(r)&&i.test(e),n=n.test(r)&&n.test(e);if(i||n)try{t=new o.Ip.Range(r,e)}catch(e){}}return t}function T(e){e.completed.then(function(e){e.status===a.status.SUCCESSFUL?(c.success(p("Autodiscovery completed.")),g.autoDiscoveryInProgress=!1):e.status===a.status.FAILED&&(e.failureReason?c.danger(v.getString('Autodiscovery failed due to: "{{ failureReason | translate }}".',e)):c.danger(p("Autodiscovery failed.")),g.autoDiscoveryInProgress=!1)},_.noop,function(){c.success(p("Autodiscovery in progress."))}).then(N)}function h(){return"modbus"===g.tab}function O(){return"canbus"===g.tab}function L(){return"opcua"===g.tab}function M(){return"profibus"===g.tab}function U(){return"canopen"===g.tab}function w(){return"snmp"===g.tab}_.assign(g,{$onInit:function(){s.detail(m).then(n.getResData).then(function(e){h()?_.defaults(e.c8y_SerialConfiguration,{baudRate:19200,dataBits:8,parity:"E",stopBits:1}):O()&&(g.serialConfigurationOptions.baudRates=[1e5,125e3,25e4,5e5,1e6]),g.device=e}).then(S).then(N).then(P)},shouldShowSerialPanel:function(){return h()&&_.get(g,"device.c8y_SerialConfiguration")},isModbusTab:h,isCanBusTab:O,isOPCUATab:L,isProfibusTab:M,isCanOpenTab:U,isSNMPTab:w,getFieldValidationHints:_.curryRight(n.validationHints)(I),serialConfigurationOptions:{baudRates:[110,300,600,1200,2400,4800,9600,14400,19200,38400,57600,115200,25e4,460800,5e5,921600,1e6],dataBits:[8],parities:["N","E","O"],stopBits:[1,2]},fieldbusConfigurationOptions:{baudRates:[{value:1e3,label:"1 Mbit/s"},{value:800,label:"800 kbit/s"},{value:500,label:"500 kbit/s"},{value:250,label:"250 kbit/s"},{value:125,label:"125 kbit/s"},{value:50,label:"50 kbit/s"},{value:20,label:"20 kbit/s"},{value:10,label:"10 kbit/s"}]},deviceConfigurationOptions:b,fieldErrors:A,fieldErrorsToMessages:I,saveSerialConfig:function(){!function(e){return a.create({deviceId:e.id,description:p("Set serial configuration"),c8y_SerialConfiguration:e.c8y_SerialConfiguration})}(g.device).then(function(){return c.success(p("Settings will be applied."))})},saveFieldbusConfig:function(){!function(e){var t=r.resolve();h()&&e.c8y_ModbusConfiguration?t=function(e){return a.create({deviceId:e.id,description:p("Set modbus configuration"),c8y_ModbusConfiguration:_.omit(e.c8y_ModbusConfiguration,["maxFieldbusVersion"])})}(e):O()?t=function(e){return a.create({deviceId:e.id,description:p("Set CAN Bus configuration"),c8y_CanConfiguration:_.omit(e.c8y_CanConfiguration,["maxFieldbusVersion"])})}(e):L()?t=function(e){var t=e.c8y_OPCUAGateway.transmitRate,e=_.merge(_.cloneDeep(e),{c8y_OPCUAGateway:{transmitRate:0===t?void 0:t}});return s.update(_.pick(e,["id","c8y_OPCUAGateway"]))}(e):M()?t=function(e){return a.create({deviceId:e.id,description:p("Set Profibus configuration"),c8y_ProfibusConfiguration:_.pick(e.c8y_ProfibusConfiguration,["transmitRate","slaveAddress"])})}(e):U()?t=function(e){return a.create({deviceId:e.id,description:p("Set CAN Open configuration"),c8y_CANopenConfiguration:_.omit(e.c8y_CANopenConfiguration,["maxFieldbusVersion"])})}(e):w()&&(t=function(e){var t=e.c8y_SNMPGateway.transmitRate,e=_.merge(_.cloneDeep(e),{c8y_SNMPGateway:{transmitRate:0===t?void 0:t}});return s.update(_.pick(e,["id","c8y_SNMPGateway"])).then(C)}(e));return t}(g.device).then(function(){return c.success(p("Settings will be applied."))})},invalid:function(e,t){(h()||L())&&!function(e){var e=g[e],t=e.pollingRate;{var i,n,r;t&&(e=e.transmitRate,n=i=!0,r=t.$modelValue<=e.$modelValue,L()&&0===e.$modelValue&&(r=!0),(!_.isInteger(e.$modelValue)||e.$modelValue<=0)&&(i=!1),(!_.isInteger(t.$modelValue)||t.$modelValue<=0)&&(n=!1),e.$setValidity(A.ONLY_NATURAL_NUMBERS_ALLOWED,i),e.$setValidity(A.POLLING_RATE_LARGER_THAN_TRANSMIT_RATE,r),t.$setValidity(A.ONLY_NATURAL_NUMBERS_ALLOWED,n),t.$setValidity(A.POLLING_RATE_LARGER_THAN_TRANSMIT_RATE,r))}}(e);L()&&!function(e){var e=g[e].OPCUAUrl,t=f.validation.opcuaBrowsePath.pattern,i=e.$modelValue;e.$setValidity(A.INVALID_URL,!i||t.test(i))}(e);w()&&!function(e){var e=g[e].ipRange,t=e.$modelValue;t&&(t=t.split(",").map(function(e){return e.trim()}),t=_.every(t,E),e.$setValidity(A.IP_RANGE,t),t)&&!function(e){var t=e.$modelValue,i=!0,n=!0,r=BigInt(30);{var o;t&&(o=BigInt(0),t=t.split(","),_.forEach(t,function(e){e=E(e);e||(i=!1),o+=BigInt(e.countIps())}),r<o||o<-r)&&(n=!1)}e.$setValidity(A.IP_RANGE,i),e.$setValidity(A.IP_RANGE_MAXLIMIT,n)}(e)}(e);return n.invalid(g,e,t)},reloadDevices:N,onClickDelete:function(e){u({title:p("Delete device"),body:v.getString('You are about to delete device "{{name}}". Do you want to proceed?',e),size:"sm",labels:{ok:p("Delete")},status:"danger"}).then(function(){return s.remove(e)}).then(function(){return U()?y.onRemove(g.device,e):r.resolve()}).then(function(){g.devices=_.without(g.devices,e),s.update({id:g.device.id}),c.success(p("Device deleted."))}).catch(function(e){e&&c.danger(e)})},navigateToDetail:function(e){i.url("device/".concat(e.id))},triggerAutodiscovery:function(e){g.autoDiscoveryInProgress=!0;e=e.ipRange.$modelValue;e&&(e={deviceId:m,description:p("Autodiscovery request"),c8y_SnmpAutoDiscovery:{ipRange:e}},a.createWithNotifications(e).then(T))},autoDiscoveryInProgress:!1,canTriggerAutodiscovery:function(e){return g.autoDiscoveryInProgress||e.ipRange.$dirty||_.isEmpty(e.ipRange.$modelValue)}})}e.$inject=["$rootScope","$q","$routeParams","$location","$window","c8yDeviceControl","c8yBase","c8yDevices","c8yModal","c8yAlert","c8yDeviceDatabase","c8yRealtime","c8yCanopenDevice","c8yConfig","gettext","gettextCatalog"],angular.module("c8y.modbusConfiguration4").component("c8yFieldbusConfig",{templateUrl:":::PLUGIN_PATH:::/fieldbus-config.html",bindings:{tab:"@"},controllerAs:"vm",controller:e})}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1018.499.5",
3
+ "version": "1018.500.18",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -47,7 +47,7 @@
47
47
  "ui-select": "0.19.8",
48
48
  "xterm": "5.2.1",
49
49
  "xterm-addon-fit": "0.7.0",
50
- "zip-js": "0.0.2",
50
+ "zip-js": "0.0.3",
51
51
  "dompurify": "2.2.9"
52
52
  },
53
53
  "devDependencies": {
@@ -1 +1 @@
1
- "use strict";function _typeof(r){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function _defineProperty(r,e,t){return(e=_toPropertyKey(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _toPropertyKey(r){r=_toPrimitive(r,"string");return"symbol"===_typeof(r)?r:String(r)}function _toPrimitive(r,e){if("object"!==_typeof(r)||null===r)return r;var t=r[Symbol.toPrimitive];if(void 0===t)return("string"===e?String:Number)(r);t=t.call(r,e||"default");if("object"!==_typeof(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,e){var t;if(r)return"string"==typeof r?_arrayLikeToArray(r,e):"Map"===(t="Object"===(t=Object.prototype.toString.call(r).slice(8,-1))&&r.constructor?r.constructor.name:t)||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,e):void 0}function _arrayLikeToArray(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function _iterableToArrayLimit(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=i.call(t)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(r){c=!0,o=r}finally{try{if(!u&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}function _arrayWithHoles(r){if(Array.isArray(r))return r}angular.module("c8y.smartRules").directive("smartRuleParamInputKpi",function(){return{require:"^smartRuleParamInput",scope:{rule:"=",param:"="},restrict:"E",templateUrl:":::PLUGIN_PATH:::/views/paramInputKpi.html",link:function(r,e,t,n){r.placeholder=n.placeholder},controller:["$scope","c8yKpi","c8yDataPointSvc",function(a,r,e){function t(){var r=a.param.property;r&&(a.kpiId=a.rule.config[r])}function n(r){var e,t=a.rule,n=a.param,t=t.config,o=_.find(a.kpis,{id:r}),i=n.mapSelectedKpiToProperties,i=(o&&i&&(o=o.c8y_Kpi,_.assign(t,(_defineProperty(e={},i.fragment,o.fragment),_defineProperty(e,i.series,o.series),_defineProperty(e,i.redRangeMin,_.get(o,"redRangeMin",90)),_defineProperty(e,i.redRangeMax,_.get(o,"redRangeMax",100)),e))),n.property);i&&(t[i]=r)}_.assign(a,{getKpiLabel:function(r){r=r.c8y_Kpi;return"".concat(r.label," - ").concat(r.series)},openKpiSelector:function(){e.chooseKpiWithUI().then(function(r){r=_slicedToArray(r,1)[0];a.kpiId=r._kpiId,n(a.kpiId)})},onKpiSelectionChange:n}),r.list().then(function(r){a.kpis=r}).then(t)}]}});
1
+ "use strict";function _typeof(r){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function _defineProperty(r,e,t){return(e=_toPropertyKey(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _toPropertyKey(r){r=_toPrimitive(r,"string");return"symbol"===_typeof(r)?r:String(r)}function _toPrimitive(r,e){if("object"!==_typeof(r)||null===r)return r;var t=r[Symbol.toPrimitive];if(void 0===t)return("string"===e?String:Number)(r);t=t.call(r,e||"default");if("object"!==_typeof(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,e){var t;if(r)return"string"==typeof r?_arrayLikeToArray(r,e):"Map"===(t="Object"===(t=Object.prototype.toString.call(r).slice(8,-1))&&r.constructor?r.constructor.name:t)||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,e):void 0}function _arrayLikeToArray(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function _iterableToArrayLimit(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=i.call(t)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(r){c=!0,o=r}finally{try{if(!u&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}function _arrayWithHoles(r){if(Array.isArray(r))return r}angular.module("c8y.smartRules").directive("smartRuleParamInputKpi",function(){return{require:"^smartRuleParamInput",scope:{rule:"=",param:"="},restrict:"E",templateUrl:":::PLUGIN_PATH:::/views/paramInputKpi.html",link:function(r,e,t,n){r.placeholder=n.placeholder},controller:["$scope","c8yKpi","c8yDataPointSvc",function(i,r,e){function t(){var r=i.param.property;r&&(i.kpiId=i.rule.config[r])}function n(r){var e=i.rule,t=i.param,e=e.config,n=_.find(i.kpis,{id:r}),o=t.mapSelectedKpiToProperties,o=(n&&o&&(n=n.c8y_Kpi,_.assign(e,_defineProperty(_defineProperty(_defineProperty(_defineProperty({},o.fragment,n.fragment),o.series,n.series),o.redRangeMin,_.get(n,"redRangeMin",90)),o.redRangeMax,_.get(n,"redRangeMax",100)))),t.property);o&&(e[o]=r)}_.assign(i,{getKpiLabel:function(r){r=r.c8y_Kpi;return"".concat(r.label," - ").concat(r.series)},openKpiSelector:function(){e.chooseKpiWithUI().then(function(r){r=_slicedToArray(r,1)[0];i.kpiId=r._kpiId,n(i.kpiId)})},onKpiSelectionChange:n}),r.list().then(function(r){i.kpis=r}).then(t)}]}});
@@ -1 +1 @@
1
- "use strict";!function(){function e(e,n,t){e.addNavigation({parent:t("Settings"),name:t("License management"),path:"tenantLicenses",icon:"c8y-book",priority:1e3,showIf:["c8yUserUtil",function(e){return e.canUserManageTenant({mustBeTopTenant:!0})}]}),n.when("/tenantLicenses",{template:"<c8y-license-management />"})}e.$inject=["c8yNavigatorProvider","c8yViewsProvider","gettext"],angular.module("c8y.tenantLicenses",[]).config(e)}();
1
+ "use strict";!function(){function i(t,i){return t.current().then(function(n){var e=t.isTopTenant(n.name);return i.hasAllRoles(["ROLE_TENANT_MANAGEMENT_READ","ROLE_OPTION_MANAGEMENT_READ"]).then(function(n){return n&&e})})}function n(n,e,t){n.addNavigation({parent:t("Settings"),name:t("License management"),path:"tenantLicenses",icon:"c8y-book",priority:1e3,showIf:i}),e.when("/tenantLicenses",{template:"<c8y-license-management />",showIf:i})}i.$inject=["c8yTenant","c8yPermissions"],n.$inject=["c8yNavigatorProvider","c8yViewsProvider","gettext"],angular.module("c8y.tenantLicenses",[]).config(n)}();