@c8y/ng1-modules 1023.96.0 → 1023.97.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.
@@ -2450,6 +2450,9 @@ msgstr "授权请求"
2450
2450
  msgid "Auto"
2451
2451
  msgstr "自动"
2452
2452
 
2453
+ msgid "Auto (from filename)"
2454
+ msgstr "自动(根据档案名称)"
2455
+
2453
2456
  msgid "Auto apply constraints"
2454
2457
  msgstr "自动应用约束"
2455
2458
 
@@ -2977,6 +2980,9 @@ msgstr "CRL 檔案內容將覆蓋手動條目。"
2977
2980
  msgid "CRL saved."
2978
2981
  msgstr "CRL 已儲存。"
2979
2982
 
2983
+ msgid "CSS"
2984
+ msgstr "CSS"
2985
+
2980
2986
  msgid "CSS encapsulation"
2981
2987
  msgstr "CSS 封装"
2982
2988
 
@@ -4255,6 +4261,9 @@ msgstr "內容"
4255
4261
  msgid "Content couldn't be loaded."
4256
4262
  msgstr "無法載入內容。"
4257
4263
 
4264
+ msgid "Content is sourced from a remote URL and cannot be edited inline."
4265
+ msgstr "此內容取自遠端網址,無法直接在頁面中编辑。"
4266
+
4258
4267
  msgid "Continue"
4259
4268
  msgstr "继续"
4260
4269
 
@@ -6577,6 +6586,12 @@ msgstr "对象 [{{id}}] 的 ParameterName \"{{name}}\" 重复,已重命名为
6577
6586
  msgid "Duplicate application"
6578
6587
  msgstr "重复应用程序"
6579
6588
 
6589
+ msgid "Duplicate as local"
6590
+ msgstr "复制为本地副本"
6591
+
6592
+ msgid "Duplicate as local smart rule"
6593
+ msgstr "复制为本机智能规则"
6594
+
6580
6595
  msgid "Duplicate as regular dashboard"
6581
6596
  msgstr "複製為常規儀錶板"
6582
6597
 
@@ -6706,6 +6721,9 @@ msgstr "编辑全局智能规则"
6706
6721
  msgid "Edit holding register: \"{{name}}\""
6707
6722
  msgstr "编辑保持寄存器:\"{{name}}\""
6708
6723
 
6724
+ msgid "Edit inline"
6725
+ msgstr "内嵌编辑"
6726
+
6709
6727
  msgid "Edit input register: \"{{name}}\""
6710
6728
  msgstr "编辑输入寄存器:\"{{name}}\""
6711
6729
 
@@ -6769,6 +6787,9 @@ msgstr "资产属性的可编辑表单。"
6769
6787
  msgid "Editing`icons-category`"
6770
6788
  msgstr "編輯"
6771
6789
 
6790
+ msgid "Editor language"
6791
+ msgstr "編輯語言"
6792
+
6772
6793
  msgid "Email"
6773
6794
  msgstr "电子邮件"
6774
6795
 
@@ -7538,6 +7559,9 @@ msgstr "文件"
7538
7559
  msgid "File \"{{ vm.details.name }}\" is ready for download."
7539
7560
  msgstr "文件 \"{{ vm.details.name }}\" 准备就绪,可以下载。"
7540
7561
 
7562
+ msgid "File URL"
7563
+ msgstr "文件網址"
7564
+
7541
7565
  msgid "File could not be loaded."
7542
7566
  msgstr "无法加载文件。"
7543
7567
 
@@ -7583,6 +7607,9 @@ msgstr "已导出的数据文件可以从 {tenant-domain}/inventory/binaries/{bi
7583
7607
  msgid "File(s) uploaded."
7584
7608
  msgstr "已上傳檔案。"
7585
7609
 
7610
+ msgid "Filename"
7611
+ msgstr "檔案名稱"
7612
+
7586
7613
  msgid "Files and folders`icons-category`"
7587
7614
  msgstr "檔案和資料夾"
7588
7615
 
@@ -9097,6 +9124,9 @@ msgstr "IMSI"
9097
9124
  msgid "INCORRECT"
9098
9125
  msgstr "不正确"
9099
9126
 
9127
+ msgid "INI / TOML / Properties"
9128
+ msgstr "INI / TOML / 属性"
9129
+
9100
9130
  msgid "INTEGER"
9101
9131
  msgstr "整数"
9102
9132
 
@@ -9620,6 +9650,9 @@ msgstr "我是您的 AI 程式碼助手,在此協助您為儀表板打造強
9620
9650
  msgid "J2ME commands"
9621
9651
  msgstr "J2ME 命令"
