@c8y/ng1-modules 1018.487.7 → 1018.497.2
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/NOTICES +1 -1
- package/administration-alarmMapping/views/index.html +2 -2
- package/administration-auditLogs/views/list.html +8 -7
- package/administration-deviceUsers/views/list.html +55 -18
- package/binaryArtefactsManagement/views/list.html +63 -23
- package/core/core/services/measurements.js +1 -1
- package/core/locales/de.po +3 -3
- package/core/locales/en.po +5 -5
- package/core/locales/es.po +21 -103
- package/core/locales/fr.po +20 -102
- package/core/locales/ja_JP.po +20 -102
- package/core/locales/ko.po +20 -102
- package/core/locales/nl.po +20 -102
- package/core/locales/pl.po +21 -103
- package/core/locales/pt_BR.po +38 -120
- package/core/locales/ru.po +21 -103
- package/core/locales/zh_CN.po +21 -103
- package/core/locales/zh_TW.po +21 -103
- package/core/ui/services/measurementsReport.js +1 -1
- package/core/ui/user/rolesUiStrings.constant.js +1 -1
- package/core/ui/views/modal.html +1 -1
- package/dataBroker/connectors/connectors.html +87 -32
- package/dataPointExplorer/index.js +1 -1
- package/dataPointExplorer/views/explorer.html +6 -2
- package/dataPointExplorer/views/widgetConfig.html +1 -0
- package/dataPointTable/index.js +1 -1
- package/dataPointTable/views/widgetConfig.html +1 -3
- package/device-protocols/deviceProtocolList.html +4 -4
- package/device-protocols/deviceProtocolView.html +34 -14
- package/deviceDatabase4/cumulocity.json +2 -2
- package/deviceDatabase4/detail/device-type-detail.component.js +1 -1
- package/deviceDatabase4/detail/device-type-detail.html +1 -0
- package/deviceDatabase4/modals/configure-register.component.js +1 -1
- package/deviceDatabase4/modals/configure-register.html +2 -2
- package/deviceDatabase4/validate-measurement-fragment.directive.js +1 -0
- package/deviceList/views/index.html +4 -1
- package/devicemanagement-alarmList/views/index.html +57 -19
- package/devicemanagement-availability/controllers/availability.js +1 -1
- package/devicemanagement-availability/views/detail.html +19 -8
- package/devicemanagement-eventList/views/index.html +6 -2
- package/enterpriseEdition/enterpriseEdition.module.js +1 -1
- package/eventList/index.js +1 -1
- package/export/directives/timespan.js +1 -1
- package/export/services/filters.js +1 -1
- package/export/views/detail.html +1 -1
- package/export/views/list.html +21 -0
- package/export/views/properties.html +3 -3
- package/export/views/timespan.html +38 -9
- package/measurements/fragmentChart/fragmentChart.component.js +1 -1
- package/measurements/measurements2/series.service.js +1 -1
- package/package.json +1 -1
- package/platformConfiguration/cumulocity.json +1 -1
- package/platformConfiguration/platformConfiguration.component.js +1 -0
- package/platformConfiguration/platformConfiguration.html +22 -0
- package/platformConfiguration/platformConfigurationUi.provider.js +1 -1
- package/scada/config.controller.js +1 -1
- package/scada/views/componentConfig.html +28 -14
- package/scada/widget.controller.js +1 -1
- package/tenantPolicies/tenantPolicyList/tenantPolicyList.html +90 -25
- package/tenantStatistics/tenant-statistics.html +23 -14
- package/tenants/views/detail.html +1 -1
- package/userRoles/inventoryRolesTab/inventoryRolesTab.component.js +1 -1
- package/userRoles/inventoryRolesTab/inventoryRolesTab.html +16 -10
- package/users/userListView/userListView.html +47 -17
- package/users/usersUi.provider.js +1 -1
- package/deviceControlMessage/controllers/deviceControlMessageWidget.js +0 -1
- package/deviceControlMessage/cumulocity.json +0 -15
- package/deviceControlMessage/img/message-widget-pr.png +0 -0
- package/deviceControlMessage/index.js +0 -1
- package/deviceControlMessage/views/deviceControlMessageWidget.html +0 -26
- package/deviceDatabase4/detail/device-type-detail.service.js +0 -1
- package/infoGauge/cumulocity.json +0 -20
- package/infoGauge/img/info-gauge-widget-pr.png +0 -0
- package/infoGauge/index.js +0 -1
- package/infoGauge/infoGauge.controller.js +0 -1
- package/infoGauge/infoGauge.service.js +0 -1
- package/infoGauge/infoGaugeConfig.controller.js +0 -1
- package/infoGauge/infoGaugeWidget.config.html +0 -58
- package/infoGauge/infoGaugeWidget.html +0 -32
- package/infoGauge/style.less +0 -0
- package/platformConfiguration/platformConfigurationForm.component.js +0 -1
- package/platformConfiguration/platformConfigurationForm.html +0 -50
|
@@ -64,9 +64,8 @@
|
|
|
64
64
|
class="data-point-explorer d-flex d-col"
|
|
65
65
|
ng-controller="c8yDataPointExplorerCtrl"
|
|
66
66
|
>
|
|
67
|
-
<div class="m-b-4 m-t-4 d-flex j-c-end gap-8">
|
|
67
|
+
<div ng-show="!data.widgetInstanceGlobalTimeContext" class="m-b-4 m-t-4 d-flex j-c-end gap-8">
|
|
68
68
|
<c8y-realtime-button
|
|
69
|
-
ng-show="!data.widgetInstanceGlobalTimeContext"
|
|
70
69
|
class="top-right-control"
|
|
71
70
|
channel="{{ channel }}"
|
|
72
71
|
state="data.realtime"
|
|
@@ -81,7 +80,6 @@
|
|
|
81
80
|
auto="true"
|
|
82
81
|
></c8y-aggregation>
|
|
83
82
|
<c8y-interval
|
|
84
|
-
ng-show="!data.widgetInstanceGlobalTimeContext"
|
|
85
83
|
class="top-right-control"
|
|
86
84
|
date-from="data.dateFrom"
|
|
87
85
|
date-to="data.dateTo"
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
</div>
|
|
10
10
|
<div class="c8y-list__item__body">
|
|
11
11
|
<div class="content-flex-60">
|
|
12
|
-
<div class="col-4">
|
|
12
|
+
<div class="col-4" data-cy="deviceProtocolList--Device-protocol-column-name">
|
|
13
13
|
{{ 'Device protocol' | translate }}
|
|
14
14
|
</div>
|
|
15
|
-
<div class="col-4">
|
|
15
|
+
<div class="col-4" data-cy="deviceProtocolList--Description-column-name">
|
|
16
16
|
{{ 'Description' | translate }}
|
|
17
17
|
</div>
|
|
18
|
-
<div class="col-2">
|
|
18
|
+
<div class="col-2" data-cy="deviceProtocolList--Type-column-name">
|
|
19
19
|
{{ 'Type' | translate }}
|
|
20
20
|
</div>
|
|
21
|
-
<div class="col-2">
|
|
21
|
+
<div class="col-2" data-cy="deviceProtocolList--Resources-column-name">
|
|
22
22
|
{{ 'Resources' | translate }}
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
@@ -1,33 +1,45 @@
|
|
|
1
|
-
<c8y-ui-title-set title="'Device protocols' | translate"
|
|
1
|
+
<c8y-ui-title-set title="'Device protocols' | translate"></c8y-ui-title-set>
|
|
2
2
|
<c8y-breadcrumbs-set>
|
|
3
3
|
<c8y-breadcrumbs-item
|
|
4
|
-
label="{{ 'Device protocols' | translate }}"
|
|
5
4
|
icon="c8y-device-protocols"
|
|
5
|
+
label="{{ 'Device protocols' | translate }}"
|
|
6
6
|
></c8y-breadcrumbs-item>
|
|
7
7
|
<c8y-breadcrumbs-item
|
|
8
|
-
label="{{ 'Device types' | translate }}"
|
|
9
8
|
icon="c8y-device-protocols"
|
|
9
|
+
label="{{ 'Device types' | translate }}"
|
|
10
10
|
></c8y-breadcrumbs-item>
|
|
11
11
|
</c8y-breadcrumbs-set>
|
|
12
12
|
|
|
13
13
|
<c8y-ui-action-bar-set>
|
|
14
|
-
<li
|
|
15
|
-
|
|
14
|
+
<li
|
|
15
|
+
class="navbar-form"
|
|
16
|
+
action-bar-position="left"
|
|
17
|
+
ng-show="!vm.showEmptyState()"
|
|
18
|
+
>
|
|
19
|
+
<label
|
|
20
|
+
class="sr-only"
|
|
21
|
+
for="dpFilter"
|
|
22
|
+
>
|
|
23
|
+
{{ 'Filter' | translate }}
|
|
24
|
+
</label>
|
|
16
25
|
<div class="input-group input-group-search">
|
|
17
26
|
<input
|
|
27
|
+
class="form-control ng-pristine ng-untouched ng-valid ng-empty"
|
|
18
28
|
title="{{ 'Filter' | translate }}"
|
|
19
|
-
type="search"
|
|
20
29
|
id="dpFilter"
|
|
21
|
-
class="form-control ng-pristine ng-untouched ng-valid ng-empty"
|
|
22
30
|
placeholder="{{ 'Filter…' | translate }}"
|
|
31
|
+
type="search"
|
|
23
32
|
ng-model="vm.searchString"
|
|
24
33
|
ng-model-options="{ debounce: 500 }"
|
|
25
34
|
/>
|
|
26
35
|
<span class="input-group-addon">
|
|
27
|
-
<i c8y-icon="search" ng-show="vm.searchString.length === 0 || !vm.searchString"></i>
|
|
28
36
|
<i
|
|
29
|
-
c8y-icon="
|
|
37
|
+
c8y-icon="search"
|
|
38
|
+
ng-show="vm.searchString.length === 0 || !vm.searchString"
|
|
39
|
+
></i>
|
|
40
|
+
<i
|
|
30
41
|
class="text-muted"
|
|
42
|
+
c8y-icon="times"
|
|
31
43
|
ng-show="vm.searchString.length > 0"
|
|
32
44
|
ng-click="vm.searchString = ''"
|
|
33
45
|
></i>
|
|
@@ -35,18 +47,26 @@
|
|
|
35
47
|
</div>
|
|
36
48
|
</li>
|
|
37
49
|
|
|
38
|
-
<button
|
|
50
|
+
<button
|
|
51
|
+
class="btn btn-link"
|
|
52
|
+
title="{{ 'Add device protocol' | translate }}"
|
|
53
|
+
ng-click="vm.add()"
|
|
54
|
+
>
|
|
39
55
|
<i c8y-icon="plus-circle"></i>
|
|
40
56
|
{{ 'Add device protocol' | translate }}
|
|
41
57
|
</button>
|
|
42
58
|
<c8y-device-protocol-import-button on-imported="vm.refresh()"></c8y-device-protocol-import-button>
|
|
43
59
|
<button
|
|
44
|
-
title="{{ 'Reload' | translate }}"
|
|
45
60
|
class="btn btn-link"
|
|
61
|
+
title="{{ 'Reload' | translate }}"
|
|
62
|
+
data-cy="deviceProtocolView--Import-protocol"
|
|
46
63
|
ng-click="vm.refresh()"
|
|
47
64
|
ng-disabled="vm.isLoading"
|
|
48
65
|
>
|
|
49
|
-
<i
|
|
66
|
+
<i
|
|
67
|
+
ng-class="{ 'icon-spin': vm.isLoading }"
|
|
68
|
+
c8y-icon="refresh"
|
|
69
|
+
></i>
|
|
50
70
|
{{ 'Reload' | translate }}
|
|
51
71
|
</button>
|
|
52
72
|
</c8y-ui-action-bar-set>
|
|
@@ -54,14 +74,14 @@
|
|
|
54
74
|
<c8y-help src="/users-guide/device-management/#managing-device-types"></c8y-help>
|
|
55
75
|
|
|
56
76
|
<c8y-ui-empty-state
|
|
57
|
-
ng-show="vm.showEmptyState()"
|
|
58
77
|
[icon]="vm.CONFIG.icon"
|
|
59
78
|
[title]="'No device protocols to display.' | translate"
|
|
60
79
|
[subtitle]="'Click below to add your first device protocol.' | translate"
|
|
80
|
+
ng-show="vm.showEmptyState()"
|
|
61
81
|
>
|
|
62
82
|
<button
|
|
63
|
-
title="{{ 'Add device protocol' | translate }}"
|
|
64
83
|
class="btn btn-primary"
|
|
84
|
+
title="{{ 'Add device protocol' | translate }}"
|
|
65
85
|
ng-click="vm.add()"
|
|
66
86
|
>
|
|
67
87
|
<i c8y-icon="{{ vm.CONFIG.icon }}"></i>
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"detail/input-registers.component.js",
|
|
44
44
|
"detail/options.component.js",
|
|
45
45
|
"detail/device-type-detail.component.js",
|
|
46
|
-
"detail/device-type-detail.service.js",
|
|
47
46
|
|
|
48
47
|
"unique.directive.js",
|
|
49
48
|
"validate-value-in-register-range.directive.js",
|
|
49
|
+
"validate-measurement-fragment.directive.js",
|
|
50
50
|
|
|
51
51
|
"vendor/ini.js"
|
|
52
52
|
],
|
|
@@ -78,10 +78,10 @@
|
|
|
78
78
|
"detail/input-registers.component.js",
|
|
79
79
|
"detail/options.component.js",
|
|
80
80
|
"detail/device-type-detail.component.js",
|
|
81
|
-
"detail/device-type-detail.service.js",
|
|
82
81
|
|
|
83
82
|
"unique.directive.js",
|
|
84
83
|
"validate-value-in-register-range.directive.js",
|
|
84
|
+
"validate-measurement-fragment.directive.js",
|
|
85
85
|
|
|
86
86
|
"vendor/ini.js"
|
|
87
87
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},e=Object.prototype,u=e.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",i=t.toStringTag||"@@toStringTag";function o(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i,o,a,c,t=t&&t.prototype instanceof f?t:f,t=Object.create(t.prototype),n=new T(n||[]);return s(t,"_invoke",{value:(i=e,o=r,a=n,c="suspendedStart",function(e,t){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===e)throw t;return x()}for(a.method=e,a.arg=t;;){var r=a.delegate;if(r){r=function e(t,r){var n=r.method,i=t.iterator[n];if(void 0===i)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=void 0,e(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=p(i,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;i=n.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,l):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===c)throw c="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c="executing";r=p(i,o,a);if("normal"===r.type){if(c=a.done?"completed":"suspendedYield",r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c="completed",a.method="throw",a.arg=r.arg)}})}),t}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var l={};function f(){}function y(){}function d(){}var t={},h=(o(t,n,function(){return this}),Object.getPrototypeOf),h=h&&h(h(b([]))),g=(h&&h!==e&&u.call(h,n)&&(t=h),d.prototype=f.prototype=Object.create(t));function v(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function m(a,c){var t;s(this,"_invoke",{value:function(r,n){function e(){return new c(function(e,t){!function t(e,r,n,i){var o,e=p(a[e],a,r);if("throw"!==e.type)return(r=(o=e.arg).value)&&"object"==_typeof(r)&&u.call(r,"__await")?c.resolve(r.__await).then(function(e){t("next",e,n,i)},function(e){t("throw",e,n,i)}):c.resolve(r).then(function(e){o.value=e,n(o)},function(e){return t("throw",e,n,i)});i(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}})}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function b(t){if(t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(u.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e}).next=e}return{next:x}}function x(){return{value:void 0,done:!0}}return s(g,"constructor",{value:y.prototype=d,configurable:!0}),s(d,"constructor",{value:y,configurable:!0}),y.displayName=o(d,i,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(g),e},a.awrap=function(e){return{__await:e}},v(m.prototype),o(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(e,t,r,n,i){void 0===i&&(i=Promise);var o=new m(c(e,t,r,n),i);return a.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},v(g),o(g,i,"Generator"),o(g,n,function(){return this}),o(g,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,r=Object(e),n=[];for(t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=b,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return o.type="throw",o.arg=r,n.next=e,t&&(n.method="next",n.arg=void 0),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=u.call(i,"catchLoc"),c=u.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}var o=(i=i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc?null:i)?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),w(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,i=this.tryEntries[t];if(i.tryLoc===e)return"throw"===(r=i.completion).type&&(n=r.arg,w(i)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:b(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},a}function asyncGeneratorStep(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=c.apply(e,a);function i(e){asyncGeneratorStep(n,t,r,i,o,"next",e)}function o(e){asyncGeneratorStep(n,t,r,i,o,"throw",e)}i(void 0)})}}!function(){function e(s,e,n,i,o,p,t,a,l,c,u){var f=this;function r(){return(r=_asyncToGenerator(_regeneratorRuntime().mark(function e(){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){return y.apply(this,arguments)}();case 2:return e.next=4,function(){return d.apply(this,arguments)}(f.id);case 4:k(),f.deviceType.name?t.changeTitle({title:f.deviceType.name},{skipTitleTranslation:!0}):t.changeTitle({title:c("New device type")}),s.$apply();case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function y(){return(y=_asyncToGenerator(_regeneratorRuntime().mark(function e(){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.getFeaturesManifestsAsync();case 2:f.deviceTypesFeatures=e.sent,s.$apply();case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark(function e(r){var n,i;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t=r,h()?p.getEmptyDeviceType():p.getDeviceType(t);case 2:n=e.sent,i=n.fieldbusType,_.assign(f,{deviceType:n,formValue:{fieldbusType:i},features:_.find(f.deviceTypesFeatures,{fieldbusType:i})}),s.$apply();case 6:case"end":return e.stop()}var t},e)}))).apply(this,arguments)}function h(){return"new"===f.id}function g(e){return T(e,p.addElementId(p.getEmptyDiscreteOutput()),f.deviceType.c8y_Coils)}function v(e){return T(e,p.addElementId(p.getEmptyDiscreteInput()),f.deviceType.c8y_Coils)}function m(e){return b(e,p.addElementId(p.getEmptyHoldingRegister(f.deviceType)),f.deviceType.c8y_Registers)}function w(e){return b(e,p.addElementId(p.getEmptyInputRegister()),f.deviceType.c8y_Registers)}function T(e,t,r){return x("DiscreteIO",e,t,r)}function b(e,t,r){return x("Register",e,t,r)}function x(){return E.apply(this,arguments)}function E(){return(E=_asyncToGenerator(_regeneratorRuntime().mark(function e(i,o,a,c){var u;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p["edit".concat(i,"WithUI")](o||a,f.deviceType);case 3:u=e.sent,n=r=t=void 0;var t=o,r=c,n=u;_.get(f.features,"holdingRegisters.number.useHex",!1)&&!n.number.startsWith("0x")&&(n.number="0x".concat(n.number)),t?(t=_.indexOf(r,t),r[t]=n):r.push(n),k(),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),e.t0&&"escape key press"!==e.t0&&l.danger(e.t0);case 11:s.$apply();case 12:case"end":return e.stop()}},e,null,[[0,8]])}))).apply(this,arguments)}function R(){return D.apply(this,arguments)}function D(){return(D=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r,n){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a({title:c("Delete item"),body:u.getString(n,t),labels:{ok:c("Delete")},status:"danger"});case 3:i.removeFromList(r,t),k(),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),e.t0&&l.danger(e.t0);case 10:s.$apply();case 11:case"end":return e.stop()}},e,null,[[0,7]])}))).apply(this,arguments)}function L(){return(L=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return _.get(t,"c8y_MessageIdConfiguration.source")||(r=_.get(f.features.configuration,"messageIdConfiguration[0].value"),_.set(t,"c8y_MessageIdConfiguration.source",r)),e.prev=1,e.next=4,p.save(t);case 4:l.success(c("Device type saved.")),o.setIsDetailEdited(!1),n.path("/deviceprotocols"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),l.danger(e.t0.errorMessage);case 12:s.$apply();case 13:case"end":return e.stop()}},e,null,[[1,9]])}))).apply(this,arguments)}function I(){return(I=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a({title:c("Confirm device type change?"),body:u.getString("By changing device type, all changes will be lost. Do you really want to proceed?")});case 3:return p.removeAllElements(f.deviceType),k(),t=f.formValue.fieldbusType,f.deviceType.fieldbusType=t,e.abrupt("return",t);case 10:return e.prev=10,e.t0=e.catch(0),t=f.deviceType.fieldbusType,f.formValue.fieldbusType=t,e.abrupt("return",t);case 15:case"end":return e.stop()}},e,null,[[0,10]])}))).apply(this,arguments)}function k(){var e=f.deviceType;_.assign(f,{discreteOutputsCategorized:p.getDiscreteOutputsCategorized(e),discreteInputsCategorized:p.getDiscreteInputsCategorized(e),holdingRegistersCategorized:p.getHoldingRegistersCategorized(e),inputRegistersCategorized:p.getInputRegistersCategorized(e)})}_.assign(f,{$onInit:function(){return r.apply(this,arguments)},isNew:h,isEmpty:_.isEmpty,editDiscreteOutput:g,editDiscreteInput:v,editHoldingRegister:m,editInputRegister:w,addDiscreteOutput:g,addDiscreteInput:v,addHoldingRegister:m,addInputRegister:w,removeDiscreteOutput:function(e){return R(e,f.deviceType.c8y_Coils,c('Do you really want to remove "{{name}}"?'))},removeDiscreteInput:function(e){return R(e,f.deviceType.c8y_Coils,c('Do you really want to remove "{{name}}"?'))},removeHoldingRegister:function(e){return R(e,f.deviceType.c8y_Registers,c('Do you really want to remove "{{name}}"?'))},removeInputRegister:function(e){return R(e,f.deviceType.c8y_Registers,c('Do you really want to remove "{{name}}"?'))},save:function(e){return L.apply(this,arguments)},saveDisabled:function(){var e=f.deviceType;return _.get(f,"deviceTypeForm.$invalid")||!e||_.isEmpty(e.c8y_Coils)&&_.isEmpty(e.c8y_Registers)},changeDeviceType:function(){{var e;f.deviceType.fieldbusType?_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){return I.apply(this,arguments)}();case 2:t=e.sent,f.features=_.find(f.deviceTypesFeatures,{fieldbusType:t}),s.$apply();case 5:case"end":return e.stop()}},e)}))():(e=f.formValue.fieldbusType,f.deviceType.fieldbusType=e,f.features=_.find(f.deviceTypesFeatures,{fieldbusType:e}))}},messageIdSources:p.MessageIdSources,toggleMainEdit:function(){f.editingMain=!f.editingMain}}),e.$watch("vm.deviceType",function(e,t){t&&e!==t&&o.setIsDetailEdited(!0)},!0)}e.$inject=["$rootScope","$scope","$location","c8yBase","c8yDeviceTypeDetail","c8yDeviceDatabase","c8yTitle","c8yModal","c8yAlert","gettext","gettextCatalog"],angular.module("c8y.deviceDatabase4").component("c8yDeviceTypeDetail",{templateUrl:":::PLUGIN_PATH:::/detail/device-type-detail.html",bindings:{id:"<"},controllerAs:"vm",controller:e})}();
|
|
1
|
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return a};var a={},e=Object.prototype,u=e.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",i=t.toStringTag||"@@toStringTag";function o(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i,o,a,c,t=t&&t.prototype instanceof f?t:f,t=Object.create(t.prototype),n=new T(n||[]);return s(t,"_invoke",{value:(i=e,o=r,a=n,c="suspendedStart",function(e,t){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===e)throw t;return x()}for(a.method=e,a.arg=t;;){var r=a.delegate;if(r){r=function e(t,r){var n=r.method,i=t.iterator[n];if(void 0===i)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=void 0,e(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=p(i,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;i=n.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,l):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===c)throw c="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c="executing";r=p(i,o,a);if("normal"===r.type){if(c=a.done?"completed":"suspendedYield",r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(c="completed",a.method="throw",a.arg=r.arg)}})}),t}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var l={};function f(){}function y(){}function d(){}var t={},h=(o(t,n,function(){return this}),Object.getPrototypeOf),h=h&&h(h(b([]))),g=(h&&h!==e&&u.call(h,n)&&(t=h),d.prototype=f.prototype=Object.create(t));function v(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function m(a,c){var t;s(this,"_invoke",{value:function(r,n){function e(){return new c(function(e,t){!function t(e,r,n,i){var o,e=p(a[e],a,r);if("throw"!==e.type)return(r=(o=e.arg).value)&&"object"==_typeof(r)&&u.call(r,"__await")?c.resolve(r.__await).then(function(e){t("next",e,n,i)},function(e){t("throw",e,n,i)}):c.resolve(r).then(function(e){o.value=e,n(o)},function(e){return t("throw",e,n,i)});i(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}})}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function b(t){if(t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(u.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e}).next=e}return{next:x}}function x(){return{value:void 0,done:!0}}return s(g,"constructor",{value:y.prototype=d,configurable:!0}),s(d,"constructor",{value:y,configurable:!0}),y.displayName=o(d,i,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(g),e},a.awrap=function(e){return{__await:e}},v(m.prototype),o(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(e,t,r,n,i){void 0===i&&(i=Promise);var o=new m(c(e,t,r,n),i);return a.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},v(g),o(g,i,"Generator"),o(g,n,function(){return this}),o(g,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,r=Object(e),n=[];for(t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=b,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return o.type="throw",o.arg=r,n.next=e,t&&(n.method="next",n.arg=void 0),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=u.call(i,"catchLoc"),c=u.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}var o=(i=i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc?null:i)?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),w(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,i=this.tryEntries[t];if(i.tryLoc===e)return"throw"===(r=i.completion).type&&(n=r.arg,w(i)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:b(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},a}function asyncGeneratorStep(e,t,r,n,i,o,a){try{var c=e[o](a),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,i)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=c.apply(e,a);function i(e){asyncGeneratorStep(n,t,r,i,o,"next",e)}function o(e){asyncGeneratorStep(n,t,r,i,o,"throw",e)}i(void 0)})}}!function(){function e(s,e,n,i,o,p,t,a,l,c,u){var f=this;function r(){return(r=_asyncToGenerator(_regeneratorRuntime().mark(function e(){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){return y.apply(this,arguments)}();case 2:return e.next=4,function(){return d.apply(this,arguments)}(f.id);case 4:k(),f.deviceType.name?t.changeTitle({title:f.deviceType.name},{skipTitleTranslation:!0}):t.changeTitle({title:c("New device type")}),s.$apply();case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}function y(){return(y=_asyncToGenerator(_regeneratorRuntime().mark(function e(){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.getFeaturesManifestsAsync();case 2:f.deviceTypesFeatures=e.sent,s.$apply();case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark(function e(r){var n,i;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t=r,h()?p.getEmptyDeviceType():p.getDeviceType(t);case 2:n=e.sent,i=n.fieldbusType,_.assign(f,{deviceType:n,formValue:{fieldbusType:i},features:_.find(f.deviceTypesFeatures,{fieldbusType:i})}),s.$apply();case 6:case"end":return e.stop()}var t},e)}))).apply(this,arguments)}function h(){return"new"===f.id}function g(e){return T(e,p.addElementId(p.getEmptyDiscreteOutput()),f.deviceType.c8y_Coils)}function v(e){return T(e,p.addElementId(p.getEmptyDiscreteInput()),f.deviceType.c8y_Coils)}function m(e){return b(e,p.addElementId(p.getEmptyHoldingRegister(f.deviceType)),f.deviceType.c8y_Registers)}function w(e){return b(e,p.addElementId(p.getEmptyInputRegister()),f.deviceType.c8y_Registers)}function T(e,t,r){return x("DiscreteIO",e,t,r)}function b(e,t,r){return x("Register",e,t,r)}function x(){return E.apply(this,arguments)}function E(){return(E=_asyncToGenerator(_regeneratorRuntime().mark(function e(i,o,a,c){var u;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p["edit".concat(i,"WithUI")](o||a,f.deviceType);case 3:u=e.sent,n=r=t=void 0;var t=o,r=c,n=u;_.get(f.features,"holdingRegisters.number.useHex",!1)&&!n.number.startsWith("0x")&&(n.number="0x".concat(n.number)),t?(t=_.indexOf(r,t),r[t]=n):r.push(n),k(),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),e.t0&&"escape key press"!==e.t0&&l.danger(e.t0);case 11:s.$apply();case 12:case"end":return e.stop()}},e,null,[[0,8]])}))).apply(this,arguments)}function R(){return D.apply(this,arguments)}function D(){return(D=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r,n){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a({title:c("Delete item"),body:u.getString(n,t),labels:{ok:c("Delete")},status:"danger"});case 3:i.removeFromList(r,t),k(),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),e.t0&&l.danger(e.t0);case 10:s.$apply();case 11:case"end":return e.stop()}},e,null,[[0,7]])}))).apply(this,arguments)}function L(){return(L=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return _.get(t,"c8y_MessageIdConfiguration.source")||(r=_.get(f.features.configuration,"messageIdConfiguration[0].value"),_.set(t,"c8y_MessageIdConfiguration.source",r)),e.prev=1,e.next=4,p.save(t);case 4:l.success(c("Device type saved.")),o.setIsDetailEdited(!1),n.path("/deviceprotocols"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),l.danger(e.t0.errorMessage);case 12:s.$apply();case 13:case"end":return e.stop()}},e,null,[[1,9]])}))).apply(this,arguments)}function I(){return(I=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a({title:c("Confirm device type change?"),body:u.getString("By changing device type, all changes will be lost. Do you really want to proceed?")});case 3:return p.removeAllElements(f.deviceType),k(),t=f.formValue.fieldbusType,f.deviceType.fieldbusType=t,e.abrupt("return",t);case 10:return e.prev=10,e.t0=e.catch(0),t=f.deviceType.fieldbusType,f.formValue.fieldbusType=t,e.abrupt("return",t);case 15:case"end":return e.stop()}},e,null,[[0,10]])}))).apply(this,arguments)}function k(){var e=f.deviceType;_.assign(f,{discreteOutputsCategorized:p.getDiscreteOutputsCategorized(e),discreteInputsCategorized:p.getDiscreteInputsCategorized(e),holdingRegistersCategorized:p.getHoldingRegistersCategorized(e),inputRegistersCategorized:p.getInputRegistersCategorized(e)})}_.assign(f,{$onInit:function(){return r.apply(this,arguments)},isNew:h,isEmpty:_.isEmpty,editDiscreteOutput:g,editDiscreteInput:v,editHoldingRegister:m,editInputRegister:w,addDiscreteOutput:g,addDiscreteInput:v,addHoldingRegister:m,addInputRegister:w,removeDiscreteOutput:function(e){return R(e,f.deviceType.c8y_Coils,c('Do you really want to remove "{{name}}"?'))},removeDiscreteInput:function(e){return R(e,f.deviceType.c8y_Coils,c('Do you really want to remove "{{name}}"?'))},removeHoldingRegister:function(e){return R(e,f.deviceType.c8y_Registers,c('Do you really want to remove "{{name}}"?'))},removeInputRegister:function(e){return R(e,f.deviceType.c8y_Registers,c('Do you really want to remove "{{name}}"?'))},save:function(e){return L.apply(this,arguments)},saveDisabled:function(){var e=f.deviceType;return _.get(f,"deviceTypeForm.$invalid")||!e||_.isEmpty(e.c8y_Coils)&&_.isEmpty(e.c8y_Registers)},changeDeviceType:function(){{var e;f.deviceType.fieldbusType?_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){return I.apply(this,arguments)}();case 2:t=e.sent,f.features=_.find(f.deviceTypesFeatures,{fieldbusType:t}),s.$apply();case 5:case"end":return e.stop()}},e)}))():(e=f.formValue.fieldbusType,f.deviceType.fieldbusType=e,f.features=_.find(f.deviceTypesFeatures,{fieldbusType:e}))}},messageIdSources:p.MessageIdSources,toggleMainEdit:function(){f.editingMain=!f.editingMain}}),e.$watch("vm.deviceType",function(e,t){t&&e!==t&&o.setIsDetailEdited(!0)},!0)}e.$inject=["$rootScope","$scope","$location","c8yBase","c8yDeviceTypeDetailEdited","c8yDeviceDatabase","c8yTitle","c8yModal","c8yAlert","gettext","gettextCatalog"],angular.module("c8y.deviceDatabase4").component("c8yDeviceTypeDetail",{templateUrl:":::PLUGIN_PATH:::/detail/device-type-detail.html",bindings:{id:"<"},controllerAs:"vm",controller:e})}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(e,t,a,o,n,i,r){var u,l,d,s,m,c,g,S=this,f="elementForm",I={IS_REQUIRED:"required",IS_VALID_NAME:"valid-name",IS_VALID_BIT_RANGE:"valid-bit-range",IS_VALID_MEASUREMENT:"valid-measurement",IS_VALUE_IN_REGISTER_RANGE:"value-in-register-range",IS_VALID_NO_BITS_FOR_SIGNED_REGISTER:"no-bits-for-signed-register",IS_VALID_MESSAGEID:"valid-messageID",IS_VALID_BROWSEPATH:"valid-browsePath",IS_VALID_OID:"valid-oid",IS_MIN:"min",IS_MAX:"max",IS_UNIQUE:"unique",PATTERN:"pattern",HEXNUMBER:"hexnumber"},p=i("Value out of range. Allowed values from {{min | number}} to {{max | number}}."),v=i('This will be matched with the message ID extracted from the protocol\'s data according to the "Source" setting.');function y(){"read"===S.readWriteMutexValue?(l.meta.showStatus=!0,l.meta.updateStatus=!1):(l.meta.showStatus=!1,l.meta.updateStatus=!0)}function E(e){e=S.features.functionalities[e];return e&&(!e.showIf||e.showIf(S.element))}function h(){return _.get(u,"number.min",1)}function V(){return _.get(u,"number.max",65536)}function b(e){var t=_.get(u,"noBits.max");return _.isNumber(t)&&_.isNumber(e)?t-e:t}_.assign(S,{$onInit:function(){var e=S.resolve;l=e.element,d=e.existingElements,s=e.existingCategories,m=e.deviceType,c=e.fieldbusType,function(){var e=l.input?"input":"holding";u=S.resolve.features["".concat(e,"Registers")],_.assign(S,{features:u,dataTypes:_.get(u,"dataType.choices"),accessTypes:_.get(u,"accessType.choices")})}(),S.element=o.addRegisterMeta(l,m),S.categories=s,S.deviceType=m,S.fieldbusType=c,function(){var e;_defineProperty(e={},I.IS_REQUIRED,i("This field is required.")),_defineProperty(e,I.IS_VALID_NAME,_.get(u,"validation.invalidName",i("Name must be unique among registers."))),_defineProperty(e,I.IS_VALID_BIT_RANGE,i("Selected number, start bit or number of bits overlap with another register.")),_defineProperty(e,I.IS_VALID_MEASUREMENT,_.get(u,"validation.invalidMeasurement",i("Selected measurement type and series are already used by another register."))),_defineProperty(e,I.IS_MIN,i("Value cannot be lower than minimum.")),_defineProperty(e,I.IS_MAX,i("Value cannot be greater than maximum.")),_defineProperty(e,I.IS_UNIQUE,i("Value cannot be used more than once.")),_defineProperty(e,I.IS_VALID_NO_BITS_FOR_SIGNED_REGISTER,i("At least two bits needed for signed register.")),_defineProperty(e,I.IS_VALID_MESSAGEID,i("Invalid hexadecimal number.")),_defineProperty(e,I.IS_VALID_BROWSEPATH,i("Invalid browse path.")),_defineProperty(e,I.IS_VALID_OID,_.get(u,"validation.invalidOid",i("OID must be unique among components."))),_defineProperty(e,I.PATTERN,i("
|
|
1
|
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(e,t,a,o,n,i,r){var u,l,d,s,m,c,g,S=this,f="elementForm",I={IS_REQUIRED:"required",IS_VALID_NAME:"valid-name",IS_VALID_BIT_RANGE:"valid-bit-range",IS_VALID_MEASUREMENT:"valid-measurement",IS_VALUE_IN_REGISTER_RANGE:"value-in-register-range",IS_VALID_NO_BITS_FOR_SIGNED_REGISTER:"no-bits-for-signed-register",IS_VALID_MESSAGEID:"valid-messageID",IS_VALID_BROWSEPATH:"valid-browsePath",IS_VALID_OID:"valid-oid",IS_MIN:"min",IS_MAX:"max",IS_UNIQUE:"unique",PATTERN:"pattern",HEXNUMBER:"hexnumber",MEASUREMENT_FRAGMENT:"measurement-fragment"},p=i("Value out of range. Allowed values from {{min | number}} to {{max | number}}."),v=i('This will be matched with the message ID extracted from the protocol\'s data according to the "Source" setting.');function y(){"read"===S.readWriteMutexValue?(l.meta.showStatus=!0,l.meta.updateStatus=!1):(l.meta.showStatus=!1,l.meta.updateStatus=!0)}function E(e){e=S.features.functionalities[e];return e&&(!e.showIf||e.showIf(S.element))}function h(){return _.get(u,"number.min",1)}function V(){return _.get(u,"number.max",65536)}function b(e){var t=_.get(u,"noBits.max");return _.isNumber(t)&&_.isNumber(e)?t-e:t}_.assign(S,{$onInit:function(){var e=S.resolve;l=e.element,d=e.existingElements,s=e.existingCategories,m=e.deviceType,c=e.fieldbusType,function(){var e=l.input?"input":"holding";u=S.resolve.features["".concat(e,"Registers")],_.assign(S,{features:u,dataTypes:_.get(u,"dataType.choices"),accessTypes:_.get(u,"accessType.choices")})}(),S.element=o.addRegisterMeta(l,m),S.categories=s,S.deviceType=m,S.fieldbusType=c,function(){var e;_defineProperty(e={},I.IS_REQUIRED,i("This field is required.")),_defineProperty(e,I.IS_VALID_NAME,_.get(u,"validation.invalidName",i("Name must be unique among registers."))),_defineProperty(e,I.IS_VALID_BIT_RANGE,i("Selected number, start bit or number of bits overlap with another register.")),_defineProperty(e,I.IS_VALID_MEASUREMENT,_.get(u,"validation.invalidMeasurement",i("Selected measurement type and series are already used by another register."))),_defineProperty(e,I.IS_MIN,i("Value cannot be lower than minimum.")),_defineProperty(e,I.IS_MAX,i("Value cannot be greater than maximum.")),_defineProperty(e,I.IS_UNIQUE,i("Value cannot be used more than once.")),_defineProperty(e,I.IS_VALID_NO_BITS_FOR_SIGNED_REGISTER,i("At least two bits needed for signed register.")),_defineProperty(e,I.IS_VALID_MESSAGEID,i("Invalid hexadecimal number.")),_defineProperty(e,I.IS_VALID_BROWSEPATH,i("Invalid browse path.")),_defineProperty(e,I.IS_VALID_OID,_.get(u,"validation.invalidOid",i("OID must be unique among components."))),_defineProperty(e,I.PATTERN,i("Must be a valid number.")),_defineProperty(e,I.HEXNUMBER,i("Must be a valid hexadecimal number.")),_defineProperty(e,I.MEASUREMENT_FRAGMENT,i("Must not contain whitespaces nor the special characters .,*[]()@$")),g=e}(),u.functionalities.readWriteMutex&&(S.readWriteMutexValue="read",l.meta.updateStatus&&(S.readWriteMutexValue="write"),y())},PATTERN_VALIDATE_FRAGMENT_SERIES:"^[^.]*$",alarmSeverities:n.severityList,getValuePlaceholder:function(e){var t=r.getString("no value");_.isUndefined(e)||_.isNaN(e)||(t=e);return"(".concat(t,")")},addEnumValue:o.addEmptyEnumValue,removeEnumValue:o.removeEnumValue,invalid:function(e){return function(e){{var t,n;"number"===e&&_.get(u,"number.useHex")&&(e=_.get(S,"".concat(f,".number")),(n=_.get(e,"$modelValue"))?(n.startsWith("0x")&&(n=n.substring(2)),t=parseInt(n,16),n=t.toString(16)===n.toLowerCase(),e.$setValidity(I.IS_VALID_MESSAGEID,n),e.$setValidity(I.IS_MIN,!n||t>=h()),e.$setValidity(I.IS_MAX,!n||t<=V())):e.$setValidity(I.IS_VALID_MESSAGEID,!0))}}(e),function(e){var t=S[f];"browsePath"===e&&(e=t.browsePath.$viewValue,t.browsePath.$setValidity(I.IS_VALID_BROWSEPATH,/^|((\d)+:[^/]+)([/](\d)+:[^/]+)*$/.test(e)))}(e),function(){var t=S[f].name,n=_.get(l,"meta"),e=_.isUndefined(t.$modelValue)||_.every(d,function(e){return e.name===_.get(n,"original.name")||e.name!==t.$modelValue});t.$setValidity(I.IS_VALID_NAME,e)}(),function(){var e=S[f],n=e.number,a=e.startBit,i=e.noBits,r=_.get(l,"meta"),e=!n||_.isUndefined(n.$modelValue)||_.isUndefined(a.$modelValue)||_.isUndefined(i.$modelValue)||!_.some(d,function(e){var t=n.$modelValue;_.get(u,"number.useHex")&&t&&-1===t.indexOf("0x")&&(t="0x".concat(t));return(!r||!(_.get(r,"original.number")===e.number&&r.original.startBit===e.startBit))&&e.input===l.input&&o.areOverlappingRegisters(e,{number:t,startBit:a.$modelValue,noBits:i.$modelValue},u)});n&&n.$setValidity(I.IS_VALID_BIT_RANGE,e);a&&a.$setValidity(I.IS_VALID_BIT_RANGE,e);i&&i.$setValidity(I.IS_VALID_BIT_RANGE,e)}(),function(){var e=S[f],i=_.get(e,"messageTypeId.$modelValue"),t=e.measurementType,r=_.get(t,"$modelValue"),e=e.measurementSeries,o=_.get(e,"$modelValue"),s=_.get(l,"meta"),n=!_.get(s,"sendMeasurement")||_.isUndefined(r)||_.isUndefined(o)||!_.some(d,function(e){var t=!1,n=_.get(l,"id")===_.get(e,"id"),a=u.number&&_.get(s,"original.number")===e.number&&_.get(s,"original.startBit")===e.startBit&&_.get(s,"original.input")===e.input;return t=n||a?t:(!u.messageTypeId||_.get(e,"messageTypeId")===i)&&_.get(e,"measurementMapping.type")===r&&_.get(e,"measurementMapping.series")===o});t&&t.$setValidity(I.IS_VALID_MEASUREMENT,n);e&&e.$setValidity(I.IS_VALID_MEASUREMENT,n)}(),function(){var e=_.get(S,"".concat(f,".noBits"));{var t;e&&(t=!l.signed||l.signed&&!_.isUndefined(e.$modelValue)&&1<e.$modelValue,e.$setValidity(I.IS_VALID_NO_BITS_FOR_SIGNED_REGISTER,t))}}(),function(e){var t=S[f];{var n,a;"oid"===e&&(n=t.oid,a=_.get(l,"meta"),e=_.isUndefined(n.$modelValue)||_.every(d,function(e){return e.oid===_.get(a,"original.oid")||e.oid!==n.$modelValue}),n.$setValidity(I.IS_VALID_OID,e))}}(e),a.invalid(S,f,e)},validationHints:function(e,t){var n=_.cloneDeep(g),t=_.get(t,"validateValueInRegisterRange");t&&(n[I.IS_VALUE_IN_REGISTER_RANGE]=r.getString(p,t));return a.validationHints(e,n)},onAccessTypeChange:function(){E("showStatus")||(S.element.meta.showStatus=!1);!S.element.input&&E("updateStatus")||(S.element.meta.updateStatus=!1);S.shouldEnableShowStatusStandardFunctionalities()&&E("sendMeasurement")||(S.element.meta.sendMeasurement=!1);S.shouldEnableShowStatusStandardFunctionalities()&&E("raiseAlarm")||(S.element.meta.raiseAlarm=!1);S.shouldEnableShowStatusStandardFunctionalities()&&E("sendEvent")||(S.element.meta.sendEvent=!1)},onUpdateStatusCheckboxChange:function(){l.meta.updateStatus&&(l.meta.showStatus=!0)},onStatusMappingRadiosChange:y,save:function(){(function(){var e=[];S.features.functionalities.readWriteMutex&&(e=["measurementMapping","eventMapping","alarmMapping"],"read"===S.readWriteMutexValue)&&(e=["min","max"]);l.noBits<=8&&e.push("littleEndian");_.forEach(e,function(e){return _.unset(l,e)})})(),S.close({$value:o.removeRegisterMeta(l)})},messageTypeIdMax:function(){var e=void 0;return _.get(m,"c8y_MessageIdConfiguration.source")!==o.MessageIdSources.PAYLOAD.value?e:(e=_.get(m,"c8y_MessageIdConfiguration.messageIdMapping.noBits"),Math.pow(2,e)-1)},startBitMax:function(){return _.get(u,"startBit.max")},noBitsMax:b,getNumberMin:h,getNumberMax:V,shouldShowOptions:function(){return _.some(S.features.options,Boolean)},shouldShowNormalisationSection:function(){return _.some([S.features.multiplier,S.features.divisor,S.features.offset,S.features.decimalPlaces,S.features.unit,_.get(S.element,"meta.updateStatus",!1)],Boolean)},shouldShowFunctionalities:function(){var e=S.features.functionalities,t=e.readWriteMutex,n=e.showStatus&&S.shouldShowFunctionality("showStatus"),a=e.updateStatus&&!S.element.input&&S.shouldShowFunctionality("updateStatus"),i=S.shouldEnableShowStatusStandardFunctionalities()&&(S.shouldShowFunctionality("sendMeasurement")||S.shouldShowFunctionality("raiseAlarm")||S.shouldShowFunctionality("sendEvent")),e=e.sendManagedObjectUpdate;return t||n||a||i||e},shouldEnableShowStatusStandardFunctionalities:function(){return!(S.features.functionalities.readWriteMutex&&"write"===S.readWriteMutexValue)},shouldShowFunctionality:E,messageIdTooltip:v}),e.$watch("vm.element.startBit",function(){var e=b(l.startBit);l.noBits>e&&(l.noBits=e)}),e.$watchGroup(["vm.element.min","vm.element.max","vm.element.noBits","vm.element.multiplier","vm.element.divisor","vm.element.decimalPlaces","vm.element.signed","vm.element.meta.dataType"],function(){var e=l.meta;e&&(e.valuesRange=o.getValuesRange(l))})}e.$inject=["$scope","$q","c8yBase","c8yDeviceDatabase","c8yAlarms","gettext","gettextCatalog"],angular.module("c8y.deviceDatabase4").component("c8yConfigureRegisterModal",{templateUrl:":::PLUGIN_PATH:::/modals/configure-register.html",bindings:{resolve:"<",close:"&",dismiss:"&"},controllerAs:"vm",controller:e})}();
|
|
@@ -1035,7 +1035,7 @@
|
|
|
1035
1035
|
class="form-control"
|
|
1036
1036
|
id="measurementType"
|
|
1037
1037
|
name="measurementType"
|
|
1038
|
-
|
|
1038
|
+
validate-measurement-fragment
|
|
1039
1039
|
ng-model="vm.element.measurementMapping.type"
|
|
1040
1040
|
placeholder="{{ 'e.g.' | translate }} c8y_Temperature"
|
|
1041
1041
|
ng-required="vm.element.meta.sendMeasurement"
|
|
@@ -1055,7 +1055,7 @@
|
|
|
1055
1055
|
class="form-control"
|
|
1056
1056
|
id="measurementSeries"
|
|
1057
1057
|
name="measurementSeries"
|
|
1058
|
-
|
|
1058
|
+
validate-measurement-fragment
|
|
1059
1059
|
ng-model="vm.element.measurementMapping.series"
|
|
1060
1060
|
placeholder="{{ 'e.g.' | translate }} T"
|
|
1061
1061
|
ng-required="vm.element.meta.sendMeasurement"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";angular.module("c8y.deviceDatabase4").directive("validateMeasurementFragment",function(){return{restrict:"A",require:"ngModel",link:function(e,t,r,n){var a=/^[^.,*[\]()@$]*$/;n.$validators["measurement-fragment"]=function(e){return a.test(e)}}}});
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
<div ng-controller="DeviceListCtrl as ctrl">
|
|
2
2
|
<c8y-help src="/users-guide/device-management/#viewing-devices"></c8y-help>
|
|
3
|
-
<c8y-device-list
|
|
3
|
+
<c8y-device-list
|
|
4
|
+
set-titles="true"
|
|
5
|
+
parent-device-id="ctrl.deviceId"
|
|
6
|
+
></c8y-device-list>
|
|
4
7
|
</div>
|
|
@@ -15,40 +15,58 @@
|
|
|
15
15
|
|
|
16
16
|
<div ng-controller="alarmListCtrl as vm">
|
|
17
17
|
<c8y-ui-action-bar-set>
|
|
18
|
-
<li
|
|
18
|
+
<li
|
|
19
|
+
class="navbar-form"
|
|
20
|
+
action-bar-position="left"
|
|
21
|
+
>
|
|
19
22
|
<div class="btn-group btn-group-sm">
|
|
20
23
|
<button
|
|
24
|
+
class="btn btn-default btn-sm d-flex a-i-center"
|
|
25
|
+
ng-class="{ active: severity.active }"
|
|
21
26
|
title="{{ severity.name | lowercase | humanize | translate }}"
|
|
22
|
-
ng-repeat="severity in vm.severities"
|
|
23
27
|
type="button"
|
|
24
|
-
|
|
28
|
+
ng-repeat="severity in vm.severities"
|
|
25
29
|
ng-model="severity.active"
|
|
26
30
|
ng-click="severity.toggleActive()"
|
|
27
|
-
ng-class="{ active: severity.active }"
|
|
28
31
|
>
|
|
29
32
|
<i
|
|
30
|
-
c8y-icon="{{ vm.icon(severity.name) }}"
|
|
31
33
|
class="status m-r-4 icon-14 stroked-icon"
|
|
32
34
|
ng-class="severity.name | lowercase"
|
|
35
|
+
c8y-icon="{{ vm.icon(severity.name) }}"
|
|
33
36
|
></i>
|
|
34
37
|
|
|
35
38
|
<span
|
|
36
39
|
class="hidden-md hidden-sm text-truncate m-r-4"
|
|
37
40
|
ng-bind="severity.name | lowercase | humanize | translate"
|
|
38
41
|
></span>
|
|
39
|
-
<span
|
|
42
|
+
<span
|
|
43
|
+
class="badge badge-info flex-no-shrink"
|
|
44
|
+
ng-if="severity.active"
|
|
45
|
+
>
|
|
40
46
|
<span ng-if="severity.countLoading">
|
|
41
|
-
<i
|
|
47
|
+
<i
|
|
48
|
+
class="icon-spin"
|
|
49
|
+
c8y-icon="circle-o-notch"
|
|
50
|
+
></i>
|
|
42
51
|
</span>
|
|
43
|
-
<span
|
|
52
|
+
<span
|
|
53
|
+
ng-if="!severity.countLoading"
|
|
54
|
+
ng-bind="severity.count"
|
|
55
|
+
></span>
|
|
44
56
|
</span>
|
|
45
57
|
</button>
|
|
46
58
|
</div>
|
|
47
59
|
</li>
|
|
48
60
|
</c8y-ui-action-bar-set>
|
|
49
61
|
<c8y-ui-action-bar-set>
|
|
50
|
-
<li
|
|
51
|
-
|
|
62
|
+
<li
|
|
63
|
+
class="navbar-form"
|
|
64
|
+
action-bar-position="right"
|
|
65
|
+
>
|
|
66
|
+
<label
|
|
67
|
+
class="c8y-switch"
|
|
68
|
+
aria-label="{{ 'Show cleared alarms' | translate }}"
|
|
69
|
+
>
|
|
52
70
|
<input
|
|
53
71
|
type="checkbox"
|
|
54
72
|
ng-model="vm.unresolved"
|
|
@@ -57,7 +75,10 @@
|
|
|
57
75
|
ng-false-value="true"
|
|
58
76
|
/>
|
|
59
77
|
<span></span>
|
|
60
|
-
<span
|
|
78
|
+
<span
|
|
79
|
+
class="text-truncate"
|
|
80
|
+
title="{{ 'Show cleared alarms' | translate }}"
|
|
81
|
+
>
|
|
61
82
|
{{ 'Show cleared alarms' | translate }}
|
|
62
83
|
</span>
|
|
63
84
|
</label>
|
|
@@ -66,13 +87,19 @@
|
|
|
66
87
|
<c8y-ui-action-bar-set>
|
|
67
88
|
<li action-bar-position="right">
|
|
68
89
|
<button
|
|
90
|
+
class="btn btn-link d-flex a-i-center"
|
|
69
91
|
title="{{ 'Clear all alarms' | translate }}"
|
|
70
92
|
type="button"
|
|
71
|
-
class="btn btn-link d-flex a-i-center"
|
|
72
93
|
ng-click="vm.resolveAll()"
|
|
73
94
|
>
|
|
74
|
-
<i
|
|
75
|
-
|
|
95
|
+
<i
|
|
96
|
+
class="m-r-4"
|
|
97
|
+
c8y-icon="c8y-alert-idle"
|
|
98
|
+
></i>
|
|
99
|
+
<span
|
|
100
|
+
class="text-truncate"
|
|
101
|
+
title="{{ 'Clear all`alarms`' | translate }}"
|
|
102
|
+
>
|
|
76
103
|
{{ 'Clear all`alarms`' | translate }}
|
|
77
104
|
</span>
|
|
78
105
|
</button>
|
|
@@ -80,19 +107,30 @@
|
|
|
80
107
|
</c8y-ui-action-bar-set>
|
|
81
108
|
<c8y-ui-action-bar-set>
|
|
82
109
|
<li action-bar-position="right">
|
|
83
|
-
<c8y-realtime-switch
|
|
110
|
+
<c8y-realtime-switch
|
|
111
|
+
class="d-contents"
|
|
112
|
+
state="vm.realtime"
|
|
113
|
+
></c8y-realtime-switch>
|
|
84
114
|
</li>
|
|
85
115
|
</c8y-ui-action-bar-set>
|
|
86
116
|
<c8y-ui-action-bar-set>
|
|
87
117
|
<li action-bar-position="right">
|
|
88
118
|
<button
|
|
119
|
+
class="btn btn-link d-flex a-i-center"
|
|
89
120
|
title="{{ 'Refresh alarm list contents' | translate }}"
|
|
90
121
|
type="button"
|
|
91
|
-
class="btn btn-link d-flex a-i-center"
|
|
92
122
|
ng-click="vm.refresh()"
|
|
93
123
|
>
|
|
94
|
-
<i
|
|
95
|
-
|
|
124
|
+
<i
|
|
125
|
+
ng-class="{ 'icon-spin': vm.isRefreshing() }"
|
|
126
|
+
c8y-icon="refresh"
|
|
127
|
+
></i>
|
|
128
|
+
<span
|
|
129
|
+
class="m-l-4 text-truncate"
|
|
130
|
+
translate
|
|
131
|
+
>
|
|
132
|
+
Reload
|
|
133
|
+
</span>
|
|
96
134
|
</button>
|
|
97
135
|
</li>
|
|
98
136
|
</c8y-ui-action-bar-set>
|
|
@@ -102,13 +140,13 @@
|
|
|
102
140
|
<div class="row">
|
|
103
141
|
<c8y-alarm-list
|
|
104
142
|
class="col-lg-6 c8y-alarm-list"
|
|
143
|
+
data-title="{text:(severity.name | lowercase | humanize | translate), icon:vm.icon(severity.name), class:(severity.name | lowercase)}"
|
|
105
144
|
ng-repeat="severity in vm.severities"
|
|
106
145
|
ng-if="severity.active"
|
|
107
146
|
filter="severity.filters"
|
|
108
147
|
active-severities="{[severity.name]: true}"
|
|
109
148
|
realtime="vm.realtime"
|
|
110
149
|
hide-header-actions="true"
|
|
111
|
-
data-title="{text:(severity.name | lowercase | humanize | translate), icon:vm.icon(severity.name), class:(severity.name | lowercase)}"
|
|
112
150
|
refresh-loading="severity.refreshing"
|
|
113
151
|
></c8y-alarm-list>
|
|
114
152
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function t(n,t,o,l,a,r){var i,u=t.deviceId,c={},t=a("Availability percentage is based on the number of critical alarms raised and cleared."),e=a("Operability chart displays how many devices had their average availability on particular level in the last
|
|
1
|
+
"use strict";!function(){function t(n,t,o,l,a,r){var i,u=t.deviceId,c={},t=a("Availability percentage is based on the number of critical alarms raised and cleared."),e=a("Operability chart displays how many devices had their average availability on particular level in the last 30 days."),d=o.createEnum([{name:"DAY",value:1,label:a("Last 24 hours availability")},{name:"WEEK",value:7,label:a("Last 7 days availability")},{name:"MONTH",value:30,label:a("Last 30 days availability")}]),v=o.createEnum([{name:"DOWNTIME",value:"downtime",label:a("Downtime"),color:"#d9534f"},{name:"UPTIME",value:"uptime",label:a("Uptime"),color:"#5cb85c"}]);function m(r){t=r,a=moment(),t=moment().subtract(t.value,"days"),e=o.dateFullFormat;var t,a,e,i={dateFrom:t.format(e),dateTo:a.format(e),id:u};return(i.id?l.reports.downtimeDuration(i):l.reports.downtimeDurationAggregation(i)).then(function(t){var a,e,n;a=r,e=i,t=t.data,n=t.downtimeDuration,e=f(i,t)-n,c[a.name]={name:a.name,label:a.label,order:a.ordinal,data:[{key:v.DOWNTIME.value,val:n},{key:v.UPTIME.value,val:e}]}})}function f(t,a){var a=1<arguments.length&&void 0!==a?a:{},e=moment(t.dateFrom),t=moment(t.dateTo),n=1;return"number"==typeof a.deviceCount?n=a.deviceCount:Array.isArray(a.availabilityStats)&&(n=a.availabilityStats.length),t.diff(e,"seconds")*(n||1)}function s(t){var a=_.find(t,{key:v.UPTIME.value}).val;return a/(a+_.find(t,{key:v.DOWNTIME.value}).val)*100}_.assign(n,{intervalsData:c,availabilityTooltip:t,operabilityTooltip:e,x:function(){return function(t){return t.key}},y:function(){return function(t){return t.val}},xGraph:function(){return function(t){return t[0]}},yGraph:function(){return function(t){return t[1]}},xTickFormat:function(){return function(t){return"".concat(t,"%")}},color:function(){return function(t){return _.find(v,{value:t.data.key}).color}},colorGraph:function(){return function(){return v.UPTIME.color}},tooltip:function(){return function(t){return r.getString(_.find(v,{value:t}).label)}},tooltipGraph:function(){return function(t,a,e){e=Math.round(e);return r.getPlural(e,"1 device","{{$count}} devices",{})}},percentage:s,percentageClass:function(t){return 50<s(t)?"text-success":"text-danger"}}),d.values().forEach(m),u||(a=o.dateFullFormat,i={dateFrom:moment().subtract(30,"day").format(a),dateTo:moment().format(a)},l.reports.downtimeDuration(i).then(function(t){var a,e;a=i,t=(t=t.data).availabilityStats,e=f(a),a=t.map(function(t){var a=t.downtimeDuration;return t.percent=100*(e-a)/e,t}),n.graphData=[{key:"operability",values:function(a){for(var n=10,r=[],t=function(){var e=i*n,t=a.filter(function(t){return a=e,(t=t).percent<=a&&t.percent>a-n;var a}).length;r.push([e,t])},i=0;i<=10;i++)t();return r}(a)}]}))}t.$inject=["$scope","$routeParams","c8yBase","c8yAlarms","gettext","gettextCatalog"],angular.module("c8y.parts.availability").controller("availabilityReportCtrl",t)}();
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
<c8y-breadcrumbs-set>
|
|
2
2
|
<c8y-breadcrumbs-item
|
|
3
|
-
label="{{ 'Availability' | translate }}"
|
|
4
3
|
icon="signal"
|
|
4
|
+
label="{{ 'Availability' | translate }}"
|
|
5
|
+
></c8y-breadcrumbs-item>
|
|
6
|
+
<c8y-breadcrumbs-item
|
|
7
|
+
icon="exchange"
|
|
8
|
+
label="{{ 'Devices' | translate }}"
|
|
5
9
|
></c8y-breadcrumbs-item>
|
|
6
|
-
<c8y-breadcrumbs-item label="{{ 'Devices' | translate }}" icon="exchange"></c8y-breadcrumbs-item>
|
|
7
10
|
</c8y-breadcrumbs-set>
|
|
8
11
|
|
|
9
12
|
<div class="card-group">
|
|
10
13
|
<div
|
|
11
|
-
ng-repeat="intervalData in intervalsData | orderBy:'order'"
|
|
12
14
|
class="availabilityPie col-md-4 col-xs-12"
|
|
15
|
+
ng-repeat="intervalData in intervalsData | orderBy:'order'"
|
|
13
16
|
>
|
|
14
17
|
<div class="card">
|
|
15
18
|
<div class="card-header">
|
|
@@ -20,13 +23,16 @@
|
|
|
20
23
|
<hr />
|
|
21
24
|
<div class="card-block">
|
|
22
25
|
<div class="p-relative">
|
|
23
|
-
<span
|
|
24
|
-
|
|
26
|
+
<span
|
|
27
|
+
class="percentage"
|
|
28
|
+
ng-class="percentageClass(intervalData.data)"
|
|
29
|
+
>
|
|
30
|
+
{{ percentage(intervalData.data) | number : 0 }}%
|
|
25
31
|
</span>
|
|
26
32
|
<nvd3-pie-chart
|
|
27
|
-
data="intervalData.data"
|
|
28
33
|
id="interval{{ $index }}"
|
|
29
34
|
height="500"
|
|
35
|
+
data="intervalData.data"
|
|
30
36
|
width="600"
|
|
31
37
|
x="x()"
|
|
32
38
|
y="y()"
|
|
@@ -50,14 +56,19 @@
|
|
|
50
56
|
<div ng-if="graphData">
|
|
51
57
|
<div class="card availabilityGraph">
|
|
52
58
|
<div class="card-header">
|
|
53
|
-
<div
|
|
59
|
+
<div
|
|
60
|
+
class="card-title"
|
|
61
|
+
translate
|
|
62
|
+
>
|
|
63
|
+
Last 30 days operability
|
|
64
|
+
</div>
|
|
54
65
|
</div>
|
|
55
66
|
<hr />
|
|
56
67
|
<div class="card-block">
|
|
57
68
|
<nvd3-multi-bar-chart
|
|
58
|
-
data="graphData"
|
|
59
69
|
id="availabilityGraph"
|
|
60
70
|
height="300"
|
|
71
|
+
data="graphData"
|
|
61
72
|
width="1000"
|
|
62
73
|
x="xGraph()"
|
|
63
74
|
y="yGraph()"
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
<div ng-controller=
|
|
1
|
+
<div ng-controller="eventListCtrl as vm">
|
|
2
2
|
<c8y-help src="/users-guide/device-management/#events-all"></c8y-help>
|
|
3
|
-
<c8y-event-list
|
|
3
|
+
<c8y-event-list
|
|
4
|
+
show-page-titles="true"
|
|
5
|
+
filters="vm.filters"
|
|
6
|
+
initial-realtime-state="true"
|
|
7
|
+
/>
|
|
4
8
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function n(t,n,e){c.$inject=["manageCertificateSvc"],s.$inject=["c8yEnterpriseEditionAvailability"],a.$inject=["$scope"];var i=["ROLE_INVENTORY_ADMIN","ROLE_OPTION_MANAGEMENT_ADMIN","ROLE_APPLICATION_MANAGEMENT_ADMIN","ROLE_APPLICATION_MANAGEMENT_READ"];function r(i){return["c8yTenant",function(n){var t=this;n.isEnterpriseEditionTenant().then(function(n){t.title=n?e("Enterprise tenant"):i})}]}function o(i){return["c8yTenant","c8yApplication",function(n,t){return n.isEnterpriseEditionTenant().then(function(n){return!n&&t.isAnyAvailable(i)})}]}function a(n){n.optionsGroups=["twoFactorAuthenticationOptions","supportLinkOptions","passwordResetOptions","emailServerOptions","dataExportOptions","storageLimitOptions","suspendingTenantsOptions"]}function s(n){return n.isAvailable()}function c(n){return n.hasCustomLoadBalancer().then(function(n){return!n})}_.each(["/enterprise","/branding"],function(n){return t.when(n,{template:'\n <c8y-ui-title-set title="vm.title"></c8y-ui-title-set>\n <c8y-branding-configuration-form></c8y-branding-configuration-form>\n ',name:n=e("Branding"),icon:"paint-brush",controller:r(n),controllerAs:"vm"})}),_.each(["/enterprise","/domain_name"],function(n){return t.when(n,{template:'\n <c8y-ui-title-set title="vm.title"></c8y-ui-title-set>\n <c8y-manage-certificate-form></c8y-manage-certificate-form>\n ',name:n=e("Domain name"),icon:"certificate",controller:r(n),controllerAs:"vm",showIf:c})}),n.addNavigation({name:e("Enterprise tenant"),parent:e("Settings"),icon:"enterprise-resource-planning",priority:1e3,path:"enterprise",routerLinkExact:!1,showIf:s,showIfPermissions:{allRoles:i}}),n.addNavigation({name:e("Branding"),parent:e("Settings"),icon:"paint-brush",priority:1e3,path:"branding",showIf:o([{name:"branding"},{name:"feature-branding"}]),showIfPermissions:{allRoles:i}}),n.addNavigation({name:e("Domain name"),parent:e("Settings"),icon:"certificate",priority:1e3,path:"domain_name",showIf:o([{name:"sslmanagement"}]),showIfPermissions:{allRoles:i}}),t.when("/enterprise",{template:'<c8y-platform-configuration
|
|
1
|
+
"use strict";!function(){function n(t,n,e){c.$inject=["manageCertificateSvc"],s.$inject=["c8yEnterpriseEditionAvailability"],a.$inject=["$scope"];var i=["ROLE_INVENTORY_ADMIN","ROLE_OPTION_MANAGEMENT_ADMIN","ROLE_APPLICATION_MANAGEMENT_ADMIN","ROLE_APPLICATION_MANAGEMENT_READ"];function r(i){return["c8yTenant",function(n){var t=this;n.isEnterpriseEditionTenant().then(function(n){t.title=n?e("Enterprise tenant"):i})}]}function o(i){return["c8yTenant","c8yApplication",function(n,t){return n.isEnterpriseEditionTenant().then(function(n){return!n&&t.isAnyAvailable(i)})}]}function a(n){n.optionsGroups=["twoFactorAuthenticationOptions","supportLinkOptions","passwordResetOptions","emailServerOptions","dataExportOptions","storageLimitOptions","suspendingTenantsOptions"]}function s(n){return n.isAvailable()}function c(n){return n.hasCustomLoadBalancer().then(function(n){return!n})}_.each(["/enterprise","/branding"],function(n){return t.when(n,{template:'\n <c8y-ui-title-set title="vm.title"></c8y-ui-title-set>\n <c8y-branding-configuration-form></c8y-branding-configuration-form>\n ',name:n=e("Branding"),icon:"paint-brush",controller:r(n),controllerAs:"vm"})}),_.each(["/enterprise","/domain_name"],function(n){return t.when(n,{template:'\n <c8y-ui-title-set title="vm.title"></c8y-ui-title-set>\n <c8y-manage-certificate-form></c8y-manage-certificate-form>\n ',name:n=e("Domain name"),icon:"certificate",controller:r(n),controllerAs:"vm",showIf:c})}),n.addNavigation({name:e("Enterprise tenant"),parent:e("Settings"),icon:"enterprise-resource-planning",priority:1e3,path:"enterprise",routerLinkExact:!1,showIf:s,showIfPermissions:{allRoles:i}}),n.addNavigation({name:e("Branding"),parent:e("Settings"),icon:"paint-brush",priority:1e3,path:"branding",showIf:o([{name:"branding"},{name:"feature-branding"}]),showIfPermissions:{allRoles:i}}),n.addNavigation({name:e("Domain name"),parent:e("Settings"),icon:"certificate",priority:1e3,path:"domain_name",showIf:o([{name:"sslmanagement"}]),showIfPermissions:{allRoles:i}}),t.when("/enterprise",{template:'<c8y-platform-configuration options-groups="optionsGroups"></c8y-platform-configuration>',name:e("Configuration"),icon:"cog",controller:a})}n.$inject=["c8yViewsProvider","c8yNavigatorProvider","gettext"],angular.module("c8y.enterpriseEdition",["c8y.custom-branding"]).config(n)}();
|
package/eventList/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(){function e(e,t){e.add({name:"Event list",nameDisplay:t("Event list"),description:t("Displays the list of events for selected device."),templateUrl:":::PLUGIN_PATH:::/views/eventList.html",configTemplateUrl:":::PLUGIN_PATH:::/views/eventListConfig.html",previewImage:":::PLUGIN_PATH:::/img/events-list-widget-pr.png",options:{groupsSelectable:!0},displaySettings:{globalTimeContext:!0}})}e.$inject=["c8yComponentsProvider","gettext"],angular.module("c8y.eventList",[]).config(e)}();
|
|
1
|
+
"use strict";!function(){function e(e,t){e.add({name:"Event list",nameDisplay:t("Event list"),description:t("Displays the list of events for selected device."),templateUrl:":::PLUGIN_PATH:::/views/eventList.html",configTemplateUrl:":::PLUGIN_PATH:::/views/eventListConfig.html",previewImage:":::PLUGIN_PATH:::/img/events-list-widget-pr.png",options:{groupsSelectable:!0},displaySettings:{globalTimeContext:!0,globalRealtimeContext:!0}})}e.$inject=["c8yComponentsProvider","gettext"],angular.module("c8y.eventList",[]).config(e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";angular.module("c8y.cockpit.export").directive("c8yExportTimespan",["gettext",function(e){return{restrict:"AE",link:function(t){t.types={LAST_WEEK:e("Last week"),LAST_MONTH:e("Last month"),LAST_YEAR:e("Last year"),CUSTOM:e("Custom")}},scope:{timespan:"=c8yExportTimespan"},templateUrl:":::PLUGIN_PATH:::/views/timespan.html"}}]);
|
|
1
|
+
"use strict";angular.module("c8y.cockpit.export").directive("c8yExportTimespan",["gettext",function(e){return{restrict:"AE",link:function(t){t.types={LAST_24HOURS:e("Last 24 hours"),LAST_7DAYS:e("Last 7 days"),LAST_30DAYS:e("Last 30 days"),LAST_WEEK:e("Last week"),LAST_MONTH:e("Last month"),LAST_YEAR:e("Last year"),CUSTOM:e("Custom")}},scope:{timespan:"=c8yExportTimespan"},templateUrl:":::PLUGIN_PATH:::/views/timespan.html"}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";angular.module("c8y.cockpit.export").factory("c8yExportFilters",["$q","c8yBase","c8yInventory","c8yGroups",function(e,o,a,t){function r(e,t){this.name=e,this.onLoad(t)}function n(e,t){r.call(this,e,t)}function i(e,t,o){r.call(this,e,t,o)}return r.prototype.onLoad=function(e){this.value=e.queryParameters[this.name],this.enabled=Boolean(e.queryParameters[this.name])},r.prototype.onSave=function(e){this.enabled&&(e.queryParameters[this.name]=this.value)},(n.prototype=Object.create(r.prototype)).onLoad=function(e){e=e.queryParameters;this.value=e.source||e.groupId,this.enabled=Boolean(this.value),this.loadSource()},n.prototype.loadSource=function(){var t=this;return this.value?a.detail(this.value).then(o.getResData).then(function(e){t.value=e}):e.when()},n.prototype.onSave=function(e){e=e.queryParameters;delete e.source,delete e.groupId,this.enabled&&this.value&&(t.isGroup(this.value)?e.groupId=this.value.id:e.source=this.value.id)},(i.prototype=Object.create(r.prototype)).onLoad=function(e){var t=e.queryParameters;this.value={dateType:t.dateType||"
|
|
1
|
+
"use strict";angular.module("c8y.cockpit.export").factory("c8yExportFilters",["$q","c8yBase","c8yInventory","c8yGroups",function(e,o,a,t){function r(e,t){this.name=e,this.onLoad(t)}function n(e,t){r.call(this,e,t)}function i(e,t,o){r.call(this,e,t,o)}return r.prototype.onLoad=function(e){this.value=e.queryParameters[this.name],this.enabled=Boolean(e.queryParameters[this.name])},r.prototype.onSave=function(e){this.enabled&&(e.queryParameters[this.name]=this.value)},(n.prototype=Object.create(r.prototype)).onLoad=function(e){e=e.queryParameters;this.value=e.source||e.groupId,this.enabled=Boolean(this.value),this.loadSource()},n.prototype.loadSource=function(){var t=this;return this.value?a.detail(this.value).then(o.getResData).then(function(e){t.value=e}):e.when()},n.prototype.onSave=function(e){e=e.queryParameters;delete e.source,delete e.groupId,this.enabled&&this.value&&(t.isGroup(this.value)?e.groupId=this.value.id:e.source=this.value.id)},(i.prototype=Object.create(r.prototype)).onLoad=function(e){var t=e.queryParameters;this.value={dateType:t.dateType||"LAST_7DAYS",from:t.from,to:t.to},this.enabled=void 0!==t.dateType||""===e.name},i.prototype.onSave=function(e){e=e.queryParameters;delete e.dateType,delete e.from,delete e.to,this.enabled&&_.merge(e,this.value)},{Filter:r,SourceFilter:n,DateRangeFilter:i}}]);
|
package/export/views/detail.html
CHANGED