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() {
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();
}
});

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

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

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

@ -32,6 +32,7 @@ function GatewayForm() {
bindToController: {
formId: '=',
ctx: '=',
isStateForm: '=',
deviceName: '=',
isReadOnly: '=',
isState: '='
@ -54,9 +55,6 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel,
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: '',
@ -100,6 +98,7 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel,
$scope.$watch('vm.ctx', function () {
if (vm.ctx) {
vm.isStateForm = $scope.isStateForm;
vm.settings = vm.ctx.settings;
vm.widgetConfig = vm.ctx.widgetConfig;
if (vm.ctx.datasources && vm.ctx.datasources.length) {
@ -174,7 +173,6 @@ 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 () {

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 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';
@ -97,7 +96,6 @@ export default angular.module('thingsboard.home', [
thingsboardNavTree,
thingsboardDashboardAutocomplete,
thingsboardKvMap,
thingsboardStateGatewayForm,
thingsboardGatewayConfig,
thingsboardGatewayConfigSelect,
thingsboardGatewayForm,

Loading…
Cancel
Save