node-red-contrib-mobius-flow-base 2.5.86-beta.91 → 2.5.86-beta.94
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.
|
@@ -224,7 +224,11 @@ module.exports = function (RED) {
|
|
|
224
224
|
response.colour = 'grey';
|
|
225
225
|
response.text = 'Never Active';
|
|
226
226
|
}
|
|
227
|
-
return
|
|
227
|
+
return {
|
|
228
|
+
fill: response.text,
|
|
229
|
+
shape: 'dot',
|
|
230
|
+
text: response.colour,
|
|
231
|
+
};
|
|
228
232
|
};
|
|
229
233
|
|
|
230
234
|
/**
|
|
@@ -233,32 +237,33 @@ module.exports = function (RED) {
|
|
|
233
237
|
*/
|
|
234
238
|
node.updateNodeStatus = function (mobiusNode) {
|
|
235
239
|
node.users[mobiusNode.id] = mobiusNode;
|
|
236
|
-
let
|
|
237
|
-
|
|
240
|
+
let status = {
|
|
241
|
+
fill: 'Connected',
|
|
242
|
+
shape: 'dot',
|
|
243
|
+
text: 'green',
|
|
244
|
+
};
|
|
238
245
|
if (node.users[mobiusNode.id].statusType === 'timeSinceLastActive') {
|
|
239
|
-
|
|
240
|
-
statusText = result.text;
|
|
241
|
-
statusColour = result.colour;
|
|
246
|
+
status = node.buildLastActiveTimeStatus(node.users[mobiusNode.id].lastActiveTime);
|
|
242
247
|
} else {
|
|
243
248
|
const uri = node.users[mobiusNode.id].latestUri;
|
|
244
249
|
if (uri !== '') {
|
|
245
|
-
|
|
250
|
+
status = {
|
|
251
|
+
fill: uri,
|
|
252
|
+
shape: 'dot',
|
|
253
|
+
text: 'green',
|
|
254
|
+
};
|
|
246
255
|
}
|
|
247
256
|
}
|
|
248
|
-
node.users[mobiusNode.id].status(
|
|
249
|
-
fill: statusColour,
|
|
250
|
-
shape: 'dot',
|
|
251
|
-
text: statusText,
|
|
252
|
-
});
|
|
257
|
+
node.users[mobiusNode.id].status(status);
|
|
253
258
|
};
|
|
254
259
|
|
|
255
260
|
/**
|
|
256
261
|
* Update a given node's node latest URI record
|
|
257
262
|
* @param {Object} mobiusNode - The node whos last URI record is to be updated
|
|
258
263
|
*/
|
|
259
|
-
node.updateLatestUri = function (mobiusNode) {
|
|
264
|
+
node.updateLatestUri = function (mobiusNode, uri) {
|
|
260
265
|
node.users[mobiusNode.id] = mobiusNode;
|
|
261
|
-
node.users[mobiusNode.id].latestUri =
|
|
266
|
+
node.users[mobiusNode.id].latestUri = uri;
|
|
262
267
|
node.updateNodeStatus(mobiusNode);
|
|
263
268
|
};
|
|
264
269
|
|
|
@@ -54,8 +54,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
54
54
|
</div>
|
|
55
55
|
<hr>
|
|
56
56
|
<div class="form-row">
|
|
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;">
|
|
57
|
+
<label for="node-input-statusType" style="width: 30%;"><i class="fa fa-bars"></i> Status Display</label>
|
|
58
|
+
<select type="text" id="node-input-statusType" style="width: 70%; display: inline-block; width: auto; vertical-align: center;">
|
|
59
59
|
<option value="timeSinceLastActive">Time since last active</option>
|
|
60
60
|
<option value="lastUri">Last URI</option>
|
|
61
61
|
</select>
|
|
@@ -49,7 +49,7 @@ module.exports = function (RED) {
|
|
|
49
49
|
text: 'Disconnected',
|
|
50
50
|
});
|
|
51
51
|
node.serviceConn.subscribeToObjectCOV(node.object, this.id, (response) => {
|
|
52
|
-
node.serviceConn.updateLatestUri(node);
|
|
52
|
+
node.serviceConn.updateLatestUri(node, response.uri);
|
|
53
53
|
node.serviceConn.updateLastActiveTime(node);
|
|
54
54
|
let allResources = _.keyBy(
|
|
55
55
|
response.value.resources,
|