node-red-contrib-mobius-flow-base 2.5.86-beta.86 → 2.5.86-beta.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -232,10 +232,12 @@ module.exports = function (RED) {
|
|
|
232
232
|
* @param {Object} mobiusNode - The node whos status is to be updated
|
|
233
233
|
*/
|
|
234
234
|
node.updateNodeStatus = function (mobiusNode) {
|
|
235
|
+
console.log('Update');
|
|
236
|
+
console.log(node.users[mobiusNode.id].statusType);
|
|
235
237
|
node.users[mobiusNode.id] = mobiusNode;
|
|
236
238
|
let statusText = 'Unknown';
|
|
237
239
|
let statusColour = 'green';
|
|
238
|
-
if (node.users[mobiusNode.id].
|
|
240
|
+
if (node.users[mobiusNode.id].statusType === 'timeSinceLastActive') {
|
|
239
241
|
let result = getLastActiveTimeStatus(node.users[mobiusNode.id].lastActiveTime);
|
|
240
242
|
statusText = result.text;
|
|
241
243
|
statusColour = result.colour;
|
|
@@ -54,10 +54,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
54
54
|
</div>
|
|
55
55
|
<hr>
|
|
56
56
|
<div class="form-row">
|
|
57
|
-
<label for="node-input-
|
|
58
|
-
<select type="text" id="node-input-
|
|
59
|
-
<option value="
|
|
60
|
-
<option value="
|
|
57
|
+
<label for="node-input-statusType"><i class="fa fa-bars"></i> Status Display</label>
|
|
58
|
+
<select type="text" id="node-input-statusType" style="display: inline-block; width: auto; vertical-align: center;">
|
|
59
|
+
<option value="timeSinceLastActive">Time since last active</option>
|
|
60
|
+
<option value="lastUri">Last URI</option>
|
|
61
61
|
</select>
|
|
62
62
|
</div>
|
|
63
63
|
<div class="form-row">
|
|
@@ -71,7 +71,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
71
71
|
category: 'mobius',
|
|
72
72
|
defaults: {
|
|
73
73
|
name: {value:""},
|
|
74
|
-
|
|
74
|
+
statusType: {value:""},
|
|
75
75
|
detailedOutput: {value:false},
|
|
76
76
|
format: {value: "name", required: true},
|
|
77
77
|
include: {value: "changed", required: true},
|
|
@@ -37,9 +37,11 @@ module.exports = function (RED) {
|
|
|
37
37
|
this.include = n.include;
|
|
38
38
|
this.serviceConn = RED.nodes.getNode(n.connection);
|
|
39
39
|
this.latestUri = '';
|
|
40
|
-
this.
|
|
40
|
+
this.statusType = n.statusType;
|
|
41
41
|
var node = this;
|
|
42
42
|
|
|
43
|
+
console.log(node.statusType);
|
|
44
|
+
|
|
43
45
|
if (node.serviceConn) {
|
|
44
46
|
node.status({
|
|
45
47
|
fill: 'red',
|
|
@@ -49,6 +51,7 @@ module.exports = function (RED) {
|
|
|
49
51
|
|
|
50
52
|
node.serviceConn.subscribeToObjectCOV(node.object, this.id, (response) => {
|
|
51
53
|
node.latestUri = JSON.stringify(response.uri);
|
|
54
|
+
node.updateNodeStatus(node);
|
|
52
55
|
let allResources = _.keyBy(
|
|
53
56
|
response.value.resources,
|
|
54
57
|
node.format === 'name' ? 'name' : 'rid'
|