@c8y/ng1-modules 1019.2.8 → 1019.4.8

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 (33) hide show
  1. package/NOTICES +344 -137
  2. package/administration-homeAdministration/home-administration.template.html +1 -1
  3. package/cockpit-smartRulesUI/index.js +1 -1
  4. package/core/core/services/geo.js +1 -1
  5. package/core/cumulocity.json +2 -0
  6. package/core/locales/de.po +6 -3
  7. package/core/locales/en.po +6 -0
  8. package/core/locales/es.po +366 -207
  9. package/core/locales/fr.po +6 -3
  10. package/core/locales/nl.po +6 -3
  11. package/core/locales/pl.po +66 -62
  12. package/core/locales/pt_BR.po +6 -3
  13. package/core/ui/devices/device-details.config.js +1 -0
  14. package/core/ui/groups/group-details.config.js +1 -0
  15. package/core/ui/services/util.js +1 -1
  16. package/core/ui/user/editUser.directive.html +1 -1
  17. package/core/ui/utils/guide-docs.directive.js +1 -1
  18. package/dataBroker/connectors/connectorEditor.html +2 -2
  19. package/devicemanagement-tracking/controllers/config.js +1 -0
  20. package/devicemanagement-tracking/controllers/tracking.js +1 -0
  21. package/devicemanagement-tracking/cumulocity.json +19 -0
  22. package/devicemanagement-tracking/index.js +1 -0
  23. package/devicemanagement-tracking/views/index.html +102 -0
  24. package/map/views/geofenceEdit.html +1 -1
  25. package/package.json +5 -5
  26. package/smartRules/controllers/list.js +1 -1
  27. package/smartRules/list/smartRulesList.component.js +1 -1
  28. package/applicationLinks/applications.controller.js +0 -1
  29. package/applicationLinks/cumulocity.json +0 -17
  30. package/applicationLinks/img/applications-widget-pr.png +0 -0
  31. package/applicationLinks/index.js +0 -1
  32. package/applicationLinks/style.css +0 -59
  33. package/applicationLinks/views/applications.html +0 -19
@@ -0,0 +1,102 @@
1
+ <div ng-controller="trackingCtrl as ctrl">
2
+ <c8y-ui-action-bar-set>
3
+ <c8y-realtime-switch
4
+ get-state="ctrl.map.state()"
5
+ on-start="ctrl.map.startRt()"
6
+ on-stop="ctrl.map.stopRt()"
7
+ ></c8y-realtime-switch>
8
+
9
+ <li class="navbar-form">
10
+ <form class="form-inline">
11
+ <div class="c8y-select-wrapper" ng-if="ctrl.showTrackingOptions">
12
+ <select
13
+ class="form-control"
14
+ ng-model="ctrl.trackingOption"
15
+ ng-change="ctrl.onTrackingOptionChange()"
16
+ >
17
+ <option value="all" translate>Show all data</option>
18
+ <option value="gps" translate>Show GPS data only</option>
19
+ <option value="gsm" translate>Show GSM data only</option>
20
+ </select>
21
+ <span></span>
22
+ </div>
23
+ <c8y-time-interval date-from="ctrl.dateFrom" date-to="ctrl.dateTo"></c8y-time-interval>
24
+ </form>
25
+ </li>
26
+ </c8y-ui-action-bar-set>
27
+
28
+ <div class="card content-fullpage card--grid grid__col--8-4--md">
29
+ <div
30
+ class="p-relative"
31
+ style="min-height: 30vh"
32
+ c8y-map-internal
33
+ map="ctrl.map"
34
+ marker-template="ctrl.markerTemplate"
35
+ c8y-legend="ctrl.legend"
36
+ device-id="ctrl.deviceId"
37
+ realtime="ctrl.realtime"
38
+ ></div>
39
+ <div class="d-flex d-col bg-inherit content-fullpage">
40
+ <div class="card-header separator">
41
+ <div class="card-title" translate>Tracking events</div>
42
+ </div>
43
+ <div class="inner-scroll">
44
+ <div class="card-block" ng-show="ctrl.events().length == 0">
45
+ <div class="c8y-empty-state text-left">
46
+ <div class="h1 c8y-icon c8y-icon-location c8y-icon-duocolor"></div>
47
+ <p>{{ 'No tracking events found' | translate }}</p>
48
+ </div>
49
+ </div>
50
+
51
+ <div class="card-block p-t-0 p-b-0">
52
+ <div class="list-group">
53
+ <div
54
+ class="list-group-item d-flex p-l-0 p-r-0"
55
+ ng-repeat="event in ctrl.events()"
56
+ ng-class="{ 'text-info': !!ctrl.markers['p' + $index] }"
57
+ ng-click="ctrl.toggle($index, event)"
58
+ >
59
+ <div class="list-item-icon">
60
+ <i c8y-icon="c8y-location"></i>
61
+ </div>
62
+ <div class="list-item-body">
63
+ <div class="d-flex">
64
+ <span class="m-r-8">
65
+ {{ event.time | date: 'mediumDate' }}
66
+ </span>
67
+ <span class="m-l-auto">
68
+ {{ event.time | date: 'mediumTime' }}
69
+ </span>
70
+ </div>
71
+
72
+ <span ng-if="ctrl.eventText">{{ event.text }}</span>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ <div>
79
+ <button
80
+ type="button"
81
+ title="{{ 'Load more' | translate }}"
82
+ class="btn btn-link fit-w sticky-bottom separator-top"
83
+ ng-click="ctrl.loadMore()"
84
+ ng-if="ctrl.hasLoadMore()"
85
+ >
86
+ {{ 'Load more' | translate }}
87
+ </button>
88
+ </div>
89
+ <div class="card-footer separator" ng-show="ctrl.events().length">
90
+ <button
91
+ title="{{ 'Deselect all markers' | translate }}"
92
+ type="button"
93
+ class="btn btn-default"
94
+ ng-disabled="ctrl.noMarkers"
95
+ ng-click="ctrl.hideAll()"
96
+ >
97
+ {{ 'Deselect all markers' | translate }}
98
+ </button>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ </div>
@@ -68,7 +68,7 @@
68
68
  title="{{ 'Save' | translate }}"
