@c8y/ng1-modules 1019.24.2 → 1020.0.4

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 (150) hide show
  1. package/NOTICES +8357 -6666
  2. package/app-logs/app-logs.service.js +1 -1
  3. package/asset-notes/assetNotes.component.js +1 -1
  4. package/assetPropertyWidget/main.controller.js +1 -1
  5. package/cell-id-information-activator/cell-id-information-activator.config.js +1 -1
  6. package/cell-id-information-activator/cell-id-information-activator.service.js +1 -1
  7. package/cell-id-usage-statistics/cell-id-usage-statistics.component.js +1 -1
  8. package/cell-id-usage-statistics/cell-id-usage-statistics.service.js +1 -1
  9. package/commandTemplates/controllers/commandTemplates.js +1 -1
  10. package/commandTemplates/views/commandTemplates.html +83 -41
  11. package/core/core/services/alarms.js +1 -1
  12. package/core/core/services/application.js +1 -1
  13. package/core/core/services/auth.js +1 -1
  14. package/core/core/services/base.js +1 -1
  15. package/core/core/services/deviceShell.js +1 -1
  16. package/core/core/services/devices.js +1 -1
  17. package/core/core/services/dynamicGroups.js +1 -1
  18. package/core/core/services/geo.js +1 -1
  19. package/core/core/services/groups.js +1 -1
  20. package/core/core/services/inventory.js +1 -1
  21. package/core/core/services/kpi.js +1 -1
  22. package/core/core/services/measurements.js +1 -1
  23. package/core/core/services/settings.js +1 -1
  24. package/core/core/services/tenant.js +1 -1
  25. package/core/core/services/user.js +1 -1
  26. package/core/core/services/util.js +1 -1
  27. package/core/locales/de.po +553 -306
  28. package/core/locales/en.po +69 -0
  29. package/core/locales/es.po +562 -314
  30. package/core/locales/fr.po +560 -313
  31. package/core/locales/ja_JP.po +587 -299
  32. package/core/locales/ko.po +334 -327
  33. package/core/locales/nl.po +636 -389
  34. package/core/locales/pl.po +558 -310
  35. package/core/locales/pt_BR.po +575 -328
  36. package/core/locales/ru.po +21 -320
  37. package/core/locales/zh_CN.po +330 -323
  38. package/core/locales/zh_TW.po +330 -323
  39. package/core/ui/components/passwordStrengthChecklist.html +1 -1
  40. package/core/ui/configurable-device-list-columns/configurable-columns.service.js +1 -1
  41. package/core/ui/configurable-device-list-columns/modal-columns-configure.component.js +1 -1
  42. package/core/ui/controllers/deviceList.js +1 -1
  43. package/core/ui/controllers/eventList.js +1 -1
  44. package/core/ui/csvExporter/csvExporter.controller.js +1 -1
  45. package/core/ui/directives/alarmList.js +1 -1
  46. package/core/ui/directives/map.js +1 -1
  47. package/core/ui/directives/map2.js +1 -1
  48. package/core/ui/operations/operations-timeline.html +24 -10
  49. package/core/ui/properties/lastDeviceMessage.computedProperty.js +1 -1
  50. package/core/ui/schemaForm/schemaForm.component.js +1 -1
  51. package/core/ui/services/deviceListColumns.js +1 -1
  52. package/core/ui/services/measurementsReport.js +1 -1
  53. package/core/ui/user/editUser.directive.html +2 -0
  54. package/core/ui/views/eventList.html +3 -1
  55. package/dataBroker/connectors/connectors.html +1 -0
  56. package/dataBroker/connectorsAlarms/connectorAlarms.component.js +1 -1
  57. package/device-protocol-actility/actility-device.provider.js +1 -1
  58. package/device-protocol-canbus/canbus-device.provider.js +1 -1
  59. package/device-protocol-canopen/canopen-device.provider.js +1 -1
  60. package/device-protocol-deviceDatabase4/device-type-protocol-base.provider.js +1 -1
  61. package/device-protocol-lora/lora-device.provider.js +1 -1
  62. package/device-protocol-lpwan/lpwan-device.provider.js +1 -1
  63. package/device-protocol-modbus/modbus-device.provider.js +1 -1
  64. package/device-protocol-opcua/opcua-device.provider.js +1 -1
  65. package/device-protocol-profibus/profibus-device.provider.js +1 -1
  66. package/device-protocol-sigfox/sigfox-device.provider.js +1 -1
  67. package/device-protocol-snmp/snmp-device.provider.js +1 -1
  68. package/device-protocols/device-protocol-import-button.component.js +1 -1
  69. package/deviceDatabase4/detail/device-type-detail.component.js +1 -1
  70. package/deviceDatabase4/device-database.service.js +1 -1
  71. package/deviceDatabase4/device-type-list.component.js +1 -1
  72. package/deviceDatabase4/modals/configure-discrete-io.component.js +1 -1
  73. package/deviceDatabase4/modals/configure-register.component.js +1 -1
  74. package/deviceDatabase4/modals/import-device-type.component.js +1 -1
  75. package/deviceDatabase4/unique.directive.js +1 -1
  76. package/deviceDetail/cumulocity.json +0 -1
  77. package/deviceSelector/controllers/deviceSelectorComboCtrl.js +1 -1
  78. package/deviceStatusWidget/deviceStatus.component.js +1 -1
  79. package/deviceStatusWidget/ownerStatus.component.js +1 -1
  80. package/devicemanagement-availability/controllers/availability.js +1 -1
  81. package/devicemanagement-availability/views/detail.html +2 -2
  82. package/devicemanagement-eventList/controllers/eventList.js +1 -1
  83. package/enterpriseEdition/customBranding/brandingConfigurationUi.provider.js +1 -1
  84. package/enterpriseEdition/sslCertificate/manageCertificateForm.html +1 -1
  85. package/eventList/eventList.controller.js +1 -1
  86. package/generic-ui/generic-ui-inventory-property.component.js +1 -1
  87. package/groupsHierarchy/controllers/groupsListCtrl.js +1 -1
  88. package/kpi/controllers/pieChart.js +1 -1
  89. package/measurements/fragmentChart/fragmentChart.component.js +1 -1
  90. package/modbusConfiguration4/fieldbus-config.component.js +1 -1
  91. package/modbusConfiguration4/fieldbus-device-list.component.js +1 -1
  92. package/modbusWidget4/modbus-widget.service.js +1 -1
  93. package/modbusWidget4/widget-config.component.js +1 -1
  94. package/modbusWidget4/widget.component.js +1 -1
  95. package/package.json +5 -5
  96. package/remoteAccess/remoteAccess.service.js +1 -1
  97. package/remoteAccess/remoteAccessSettings/remoteAccessSettings.component.js +1 -1
  98. package/roles/detail/roleDetailInventory.html +33 -14
  99. package/scada/mapping.directive.js +1 -1
  100. package/simulators/simulatorsUi.provider.js +1 -1
  101. package/smartRestEditor/views/list.html +1 -0
  102. package/smartRules/directives/smartRuleParamInputKpi.js +1 -1
  103. package/smartRules/list/smartRulesList.html +25 -0
  104. package/smartRules/views/edit.html +95 -27
  105. package/smartRules/views/list.html +39 -5
  106. package/tenantStatistics/tenant-statistics.component.js +1 -1
  107. package/userRoles/inventoryRolesTab/inventoryRolesTab.component.js +1 -1
  108. package/users/userListView/userListView.component.js +1 -1
  109. package/users/userListView/userListView.html +1 -0
  110. package/users/userRemovalModal/userRemovalModal.component.html +1 -0
  111. package/alarmAssets/cumulocity.json +0 -14
  112. package/alarmAssets/img/all-critical-alarms-widget-pr.png +0 -0
  113. package/alarmAssets/index.js +0 -1
  114. package/alarmAssets/views/component.html +0 -8
  115. package/alarms/cumulocity.json +0 -21
  116. package/alarms/img/alarm-list-widget-pr.png +0 -0
  117. package/alarms/index.js +0 -1
  118. package/alarms/index.mock.js +0 -1
  119. package/alarms/severity.directive.js +0 -1
  120. package/alarms/severity.html +0 -13
  121. package/alarms/styles.css +0 -3
  122. package/alarms/widget-config.controller.js +0 -1
  123. package/alarms/widget-config.html +0 -116
  124. package/alarms/widget.config.js +0 -1
  125. package/alarms/widget.controller.js +0 -1
  126. package/alarms/widget.html +0 -15
  127. package/alarms/widget.module.js +0 -1
  128. package/alarms/widget.module.mock.js +0 -1
  129. package/cockpit-alarmRecent/cumulocity.json +0 -18
  130. package/cockpit-alarmRecent/img/recent-alarms-widget-pr.png +0 -0
  131. package/cockpit-alarmRecent/index.js +0 -1
  132. package/cockpit-alarmRecent/views/component.html +0 -7
  133. package/devicemanagement-aclManagement/controllers/aclManagementCtrl.js +0 -1
  134. package/devicemanagement-aclManagement/cumulocity.json +0 -21
  135. package/devicemanagement-aclManagement/index.js +0 -1
  136. package/devicemanagement-aclManagement/views/index.html +0 -207
  137. package/devicemanagement-alarmList/controllers/alarmList.js +0 -1
  138. package/devicemanagement-alarmList/cumulocity.json +0 -24
  139. package/devicemanagement-alarmList/gallery/alarms.png +0 -0
  140. package/devicemanagement-alarmList/index.js +0 -1
  141. package/devicemanagement-alarmList/views/index.html +0 -155
  142. package/devicemanagement-tracking/controllers/config.js +0 -1
  143. package/devicemanagement-tracking/controllers/tracking.js +0 -1
  144. package/devicemanagement-tracking/cumulocity.json +0 -19
  145. package/devicemanagement-tracking/index.js +0 -1
  146. package/devicemanagement-tracking/views/index.html +0 -103
  147. package/devicemanagement-vendMeDeviceControl/controllers/vendMeDeviceControl.js +0 -1
  148. package/devicemanagement-vendMeDeviceControl/cumulocity.json +0 -18
  149. package/devicemanagement-vendMeDeviceControl/index.js +0 -1
  150. package/devicemanagement-vendMeDeviceControl/views/index.html +0 -229
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var o,r=Object.keys(e);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(e),t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)),r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach(function(t){_defineProperty(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function _defineProperty(t,e,o){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:String(t)}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0===o)return("string"===e?String:Number)(t);o=o.call(t,e||"default");if("object"!=_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(u,n,a,o,r,i){var c="application/applications",s="application/vnd.com.nsn.cumulocity.applicationLogs+json;charset=UTF-8;ver=0.9";return{downloadAndSaveAs:function(t,o,r,n){return e(t,o,r,n).then(function(t){var e,t=t.logs;_.isEmpty(t)?i.info(p(r,n)):(t=t,e="".concat(e=o,".log"),t=new Blob([t],{type:"text/plain"}),window.saveAs(t,e))})},shouldShowLogsTab:function(t){var t="c8y_Application_".concat(t),e=new Date;return o.list({type:t,nocache:e.getTime()}).then(function(t){var e;return _.isEqual(_.get(t,"length"),1)&&(t=_.head(t),e=_.get(t,"c8y_SupportedLogs"),t=_.get(t,"c8y_Status.instances"),e=_.some(e,function(t){return"syslog"===t})&&!_.isEmpty(t)),e})},getAllLogs:e,getLogs:l,formatDateChosenByUser:function(t){t=moment(t).format("YYYY-MM-DDTHH:mm:ss.SSS");return moment("".concat(t,"Z")).toISOString()},getWarningMessageForMissingLogs:p};function e(o,r,n,a){function i(t){var e=m(t.dateTo);return c.push(t.logs),moment(e).isValid()&&t.truncated&&t.dateFrom!==t.dateTo?l(o,r,{dateFrom:e,dateTo:a}).then(i):u.resolve(c)}var c=[];return l(o,r,{dateFrom:n,dateTo:a}).then(i).then(function(t){var e=n,o=a,r=t;return r=t.join(""),{dateFrom:e,dateTo:o,logs:r}})}function l(t,e){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length?arguments[3]:void 0,t=a.url("".concat(c,"/").concat(t,"/logs/").concat(e)),e=_objectSpread({headers:{Accept:s},params:o},r);return o.dateFrom&&(o.dateFrom=m(o.dateFrom)),o.dateTo&&(o.dateTo=m(o.dateTo)),n.get(t,e).then(a.getResData)}function m(t){return moment(t).format(a.dateFullFormatWithMs)}function p(t,e){var o;return!t&&e&&(o=r.getString("No logs available before {{dateTo | absoluteDateTimeFormat:'LL, LTS':'+0000'}}.",{dateTo:e})),t&&e&&(o=r.getString("No logs available in time range {{dateFrom | absoluteDateTimeFormat:'LL, LTS':'+0000'}} - {{dateTo | absoluteDateTimeFormat:'LL, LTS':'+0000'}}.",{dateFrom:t,dateTo:e})),t&&!e&&(o=r.getString("No logs available after {{dateFrom | absoluteDateTimeFormat:'LL, LTS':'+0000'}}.",{dateFrom:t})),o=t||e?o:r.getString("No logs available.")}}t.$inject=["$q","$http","c8yBase","c8yInventory","gettextCatalog","c8yAlert"],angular.module("c8y.appLogs").factory("c8yApplicationLogs",t)}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var o,r=Object.keys(e);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(e),t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)),r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach(function(t){_defineProperty(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function _defineProperty(t,e,o){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0===o)return("string"===e?String:Number)(t);o=o.call(t,e||"default");if("object"!=_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(u,n,a,o,r,i){var c="application/applications",s="application/vnd.com.nsn.cumulocity.applicationLogs+json;charset=UTF-8;ver=0.9";return{downloadAndSaveAs:function(t,o,r,n){return e(t,o,r,n).then(function(t){var e,t=t.logs;_.isEmpty(t)?i.info(p(r,n)):(t=t,e="".concat(e=o,".log"),t=new Blob([t],{type:"text/plain"}),window.saveAs(t,e))})},shouldShowLogsTab:function(t){var t="c8y_Application_".concat(t),e=new Date;return o.list({type:t,nocache:e.getTime()}).then(function(t){var e;return _.isEqual(_.get(t,"length"),1)&&(t=_.head(t),e=_.get(t,"c8y_SupportedLogs"),t=_.get(t,"c8y_Status.instances"),e=_.some(e,function(t){return"syslog"===t})&&!_.isEmpty(t)),e})},getAllLogs:e,getLogs:l,formatDateChosenByUser:function(t){t=moment(t).format("YYYY-MM-DDTHH:mm:ss.SSS");return moment("".concat(t,"Z")).toISOString()},getWarningMessageForMissingLogs:p};function e(o,r,n,a){function i(t){var e=m(t.dateTo);return c.push(t.logs),moment(e).isValid()&&t.truncated&&t.dateFrom!==t.dateTo?l(o,r,{dateFrom:e,dateTo:a}).then(i):u.resolve(c)}var c=[];return l(o,r,{dateFrom:n,dateTo:a}).then(i).then(function(t){var e=n,o=a,r=t;return r=t.join(""),{dateFrom:e,dateTo:o,logs:r}})}function l(t,e){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length?arguments[3]:void 0,t=a.url("".concat(c,"/").concat(t,"/logs/").concat(e)),e=_objectSpread({headers:{Accept:s},params:o},r);return o.dateFrom&&(o.dateFrom=m(o.dateFrom)),o.dateTo&&(o.dateTo=m(o.dateTo)),n.get(t,e).then(a.getResData)}function m(t){return moment(t).format(a.dateFullFormatWithMs)}function p(t,e){var o;return!t&&e&&(o=r.getString("No logs available before {{dateTo | absoluteDateTimeFormat:'LL, LTS':'+0000'}}.",{dateTo:e})),t&&e&&(o=r.getString("No logs available in time range {{dateFrom | absoluteDateTimeFormat:'LL, LTS':'+0000'}} - {{dateTo | absoluteDateTimeFormat:'LL, LTS':'+0000'}}.",{dateFrom:t,dateTo:e})),t&&!e&&(o=r.getString("No logs available after {{dateFrom | absoluteDateTimeFormat:'LL, LTS':'+0000'}}.",{dateFrom:t})),o=t||e?o:r.getString("No logs available.")}}t.$inject=["$q","$http","c8yBase","c8yInventory","gettextCatalog","c8yAlert"],angular.module("c8y.appLogs").factory("c8yApplicationLogs",t)}();
@@ -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 ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(e,t,n,o){var r=this;function i(e){return _objectSpread(_objectSpread({},e),{},{htmlContent:o(e.htmlContent)})}_.assign(r,{$onInit:function(){return t.get(r.config.device).then(function(e){r.notes=i(e)})},edit:function(){r.editable=!0,r.editedNotes=_.cloneDeep(r.notes)},save:function(){t.save(r.config.device,r.editedNotes).then(function(e){r.editable=!1,r.notes=i(e)}).then(function(){return e.success(n("Notes saved."))})},cancel:function(){r.editable=!1,r.editedNotes=void 0}})}e.$inject=["c8yAlert","assetNotesSvc","gettext","$sanitize"],angular.module("c8y.assetNotes").component("c8yAssetNotes",{bindings:{config:"<"},templateUrl:":::PLUGIN_PATH:::/assetNotes.html",controller:e,controllerAs:"vm"})}();
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 ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(e,t,n,o){var r=this;function i(e){return _objectSpread(_objectSpread({},e),{},{htmlContent:o(e.htmlContent)})}_.assign(r,{$onInit:function(){return t.get(r.config.device).then(function(e){r.notes=i(e)})},edit:function(){r.editable=!0,r.editedNotes=_.cloneDeep(r.notes)},save:function(){t.save(r.config.device,r.editedNotes).then(function(e){r.editable=!1,r.notes=i(e)}).then(function(){return e.success(n("Notes saved."))})},cancel:function(){r.editable=!1,r.editedNotes=void 0}})}e.$inject=["c8yAlert","assetNotesSvc","gettext","$sanitize"],angular.module("c8y.assetNotes").component("c8yAssetNotes",{bindings:{config:"<"},templateUrl:":::PLUGIN_PATH:::/assetNotes.html",controller:e,controllerAs:"vm"})}();
@@ -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 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:String(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 _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 r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r=Object.prototype.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 _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,c,a=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(l)throw o}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}!function(){function e(r,e,t,n,o,i,c,a,u,l){var f=_.memoize(function(){return e.all({configProperties:function(){var e=P("properties",[]);return _.filter(e,"__active").map(function(e){return angular.copy(e)})}(),discoveredProperties:function(){if(P("allowDisplayAndEditKnownProperties",!1))return o.list().then(function(e){return _.filter(e,d)}).then(function(e){return _.filter(e,b)});return[]}()}).then(function(e){var t=e.configProperties,e=e.discoveredProperties;return _(t).concat(e).uniqBy(function(e){return"".concat(_.get(e,"id"),"_").concat(_.get(e,"config._id"))}).reject(j).value()})});function s(){var e;f.cache.clear(),r.$emit("stopRealtime"),e=r.child.config.device.id,n.detailRealtime(e,r,void 0,{withChildren:!0}).then(function(e){r.managedObject=e}).then(y).then(p).then(h)}function y(){return f().then(function(e){i.attach(r.managedObject,e)})}function p(){return f().then(function(e){return o.getSchema(e)}).then(function(e){r.schema=e})}function d(e){return 1===e.keyPath.length}function b(e){return _.has(r.managedObject,e.keyPath[0])}function h(){m(!0)}function m(t){return e.all({properties:f(),options:function(e){var t={};e&&(t.readonly=e,t.feedback=!1,t.disableSuccessState=!0,t.disableErrorState=!0);return t}(t)}).then(function(e){var t=e.properties,e=e.options;return o.getForm(t,e)}).then(function(e){r.form=e,r.editable=!t})}function g(e){_.forEach(e,function(e){e=_slicedToArray(e.keyPath,1)[0];_.isUndefined(r.managedObject[e])&&(r.managedObject[e]=null)}),f.cache.clear(),p().then(function(){return m(!1)})}function v(){t.getContext().id===r.child.config.device.id&&a.changeTitle({title:_.get(r,"managedObject.name")||""},{skipTitleTranslation:!0})}function P(e,t){return _.get(r.child.config.options,e,t)}function j(e){var t=P("hiddenPropertiesKeyPaths",[]);return!!_.includes(t,e.keyPath[0])}r.$watch("child.config.options",s),_.assign(r,{startEdit:function(){r.managedObject=_.cloneDeep(r.managedObject),y(),m(!1)},canAddProperties:function(){return P("allowDisplayAndEditKnownProperties",!1)},addProperties:function(){var e={includeTree:!1,includeTreeChildren:!1,showComputed:!1,showRootPropertiesOnly:!0,managedObject:r.managedObject,hideExistingInMO:!0};return l.openSelector(e).then(g)},save:function(){return f().then(function(e){return _.reject(e,{computed:!0})}).then(function(e){return _objectSpread({id:r.managedObject.id},_.pick(r.managedObject,_.map(e,"keyPath[0]")))}).then(n.save).then(v).then(function(){return c.success(u("Changes saved."))}).then(s)},cancelEdit:function(){s()}})}e.$inject=["$scope","$q","c8yUiUtil","c8yInventory","c8yPropertiesLibrary","c8yComputedProperties","c8yAlert","c8yTitle","gettext","SchemaPropertiesSvc"],angular.module("c8y.parts.assetPropertyWidget").controller("assetPropertyWidgetCtrl",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 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 _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 r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r=Object.prototype.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 _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,c,a=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(l)throw o}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}!function(){function e(r,e,t,n,o,i,c,a,u,l){var f=_.memoize(function(){return e.all({configProperties:function(){var e=P("properties",[]);return _.filter(e,"__active").map(function(e){return angular.copy(e)})}(),discoveredProperties:function(){if(P("allowDisplayAndEditKnownProperties",!1))return o.list().then(function(e){return _.filter(e,d)}).then(function(e){return _.filter(e,b)});return[]}()}).then(function(e){var t=e.configProperties,e=e.discoveredProperties;return _(t).concat(e).uniqBy(function(e){return"".concat(_.get(e,"id"),"_").concat(_.get(e,"config._id"))}).reject(j).value()})});function s(){var e;f.cache.clear(),r.$emit("stopRealtime"),e=r.child.config.device.id,n.detailRealtime(e,r,void 0,{withChildren:!0}).then(function(e){r.managedObject=e}).then(y).then(p).then(h)}function y(){return f().then(function(e){i.attach(r.managedObject,e)})}function p(){return f().then(function(e){return o.getSchema(e)}).then(function(e){r.schema=e})}function d(e){return 1===e.keyPath.length}function b(e){return _.has(r.managedObject,e.keyPath[0])}function h(){m(!0)}function m(t){return e.all({properties:f(),options:function(e){var t={};e&&(t.readonly=e,t.feedback=!1,t.disableSuccessState=!0,t.disableErrorState=!0);return t}(t)}).then(function(e){var t=e.properties,e=e.options;return o.getForm(t,e)}).then(function(e){r.form=e,r.editable=!t})}function g(e){_.forEach(e,function(e){e=_slicedToArray(e.keyPath,1)[0];_.isUndefined(r.managedObject[e])&&(r.managedObject[e]=null)}),f.cache.clear(),p().then(function(){return m(!1)})}function v(){t.getContext().id===r.child.config.device.id&&a.changeTitle({title:_.get(r,"managedObject.name")||""},{skipTitleTranslation:!0})}function P(e,t){return _.get(r.child.config.options,e,t)}function j(e){var t=P("hiddenPropertiesKeyPaths",[]);return!!_.includes(t,e.keyPath[0])}r.$watch("child.config.options",s),_.assign(r,{startEdit:function(){r.managedObject=_.cloneDeep(r.managedObject),y(),m(!1)},canAddProperties:function(){return P("allowDisplayAndEditKnownProperties",!1)},addProperties:function(){var e={includeTree:!1,includeTreeChildren:!1,showComputed:!1,showRootPropertiesOnly:!0,managedObject:r.managedObject,hideExistingInMO:!0};return l.openSelector(e).then(g)},save:function(){return f().then(function(e){return _.reject(e,{computed:!0})}).then(function(e){return _objectSpread({id:r.managedObject.id},_.pick(r.managedObject,_.map(e,"keyPath[0]")))}).then(n.save).then(v).then(function(){return c.success(u("Changes saved."))}).then(s)},cancelEdit:function(){s()}})}e.$inject=["$scope","$q","c8yUiUtil","c8yInventory","c8yPropertiesLibrary","c8yComputedProperties","c8yAlert","c8yTitle","gettext","SchemaPropertiesSvc"],angular.module("c8y.parts.assetPropertyWidget").controller("assetPropertyWidgetCtrl",e)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var r,o=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,r)),o}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:String(t)}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(t,e){var r={path:"/device/:deviceId/*",actionBar:!0};t.addUrlAction(_objectSpread(_objectSpread({},r),{},{text:e("Activate Cell ID information"),showIf:["$q","$routeParams","cellIdInformationActivator",function(t,e,r){return t.all({shown:r.shouldShowActivator(),activated:r.isActivatedFor(e.deviceId)}).then(function(t){var e=t.shown,t=t.activated;return e&&!t})}],action:["$routeParams","cellIdInformationActivator",function(t,e){e.activate(t.deviceId)}]})),t.addUrlAction(_objectSpread(_objectSpread({},r),{},{text:e("Deactivate Cell ID information"),showIf:["$q","$routeParams","cellIdInformationActivator",function(t,e,r){return t.all({shown:r.shouldShowActivator(),activated:r.isActivatedFor(e.deviceId)}).then(function(t){var e=t.shown,t=t.activated;return e&&t})}],action:["$routeParams","cellIdInformationActivator",function(t,e){e.deactivate(t.deviceId)}]}))}t.$inject=["c8yActionsProvider","gettext"],angular.module("c8y.cellIdInformationActivator").config(t)}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var r,o=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,r)),o}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(t,e){var r={path:"/device/:deviceId/*",actionBar:!0};t.addUrlAction(_objectSpread(_objectSpread({},r),{},{text:e("Activate Cell ID information"),showIf:["$q","$routeParams","cellIdInformationActivator",function(t,e,r){return t.all({shown:r.shouldShowActivator(),activated:r.isActivatedFor(e.deviceId)}).then(function(t){var e=t.shown,t=t.activated;return e&&!t})}],action:["$routeParams","cellIdInformationActivator",function(t,e){e.activate(t.deviceId)}]})),t.addUrlAction(_objectSpread(_objectSpread({},r),{},{text:e("Deactivate Cell ID information"),showIf:["$q","$routeParams","cellIdInformationActivator",function(t,e,r){return t.all({shown:r.shouldShowActivator(),activated:r.isActivatedFor(e.deviceId)}).then(function(t){var e=t.shown,t=t.activated;return e&&t})}],action:["$routeParams","cellIdInformationActivator",function(t,e){e.deactivate(t.deviceId)}]}))}t.$inject=["c8yActionsProvider","gettext"],angular.module("c8y.cellIdInformationActivator").config(t)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},t=Object.prototype,s=t.hasOwnProperty,l=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(u){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof d?e:d,e=Object.create(e.prototype),n=new k(n||[]);return l(e,"_invoke",{value:(o=t,i=r,a=n,c=h,function(t,e){if(c===y)throw new Error("Generator is already running");if(c===g){if("throw"===t)throw e;return{value:u,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=u,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;n=f(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,v;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}(r,a);if(r){if(r===v)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===h)throw c=g,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=y;r=f(o,i,a);if("normal"===r.type){if(c=a.done?g:p,r.arg===v)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=g,a.method="throw",a.arg=r.arg)}})}),e}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var h="suspendedStart",p="suspendedYield",y="executing",g="completed",v={};function d(){}function m(){}function w(){}var e={},b=(i(e,n,function(){return this}),Object.getPrototypeOf),b=b&&b(b(G([]))),_=(b&&b!==t&&s.call(b,n)&&(e=b),w.prototype=d.prototype=Object.create(e));function x(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function S(a,c){var e;l(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=f(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==_typeof(r)&&s.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function G(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return l(_,"constructor",{value:m.prototype=w,configurable:!0}),l(w,"constructor",{value:m,configurable:!0}),m.displayName=i(w,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,i(t,o,"GeneratorFunction")),t.prototype=Object.create(_),t},a.awrap=function(t){return{__await:t}},x(S.prototype),i(S.prototype,r,function(){return this}),a.AsyncIterator=S,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new S(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},x(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=G,k.prototype={constructor:k,reset:function(t){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(E),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("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 t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){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"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,E(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:G(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=u),v}},a}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}!function(){function t(n,o,r,i,a,c,u,s){var l={true:{title:s.getString("Activate Cell ID information"),body:s.getString("Activating this feature will result in automatically updating the GPS position of the device when it sends new Cell ID data. Using this feature can result in additional costs."),status:"danger",labels:{ok:s.getString("Activate")}},false:{title:s.getString("Deactivate Cell ID information"),body:s.getString("Are you sure you want to deactivate Cell ID information for this device?"),status:"info",labels:{ok:s.getString("Deactivate")}}};return{shouldShowActivator:function(){return t.apply(this,arguments)},isActivatedFor:function(t){return e.apply(this,arguments)},activate:_.curry(f)(!0),deactivate:_.curry(f)(!1)};function t(){return(t=_asyncToGenerator(_regeneratorRuntime().mark(function t(){var e;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.detailValue({category:"cellid",key:"operation.mode"});case 2:return e=t.sent,t.abrupt("return","manual"===e);case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}function e(){return(e=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var r;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=_.isString(e),t.t0)return t.t1=a,t.next=5,i.detail(e);t.next=7;break;case 5:t.t2=t.sent,t.t0=t.t1.getResData.call(t.t1,t.t2);case 7:return r=t.t0,t.abrupt("return",!!_.get(r,"c8y_CellIdFeatureActive"));case 9:case"end":return t.stop()}},t)}))).apply(this,arguments)}function f(t,e){return h.apply(this,arguments)}function h(){return(h=_asyncToGenerator(_regeneratorRuntime().mark(function t(e,r){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,function(){return p.apply(this,arguments)}(e);case 3:if(t.sent)return t.next=7,o.post(a.url("service/cellid/devices/".concat(r)),{active:e});t.next=10;break;case 7:n.$broadcast("$routeChangeStart"),n.$broadcast("$routeChangeSuccess"),u.success(e?s.getString("Cell ID information activated"):s.getString("Cell ID information deactivated"));case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.error(t.t0.data.message);case 15:case"end":return t.stop()}},t,null,[[0,12]])}))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,c(l[e]);case 3:return t.abrupt("return",t.sent);case 6:return t.prev=6,t.t0=t.catch(0),t.abrupt("return",0);case 9:case"end":return t.stop()}},t,null,[[0,6]])}))).apply(this,arguments)}}t.$inject=["$rootScope","$http","c8ySettings","c8yDevices","c8yBase","c8yModal","c8yAlert","gettextCatalog"],angular.module("c8y.cellIdInformationActivator").factory("cellIdInformationActivator",t)}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},t=Object.prototype,s=t.hasOwnProperty,l=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(u){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof d?e:d,e=Object.create(e.prototype),n=new k(n||[]);return l(e,"_invoke",{value:(o=t,i=r,a=n,c=h,function(t,e){if(c===y)throw Error("Generator is already running");if(c===g){if("throw"===t)throw e;return{value:u,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=u,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;n=f(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,v;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}(r,a);if(r){if(r===v)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===h)throw c=g,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=y;r=f(o,i,a);if("normal"===r.type){if(c=a.done?g:p,r.arg===v)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=g,a.method="throw",a.arg=r.arg)}})}),e}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var h="suspendedStart",p="suspendedYield",y="executing",g="completed",v={};function d(){}function m(){}function w(){}var e={},b=(i(e,n,function(){return this}),Object.getPrototypeOf),b=b&&b(b(G([]))),_=(b&&b!==t&&s.call(b,n)&&(e=b),w.prototype=d.prototype=Object.create(e));function x(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function S(a,c){var e;l(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=f(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==_typeof(r)&&s.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function G(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return l(_,"constructor",{value:m.prototype=w,configurable:!0}),l(w,"constructor",{value:m,configurable:!0}),m.displayName=i(w,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,i(t,o,"GeneratorFunction")),t.prototype=Object.create(_),t},a.awrap=function(t){return{__await:t}},x(S.prototype),i(S.prototype,r,function(){return this}),a.AsyncIterator=S,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new S(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},x(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=G,k.prototype={constructor:k,reset:function(t){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(E),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("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 t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){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"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,E(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:G(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=u),v}},a}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}!function(){function t(n,o,r,i,a,c,u,s){var l={true:{title:s.getString("Activate Cell ID information"),body:s.getString("Activating this feature will result in automatically updating the GPS position of the device when it sends new Cell ID data. Using this feature can result in additional costs."),status:"danger",labels:{ok:s.getString("Activate")}},false:{title:s.getString("Deactivate Cell ID information"),body:s.getString("Are you sure you want to deactivate Cell ID information for this device?"),status:"info",labels:{ok:s.getString("Deactivate")}}};return{shouldShowActivator:function(){return t.apply(this,arguments)},isActivatedFor:function(t){return e.apply(this,arguments)},activate:_.curry(f)(!0),deactivate:_.curry(f)(!1)};function t(){return(t=_asyncToGenerator(_regeneratorRuntime().mark(function t(){var e;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.detailValue({category:"cellid",key:"operation.mode"});case 2:return e=t.sent,t.abrupt("return","manual"===e);case 4:case"end":return t.stop()}},t)}))).apply(this,arguments)}function e(){return(e=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var r;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=_.isString(e),t.t0)return t.t1=a,t.next=5,i.detail(e);t.next=7;break;case 5:t.t2=t.sent,t.t0=t.t1.getResData.call(t.t1,t.t2);case 7:return r=t.t0,t.abrupt("return",!!_.get(r,"c8y_CellIdFeatureActive"));case 9:case"end":return t.stop()}},t)}))).apply(this,arguments)}function f(t,e){return h.apply(this,arguments)}function h(){return(h=_asyncToGenerator(_regeneratorRuntime().mark(function t(e,r){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,function(){return p.apply(this,arguments)}(e);case 3:if(t.sent)return t.next=7,o.post(a.url("service/cellid/devices/".concat(r)),{active:e});t.next=10;break;case 7:n.$broadcast("$routeChangeStart"),n.$broadcast("$routeChangeSuccess"),u.success(e?s.getString("Cell ID information activated"):s.getString("Cell ID information deactivated"));case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.error(t.t0.data.message);case 15:case"end":return t.stop()}},t,null,[[0,12]])}))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,c(l[e]);case 3:return t.abrupt("return",t.sent);case 6:return t.prev=6,t.t0=t.catch(0),t.abrupt("return",0);case 9:case"end":return t.stop()}},t,null,[[0,6]])}))).apply(this,arguments)}}t.$inject=["$rootScope","$http","c8ySettings","c8yDevices","c8yBase","c8yModal","c8yAlert","gettextCatalog"],angular.module("c8y.cellIdInformationActivator").factory("cellIdInformationActivator",t)}();
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var s,a={},t=Object.prototype,u=t.hasOwnProperty,l=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(s){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof g?e:g,e=Object.create(e.prototype),n=new I(n||[]);return l(e,"_invoke",{value:(o=t,i=r,a=n,c=h,function(t,e){if(c===p)throw new Error("Generator is already running");if(c===d){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===s)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;n=f(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,m;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}(r,a);if(r){if(r===m)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===h)throw c=d,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=p;r=f(o,i,a);if("normal"===r.type){if(c=a.done?d:y,r.arg===m)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=d,a.method="throw",a.arg=r.arg)}})}),e}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var h="suspendedStart",y="suspendedYield",p="executing",d="completed",m={};function g(){}function v(){}function b(){}var e={},w=(i(e,n,function(){return this}),Object.getPrototypeOf),w=w&&w(w(E([]))),_=(w&&w!==t&&u.call(w,n)&&(e=w),b.prototype=g.prototype=Object.create(e));function S(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function L(a,c){var e;l(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=f(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==_typeof(r)&&u.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function E(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(u.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return l(_,"constructor",{value:v.prototype=b,configurable:!0}),l(b,"constructor",{value:v,configurable:!0}),v.displayName=i(b,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,i(t,o,"GeneratorFunction")),t.prototype=Object.create(_),t},a.awrap=function(t){return{__await:t}},S(L.prototype),i(L.prototype,r,function(){return this}),a.AsyncIterator=L,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new L(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},S(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=E,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&u.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=s),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=u.call(o,"catchLoc"),c=u.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,T(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=s),m}},a}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_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(t,e){var r;if(t)return"string"==typeof t?_arrayLikeToArray(t,e):"Map"===(r="Object"===(r=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}!function(){function t(i,o,a,e,r,n,c,s,u){var l=this;function t(){return(t=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r.changeTitle({title:u("Cell ID usage statistics")}),t.next=3,f();case 3:case"end":return t.stop()}},t)}))).apply(this,arguments)}function f(){return h.apply(this,arguments)}function h(){return(h=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=n=r=e=void 0,e=a.dateFrom,r=a.dateTo,n=moment().startOf("month").toDate(),o=moment().add(1,"day").toDate(),l.dateFrom=c.stringToDate(e)||n,l.dateTo=c.stringToDate(r)||o,t.next=3,function(){return y.apply(this,arguments)}();case 3:l.subtenantList.columns=s.getSubtenantListColumns(),l.subtenantList.csvHeaders=_.map(l.subtenantList.columns,function(t){return _.get(t,"header.csv")||_.get(t,"header.text")||_.get(t,"header")}),l.subtenantList.filteredSortedStatisticsItems=d(),i.$apply();case 7:case"end":return t.stop()}var e,r,n,o},t)}))).apply(this,arguments)}function y(){return(y=_asyncToGenerator(_regeneratorRuntime().mark(function t(){var e,r,n;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=p(),t.next=3,o.all({tenantStatistics:s.getTenantStatisticsFor(e),subtenantsStatistics:s.getSubtenantsStatisticsFor(e)});case 3:e=t.sent,r=e.tenantStatistics,n=e.subtenantsStatistics,l.tenantStatistics=r,l.subtenantList.statisticsItems=n;case 8:case"end":return t.stop()}},t)}))).apply(this,arguments)}function p(){return{dateFrom:c.dateToString(l.dateFrom),dateTo:c.dateToString(l.dateTo)}}function d(t){var t=0<arguments.length&&void 0!==t?t:l.subtenantList.columnsConfig,e=(l.subtenantList.columnsConfig=t,l.subtenantList),r=e.statisticsItems,e=e.columns;return n.filterSort(r,e,t)}_.assign(l,{$onInit:function(){return t.apply(this,arguments)},refresh:f,doFilter:function(){var t=p();t.dateFrom&&t.dateTo&&e.search(t)},clearFilter:function(){e.search({})},tenantStatistics:{tenantId:void 0,apiRequests:0,activeDevices:0},subtenantList:{csvHeaders:[],csvData:function(){return _.map([l.tenantStatistics].concat(_toConsumableArray(l.subtenantList.filteredSortedStatisticsItems)),function(t){return _.at(t,["tenantId","apiRequests","activeDevices"])})},columns:[],columnsConfig:{},onColumnsConfigChanged:function(t){l.subtenantList.filteredSortedStatisticsItems=d(t)},statisticsItems:[],filteredSortedStatisticsItems:[],goToSubtenant:function(t){t=t.tenantId;e.path("/tenants/".concat(t))}}})}t.$inject=["$rootScope","$q","$routeParams","$location","c8yTitle","c8yFilteringSortingCollections","c8yUtil","cellIdUsageStatisticsService","gettext"],angular.module("c8y.cellIdUsageStatistics").component("c8yCellIdUsageStatistics",{templateUrl:":::PLUGIN_PATH:::/cell-id-usage-statistics.html",controllerAs:"vm",controller:t})}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var s,a={},t=Object.prototype,u=t.hasOwnProperty,l=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(s){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof g?e:g,e=Object.create(e.prototype),n=new I(n||[]);return l(e,"_invoke",{value:(o=t,i=r,a=n,c=h,function(t,e){if(c===p)throw Error("Generator is already running");if(c===d){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===s)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;n=f(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,m;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}(r,a);if(r){if(r===m)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===h)throw c=d,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=p;r=f(o,i,a);if("normal"===r.type){if(c=a.done?d:y,r.arg===m)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=d,a.method="throw",a.arg=r.arg)}})}),e}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var h="suspendedStart",y="suspendedYield",p="executing",d="completed",m={};function g(){}function v(){}function b(){}var e={},w=(i(e,n,function(){return this}),Object.getPrototypeOf),w=w&&w(w(E([]))),_=(w&&w!==t&&u.call(w,n)&&(e=w),b.prototype=g.prototype=Object.create(e));function S(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function L(a,c){var e;l(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=f(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==_typeof(r)&&u.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function E(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(u.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return l(_,"constructor",{value:v.prototype=b,configurable:!0}),l(b,"constructor",{value:v,configurable:!0}),v.displayName=i(b,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,i(t,o,"GeneratorFunction")),t.prototype=Object.create(_),t},a.awrap=function(t){return{__await:t}},S(L.prototype),i(L.prototype,r,function(){return this}),a.AsyncIterator=L,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new L(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},S(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=E,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&u.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=s),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=u.call(o,"catchLoc"),c=u.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,T(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=s),m}},a}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_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(t,e){var r;if(t)return"string"==typeof t?_arrayLikeToArray(t,e):"Map"===(r="Object"===(r=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}!function(){function t(i,o,a,e,r,n,c,s,u){var l=this;function t(){return(t=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r.changeTitle({title:u("Cell ID usage statistics")}),t.next=3,f();case 3:case"end":return t.stop()}},t)}))).apply(this,arguments)}function f(){return h.apply(this,arguments)}function h(){return(h=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=n=r=e=void 0,e=a.dateFrom,r=a.dateTo,n=moment().startOf("month").toDate(),o=moment().add(1,"day").toDate(),l.dateFrom=c.stringToDate(e)||n,l.dateTo=c.stringToDate(r)||o,t.next=3,function(){return y.apply(this,arguments)}();case 3:l.subtenantList.columns=s.getSubtenantListColumns(),l.subtenantList.csvHeaders=_.map(l.subtenantList.columns,function(t){return _.get(t,"header.csv")||_.get(t,"header.text")||_.get(t,"header")}),l.subtenantList.filteredSortedStatisticsItems=d(),i.$apply();case 7:case"end":return t.stop()}var e,r,n,o},t)}))).apply(this,arguments)}function y(){return(y=_asyncToGenerator(_regeneratorRuntime().mark(function t(){var e,r,n;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=p(),t.next=3,o.all({tenantStatistics:s.getTenantStatisticsFor(e),subtenantsStatistics:s.getSubtenantsStatisticsFor(e)});case 3:e=t.sent,r=e.tenantStatistics,n=e.subtenantsStatistics,l.tenantStatistics=r,l.subtenantList.statisticsItems=n;case 8:case"end":return t.stop()}},t)}))).apply(this,arguments)}function p(){return{dateFrom:c.dateToString(l.dateFrom),dateTo:c.dateToString(l.dateTo)}}function d(t){var t=0<arguments.length&&void 0!==t?t:l.subtenantList.columnsConfig,e=(l.subtenantList.columnsConfig=t,l.subtenantList),r=e.statisticsItems,e=e.columns;return n.filterSort(r,e,t)}_.assign(l,{$onInit:function(){return t.apply(this,arguments)},refresh:f,doFilter:function(){var t=p();t.dateFrom&&t.dateTo&&e.search(t)},clearFilter:function(){e.search({})},tenantStatistics:{tenantId:void 0,apiRequests:0,activeDevices:0},subtenantList:{csvHeaders:[],csvData:function(){return _.map([l.tenantStatistics].concat(_toConsumableArray(l.subtenantList.filteredSortedStatisticsItems)),function(t){return _.at(t,["tenantId","apiRequests","activeDevices"])})},columns:[],columnsConfig:{},onColumnsConfigChanged:function(t){l.subtenantList.filteredSortedStatisticsItems=d(t)},statisticsItems:[],filteredSortedStatisticsItems:[],goToSubtenant:function(t){t=t.tenantId;e.path("/tenants/".concat(t))}}})}t.$inject=["$rootScope","$q","$routeParams","$location","c8yTitle","c8yFilteringSortingCollections","c8yUtil","cellIdUsageStatisticsService","gettext"],angular.module("c8y.cellIdUsageStatistics").component("c8yCellIdUsageStatistics",{templateUrl:":::PLUGIN_PATH:::/cell-id-usage-statistics.html",controllerAs:"vm",controller:t})}();
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},t=Object.prototype,s=t.hasOwnProperty,l=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(u){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof m?e:m,e=Object.create(e.prototype),n=new T(n||[]);return l(e,"_invoke",{value:(o=t,i=r,a=n,c=h,function(t,e){if(c===y)throw new Error("Generator is already running");if(c===g){if("throw"===t)throw e;return{value:u,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=u,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;n=f(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,v;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}(r,a);if(r){if(r===v)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===h)throw c=g,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=y;r=f(o,i,a);if("normal"===r.type){if(c=a.done?g:p,r.arg===v)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=g,a.method="throw",a.arg=r.arg)}})}),e}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var h="suspendedStart",p="suspendedYield",y="executing",g="completed",v={};function m(){}function d(){}function w(){}var e={},_=(i(e,n,function(){return this}),Object.getPrototypeOf),_=_&&_(_(N([]))),b=(_&&_!==t&&s.call(_,n)&&(e=_),w.prototype=m.prototype=Object.create(e));function S(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function E(a,c){var e;l(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=f(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==_typeof(r)&&s.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function N(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return l(b,"constructor",{value:d.prototype=w,configurable:!0}),l(w,"constructor",{value:d,configurable:!0}),d.displayName=i(w,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,i(t,o,"GeneratorFunction")),t.prototype=Object.create(b),t},a.awrap=function(t){return{__await:t}},S(E.prototype),i(E.prototype,r,function(){return this}),a.AsyncIterator=E,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new E(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},S(b),i(b,o,"Generator"),i(b,n,function(){return this}),i(b,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=N,T.prototype={constructor:T,reset:function(t){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(L),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("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 t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){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"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,L(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:N(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=u),v}},a}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}!function(){function t(n,o,t,e){var i=e.TENANT_STATS_SERVICE_ENDPOINT,a=e.SUBTENANTS_STATS_SERVICE_ENDPOINT,r=e.SUBTENANT_STATS_COLUMNS;return{getSubtenantListColumns:function(){return[t.getColumn(r.tenantId),t.getColumn(r.apiRequests),t.getColumn(r.activeDevices)]},getTenantStatisticsFor:function(t){return c.apply(this,arguments)},getSubtenantsStatisticsFor:function(t){return u.apply(this,arguments)},isCellIDMicroserviceAvailable:function(){return l.apply(this,arguments)}};function c(){return(c=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var r;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=o,t.next=4,n.get(o.url(i),{params:o.timeOrderFilter(o.pageSizeNoTotalFilter(e)),silentError:!0});case 4:return t.t1=t.sent,r=t.t0.getResData.call(t.t0,t.t1),t.abrupt("return",s(r));case 9:return t.prev=9,t.t2=t.catch(0),t.abrupt("return",s({}));case 12:case"end":return t.stop()}},t,null,[[0,9]])}))).apply(this,arguments)}function u(){return(u=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var r;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=o,t.next=4,n.get(o.url(a),{params:o.timeOrderFilter(o.pageSizeNoTotalFilter(e)),silentError:!0});case 4:return t.t1=t.sent,r=t.t0.getResData.call(t.t0,t.t1),t.abrupt("return",_.map(r,s));case 9:return t.prev=9,t.t2=t.catch(0),t.abrupt("return",[]);case 12:case"end":return t.stop()}},t,null,[[0,9]])}))).apply(this,arguments)}function s(t){return{tenantId:_.get(t,"tenant"),apiRequests:_.get(t,"statistics.apiRequests",0),activeDevices:_.get(t,"statistics.activeDevices",0)}}function l(){return(l=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n.get(o.url(i),{params:{dateFrom:moment().format(o.dateFormat)},silentError:!0});case 3:return t.abrupt("return",!0);case 6:return t.prev=6,t.t0=t.catch(0),t.abrupt("return",!1);case 9:case"end":return t.stop()}},t,null,[[0,6]])}))).apply(this,arguments)}}t.$inject=["$http","c8yBase","c8yFilteringSortingCollections","cellIdUsageStatisticsConstants"],angular.module("c8y.cellIdUsageStatistics").factory("cellIdUsageStatisticsService",t)}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var u,a={},t=Object.prototype,s=t.hasOwnProperty,l=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(u){i=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o,i,a,c,e=e&&e.prototype instanceof m?e:m,e=Object.create(e.prototype),n=new T(n||[]);return l(e,"_invoke",{value:(o=t,i=r,a=n,c=h,function(t,e){if(c===y)throw Error("Generator is already running");if(c===g){if("throw"===t)throw e;return{value:u,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===u)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=u,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;n=f(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,v;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=u),r.delegate=null,v):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}(r,a);if(r){if(r===v)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===h)throw c=g,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=y;r=f(o,i,a);if("normal"===r.type){if(c=a.done?g:p,r.arg===v)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c=g,a.method="throw",a.arg=r.arg)}})}),e}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var h="suspendedStart",p="suspendedYield",y="executing",g="completed",v={};function m(){}function d(){}function w(){}var e={},_=(i(e,n,function(){return this}),Object.getPrototypeOf),_=_&&_(_(N([]))),b=(_&&_!==t&&s.call(_,n)&&(e=_),w.prototype=m.prototype=Object.create(e));function S(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function E(a,c){var e;l(this,"_invoke",{value:function(r,n){function t(){return new c(function(t,e){!function e(t,r,n,o){var i,t=f(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==_typeof(r)&&s.call(r,"__await")?c.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):c.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function N(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(_typeof(e)+" is not iterable")}return l(b,"constructor",{value:d.prototype=w,configurable:!0}),l(w,"constructor",{value:d,configurable:!0}),d.displayName=i(w,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,i(t,o,"GeneratorFunction")),t.prototype=Object.create(b),t},a.awrap=function(t){return{__await:t}},S(E.prototype),i(E.prototype,r,function(){return this}),a.AsyncIterator=E,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new E(c(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},S(b),i(b,o,"Generator"),i(b,n,function(){return this}),i(b,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=N,T.prototype={constructor:T,reset:function(t){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(L),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("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 t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){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"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,L(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:N(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=u),v}},a}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(c){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=c.apply(t,a);function o(t){asyncGeneratorStep(n,e,r,o,i,"next",t)}function i(t){asyncGeneratorStep(n,e,r,o,i,"throw",t)}o(void 0)})}}!function(){function t(n,o,t,e){var i=e.TENANT_STATS_SERVICE_ENDPOINT,a=e.SUBTENANTS_STATS_SERVICE_ENDPOINT,r=e.SUBTENANT_STATS_COLUMNS;return{getSubtenantListColumns:function(){return[t.getColumn(r.tenantId),t.getColumn(r.apiRequests),t.getColumn(r.activeDevices)]},getTenantStatisticsFor:function(t){return c.apply(this,arguments)},getSubtenantsStatisticsFor:function(t){return u.apply(this,arguments)},isCellIDMicroserviceAvailable:function(){return l.apply(this,arguments)}};function c(){return(c=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var r;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=o,t.next=4,n.get(o.url(i),{params:o.timeOrderFilter(o.pageSizeNoTotalFilter(e)),silentError:!0});case 4:return t.t1=t.sent,r=t.t0.getResData.call(t.t0,t.t1),t.abrupt("return",s(r));case 9:return t.prev=9,t.t2=t.catch(0),t.abrupt("return",s({}));case 12:case"end":return t.stop()}},t,null,[[0,9]])}))).apply(this,arguments)}function u(){return(u=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var r;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=o,t.next=4,n.get(o.url(a),{params:o.timeOrderFilter(o.pageSizeNoTotalFilter(e)),silentError:!0});case 4:return t.t1=t.sent,r=t.t0.getResData.call(t.t0,t.t1),t.abrupt("return",_.map(r,s));case 9:return t.prev=9,t.t2=t.catch(0),t.abrupt("return",[]);case 12:case"end":return t.stop()}},t,null,[[0,9]])}))).apply(this,arguments)}function s(t){return{tenantId:_.get(t,"tenant"),apiRequests:_.get(t,"statistics.apiRequests",0),activeDevices:_.get(t,"statistics.activeDevices",0)}}function l(){return(l=_asyncToGenerator(_regeneratorRuntime().mark(function t(){return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n.get(o.url(i),{params:{dateFrom:moment().format(o.dateFormat)},silentError:!0});case 3:return t.abrupt("return",!0);case 6:return t.prev=6,t.t0=t.catch(0),t.abrupt("return",!1);case 9:case"end":return t.stop()}},t,null,[[0,6]])}))).apply(this,arguments)}}t.$inject=["$http","c8yBase","c8yFilteringSortingCollections","cellIdUsageStatisticsConstants"],angular.module("c8y.cellIdUsageStatistics").factory("cellIdUsageStatisticsService",t)}();
@@ -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 _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_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 n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(){function e(e,t,n,r,o,a,i,l){var m,y=this,c=[],u=r.getDeliveryTypes().defaultDeliveryType,d=r.getDeliveryTypes().standardDeliveryTypes;function s(e){c.length=0,_.forEach(e,function(e){var t=!!e.id;c.push({name:t?e.name:l.getString(e.name),command:e.command,category:t?e.category:l.getString(e.category),deliveryTypes:e.deliveryTypes,id:e.id})})}function p(e){y.result.commandTemplate=e,_.difference(e.deliveryTypes,d)||y.standardDeliveryTypes.push(e.deliveryType),y.commandDeliveryType=_.first(e.deliveryTypes)||u}_.assign(y,{commandTemplates:c,standardDeliveryTypes:d,defaultDeliveryType:u,commandDeliveryTypesSelected:{},validateSelectedDeliveryTypes:function(){return _.isEmpty(_.pickBy(y.commandDeliveryTypesSelected))},result:{action:null,commandTemplate:null},forms:{},onTemplateSelected:p,use:function(e){y.result.action="USE",y.result.deliveryType=e!==u&&e,y.result.commandTemplate=_.clone(y.result.commandTemplate);e=y.result.commandTemplate;e.text=e.text||e.command,y.close(y.result)},execute:function(e){y.result.action="EXECUTE",y.result.deliveryType=e!==u&&e,y.result.commandTemplate=_.clone(y.result.commandTemplate);e=y.result.commandTemplate;e.text=e.command,y.close(y.result)},cancel:function(){y.newCommandTemplate?delete y.newCommandTemplate:y.dismiss()},save:function(){y.newCommandTemplate.deliveryTypes=_.keys(_.pickBy(y.commandDeliveryTypesSelected)),r.saveTemplate(y.newCommandTemplate).then(t.getResData).then(function(e){var e=_.pick(e,["id","name","category","command","text","deliveryTypes"]),t=_.find(c,{id:e.id});t?_.assign(t,e):c.unshift(e),y.result.commandTemplate=e,p(e),delete y.newCommandTemplate})},addNew:function(){y.newCommandTemplate={deviceType:m},y.commandDeliveryTypesSelected=_defineProperty({},u,!0)},hideAddButton:function(){return!!y.newCommandTemplate},edit:function(e){var t;t=_.isEmpty(e.deliveryTypes)?d:e.deliveryTypes;_.forEach(t,function(e){_.assign(y.commandDeliveryTypesSelected,_defineProperty({},e,!0))}),y.newCommandTemplate=e},remove:function(e){y.result.commandTemplate===e&&delete y.result.commandTemplate;r.removeTemplate(e).then(function(){_.pull(c,e)}).then(function(){a.success(i("Shell command template deleted."))})},isDeliveryTypeSupported:function(e,t){t=_.get(t,"deliveryTypes");return _.isEmpty(t)||_.includes(t,e)},getExecuteButtonLabel:function(e){return e!==u?l.getString("Execute (via {{ deliveryType | translate }})",{deliveryType:e}):l.getString("Execute")},appendToEl:document.getElementsByClassName("modal"),getCommandPlaceholder:function(){return l.getString("e.g. {{ example }}",{example:"ls"})}}),function(e){return n.detailCached(e).then(t.getResData).then(function(e){return m=_.concat(e.type,e.c8y_DeviceTypes||[]),r.getCommandTemplatesForDeviceType.apply(r,_toConsumableArray(m))})}(e.deviceId).then(s),r.canSendCommandsViaSMS().then(function(e){y.smsEnabled=e}),o.hasAnyRole(["ROLE_INVENTORY_ADMIN","ROLE_MANAGED_OBJECT_ADMIN"]).then(function(e){y.canWrite=e})}e.$inject=["$routeParams","c8yBase","c8yDevices","c8yDeviceShell","c8yPermissions","c8yAlert","gettext","gettextCatalog"],angular.module("c8y.commandTemplates").controller("commandTemplatesCtrl",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 _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}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 n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_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 n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(){function e(e,t,n,r,o,a,i,l){var m,y=this,c=[],u=r.getDeliveryTypes().defaultDeliveryType,d=r.getDeliveryTypes().standardDeliveryTypes;function s(e){c.length=0,_.forEach(e,function(e){var t=!!e.id;c.push({name:t?e.name:l.getString(e.name),command:e.command,category:t?e.category:l.getString(e.category),deliveryTypes:e.deliveryTypes,id:e.id})})}function p(e){y.result.commandTemplate=e,_.difference(e.deliveryTypes,d)||y.standardDeliveryTypes.push(e.deliveryType),y.commandDeliveryType=_.first(e.deliveryTypes)||u}_.assign(y,{commandTemplates:c,standardDeliveryTypes:d,defaultDeliveryType:u,commandDeliveryTypesSelected:{},validateSelectedDeliveryTypes:function(){return _.isEmpty(_.pickBy(y.commandDeliveryTypesSelected))},result:{action:null,commandTemplate:null},forms:{},onTemplateSelected:p,use:function(e){y.result.action="USE",y.result.deliveryType=e!==u&&e,y.result.commandTemplate=_.clone(y.result.commandTemplate);e=y.result.commandTemplate;e.text=e.text||e.command,y.close(y.result)},execute:function(e){y.result.action="EXECUTE",y.result.deliveryType=e!==u&&e,y.result.commandTemplate=_.clone(y.result.commandTemplate);e=y.result.commandTemplate;e.text=e.command,y.close(y.result)},cancel:function(){y.newCommandTemplate?delete y.newCommandTemplate:y.dismiss()},save:function(){y.newCommandTemplate.deliveryTypes=_.keys(_.pickBy(y.commandDeliveryTypesSelected)),r.saveTemplate(y.newCommandTemplate).then(t.getResData).then(function(e){var e=_.pick(e,["id","name","category","command","text","deliveryTypes"]),t=_.find(c,{id:e.id});t?_.assign(t,e):c.unshift(e),y.result.commandTemplate=e,p(e),delete y.newCommandTemplate})},addNew:function(){y.newCommandTemplate={deviceType:m},y.commandDeliveryTypesSelected=_defineProperty({},u,!0)},hideAddButton:function(){return!!y.newCommandTemplate},edit:function(e){var t;t=_.isEmpty(e.deliveryTypes)?d:e.deliveryTypes;_.forEach(t,function(e){_.assign(y.commandDeliveryTypesSelected,_defineProperty({},e,!0))}),y.newCommandTemplate=e},remove:function(e){y.result.commandTemplate===e&&delete y.result.commandTemplate;r.removeTemplate(e).then(function(){_.pull(c,e)}).then(function(){a.success(i("Shell command template deleted."))})},isDeliveryTypeSupported:function(e,t){t=_.get(t,"deliveryTypes");return _.isEmpty(t)||_.includes(t,e)},getExecuteButtonLabel:function(e){return e!==u?l.getString("Execute (via {{ deliveryType | translate }})",{deliveryType:e}):l.getString("Execute")},appendToEl:document.getElementsByClassName("modal"),getCommandPlaceholder:function(){return l.getString("e.g. {{ example }}",{example:"ls"})}}),function(e){return n.detailCached(e).then(t.getResData).then(function(e){return m=_.concat(e.type,e.c8y_DeviceTypes||[]),r.getCommandTemplatesForDeviceType.apply(r,_toConsumableArray(m))})}(e.deviceId).then(s),r.canSendCommandsViaSMS().then(function(e){y.smsEnabled=e}),o.hasAnyRole(["ROLE_INVENTORY_ADMIN","ROLE_MANAGED_OBJECT_ADMIN"]).then(function(e){y.canWrite=e})}e.$inject=["$routeParams","c8yBase","c8yDevices","c8yDeviceShell","c8yPermissions","c8yAlert","gettext","gettextCatalog"],angular.module("c8y.commandTemplates").controller("commandTemplatesCtrl",e)}();
@@ -1,23 +1,35 @@
1
1
  <div class="modal-header text-center separator">
2
- <h1 id="modal-title" class="h3" translate>Select a predefined command</h1>
2
+ <div
3
+ class="h3"
4
+ id="modal-title"
5
+ translate
6
+ >
7
+ Select a predefined command
8
+ </div>
3
9
  </div>
4
- <div class="d-flex p-16 separator-bottom a-i-center" ng-hide="vm.newCommandTemplate">
10
+ <div
11
+ class="d-flex p-16 separator-bottom a-i-center"
12
+ ng-hide="vm.newCommandTemplate"
13
+ >
5
14
  <form class="commandTemplatesSearchForm flex-grow p-r-16">
6
15
  <div class="input-group input-group-search">
7
16
  <input
8
- type="search"
9
17
  class="form-control"
10
18
  placeholder="{{ 'Search command by name or text' | translate }}"
19
+ type="search"
11
20
  ng-model="commandsFilter.text"
12
21
  data-cy="commandTemplates--search-command"
13
22
  />
14
23
  <span class="input-group-addon">
15
- <i c8y-icon="search" ng-hide="commandsFilter.text.length"></i>
24
+ <i
25
+ c8y-icon="search"
26
+ ng-hide="commandsFilter.text.length"
27
+ ></i>
16
28
  <i
17
29
  c8y-icon="times"
30
+ title="{{ 'Clear`input`' | translate }}"
18
31
  ng-show="commandsFilter.text.length"
19
32
  ng-click="commandsFilter.text=''"
20
- title="{{ 'Clear`input`' | translate }}"
21
33
  data-cy="commandTemplates--icon-search"
22
34
  ></i>
23
35
  </span>
@@ -26,9 +38,9 @@
26
38
  <div class="m-l-auto">
27
39
  <button
28
40
  class="btn btn-default btn-xs"
29
- ng-click="vm.addNew()"
30
41
  title="{{ 'Create a new command template' | translate }}"
31
42
  type="button"
43
+ ng-click="vm.addNew()"
32
44
  ng-show="vm.canWrite && !vm.newCommandTemplate"
33
45
  data-cy="commandTemplates--new-command-template"
34
46
  >
@@ -37,15 +49,21 @@
37
49
  </button>
38
50
  </div>
39
51
  </div>
40
- <div class="modal-inner-scroll" id="modal-body">
41
- <div class="modal-body bg-level-2" ng-if="vm.newCommandTemplate">
52
+ <div
53
+ class="modal-inner-scroll"
54
+ id="modal-body"
55
+ >
56
+ <div
57
+ class="modal-body bg-level-2"
58
+ ng-if="vm.newCommandTemplate"
59
+ >
42
60
  <form name="vm.forms.newCommandForm">
43
61
  <div class="form-group">
44
62
  <label translate>Name</label>
45
63
  <input
64
+ class="form-control"
46
65
  placeholder="{{ 'e.g. My command template' | translate }}"
47
66
  required
48
- class="form-control"
49
67
  ng-model="vm.newCommandTemplate.name"
50
68
  data-cy="commandTemplates--predefined-command-name"
51
69
  />
@@ -53,9 +71,9 @@
53
71
  <div class="form-group">
54
72
  <label translate>Category</label>
55
73
  <input
74
+ class="form-control"
56
75
  placeholder="{{ 'e.g. My templates category' | translate }}"
57
76
  required
58
- class="form-control"
59
77
  ng-model="vm.newCommandTemplate.category"
60
78
  data-cy="commandTemplates--predefined-command-category"
61
79
  />
@@ -63,10 +81,10 @@
63
81
  <div class="form-group">
64
82
  <label translate>Command template</label>
65
83
  <textarea
66
- placeholder="{{ vm.getCommandPlaceholder() }}"
67
- required
68
84
  class="form-control"
85
+ placeholder="{{ vm.getCommandPlaceholder() }}"
69
86
  rows="1"
87
+ required
70
88
  ng-model="vm.newCommandTemplate.command"
71
89
  data-cy="commandTemplates--command-template"
72
90
  ></textarea>
@@ -74,7 +92,10 @@
74
92
  <div class="form-group">
75
93
  <label translate>Delivery type</label>
76
94
  <span ng-repeat="deliveryType in vm.standardDeliveryTypes">
77
- <label title="{{ deliveryType | translate }}" class="c8y-checkbox">
95
+ <label
96
+ class="c8y-checkbox"
97
+ title="{{ deliveryType | translate }}"
98
+ >
78
99
  <input
79
100
  type="checkbox"
80
101
  ng-model="vm.commandDeliveryTypesSelected[deliveryType]"
@@ -89,17 +110,20 @@
89
110
  </div>
90
111
 
91
112
  <c8y-ui-empty-state
92
- ng-if="vm.commandTemplates.length === 0 && !vm.newCommandTemplate"
93
113
  [icon]="'terminal'"
94
114
  [title]="'No command template available.' | translate"
95
115
  [subtitle]="'Add a new command template by clicking the button above.' | translate"
116
+ ng-if="vm.commandTemplates.length === 0 && !vm.newCommandTemplate"
96
117
  ></c8y-ui-empty-state>
97
118
 
98
- <div class="list-group borderless-top command-templates-list" ng-hide="vm.newCommandTemplate">
119
+ <div
120
+ class="list-group borderless-top command-templates-list"
121
+ ng-hide="vm.newCommandTemplate"
122
+ >
99
123
  <div
100
124
  class="list-group-item d-flex"
101
- ng-repeat="commandTemplate in vm.commandTemplates | filter:commandsFilter.text"
102
125
  ng-class="{ active: vm.result.commandTemplate === commandTemplate }"
126
+ ng-repeat="commandTemplate in vm.commandTemplates | filter:commandsFilter.text"
103
127
  ng-click="vm.onTemplateSelected(commandTemplate)"
104
128
  >
105
129
  <div
@@ -110,26 +134,29 @@
110
134
  >
111
135
  <div
112
136
  class="dropdown settings"
137
+ ng-class="{ open: isOpen }"
113
138
  uib-dropdown
114
139
  dropdown-append-to-body="true"
115
140
  is-open="isOpen"
116
- ng-class="{ open: isOpen }"
117
141
  >
118
142
  <button
119
143
  class="dropdown-toggle c8y-dropdown"
120
144
  title="{{ 'Actions' | translate }}"
145
+ aria-haspopup="true"
121
146
  type="button"
122
147
  uib-dropdown-toggle
123
- aria-haspopup="true"
124
148
  >
125
149
  <i c8y-icon="ellipsis-v"></i>
126
150
  </button>
127
- <ul class="dropdown-menu dropdown-menu-right dropdown-menu--modal" uib-dropdown-menu>
151
+ <ul
152
+ class="dropdown-menu dropdown-menu-right dropdown-menu--modal"
153
+ uib-dropdown-menu
154
+ >
128
155
  <li>
129
156
  <button
130
- ng-click="vm.edit(commandTemplate)"
131
157
  title="{{ 'Edit' | translate }}"
132
158
  type="button"
159
+ ng-click="vm.edit(commandTemplate)"
133
160
  >
134
161
  <i c8y-icon="edit"></i>
135
162
  {{ 'Edit' | translate }}
@@ -137,9 +164,9 @@
137
164
  </li>
138
165
  <li>
139
166
  <button
140
- ng-click="vm.remove(commandTemplate)"
141
167
  title="{{ 'Remove' | translate }}"
142
168
  type="button"
169
+ ng-click="vm.remove(commandTemplate)"
143
170
  >
144
171
  <i c8y-icon="delete"></i>
145
172
  {{ 'Remove' | translate }}
@@ -152,25 +179,40 @@
152
179
  <i c8y-icon="terminal"></i>
153
180
  </div>
154
181
  <div class="list-item-body">
155
- <div class="d-flex">
156
- <span class="flex-grow p-r-8">
157
- {{ commandTemplate.name | translate }}
158
- </span>
159
- <span
160
- class="label label-info a-s-end m-r-4"
161
- ng-show="commandTemplate.deliveryTypes.length === 1"
182
+ <div class="d-flex a-i-start">
183
+ <div
184
+ class="d-col flex-grow"
185
+ style="max-width: 460px"
186
+ >
187
+ <span class="p-r-8">
188
+ {{ commandTemplate.name | translate }}
189
+ </span>
190
+ <span class="list-group-item-text">
191
+ <small ng-class="{ 'text-muted': vm.result.commandTemplate != commandTemplate }">
192
+ {{ commandTemplate.command }}
193
+ </small>
194
+ </span>
195
+ </div>
196
+ <div
197
+ class="d-col"
198
+ style="max-width: 70px !important"
162
199
  >
163
- {{ commandTemplate.deliveryTypes[0] | translate }}
164
- </span>
165
- <span class="label label-info a-s-end" ng-show="commandTemplate.category">
166
- {{ commandTemplate.category | translate }}
167
- </span>
200
+ <span
201
+ class="tag tag--info m-b-4"
202
+ title=" {{ commandTemplate.deliveryTypes[0] | translate }}"
203
+ ng-show="commandTemplate.deliveryTypes.length === 1"
204
+ >
205
+ {{ commandTemplate.deliveryTypes[0] | translate }}
206
+ </span>
207
+ <span
208
+ class="tag tag--info"
209
+ title=" {{ commandTemplate.category | translate }}"
210
+ ng-show="commandTemplate.category"
211
+ >
212
+ {{ commandTemplate.category | translate }}
213
+ </span>
214
+ </div>
168
215
  </div>
169
- <span class="list-group-item-text">
170
- <small ng-class="{ 'text-muted': vm.result.commandTemplate != commandTemplate }">
171
- {{ commandTemplate.command }}
172
- </small>
173
- </span>
174
216
  </div>
175
217
  </div>
176
218
  </div>
@@ -179,16 +221,16 @@
179
221
  <div class="modal-footer">
180
222
  <button
181
223
  class="btn btn-default"
182
- type="button"
183
224
  title="{{ 'Cancel' | translate }}"
225
+ type="button"
184
226
  ng-click="vm.cancel()"
185
227
  >
186
228
  {{ 'Cancel' | translate }}
187
229
  </button>
188
230
  <button
189
231
  class="btn btn-primary"
190
- type="button"
191
232
  title="{{ 'Use' | translate }}"
233
+ type="button"
192
234
  ng-click="vm.use(vm.commandDeliveryType)"
193
235
  ng-disabled="!vm.result.commandTemplate"
194
236
  ng-hide="vm.newCommandTemplate"
@@ -197,8 +239,8 @@
197
239
  </button>
198
240
  <button
199
241
  class="btn btn-primary"
200
- type="button"
201
242
  title="{{ 'Save' | translate }}"
243
+ type="button"
202
244
  ng-click="vm.save()"
203
245
  ng-disabled="vm.forms.newCommandForm.$invalid"
204
246
  ng-show="vm.newCommandTemplate"
@@ -1 +1 @@
1
- "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:String(t)}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(n,i,o,u,a,t,e,c){var r=i.cleanFields,s="alarm/alarms",f="".concat(s,"/reports"),l={headers:i.contentHeaders("alarm")},m={WARNING:e("WARNING"),MINOR:e("MINOR"),MAJOR:e("MAJOR"),CRITICAL:e("CRITICAL")},y=[m.CRITICAL,m.MAJOR,m.MINOR,m.WARNING],p=_.keys(m),g={ACTIVE:e("ACTIVE"),ACKNOWLEDGED:e("ACKNOWLEDGED"),CLEARED:e("CLEARED")},d=_.keys(g),h=["id"],v=["id","self","creationTime","type","time","count","history","firstOccurence","firstOccurrenceTime"],b={},E="status",e={type:e("Type"),text:e("Text"),lastUpdated:e("Last updated")};function O(t){t=t.id||t;return i.url("".concat(s,"/").concat(t))}function D(t){var e=i.url(s),t=i.timeOrderFilter(i.pageSizeNoTotalFilter(t)),r={params:t},t=i.cleanListCallback("alarms",D,t);return n.get(e,r).then(t)}function C(t){var e=i.url(s),t=r(t,h);return n.post(e,t,l)}function w(t){var e=O(t),t=r(t,v);return n.put(e,t,l)}function A(e,t){t=t?r(t):a.list({source:e.id,pageSize:1e3}).then(r);return t;function r(t){var n="--";return e.status!==g.ACKNOWLEDGED||_.isEmpty(t)||(n=_.last(t).user),t.forEach(function(t){var e=t.changes||[],r=!1;if(e.forEach(function(t){if(t.attribute===E&&t.newValue===g.ACKNOWLEDGED)return!(r=!0)}),r)return n=t.user||n,!1}),n}}function T(t,e){function r(t){var t=t||[],n=t.length?t[t.length-1].creationTime:void 0;return t.forEach(function(e){var t=e.changes||[],r=!1;if(t.forEach(function(t){if(t.attribute===E&&t.newValue===g.ACKNOWLEDGED)return n=e.creationTime,!(r=!0)}),r)return!1}),n}return e?r(e):a.list({source:t.id,pageSize:1e3}).then(r)}function N(t,e){t=L(t,e);return t.humanize?t.humanize():t.then(function(t){return t.humanize?t.humanize():""})}function L(i,t){function e(t){var t=t||[],e=i.firstOccurrenceTime||i.time||i.creationTime,n=t.length?t[t.length-1].creationTime:void 0,r="";return _.forEach(t,function(e){var t=e.changes||[],r=!1;if(t.forEach(function(t){if(t.attribute===E&&t.newValue===g.CLEARED)return n=e.creationTime,!(r=!0)}),r)return!1}),e&&n&&(t=moment(e),e=moment(n),r=moment.duration(t.diff(e))),r}return t?e(t):a.list({source:i.id,pageSize:1e3}).then(e)}function S(t,e){t=[f,t];return e.id&&t.push(e.id),i.url(t.join("/"))}function R(t){var r=_.memoize(t,function(t,e){return[t.id,t.status,t.count,e&&e.length].join(":")});return function(t,e){return r(t,e)}}function j(t,e){var r=u.when(A(t,e)),t=u.when(T(t,e));return u.all([r,t]).then(function(t){return c.getString("ACKNOWLEDGED`alarm` by: {{ackBy}} {{ackTimeFromNow}}",{ackBy:t[0],ackTimeFromNow:moment(t[1]).fromNow()})})}function I(t,e){return u.when(N(t,e)).then(function(t){return c.getString("CLEARED`alarm`: was active for {{alarmDuration}}",{alarmDuration:t})})}function P(t){return u.when(c.getString("ACTIVE`alarm`: triggered {{alarmTimeFromNow}}",{alarmTimeFromNow:moment(t.time).fromNow()}))}b[m.WARNING]="circle",b[m.MINOR]="high-priority",b[m.MAJOR]="warning",b[m.CRITICAL]="exclamation-circle",b[g.CLEARED]="c8y-alert-idle",b[g.ACKNOWLEDGED]="bell-slash",b[g.ACTIVE]="bell";m={list:D,listByStatus:function(t,e){return t=_.compact(_.map(t,function(t,e){return t?e:void 0})),t=_.map(t,function(t){return D(_objectSpread(_objectSpread({},e),{},{status:t}))}),u.all(t).then(i.combineLists)},listByDevices:function(t,e){return u.all(_.map(t,function(t){return e.source=t,D(e)})).then(i.combineLists)},getSeverityCount:function(t,e){return _.filter(t,{severity:e}).length},detail:function(t){return t=O(t),n.get(t)},update:w,updateBulk:function(t,e){var r=i.url(s);return n.put(r,e,{params:t})},create:C,save:function(t){return(t.id?w:C)(t)},acknowledgedBy:R(A),ackTime:R(T),alarmDuration:R(N),alarmDurationDiff:R(L),severity:m,severityList:p,getHighestSeverityFromAlarmsStatus:function(e){var t=_.map(y,function(t){return{severity:t,count:_.get(e,_.toLower(t),0)}}),t=_.find(t,function(t){return 0<t.count});return _.get(t,"severity",null)},status:g,statusList:d,statusText:R(function(t,e){var r;switch((t.status||"").toUpperCase()){case g.ACKNOWLEDGED:r=j;break;case g.CLEARED:r=I;break;case g.ACTIVE:r=P}return r&&r(t,e)}),icon:function(t){return t=(_.isObjectLike(t)?t.severity:t).toUpperCase(),b[t]},reports:{downtimeDuration:function(t){var e=S("downtimeDuration",t=i.timeOrderFilter(t));return n.get(e,{params:t})},downtimeDurationAggregation:function(t){var e=S("downtimeDuration/aggregation",t=i.timeOrderFilter(t));return n.get(e,{params:t})}},getDisplayCount:function(t){var e=i.url("".concat(s,"/count"));return n.get(e,{params:t}).then(i.getResData).then(function(t){return 99<t?"99+":t})},createCounter:function(t){var e,r,n=_.get(t,"source"),n="/alarms/".concat(n||"*"),n=new o.Counter(D,n);return t&&(e=[o.defaultPropertyMaps.date,o.defaultPropertyMaps.source],t.type&&(r=t.type,e.push([function(t){return r===t.type}])),delete t.type,n.filter(t,e)),n}};return t.enhanceWithKeysUtil({target:m,reservedKeys:["history","id","severity","self","source","creationTime","time","text","firstOccurrence","count","firstOccurrenceTime","status"],standardKeys:e})}t.$inject=["$http","c8yBase","c8yCounter","$q","c8yAudits","c8yUtil","gettext","gettextCatalog"],angular.module("c8y.core").factory("c8yAlarms",t)}();
1
+ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(n,i,o,u,a,t,e,c){var r=i.cleanFields,s="alarm/alarms",f="".concat(s,"/reports"),l={headers:i.contentHeaders("alarm")},m={WARNING:e("WARNING"),MINOR:e("MINOR"),MAJOR:e("MAJOR"),CRITICAL:e("CRITICAL")},y=[m.CRITICAL,m.MAJOR,m.MINOR,m.WARNING],p=_.keys(m),g={ACTIVE:e("ACTIVE"),ACKNOWLEDGED:e("ACKNOWLEDGED"),CLEARED:e("CLEARED")},d=_.keys(g),h=["id"],v=["id","self","creationTime","type","time","count","history","firstOccurence","firstOccurrenceTime"],b={},E="status",e={type:e("Type"),text:e("Text"),lastUpdated:e("Last updated")};function O(t){t=t.id||t;return i.url("".concat(s,"/").concat(t))}function D(t){var e=i.url(s),t=i.timeOrderFilter(i.pageSizeNoTotalFilter(t)),r={params:t},t=i.cleanListCallback("alarms",D,t);return n.get(e,r).then(t)}function C(t){var e=i.url(s),t=r(t,h);return n.post(e,t,l)}function w(t){var e=O(t),t=r(t,v);return n.put(e,t,l)}function A(e,t){t=t?r(t):a.list({source:e.id,pageSize:1e3}).then(r);return t;function r(t){var n="--";return e.status!==g.ACKNOWLEDGED||_.isEmpty(t)||(n=_.last(t).user),t.forEach(function(t){var e=t.changes||[],r=!1;if(e.forEach(function(t){if(t.attribute===E&&t.newValue===g.ACKNOWLEDGED)return!(r=!0)}),r)return n=t.user||n,!1}),n}}function T(t,e){function r(t){var t=t||[],n=t.length?t[t.length-1].creationTime:void 0;return t.forEach(function(e){var t=e.changes||[],r=!1;if(t.forEach(function(t){if(t.attribute===E&&t.newValue===g.ACKNOWLEDGED)return n=e.creationTime,!(r=!0)}),r)return!1}),n}return e?r(e):a.list({source:t.id,pageSize:1e3}).then(r)}function N(t,e){t=L(t,e);return t.humanize?t.humanize():t.then(function(t){return t.humanize?t.humanize():""})}function L(i,t){function e(t){var t=t||[],e=i.firstOccurrenceTime||i.time||i.creationTime,n=t.length?t[t.length-1].creationTime:void 0,r="";return _.forEach(t,function(e){var t=e.changes||[],r=!1;if(t.forEach(function(t){if(t.attribute===E&&t.newValue===g.CLEARED)return n=e.creationTime,!(r=!0)}),r)return!1}),e&&n&&(t=moment(e),e=moment(n),r=moment.duration(t.diff(e))),r}return t?e(t):a.list({source:i.id,pageSize:1e3}).then(e)}function R(t,e){t=[f,t];return e.id&&t.push(e.id),i.url(t.join("/"))}function S(t){var r=_.memoize(t,function(t,e){return[t.id,t.status,t.count,e&&e.length].join(":")});return function(t,e){return r(t,e)}}function j(t,e){var r=u.when(A(t,e)),t=u.when(T(t,e));return u.all([r,t]).then(function(t){return c.getString("ACKNOWLEDGED`alarm` by: {{ackBy}} {{ackTimeFromNow}}",{ackBy:t[0],ackTimeFromNow:moment(t[1]).fromNow()})})}function I(t,e){return u.when(N(t,e)).then(function(t){return c.getString("CLEARED`alarm`: was active for {{alarmDuration}}",{alarmDuration:t})})}function P(t){return u.when(c.getString("ACTIVE`alarm`: triggered {{alarmTimeFromNow}}",{alarmTimeFromNow:moment(t.time).fromNow()}))}b[m.WARNING]="circle",b[m.MINOR]="high-priority",b[m.MAJOR]="warning",b[m.CRITICAL]="exclamation-circle",b[g.CLEARED]="c8y-alert-idle",b[g.ACKNOWLEDGED]="bell-slash",b[g.ACTIVE]="bell";m={list:D,listByStatus:function(t,e){return t=_.compact(_.map(t,function(t,e){return t?e:void 0})),t=_.map(t,function(t){return D(_objectSpread(_objectSpread({},e),{},{status:t}))}),u.all(t).then(i.combineLists)},listByDevices:function(t,e){return u.all(_.map(t,function(t){return e.source=t,D(e)})).then(i.combineLists)},getSeverityCount:function(t,e){return _.filter(t,{severity:e}).length},detail:function(t){return t=O(t),n.get(t)},update:w,updateBulk:function(t,e){var r=i.url(s);return n.put(r,e,{params:t})},create:C,save:function(t){return(t.id?w:C)(t)},acknowledgedBy:S(A),ackTime:S(T),alarmDuration:S(N),alarmDurationDiff:S(L),severity:m,severityList:p,getHighestSeverityFromAlarmsStatus:function(e){var t=_.map(y,function(t){return{severity:t,count:_.get(e,_.toLower(t),0)}}),t=_.find(t,function(t){return 0<t.count});return _.get(t,"severity",null)},status:g,statusList:d,statusText:S(function(t,e){var r;switch((t.status||"").toUpperCase()){case g.ACKNOWLEDGED:r=j;break;case g.CLEARED:r=I;break;case g.ACTIVE:r=P}return r&&r(t,e)}),icon:function(t){return t=(_.isObjectLike(t)?t.severity:t).toUpperCase(),b[t]},reports:{downtimeDuration:function(t){var e=R("downtimeDuration",t=i.timeOrderFilter(t));return n.get(e,{params:t})},downtimeDurationAggregation:function(t){var e=R("downtimeDuration/aggregation",t=i.timeOrderFilter(t));return n.get(e,{params:t})}},getDisplayCount:function(t){var e=i.url("".concat(s,"/count"));return n.get(e,{params:t}).then(i.getResData).then(function(t){return 99<t?"99+":t})},createCounter:function(t){var e,r,n=_.get(t,"source"),n="/alarms/".concat(n||"*"),n=new o.Counter(D,n);return t&&(e=[o.defaultPropertyMaps.date,o.defaultPropertyMaps.source],t.type&&(r=t.type,e.push([function(t){return r===t.type}])),delete t.type,n.filter(t,e)),n}};return t.enhanceWithKeysUtil({target:m,reservedKeys:["history","id","severity","self","source","creationTime","time","text","firstOccurrence","count","firstOccurrenceTime","status"],standardKeys:e})}t.$inject=["$http","c8yBase","c8yCounter","$q","c8yAudits","c8yUtil","gettext","gettextCatalog"],angular.module("c8y.core").factory("c8yAlarms",t)}();