@ -17,30 +17,36 @@
-->
-->
< md-content md-scroll-y layout = "column" class = "gateway-form" >
< md-content md-scroll-y layout = "column" class = "gateway-form" >
< form name = "gatewayConfiguration" >
< form name = "gatewayConfiguration" >
< md-expansion-panel-group >
< md-expansion-panel-group >
< md-expansion-panel md-component-id = "thingsboardPanelId" >
< md-expansion-panel md-component-id = "{{vm.idForm}} thingsboardPanelId" >
< md-expansion-panel-collapsed >
< md-expansion-panel-collapsed >
< div class = "tb-panel-title" > {{ 'gateway.thingsboard' | translate | uppercase }}< / div >
< div class = "tb-panel-title" > {{ 'gateway.thingsboard' | translate | uppercase }}< / div >
< span flex > < / span >
< span flex > < / span >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
< / md-expansion-panel-collapsed >
< / md-expansion-panel-collapsed >
< md-expansion-panel-expanded >
< md-expansion-panel-expanded >
< md-expansion-panel-header ng-click = "vm.collapsePanel('thingsboardPanelId')" >
< md-expansion-panel-header ng-click = "vm.collapsePanel(vm.idForm + 'thingsboardPanelId')" >
< div class = "tb-panel-title" > {{ 'gateway.thingsboard' | translate | uppercase }}< / div >
< div class = "tb-panel-title" > {{ 'gateway.thingsboard' | translate | uppercase }}< / div >
< span flex > < / span >
< span flex > < / span >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
< / md-expansion-panel-header >
< / md-expansion-panel-header >
< md-expansion-panel-content >
< md-expansion-panel-content >
< tb-gateway-config-select tb-required = "true"
< tb-gateway-config-select ng-if = "!vm.isStateForm"
tb-required="true"
ng-model="vm.configurations.gateway"
ng-model="vm.configurations.gateway"
the-form="gatewayConfiguration"
the-form="gatewayConfiguration"
gateway-list="vm.gateways"
gateway-list="vm.gateways"
get_access_token="vm.getAccessToken"
get_access_token="vm.getAccessToken"
create-device="vm.createDevice">
create-device="vm.createDevice">
< / tb-gateway-config-select >
< / tb-gateway-config-select >
< md-input-container ng-if = "vm.isStateForm"
class="md-block">
< label > {{'gateway.gateway-name' | translate }}< / label >
< input ng-disabled = "true" type = "text" ng-model = "vm.configurations.gateway.name" name = "gatewayName" / >
< / md-input-container >
< md-input-container class = "md-block" >
< md-input-container class = "md-block" >
< label > {{'gateway.security-type' | translate }}< / label >
< label > {{'gateway.security-type' | translate }}< / label >
< md-select name = "securityType" ng-model = "vm.configurations.securityType" required >
< md-select ng-disabled = "vm.isReadOnlyForm" n ame = "securityType" ng-model = "vm.configurations.securityType" required >
< md-option ng-repeat = "securityType in vm.securityTypes" ng-value = "securityType.value" >
< md-option ng-repeat = "securityType in vm.securityTypes" ng-value = "securityType.value" >
{{securityType.name | translate}}
{{securityType.name | translate}}
< / md-option >
< / md-option >
@ -50,14 +56,14 @@
ng-class="{'gateway-config-row-vertical': vm.changeAlignment}">
ng-class="{'gateway-config-row-vertical': vm.changeAlignment}">
< md-input-container class = "md-block" flex >
< md-input-container class = "md-block" flex >
< label > {{ 'gateway.thingsboard-host' | translate }}< / label >
< label > {{ 'gateway.thingsboard-host' | translate }}< / label >
< input type = "text" name = "host" ng-model = "vm.configurations.host" required >
< input ng-disabled = "vm.isReadOnlyForm" type = "text" name = "host" ng-model = "vm.configurations.host" required >
< div ng-messages = "gatewayConfiguration.host.$error" >
< div ng-messages = "gatewayConfiguration.host.$error" >
< div ng-message = "required" translate > gateway.thingsboard-host-required< / div >
< div ng-message = "required" translate > gateway.thingsboard-host-required< / div >
< / div >
< / div >
< / md-input-container >
< / md-input-container >
< md-input-container class = "md-block" flex >
< md-input-container class = "md-block" flex >
< label > {{ 'gateway.thingsboard-port' | translate }}< / label >
< label > {{ 'gateway.thingsboard-port' | translate }}< / label >
< input type = "number" min = "1" max = "65535" ng-pattern = "/^-?[0-9]+$/" name = "port"
< input ng-disabled = "vm.isReadOnlyForm" type = "number" min = "1" max = "65535" ng-pattern = "/^-?[0-9]+$/" name = "port"
ng-model="vm.configurations.port" required>
ng-model="vm.configurations.port" required>
< div ng-messages = "gatewayConfiguration.port.$error" >
< div ng-messages = "gatewayConfiguration.port.$error" >
< div ng-message = "required" translate > gateway.thingsboard-port-required< / div >
< div ng-message = "required" translate > gateway.thingsboard-port-required< / div >
@ -70,18 +76,18 @@
< div ng-if = "vm.configurations.securityType=='tls'" >
< div ng-if = "vm.configurations.securityType=='tls'" >
< md-input-container class = "md-block security-type" >
< md-input-container class = "md-block security-type" >
< label > {{'gateway.tls-path-ca-certificate' | translate }}< / label >
< label > {{'gateway.tls-path-ca-certificate' | translate }}< / label >
< input type = "text" ng-model = "vm.configurations.caCertPath" name = "caCertPath" / >
< input ng-disabled = "vm.isReadOnlyForm" type = "text" ng-model = "vm.configurations.caCertPath" name = "caCertPath" / >
< / md-input-container >
< / md-input-container >
< md-input-container class = "md-block" >
< md-input-container class = "md-block" >
< label > {{'gateway.tls-path-private-key' | translate }}< / label >
< label > {{'gateway.tls-path-private-key' | translate }}< / label >
< input type = "text" ng-model = "vm.configurations.privateKeyPath" name = "privateKeyPath" / >
< input ng-disabled = "vm.isReadOnlyForm" type = "text" ng-model = "vm.configurations.privateKeyPath" name = "privateKeyPath" / >
< / md-input-container >
< / md-input-container >
< md-input-container class = "md-block" >
< md-input-container class = "md-block" >
< label > {{'gateway.tls-path-client-certificate' | translate }}< / label >
< label > {{'gateway.tls-path-client-certificate' | translate }}< / label >
< input type = "text" ng-model = "vm.configurations.certPath" name = "certPath" / >
< input ng-disabled = "vm.isReadOnlyForm" type = "text" ng-model = "vm.configurations.certPath" name = "certPath" / >
< / md-input-container >
< / md-input-container >
< / div >
< / div >
< md-checkbox ng-model = "vm.configurations.remoteConfiguration"
< md-checkbox ng-show = "!vm.isReadOnlyForm" ng- model = "vm.configurations.remoteConfiguration"
name="remoteConfiguration"
name="remoteConfiguration"
aria-label="{{ 'gateway.remote-remote' | translate }}">
aria-label="{{ 'gateway.remote-remote' | translate }}">
{{ 'gateway.remote' | translate }}
{{ 'gateway.remote' | translate }}
@ -90,7 +96,7 @@
ng-class="{'gateway-config-row-vertical': vm.changeAlignment}">
ng-class="{'gateway-config-row-vertical': vm.changeAlignment}">
< md-input-container class = "md-block md-select-container" flex >
< md-input-container class = "md-block md-select-container" flex >
< label > {{'gateway.remote-logging-level' | translate }}< / label >
< label > {{'gateway.remote-logging-level' | translate }}< / label >
< md-select name = "loggingLevel" ng-model = "vm.configurations.remoteLoggingLevel" >
< md-select ng-disabled = "vm.isReadOnlyForm" n ame = "loggingLevel" ng-model = "vm.configurations.remoteLoggingLevel" >
< md-option ng-repeat = "logLevel in vm.types.gatewayLogLevel"
< md-option ng-repeat = "logLevel in vm.types.gatewayLogLevel"
ng-value="logLevel" ng-selected="$index === 5">
ng-value="logLevel" ng-selected="$index === 5">
{{logLevel}}
{{logLevel}}
@ -99,7 +105,7 @@
< / md-input-container >
< / md-input-container >
< md-input-container class = "md-block" flex >
< md-input-container class = "md-block" flex >
< label > {{'gateway.path-logs' | translate }}< / label >
< label > {{'gateway.path-logs' | translate }}< / label >
< input type = "text" ng-model = "vm.configurations.remoteLoggingPathToLogs"
< input ng-disabled = "vm.isReadOnlyForm" type = "text" ng-model = "vm.configurations.remoteLoggingPathToLogs"
name="remoteLoggingPathToLogs" required>
name="remoteLoggingPathToLogs" required>
< div ng-messages = "gatewayConfiguration.remoteLoggingPathToLogs.$error" >
< div ng-messages = "gatewayConfiguration.remoteLoggingPathToLogs.$error" >
< div ng-message = "required" translate > gateway.path-logs-required< / div >
< div ng-message = "required" translate > gateway.path-logs-required< / div >
@ -109,14 +115,14 @@
< / md-expansion-panel-content >
< / md-expansion-panel-content >
< / md-expansion-panel-expanded >
< / md-expansion-panel-expanded >
< / md-expansion-panel >
< / md-expansion-panel >
< md-expansion-panel md-component-id = "storagePanelId" >
< md-expansion-panel md-component-id = "{{vm.idForm}} storagePanelId" >
< md-expansion-panel-collapsed >
< md-expansion-panel-collapsed >
< div class = "tb-panel-title" > {{ 'gateway.storage' | translate | uppercase }}< / div >
< div class = "tb-panel-title" > {{ 'gateway.storage' | translate | uppercase }}< / div >
< span flex > < / span >
< span flex > < / span >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
< / md-expansion-panel-collapsed >
< / md-expansion-panel-collapsed >
< md-expansion-panel-expanded >
< md-expansion-panel-expanded >
< md-expansion-panel-header ng-click = "vm.collapsePanel('storagePanelId')" >
< md-expansion-panel-header ng-click = "vm.collapsePanel(vm.idForm + 'storagePanelId')" >
< div class = "tb-panel-title" > {{ 'gateway.storage' | translate | uppercase }}< / div >
< div class = "tb-panel-title" > {{ 'gateway.storage' | translate | uppercase }}< / div >
< span flex > < / span >
< span flex > < / span >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
@ -124,18 +130,17 @@
< md-expansion-panel-content >
< md-expansion-panel-content >
< md-input-container class = "md-block" flex >
< md-input-container class = "md-block" flex >
< label > {{'gateway.storage-type' | translate }}< / label >
< label > {{'gateway.storage-type' | translate }}< / label >
< md-select required ng-model = "vm.configurations.storageType" >
< md-select ng-disabled = "vm.isReadOnlyForm" required ng-model = "vm.configurations.storageType" >
< md-option ng-repeat = "storageType in vm.storageTypes" ng-value = "storageType.value" >
< md-option ng-repeat = "storageType in vm.storageTypes" ng-value = "storageType.value" >
{{storageType.name | translate}}
{{storageType.name | translate}}
< / md-option >
< / md-option >
< / md-select >
< / md-select >
< / md-input-container >
< / md-input-container >
< div layout = "row" class = "gateway-form-row"
< div layout = "row" class = "gateway-form-row"
ng-class="{'gateway-config-row-vertical': vm.changeAlignment}">
ng-class="{'gateway-config-row-vertical': vm.changeAlignment}">
< md-input-container class = "md-block" flex >
< md-input-container class = "md-block" flex >
< label > {{'gateway.storage-pack-size' | translate }}< / label >
< label > {{'gateway.storage-pack-size' | translate }}< / label >
< input type = "number" min = "1" name = "readRecordsCount" ng-pattern = "/^-?[0-9]+$/"
< input ng-disabled = "vm.isReadOnlyForm" type = "number" min = "1" name = "readRecordsCount" ng-pattern = "/^-?[0-9]+$/"
ng-model='vm.configurations.readRecordsCount' required/>
ng-model='vm.configurations.readRecordsCount' required/>
< div ng-messages = "gatewayConfiguration.readRecordsCount.$error" >
< div ng-messages = "gatewayConfiguration.readRecordsCount.$error" >
< div ng-message = "required" translate > gateway.storage-pack-size-required< / div >
< div ng-message = "required" translate > gateway.storage-pack-size-required< / div >
@ -143,10 +148,9 @@
< div ng-message = "pattern" translate > gateway.storage-pack-size-pattern< / div >
< div ng-message = "pattern" translate > gateway.storage-pack-size-pattern< / div >
< / div >
< / div >
< / md-input-container >
< / md-input-container >
< md-input-container class = "md-block" flex >
< md-input-container class = "md-block" flex >
< label translate > {{ vm.configurations.storageType !== 'fileStorage' ? 'gateway.storage-max-records' : 'gateway.storage-max-file-records' }}< / label >
< label translate > {{ vm.configurations.storageType !== 'fileStorage' ? 'gateway.storage-max-records' : 'gateway.storage-max-file-records' }}< / label >
< input type = "number" min = "1" name = "maxRecordsCount" ng-pattern = "/^-?[0-9]+$/"
< input ng-disabled = "vm.isReadOnlyForm" type = "number" min = "1" name = "maxRecordsCount" ng-pattern = "/^-?[0-9]+$/"
ng-model='vm.configurations.maxRecordsCount' required/>
ng-model='vm.configurations.maxRecordsCount' required/>
< div ng-messages = "gatewayConfiguration.maxRecordsCount.$error" >
< div ng-messages = "gatewayConfiguration.maxRecordsCount.$error" >
< div ng-message = "required" translate > gateway.storage-max-records-required< / div >
< div ng-message = "required" translate > gateway.storage-max-records-required< / div >
@ -155,13 +159,12 @@
< / div >
< / div >
< / md-input-container >
< / md-input-container >
< / div >
< / div >
< div layout = "row" class = "gateway-form-row"
< div layout = "row" class = "gateway-form-row"
ng-if="vm.configurations.storageType == 'fileStorage'"
ng-if="vm.configurations.storageType == 'fileStorage'"
ng-class="{'gateway-config-row-vertical': vm.changeAlignment}">
ng-class="{'gateway-config-row-vertical': vm.changeAlignment}">
< md-input-container class = "md-block" flex >
< md-input-container class = "md-block" flex >
< label > {{'gateway.storage-max-files' | translate }}< / label >
< label > {{'gateway.storage-max-files' | translate }}< / label >
< input type = "number" min = "1" name = "maxFilesCount" ng-pattern = "/^-?[0-9]+$/"
< input ng-disabled = "vm.isReadOnlyForm" type = "number" min = "1" name = "maxFilesCount" ng-pattern = "/^-?[0-9]+$/"
ng-model='vm.configurations.maxFilesCount' required/>
ng-model='vm.configurations.maxFilesCount' required/>
< div ng-messages = "gatewayConfiguration.maxFilesCount.$error" >
< div ng-messages = "gatewayConfiguration.maxFilesCount.$error" >
< div ng-message = "required" translate > gateway.storage-max-files-required< / div >
< div ng-message = "required" translate > gateway.storage-max-files-required< / div >
@ -169,10 +172,9 @@
< div ng-message = "pattern" translate > gateway.storage-max-files-pattern< / div >
< div ng-message = "pattern" translate > gateway.storage-max-files-pattern< / div >
< / div >
< / div >
< / md-input-container >
< / md-input-container >
< md-input-container class = "md-block" flex >
< md-input-container class = "md-block" flex >
< label > {{'gateway.storage-path' | translate }}< / label >
< label > {{'gateway.storage-path' | translate }}< / label >
< input type = "text" name = "dataFolderPath" ng-model = 'vm.configurations.dataFolderPath'
< input ng-disabled = "vm.isReadOnlyForm" type = "text" name = "dataFolderPath" ng-model = 'vm.configurations.dataFolderPath'
required/>
required/>
< div ng-messages = "gatewayConfiguration.dataFolderPath.$error" >
< div ng-messages = "gatewayConfiguration.dataFolderPath.$error" >
< div ng-message = "required" translate > gateway.storage-path-required< / div >
< div ng-message = "required" translate > gateway.storage-path-required< / div >
@ -182,14 +184,14 @@
< / md-expansion-panel-content >
< / md-expansion-panel-content >
< / md-expansion-panel-expanded >
< / md-expansion-panel-expanded >
< / md-expansion-panel >
< / md-expansion-panel >
< md-expansion-panel md-component-id = "connectorsPanelId" >
< md-expansion-panel md-component-id = "{{vm.idForm}} connectorsPanelId" >
< md-expansion-panel-collapsed >
< md-expansion-panel-collapsed >
< div class = "tb-panel-title" > {{ 'gateway.connectors' | translate | uppercase }}< / div >
< div class = "tb-panel-title" > {{ 'gateway.connectors' | translate | uppercase }}< / div >
< span flex > < / span >
< span flex > < / span >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
< / md-expansion-panel-collapsed >
< / md-expansion-panel-collapsed >
< md-expansion-panel-expanded >
< md-expansion-panel-expanded >
< md-expansion-panel-header ng-click = "vm.collapsePanel('connectorsPanelId')" >
< md-expansion-panel-header ng-click = "vm.collapsePanel(vm.idForm + 'connectorsPanelId')" >
< div class = "tb-panel-title" > {{ 'gateway.connectors' | translate | uppercase }}< / div >
< div class = "tb-panel-title" > {{ 'gateway.connectors' | translate | uppercase }}< / div >
< span flex > < / span >
< span flex > < / span >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
< md-expansion-panel-icon > < / md-expansion-panel-icon >
@ -198,13 +200,14 @@
< tb-gateway-config
< tb-gateway-config
gateway-config="vm.configurations.connectors"
gateway-config="vm.configurations.connectors"
the-form="gatewayConfiguration"
the-form="gatewayConfiguration"
change-alignment="vm.changeAlignment">
change-alignment="vm.changeAlignment"
is-read-only="vm.isReadOnlyForm">
< / tb-gateway-config >
< / tb-gateway-config >
< / md-expansion-panel-content >
< / md-expansion-panel-content >
< / md-expansion-panel-expanded >
< / md-expansion-panel-expanded >
< / md-expansion-panel >
< / md-expansion-panel >
< / md-expansion-panel-group >
< / md-expansion-panel-group >
< section layout = "row" layout-align = "end center" class = "form-action-buttons" >
< section ng-show = "!vm.isReadOnlyForm" layout = "row" layout-align = "end center" class = "form-action-buttons" >
< md-button class = "md-primary md-raised"
< md-button class = "md-primary md-raised"
ng-click="vm.exportConfig()"
ng-click="vm.exportConfig()"
ng-if="!vm.configurations.remoteConfiguration"
ng-if="!vm.configurations.remoteConfiguration"
@ -213,14 +216,14 @@
{{'action.download' | translate }}
{{'action.download' | translate }}
< md-tooltip > {{'gateway.download-tip' | translate }}< / md-tooltip >
< md-tooltip > {{'gateway.download-tip' | translate }}< / md-tooltip >
< / md-button >
< / md-button >
< md-button class = "md-primary md-raised"
< md-button class = "md-primary md-raised"
ng-click="vm.saveAttributeConfig()"
ng-click="vm.saveAttributeConfig()"
ng-if="vm.configurations.remoteConfiguration"
ng-if="vm.configurations.remoteConfiguration"
ng-disabled="gatewayConfiguration.$invalid || !gatewayConfiguration.$dirty"
ng-disabled="gatewayConfiguration.$invalid || !gatewayConfiguration.$dirty"
aria-label="{{ 'gateway.save-tip' | translate }}">
aria-label="{{ 'gateway.save-tip' | translate }}">
{{'action.save' | translate }}
{{'action.save' | translate }}
< md-tooltip ng-if = "vm.configurations.remoteConfiguration" > {{'gateway.save-tip' | translate }}< / md-tooltip >
< md-tooltip ng-if = "vm.configurations.remoteConfiguration" > {{'gateway.save-tip' | translate }}
< / md-tooltip >
< / md-button >
< / md-button >
< / section >
< / section >
< / form >
< / form >