@c8y/ng1-modules 1022.21.3 → 1022.27.0
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/core/locales/de.po +43 -24
- package/core/locales/es.po +43 -24
- package/core/locales/fr.po +43 -24
- package/core/locales/ja_JP.po +41 -24
- package/core/locales/ko.po +42 -24
- package/core/locales/nl.po +43 -24
- package/core/locales/pl.po +43 -24
- package/core/locales/pt_BR.po +43 -24
- package/core/locales/zh_CN.po +43 -24
- package/core/locales/zh_TW.po +43 -24
- package/core/ui/properties/propertiesLibrary.service.js +1 -1
- package/deviceStatusWidget/requiredAvailabilityIntervalSetting.html +2 -0
- package/package.json +1 -1
package/core/locales/zh_TW.po
CHANGED
|
@@ -192,12 +192,6 @@ msgid "1 user"
|
|
|
192
192
|
msgid_plural "{{$count}} users"
|
|
193
193
|
msgstr[0] "{{$count}} 个用户"
|
|
194
194
|
|
|
195
|
-
msgid "30`seconds`"
|
|
196
|
-
msgstr "30"
|
|
197
|
-
|
|
198
|
-
msgid "40`seconds`"
|
|
199
|
-
msgstr "40"
|
|
200
|
-
|
|
201
195
|
msgid "<Not calculated>"
|
|
202
196
|
msgstr "<未计算>"
|
|
203
197
|
|
|
@@ -1465,6 +1459,9 @@ msgstr "同意并继续"
|
|
|
1465
1459
|
msgid "Alarm"
|
|
1466
1460
|
msgstr "警报"
|
|
1467
1461
|
|
|
1462
|
+
msgid "Alarm count"
|
|
1463
|
+
msgstr "警报计数"
|
|
1464
|
+
|
|
1468
1465
|
msgid "Alarm count 3 months"
|
|
1469
1466
|
msgstr "3 个月的警报计数"
|
|
1470
1467
|
|
|
@@ -2006,6 +2003,9 @@ msgstr "资产属性"
|
|
|
2006
2003
|
msgid "Asset properties updated."
|
|
2007
2004
|
msgstr "资产属性已更新。"
|
|
2008
2005
|
|
|
2006
|
+
msgid "Asset property list"
|
|
2007
|
+
msgstr "資產属性列表"
|
|
2008
|
+
|
|
2009
2009
|
msgid "Asset selection"
|
|
2010
2010
|
msgstr "资产选择"
|
|
2011
2011
|
|
|
@@ -3216,6 +3216,9 @@ msgstr "清除地理围栏"
|
|
|
3216
3216
|
msgid "Clear mapping"
|
|
3217
3217
|
msgstr "清除映射"
|
|
3218
3218
|
|
|
3219
|
+
msgid "Clear search"
|
|
3220
|
+
msgstr "清除搜尋"
|
|
3221
|
+
|
|
3219
3222
|
msgid "Clear selection"
|
|
3220
3223
|
msgstr "清除选择"
|
|
3221
3224
|
|
|
@@ -3322,6 +3325,11 @@ msgstr "单击列标题以应用过滤器。"
|
|
|
3322
3325
|
msgid "Click the column headers to apply filters. Click <b>Active filters</b> button to manage applied filters."
|
|
3323
3326
|
msgstr "按一下列標題以應用篩選器。按一下<b>活動篩選器</b>按鈕以管理應用的篩選器。"
|
|
3324
3327
|
|
|
3328
|
+
msgid "Click the copy icon for your chosen property and insert it into the HTML widget as a template\n"
|
|
3329
|
+
" literal."
|
|
3330
|
+
msgstr "按一下您所選的屬性的複製圖示,然後將其插入 HTML 小組件中,作為模板\n"
|
|
3331
|
+
" literal。"
|
|
3332
|
+
|
|
3325
3333
|
msgid "Click the link to download the file with the affected devices."
|
|
3326
3334
|
msgstr "单击链接以下载受影响设备的文件。"
|
|
3327
3335
|
|
|
@@ -3415,6 +3423,9 @@ msgstr "全部折疊"
|
|
|
3415
3423
|
msgid "Collapse navigator on start up"
|
|
3416
3424
|
msgstr "启动时折疊导航器"
|
|
3417
3425
|
|
|
3426
|
+
msgid "Collapse {{ assetPropertyLabel }}"
|
|
3427
|
+
msgstr "折疊 {{ assetPropertyLabel }}"
|
|
3428
|
+
|
|
3418
3429
|
msgid "Color"
|
|
3419
3430
|
msgstr "颜色"
|
|
3420
3431
|
|
|
@@ -6469,6 +6480,9 @@ msgstr "事件属性"
|
|
|
6469
6480
|
msgid "Event text"
|
|
6470
6481
|
msgstr "事件文本"
|
|
6471
6482
|
|
|
6483
|
+
msgid "Event time"
|
|
6484
|
+
msgstr "事件時間"
|
|
6485
|
+
|
|
6472
6486
|
msgid "Event type"
|
|
6473
6487
|
msgstr "事件类型"
|
|
6474
6488
|
|
|
@@ -6562,6 +6576,9 @@ msgstr "展開導航控件"
|
|
|
6562
6576
|
msgid "Expand node"
|
|
6563
6577
|
msgstr "展開節點"
|
|
6564
6578
|
|
|
6579
|
+
msgid "Expand {{ assetPropertyLabel }}"
|
|
6580
|
+
msgstr "展开 {{ assetPropertyLabel }}"
|
|
6581
|
+
|
|
6565
6582
|
msgid "Expand/collapse"
|
|
6566
6583
|
msgstr "展开/折叠"
|
|
6567
6584
|
|
|
@@ -8303,6 +8320,9 @@ msgstr "每小时聚合"
|
|
|
8303
8320
|
msgid "Hourly: {{ minutes }} minute(s) past the hour."
|
|
8304
8321
|
msgstr "每小时:该小时已过 {{ minutes }} 分钟。"
|
|
8305
8322
|
|
|
8323
|
+
msgid "How to use properties in the widget"
|
|
8324
|
+
msgstr "如何在小組件物品中使用屬性"
|
|
8325
|
+
|
|
8306
8326
|
msgid "How would you like to proceed with sub-users when the owner is deleted?"
|
|
8307
8327
|
msgstr "删除所有者时,您想对子用户做什么?"
|
|
8308
8328
|
|
|
@@ -10465,9 +10485,6 @@ msgstr "没有描述"
|
|
|
10465
10485
|
msgid "No description available."
|
|
10466
10486
|
msgstr "没有可用的描述。"
|
|
10467
10487
|
|
|
10468
|
-
msgid "No description provided."
|
|
10469
|
-
msgstr "未提供描述。"
|
|
10470
|
-
|
|
10471
10488
|
msgid "No device groups available due to the device owner permissions. The device owner must be\n"
|
|
10472
10489
|
" granted access to some device groups first."
|
|
10473
10490
|
msgstr "由于设备所有者权限,无设备组可用。必须先授予设备所有者\n"
|
|
@@ -10751,9 +10768,6 @@ msgstr "沒有其他可用的軟體版本。"
|
|
|
10751
10768
|
msgid "No package selected"
|
|
10752
10769
|
msgstr "未选择任何包"
|
|
10753
10770
|
|
|
10754
|
-
msgid "No parameters to display."
|
|
10755
|
-
msgstr "无参数可显示。"
|
|
10756
|
-
|
|
10757
10771
|
msgid "No password"
|
|
10758
10772
|
msgstr "无密码"
|
|
10759
10773
|
|
|
@@ -10799,6 +10813,9 @@ msgstr "无预览可用于 <code>text/*</code> 之外的 MIME 类型的日志文
|
|
|
10799
10813
|
msgid "No preview available."
|
|
10800
10814
|
msgstr "无预览可用。"
|
|
10801
10815
|
|
|
10816
|
+
msgid "No properties to display"
|
|
10817
|
+
msgstr "沒有要顯示的 屬性"
|
|
10818
|
+
|
|
10802
10819
|
msgid "No properties to display."
|
|
10803
10820
|
msgstr "沒有可供顯示的屬性。"
|
|
10804
10821
|
|
|
@@ -11412,6 +11429,9 @@ msgstr "開啟您智能手機上的 \n"
|
|
|
11412
11429
|
msgid "Open dashboard"
|
|
11413
11430
|
msgstr "打开面板"
|
|
11414
11431
|
|
|
11432
|
+
msgid "Open details"
|
|
11433
|
+
msgstr "開啟详细信息"
|
|
11434
|
+
|
|
11415
11435
|
msgid "Open in Device Management"
|
|
11416
11436
|
msgstr "在設備管理中打開"
|
|
11417
11437
|
|
|
@@ -11711,12 +11731,6 @@ msgstr "页面 {{ pageNo }} 正在加载…"
|
|
|
11711
11731
|
msgid "Panel"
|
|
11712
11732
|
msgstr "面板"
|
|
11713
11733
|
|
|
11714
|
-
msgid "Parameters"
|
|
11715
|
-
msgstr "Parameters"
|
|
11716
|
-
|
|
11717
|
-
msgid "Parameters used in the device will be displayed here"
|
|
11718
|
-
msgstr "设备中使用的参数将显示在此处。"
|
|
11719
|
-
|
|
11720
11734
|
msgid "Parent group ID"
|
|
11721
11735
|
msgstr "父组 ID"
|
|
11722
11736
|
|
|
@@ -12601,6 +12615,11 @@ msgstr "最近的警报"
|
|
|
12601
12615
|
msgid "Recent alarms are displayed below. Past alarms might not be shown."
|
|
12602
12616
|
msgstr "最近的報警顯示在下麵。可能不會顯示過去的報警。"
|
|
12603
12617
|
|
|
12618
|
+
msgid "Recent alarms are displayed below. Past alarms might not be shown. Optionally you can\n"
|
|
12619
|
+
" add a custom alarm."
|
|
12620
|
+
msgstr "最近的警报显示在下面。過去的警報可能不會顯示。您可以選擇\n"
|
|
12621
|
+
" 添加自訂鬧鈴。"
|
|
12622
|
+
|
|
12604
12623
|
msgid "Recent data"
|
|
12605
12624
|
msgstr "最近的数据"
|
|
12606
12625
|
|
|
@@ -13612,6 +13631,9 @@ msgstr "從清單中選取一個警報以檢視其詳細資訊。"
|
|
|
13612
13631
|
msgid "Select an asset from the list."
|
|
13613
13632
|
msgstr "從清單中選取資產。"
|
|
13614
13633
|
|
|
13634
|
+
msgid "Select an asset to see the available properties."
|
|
13635
|
+
msgstr "選擇一項資產以查看可用性屬性。"
|
|
13636
|
+
|
|
13615
13637
|
msgid "Select an asset with alarms from the list."
|
|
13616
13638
|
msgstr "從清單中選擇帶有報警的資產。"
|
|
13617
13639
|
|
|
@@ -16186,6 +16208,9 @@ msgstr "已在平台级别启用此设置。"
|
|
|
16186
16208
|
msgid "The setting is enforced on the platform level."
|
|
16187
16209
|
msgstr "已在平台级别强制实施此设置。"
|
|
16188
16210
|
|
|
16211
|
+
msgid "The smart group will be created based on the filters currently applied in the device list."
|
|
16212
|
+
msgstr "智能組將會根據設備列表中當前應用的篩選條件來创建。"
|
|
16213
|
+
|
|
16189
16214
|
msgid "The successfully enrolled devices can now request signed certificates and use them to\n"
|
|
16190
16215
|
" connect and authenticate to the platform via certificate-based authentication."
|
|
16191
16216
|
msgstr "成功註冊的設備現在可以請求已簽署的憑證,並使用這些憑證透過基於憑證的驗證方式\n"
|
|
@@ -16518,9 +16543,6 @@ msgstr "超过阈值"
|
|
|
16518
16543
|
msgid "Thresholds exceeded"
|
|
16519
16544
|
msgstr "已超过阈值"
|
|
16520
16545
|
|
|
16521
|
-
msgid "Thе smart group will be created based on the filters currently applied in the device list."
|
|
16522
|
-
msgstr "這一智慧群組將根據目前套用在裝置清單中的篩選條件建立。"
|
|
16523
|
-
|
|
16524
16546
|
msgid "Time"
|
|
16525
16547
|
msgstr "时间"
|
|
16526
16548
|
|
|
@@ -19285,9 +19307,6 @@ msgstr "未指定"
|
|
|
19285
19307
|
msgid "note: \"{{ note }}\""
|
|
19286
19308
|
msgstr "备注:\"{{ note }}\""
|
|
19287
19309
|
|
|
19288
|
-
msgid "ns=2;s=Node1"
|
|
19289
|
-
msgstr "ns=2;s=節點1"
|
|
19290
|
-
|
|
19291
19310
|
msgid "number of devices"
|
|
19292
19311
|
msgstr "设备数量"
|
|
19293
19312
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,p=[],s=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(p.push(n.value),p.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return p}}function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayWithHoles(e){if(Array.isArray(e))return e}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 r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.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 _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 r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}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 e(e,o,c,u,h,f,y,m,d){return new function r(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=n.tenantId,l=this,a="x-show-if-any-available",p="title";function i(e){var t=_.cloneDeep(e),e=u.when(t),r=_.find(l.ENTITIES.values(),{staticSchemaPath:l.propertiesCfg.static.path});return e=r?y.list().then(function(e){var t={appliesTo:{}};return t.appliesTo[r.value]=!0,_.filter(e,t)}).then(function(e){return _.map(e,function(e){return _.get(e,"c8y_JsonSchema")})}).then(function(e){return _.forEach(e,function(e){r===l.ENTITIES.TENANTS?_.merge(t.properties.customProperties.properties,e.properties):_.merge(t.properties,e.properties)}),t}):e}function s(e,t,r,n,i){if(r===p&&(r=_.has(i,"type"),i=!_.isUndefined(e),r)&&i)return e}this.ENTITIES=h.createEnum([{name:"MANAGED_OBJECTS",value:"MANAGED_OBJECTS",staticSchemaPath:h.dataFilePath("properties/managed-objects.json")},{name:"MEASUREMENTS",value:"MEASUREMENTS",staticSchemaPath:h.dataFilePath("properties/measurements.json")},{name:"ALARMS",value:"ALARMS",staticSchemaPath:h.dataFilePath("properties/alarms.json")},{name:"EVENTS",value:"EVENTS",staticSchemaPath:h.dataFilePath("properties/events.json")},{name:"TENANTS",value:"TENANTS",staticSchemaPath:h.dataFilePath("properties/tenants.json")}]),this.properties={},this.propertiesCfg={static:{path:e}},this.list=function(){return l.loadProperties().then(_.bind(l.getSimplifiedProperties,l))},this.getProperties=function(){return l.loadProperties().then(_.bind(l.getFullProperties,l))},this.getTenantDetails=function(){return t?d.detail(t).then(h.getResData):d.current()},this.removeKeysDependingOnAppsAvailability=function(t){return function e(t){for(var r=Object.keys(t),n=!1,i=0;i<r.length;i++){var o=r[i];_typeof(t[o])===_typeof({})&&null!==t[o]&&(n=o===a||n||e(t[o]))}return n}(t)?l.getTenantDetails().then(function(e){return e=_.flatMap(e.applications.references,"application"),function t(r,n){var e=Object.keys(r);return _.forEach(e,function(e){void 0===r[e][a]||_.some(r[e][a],function(e){return f.isAppOnTheList(n,e)})?_typeof(r[e])===_typeof({})&&null!==r[e]&&e!==a&&t(r[e],n):delete r[e]}),r}(t,e)}):t},this.loadProperties=_.throttle(function(){return l.loadStaticPropertiesSchema().then(i).then(l.removeKeysDependingOnAppsAvailability).then(_.bind(l.getPropertiesFromSchema,l)).then(_.bind(l.addProperties,l))},1e3,{leading:!0,trailing:!1}),this.loadStaticPropertiesSchema=function(){var e=l.propertiesCfg.static.path;return l.loadStaticPropertiesSchemaFromMemory()||o.get(e).then(h.getResData)},this.pathToKey=function(){var e=l.propertiesCfg.static.path;return _.last(e.split("/")).replace(/\.json$/,"")},this.loadStaticPropertiesSchemaFromMemory=function(){var e=l.pathToKey();return(e=(window.c8y&&window.c8y.collections&&window.c8y.collections.properties||{})[e])&&u.when(e)},this.getPropertiesFromSchema=function(e,t,r){var o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:["properties"],a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:[],p=5<arguments.length&&void 0!==arguments[5]?arguments[5]:[],s=t||e.id||"c8yDefaultSchema",t=_.cloneDeep(r||{type:"object",properties:{}}),c=l.setObjValue(t,o,{});return _.has(e,"properties")&&_.forEach(e.properties,function(e,t){var r=_.cloneDeep(c),n=_.flattenDeep([o,t,"properties"]),i=_.flattenDeep([a,t]),r=l.setObjValue(r,o,_.cloneDeep(e),t),t=l.getNewPropertyObj(s,i,r,e);p.push(t),l.getPropertiesFromSchema(e,s,r,n,i,p)}),p},this.getNewPropertyObj=function(e,t,r,n){var i=t.join("."),e={id:"".concat(e,"!!").concat(i),keyPath:t,type:n.type,printFormat:n.printFormat,label:l.getDefaultPropertyLabel(t,n),schema:r};return n.config&&(e.configSchema=n.config),n.computed&&(e.computed=n.computed),e},this.getFragmentName=function(e){var e=e[e.length-1],t=/_\d{9,}$/;return e=t.test(e)?e.replace(t,""):e},this.getDefaultPropertyLabel=function(e,t){return t=(t=t.title)||(t=(t=l.getFragmentName(e)).replace(/^c8y_/i,"").replace(/([A-Z][a-z])/g," $1").replace(/([^0-9])([0-9])/g,"$1 $2").replace("_"," ").replace(/^\s*/,"").replace(/\s*$/,"")).charAt(0).toUpperCase()+t.slice(1)},this.setObjValue=function(e,t,r,n){for(var i=e,o=0;o<t.length-1;o++)i[t[o]]||(i[t[o]]={}),i=i[t[o]];return n?i[t[o]][n]=r:i[t[o]]=r,e},this.addProperties=function(e){_.forEach(e,function(e){l.properties[e.id]=e})},this.getSimplifiedProperties=function(){return _.map(l.properties,_.bind(l.simplifyProperty,l))},this.simplifyProperty=function(e){return _.pick(e,["id","keyPath","type","label","configSchema","computed","printFormat"])},this.getFullProperties=function(){return _.cloneDeep(l.properties)},this.getSchema=function(e){return l.loadProperties().then(_.bind(l.getSchemaForProperties,l,e)).catch(c.error)},this.getSchemaForProperties=function(o){var a={type:"object",properties:{}};return _.forEach(o,function(e){l.isCustomProperty(e)&&l.addCustomProperty(e),_.mergeWith(a.properties,l.properties[e.id].schema.properties,s);var t,r,n,i=l.findInSchema(a,e);i&&(i.id=e.id,i.title=e.label||l.properties[e.id].label,n=i,t=e,r=o,l.isComplexProperty(t)&&0<l.getChildren(t,r).length&&(n.properties={}),_.forEach(_.get(i,"properties"),function(e){_.set(e,p,m.getString(e.title))}),t=a,r=e,n=_.last(r.id.split("!!")),i=_.last(r.keyPath),r.computed)&&r.configSchema&&(n!==i&&(t.properties[i]=t.properties[n],delete t.properties[n]),r.config&&4===r.config.resultType&&(t.properties[i].type="object",t.properties[i].properties={value:{title:m.getString("Value"),type:"number"},unit:{title:m.getString("Unit"),type:"string"}}),r.config)&&1===r.config.resultType&&(t.properties[i].type="number")}),function r(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];e.properties&&_.forEach(e.properties,function(e,t){n(e,t,[].concat(_toConsumableArray(i),[t])),r(e,n,[].concat(_toConsumableArray(i),[t]))})}(a,function(e,t,r){_.isUndefined(e.title)&&(e.title=l.getDefaultPropertyLabel(r,e))}),a},this.findInSchema=function(e,t){var r=t.keyPath;return t.computed&&(r=[l.getFragmentName(r)]),l.findInSchemaByKeyPath(e,r)},this.findInSchemaById=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];return _.isObjectLike(e)&&_.forOwn(e,function(e){_.isObjectLike(e)&&e.id===t?r.push(e):l.findInSchemaById(e,t,r)}),r},this.findInSchemaByKeyPath=function(e,t){if(!t.length)return e;if(e.properties){var r=(t=_toArray(t))[0],t=t.slice(1);if(_.has(e.properties,r))return this.findInSchemaByKeyPath(e.properties[r],t)}},this.getForm=function(e,t){return l.loadProperties().then(_.bind(l.getFormForProperties,l,e,t))},this.getFormForProperties=function(e,n){var t=_(e).map(function(e){var t;return e.computed?e:(t=_slicedToArray(e.id.match(/^(.+)!!/),2)[1],t="".concat(t,"!!").concat(e.keyPath[0]),e=l.properties[t],_.pick(e,["id","keyPath"]))}).uniqBy("keyPath").value(),i=l.getSchemaForProperties(e);return t.map(function(e){return t=n,r=i,r=l.findInSchemaByKeyPath(r,e.keyPath),r=((e,t)=>(t.computed&&t.configSchema&&(e.key=_.last(t.keyPath)),e))(r={key:ObjectPath.stringify(l.properties[e.id].keyPath),title:r.title||e.label||l.properties[e.id].label},e),_.assign(r,t),r;var t,r})},this.isComplexProperty=function(e){return"object"===e.type||"array"===e.type},this.isCustomProperty=function(e){return"c8yCustom"===e.id.split("!!")[0]},this.getChildren=function(t,e){return _.filter(e||l.properties,function(e){return t.id!==e.id&&_.isEqual(_.take(e.keyPath,t.keyPath.length),t.keyPath)})},this.changeActiveProperty=function(e,t){return _.map(e,function(e){return _.assign(e,{__active:t})})},this.removeDuplication=function(e){var t,r=e;return _.map(e,function(e){l.isComplexProperty(e)&&(t=_.map(l.getChildren(e),"id"),r=_.reject(r,function(e){return _.includes(t,e.id)}))}),r},this.getParent=function(t){return _.filter(l.properties,function(e){return t.keyPath.length>e.keyPath.length&&_.isEqual(_.take(t.keyPath,e.keyPath.length),e.keyPath)})},this.addCustomProperty=function(e){l.properties[e.id]||(l.properties[e.id]={}),_.merge(l.properties[e.id],e)},this.another=function(e,t){return new r(e,void 0===t?n:t)},this.paths=_.reduce(this.ENTITIES.values(),function(e,t){return e[_.startCase(_.camelCase(t.value)).replace(" ","")]=t.staticSchemaPath,e},{})}(h.dataFilePath("properties/managed-objects.json"))}e.$inject=["$filter","$http","$log","$q","c8yBase","c8yApplication","c8yJsonSchemas","gettextCatalog","c8yTenant"],angular.module("c8y.ui").provider("c8yPropertiesLibrary",function(){return{$get:e}})})();
|
|
1
|
+
function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,p=[],s=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(p.push(n.value),p.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return p}}function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayWithHoles(e){if(Array.isArray(e))return e}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 r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.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 _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 r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}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 e(e,o,c,l,h,f,y,m,d){return new function r(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=n.tenantId,u=this,a="x-show-if-any-available",p="title";function i(e){var t=_.cloneDeep(e),e=l.when(t),r=_.find(u.ENTITIES.values(),{staticSchemaPath:u.propertiesCfg.static.path});return e=r?y.list().then(function(e){var t={appliesTo:{}};return t.appliesTo[r.value]=!0,_.filter(e,t)}).then(function(e){return _.map(e,function(e){return _.get(e,"c8y_JsonSchema")})}).then(function(e){return _.forEach(e,function(e){r===u.ENTITIES.TENANTS?_.merge(t.properties.customProperties.properties,e.properties):_.merge(t.properties,e.properties)}),t}):e}function s(e,t,r,n,i){if(r===p&&(r=_.has(i,"type"),i=!_.isUndefined(e),r)&&i)return e}this.ENTITIES=h.createEnum([{name:"MANAGED_OBJECTS",value:"MANAGED_OBJECTS",staticSchemaPath:h.dataFilePath("properties/managed-objects.json")},{name:"MEASUREMENTS",value:"MEASUREMENTS",staticSchemaPath:h.dataFilePath("properties/measurements.json")},{name:"ALARMS",value:"ALARMS",staticSchemaPath:h.dataFilePath("properties/alarms.json")},{name:"EVENTS",value:"EVENTS",staticSchemaPath:h.dataFilePath("properties/events.json")},{name:"TENANTS",value:"TENANTS",staticSchemaPath:h.dataFilePath("properties/tenants.json")}]),this.properties={},this.propertiesCfg={static:{path:e}},this.list=function(){return u.loadProperties().then(_.bind(u.getSimplifiedProperties,u))},this.getProperties=function(){return u.loadProperties().then(_.bind(u.getFullProperties,u))},this.getTenantDetails=function(){return t?d.detail(t).then(h.getResData):d.current()},this.removeKeysDependingOnAppsAvailability=function(t){return function e(t){for(var r=Object.keys(t),n=!1,i=0;i<r.length;i++){var o=r[i];_typeof(t[o])===_typeof({})&&null!==t[o]&&(n=o===a||n||e(t[o]))}return n}(t)?u.getTenantDetails().then(function(e){return e=_.flatMap(e.applications.references,"application"),function t(r,n){var e=Object.keys(r);return _.forEach(e,function(e){void 0===r[e][a]||_.some(r[e][a],function(e){return f.isAppOnTheList(n,e)})?_typeof(r[e])===_typeof({})&&null!==r[e]&&e!==a&&t(r[e],n):delete r[e]}),r}(t,e)}):t},this.loadProperties=_.throttle(function(){return u.loadStaticPropertiesSchema().then(i).then(u.removeKeysDependingOnAppsAvailability).then(_.bind(u.getPropertiesFromSchema,u)).then(_.bind(u.addProperties,u))},1e3,{leading:!0,trailing:!1}),this.loadStaticPropertiesSchema=function(){var e=u.propertiesCfg.static.path;return u.loadStaticPropertiesSchemaFromMemory()||o.get(e).then(h.getResData)},this.pathToKey=function(){var e=u.propertiesCfg.static.path;return _.last(e.split("/")).replace(/\.json$/,"")},this.loadStaticPropertiesSchemaFromMemory=function(){var e=u.pathToKey();return(e=(window.c8y&&window.c8y.collections&&window.c8y.collections.properties||{})[e])&&l.when(e)},this.getPropertiesFromSchema=function(e,t,r){var o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:["properties"],a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:[],p=5<arguments.length&&void 0!==arguments[5]?arguments[5]:[],s=t||e.id||"c8yDefaultSchema",t=_.cloneDeep(r||{type:"object",properties:{}}),c=u.setObjValue(t,o,{});return _.has(e,"properties")&&_.forEach(e.properties,function(e,t){var r=_.cloneDeep(c),n=_.flattenDeep([o,t,"properties"]),i=_.flattenDeep([a,t]),r=u.setObjValue(r,o,_.cloneDeep(e),t),t=u.getNewPropertyObj(s,i,r,e);p.push(t),u.getPropertiesFromSchema(e,s,r,n,i,p)}),p},this.getNewPropertyObj=function(e,t,r,n){var i=t.join("."),e={id:"".concat(e,"!!").concat(i),keyPath:t,type:n.type,printFormat:n.printFormat,label:u.getDefaultPropertyLabel(t,n),schema:r};return n.config&&(e.configSchema=n.config),n.computed&&(e.computed=n.computed),e},this.getFragmentName=function(e){var e=e[e.length-1],t=/_\d{9,}$/;return e=t.test(e)?e.replace(t,""):e},this.getDefaultPropertyLabel=function(e,t){return t=(t=t.title)||(t=(t=u.getFragmentName(e)).replace(/^c8y_/i,"").replace(/([A-Z][a-z])/g," $1").replace(/([^0-9])([0-9])/g,"$1 $2").replace("_"," ").replace(/^\s*/,"").replace(/\s*$/,"")).charAt(0).toUpperCase()+t.slice(1)},this.setObjValue=function(e,t,r,n){for(var i=e,o=0;o<t.length-1;o++)i[t[o]]||(i[t[o]]={}),i=i[t[o]];return n?i[t[o]][n]=r:i[t[o]]=r,e},this.addProperties=function(e){_.forEach(e,function(e){u.properties[e.id]=e})},this.getSimplifiedProperties=function(){return _.map(u.properties,_.bind(u.simplifyProperty,u))},this.simplifyProperty=function(e){return _.pick(e,["id","keyPath","type","label","configSchema","computed","printFormat"])},this.getFullProperties=function(){return _.cloneDeep(u.properties)},this.getSchema=function(e){return u.loadProperties().then(_.bind(u.getSchemaForProperties,u,e)).catch(c.error)},this.getSchemaForProperties=function(o){var a={type:"object",properties:{}};return _.forEach(o,function(e){u.isCustomProperty(e)&&u.addCustomProperty(e),_.mergeWith(a.properties,u.properties[e.id].schema.properties,s);var t,r,n,i=u.findInSchema(a,e);i&&(i.id=e.id,i.title=e.label||u.properties[e.id].label,n=i,t=e,r=o,u.isComplexProperty(t)&&0<u.getChildren(t,r).length&&(n.properties={}),_.forEach(_.get(i,"properties"),function(e){_.set(e,p,m.getString(e.title))}),t=a,r=e,n=_.last(r.id.split("!!")),i=_.last(r.keyPath),r.computed)&&r.configSchema&&(n!==i&&(t.properties[i]=t.properties[n],delete t.properties[n]),r.config&&4===r.config.resultType&&(t.properties[i].type="object",t.properties[i].properties={value:{title:m.getString("Value"),type:"number"},unit:{title:m.getString("Unit"),type:"string"}}),r.config)&&1===r.config.resultType&&(t.properties[i].type="number")}),function r(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];e.properties&&_.forEach(e.properties,function(e,t){n(e,t,[].concat(_toConsumableArray(i),[t])),r(e,n,[].concat(_toConsumableArray(i),[t]))})}(a,function(e,t,r){_.isUndefined(e.title)&&(e.title=u.getDefaultPropertyLabel(r,e))}),a},this.findInSchema=function(e,t){var r=t.keyPath;return t.computed&&(r=[u.getFragmentName(r)]),u.findInSchemaByKeyPath(e,r)},this.findInSchemaById=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];return _.isObjectLike(e)&&_.forOwn(e,function(e){_.isObjectLike(e)&&e.id===t?r.push(e):u.findInSchemaById(e,t,r)}),r},this.findInSchemaByKeyPath=function(e,t){if(!t.length)return e;if(e.properties){var r=(t=_toArray(t))[0],t=t.slice(1);if(_.has(e.properties,r))return this.findInSchemaByKeyPath(e.properties[r],t)}},this.getForm=function(e,t){return u.loadProperties().then(_.bind(u.getFormForProperties,u,e,t))},this.getFormForProperties=function(e,n){var t=_(e).map(function(e){if(e.computed)return e;for(var t=_slicedToArray(e.id.match(/^(.+)!!/),2)[1],r=[],n=0;n<e.keyPath.length;n++){r.push(e.keyPath[n]);var i="".concat(t,"!!").concat(r.join("."));if(i=u.properties[i])return _.pick(i,["id","keyPath"])}return{}}).uniqBy("keyPath").value(),i=u.getSchemaForProperties(e);return t.map(function(e){return t=n,r=i,r=u.findInSchemaByKeyPath(r,e.keyPath),r=((e,t)=>(t.computed&&t.configSchema&&(e.key=_.last(t.keyPath)),e))(r={key:ObjectPath.stringify(u.properties[e.id].keyPath),title:r.title||e.label||u.properties[e.id].label},e),_.assign(r,t),r;var t,r})},this.isComplexProperty=function(e){return"object"===e.type||"array"===e.type},this.isCustomProperty=function(e){return"c8yCustom"===e.id.split("!!")[0]},this.getChildren=function(t,e){return _.filter(e||u.properties,function(e){return t.id!==e.id&&_.isEqual(_.take(e.keyPath,t.keyPath.length),t.keyPath)})},this.changeActiveProperty=function(e,t){return _.map(e,function(e){return _.assign(e,{__active:t})})},this.removeDuplication=function(e){var t,r=e;return _.map(e,function(e){u.isComplexProperty(e)&&(t=_.map(u.getChildren(e),"id"),r=_.reject(r,function(e){return _.includes(t,e.id)}))}),r},this.getParent=function(t){return _.filter(u.properties,function(e){return t.keyPath.length>e.keyPath.length&&_.isEqual(_.take(t.keyPath,e.keyPath.length),e.keyPath)})},this.addCustomProperty=function(e){u.properties[e.id]||(u.properties[e.id]={}),_.merge(u.properties[e.id],e)},this.another=function(e,t){return new r(e,void 0===t?n:t)},this.paths=_.reduce(this.ENTITIES.values(),function(e,t){return e[_.startCase(_.camelCase(t.value)).replace(" ","")]=t.staticSchemaPath,e},{})}(h.dataFilePath("properties/managed-objects.json"))}e.$inject=["$filter","$http","$log","$q","c8yBase","c8yApplication","c8yJsonSchemas","gettextCatalog","c8yTenant"],angular.module("c8y.ui").provider("c8yPropertiesLibrary",function(){return{$get:e}})})();
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
tooltip-append-to-body="true"
|
|
33
33
|
type="button"
|
|
34
34
|
ng-hide="!!vm.status.maintenanceStatus"
|
|
35
|
+
data-cy="requiredAvailabilityIntervalSetting--editButton"
|
|
35
36
|
ng-click="vm.toggleEdit()"
|
|
36
37
|
>
|
|
37
38
|
<i c8y-icon="pencil"></i>
|
|
@@ -69,6 +70,7 @@
|
|
|
69
70
|
aria-label="{{ 'Save' | translate }}"
|
|
70
71
|
type="button"
|
|
71
72
|
ng-disabled="vm.saveInProgress || vm.availabilityForm.$invalid || !!vm.status.maintenanceStatus"
|
|
73
|
+
data-cy="requiredAvailabilityIntervalSetting--saveButton"
|
|
72
74
|
ng-click="vm.save()"
|
|
73
75
|
>
|
|
74
76
|
<span
|