9622
9652
 
9653
+ msgid "JSON"
9654
+ msgstr "JSON"
9655
+
9623
9656
  msgid "JSON parsed successfully."
9624
9657
  msgstr "已成功解析 JSON。"
9625
9658
 
@@ -9632,6 +9665,9 @@ msgstr "JWKS URL"
9632
9665
  msgid "JWT field"
9633
9666
  msgstr "JWT 字段"
9634
9667
 
9668
+ msgid "JavaScript"
9669
+ msgstr "JavaScript"
9670
+
9635
9671
  msgid "KPI"
9636
9672
  msgstr "KPI"
9637
9673
 
@@ -10440,6 +10476,9 @@ msgstr "映射"
10440
10476
  msgid "Mark as provided"
10441
10477
  msgstr "標示為提供商"
10442
10478
 
10479
+ msgid "Markdown"
10480
+ msgstr "Markdown"
10481
+
10443
10482
  msgid "Markdown widget"
10444
10483
  msgstr "標記小組件"
10445
10484
 
@@ -12979,6 +13018,9 @@ msgstr "預留位置:{tenant-domain}、{host}、{token}、{username}、{email}
12979
13018
  msgid "Placeholders: {user}, {exportApi}"
12980
13019
  msgstr "占位符:{user}、{exportApi}"
12981
13020
 
13021
+ msgid "Plain text"
13022
+ msgstr "純文字"
13023
+
12982
13024
  msgid "Platform administration`KEEP_ORIGINAL`"
12983
13025
  msgstr "Platform administration"
12984
13026
 
@@ -16901,6 +16943,9 @@ msgstr "開啟聲音探測器"
16901
16943
  msgid "Switch to ModemMode"
16902
16944
  msgstr "切换为 ModemMode"
16903
16945
 
16946
+ msgid "Switch to inline editing"
16947
+ msgstr "切換至內嵌编辑模式"
16948
+
16904
16949
  msgid "Switch vibration detector off"
16905
16950
  msgstr "关闭振动探测器"
16906
16951
 
@@ -17662,6 +17707,9 @@ msgstr "時間上下文可在小工具檢視模式中進行設定。"
17662
17707
  msgid "The update method is determined by the widget type. Some widgets support real-time updates via WebSocket connection, while others use periodic refreshes."
17663
17708
  msgstr "更新方式取決於小工具類型。部分小工具支援透過 WebSocket 連線進行即時更新,而其他小工具則採用定期刷新機制。"
17664
17709
 
17710
+ msgid "The uploaded file appears to be binary. Switching to inline editing will discard it. Do you want to continue?"
17711
+ msgstr "上传的文件似乎是二进位文件。若切换至内嵌编辑模式,该文件将会被删除。您要继续吗?"
17712
+
17665
17713
  msgid "The uploaded image cannot be bigger than 4 MB. Please upload a smaller one."
17666
17714
  msgstr "上传的图像不能大于 4 MB。请上传小图像。"
17667
17715
 
@@ -18457,6 +18505,9 @@ msgstr "在此輸入您的訊息..."
18457
18505
  msgid "Type: {{ alarmType }}"
18458
18506
  msgstr "類型: {{ alarmType }}"
18459
18507
 
18508
+ msgid "TypeScript"
18509
+ msgstr "TypeScript"
18510
+
18460
18511
  msgid "Types"
18461
18512
  msgstr "类型"
18462
18513
 
@@ -19748,12 +19799,18 @@ msgstr "X 軸輔助線"
19748
19799
  msgid "X.509 certificate (PEM format)"
19749
19800
  msgstr "X.509 证书(PEM 格式)"
19750
19801
 
19802
+ msgid "XML"
19803
+ msgstr "XML"
19804
+
19751
19805
  msgid "Y-axis"
19752
19806
  msgstr "Y 軸"
19753
19807
 
19754
19808
  msgid "Y-axis helper lines"
19755
19809
  msgstr "Y 軸輔助線"
19756
19810
 
19811
+ msgid "YAML"
19812
+ msgstr "YAML"
19813
+
19757
19814
  msgid "Year"
19758
19815
  msgstr "年"
19759
19816
 
@@ -20609,9 +20666,6 @@ msgstr "例如,一楼"
20609
20666
  msgid "e.g. Forwarding measurements"
20610
20667
  msgstr "例如,转发测量"
20611
20668
 
20612
- msgid "e.g. Host configuration"
20613
- msgstr "例如,主机配置"
20614
-
20615
20669
  msgid "e.g. Host configuration applied to devices with type c8y_Linux"
