Skip to content

Commit 468108f

Browse files
committed
1
1 parent b7ff056 commit 468108f

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

OpenFlow/src/public/Controllers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,7 @@ module openflow {
15721572
await api.RegisterQueue();
15731573
this.noderedurl = "https://" + WebSocketClient.nodered_domain_schema.replace("$nodered_id$", WebSocketClient.user.username);
15741574
// // this.GetNoderedInstance();
1575-
setTimeout(this.GetNoderedInstance.bind(this), 2000);
1575+
this.GetNoderedInstance();
15761576
});
15771577
}
15781578
async GetNoderedInstance() {
@@ -1590,7 +1590,6 @@ module openflow {
15901590
console.error(error);
15911591
}
15921592
if (!this.$scope.$$phase) { this.$scope.$apply(); }
1593-
setTimeout(this.GetNoderedInstance.bind(this), 2000);
15941593
}
15951594
async EnsureNoderedInstance() {
15961595
try {

OpenFlowNodeRED/src/Config.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as https from "https";
22
import * as retry from "async-retry";
33
import { fetch, toPassportConfig } from "passport-saml-metadata";
4+
import { NoderedUtil } from "./nodered/nodes/NoderedUtil";
45
export class Config {
56
public static nodered_id: string = Config.getEnv("nodered_id", "1");
67
public static nodered_sa: string = Config.getEnv("nodered_sa", "");
@@ -36,14 +37,20 @@ export class Config {
3637
public static aes_secret: string = Config.getEnv("aes_secret", "");
3738

3839
public static baseurl(): string {
39-
var matches = Config.nodered_id.match(/\d+/);
40-
if (matches !== null && matches !== undefined) {
41-
if (matches.length > 0) {
42-
Config.nodered_id = matches[matches.length - 1]; // Just grab the last number
40+
if (NoderedUtil.IsNullEmpty(Config.nodered_sa)) {
41+
var matches = Config.nodered_id.match(/\d+/);
42+
if (matches !== null && matches !== undefined) {
43+
if (matches.length > 0) {
44+
Config.nodered_id = matches[matches.length - 1]; // Just grab the last number
45+
}
46+
}
47+
if (Config.nodered_domain_schema != "") {
48+
Config.domain = Config.nodered_domain_schema.replace("$nodered_id$", Config.nodered_id)
49+
}
50+
} else {
51+
if (Config.nodered_domain_schema != "") {
52+
Config.domain = Config.nodered_domain_schema.replace("$nodered_id$", Config.nodered_id)
4353
}
44-
}
45-
if (Config.nodered_domain_schema != "") {
46-
Config.domain = Config.nodered_domain_schema.replace("$nodered_id$", Config.nodered_id)
4754
}
4855
// if (Config.tls_crt != '' && Config.tls_key != '') {
4956
// return "https://" + Config.domain + ":" + Config.port + "/";

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.213
1+
0.0.214

0 commit comments

Comments
 (0)