Browse Source

add isStateForm for the last telemetry type

pull/2627/head
nick 7 years ago
parent
commit
9bf4039553
  1. 1
      ui/src/app/components/gateway/gateway-config-select.directive.js
  2. 3
      ui/src/app/components/gateway/gateway-config.directive.js
  3. 6
      ui/src/app/components/gateway/gateway-form.directive.js
  4. 2
      ui/src/app/layout/index.js

1
ui/src/app/components/gateway/gateway-config-select.directive.js

@ -48,7 +48,6 @@ function GatewayConfigSelect($compile, $templateCache, $mdConstant, $translate,
function startWatchers() { function startWatchers() {
scope.$watch('gateway', function (newVal, prevVal) { scope.$watch('gateway', function (newVal, prevVal) {
if (!angular.equals(newVal, prevVal) && newVal !== null) { if (!angular.equals(newVal, prevVal) && newVal !== null) {
console.log("select startWatchers", "newVal", newVal, "prevVal", prevVal); //eslint-disable-line
scope.updateView(); scope.updateView();
} }
}); });

3
ui/src/app/components/gateway/gateway-config.directive.js

@ -84,6 +84,9 @@ function GatewayConfigController($scope, $document, $mdDialog, $mdUtil, $window,
multiple: true, multiple: true,
}).then(function (config) { }).then(function (config) {
if (config && index > -1) { if (config && index > -1) {
if (!angular.equals(vm.gatewayConfig[index].config, config)) {
$scope.gatewayConfiguration.$setDirty();
}
vm.gatewayConfig[index].config = config; vm.gatewayConfig[index].config = config;
} }
}); });

6
ui/src/app/components/gateway/gateway-form.directive.js

@ -32,6 +32,7 @@ function GatewayForm() {
bindToController: { bindToController: {
formId: '=', formId: '=',
ctx: '=', ctx: '=',
isStateForm: '=',
deviceName: '=', deviceName: '=',
isReadOnly: '=', isReadOnly: '=',
isState: '=' isState: '='
@ -54,9 +55,6 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel,
vm.types = types; vm.types = types;
vm.deviceNameForm = (vm.deviceName) ? vm.deviceName : null; 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.idForm = Math.random().toString(36).replace(/^0\.[0-9]*/, '');
vm.configurations = { vm.configurations = {
gateway: '', gateway: '',
@ -100,6 +98,7 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel,
$scope.$watch('vm.ctx', function () { $scope.$watch('vm.ctx', function () {
if (vm.ctx) { if (vm.ctx) {
vm.isStateForm = $scope.isStateForm;
vm.settings = vm.ctx.settings; vm.settings = vm.ctx.settings;
vm.widgetConfig = vm.ctx.widgetConfig; vm.widgetConfig = vm.ctx.widgetConfig;
if (vm.ctx.datasources && vm.ctx.datasources.length) { if (vm.ctx.datasources && vm.ctx.datasources.length) {
@ -174,7 +173,6 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel,
} }
vm.createDevice = (deviceObj) => { vm.createDevice = (deviceObj) => {
// console.log("vm.createDevice deviceObj", deviceObj); //eslint-disable-line
deviceService.findByName(deviceObj.name, {ignoreErrors: true}) deviceService.findByName(deviceObj.name, {ignoreErrors: true})
.then( .then(
function () { function () {

2
ui/src/app/layout/index.js

@ -30,7 +30,6 @@ import thingsboardSideMenu from '../components/side-menu.directive';
import thingsboardNavTree from '../components/nav-tree.directive'; import thingsboardNavTree from '../components/nav-tree.directive';
import thingsboardDashboardAutocomplete from '../components/dashboard-autocomplete.directive'; import thingsboardDashboardAutocomplete from '../components/dashboard-autocomplete.directive';
import thingsboardKvMap from '../components/kv-map.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 thingsboardGatewayConfig from '../components/gateway/gateway-config.directive';
import thingsboardGatewayConfigSelect from '../components/gateway/gateway-config-select.directive'; import thingsboardGatewayConfigSelect from '../components/gateway/gateway-config-select.directive';
import thingsboardGatewayForm from '../components/gateway/gateway-form.directive'; import thingsboardGatewayForm from '../components/gateway/gateway-form.directive';
@ -97,7 +96,6 @@ export default angular.module('thingsboard.home', [
thingsboardNavTree, thingsboardNavTree,
thingsboardDashboardAutocomplete, thingsboardDashboardAutocomplete,
thingsboardKvMap, thingsboardKvMap,
thingsboardStateGatewayForm,
thingsboardGatewayConfig, thingsboardGatewayConfig,
thingsboardGatewayConfigSelect, thingsboardGatewayConfigSelect,
thingsboardGatewayForm, thingsboardGatewayForm,

Loading…
Cancel
Save