@c8y/ng1-modules 1018.505.8 → 1018.509.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/administration-archivesEditor/views/index.html +1 -1
- package/binaryArtefactsManagement/index.js +1 -1
- package/binaryArtefactsManagement/views/list.html +1 -1
- package/cockpit-smartRulesUI/index.js +1 -1
- package/commandTemplates/controllers/commandTemplates.js +1 -1
- package/core/core/services/deviceShell.js +1 -1
- package/core/core/services/dynamicGroups.js +1 -1
- package/core/core/services/groups.js +1 -1
- package/core/core/services/permissions.js +1 -1
- package/core/core/services/userPreferences.js +1 -1
- package/core/locales/pl.po +301 -146
- package/core/ui/services/groupsHierarchySvc.js +1 -1
- package/core/ui/user/measurementUnitPreference.component.js +1 -1
- package/dashboard2/dashboard.service.js +1 -1
- package/device-protocol-lwm2m/lwm2mDetail.html +2 -2
- package/deviceDatabase4/device-database.service.js +1 -1
- package/deviceDatabase4/device-type-list.html +1 -1
- package/deviceDatabase4/modals/configure-register.component.js +1 -1
- package/deviceGroupAssignment/groupAssignment.component.js +1 -1
- package/deviceSelector/views/deviceSelectorCombo.html +1 -1
- package/devicemanagement-availability/index.js +1 -1
- package/devicemanagement-logViewer/views/index.html +1 -0
- package/enterpriseEdition/enterpriseEdition.module.js +1 -1
- package/export/directives/timespan.js +1 -1
- package/export/views/timespan.html +12 -27
- package/kpi/views/graphConfig.html +2 -2
- package/kpi/views/setup.html +1 -1
- package/package.json +1 -1
- package/smartRules/controllers/list.js +1 -1
- package/smartRules/list/smartRulesList.component.js +1 -1
- package/smartRules/services/smartRules.js +1 -1
|
@@ -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,
|
|
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 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(i,u,o,r,n,a,t,c,l,s){var d=o.url("service/smartrule"),f="".concat(d,"/smartrules"),h=["id","self","cepModuleId","lastUpdated","creationTime"],p=["type","cepModuleId","creationTime","lastUpdated"];return{permissionsCfgs:{create:[{anyRole:["ROLE_INVENTORY_ADMIN","ROLE_INVENTORY_CREATE"]},{anyRole:["ROLE_CEP_MANAGEMENT_ADMIN","ROLE_SMARTRULE_ADMIN"]}]},getEmpty:function(e){var e=e||n.getContext(),t={type:"c8y_SmartRule",name:"",enabled:!0,config:{}};e.context&&e.id&&(t.c8y_Context=e,t.type="c8y_PrivateSmartRule");return t},list:function(){return u.get(f).then(o.getResData).then(_.property("rules")).then(m)},listByContext:function(e){return u.get(S({moId:e})).then(o.getResData).then(_.property("rules")).then(m)},detail:function(e){e=v({id:e});return u.get(e).then(o.getResData)},save:function(e,t,n){e=e.id?g(e):function(e,t,n){var r=v(e,!0);return function(e,t,n){return e.ruleTemplateName=t.name,function(e,t){var n=i.when(e);e.c8y_Context||t.mo?(e.enabledSources=[],e.disabledSources=void 0,n=y(e,t.mo,t.withChildren)):(e.enabledSources=void 0,e.disabledSources=[]);return n}(e,n)}(e,t,n).then(_.partial(u.post,r)).then(o.getResData)}(e,t,n);return e},remove:function(e){e=v(e,!0);return u.delete(e)},hasSource:function(e,t){t=t&&t.id||t;if(!t)return!1;if(e.disabledSources)return!R(e.disabledSources,t);if(e.enabledSources)return R(e.enabledSources,t);return!0},activate:function(e,t,n){return y(e,t,n).then(g)},deactivate:function(e,t,n){return b(e,t,n).then(g)},updateSources:function(e,t,r,u){return function(e,t,n){return t.reduce(function(e,t){return e.then(function(e){return y(e,t,n)})},i.resolve(e))}(e,t,u).then(function(e){return n=u,r.reduce(function(e,t){return e.then(function(e){return b(e,t,n)})},i.resolve(e));var n}).then(g)},addNewWithUI:
|
|
1
|
+
"use strict";!function(){function e(i,u,o,r,n,a,t,c,l,s){var d=o.url("service/smartrule"),f="".concat(d,"/smartrules"),h=["id","self","cepModuleId","lastUpdated","creationTime"],p=["type","cepModuleId","creationTime","lastUpdated"];return{permissionsCfgs:{create:[{anyRole:["ROLE_INVENTORY_ADMIN","ROLE_INVENTORY_CREATE","ROLE_MANAGED_OBJECT_ADMIN","ROLE_MANAGED_OBJECT_CREATE"]},{anyRole:["ROLE_CEP_MANAGEMENT_ADMIN","ROLE_SMARTRULE_ADMIN"]}]},getEmpty:function(e){var e=e||n.getContext(),t={type:"c8y_SmartRule",name:"",enabled:!0,config:{}};e.context&&e.id&&(t.c8y_Context=e,t.type="c8y_PrivateSmartRule");return t},list:function(){return u.get(f).then(o.getResData).then(_.property("rules")).then(m)},listByContext:function(e){return u.get(S({moId:e})).then(o.getResData).then(_.property("rules")).then(m)},detail:function(e){e=v({id:e});return u.get(e).then(o.getResData)},save:function(e,t,n){e=e.id?g(e):function(e,t,n){var r=v(e,!0);return function(e,t,n){return e.ruleTemplateName=t.name,function(e,t){var n=i.when(e);e.c8y_Context||t.mo?(e.enabledSources=[],e.disabledSources=void 0,n=y(e,t.mo,t.withChildren)):(e.enabledSources=void 0,e.disabledSources=[]);return n}(e,n)}(e,t,n).then(_.partial(u.post,r)).then(o.getResData)}(e,t,n);return e},remove:function(e){e=v(e,!0);return u.delete(e)},hasSource:function(e,t){t=t&&t.id||t;if(!t)return!1;if(e.disabledSources)return!R(e.disabledSources,t);if(e.enabledSources)return R(e.enabledSources,t);return!0},activate:function(e,t,n){return y(e,t,n).then(g)},deactivate:function(e,t,n){return b(e,t,n).then(g)},updateSources:function(e,t,r,u){return function(e,t,n){return t.reduce(function(e,t){return e.then(function(e){return y(e,t,n)})},i.resolve(e))}(e,t,u).then(function(e){return n=u,r.reduce(function(e,t){return e.then(function(e){return b(e,t,n)})},i.resolve(e));var n}).then(g)},addNewWithUI:A,addNewForInputAlarmAndOutputUserWithUI:function(e,t){return A({inputAlarm:e,outputUser:t})},addNewForInputDataPointWithUI:function(e){return A({inputDataPoint:e})},addNewForOutputOperationWithUI:function(e){return A({outputOperation:{template:function(e){return o.cleanFields(e,["id","self","status","deviceId","creationTime","failureReason"])}(e)}})},createInstanceWithUI:E,createInstanceWithUIByName:function(e,t){return c.getTemplateByName(e).then(function(e){return E(e,t)})},editWithUI:function(e){return N(e,void 0)},cloneWithUI:function(e){return t.current().then(_.partial(D,e)).then(N)}};function m(e){return i.all(_.map(e,function(t){return c.getTemplateForRule(t).then(function(e){return _.isUndefined(e)?null:t})})).then(_.flatten).then(_.filter)}function v(e,t){var n=_.get(e,"c8y_Context.id"),t=t&&n?S({moId:n}):f;return e.id&&(t+="/".concat(e.id)),t}function S(e){return"".concat(d,"/managedObjects/").concat(e.moId,"/smartrules")}function g(e){var t=v(e,!0),e=o.cleanFields(e,p);return u.put(t,e)}function y(n,e,t){return I(e,t).then(function(e){return _.forEach(e,function(t){_.isArray(n.enabledSources)&&!R(n.enabledSources,t)&&n.enabledSources.push(t),_.isArray(n.disabledSources)&&R(n.disabledSources,t)&&_.remove(n.disabledSources,function(e){return _.toString(e)===_.toString(t)})}),n})}function b(n,e,t){return I(e,t).then(function(e){return _.forEach(e,function(t){_.isArray(n.enabledSources)&&R(n.enabledSources,t)&&_.remove(n.enabledSources,function(e){return _.toString(e)===_.toString(t)}),_.isArray(n.disabledSources)&&!R(n.disabledSources,t)&&n.disabledSources.push(t)}),n})}function I(e,t){var e=e&&e.id||e,n=[];return e&&(n.push(i.when(e)),n.push(function(e,t){var n=[];!0!==t&&!0!==t.assets||n.push(r.childAssets(e));!0!==t&&!0!==t.devices||n.push(r.childDevices(e));return i.all(n).then(_.flattenDeep).then(_.partialRight(_.map,"id"))}(e,t))),i.all(n).then(_.flattenDeep)}function R(e,t){var n=t.id||t;return _.some(e,function(e){return _.toString(e)===_.toString(n)})}function A(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0,n=2<arguments.length?arguments[2]:void 0;return a({title:l("Add global smart rule"),templateUrl:":::PLUGIN_PATH:::/views/add.html",controller:"SmartRuleAddCtrl",ariaLabelledBy:"modal-title",ariaDescribedBy:"modal-body",size:"lg",keyboard:!1,resolve:{context:function(){return _.cloneDeep(e)},ruleInitialObj:function(){return _.cloneDeep(n)},ruleTemplatesFilterFn:function(){return t}}})}function E(e,t){return N(t,e)}function D(e,t){e=_.cloneDeep(e);return(e=o.cleanFields(e,h)).name=s.getString("Duplicate of {{name}}",e),t&&(e.owner=t.id),e}function N(e,t){return a({templateUrl:":::PLUGIN_PATH:::/views/edit.html",controller:"SmartRuleEditCtrl",size:"sm",keyboard:!1,resolve:{ruleTemplate:function(){return _.cloneDeep(t)},rule:function(){return _.cloneDeep(e)}}})}}e.$inject=["$q","$http","c8yBase","c8yInventory","c8yUiUtil","c8yModal","c8yUser","smartRuleTemplatesSvc","gettext","gettextCatalog"],angular.module("c8y.smartRules").factory("smartRulesSvc",e)}();
|