From 6c15874dde9b8028cff89503521e94c045185e89 Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 14 Feb 2020 19:06:06 +0200 Subject: [PATCH] new widget for gateway with the last telemetry type --- .../gateway-config-select.directive.js | 1 + .../gateway/gateway-config.directive.js | 3 +- .../gateway/gateway-config.tpl.html | 12 +- .../gateway/gateway-form.directive.js | 79 +++++++--- .../components/gateway/gateway-form.tpl.html | 63 ++++---- .../gateway/state-gateway-dialog.scss | 18 +++ .../gateway/state-gateway-dialog.tpl.html | 52 ++++++ .../gateway/state-gateway-form.directive.js | 149 ++++++++++++++++++ .../gateway/state-gateway-form.scss | 18 +++ .../gateway/state-gateway-form.tpl.html | 28 ++++ ui/src/app/layout/index.js | 2 + ui/src/app/locale/locale.constant-en_US.json | 7 +- 12 files changed, 369 insertions(+), 63 deletions(-) create mode 100644 ui/src/app/components/gateway/state-gateway-dialog.scss create mode 100644 ui/src/app/components/gateway/state-gateway-dialog.tpl.html create mode 100644 ui/src/app/components/gateway/state-gateway-form.directive.js create mode 100644 ui/src/app/components/gateway/state-gateway-form.scss create mode 100644 ui/src/app/components/gateway/state-gateway-form.tpl.html diff --git a/ui/src/app/components/gateway/gateway-config-select.directive.js b/ui/src/app/components/gateway/gateway-config-select.directive.js index 79ff454475..05dc11b31a 100644 --- a/ui/src/app/components/gateway/gateway-config-select.directive.js +++ b/ui/src/app/components/gateway/gateway-config-select.directive.js @@ -48,6 +48,7 @@ function GatewayConfigSelect($compile, $templateCache, $mdConstant, $translate, function startWatchers() { scope.$watch('gateway', function (newVal, prevVal) { if (!angular.equals(newVal, prevVal) && newVal !== null) { + console.log("select startWatchers", "newVal", newVal, "prevVal", prevVal); //eslint-disable-line scope.updateView(); } }); diff --git a/ui/src/app/components/gateway/gateway-config.directive.js b/ui/src/app/components/gateway/gateway-config.directive.js index 120a6d3e15..4c361fdc56 100644 --- a/ui/src/app/components/gateway/gateway-config.directive.js +++ b/ui/src/app/components/gateway/gateway-config.directive.js @@ -37,7 +37,8 @@ function GatewayConfig() { disabled: '=ngDisabled', gatewayConfig: '=', changeAlignment: '=', - theForm: '=' + theForm: '=', + isReadOnly: '=' }, controller: GatewayConfigController, controllerAs: 'vm', diff --git a/ui/src/app/components/gateway/gateway-config.tpl.html b/ui/src/app/components/gateway/gateway-config.tpl.html index eef7c737e4..e4525b2bf2 100644 --- a/ui/src/app/components/gateway/gateway-config.tpl.html +++ b/ui/src/app/components/gateway/gateway-config.tpl.html @@ -18,7 +18,7 @@
-
@@ -26,7 +26,7 @@ ng-class="{'gateway-config-row-vertical': vm.changeAlignment}"> - @@ -39,7 +39,7 @@ -
@@ -49,7 +49,7 @@
- more_horiz @@ -57,7 +57,7 @@ {{ 'gateway.update-config' | translate }} - close @@ -70,7 +70,7 @@ layout-align="center center" ng-class="{'disabled': vm.disabled}" class="no-data-found" translate>{{'gateway.no-connectors'}}
- {{ 'gateway.connector-add' | translate }} diff --git a/ui/src/app/components/gateway/gateway-form.directive.js b/ui/src/app/components/gateway/gateway-form.directive.js index 1e2e02ce24..e558e20e38 100644 --- a/ui/src/app/components/gateway/gateway-form.directive.js +++ b/ui/src/app/components/gateway/gateway-form.directive.js @@ -31,11 +31,14 @@ function GatewayForm() { scope: true, bindToController: { formId: '=', - ctx: '=' + ctx: '=', + deviceName: '=', + isReadOnly: '=', + isState: '=' }, controller: GatewayFormController, controllerAs: 'vm', - templateUrl: gatewayFormTemplate + templateUrl: gatewayFormTemplate, }; } @@ -50,7 +53,11 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, const templateLogsConfig = '[loggers]}}keys=root, service, connector, converter, tb_connection, storage, extension}}[handlers]}}keys=consoleHandler, serviceHandler, connectorHandler, converterHandler, tb_connectionHandler, storageHandler, extensionHandler}}[formatters]}}keys=LogFormatter}}[logger_root]}}level=ERROR}}handlers=consoleHandler}}[logger_connector]}}level={ERROR}}}handlers=connectorHandler}}formatter=LogFormatter}}qualname=connector}}[logger_storage]}}level={ERROR}}}handlers=storageHandler}}formatter=LogFormatter}}qualname=storage}}[logger_tb_connection]}}level={ERROR}}}handlers=tb_connectionHandler}}formatter=LogFormatter}}qualname=tb_connection}}[logger_service]}}level={ERROR}}}handlers=serviceHandler}}formatter=LogFormatter}}qualname=service}}[logger_converter]}}level={ERROR}}}handlers=connectorHandler}}formatter=LogFormatter}}qualname=converter}}[logger_extension]}}level={ERROR}}}handlers=connectorHandler}}formatter=LogFormatter}}qualname=extension}}[handler_consoleHandler]}}class=StreamHandler}}level={ERROR}}}formatter=LogFormatter}}args=(sys.stdout,)}}[handler_connectorHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}connector.log", "d", 1, 7,)}}[handler_storageHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}storage.log", "d", 1, 7,)}}[handler_serviceHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}service.log", "d", 1, 7,)}}[handler_converterHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}converter.log", "d", 1, 3,)}}[handler_extensionHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}extension.log", "d", 1, 3,)}}[handler_tb_connectionHandler]}}level={ERROR}}}class=logging.handlers.TimedRotatingFileHandler}}formatter=LogFormatter}}args=("{./logs/}tb_connection.log", "d", 1, 3,)}}[formatter_LogFormatter]}}format="%(asctime)s - %(levelname)s - [%(filename)s] - %(module)s - %(lineno)d - %(message)s" }}datefmt="%Y-%m-%d %H:%M:%S"'; vm.types = types; - + vm.deviceNameForm = (vm.deviceName) ? vm.deviceName : null; + // vm.isReadOnlyForm = (vm.isReadOnly) ? vm.isReadOnly : false; + // vm.isStateForm = (vm.isState) ? vm.isState : false; + vm.isStateForm = true; + vm.idForm = Math.random().toString(36).replace(/^0\.[0-9]*/, ''); vm.configurations = { gateway: '', host: $document[0].domain, @@ -92,13 +99,17 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, }]; $scope.$watch('vm.ctx', function () { - if (vm.ctx ) { + if (vm.ctx) { vm.settings = vm.ctx.settings; vm.widgetConfig = vm.ctx.widgetConfig; - initializeConfig(); + if (vm.ctx.datasources && vm.ctx.datasources.length) { + vm.deviceNameForm = vm.ctx.datasources[0].name; + } } + initializeConfig(); }); + $scope.$on('gateway-form-resize', function (event, formId) { if (vm.formId == formId) { updateWidgetDisplaying(); @@ -106,21 +117,34 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, }); function updateWidgetDisplaying() { - vm.changeAlignment = (vm.ctx.$container[0].offsetWidth <= 425); + if (vm.ctx) { + vm.changeAlignment = (vm.ctx.$container[0].offsetWidth <= 425); + } } function initWidgetSettings() { let widgetTitle; - if (vm.settings.widgetTitle && vm.settings.widgetTitle.length) { - widgetTitle = utils.customTranslation(vm.settings.widgetTitle, vm.settings.widgetTitle); + if (vm.settings) { + vm.isReadOnlyForm = (vm.settings.readOnly) ? vm.settings.readOnly : false; + if (vm.settings.gatewayTitle && vm.settings.gatewayTitle.length) { + widgetTitle = utils.customTranslation(vm.settings.gatewayTitle, vm.settings.gatewayTitle); + } } else { + vm.isReadOnlyForm = false; widgetTitle = $translate.instant('gateway.gateway'); } - vm.ctx.widgetTitle = widgetTitle; + if (vm.ctx) { + vm.ctx.widgetTitle = widgetTitle; + } - archiveFileName = vm.settings.archiveFileName && vm.settings.archiveFileName.length ? vm.settings.archiveFileName : 'gatewayConfiguration'; - gatewayNameExists = utils.customTranslation(vm.settings.deviceNameExist, vm.settings.deviceNameExist) || $translate.instant('gateway.gateway-exists'); - successfulSaved = utils.customTranslation(vm.settings.successfulSave, vm.settings.successfulSave) || $translate.instant('gateway.gateway-saved'); + archiveFileName = vm.settings && vm.settings.archiveFileName && vm.settings.archiveFileName.length ? vm.settings.archiveFileName : 'gatewayConfiguration'; + if (vm.settings) { + gatewayNameExists = utils.customTranslation(vm.settings.deviceNameExist, vm.settings.deviceNameExist) || $translate.instant('gateway.gateway-exists'); + successfulSaved = utils.customTranslation(vm.settings.successfulSave, vm.settings.successfulSave) || $translate.instant('gateway.gateway-saved'); + } else { + gatewayNameExists = $translate.instant('gateway.gateway-exists'); + successfulSaved = $translate.instant('gateway.gateway-saved'); + } } function initializeConfig() { @@ -129,6 +153,7 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, getGatewaysList(true); } + vm.getAccessToken = (deviceId) => { if (deviceId.id) { getDeviceCredentials(deviceId.id); @@ -149,18 +174,19 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, } vm.createDevice = (deviceObj) => { + // console.log("vm.createDevice deviceObj", deviceObj); //eslint-disable-line deviceService.findByName(deviceObj.name, {ignoreErrors: true}) .then( function () { - toast.showError(gatewayNameExists, angular.element('.gateway-form'),'top left'); + toast.showError(gatewayNameExists, angular.element('.gateway-form'), 'top left'); }, function () { - if(vm.settings.gatewayType && vm.settings.gatewayType.length){ + if (vm.settings.gatewayType && vm.settings.gatewayType.length) { deviceObj.type = vm.settings.gatewayType; } deviceService.saveDevice(deviceObj).then( (device) => { - getDeviceCredentials(device.id.id).then(() =>{ + getDeviceCredentials(device.id.id).then(() => { getGatewaysList(); }); } @@ -173,8 +199,8 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, saveAttribute(configurationAttribute, $window.btoa(angular.toJson(getGatewayConfigJSON())), types.attributesScope.shared.value), saveAttribute(configurationDraftsAttribute, $window.btoa(angular.toJson(getDraftConnectorJSON())), types.attributesScope.server.value), saveAttribute(remoteLoggingLevelAttribute, vm.configurations.remoteLoggingLevel.toUpperCase(), types.attributesScope.shared.value) - ]).then(() =>{ - toast.showSuccess(successfulSaved, 2000, angular.element('.gateway-form'),'top left'); + ]).then(() => { + toast.showSuccess(successfulSaved, 2000, angular.element('.gateway-form'), 'top left'); }) }; @@ -238,7 +264,7 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, config += ' max_records_per_file: ' + vm.configurations.maxRecordsCount + '\n'; } config += 'connectors:\n'; - for(let i = 0; i < vm.configurations.connectors.length; i++){ + for (let i = 0; i < vm.configurations.connectors.length; i++) { if (vm.configurations.connectors[i].enabled) { config += ' -\n'; config += ' name: ' + vm.configurations.connectors[i].name + '\n'; @@ -250,7 +276,7 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, } function generateConfigConnectorFiles(fileZipAdd) { - for(let i = 0; i < vm.configurations.connectors.length; i++){ + for (let i = 0; i < vm.configurations.connectors.length; i++) { if (vm.configurations.connectors[i].enabled) { fileZipAdd[generateFileName(vm.configurations.connectors[i].name)] = angular.toJson(vm.configurations.connectors[i].config); } @@ -276,7 +302,7 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, function gatewayMainConfigJSON() { let configuration = {}; - + let thingsBoard = {}; thingsBoard.host = vm.configurations.host; thingsBoard.remoteConfiguration = vm.configurations.remoteConfiguration; @@ -325,10 +351,10 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, } function gatewayConnectorConfigJSON(gatewayConfiguration) { - for(let i = 0; i < vm.configurations.connectors.length; i++){ + for (let i = 0; i < vm.configurations.connectors.length; i++) { if (vm.configurations.connectors[i].enabled) { let typeConnector = vm.configurations.connectors[i].configType; - if(!angular.isArray(gatewayConfiguration[typeConnector])){ + if (!angular.isArray(gatewayConfiguration[typeConnector])) { gatewayConfiguration[typeConnector] = []; } @@ -343,7 +369,7 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, function getDraftConnectorJSON() { let draftConnector = {}; - for(let i = 0; i < vm.configurations.connectors.length; i++){ + for (let i = 0; i < vm.configurations.connectors.length; i++) { if (!vm.configurations.connectors[i].enabled) { let connector = { connector: vm.configurations.connectors[i].configType, @@ -362,7 +388,10 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, const device = devices[i]; if (device.additionalInfo !== null && device.additionalInfo.gateway === true) { vm.gateways.push(device); - if (firstInit && vm.gateways.length && device.name === vm.gateways[0].name) { + if (vm.deviceNameForm && firstInit && vm.gateways.length && device.name === vm.deviceNameForm) { + vm.configurations.gateway = device; + vm.getAccessToken(device.id); + } else if (firstInit && vm.gateways.length && device.name === vm.gateways[0].name) { vm.configurations.gateway = device; vm.getAccessToken(device.id); } @@ -385,7 +414,7 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, for (let connectorType in keyValue) { let name = "No name"; if (Object.prototype.hasOwnProperty.call(keyValue[connectorType], 'name')) { - name = keyValue[connectorType].name ; + name = keyValue[connectorType].name; } let connector = { enabled: true, diff --git a/ui/src/app/components/gateway/gateway-form.tpl.html b/ui/src/app/components/gateway/gateway-form.tpl.html index abe030d543..c8d44d1fcb 100644 --- a/ui/src/app/components/gateway/gateway-form.tpl.html +++ b/ui/src/app/components/gateway/gateway-form.tpl.html @@ -17,30 +17,36 @@ -->
- - + +
{{ 'gateway.thingsboard' | translate | uppercase }}
- +
{{ 'gateway.thingsboard' | translate | uppercase }}
- + + + + - + {{securityType.name | translate}} @@ -50,14 +56,14 @@ ng-class="{'gateway-config-row-vertical': vm.changeAlignment}"> - +
gateway.thingsboard-host-required
-
gateway.thingsboard-port-required
@@ -70,18 +76,18 @@
- + - + - +
- {{ 'gateway.remote' | translate }} @@ -90,7 +96,7 @@ ng-class="{'gateway-config-row-vertical': vm.changeAlignment}"> - + {{logLevel}} @@ -99,7 +105,7 @@ -
gateway.path-logs-required
@@ -109,14 +115,14 @@ - +
{{ 'gateway.storage' | translate | uppercase }}
- +
{{ 'gateway.storage' | translate | uppercase }}
@@ -124,18 +130,17 @@ - + {{storageType.name | translate}} -
-
gateway.storage-pack-size-required
@@ -143,10 +148,9 @@
gateway.storage-pack-size-pattern
- -
gateway.storage-max-records-required
@@ -155,13 +159,12 @@
-
-
gateway.storage-max-files-required
@@ -169,10 +172,9 @@
gateway.storage-max-files-pattern
- -
gateway.storage-path-required
@@ -182,14 +184,14 @@ - +
{{ 'gateway.connectors' | translate | uppercase }}
- +
{{ 'gateway.connectors' | translate | uppercase }}
@@ -198,13 +200,14 @@ + change-alignment="vm.changeAlignment" + is-read-only="vm.isReadOnlyForm">
-
+
{{'gateway.download-tip' | translate }} - {{'action.save' | translate }} - {{'gateway.save-tip' | translate }} + {{'gateway.save-tip' | translate }} +
diff --git a/ui/src/app/components/gateway/state-gateway-dialog.scss b/ui/src/app/components/gateway/state-gateway-dialog.scss new file mode 100644 index 0000000000..7057021fdc --- /dev/null +++ b/ui/src/app/components/gateway/state-gateway-dialog.scss @@ -0,0 +1,18 @@ +/** + * Copyright © 2016-2020 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.state-gateway-config-dialog { + width: 600px; +} diff --git a/ui/src/app/components/gateway/state-gateway-dialog.tpl.html b/ui/src/app/components/gateway/state-gateway-dialog.tpl.html new file mode 100644 index 0000000000..515d503578 --- /dev/null +++ b/ui/src/app/components/gateway/state-gateway-dialog.tpl.html @@ -0,0 +1,52 @@ + + + + +
+

+ gateway.title-show-config +

+ + + + +
+
+ +
+
+
+ + + + +
+ + + +
+
+
+
+ diff --git a/ui/src/app/components/gateway/state-gateway-form.directive.js b/ui/src/app/components/gateway/state-gateway-form.directive.js new file mode 100644 index 0000000000..428c19581e --- /dev/null +++ b/ui/src/app/components/gateway/state-gateway-form.directive.js @@ -0,0 +1,149 @@ +/* + * Copyright © 2016-2020 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import './state-gateway-form.scss'; +import './state-gateway-dialog.scss'; +/* eslint-disable import/no-unresolved, import/default */ + +import stateGatewayFormTemplate from './state-gateway-form.tpl.html'; +import stateGatewayDialogTemplate from "./state-gateway-dialog.tpl.html"; + +/* eslint-enable import/no-unresolved, import/default */ + +export default angular.module('thingsboard.directives.stateGatewayForm', []) + .directive('tbStateGatewayForm', StateGatewayForm) + .name; + +/*@ngInject*/ +function StateGatewayForm() { + return { + restrict: "E", + scope: true, + bindToController: { + disabled: '=ngDisabled', + keyPlaceholderText: '@?', + valuePlaceholderText: '@?', + noDataText: '@?', + formId: '=', + ctx: '=', + theForm: '=' + }, + controller: StateGatewayFormController, + controllerAs: 'vm', + templateUrl: stateGatewayFormTemplate + }; + +} + +/*@ngInject*/ +function StateGatewayFormController($scope, $mdDialog, $injector, $document, $mdExpansionPanel, $translate, types, entityService, utils) { + $scope.$mdExpansionPanel = $mdExpansionPanel; + let vm = this; + vm.isReadOnly = false; + vm.isState = true; + vm.isDashboard = false; + + $scope.$watch('vm.ctx', function() { + if (vm.ctx && vm.ctx.defaultSubscription) { + vm.settings = vm.ctx.settings; + if (vm.ctx.datasources && vm.ctx.datasources.length) { + vm.deviceName = vm.ctx.datasources[0].name; + vm.isDashboard = vm.deviceName ? true : false; + if (vm.ctx.settings) { + vm.isReadOnly = vm.ctx.settings.readOnly; + } + initializeConfig(); + } + } + }); + + + function updateWidgetDisplaying() { + if (vm.ctx && vm.ctx.$container) { + vm.changeAlignment = (vm.ctx.$container[0].offsetWidth <= 425); + } + } + + function initWidgetSettings() { + if (vm.settings.stateGatewayTitle && vm.settings.stateGatewayTitle.length) { + vm.stateGatewayTitle = utils.customTranslation(vm.settings.stateGatewayTitle, vm.settings.stateGatewayTitle); + } else { + vm.stateGatewayTitle = $translate.instant('gateway.state-title'); + } + vm.ctx.widgetActions = [vm.showConfig]; + vm.ctx.widgetTitle = vm.stateGatewayTitle; + } + + + function initializeConfig() { + updateWidgetDisplaying(); + initWidgetSettings(); + } + + $scope.$on('state-gateway-form-resize', function (event, formId) { + if (vm.formId == formId) { + updateWidgetDisplaying(); + } + }); + + updateWidgetDisplaying(); + + + + vm.showConfig = { + name: "gateway.show-config-tip", + show: true, + onAction: function($event) { + vm.openShowConfigDialog($event) + }, + icon: "visibility" + }; + + vm.openShowConfigDialog =($event) => { + if ($event) { + $event.stopPropagation(); + } + $mdDialog.show({ + controller: StateGatewayDialogController, + controllerAs: 'vm', + templateUrl: stateGatewayDialogTemplate, + parent: angular.element($document[0].body), + locals: { + deviceName: vm.deviceName, + isReadOnly: vm.isReadOnly, + isState: vm.isState + }, + bindToController: true, + targetEvent: $event, + fullscreen: true, + multiple: true + }).then(function() { + }, function () { + }); + } + +} + + +/*@ngInject*/ +function StateGatewayDialogController($scope, $mdDialog, deviceName, isReadOnly, isState) { + let vm = this; + vm.deviceName = deviceName; + vm.isReadOnly = isReadOnly; + vm.isState = isState; + vm.cancel = () => { + $mdDialog.hide(); + }; +} diff --git a/ui/src/app/components/gateway/state-gateway-form.scss b/ui/src/app/components/gateway/state-gateway-form.scss new file mode 100644 index 0000000000..a58b13784e --- /dev/null +++ b/ui/src/app/components/gateway/state-gateway-form.scss @@ -0,0 +1,18 @@ +/** + * Copyright © 2016-2020 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.state-gateway-form { + padding: 5px 5px 0; +} diff --git a/ui/src/app/components/gateway/state-gateway-form.tpl.html b/ui/src/app/components/gateway/state-gateway-form.tpl.html new file mode 100644 index 0000000000..61600ab52f --- /dev/null +++ b/ui/src/app/components/gateway/state-gateway-form.tpl.html @@ -0,0 +1,28 @@ + +
+ + + + + + + + + +
diff --git a/ui/src/app/layout/index.js b/ui/src/app/layout/index.js index a00baa5199..993163e03a 100644 --- a/ui/src/app/layout/index.js +++ b/ui/src/app/layout/index.js @@ -30,6 +30,7 @@ import thingsboardSideMenu from '../components/side-menu.directive'; import thingsboardNavTree from '../components/nav-tree.directive'; import thingsboardDashboardAutocomplete from '../components/dashboard-autocomplete.directive'; import thingsboardKvMap from '../components/kv-map.directive'; +import thingsboardStateGatewayForm from '../components/gateway/state-gateway-form.directive'; import thingsboardGatewayConfig from '../components/gateway/gateway-config.directive'; import thingsboardGatewayConfigSelect from '../components/gateway/gateway-config-select.directive'; import thingsboardGatewayForm from '../components/gateway/gateway-form.directive'; @@ -96,6 +97,7 @@ export default angular.module('thingsboard.home', [ thingsboardNavTree, thingsboardDashboardAutocomplete, thingsboardKvMap, + thingsboardStateGatewayForm, thingsboardGatewayConfig, thingsboardGatewayConfigSelect, thingsboardGatewayForm, diff --git a/ui/src/app/locale/locale.constant-en_US.json b/ui/src/app/locale/locale.constant-en_US.json index 48bff7d6cd..9815b6ba81 100644 --- a/ui/src/app/locale/locale.constant-en_US.json +++ b/ui/src/app/locale/locale.constant-en_US.json @@ -1197,7 +1197,12 @@ "tls-path-private-key": "Path to private key on gateway", "toggle-fullscreen": "Toggle fullscreen", "transformer-json-config": "Configuration JSON*", - "update-config": "Add/update configuration JSON" + "update-config": "Add/update configuration JSON", + "state-title": "Gateway state", + "show-config-tip": "Show gateway configuration", + "title-show-config": "Show gateway configuration", + "read-only": "Read only", + "read-write": "" }, "grid": { "delete-item-title": "Are you sure you want to delete this item?",