69
69
  class="btn btn-primary btn-block"
70
70
  ng-click="chooseGeofence()"
71
- ng-disabled="map.paths.geofencePath.latlngs.length < 3"
71
+ ng-disabled="map.paths.geofencePath.latlngs === undefined || map.paths.geofencePath.latlngs.length < 3"
72
72
  translate
73
73
  >
74
74
  Save
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1019.2.8",
3
+ "version": "1019.4.8",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -35,7 +35,7 @@
35
35
  "jquery": "3.6.3",
36
36
  "jquery-ui": "1.13.2",
37
37
  "leaflet": "1.7.1",
38
- "libphonenumber-js": "1.10.37",
38
+ "libphonenumber-js": "1.10.54",
39
39
  "lodash": "4.17.21",
40
40
  "moment": "2.29.4",
41
41
  "ng-csv": "0.3.6",
@@ -45,14 +45,14 @@
45
45
  "payment": "2.4.6",
46
46
  "tv4": "1.3.0",
47
47
  "ui-select": "0.19.8",
48
- "xterm": "5.2.1",
49
- "xterm-addon-fit": "0.7.0",
48
+ "xterm": "5.3.0",
49
+ "xterm-addon-fit": "0.8.0",
50
50
  "zip-js": "0.0.3",
51
51
  "dompurify": "2.2.9"
52
52
  },
