@c8y/ng1-modules 1021.81.0 → 1022.3.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/alarmsEventsExplorer/alarmsEventsTimelinesConfig/alarmsEventsTimelinesConfig.html +1 -1
- package/assetPropertyWidget/img/asset-properties-widget-pr.png +0 -0
- package/assetPropertyWidget/views/config.html +1 -1
- package/assetTable/assetTable2/img/asset-table-widget-pr.png +0 -0
- package/assetTable/img/asset-table-widget-pr.png +0 -0
- package/core/core/services/audits.js +1 -1
- package/core/core/services/retentions.js +1 -1
- package/core/core/services/tenant.js +1 -1
- package/core/core/services/user.js +1 -1
- package/core/cumulocity.json +0 -1
- package/core/locales/de.po +472 -720
- package/core/locales/es.po +422 -671
- package/core/locales/fr.po +501 -751
- package/core/locales/ja_JP.po +494 -740
- package/core/locales/ko.po +421 -671
- package/core/locales/nl.po +424 -672
- package/core/locales/pl.po +422 -672
- package/core/locales/pt_BR.po +519 -768
- package/core/locales/zh_CN.po +421 -671
- package/core/locales/zh_TW.po +422 -671
- package/core/ui/properties/propertySelector.html +156 -109
- package/core/ui/views/auditList.html +2 -2
- package/core/ui/views/eventList.html +2 -2
- package/core/ui/views/filePicker.html +1 -1
- package/dataBroker/connectors/connectors.service.js +1 -1
- package/dataPointExplorer/img/data-points-graph-widget-pr.png +0 -0
- package/dataPointExplorer/views/widgetConfig.html +92 -94
- package/device-protocols/object-mapping.component.js +1 -1
- package/device-protocols/object-mapping.html +1 -1
- package/deviceDatabase4/modals/configure-discrete-io.html +1 -1
- package/deviceDatabase4/modals/configure-register.html +1 -1
- package/deviceDetail/cumulocity.json +1 -2
- package/deviceStatusWidget/ownerStatus.html +2 -2
- package/deviceStatusWidget/requiredAvailabilityIntervalSetting.html +4 -4
- package/devicemanagement-eventList/index.js +1 -1
- package/enterpriseEdition/cumulocity.json +0 -13
- package/enterpriseEdition/enterpriseEdition.module.js +1 -1
- package/eventList/img/events-list-widget-pr.png +0 -0
- package/eventList/views/eventListConfig.html +39 -32
- package/export/cumulocity.json +0 -1
- package/export/index.js +1 -1
- package/export/services/config.js +1 -1
- package/htmlWidget/index.js +1 -1
- package/kpi/img/data-points-list-widget-pr.png +0 -0
- package/kpi/views/gaugeConfig.html +28 -34
- package/kpi/views/listConfig.html +14 -18
- package/kpi/views/pieChartConfig.html +30 -36
- package/modbusConfiguration4/fieldbus-device-list.component.js +1 -1
- package/modbusWidget4/widget-config.html +74 -84
- package/package.json +11 -13
- package/propertiesLibrary/index.js +1 -1
- package/roles/list/rolesList.html +0 -2
- package/scada/views/componentConfig.html +23 -23
- package/scada/views/mapping.html +41 -39
- package/smartRules/controllers/add.js +1 -1
- package/smartRules/controllers/list.js +1 -1
- package/smartRules/list/smartRulesList.component.js +1 -1
- package/smartRules/list/smartRulesList.html +2 -2
- package/smartRules/services/smartRules.js +1 -1
- package/smartRules/views/add.html +32 -10
- package/smartRules/views/list.html +4 -3
- package/trafficLightWidget/states-mapping.html +82 -69
- package/administration-config/administration-config.module.js +0 -1
- package/administration-config/cumulocity.json +0 -13
- package/asset-notes/assetNotes.component.js +0 -1
- package/asset-notes/assetNotes.html +0 -93
- package/asset-notes/assetNotes.module.js +0 -1
- package/asset-notes/assetNotes.service.js +0 -1
- package/asset-notes/cumulocity.json +0 -13
- package/core/ui/forms/ssh-key-input.html +0 -33
- package/core/ui/forms/ssh-key-input.js +0 -1
- package/devicemanagement-deviceListMap/controllers/deviceListMap.js +0 -1
- package/devicemanagement-deviceListMap/cumulocity.json +0 -19
- package/devicemanagement-deviceListMap/index.js +0 -1
- package/devicemanagement-deviceListMap/views/index.html +0 -21
- package/enterpriseEdition/customBranding/brandingConfiguration.constants.js +0 -1
- package/enterpriseEdition/customBranding/brandingConfiguration.service.js +0 -1
- package/enterpriseEdition/customBranding/brandingConfigurationForm.component.js +0 -1
- package/enterpriseEdition/customBranding/brandingConfigurationForm.html +0 -141
- package/enterpriseEdition/customBranding/brandingConfigurationUi.provider.js +0 -1
- package/enterpriseEdition/customBranding/brandingDeploy.service.js +0 -1
- package/enterpriseEdition/customBranding/brandingProcessExecution.component.js +0 -1
- package/enterpriseEdition/customBranding/brandingProcessExecution.html +0 -120
- package/enterpriseEdition/customBranding/custom-branding.module.js +0 -1
- package/enterpriseEdition/customBranding/microservice.value.js +0 -1
- package/enterpriseEdition/ui-assets/index.js +0 -1
- package/enterpriseEdition/ui-assets/public-options.service.js +0 -1
- package/enterpriseEdition/ui-assets/static-assets.service.js +0 -1
- package/enterpriseEdition/ui-assets/ui-assets.service.js +0 -1
- package/export/controllers/list.js +0 -1
- package/export/views/list.html +0 -298
- package/remoteAccess/clients/remoteAccessClients.service.js +0 -1
- package/remoteAccess/clients/terminal/index.html +0 -30
- package/remoteAccess/clients/terminal/index.js +0 -1
- package/remoteAccess/clients/terminal/shell-adapter.js +0 -1
- package/remoteAccess/clients/terminal/style.css +0 -25
- package/remoteAccess/clients/terminal/telnet-negotiator.js +0 -1
- package/remoteAccess/clients/vnc/vncClient.html +0 -60
- package/remoteAccess/clients/vnc/vncClient.js +0 -1
- package/remoteAccess/cumulocity.json +0 -69
- package/remoteAccess/remoteAccess.module.js +0 -1
- package/remoteAccess/remoteAccess.service.js +0 -1
- package/remoteAccess/remoteAccessEndpointCard/remoteAccessEndpointCard.component.js +0 -1
- package/remoteAccess/remoteAccessEndpointCard/remoteAccessEndpointCard.html +0 -89
- package/remoteAccess/remoteAccessEndpointModal/remoteAccessEndpointModal.component.js +0 -1
- package/remoteAccess/remoteAccessEndpointModal/remoteAccessEndpointModal.html +0 -484
- package/remoteAccess/remoteAccessEndpointModal/suggestedIPAddressTemplate.html +0 -8
- package/remoteAccess/remoteAccessEndpointsList/remoteAccessEndpointsList.component.js +0 -1
- package/remoteAccess/remoteAccessEndpointsList/remoteAccessEndpointsList.html +0 -75
- package/remoteAccess/remoteAccessSettings/remoteAccessSettings.component.js +0 -1
- package/remoteAccess/remoteAccessSettings/remoteAccessSettings.html +0 -37
- package/remoteAccess/remoteAccessUI.provider.js +0 -1
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
style="min-height: 36px"
|
|
4
4
|
>
|
|
5
5
|
<div
|
|
6
|
-
class="
|
|
6
|
+
class="text-12 d-flex a-i-center p-r-4 text-medium flex-no-shrink"
|
|
7
7
|
ng-hide="vm.isEditMode"
|
|
8
8
|
>
|
|
9
9
|
<p translate>Owner</p>
|
|
10
10
|
</div>
|
|
11
11
|
<div
|
|
12
|
-
class="
|
|
12
|
+
class="p-l-4 p-r-0 min-width-0 m-l-auto d-inline-flex a-i-center"
|
|
13
13
|
ng-hide="vm.isEditMode"
|
|
14
14
|
>
|
|
15
15
|
<div
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
style="min-height: 36px"
|
|
5
5
|
>
|
|
6
6
|
<p
|
|
7
|
-
class="
|
|
7
|
+
class="text-12 text-medium flex-no-shrink"
|
|
8
8
|
ng-hide="vm.isEditMode"
|
|
9
9
|
translate
|
|
10
10
|
>
|
|
11
11
|
Required interval
|
|
12
12
|
</p>
|
|
13
13
|
<div
|
|
14
|
-
class="d-flex
|
|
14
|
+
class="d--inline-flex m-l-auto a-i-center min-width-0"
|
|
15
15
|
ng-hide="vm.isEditMode"
|
|
16
16
|
>
|
|
17
17
|
<span>{{ vm.responseInterval || '---' }}</span>
|
|
@@ -114,13 +114,13 @@
|
|
|
114
114
|
style="min-height: 36px"
|
|
115
115
|
>
|
|
116
116
|
<p
|
|
117
|
-
class="
|
|
117
|
+
class="text-12 text-medium flex-no-shrink"
|
|
118
118
|
for="maintenance"
|
|
119
119
|
translate
|
|
120
120
|
>
|
|
121
121
|
Maintenance
|
|
122
122
|
</p>
|
|
123
|
-
<div class="
|
|
123
|
+
<div class="m-l-auto d-inline-flex a-i-center min-width-0">
|
|
124
124
|
<label
|
|
125
125
|
class="c8y-switch c8y-switch--inline"
|
|
126
126
|
uib-tooltip="{{ 'Enable/disable maintenance' | translate }}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{function e(e,n,i){var t="
|
|
1
|
+
(()=>{function e(e,n,i){var t="online1";e.addNavigation({parent:{name:i("Overviews"),icon:"c8y-overviews"},name:i("Events"),priority:1300,icon:t,path:"events"}),n.when("/events",{icon:t,name:i("Events"),templateUrl:":::PLUGIN_PATH:::/views/index.html"}),n.when("/device/:deviceId",{icon:t,name:i("Events"),templateUrl:":::PLUGIN_PATH:::/views/index.html"}),n.when("/service/:deviceId",{icon:t,name:i("Events"),templateUrl:":::PLUGIN_PATH:::/views/index.html"})}e.$inject=["c8yNavigatorProvider","c8yViewsProvider","gettext"],angular.module("c8y.parts.eventList",[]).config(e)})();
|
|
@@ -7,23 +7,10 @@
|
|
|
7
7
|
"description": "Manage enterprise edition configuration",
|
|
8
8
|
"js": [
|
|
9
9
|
"createFile.js",
|
|
10
|
-
"ui-assets/index.js",
|
|
11
|
-
"ui-assets/ui-assets.service.js",
|
|
12
|
-
"ui-assets/public-options.service.js",
|
|
13
|
-
"ui-assets/static-assets.service.js",
|
|
14
10
|
|
|
15
11
|
"enterpriseEdition.module.js",
|
|
16
12
|
"enterpriseEditionAvailability.service.js",
|
|
17
13
|
|
|
18
|
-
"customBranding/custom-branding.module.js",
|
|
19
|
-
"customBranding/microservice.value.js",
|
|
20
|
-
"customBranding/brandingConfigurationUi.provider.js",
|
|
21
|
-
"customBranding/brandingConfigurationForm.component.js",
|
|
22
|
-
"customBranding/brandingConfiguration.service.js",
|
|
23
|
-
"customBranding/brandingConfiguration.constants.js",
|
|
24
|
-
"customBranding/brandingDeploy.service.js",
|
|
25
|
-
"customBranding/brandingProcessExecution.component.js",
|
|
26
|
-
|
|
27
14
|
"sslCertificate/manageCertificate.component.js",
|
|
28
15
|
"sslCertificate/manageCertificate.service.js",
|
|
29
16
|
"sslCertificate/certificateActivation.component.js",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{function n(t,n,
|
|
1
|
+
(()=>{function n(t,n,i){c.$inject=["manageCertificateSvc"],s.$inject=["c8yEnterpriseEditionAvailability"],a.$inject=["$scope"];var e,o=["ROLE_OPTION_MANAGEMENT_ADMIN","ROLE_APPLICATION_MANAGEMENT_ADMIN","ROLE_APPLICATION_MANAGEMENT_READ"],r=["ROLE_INVENTORY_ADMIN","ROLE_MANAGED_OBJECT_ADMIN"];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","/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=i("Domain name"),icon:"certificate",controller:(e=>["c8yTenant",function(n){var t=this;n.isEnterpriseEditionTenant().then(function(n){t.title=n?i("Enterprise tenant"):e})}])(n),controllerAs:"vm",showIf:c,priority:400})}),n.addNavigation({name:i("Enterprise tenant"),parent:i("Settings"),icon:"enterprise-resource-planning",priority:1e3,path:"enterprise",routerLinkExact:!1,showIf:s,showIfPermissions:{allRoles:o,anyRole:r}}),n.addNavigation({name:i("Domain name"),parent:i("Settings"),icon:"certificate",priority:1e3,path:"domain_name",showIf:(e=[{name:"sslmanagement"}],["c8yTenant","c8yApplication",function(n,t){return n.isEnterpriseEditionTenant().then(function(n){return!n&&t.isAnyAvailable(e)})}]),showIfPermissions:{allRoles:o,anyRole:r}}),t.when("/enterprise",{template:'<c8y-platform-configuration options-groups="optionsGroups"></c8y-platform-configuration>',name:i("Configuration"),icon:"cog",controller:a,priority:500})}n.$inject=["c8yViewsProvider","c8yNavigatorProvider","gettext"],angular.module("c8y.enterpriseEdition",[]).config(n)})();
|
|
Binary file
|
|
@@ -1,35 +1,42 @@
|
|
|
1
|
-
<div
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
<div ng-controller="EventListConfigCtrl as ctrl">
|
|
2
|
+
<fieldset class="c8y-fieldset">
|
|
3
|
+
<legend>{{ 'Date' | translate }}</legend>
|
|
4
|
+
<div class="form-group form-group-sm m-b-16">
|
|
5
|
+
<label for="dateSelection">
|
|
6
|
+
{{ 'Date selection' | translate }}
|
|
7
|
+
<button
|
|
8
|
+
type="button"
|
|
9
|
+
class="btn-help btn-help--sm"
|
|
10
|
+
aria-label="{{ 'Help' | translate }}"
|
|
11
|
+
uib-popover-html="ctrl.dateSelectionHelpPopoverText | translate"
|
|
12
|
+
popover-placement="right"
|
|
13
|
+
popover-trigger="'focus'"
|
|
14
|
+
popover-append-to-body="true"
|
|
15
|
+
></button>
|
|
16
|
+
</label>
|
|
17
|
+
<div class="c8y-select-wrapper">
|
|
18
|
+
<select
|
|
19
|
+
id="dateSelection"
|
|
20
|
+
class="form-control"
|
|
21
|
+
title="{{ 'Date selection' | translate }}"
|
|
22
|
+
aria-label="{{ 'Date selection' | translate }}"
|
|
23
|
+
ng-model="config.widgetInstanceGlobalTimeContext"
|
|
24
|
+
>
|
|
25
|
+
<option title="{{ 'Dashboard time range' | translate }}" ng-value="true">
|
|
26
|
+
{{ 'Dashboard time range' | translate }}
|
|
27
|
+
</option>
|
|
28
|
+
<option title="{{ 'Widget' | translate }}" ng-value="undefined">
|
|
29
|
+
{{ 'Widget' | translate }}
|
|
30
|
+
</option>
|
|
31
|
+
</select>
|
|
32
|
+
</div>
|
|
30
33
|
</div>
|
|
31
|
-
</
|
|
34
|
+
</fieldset>
|
|
32
35
|
|
|
33
|
-
<
|
|
34
|
-
|
|
36
|
+
<fieldset class="c8y-fieldset">
|
|
37
|
+
<legend>{{ 'Type' | translate }}</legend>
|
|
38
|
+
<div class="form-group form-group-sm m-b-16">
|
|
39
|
+
<input type="text" class="form-control" ng-model="config.options.type" />
|
|
40
|
+
</div>
|
|
41
|
+
</fieldset>
|
|
35
42
|
</div>
|
package/export/cumulocity.json
CHANGED
package/export/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{function e(e,
|
|
1
|
+
(()=>{function e(e,t){e.when("/export/:exportId/:clone?",{templateUrl:":::PLUGIN_PATH:::/views/detail.html",name:t("Properties"),icon:"graph-report"})}e.$inject=["c8yViewsProvider","gettext"],angular.module("c8y.cockpit.export",[]).config(e)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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}(()=>{e.$inject=["c8yBase","c8yUser","c8yInventory","c8yExportApis","c8yExportFilters","gettext","gettextCatalog","c8yReportsService"],angular.module("c8y.cockpit.export").service("exportConfig",e);var m="c8y_ExportConfiguration",f={name:"",exportType:"csv",queryParameters:{},apiList:[]};function e(t,e,r,n,a,i,o,
|
|
1
|
+
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}(()=>{e.$inject=["c8yBase","c8yUser","c8yInventory","c8yExportApis","c8yExportFilters","gettext","gettextCatalog","c8yReportsService"],angular.module("c8y.cockpit.export").service("exportConfig",e);var m="c8y_ExportConfiguration",f={name:"",exportType:"csv",queryParameters:{},apiList:[]};function e(t,e,r,n,a,i,o,l){var s=[{name:"source",label:i("Object to export"),template:":::PLUGIN_PATH:::/views/filters/source.html",def:[a.SourceFilter,"source"]},{name:"dateType",label:i("Time range"),template:":::PLUGIN_PATH:::/views/filters/dateRange.html",def:[a.DateRangeFilter,"dateType"]}],u=[{name:"Alarms",icon:"bell",label:i("Alarms"),def:[n.Api,"Alarms"]},{name:"Events",icon:"online1",label:i("Events"),def:[n.Api,"Events"]},{name:"ManagedObjects",icon:"cubes",label:i("Managed objects"),def:[n.Api,"ManagedObjects"]},{name:"Measurements",icon:"line-chart",label:i("Measurements"),def:[n.MeasurementsApi],template:":::PLUGIN_PATH:::/views/apis/measurements.html"}];function c(e){for(var t=arguments.length,a=new Array(1<t?t-1:0),r=1;r<t;r++)a[r-1]=arguments[r];return _.map(e,function(e){var t=e.def,r=_.tail(t),n=new((n=_).bind.apply(n,_toConsumableArray([t[0],t[0]].concat(r).concat(a))));return _.assign(n,_.omit(e,"def","name")),n})}this.getFilters=function(e,t){return c(s,e,t)},this.getApis=function(e){return c(u,e)},this.getFileTypes=function(){return[{name:"CSV",type:"csv"},{name:"Excel (.xlsx)",type:"vnd.ms-excel"}]},this.list=function(){return r.list({fragmentType:m,pageSize:200})},this.create=function(e){return _.merge(_.cloneDeep(f),e)},this.detail=function(e){return r.detail(e).then(t.getResData)},this.save=function(e){return e.id?r.save(e).then(function(){return e}):(e[m]={},r.createConfirm(e).then(t.getResData))},this.remove=function(e){return l.removeConfiguration(e)},this.getSmartRuleDefaults=function(t){return e.current().then(function(e){return{name:o.getString('Send "{{name}}" via email',t),c8y_Context:{context:"exportConfiguration",id:t.id},config:{exportConfiguration:_.pick(t,["id","name"]),exportConfigurationId:t.id,to:e.email,subject:o.getString('Export of "{{name}}"',t)}}})}}})();
|
package/htmlWidget/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
angular.module("c8y.parts.htmlwidget",[]).config(["c8yComponentsProvider","gettext",function(e,t){e.add({name:"Html widget",nameDisplay:t("HTML"),description:t("Display custom HTML code"),templateUrl:":::PLUGIN_PATH:::/views/htmlWidget.html",configTemplateUrl:":::PLUGIN_PATH:::/views/config.html",previewImage:":::PLUGIN_PATH:::/img/html-widget-pr.png",options:{groupsSelectable:!0,deviceTargetNotRequired:!0}})}]);
|
|
1
|
+
angular.module("c8y.parts.htmlwidget",[]).config(["c8yComponentsProvider","gettext",function(e,t){function i(e){return e.getFeatureStatePromise("ui.html-widget.v2").then(function(e){return!e})}i.$inject=["c8yFeatureCacheService"],e.add({name:"Html widget",nameDisplay:t("HTML"),description:t("Display custom HTML code"),templateUrl:":::PLUGIN_PATH:::/views/htmlWidget.html",configTemplateUrl:":::PLUGIN_PATH:::/views/config.html",previewImage:":::PLUGIN_PATH:::/img/html-widget-pr.png",options:{groupsSelectable:!0,deviceTargetNotRequired:!0},showIf:i})}]);
|
|
Binary file
|
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
<div ng-form="gaugeForm" ng-controller="kpiConfigCtrl" class="
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
<div ng-form="gaugeForm" ng-controller="kpiConfigCtrl" class="no-card-context bg-inherit">
|
|
2
|
+
<c8y-data-point-list
|
|
3
|
+
max-select-count="1"
|
|
4
|
+
datapoints="config.datapoints"
|
|
5
|
+
ng-model="config"
|
|
6
|
+
dont-save="true"
|
|
7
|
+
no-chart
|
|
8
|
+
allow-adding-data-points-from-context-mo-only="dashboard.deviceType && dashboard.deviceTypeValue"
|
|
9
|
+
class="bg-inherit"
|
|
10
|
+
></c8y-data-point-list>
|
|
11
|
+
|
|
12
|
+
<fieldset class="c8y-fieldset">
|
|
13
|
+
<legend>{{ 'Decimal places' | translate }}</legend>
|
|
14
|
+
<div class="form-group form-group-sm m-b-16">
|
|
15
|
+
<input
|
|
16
|
+
name="decimalPlaces"
|
|
17
|
+
ng-model="config.fractionSize"
|
|
18
|
+
ng-init="config.fractionSize = (config.fractionSize === undefined || config.fractionSize === null ? 2 : config.fractionSize)"
|
|
19
|
+
type="number"
|
|
20
|
+
ng-min="0"
|
|
21
|
+
ng-max="10"
|
|
22
|
+
step="1"
|
|
23
|
+
c8y-model-options="{unsetWhenNull: true}"
|
|
24
|
+
class="form-control"
|
|
25
|
+
placeholder="{{ 'e.g.' | translate}} 2"
|
|
26
|
+
/>
|
|
27
|
+
<c8y-error-feedback field="gaugeForm.decimalPlaces"></c8y-error-feedback>
|
|
13
28
|
</div>
|
|
14
|
-
|
|
15
|
-
<div class="card-header separator">
|
|
16
|
-
<div class="card-title h4">{{ 'Decimal places' | translate }}</div>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="form-group p-t-8">
|
|
19
|
-
<label translate class="sr-only">Decimal places</label>
|
|
20
|
-
<input
|
|
21
|
-
name="decimalPlaces"
|
|
22
|
-
ng-model="config.fractionSize"
|
|
23
|
-
ng-init="config.fractionSize = (config.fractionSize === undefined || config.fractionSize === null ? 2 : config.fractionSize)"
|
|
24
|
-
type="number"
|
|
25
|
-
ng-min="0"
|
|
26
|
-
ng-max="10"
|
|
27
|
-
step="1"
|
|
28
|
-
c8y-model-options="{unsetWhenNull: true}"
|
|
29
|
-
class="form-control"
|
|
30
|
-
placeholder="{{ 'e.g.' | translate}} 2"
|
|
31
|
-
/>
|
|
32
|
-
<c8y-error-feedback field="gaugeForm.decimalPlaces"></c8y-error-feedback>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
29
|
+
</fieldset>
|
|
36
30
|
</div>
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
<div ng-controller="kpiConfigCtrl">
|
|
2
2
|
<div
|
|
3
3
|
ng-controller="listConfigCtrl"
|
|
4
|
-
class="no-card-context
|
|
5
|
-
style="height: calc(100vh - 422px)"
|
|
4
|
+
class="no-card-context"
|
|
6
5
|
>
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
no-chart
|
|
12
|
-
class="bg-level-1"
|
|
13
|
-
allow-adding-data-points-from-context-mo-only="dashboard.deviceType && dashboard.deviceTypeValue"
|
|
14
|
-
></c8y-data-point-list>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="col-md-6 p-r-24 inner-scroll">
|
|
17
|
-
<div class="card-header separator sticky-top bg-level-0">
|
|
18
|
-
<span class="card-title">{{ 'Column visibility' | translate }}</span>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="form-group p-t-8">
|
|
21
|
-
<label class="c8y-checkbox">
|
|
6
|
+
<fieldset class="c8y-fieldset">
|
|
7
|
+
<legend>{{ 'Column visibility' | translate }}</legend>
|
|
8
|
+
<div class="form-group d-flex flex-wrap gap-16">
|
|
9
|
+
<label class="c8y-checkbox m-t-8">
|
|
22
10
|
<input
|
|
23
11
|
type="checkbox"
|
|
24
12
|
ng-model="config.options.kpi"
|
|
@@ -67,6 +55,14 @@
|
|
|
67
55
|
<span>{{ 'Asset' | translate }}</span>
|
|
68
56
|
</label>
|
|
69
57
|
</div>
|
|
70
|
-
</
|
|
58
|
+
</fieldset>
|
|
59
|
+
|
|
60
|
+
<c8y-data-point-list
|
|
61
|
+
ng-model="config"
|
|
62
|
+
datapoints="config.options.dataPoints"
|
|
63
|
+
no-chart
|
|
64
|
+
class="bg-inherit"
|
|
65
|
+
allow-adding-data-points-from-context-mo-only="dashboard.deviceType && dashboard.deviceTypeValue"
|
|
66
|
+
></c8y-data-point-list>
|
|
71
67
|
</div>
|
|
72
68
|
</div>
|
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
<div ng-controller="kpiConfigCtrl" class="
|
|
1
|
+
<div ng-controller="kpiConfigCtrl" class="no-card-context bg-inherit">
|
|
2
2
|
<div ng-controller="pieChartConfigCtrl" class="alert alert-warning m-t-8 center-block" ng-show="differentUnits" translate>
|
|
3
3
|
Measurements with different units are selected.
|
|
4
4
|
</div>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
|
|
6
|
+
<c8y-data-point-list
|
|
7
|
+
basic-list
|
|
8
|
+
ng-model="config"
|
|
9
|
+
datapoints="config.datapoints"
|
|
10
|
+
allow-adding-data-points-from-context-mo-only="dashboard.deviceType && dashboard.deviceTypeValue"
|
|
11
|
+
dont-save="true"
|
|
12
|
+
class="bg-inherit"
|
|
13
|
+
></c8y-data-point-list>
|
|
14
|
+
|
|
15
|
+
<fieldset ng-controller="pieChartConfigCtrl" class="c8y-fieldset">
|
|
16
|
+
<legend translate>Pie Chart Options</legend>
|
|
17
|
+
<div class="form-group d-flex gap-16 flex-wrap m-b-16">
|
|
18
|
+
<label class="c8y-checkbox m-t-8">
|
|
19
|
+
<input type="checkbox" ng-model="config.pieChartOptions.showTooltips" />
|
|
20
|
+
<span></span>
|
|
21
|
+
<span translate>Show tooltips</span>
|
|
22
|
+
</label>
|
|
23
|
+
<label class="c8y-checkbox">
|
|
24
|
+
<input type="checkbox" ng-model="config.pieChartOptions.showLabels" />
|
|
25
|
+
<span></span>
|
|
26
|
+
<span translate>Show percentages</span>
|
|
27
|
+
</label>
|
|
28
|
+
<label class="c8y-checkbox">
|
|
29
|
+
<input type="checkbox" ng-model="config.pieChartOptions.showLegend" />
|
|
30
|
+
<span></span>
|
|
31
|
+
<span translate>Show legend</span>
|
|
32
|
+
</label>
|
|
15
33
|
</div>
|
|
16
|
-
|
|
17
|
-
<div ng-controller="pieChartConfigCtrl">
|
|
18
|
-
<div class="card-header separator">
|
|
19
|
-
<div class="card-title h4" translate>Pie Chart Options</div>
|
|
20
|
-
</div>
|
|
21
|
-
<div class="form-group p-t-8">
|
|
22
|
-
<label class="c8y-checkbox">
|
|
23
|
-
<input type="checkbox" ng-model="config.pieChartOptions.showTooltips" />
|
|
24
|
-
<span></span>
|
|
25
|
-
<span translate>Show tooltips</span>
|
|
26
|
-
</label>
|
|
27
|
-
<label class="c8y-checkbox">
|
|
28
|
-
<input type="checkbox" ng-model="config.pieChartOptions.showLabels" />
|
|
29
|
-
<span></span>
|
|
30
|
-
<span translate>Show percentages</span>
|
|
31
|
-
</label>
|
|
32
|
-
<label class="c8y-checkbox">
|
|
33
|
-
<input type="checkbox" ng-model="config.pieChartOptions.showLegend" />
|
|
34
|
-
<span></span>
|
|
35
|
-
<span translate>Show legend</span>
|
|
36
|
-
</label>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
34
|
+
</fieldset>
|
|
41
35
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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 u,a={},e=Object.prototype,s=e.hasOwnProperty,d=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",o=t.toStringTag||"@@toStringTag";function i(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(u){i=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o,i,a,c,t=t&&t.prototype instanceof g?t:g,t=Object.create(t.prototype),r=new O(r||[]);return d(t,"_invoke",{value:(o=e,i=n,a=r,c=f,function(e,t){if(c===h)throw Error("Generator is already running");if(c===y){if("throw"===e)throw t;return{value:u,done:!0}}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n){n=function e(t,n){var r=n.method,o=t.iterator[r];if(o===u)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=u,e(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;r=l(o,t.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,v;o=r.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=u),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}(n,a);if(n){if(n===v)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===f)throw c=y,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=h;n=l(o,i,a);if("normal"===n.type){if(c=a.done?y:p,n.arg===v)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(c=y,a.method="throw",a.arg=n.arg)}})}),t}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var f="suspendedStart",p="suspendedYield",h="executing",y="completed",v={};function g(){}function m(){}function _(){}var t={},b=(i(t,r,function(){return this}),Object.getPrototypeOf),b=b&&b(b(S([]))),w=(b&&b!==e&&s.call(b,r)&&(t=b),_.prototype=g.prototype=Object.create(t));function E(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function x(a,c){var t;d(this,"_invoke",{value:function(n,r){function e(){return new c(function(e,t){!function t(e,n,r,o){var i,e=l(a[e],a,n);if("throw"!==e.type)return(n=(i=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,r,o)},function(e){t("throw",e,r,o)}):c.resolve(n).then(function(e){i.value=e,r(i)},function(e){return t("throw",e,r,o)});o(e.arg)}(n,r,e,t)})}return t=t?t.then(e,e):e()}})}function D(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 N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function S(t){if(t||""===t){var n,e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n<t.length;)if(s.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=u,e.done=!0,e}).next=e}throw new TypeError(_typeof(t)+" is not iterable")}return d(w,"constructor",{value:m.prototype=_,configurable:!0}),d(_,"constructor",{value:m,configurable:!0}),m.displayName=i(_,o,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,i(e,o,"GeneratorFunction")),e.prototype=Object.create(w),e},a.awrap=function(e){return{__await:e}},E(x.prototype),i(x.prototype,n,function(){return this}),a.AsyncIterator=x,a.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var i=new x(c(e,t,n,r),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},E(w),i(w,o,"Generator"),i(w,r,function(){return this}),i(w,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,n=Object(e),r=[];for(t in n)r.push(t);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=S,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(N),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=u)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=u),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&s.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}var i=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},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),v},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n,r,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(n=o.completion).type&&(r=n.arg,N(o)),r}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=u),v}},a}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,n){var r=c.apply(e,a);function o(e){asyncGeneratorStep(r,t,n,o,i,"next",e)}function i(e){asyncGeneratorStep(r,t,n,o,i,"throw",e)}o(void 0)})}}(()=>{function e(o,n,i,a,c,u,s,d,r,l){var e,f=this;function t(){return(t=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var n;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=f.mode,t.adding=!0,t.protocol=n;try{f.expandedId="",f.reloadDevices(),i.success(l("Child device changes saved."))}catch(e){t.adding=!1,i.danger(l("Failed to change child device."))}o.$apply();case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,n,r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=f.mode,n=f.device,(r=f.newDevice).adding=!0,r.protocol=t,e.prev=3,y())return e.next=7,a.create(n,r);e.next=9;break;case 7:e.next=27;break;case 9:if(v())return e.next=12,c.create(n,r);e.next=14;break;case 12:e.next=27;break;case 14:if(g())return e.next=17,u.create(n,r);e.next=19;break;case 17:e.next=27;break;case 19:if(m())return e.next=22,s.create(n,r);e.next=24;break;case 22:e.next=27;break;case 24:if(b())return e.next=27,d.create(n,r);e.next=27;break;case 27:h(),f.reloadDevices(),i.success(l("New child device added.")),e.next=33;break;case 30:e.prev=30,e.t0=e.catch(3),f.newDevice.adding=!1,i.danger(l("Failed to add new child device."));case 33:o.$apply();case 34:case"end":return e.stop()}},e,null,[[3,30]])}))).apply(this,arguments)}function h(){f.expandedId="",_.unset(f,"newDevice"),f[e].$setPristine(),document.getElementsByName("vm.".concat(e))[0].reset()}function y(){return"modbus"===f.tab}function v(){return"canbus"===f.tab}function g(){return"opcua"===f.tab}function m(){return"profibus"===f.tab}function b(){return"canopen"===f.tab}_.assign(f,{$onInit:function(){e="new".concat(f.mode,"DeviceForm"),f.expandedId=""},shouldShowSection:function(){var e=f.device,t=f.mode,n=!1;y()?"TCP"===t?n=r.supportsOperation(e,"c8y_ModbusDevice"):"RTU"===t&&(n=r.supportsOperation(e,"c8y_ModbusDevice")&&e.c8y_SerialConfiguration):v()&&"CAN"===t?n=r.supportsOperation(e,"c8y_CanDevice"):m()&&"Profibus"===t?n=r.supportsOperation(e,"c8y_ProfibusDevice"):b()&&"CANopen"===t&&(n=r.supportsOperation(e,"c8y_CANopenAddDevice"));return n},isModbusTab:y,isCanBusTab:v,isOPCUATab:g,isProfibusTab:m,isCanOpenTab:b,invalid:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(f.mode,"DeviceForm");return(e=>{var t,n,r,o,i=f.mode,a=f.fieldErrors;"TCP"===i||"RTU"===i?(o=f[e],(r=o.address)&&(n=r.$modelValue,"TCP"===i?(o=o.ipAddress,t=o.$modelValue,_.isUndefined(n)||r.$setValidity(a.ADDRESS_INVALID,(e=>e<=247||255===e)(n)),t=n&&t&&_.some(f.devices,{address:n,ipAddress:t,protocol:"TCP"}),r.$setValidity(a.ADDRESSES_IN_USE,!t),o.$setValidity(a.ADDRESSES_IN_USE,!t)):"RTU"===i&&(o=n&&_.some(f.devices,{address:n,protocol:"RTU"}),r.$setValidity(a.ADDRESS_IN_USE,!o)))):"CANopen"===i&&(t=f[e].nodeId)&&(n=t.$modelValue)&&(r=(e=>1<=e&&e<=127)(n),o=(t=>f.devices.find(function(e){return!(!e||!e.nodeId)&&e.nodeId===t}))(n),r?o?(t.$setValidity(a.NODE_OUT_OF_RANGE,!0),t.$setValidity(a.NODE_IN_USE,!1)):(t.$setValidity(a.NODE_OUT_OF_RANGE,!0),t.$setValidity(a.NODE_IN_USE,!0)):(t.$setValidity(a.NODE_OUT_OF_RANGE,!1),t.$setValidity(a.NODE_IN_USE,!0)))})(t),n.invalid(f,t,e)},getFieldValidationHints:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(f.mode,"DeviceForm"),t=_.get(f,"".concat(t,".").concat(e));if(t)return n.validationHints(t,f.fieldErrorsToMessages);return""},isFormInvalid:function(){return _.get(f,"".concat(e,".$invalid"))||_.get(f,"newDevice.adding")},startAddingNewDevice:function(){f.newDevice={name:null,deviceType:null,address:null}},addNewDevice:function(){return p.apply(this,arguments)},clearNewDevice:h,filterByMode:function(){if(y())return function(e){return _.get(e,"protocol")===f.mode};if(b())return function(e){return e.nodeId};return function(){return!0}},updateDevice:function(e){return t.apply(this,arguments)},startEditDevice:function(e){var t=_.cloneDeep(e);t.adding=!1,_.isUndefined(t.deviceType)||(e=f.deviceConfigurationOptions,t.deviceType=_.find(e.types,function(e){return e.name===t.deviceType}));return t},isEditFormInvalid:function(e,t){return _.get(f,"".concat(e,".$invalid"))||_.get(t,"adding")},toggle:function(e){f.expandedId===e?f.expandedId="":f.expandedId=e},clearEditDevice:function(){f.expandedId=""},getFormName:function(e){if(e)return e=e.id,"vm.form".concat(_.toString(e));return"vm.form"},getDeviceFormName:function(e){return"form".concat(e.id)},expandedId:void 0})}e.$inject=["$rootScope","c8yBase","c8yAlert","c8yModbusDevice","c8yCanbusDevice","c8yOPCUADevice","c8yProfibusDevice","c8yCanopenDevice","c8yDevices","gettext"],angular.module("c8y.modbusConfiguration4").component("c8yFieldbusDeviceList",{templateUrl:":::PLUGIN_PATH:::/fieldbus-device-list.html",bindings:{tab:"@",mode:"@",fieldErrors:"<",fieldErrorsToMessages:"<",deviceConfigurationOptions:"<",device:"<",devices:"<",reloadDevices:"<",onClickDelete:"<",navigateToDetail:"<"},controllerAs:"vm",controller:e})})();
|
|
1
|
+
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 u,a={},e=Object.prototype,s=e.hasOwnProperty,d=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",o=t.toStringTag||"@@toStringTag";function i(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(u){i=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o,i,a,c,t=t&&t.prototype instanceof g?t:g,t=Object.create(t.prototype),r=new O(r||[]);return d(t,"_invoke",{value:(o=e,i=n,a=r,c=f,function(e,t){if(c===h)throw Error("Generator is already running");if(c===y){if("throw"===e)throw t;return{value:u,done:!0}}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n){n=function e(t,n){var r=n.method,o=t.iterator[r];if(o===u)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=u,e(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;r=l(o,t.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,v;o=r.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=u),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}(n,a);if(n){if(n===v)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===f)throw c=y,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=h;n=l(o,i,a);if("normal"===n.type){if(c=a.done?y:p,n.arg===v)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(c=y,a.method="throw",a.arg=n.arg)}})}),t}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=c;var f="suspendedStart",p="suspendedYield",h="executing",y="completed",v={};function g(){}function m(){}function _(){}var t={},b=(i(t,r,function(){return this}),Object.getPrototypeOf),b=b&&b(b(S([]))),w=(b&&b!==e&&s.call(b,r)&&(t=b),_.prototype=g.prototype=Object.create(t));function E(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function x(a,c){var t;d(this,"_invoke",{value:function(n,r){function e(){return new c(function(e,t){!function t(e,n,r,o){var i,e=l(a[e],a,n);if("throw"!==e.type)return(n=(i=e.arg).value)&&"object"==_typeof(n)&&s.call(n,"__await")?c.resolve(n.__await).then(function(e){t("next",e,r,o)},function(e){t("throw",e,r,o)}):c.resolve(n).then(function(e){i.value=e,r(i)},function(e){return t("throw",e,r,o)});o(e.arg)}(n,r,e,t)})}return t=t?t.then(e,e):e()}})}function D(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 N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function S(t){if(t||""===t){var n,e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n<t.length;)if(s.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=u,e.done=!0,e}).next=e}throw new TypeError(_typeof(t)+" is not iterable")}return d(w,"constructor",{value:m.prototype=_,configurable:!0}),d(_,"constructor",{value:m,configurable:!0}),m.displayName=i(_,o,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,i(e,o,"GeneratorFunction")),e.prototype=Object.create(w),e},a.awrap=function(e){return{__await:e}},E(x.prototype),i(x.prototype,n,function(){return this}),a.AsyncIterator=x,a.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var i=new x(c(e,t,n,r),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},E(w),i(w,o,"Generator"),i(w,r,function(){return this}),i(w,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,n=Object(e),r=[];for(t in n)r.push(t);return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=S,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(N),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=u)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=u),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&s.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}var i=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},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),v},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n,r,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(n=o.completion).type&&(r=n.arg,N(o)),r}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=u),v}},a}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(c){return function(){var e=this,a=arguments;return new Promise(function(t,n){var r=c.apply(e,a);function o(e){asyncGeneratorStep(r,t,n,o,i,"next",e)}function i(e){asyncGeneratorStep(r,t,n,o,i,"throw",e)}o(void 0)})}}(()=>{function e(o,n,i,a,c,u,s,d,r,l){var e,f=this;function t(){return(t=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){var n;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=f.mode,t.adding=!0,t.protocol=n;try{f.expandedId="",f.reloadDevices(),i.success(l("Child device changes saved."))}catch(e){t.adding=!1,i.danger(l("Failed to change child device."))}o.$apply();case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,n,r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=f.mode,n=f.device,(r=f.newDevice).adding=!0,r.protocol=t,e.prev=3,y())return e.next=7,a.create(n,r);e.next=9;break;case 7:e.next=27;break;case 9:if(v())return e.next=12,c.create(n,r);e.next=14;break;case 12:e.next=27;break;case 14:if(g())return e.next=17,u.create(n,r);e.next=19;break;case 17:e.next=27;break;case 19:if(m())return e.next=22,s.create(n,r);e.next=24;break;case 22:e.next=27;break;case 24:if(b())return e.next=27,d.create(n,r);e.next=27;break;case 27:h(),f.reloadDevices(),i.success(l("New child device added.")),e.next=33;break;case 30:e.prev=30,e.t0=e.catch(3),f.newDevice.adding=!1,i.danger(l("Failed to add new child device."));case 33:o.$apply();case 34:case"end":return e.stop()}},e,null,[[3,30]])}))).apply(this,arguments)}function h(){f.expandedId="",_.unset(f,"newDevice"),f[e].$setPristine(),document.getElementsByName("vm.".concat(e))[0].reset()}function y(){return"modbus"===f.tab}function v(){return"canbus"===f.tab}function g(){return"opcua"===f.tab}function m(){return"profibus"===f.tab}function b(){return"canopen"===f.tab}_.assign(f,{$onInit:function(){e="new".concat(f.mode,"DeviceForm"),f.expandedId=""},shouldShowSection:function(){var e=f.device,t=f.mode,n=!1;y()?"TCP"===t?n=r.supportsOperation(e,"c8y_ModbusDevice"):"RTU"===t&&(n=r.supportsOperation(e,"c8y_ModbusDevice")&&e.c8y_SerialConfiguration):v()&&"CAN"===t?n=r.supportsOperation(e,"c8y_CanDevice"):m()&&"Profibus"===t?n=r.supportsOperation(e,"c8y_ProfibusDevice"):b()&&"CANopen"===t&&(n=r.supportsOperation(e,"c8y_CANopenAddDevice"));return n},isModbusTab:y,isCanBusTab:v,isOPCUATab:g,isProfibusTab:m,isCanOpenTab:b,invalid:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(f.mode,"DeviceForm");return(e=>{var t,n,r,o,i=f.mode,a=f.fieldErrors;"TCP"===i||"RTU"===i?(o=f[e],(r=o.address)&&(n=r.$modelValue,"TCP"===i?(o=o.ipAddress,t=o.$modelValue,_.isUndefined(n)||r.$setValidity(a.ADDRESS_INVALID,(e=>e<=247||255===e)(n)),t=n&&t&&_.some(f.devices,{address:n,ipAddress:t,protocol:"TCP"}),r.$setValidity(a.ADDRESSES_IN_USE,!t),o.$setValidity(a.ADDRESSES_IN_USE,!t)):"RTU"===i&&(o=n&&_.some(f.devices,{address:n,protocol:"RTU"}),r.$setValidity(a.ADDRESS_IN_USE,!o)))):"CANopen"===i&&(t=f[e].nodeId)&&(n=t.$modelValue)&&(r=(e=>1<=e&&e<=127)(n),o=(t=>!!f.devices&&f.devices.find(function(e){return!(!e||!e.nodeId)&&e.nodeId===t}))(n),r?o?(t.$setValidity(a.NODE_OUT_OF_RANGE,!0),t.$setValidity(a.NODE_IN_USE,!1)):(t.$setValidity(a.NODE_OUT_OF_RANGE,!0),t.$setValidity(a.NODE_IN_USE,!0)):(t.$setValidity(a.NODE_OUT_OF_RANGE,!1),t.$setValidity(a.NODE_IN_USE,!0)))})(t),n.invalid(f,t,e)},getFieldValidationHints:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new".concat(f.mode,"DeviceForm"),t=_.get(f,"".concat(t,".").concat(e));if(t)return n.validationHints(t,f.fieldErrorsToMessages);return""},isFormInvalid:function(){return _.get(f,"".concat(e,".$invalid"))||_.get(f,"newDevice.adding")},startAddingNewDevice:function(){f.newDevice={name:null,deviceType:null,address:null}},addNewDevice:function(){return p.apply(this,arguments)},clearNewDevice:h,filterByMode:function(){if(y())return function(e){return _.get(e,"protocol")===f.mode};if(b())return function(e){return e.nodeId};return function(){return!0}},updateDevice:function(e){return t.apply(this,arguments)},startEditDevice:function(e){var t=_.cloneDeep(e);t.adding=!1,_.isUndefined(t.deviceType)||(e=f.deviceConfigurationOptions,t.deviceType=_.find(e.types,function(e){return e.name===t.deviceType}));return t},isEditFormInvalid:function(e,t){return _.get(f,"".concat(e,".$invalid"))||_.get(t,"adding")},toggle:function(e){f.expandedId===e?f.expandedId="":f.expandedId=e},clearEditDevice:function(){f.expandedId=""},getFormName:function(e){if(e)return e=e.id,"vm.form".concat(_.toString(e));return"vm.form"},getDeviceFormName:function(e){return"form".concat(e.id)},expandedId:void 0})}e.$inject=["$rootScope","c8yBase","c8yAlert","c8yModbusDevice","c8yCanbusDevice","c8yOPCUADevice","c8yProfibusDevice","c8yCanopenDevice","c8yDevices","gettext"],angular.module("c8y.modbusConfiguration4").component("c8yFieldbusDeviceList",{templateUrl:":::PLUGIN_PATH:::/fieldbus-device-list.html",bindings:{tab:"@",mode:"@",fieldErrors:"<",fieldErrorsToMessages:"<",deviceConfigurationOptions:"<",device:"<",devices:"<",reloadDevices:"<",onClickDelete:"<",navigateToDetail:"<"},controllerAs:"vm",controller:e})})();
|