Commit c434383b72b1209737158bb7c5589b9a3e5177ae

Authored by Igor Kulikov
2 parents c4be9857 2c22afce

Merge branch 'master' of github.com:thingsboard/thingsboard

@@ -273,23 +273,17 @@ updates: @@ -273,23 +273,17 @@ updates:
273 spring.mvc.cors: 273 spring.mvc.cors:
274 mappings: 274 mappings:
275 # Intercept path 275 # Intercept path
276 - "/api/auth/**": 276 + "[/api/**]":
277 #Comma-separated list of origins to allow. '*' allows all origins. When not set,CORS support is disabled. 277 #Comma-separated list of origins to allow. '*' allows all origins. When not set,CORS support is disabled.
278 allowed-origins: "*" 278 allowed-origins: "*"
279 #Comma-separated list of methods to allow. '*' allows all methods. 279 #Comma-separated list of methods to allow. '*' allows all methods.
280 - allowed-methods: "POST,GET,OPTIONS" 280 + allowed-methods: "*"
281 #Comma-separated list of headers to allow in a request. '*' allows all headers. 281 #Comma-separated list of headers to allow in a request. '*' allows all headers.
282 allowed-headers: "*" 282 allowed-headers: "*"
283 #How long, in seconds, the response from a pre-flight request can be cached by clients. 283 #How long, in seconds, the response from a pre-flight request can be cached by clients.
284 max-age: "1800" 284 max-age: "1800"
285 #Set whether credentials are supported. When not set, credentials are not supported. 285 #Set whether credentials are supported. When not set, credentials are not supported.
286 allow-credentials: "true" 286 allow-credentials: "true"
287 - "/api/v1/**":  
288 - allowed-origins: "*"  
289 - allowed-methods: "*"  
290 - allowed-headers: "*"  
291 - max-age: "1800"  
292 - allow-credentials: "true"  
293 287
294 # spring serve gzip compressed static resources 288 # spring serve gzip compressed static resources
295 spring.resources.chain: 289 spring.resources.chain:
@@ -283,7 +283,7 @@ function Contact($compile, $templateCache) { @@ -283,7 +283,7 @@ function Contact($compile, $templateCache) {
283 "Austria": "[0-9]{4}", 283 "Austria": "[0-9]{4}",
284 "Belgium": "[0-9]{4}", 284 "Belgium": "[0-9]{4}",
285 "Brazil": "[0-9]{5}[\\-]?[0-9]{3}", 285 "Brazil": "[0-9]{5}[\\-]?[0-9]{3}",
286 - "Canada": "[A-Za-z][0-9][A-Za-z] [0-9][A-Za-z][0-9]", 286 + "Canada": "^(?!.*[DFIOQU])[A-VXY][0-9][A-Z][ -]?[0-9][A-Z][0-9]$",
287 "Denmark": "[0-9]{3,4}", 287 "Denmark": "[0-9]{3,4}",
288 "Faroe Islands": "[0-9]{3,4}", 288 "Faroe Islands": "[0-9]{3,4}",
289 "Netherlands": "[1-9][0-9]{3}\\s?[a-zA-Z]{2}", 289 "Netherlands": "[1-9][0-9]{3}\\s?[a-zA-Z]{2}",
@@ -1295,7 +1295,8 @@ @@ -1295,7 +1295,8 @@
1295 "metadata-required": "Metadata entries can't be empty.", 1295 "metadata-required": "Metadata entries can't be empty.",
1296 "output": "Output", 1296 "output": "Output",
1297 "test": "Test", 1297 "test": "Test",
1298 - "help": "Help" 1298 + "help": "Help",
  1299 + "reset-debug-mode": "Reset debug mode in all nodes"
1299 }, 1300 },
1300 "tenant": { 1301 "tenant": {
1301 "tenant": "Tenant", 1302 "tenant": "Tenant",
@@ -1288,7 +1288,8 @@ @@ -1288,7 +1288,8 @@
1288 "metadata-required": "Метаданные объекта не могут быть пустыми.", 1288 "metadata-required": "Метаданные объекта не могут быть пустыми.",
1289 "output": "Выход", 1289 "output": "Выход",
1290 "test": "Протестировать", 1290 "test": "Протестировать",
1291 - "help": "Помощь" 1291 + "help": "Помощь",
  1292 + "reset-debug-mode": "Сбросить режим отладки во всех правилах"
1292 }, 1293 },
1293 "tenant": { 1294 "tenant": {
1294 "tenant": "Владелец", 1295 "tenant": "Владелец",
@@ -108,6 +108,9 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time @@ -108,6 +108,9 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time
108 vm.objectsSelected = objectsSelected; 108 vm.objectsSelected = objectsSelected;
109 vm.deleteSelected = deleteSelected; 109 vm.deleteSelected = deleteSelected;
110 110
  111 + vm.isDebugModeEnabled = isDebugModeEnabled;
  112 + vm.resetDebugModeInAllNodes = resetDebugModeInAllNodes;
  113 +
111 vm.triggerResize = triggerResize; 114 vm.triggerResize = triggerResize;
112 115
113 vm.openRuleChainContextMenu = openRuleChainContextMenu; 116 vm.openRuleChainContextMenu = openRuleChainContextMenu;
@@ -1342,6 +1345,19 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time @@ -1342,6 +1345,19 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time
1342 vm.modelservice.deleteSelected(); 1345 vm.modelservice.deleteSelected();
1343 } 1346 }
1344 1347
  1348 + function isDebugModeEnabled() {
  1349 + var res = $filter('filter')(vm.ruleChainModel.nodes, {debugMode: true});
  1350 + return (res && res.length);
  1351 + }
  1352 +
  1353 + function resetDebugModeInAllNodes() {
  1354 + vm.ruleChainModel.nodes.forEach((node) => {
  1355 + if (node.component.type != types.ruleNodeType.INPUT.value && node.component.type != types.ruleNodeType.RULE_CHAIN.value) {
  1356 + node.debugMode = false;
  1357 + }
  1358 + });
  1359 + }
  1360 +
1345 function triggerResize() { 1361 function triggerResize() {
1346 var w = angular.element($window); 1362 var w = angular.element($window);
1347 w.triggerHandler('resize'); 1363 w.triggerHandler('resize');
@@ -223,6 +223,15 @@ @@ -223,6 +223,15 @@
223 </md-tooltip> 223 </md-tooltip>
224 <ng-md-icon icon="delete"></ng-md-icon> 224 <ng-md-icon icon="delete"></ng-md-icon>
225 </md-button> 225 </md-button>
  226 + <md-button ng-disabled="$root.loading || !vm.isDebugModeEnabled()"
  227 + class="tb-btn-footer md-accent md-hue-2 md-fab"
  228 + aria-label="{{ 'rulenode.reset-debug-mode' | translate }}"
  229 + ng-click="vm.resetDebugModeInAllNodes()">
  230 + <md-tooltip md-direction="top">
  231 + {{ 'rulenode.reset-debug-mode' | translate }}
  232 + </md-tooltip>
  233 + <ng-md-icon icon="bug_report"></ng-md-icon>
  234 + </md-button>
226 <md-button ng-disabled="$root.loading || vm.isInvalid || (!vm.isDirty && !vm.isImport)" 235 <md-button ng-disabled="$root.loading || vm.isInvalid || (!vm.isDirty && !vm.isImport)"
227 class="tb-btn-footer md-accent md-hue-2 md-fab" 236 class="tb-btn-footer md-accent md-hue-2 md-fab"
228 aria-label="{{ 'action.apply' | translate }}" 237 aria-label="{{ 'action.apply' | translate }}"