53
53
  "devDependencies": {
54
54
  "jest-junit": "16.0.0",
55
- "fs-extra": "^11.1.0",
55
+ "fs-extra": "^11.2.0",
56
56
  "npm-packlist": "1.1.11",
57
57
  "@babel/plugin-syntax-dynamic-import": "7.8.3",
58
58
  "uglify-js": "3.17.4"
@@ -1 +1 @@
1
- "use strict";!function(){function e(i,r,e,o,t,n,c,j,a,u,l,s,d,f,h,g,v,m){var p,S=r.deviceId||r.groupId,A={},R={},y={done:!1,inProgress:!1},x={true:{text:v("Active"),icon:"check-circle",cls:"text-success"},false:{text:v("Inactive"),icon:"ban",cls:"text-danger"}},b=s.getContext(),C=v("Global smart rules");function I(){return o.when().then(w).then(M).then(N).then(U).then(E).catch(D)}function w(){y.inProgress=!0}function E(){y.inProgress=!1,y.done=!0,y.error=!1}function D(e){e.data&&e.data.message&&l.danger(e.data.message),y.inProgress=!1,y.done=!0,y.error=!0}function M(){return h.list().then(T)}function T(e){_.forEach(e||[],function(e){A[e.name]=e})}function N(){var e=S?g.listByContext(S):o.resolve([]),t=f.hasPermissions().then(function(e){return e?g.list():o.when([])});return o.all({listByContext:e,list:t}).then(function(e){i.rules=function(e){var t=e;S&&(t=_.reject(e,function(e){var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return O(e)&&!n.test(t)}}(S)));return t}(_.concat(e.listByContext,e.list))})}function O(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function L(e){return g.hasSource(e,S)}function U(){var e;return Array.isArray(i.rules)&&0<i.rules.length&&null!==(e=s.getContext()).context?c.childAssets(e.id,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}).then(function(e){i.children=e}).then(function(){i.ruleChildren={},_.forEach(i.rules,function(e){i.ruleChildren[e.id]=P(e)})}):o.resolve()}function P(t){return _.filter(i.children,function(e){return g.hasSource(t,e)})}_.assign(i,{isOpen:{},moId:S,loadingStatus:y,refresh:I,paging:{refresh:I},ruleTemplates:A,getLinkToDM:function(){var e={deviceId:S};return t(p||"")(e)},add:function(){g.addNewWithUI().then(I)},edit:function(e){g.editWithUI(e).then(I)},clone:function(e){g.cloneWithUI(e).then(I)},remove:function(e){u({title:v("Delete smart rule"),body:m.getString('You are about to delete smart rule "{{name}}". Do you want to proceed?',e),labels:{ok:v("Delete")},status:"danger"}).then(angular.bind(g,g.remove,e)).then(function(){return _.pull(i.rules,e)}).then(function(){return l.success(v("Smart rule deleted."))})},hasSource:L,getChildrenEnabledForSmartRule:P,toggleRuleActivationForContextMO:function(e){if(L(e))return g.deactivate(e,S,!1).then(function(){l.success(m.getString('Smart rule "{{name}}" deactivated.',e))});return g.activate(e,S,!1).then(function(){l.success(m.getString('Smart rule "{{name}}" activated.',e))})},toggleRuleActivationForChildrenMOs:function(e,n){var t=_.filter(n,function(t){return!_.find(i.ruleChildren[e.id],function(e){return e.id===t.id})}),r=_.filter(i.ruleChildren[e.id],function(t){return!_.find(n,function(e){return t.id===e.id})});return g.updateSources(e,t,r,!1).then(N).then(U).then(function(){l.success(m.getString('Smart rule "{{name}}" activated/deactivated for children.',e))})},tooltip:function(e){var t={activate:{"for group":v("Activate for this group"),"for device":v("Activate for this device"),"for object":v("Activate for this object")},deactivate:{"for group":v("Deactivate for this group"),"for device":v("Deactivate for this device"),"for object":v("Deactivate for this object")}},e=e.enabled&&L(e)?"deactivate":"activate",n=r.groupId?"group":"object";return n=r.deviceId?"device":n,t[e]["for ".concat(n)]},type:function(e){var t,e=A[e.ruleTemplateName];e&&(t=e.label.full?m.getString(e.label.full):"".concat(m.getString(e.label.input)," ").concat(m.getString(e.label.output)));return t},status:function(e){return x[e.enabled].text},statusIcon:function(e){return x[e.enabled].icon},statusClass:function(e){return x[e.enabled].cls},showTitle:function(){return null!==s.getContext().context},title:C,context:b,inputIcon:function(e){var t,e=A[e.ruleTemplateName];e&&(t=e.paramGroups.input.icon);return t},outputIcon:function(e){var t,e=A[e.ruleTemplateName];e&&(t=e.paramGroups.output.icon);return t},canAddRules:function(e){var t=_.get(A,"".concat(_.get(e,"ruleTemplateName"),"._active")),n=R.canAddRules;e&&!t&&(n=!1);_.isUndefined(n)&&(e=i.context?a.isAllowed({adminMOs:[i.context.id]}):o.all({isAllowedInventory:a.isAllowed({anyRole:["ROLE_INVENTORY_ADMIN","ROLE_MANAGED_OBJECT_ADMIN"]}),isAllowedSmartRules:a.isAllowed({anyRole:["ROLE_SMARTRULE_ADMIN","ROLE_CEP_MANAGEMENT_ADMIN"]})}).then(function(e){var t=e.isAllowedInventory,e=e.isAllowedSmartRules;return t&&e}),R.canAddRules=e.then(function(e){return R.canAddRules=e,R.canAddRules}),n=!1);return n},canModify:function(t){R.rules=R.rules||{};var n=R.rules,e=n[t.id];_.isUndefined(e)&&(n[t.id]=a.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1);return e},canApplyOnChildren:function(e){return!O(e)},canSeeSection:function(){var e=R.canSeeSection;_.isUndefined(e)&&(R.canSeeSection=(n.checkIfModulesExist(["c8y.cockpit.config"])?f.shouldShowLocalSmartRules():o.when(!1)).then(function(e){return R.canSeeSection=e,R.canSeeSection}),e=!1);return e},isConfigurationGlobalSmartRulesContext:void 0}),i.isConfigurationGlobalSmartRulesContext=e.path().includes("/rules"),I(),null===s.getContext().context&&d.changeTitle({title:C}),"device"===b.context&&n.getStaticLinkTemplate("devicemanagementDeviceDetails").then(function(e){p=e})}e.$inject=["$scope","$routeParams","$location","$q","$interpolate","c8yBase","c8yInventory","c8yApplication","c8yPermissions","c8yModal","c8yAlert","c8yUiUtil","c8yTitle","c8ySmartRulesAvailability","smartRuleTemplatesSvc","smartRulesSvc","gettext","gettextCatalog"],angular.module("c8y.smartRules").controller("SmartRulesListCtrl",e)}();
1
+ "use strict";!function(){function e(i,r,e,o,t,n,a,j,c,u,l,s,d,f,h,g,v,m){var p,S=r.deviceId||r.groupId,A={},R={},b={done:!1,inProgress:!1},y={true:{text:v("Enabled`rule`"),icon:"check-circle",cls:"text-success"},false:{text:v("Disabled`rule`"),icon:"ban",cls:"text-danger"}},x=s.getContext(),C=v("Global smart rules");function I(){return o.when().then(E).then(M).then(N).then(U).then(w).catch(D)}function E(){b.inProgress=!0}function w(){b.inProgress=!1,b.done=!0,b.error=!1}function D(e){e.data&&e.data.message&&l.danger(e.data.message),b.inProgress=!1,b.done=!0,b.error=!0}function M(){return h.list().then(T)}function T(e){_.forEach(e||[],function(e){A[e.name]=e})}function N(){var e=S?g.listByContext(S):o.resolve([]),t=f.hasPermissions().then(function(e){return e?g.list():o.when([])});return o.all({listByContext:e,list:t}).then(function(e){i.rules=function(e){var t=e;S&&(t=_.reject(e,function(e){var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return O(e)&&!n.test(t)}}(S)));return t}(_.concat(e.listByContext,e.list))})}function O(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function L(e){return g.hasSource(e,S)}function U(){var e;return Array.isArray(i.rules)&&0<i.rules.length&&null!==(e=s.getContext()).context?a.childAssets(e.id,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}).then(function(e){i.children=e}).then(function(){i.ruleChildren={},_.forEach(i.rules,function(e){i.ruleChildren[e.id]=P(e)})}):o.resolve()}function P(t){return _.filter(i.children,function(e){return g.hasSource(t,e)})}_.assign(i,{isOpen:{},moId:S,loadingStatus:b,refresh:I,paging:{refresh:I},ruleTemplates:A,getLinkToDM:function(){var e={deviceId:S};return t(p||"")(e)},add:function(){g.addNewWithUI().then(I)},edit:function(e){g.editWithUI(e).then(I)},clone:function(e){g.cloneWithUI(e).then(I)},remove:function(e){u({title:v("Delete smart rule"),body:m.getString('You are about to delete smart rule "{{name}}". Do you want to proceed?',e),labels:{ok:v("Delete")},status:"danger"}).then(angular.bind(g,g.remove,e)).then(function(){return _.pull(i.rules,e)}).then(function(){return l.success(v("Smart rule deleted."))})},hasSource:L,getChildrenEnabledForSmartRule:P,toggleRuleActivationForContextMO:function(e){if(L(e))return g.deactivate(e,S,!1).then(function(){l.success(m.getString('Smart rule "{{name}}" deactivated.',e))});return g.activate(e,S,!1).then(function(){l.success(m.getString('Smart rule "{{name}}" activated.',e))})},toggleRuleActivationForChildrenMOs:function(e,n){var t=_.filter(n,function(t){return!_.find(i.ruleChildren[e.id],function(e){return e.id===t.id})}),r=_.filter(i.ruleChildren[e.id],function(t){return!_.find(n,function(e){return t.id===e.id})});return g.updateSources(e,t,r,!1).then(N).then(U).then(function(){l.success(m.getString('Smart rule "{{name}}" activated/deactivated for children.',e))})},tooltip:function(e){var t={activate:{"for group":v("Activate for this group"),"for device":v("Activate for this device"),"for object":v("Activate for this object")},deactivate:{"for group":v("Deactivate for this group"),"for device":v("Deactivate for this device"),"for object":v("Deactivate for this object")}},e=e.enabled&&L(e)?"deactivate":"activate",n=r.groupId?"group":"object";return n=r.deviceId?"device":n,t[e]["for ".concat(n)]},type:function(e){var t,e=A[e.ruleTemplateName];e&&(t=e.label.full?m.getString(e.label.full):"".concat(m.getString(e.label.input)," ").concat(m.getString(e.label.output)));return t},status:function(e){return y[e.enabled].text},statusIcon:function(e){return y[e.enabled].icon},statusClass:function(e){return y[e.enabled].cls},showTitle:function(){return null!==s.getContext().context},title:C,context:x,inputIcon:function(e){var t,e=A[e.ruleTemplateName];e&&(t=e.paramGroups.input.icon);return t},outputIcon:function(e){var t,e=A[e.ruleTemplateName];e&&(t=e.paramGroups.output.icon);return t},canAddRules:function(e){var t=_.get(A,"".concat(_.get(e,"ruleTemplateName"),"._active")),n=R.canAddRules;e&&!t&&(n=!1);_.isUndefined(n)&&(e=i.context?c.isAllowed({adminMOs:[i.context.id]}):o.all({isAllowedInventory:c.isAllowed({anyRole:["ROLE_INVENTORY_ADMIN","ROLE_MANAGED_OBJECT_ADMIN"]}),isAllowedSmartRules:c.isAllowed({anyRole:["ROLE_SMARTRULE_ADMIN","ROLE_CEP_MANAGEMENT_ADMIN"]})}).then(function(e){var t=e.isAllowedInventory,e=e.isAllowedSmartRules;return t&&e}),R.canAddRules=e.then(function(e){return R.canAddRules=e,R.canAddRules}),n=!1);return n},canModify:function(t){R.rules=R.rules||{};var n=R.rules,e=n[t.id];_.isUndefined(e)&&(n[t.id]=c.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1);return e},canApplyOnChildren:function(e){return!O(e)},canSeeSection:function(){var e=R.canSeeSection;_.isUndefined(e)&&(R.canSeeSection=(n.checkIfModulesExist(["c8y.cockpit.config"])?f.shouldShowLocalSmartRules():o.when(!1)).then(function(e){return R.canSeeSection=e,R.canSeeSection}),e=!1);return e},isConfigurationGlobalSmartRulesContext:void 0}),i.isConfigurationGlobalSmartRulesContext=e.path().includes("/rules"),I(),null===s.getContext().context&&d.changeTitle({title:C}),"device"===x.context&&n.getStaticLinkTemplate("devicemanagementDeviceDetails").then(function(e){p=e})}e.$inject=["$scope","$routeParams","$location","$q","$interpolate","c8yBase","c8yInventory","c8yApplication","c8yPermissions","c8yModal","c8yAlert","c8yUiUtil","c8yTitle","c8ySmartRulesAvailability","smartRuleTemplatesSvc","smartRulesSvc","gettext","gettextCatalog"],angular.module("c8y.smartRules").controller("SmartRulesListCtrl",e)}();
@@ -1 +1 @@
1
- "use strict";!function(){function e(e,r,i,t,n,o,a,c,u,l,s,d,f,h){var m=this,v={},g={},p={done:!1,inProgress:!1},A={true:{text:f("Active`rule`"),icon:"check-circle",cls:"text-success"},false:{text:f("Inactive`rule`"),icon:"ban",cls:"text-warning"}};function S(){return i.when().then(R).then(C).then(I).then(N).then(b).catch(y)}function R(){p.inProgress=!0}function b(){p.inProgress=!1,p.done=!0,p.error=!1}function y(e){e.data&&e.data.message&&c.danger(e.data.message),p.inProgress=!1,p.done=!0,p.error=!0}function C(){return s.list().then(E)}function E(e){_.forEach(e,function(e){v[e.name]=e})}function I(){var e=m.mo?d.listByContext(m.mo):i.resolve([]),t=l.hasPermissions().then(function(e){return e?d.list():i.when([])});return i.all({listByContext:e,list:t}).then(function(e){m.rules=function(e){m.mo&&(e=_.reject(e,function(e){var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return x(e)&&!n.test(t)}}(m.mo)));m.filter&&(e=_.filter(e,m.filter));return e}(_.concat(e.listByContext,e.list)),"function"==typeof m.onRules&&m.onRules()(m.rules)})}function x(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function w(e){return d.hasSource(e,m.mo)}function N(){var e,t;return Array.isArray(m.rules)&&0<m.rules.length&&(e=u.getContext(),t=function(e){e=e.id;return m.mo?_.get(m,"mo.id")||m.mo:e}(e),null!==e.context)?n.childAssets(t,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}).then(function(e){m.children=e}).then(function(){m.ruleChildren={},_.forEach(m.rules,function(e){m.ruleChildren[e.id]=M(e)})}):i.resolve()}function M(t){return _.filter(m.children,function(e){return t.enabled&&d.hasSource(t,e)})}_.assign(m,{ruleTemplates:v,loadingStatus:p,isOpen:{},listClass:"interact-list",$onInit:function(){e.$on("smartRulesListReload",S),S()},add:function(){d.addNewWithUI().then(S)},edit:function(e){d.editWithUI(e).then(S)},clone:function(e){d.cloneWithUI(e).then(S)},remove:function(e){t({title:f("Delete smart rule"),body:h.getString('You are about to delete smart rule "{{name}}". Do you want to proceed?',e),status:"danger",labels:{ok:f("Delete")}}).then(d.remove.bind(d,e)).then(function(){return _.pull(m.rules,e)}).then(function(){return c.success(f("Smart rule deleted."))})},hasSource:w,getChildrenEnabledForSmartRule:M,toggleRuleActivationForContextMO:function(e){if(e.enabled&&w(e))return d.deactivate(e,m.mo,!1).then(function(){c.success(h.getString('Smart rule "{{name}}" deactivated.',e))});return d.activate(e,m.mo,!1).then(function(){c.success(h.getString('Smart rule "{{name}}" activated.',e))})},toggleRuleActivationForChildrenMOs:function(t,n){var r=[];return _.forEach(n,function(e){_.find(m.ruleChildren[t.id],{id:e.id})||r.push(d.activate(t,e,!1))}),_.forEach(m.ruleChildren[t.id],function(e){_.find(n,{id:e.id})||r.push(d.deactivate(t,e,!1))}),i.all(r).then(I).then(N).then(function(){c.success(h.getString('Smart rule "{{name}}" activated/deactivated for children.',t))})},tooltip:function(e){var t,n={activate:{"for group":f("Activate for this group."),"for device":f("Activate for this device."),"for object":f("Activate for this object.")},deactivate:{"for group":f("Deactivate for this group."),"for device":f("Deactivate for this device."),"for object":f("Deactivate for this object.")}},e=e.enabled&&w(e)?"deactivate":"activate";t=r.deviceId?"device":r.groupId?"group":"object";return n[e]["for ".concat(t)]},type:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.label.full?h.getString(e.label.full):"".concat(h.getString(e.label.input)," ").concat(h.getString(e.label.output)));return t},status:function(e){return A[e.enabled].text},statusIcon:function(e){return A[e.enabled].icon},statusClass:function(e){return A[e.enabled].cls},context:u.getContext(),inputIcon:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.paramGroups.input.icon);return t},outputIcon:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.paramGroups.output.icon);return t},canAddRules:function(){var e,t=g.canAddRules;_.isUndefined(t)&&(e=m.context?a.isAllowed({adminMOs:[m.context.id]}):i.all({isAllowedInventory:a.isAllowed({anyRole:["ROLE_INVENTORY_ADMIN","ROLE_MANAGED_OBJECT_ADMIN"]}),isAllowedSmartRules:a.isAllowed({anyRole:["ROLE_SMARTRULE_ADMIN","ROLE_CEP_MANAGEMENT_ADMIN"]})}).then(function(e){var t=e.isAllowedInventory,e=e.isAllowedSmartRules;return t&&e}),g.canAddRules=e.then(function(e){return g.canAddRules=e,g.canAddRules}),t=!1);return t},canModify:function(t){g.rules=g.rules||{};var n=g.rules,e=n[t.id];_.isUndefined(e)&&(n[t.id]=a.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1);return e},canApplyOnChildren:function(e){return!x(e)},canSeeSection:function(){var e=g.canSeeSection;_.isUndefined(e)&&(g.canSeeSection=l.shouldShowLocalSmartRules().then(function(e){return g.canSeeSection=e,g.canSeeSection}),e=!1);return e}}),_.assign(e,{refresh:S,paging:{refresh:S}})}e.$inject=["$scope","$routeParams","$q","c8yModal","c8yInventory","c8yApplication","c8yPermissions","c8yAlert","c8yUiUtil","c8ySmartRulesAvailability","smartRuleTemplatesSvc","smartRulesSvc","gettext","gettextCatalog"],angular.module("c8y.smartRules").component("smartRulesList",{bindings:{mo:"<?",filter:"<?",disableEditAndCreate:"<?",onRules:"&?"},templateUrl:":::PLUGIN_PATH:::/list/smartRulesList.html",controller:e,controllerAs:"vm"})}();
1
+ "use strict";!function(){function e(e,r,i,t,n,o,a,c,u,l,s,d,f,h){var m=this,v={},g={},p={done:!1,inProgress:!1},A={true:{text:f("Active`rule`"),icon:"check-circle",cls:"text-success"},false:{text:f("Inactive`rule`"),icon:"ban",cls:"text-warning"}};function S(){return i.when().then(R).then(C).then(I).then(N).then(b).catch(y)}function R(){p.inProgress=!0}function b(){p.inProgress=!1,p.done=!0,p.error=!1}function y(e){e.data&&e.data.message&&c.danger(e.data.message),p.inProgress=!1,p.done=!0,p.error=!0}function C(){return s.list().then(E)}function E(e){_.forEach(e,function(e){v[e.name]=e})}function I(){var e=m.mo?d.listByContext(m.mo):i.resolve([]),t=l.hasPermissions().then(function(e){return e?d.list():i.when([])});return i.all({listByContext:e,list:t}).then(function(e){m.rules=function(e){m.mo&&(e=_.reject(e,function(e){var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return x(e)&&!n.test(t)}}(m.mo)));m.filter&&(e=_.filter(e,m.filter));return e}(_.concat(e.listByContext,e.list)),"function"==typeof m.onRules&&m.onRules()(m.rules)})}function x(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function w(e){return d.hasSource(e,m.mo)}function N(){var e,t;return Array.isArray(m.rules)&&0<m.rules.length&&(e=u.getContext(),t=function(e){e=e.id;return m.mo?_.get(m,"mo.id")||m.mo:e}(e),null!==e.context)?n.childAssets(t,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}).then(function(e){m.children=e}).then(function(){m.ruleChildren={},_.forEach(m.rules,function(e){m.ruleChildren[e.id]=M(e)})}):i.resolve()}function M(t){return _.filter(m.children,function(e){return t.enabled&&d.hasSource(t,e)})}_.assign(m,{ruleTemplates:v,loadingStatus:p,isOpen:{},listClass:"interact-list",$onInit:function(){e.$on("smartRulesListReload",S),S()},add:function(){d.addNewWithUI().then(S)},edit:function(e){d.editWithUI(e).then(S)},clone:function(e){d.cloneWithUI(e).then(S)},remove:function(e){t({title:f("Delete smart rule"),body:h.getString('You are about to delete smart rule "{{name}}". Do you want to proceed?',e),status:"danger",labels:{ok:f("Delete")}}).then(d.remove.bind(d,e)).then(function(){return _.pull(m.rules,e)}).then(function(){return c.success(f("Smart rule deleted."))})},hasSource:w,getChildrenEnabledForSmartRule:M,toggleRuleActivationForContextMO:function(e){if(e.enabled&&w(e))return d.deactivate(e,m.mo,!1).then(function(){c.success(h.getString('Smart rule "{{name}}" deactivated.',e))});return d.activate(e,m.mo,!1).then(function(){c.success(h.getString('Smart rule "{{name}}" activated.',e))})},toggleRuleActivationForChildrenMOs:function(t,n){var r=[];return _.forEach(n,function(e){_.find(m.ruleChildren[t.id],{id:e.id})||r.push(d.activate(t,e,!1))}),_.forEach(m.ruleChildren[t.id],function(e){_.find(n,{id:e.id})||r.push(d.deactivate(t,e,!1))}),i.all(r).then(I).then(N).then(function(){c.success(h.getString('Smart rule "{{name}}" activated/deactivated for children.',t))})},tooltip:function(e){var t,n={activate:{"for group":f("Activate for this group."),"for device":f("Activate for this device."),"for object":f("Activate for this object.")},deactivate:{"for group":f("Deactivate for this group."),"for device":f("Deactivate for this device."),"for object":f("Deactivate for this object.")}},e=e.enabled&&w(e)?"deactivate":"activate";t=r.deviceId?"device":r.groupId?"group":"object";return n[e]["for ".concat(t)]},type:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.label.full?h.getString(e.label.full):"".concat(h.getString(e.label.input)," ").concat(h.getString(e.label.output)));return t},status:function(e){e=e.enabled&&w(e);return A[e].text},statusIcon:function(e){e=e.enabled&&w(e);return A[e].icon},statusClass:function(e){e=e.enabled&&w(e);return A[e].cls},context:u.getContext(),inputIcon:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.paramGroups.input.icon);return t},outputIcon:function(e){var t,e=v[e.ruleTemplateName];e&&(t=e.paramGroups.output.icon);return t},canAddRules:function(){var e,t=g.canAddRules;_.isUndefined(t)&&(e=m.context?a.isAllowed({adminMOs:[m.context.id]}):i.all({isAllowedInventory:a.isAllowed({anyRole:["ROLE_INVENTORY_ADMIN","ROLE_MANAGED_OBJECT_ADMIN"]}),isAllowedSmartRules:a.isAllowed({anyRole:["ROLE_SMARTRULE_ADMIN","ROLE_CEP_MANAGEMENT_ADMIN"]})}).then(function(e){var t=e.isAllowedInventory,e=e.isAllowedSmartRules;return t&&e}),g.canAddRules=e.then(function(e){return g.canAddRules=e,g.canAddRules}),t=!1);return t},canModify:function(t){g.rules=g.rules||{};var n=g.rules,e=n[t.id];_.isUndefined(e)&&(n[t.id]=a.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1);return e},canApplyOnChildren:function(e){return!x(e)},canSeeSection:function(){var e=g.canSeeSection;_.isUndefined(e)&&(g.canSeeSection=l.shouldShowLocalSmartRules().then(function(e){return g.canSeeSection=e,g.canSeeSection}),e=!1);return e}}),_.assign(e,{refresh:S,paging:{refresh:S}})}e.$inject=["$scope","$routeParams","$q","c8yModal","c8yInventory","c8yApplication","c8yPermissions","c8yAlert","c8yUiUtil","c8ySmartRulesAvailability","smartRuleTemplatesSvc","smartRulesSvc","gettext","gettextCatalog"],angular.module("c8y.smartRules").component("smartRulesList",{bindings:{mo:"<?",filter:"<?",disableEditAndCreate:"<?",onRules:"&?"},templateUrl:":::PLUGIN_PATH:::/list/smartRulesList.html",controller:e,controllerAs:"vm"})}();
@@ -1 +0,0 @@
1
- "use strict";angular.module("c8y.welcome.applications").controller("ApplicationsCtrl",["$scope","c8yApplication","DEFAULT_APP_ICON",function(t,n,e){var i,o=_.merge({},window.C8Y_APP&&window.C8Y_APP.C8Y_INSTANCE_OPTIONS,window.C8Y_INSTANCE_OPTIONS).default_icon||e,c=_.merge({},window.C8Y_APP&&window.C8Y_APP.C8Y_INSTANCE_OPTIONS,window.C8Y_INSTANCE_OPTIONS).target,r={dt:["HelpAndService"]};function a(n){i=n.name}function l(n){return n.name!==i}function u(n){return!_.includes(r[c],n.contextPath)}function P(n){var t;return n.iconSrc=(t=n).contextPath&&["/apps",t.contextPath,"icon.svg"].join("/")||o,n}t.getHref=angular.bind(n,n.getHref),n.getCurrent().then(a).then(function(){n.listByVisibleLinks().then(function(n){t.applications=_.map(_(n).filter(l).filter(u).value(),P)})})}]);
@@ -1,17 +0,0 @@
1
- {
2
- "name": "Applications component",
3
- "ngModules": [
4
- "c8y.welcome.applications"
5
- ],
6
- "category": "",
7
- "icon": "dashboard",
8
- "color": "#F03F0F",
9
- "description": "A component with quick links to applications",
10
- "js": [
11
- "index.js",
12
- "applications.controller.js"
13
- ],
14
- "copy": [
15
- "img/*"
16
- ]
17
- }
@@ -1 +0,0 @@
1
- "use strict";!function(){function i(i,t,e){_.merge({},window.C8Y_APP&&window.C8Y_APP.C8Y_INSTANCE_OPTIONS,window.C8Y_INSTANCE_OPTIONS).default_icon;i.add({name:"Applications",nameDisplay:t("Applications"),description:t("Displays the list of links to available applications."),templateUrl:":::PLUGIN_PATH:::/views/applications.html",previewImage:":::PLUGIN_PATH:::/img/applications-widget-pr.png",options:{noDeviceTarget:!0,widgetDefaults:{_width:16,_height:5}}})}i.$inject=["c8yComponentsProvider","gettext","DEFAULT_APP_ICON"],angular.module("c8y.welcome.applications",[]).constant("DEFAULT_APP_ICON","core/img/default_icon.svg").config(i)}();
@@ -1,59 +0,0 @@
1
- /*a.applications-app {
2
- background-color: white;
3
- cursor: pointer;
4
- margin: 0 2px 2px;
5
- height: 94px;
6
- float: left;
7
- color: #989e9f;
8
- text-align: center;
9
- text-decoration: none;
10
- width: 24.2%;
11
- }
12
-
13
- a.applications-app svg {
14
- width: 27%;
15
- }
16
-
17
- a.applications-app:hover {
18
- opacity: 0.7;
19
- }
20
-
21
- a.applications-app > div {
22
- position: relative;
23
- top: 50%;
24
- transform: translateY(-50%);
25
- }
26
-
27
- div.img-onload-error img {
28
- display: none;
29
- }
30
-
31
- @media (max-width: 1920px) {
32
- a.applications-app {
33
- width: 24.74%;
34
- }
35
-
36
- a.applications-app img {
37
- width: 20%;
38
- }
39
- }
40
-
41
- @media (max-width: 768px) {
42
- a.applications-app {
43
- width: 48.22%;
44
- }
45
-
46
- a.applications-app img {
47
- width: 20%;
48
- }
49
- }
50
-
51
- @media (max-width: 320px) {
52
- a.applications-app {
53
- width: 100%;
54
- }
55
-
56
- a.applications-app img {
57
- width: 26%;
58
- }
59
- }*/
@@ -1,19 +0,0 @@
1
- <div ng-controller="ApplicationsCtrl" class="card-group-block interact-grid j-c-evenly">
2
- <a
3
- class="card text-center"
4
- style="min-width:130px; flex: 1 0 130px;"
5
- ng-href="{{::getHref(app)}}"
6
- title="{{::app | humanizeAppName}}"
7
- ng-repeat="app in applications"
8
- >
9
- <div class="card-block ">
10
- <c8y-app-icon app="::app" class="icon-40"></c8y-app-icon>
11
- <p
12
- class="text-truncate-wrap max-width-100"
13
- title="{{::app | humanizeAppName}}"
14
- >
15
- {{::app | humanizeAppName}}
16
- </p>
17
- </div>
18
- </a>
19
- </div>