20616
20670
  msgstr "例如,应用于类型为 c8y_Linux 的设备的主机配置"
20617
20671
 
@@ -1 +1 @@
1
- (()=>{function e(a,c,n,r,u){var e=_.debounce(function(){var e=u.get(c.path())||{},e=e.data?n.invoke(e.data):{};a.breadcrumbs=[],o(0,(e=>((e=r.when(e).then(t))._path=c.path(),e))(e))},10);function t(e){return _.union(e,u.getLiveBreadcrumbs())}function o(e,t){t.then(function(e){var n,r;c.path()===t._path&&((n=u.getPreferredBreadcrumb())&&e.length&&(r=e[0][e[0].length-2],_.find([r],n)||(e=_.sortBy(e,function(e){return!_.find([e[e.length-2]],n)}))),a.breadcrumbs=e)})}a.$on("$routeChangeSuccess",e),u.$on("breadcrumbs",o),u.$on("preferredBreadcrumbChanged",e),u.$on("update",e)}e.$inject=["$scope","$location","$injector","$q","c8yBreadcrumbs"],angular.module("c8y.ui").component("c8yUiBreadcrumbs",{templateUrl:":::PLUGIN_PATH:::/ui/navigation/breadcrumbs.html",controller:e})})();
1
+ (()=>{function n(a,c,e,r,o){var n=_.debounce(function(){var n=o.get(c.path())||{},n=n.data?e.invoke(n.data):{};a.breadcrumbs=[],i(0,(n=>((n=r.when(n).then(u))._path=c.path(),n))(n))},10),t=(a.$on("$routeChangeSuccess",n),[o.$on("breadcrumbs",i),o.$on("preferredBreadcrumbChanged",n),o.$on("update",n)]);function u(n){return _.union(n,o.getLiveBreadcrumbs())}function i(n,t){t.then(function(n){var e,r;c.path()===t._path&&((e=o.getPreferredBreadcrumb())&&n.length&&(r=n[0][n[0].length-2],_.find([r],e)||(n=_.sortBy(n,function(n){return!_.find([n[n.length-2]],e)}))),a.breadcrumbs=n)})}a.$on("$destroy",function(){return t.forEach(function(n){return n()})})}n.$inject=["$scope","$location","$injector","$q","c8yBreadcrumbs"],angular.module("c8y.ui").component("c8yUiBreadcrumbs",{templateUrl:":::PLUGIN_PATH:::/ui/navigation/breadcrumbs.html",controller:n})})();
@@ -1 +1 @@
1
- (()=>{function t(t,e,n,i,o,l,a,c){var d=this,p=t.find("head title"),u=p.text();function r(){var t=a.get(n.path())||{},t=t.data?i.invoke(t.data):{};t.title||t.subtitle||t.templateUrl||t.then?((t=l.when(t))._path=n.path(),s(0,t)):h()}function s(t,e){e.then(function(t){!_.isUndefined(e._path)&&e._path!==n.path()||(d.title=(_.isUndefined(t.title)?d:t).title,d.subtitle=t.subtitle,d.templateUrl=t.templateUrl,"component"!==d.displayMode&&(d.displayMode=d.templateUrl?"template":void 0),h(d.title))})}function m(){return o.find(".transclude-main-container")}function f(){d.displayMode=void 0,d.title="",d.subtitle=""}function h(t){var e=u;t&&(e="".concat(c.getString(t)," / ").concat(e)),p.text(e)}_.assign(d,{$onInit:function(){a.setMainComponent(d),e.$on("$routeChangeStart",f),e.$on("$routeChangeSuccess",_.debounce(r,10)),a.$on("title",s),r()},$onDestroy:function(){a.clearMainComponent()},setTitleElement:function(t){var e=m();e.empty(),e.append(t.show()),d.displayMode="component"},clearTitleElement:function(){m().empty(),d.displayMode=void 0},isTitleVisible:function(){return d.title||d.subtitle||"template"===d.displayMode&&d.templateUrl}})}t.$inject=["$document","$scope","$location","$injector","$element","$q","c8yTitle","gettextCatalog"],angular.module("c8y.ui").controller("TitleCtrl",t)})();
1
+ (()=>{function t(t,e,n,i,l,o,a,c){var d,u=this,p=t.find("head title"),r=p.text();function s(){var t=a.get(n.path())||{},t=t.data?i.invoke(t.data):{};t.title||t.subtitle||t.templateUrl||t.then?((t=o.when(t))._path=n.path(),m(0,t)):$()}function m(t,e){e.then(function(t){!_.isUndefined(e._path)&&e._path!==n.path()||(u.title=(_.isUndefined(t.title)?u:t).title,u.subtitle=t.subtitle,u.templateUrl=t.templateUrl,"component"!==u.displayMode&&(u.displayMode=u.templateUrl?"template":void 0),$(u.title))})}function f(){return l.find(".transclude-main-container")}function h(){u.displayMode=void 0,u.title="",u.subtitle=""}function $(t){var e=r;t&&(e="".concat(c.getString(t)," / ").concat(e)),p.text(e)}_.assign(u,{$onInit:function(){a.setMainComponent(u),e.$on("$routeChangeStart",h),e.$on("$routeChangeSuccess",_.debounce(s,10)),d=a.$on("title",m),s()},$onDestroy:function(){a.clearMainComponent(),d&&(d(),d=null)},setTitleElement:function(t){var e=f();e.empty(),e.append(t.show()),u.displayMode="component"},clearTitleElement:function(){f().empty(),u.displayMode=void 0},isTitleVisible:function(){return u.title||u.subtitle||"template"===u.displayMode&&u.templateUrl}})}t.$inject=["$document","$scope","$location","$injector","$element","$q","c8yTitle","gettextCatalog"],angular.module("c8y.ui").controller("TitleCtrl",t)})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1023.96.0",
3
+ "version": "1023.97.4",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -1 +1 @@
1
- (()=>{function e(i,r,e,o,t,n,a,P,c,u,l,s,d,f,h,g,m,v){var p,S=r.deviceId||r.groupId,C={},R={},A={done:!1,inProgress:!1},y={true:{text:m("Enabled`rule`"),icon:"check-circle",cls:"text-success"},false:{text:m("Disabled`rule`"),icon:"ban",cls:"text-danger"}},x=s.getContext(),E=m("Global smart rules");function b(){return o.when().then(I).then(k).then(D).then(w).then(T).catch(j)}function I(){A.inProgress=!0}function T(){A.inProgress=!1,A.done=!0,A.error=!1}function j(e){e.data&&e.data.message&&l.danger(e.data.message),A.inProgress=!1,A.done=!0,A.error=!0}function k(){return h.list().then($)}function $(e){_.forEach(e||[],function(e){C[e.name]=e})}function D(){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=(e=>{var t=e;return t=S?_.reject(e,(e=>{var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return N(e)&&!n.test(t)}})(S)):t})(_.concat(e.listByContext,e.list))})}function N(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function O(e){return g.hasSource(e,S)}function w(){var e,t;return!(Array.isArray(i.rules)&&0<i.rules.length)||null===(t=s.getContext()).context?o.resolve():(e=a.childAssets(t.id,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}),t=a.childDevices(t.id,{params:{pageSize:2e3,withChildren:!1}}),o.all([e,t]).then(_.flatten).then(function(e){i.children=e}).then(function(){i.ruleChildren={},_.forEach(i.rules,function(e){i.ruleChildren[e.id]=M(e)})}))}function M(t){return _.filter(i.children,function(e){return g.hasSource(t,e)})}function U(e){var t=_.get(C,"".concat(_.get(e,"ruleTemplateName"),"._active")),n=R.canAddRules;return 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){return e.isAllowedInventory&&e.isAllowedSmartRules}),R.canAddRules=e.then(function(e){return R.canAddRules=e,R.canAddRules}),n=!1),n}function G(t){R.rules=R.rules||{};var n=R.rules,e=n[t.id];return _.isUndefined(e)&&(n[t.id]=c.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1),e}function L(e){var t=!0;return t=x.context!==s.CONTEXT.DEVICE&&x.context!==s.CONTEXT.GROUP?t:t&&e&&"c8y_SmartRule"!==e.type}_.assign(i,{isOpen:{},moId:S,loadingStatus:A,refresh:b,paging:{refresh:b},ruleTemplates:C,getLinkToDM:function(){var e={deviceId:S};return t(p||"")(e)},add:function(){g.addNewWithUI().then(b)},edit:function(e){g.editWithUI(e).then(b)},clone:function(e){var t=e&&e.c8y_Context&&e.c8y_Context.id;(t?g.cloneWithUI(e,t,!0):g.cloneWithUI(e)).then(b)},remove:function(e){u({title:m("Delete smart rule"),body:v.getString('You are about to delete smart rule "{{name}}". Do you want to proceed?',e),labels:{ok:m("Delete")},status:"danger"}).then(angular.bind(g,g.remove,e)).then(function(){return _.pull(i.rules,e)}).then(function(){return l.success(m("Smart rule deleted."))})},hasSource:O,getChildrenEnabledForSmartRule:M,toggleRuleActivationForContextMO:function(e){if(O(e))return g.deactivate(e,S,!1).then(function(){l.success(v.getString('Smart rule "{{name}}" deactivated.',e))});return g.activate(e,S,!1).then(function(){l.success(v.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(D).then(w).then(function(){l.success(v.getString('Smart rule "{{name}}" activated/deactivated for children.',e))})},tooltip:function(e){var t={activate:{"for group":m("Activate for this group"),"for device":m("Activate for this device"),"for object":m("Activate for this object")},deactivate:{"for group":m("Deactivate for this group"),"for device":m("Deactivate for this device"),"for object":m("Deactivate for this object")}},e=e.enabled&&O(e)?"deactivate":"activate",n=r.groupId?s.CONTEXT.GROUP:"object";return n=r.deviceId?s.CONTEXT.DEVICE:n,t[e]["for ".concat(n)]},type:function(e){var t,e=C[e.ruleTemplateName];e&&(t=e.label.full?v.getString(e.label.full):"".concat(v.getString(e.label.input)," ").concat(v.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:E,context:x,inputIcon:function(e){var t,e=C[e.ruleTemplateName];e&&(t=e.paramGroups.input.icon);return t},outputIcon:function(e){var t,e=C[e.ruleTemplateName];e&&(t=e.paramGroups.output.icon);return t},canAddRules:U,canDuplicate:function(e){return U(e)&&L(e)},canEdit:function(e){return G(e)&&L(e)},canRemove:G,canModify:G,canApplyOnChildren:function(e){return!N(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,getRuleCardTitle:function(e){return"c8y_SmartRule"===e.type?m("Global smart rule"):m("Local smart rule")},getRuleIcon:function(e){return g.getRuleIcon(e)}}),i.isConfigurationGlobalSmartRulesContext=e.path().includes("/rules"),b(),null===s.getContext().context&&d.changeTitle({title:E}),x.context===s.CONTEXT.DEVICE&&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
+ (()=>{function e(i,r,e,o,t,n,c,G,a,u,l,s,d,f,h,m,g,v){var p,C=r.deviceId||r.groupId,S={},A={},R={done:!1,inProgress:!1},y={true:{text:g("Enabled`rule`"),icon:"check-circle",cls:"text-success"},false:{text:g("Disabled`rule`"),icon:"ban",cls:"text-danger"}},T=s.getContext(),x=g("Global smart rules");function E(){return o.when().then(I).then(j).then(N).then(w).then(b).catch(X)}function I(){R.inProgress=!0}function b(){R.inProgress=!1,R.done=!0,R.error=!1}function X(e){e.data&&e.data.message&&l.danger(e.data.message),R.inProgress=!1,R.done=!0,R.error=!0}function j(){return h.list().then(k)}function k(e){_.forEach(e||[],function(e){S[e.name]=e})}function N(){var e=C?m.listByContext(C):o.resolve([]),t=f.hasPermissions().then(function(e){return e?m.list():o.when([])});return o.all({listByContext:e,list:t}).then(function(e){i.rules=(e=>{var t=e;return t=C?_.reject(e,(e=>{var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return O(e)&&!n.test(t)}})(C)):t})(_.concat(e.listByContext,e.list))})}function O(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function D(e){return m.hasSource(e,C)}function w(){var e,t;return!(Array.isArray(i.rules)&&0<i.rules.length)||null===(t=s.getContext()).context?o.resolve():(e=c.childAssets(t.id,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}),t=c.childDevices(t.id,{params:{pageSize:2e3,withChildren:!1}}),o.all([e,t]).then(_.flatten).then(function(e){i.children=e}).then(function(){i.ruleChildren={},_.forEach(i.rules,function(e){i.ruleChildren[e.id]=M(e)})}))}function M(t){return _.filter(i.children,function(e){return m.hasSource(t,e)})}function P(e){var t=_.get(S,"".concat(_.get(e,"ruleTemplateName"),"._active")),n=A.canAddRules;return 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){return e.isAllowedInventory&&e.isAllowedSmartRules}),A.canAddRules=e.then(function(e){return A.canAddRules=e,A.canAddRules}),n=!1),n}function L(t){A.rules=A.rules||{};var n=A.rules,e=n[t.id];return _.isUndefined(e)&&(n[t.id]=a.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1),e}function U(e){var e=e&&"c8y_SmartRule"===e.type,t=T.context===s.CONTEXT.DEVICE||T.context===s.CONTEXT.GROUP||T.context===s.CONTEXT.APPLICATION||"ecosystem/microservice/microservices"===T.context;return!e||!t}_.assign(i,{isOpen:{},moId:C,loadingStatus:R,refresh:E,paging:{refresh:E},ruleTemplates:S,getLinkToDM:function(){var e={deviceId:C};return t(p||"")(e)},add:function(){m.addNewWithUI().then(E)},edit:function(e){m.editWithUI(e).then(E)},clone:function(e){var t=e&&e.c8y_Context&&e.c8y_Context.id;(t?m.cloneWithUI(e,t,!0):m.cloneWithUI(e)).then(E)},cloneAsLocal:function(e){m.cloneWithUI(e,C).then(E)},remove:function(e){u({title:g("Delete smart rule"),body:v.getString('You are about to delete smart rule "{{name}}". Do you want to proceed?',e),labels:{ok:g("Delete")},status:"danger"}).then(angular.bind(m,m.remove,e)).then(function(){return _.pull(i.rules,e)}).then(function(){return l.success(g("Smart rule deleted."))})},hasSource:D,getChildrenEnabledForSmartRule:M,toggleRuleActivationForContextMO:function(e){if(D(e))return m.deactivate(e,C,!1).then(function(){l.success(v.getString('Smart rule "{{name}}" deactivated.',e))});return m.activate(e,C,!1).then(function(){l.success(v.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 m.updateSources(e,t,r,!1).then(N).then(w).then(function(){l.success(v.getString('Smart rule "{{name}}" activated/deactivated for children.',e))})},tooltip:function(e){var t={activate:{"for group":g("Activate for this group"),"for device":g("Activate for this device"),"for object":g("Activate for this object")},deactivate:{"for group":g("Deactivate for this group"),"for device":g("Deactivate for this device"),"for object":g("Deactivate for this object")}},e=e.enabled&&D(e)?"deactivate":"activate",n=r.groupId?s.CONTEXT.GROUP:"object";return n=r.deviceId?s.CONTEXT.DEVICE:n,t[e]["for ".concat(n)]},type:function(e){var t,e=S[e.ruleTemplateName];e&&(t=e.label.full?v.getString(e.label.full):"".concat(v.getString(e.label.input)," ").concat(v.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:x,context:T,inputIcon:function(e){var t,e=S[e.ruleTemplateName];e&&(t=e.paramGroups.input.icon);return t},outputIcon:function(e){var t,e=S[e.ruleTemplateName];e&&(t=e.paramGroups.output.icon);return t},canAddRules:P,canDuplicate:function(e){return P(e)&&U(e)},canDuplicateAsLocal:function(e){return P(e)&&(e=>{var e=e&&"c8y_SmartRule"===e.type,t=T.context===s.CONTEXT.DEVICE||T.context===s.CONTEXT.GROUP||T.context===s.CONTEXT.APPLICATION||"ecosystem/microservice/microservices"===T.context;return e&&t})(e)},canEdit:function(e){return L(e)&&U(e)},canRemove:L,canModify:L,canApplyOnChildren:function(e){return!O(e)},canSeeSection:function(){var e=A.canSeeSection;_.isUndefined(e)&&(A.canSeeSection=(n.checkIfModulesExist(["c8y.cockpit.config"])?f.shouldShowLocalSmartRules():o.when(!1)).then(function(e){return A.canSeeSection=e,A.canSeeSection}),e=!1);return e},isConfigurationGlobalSmartRulesContext:void 0,getRuleCardTitle:function(e){return"c8y_SmartRule"===e.type?g("Global smart rule"):g("Local smart rule")},getRuleIcon:function(e){return m.getRuleIcon(e)}}),i.isConfigurationGlobalSmartRulesContext=e.path().includes("/rules"),E(),null===s.getContext().context&&d.changeTitle({title:x}),T.context===s.CONTEXT.DEVICE&&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
- (()=>{function e(e,r,i,t,n,o,c,a,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 R(){return i.when().then(S).then(x).then(b).then(N).then(C).catch(E)}function S(){p.inProgress=!0}function C(){p.inProgress=!1,p.done=!0,p.error=!1}function E(e){e.data&&e.data.message&&a.danger(e.data.message),p.inProgress=!1,p.done=!0,p.error=!0}function x(){return s.list().then(y)}function y(e){_.forEach(e,function(e){v[e.name]=e})}function b(){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=(e=>(m.mo&&(e=_.reject(e,(e=>{var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return I(e)&&!n.test(t)}})(m.mo))),e=m.filter?_.filter(e,m.filter):e))(_.concat(e.listByContext,e.list)),"function"==typeof m.onRules&&m.onRules()(m.rules)})}function I(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function T(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=(e=>(e=e.id,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]=O(e)})}):i.resolve()}function O(t){return _.filter(m.children,function(e){return t.enabled&&d.hasSource(t,e)})}function w(){var e,t=g.canAddRules;return _.isUndefined(t)&&(e=m.context?c.isAllowed({adminMOs:[m.context.id]}):i.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){return e.isAllowedInventory&&e.isAllowedSmartRules}),g.canAddRules=e.then(function(e){return g.canAddRules=e,g.canAddRules}),t=!1),t}function D(t){g.rules=g.rules||{};var n=g.rules,e=n[t.id];return _.isUndefined(e)&&(n[t.id]=c.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1),e}function M(e){var t=!0;return t=m.context.context!==u.CONTEXT.DEVICE&&m.context.context!==u.CONTEXT.GROUP&&m.context.context!==u.CONTEXT.APPLICATION&&"ecosystem/microservice/microservices"!==m.context.context?t:t&&e&&"c8y_SmartRule"!==e.type}_.assign(m,{ruleTemplates:v,loadingStatus:p,isOpen:{},listClass:"interact-list",$onInit:function(){m.context=u.getContext(),e.$on("smartRulesListReload",R),R()},add:function(){d.addNewWithUI().then(R)},edit:function(e){d.editWithUI(e,m.mo).then(R)},clone:function(e){d.cloneWithUI(e,m.mo).then(R)},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 a.success(f("Smart rule deleted."))})},hasSource:T,getChildrenEnabledForSmartRule:O,toggleRuleActivationForContextMO:function(e){if(e.enabled&&T(e))return d.deactivate(e,m.mo,!1).then(function(){a.success(h.getString('Smart rule "{{name}}" deactivated.',e))});return d.activate(e,m.mo,!1).then(function(){a.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(b).then(N).then(function(){a.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&&T(e)?"deactivate":"activate";t=r.deviceId?u.CONTEXT.DEVICE:r.groupId?u.CONTEXT.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&&T(e);return A[e].text},statusIcon:function(e){e=e.enabled&&T(e);return A[e].icon},statusClass:function(e){e=e.enabled&&T(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},canDuplicate:function(e){return w()&&M(e)},canEdit:function(e){return D(e)&&M(e)},canRemove:D,canAddRules:w,canModify:D,canApplyOnChildren:function(e){return!I(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},getRuleIcon:function(e){return d.getRuleIcon(e)}}),_.assign(e,{refresh:R,paging:{refresh:R}})}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
+ (()=>{function e(e,r,o,t,n,i,c,a,u,l,s,d,f,m){var h=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 R(){return o.when().then(S).then(E).then(T).then(O).then(x).catch(C)}function S(){p.inProgress=!0}function x(){p.inProgress=!1,p.done=!0,p.error=!1}function C(e){e.data&&e.data.message&&a.danger(e.data.message),p.inProgress=!1,p.done=!0,p.error=!0}function E(){return s.list().then(y)}function y(e){_.forEach(e,function(e){v[e.name]=e})}function T(){var e=h.mo?d.listByContext(h.mo):o.resolve([]),t=l.hasPermissions().then(function(e){return e?d.list():o.when([])});return o.all({listByContext:e,list:t}).then(function(e){h.rules=(e=>(h.mo&&(e=_.reject(e,(e=>{var n=new RegExp("".concat(e,"/dashboard"));return function(e){var t=_.get(e,"config.url","");return I(e)&&!n.test(t)}})(h.mo))),e=h.filter?_.filter(e,h.filter):e))(_.concat(e.listByContext,e.list)),"function"==typeof h.onRules&&h.onRules()(h.rules)})}function I(e){return"sendDashboardsViaEmail"===e.ruleTemplateName}function b(e){d.cloneWithUI(e,h.mo).then(R)}function N(e){return d.hasSource(e,h.mo)}function O(){var e,t;return Array.isArray(h.rules)&&0<h.rules.length&&(e=u.getContext(),t=(e=>(e=e.id,h.mo?_.get(h,"mo.id")||h.mo:e))(e),null!==e.context)?n.childAssets(t,{skipDetail:!0,params:{pageSize:2e3,withChildren:!1}}).then(function(e){h.children=e}).then(function(){h.ruleChildren={},_.forEach(h.rules,function(e){h.ruleChildren[e.id]=D(e)})}):o.resolve()}function D(t){return _.filter(h.children,function(e){return t.enabled&&d.hasSource(t,e)})}function P(){var e,t=g.canAddRules;return _.isUndefined(t)&&(e=h.context?c.isAllowed({adminMOs:[h.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){return e.isAllowedInventory&&e.isAllowedSmartRules}),g.canAddRules=e.then(function(e){return g.canAddRules=e,g.canAddRules}),t=!1),t}function w(t){g.rules=g.rules||{};var n=g.rules,e=n[t.id];return _.isUndefined(e)&&(n[t.id]=c.isAllowed({adminMOs:[t.id]}).then(function(e){return n[t.id]=e,n[t.id]}),e=!1),e}function L(e){var e=e&&"c8y_SmartRule"===e.type,t=h.context.context===u.CONTEXT.DEVICE||h.context.context===u.CONTEXT.GROUP||h.context.context===u.CONTEXT.APPLICATION||"ecosystem/microservice/microservices"===h.context.context;return!e||!t}_.assign(h,{ruleTemplates:v,loadingStatus:p,isOpen:{},listClass:"interact-list",$onInit:function(){h.context=u.getContext(),e.$on("smartRulesListReload",R),R()},add:function(){d.addNewWithUI().then(R)},edit:function(e){d.editWithUI(e,h.mo).then(R)},clone:b,remove:function(e){t({title:f("Delete smart rule"),body:m.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(h.rules,e)}).then(function(){return a.success(f("Smart rule deleted."))})},hasSource:N,getChildrenEnabledForSmartRule:D,toggleRuleActivationForContextMO:function(e){if(e.enabled&&N(e))return d.deactivate(e,h.mo,!1).then(function(){a.success(m.getString('Smart rule "{{name}}" deactivated.',e))});return d.activate(e,h.mo,!1).then(function(){a.success(m.getString('Smart rule "{{name}}" activated.',e))})},toggleRuleActivationForChildrenMOs:function(t,n){var r=[];return _.forEach(n,function(e){_.find(h.ruleChildren[t.id],{id:e.id})||r.push(d.activate(t,e,!1))}),_.forEach(h.ruleChildren[t.id],function(e){_.find(n,{id:e.id})||r.push(d.deactivate(t,e,!1))}),o.all(r).then(T).then(O).then(function(){a.success(m.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&&N(e)?"deactivate":"activate";t=r.deviceId?u.CONTEXT.DEVICE:r.groupId?u.CONTEXT.GROUP:"object";return n[e]["for ".concat(t)]},type:function(e){var t,e=v[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){e=e.enabled&&N(e);return A[e].text},statusIcon:function(e){e=e.enabled&&N(e);return A[e].icon},statusClass:function(e){e=e.enabled&&N(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},canDuplicate:function(e){return P()&&L(e)},canDuplicateAsLocal:function(e){return P()&&(e=>{var e=e&&"c8y_SmartRule"===e.type,t=h.context.context===u.CONTEXT.DEVICE||h.context.context===u.CONTEXT.GROUP||h.context.context===u.CONTEXT.APPLICATION||"ecosystem/microservice/microservices"===h.context.context;return e&&t})(e)},canEdit:function(e){return w(e)&&L(e)},canRemove:w,cloneAsLocal:function(e){b(e)},canAddRules:P,canModify:w,canApplyOnChildren:function(e){return!I(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},getRuleIcon:function(e){return d.getRuleIcon(e)}}),_.assign(e,{refresh:R,paging:{refresh:R}})}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"})})();
@@ -138,6 +138,16 @@
138
138
  {{ 'Duplicate' | translate }}
139
139
  </button>
140
140
  </li>
141
+ <li ng-if="vm.canDuplicateAsLocal(rule) && !vm.disableEditAndCreate">
142
+ <button
143
+ title="{{ 'Duplicate as local smart rule' | translate }}"
144
+ type="button"
145
+ ng-click="vm.cloneAsLocal(rule)"
146
+ >
147
+ <i c8y-icon="copy"></i>
148
+ {{ 'Duplicate as local' | translate }}
149
+ </button>
150
+ </li>
141
151
  <li ng-if="vm.canRemove(rule)">
142
152
  <button
143
153
  title="{{ 'Delete smart rule' | translate }}"
@@ -197,6 +197,16 @@
197
197
  {{ 'Duplicate' | translate }}
198
198
  </button>
199
199
  </li>
200
+ <li ng-if="canDuplicateAsLocal(rule)">
201
+ <button
202
+ title="{{ 'Duplicate as local smart rule' | translate }}"
203
+ type="button"
204
+ ng-click="cloneAsLocal(rule)"
205
+ >
206
+ <i c8y-icon="copy"></i>
207
+ {{ 'Duplicate as local' | translate }}
208
+ </button>
209
+ </li>
200
210
  <li ng-if="canRemove(rule)">
201
211
  <button
202
212
  title="{{ 'Delete smart rule' | translate }}"