Skip to content

Commit 84d70bc

Browse files
committed
207
1 parent 46717ec commit 84d70bc

3 files changed

Lines changed: 27 additions & 4 deletions

File tree

OpenFlow/src/public/Controllers.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,12 +1572,25 @@ module openflow {
15721572
await api.RegisterQueue();
15731573
this.noderedurl = "https://" + WebSocketClient.nodered_domain_schema.replace("$nodered_id$", WebSocketClient.user.username);
15741574
this.instance = await api.GetNoderedInstance();
1575-
console.log("GetNoderedInstance:");
1576-
console.log(this.instance);
15771575
if (!this.$scope.$$phase) { this.$scope.$apply(); }
15781576
});
15791577
}
1580-
1578+
async GetNoderedInstance() {
1579+
try {
1580+
this.instance = await this.api.GetNoderedInstance();
1581+
console.log("GetNoderedInstance:");
1582+
console.log(this.instance);
1583+
if (this.instance !== null || this.instance !== undefined) {
1584+
this.messages += "GetNoderedInstance completed, status " + this.instance.status.phase + "\n";
1585+
} else {
1586+
this.messages += "GetNoderedInstance completed, status unknown/not existing" + "\n";
1587+
}
1588+
} catch (error) {
1589+
this.messages += error + "\n";
1590+
console.error(error);
1591+
}
1592+
if (!this.$scope.$$phase) { this.$scope.$apply(); }
1593+
}
15811594
async EnsureNoderedInstance() {
15821595
try {
15831596
await this.api.EnsureNoderedInstance();

OpenFlow/src/public/Nodered.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,20 @@ <h1 translate lib="web">sockets</h1>
1111
<button type="button" class="btn btn-secondary" ng-click="ctrl.RestartNoderedInstance()">Restart
1212
Nodered</button>
1313
<button type="button" class="btn btn-secondary" ng-click="ctrl.DeleteNoderedInstance()">Delete Nodered</button>
14+
<button type="button" class="btn btn-secondary" ng-click="ctrl.DeleteNoderedInstance()">Get status</button>
1415
</div>
1516
</div>
1617
</section>
1718
</form>
19+
<section ng-repeat="key in ctrl.keys">
20+
<div class="form-group">
21+
<label class="col-sm-3 control-label"><span translate lib="web">status</span>: </label>
22+
<div class="col-sm-9">
23+
<span ng-show="ctrl.instance==null">Not created</span>
24+
<span ng-show="ctrl.instance!=null">{{ ctrl.instance.status.phase }}</span>
25+
</div>
26+
</div>
27+
</section>
1828

1929
<pre>{{ ctrl.messages }}</pre>
2030
<p>If this is your first time creating a NodeRed instance, plaease signout and signin again, to refresh group

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.206
1+
0.0.207

0 commit comments

Comments
 (0)