node-red-contrib-mobius-flow-base 2.5.86-beta.74 → 2.5.86-beta.78

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.
@@ -29,17 +29,10 @@ POSSIBILITY OF SUCH DAMAGE.
29
29
  <label for="node-input-connection"><i class="fa fa-globe"></i> MOBiUS</label>
30
30
  <input type="text" id="node-input-connection">
31
31
  </div>
32
-
33
- <hr>
34
-
35
- <div id="instance-row">
36
- <div class="form-row" id="input-row">
37
- <label for="node-input-resource"><i class="fa fa-tasks"></i> URI</label>
38
- <input type="text" id="node-input-resource" style="width:61%;" placeholder="HID/SID/PID/INS/RID">
39
- </div>
32
+ <div class="form-row">
33
+ <label for="node-input-resource"><i class="fa fa-tasks"></i> URI</label>
34
+ <input type="text" id="node-input-resource" placeholder="Resource URI (hid/sid/pid/ins/rid)">
40
35
  </div>
41
- <div id="mobsearch"></div>
42
-
43
36
  <div class="form-row">
44
37
  <label for="node-input-priority"><i class="fa fa-exclamation-triangle"></i> Priority</label>
45
38
  <input type="text" id="node-input-priority" placeholder="Priotity to clear">
@@ -56,8 +49,6 @@ POSSIBILITY OF SUCH DAMAGE.
56
49
  </div>
57
50
  </script>
58
51
 
59
- <script src="common/mobsearch.js"></script>
60
-
61
52
  <script type="text/javascript">
62
53
  RED.nodes.registerType('mobius clear resource',{
63
54
  category: 'mobius',
@@ -99,17 +90,6 @@ POSSIBILITY OF SUCH DAMAGE.
99
90
  labelStyle: function() {
100
91
  return this.name ? "node_label_italic":"";
101
92
  },
102
- oneditprepare: function () {
103
- var node = this;
104
- let mobiusSrvc = $("#node-input-connection").val();
105
-
106
- opts = {
107
- htmlElementId: 'mobsearch',
108
- uriFieldName: 'node-input-resource',
109
- inputRowId: 'input-row',
110
- };
111
- initMobsearch.toRid(mobiusSrvc, opts);
112
- },
113
93
  oneditsave: function() {
114
94
  if($("#node-input-detailedOutput").prop('checked')) {
115
95
  this.outputs = 4;
@@ -28,7 +28,7 @@
28
28
  'use strict';
29
29
 
30
30
  module.exports = function (RED) {
31
- function MobiusClearResourceNode(n) {
31
+ function MobiusClearResourceNode (n) {
32
32
  RED.nodes.createNode(this, n);
33
33
  this.detailedOutput = n.detailedOutput;
34
34
  this.resource = n.resource;
@@ -40,7 +40,7 @@ module.exports = function (RED) {
40
40
  node.status({
41
41
  fill: 'red',
42
42
  shape: 'ring',
43
- text: 'Disconnected',
43
+ text: 'Disconnected'
44
44
  });
45
45
 
46
46
  node.on('input', function (msg) {
@@ -57,7 +57,7 @@ module.exports = function (RED) {
57
57
  node.status({
58
58
  fill: 'green',
59
59
  shape: 'ring',
60
- text: 'Busy',
60
+ text: 'Busy'
61
61
  });
62
62
 
63
63
  node.serviceConn.clearResourcePriority(uri, pri, (err, response) => {
@@ -65,34 +65,29 @@ module.exports = function (RED) {
65
65
  node.status({
66
66
  fill: 'yellow',
67
67
  shape: 'dot',
68
- text: 'Error: ' + JSON.stringify(err.code),
68
+ text: 'Error: ' + JSON.stringify(err.code)
69
69
  });
70
70
  node.error('Mobius error clearing resource priority ' + JSON.stringify(err));
71
71
  if (node.detailedOutput === true) {
72
- node.send([
73
- null,
74
- null,
75
- null,
76
- { topic: uri, payload: { error: true, response: err } },
77
- ]);
72
+ node.send([null, null, null, {topic: uri, payload: { error: true, response: err }}]);
78
73
  }
79
74
  } else {
80
75
  node.status({
81
76
  fill: 'green',
82
77
  shape: 'dot',
83
- text: JSON.stringify(response.value.pv),
78
+ text: JSON.stringify(response.value.pv)
84
79
  });
85
80
  if (node.detailedOutput === true) {
86
81
  node.send([
87
82
  { topic: uri, payload: response.value.pv },
88
83
  { topic: uri, payload: { pv: response.value.pv, name: response.value.name } },
89
84
  { topic: uri, payload: response.value },
90
- { topic: uri, payload: { error: false, response: response } },
85
+ { topic: uri, payload: { error: false, response: response } }
91
86
  ]);
92
87
  } else {
93
88
  node.send([
94
89
  { topic: uri, payload: response.value.pv },
95
- { topic: uri, payload: { pv: response.value.pv, name: response.value.name } },
90
+ { topic: uri, payload: { pv: response.value.pv, name: response.value.name } }
96
91
  ]);
97
92
  }
98
93
  }
@@ -111,12 +106,4 @@ module.exports = function (RED) {
111
106
  }
112
107
 
113
108
  RED.nodes.registerType('mobius clear resource', MobiusClearResourceNode);
114
-
115
- RED.httpAdmin.get('/common/*', function (req, res) {
116
- var options = {
117
- root: __dirname + '/common/',
118
- dotfiles: 'deny',
119
- };
120
- res.sendFile(req.params[0], options);
121
- });
122
109
  };
@@ -206,6 +206,50 @@ module.exports = function (RED) {
206
206
  text: 'Connected',
207
207
  });
208
208
  }
209
+ node.users[mobiusNode.id].lastActiveTime = Date.now();
210
+ node.users[mobiusNode.id].on('send', () => {
211
+ console.log('Send event');
212
+ node.users[mobiusNode.id].lastActiveTime = Date.now();
213
+ });
214
+ node.users[mobiusNode.id].statusCheckLoop = setInterval(() => {
215
+ const timeSinceLastActive = Date.now() - node.users[mobiusNode.id].lastActiveTime;
216
+ console.log(timeSinceLastActive);
217
+ if (timeSinceLastActive < 15 * 60000) {
218
+ node.users[mobiusNode.id].status({
219
+ fill: 'green',
220
+ shape: 'dot',
221
+ text: 'Active less than 15 minutes ago',
222
+ });
223
+ }
224
+ if (timeSinceLastActive >= 15 * 60000 && timeSinceLastActive < 3 * 60 * 60000) {
225
+ node.users[mobiusNode.id].status({
226
+ fill: 'green',
227
+ shape: 'dot',
228
+ text: 'Active less than 3 hours ago',
229
+ });
230
+ }
231
+ if (timeSinceLastActive >= 3 * 60 * 60000 && timeSinceLastActive < 12 * 60 * 60000) {
232
+ node.users[mobiusNode.id].status({
233
+ fill: 'green',
234
+ shape: 'dot',
235
+ text: 'Active less than 12 hours ago',
236
+ });
237
+ }
238
+ if (timeSinceLastActive >= 12 * 60 * 60000 && timeSinceLastActive < 24 * 60 * 60000) {
239
+ node.users[mobiusNode.id].status({
240
+ fill: 'green',
241
+ shape: 'dot',
242
+ text: 'Active less than 24 hours ago',
243
+ });
244
+ }
245
+ if (timeSinceLastActive > 24 * 60 * 60000) {
246
+ node.users[mobiusNode.id].status({
247
+ fill: 'grey',
248
+ shape: 'dot',
249
+ text: 'Active more than 24 hours ago',
250
+ });
251
+ }
252
+ }, 10000);
209
253
  };
210
254
 
211
255
  /**
@@ -520,30 +564,6 @@ module.exports = function (RED) {
520
564
  node.updateObjectInServiceConfig = function (hid, sid, pid, ins, config, callback) {
521
565
  node.service.srvcAPI.updateObjectInServiceConfig(hid, sid, pid, ins, config, callback);
522
566
  };
523
-
524
- node.getNodeConfig = function (hid) {
525
- return new Promise((resolve, reject) => {
526
- node.service.srvcAPI.getNodeConfig(hid, (err, response) => {
527
- if (!err) {
528
- resolve(response);
529
- } else {
530
- reject(err);
531
- }
532
- });
533
- });
534
- };
535
-
536
- node.getServiceConfigProm = function (hid, sid) {
537
- return new Promise((resolve, reject) => {
538
- node.service.srvcAPI.getServiceConfig(hid, sid, (err, response) => {
539
- if (!err) {
540
- resolve(response);
541
- } else {
542
- reject(err);
543
- }
544
- });
545
- });
546
- };
547
567
  }
548
568
 
549
569
  RED.nodes.registerType('mobius connection', MobiusConnectionNode);
@@ -604,71 +624,4 @@ module.exports = function (RED) {
604
624
  }
605
625
  }
606
626
  );
607
-
608
- // Register the endpoint for node-red mobius discovery in node-red node config pages
609
- RED.httpAdmin.get('/mdiscover', RED.auth.needsPermission('serial.read'), function (req, res) {
610
- let conn = RED.nodes.getNode(req.query.mobius);
611
- let uri = req.query.uri;
612
- if (conn === null || !conn.service.connected) {
613
- RED.log.error('Discover services failed - could not to connect to MOBiUS hub.');
614
- throw new Error('Discover services failed - could not to connect to MOBiUS hub.');
615
- } else {
616
- uiDeviceDiscovery
617
- .discover(conn, uri)
618
- .then((response) => {
619
- res.json(response);
620
- })
621
- .catch((err) => {
622
- throw err;
623
- });
624
- }
625
- });
626
-
627
- // Register the endpoint for node-red mobius discovery in node-red node config pages
628
- RED.httpAdmin.get('/mgetservices', RED.auth.needsPermission('serial.read'), function (req, res) {
629
- let conn = RED.nodes.getNode(req.query.mobius);
630
- let hid = req.query.hid;
631
- if (conn === null || !conn.service.connected) {
632
- RED.log.error('Get services failed - could not to connect to MOBiUS hub.');
633
- throw new Error('Get services failed - could not to connect to MOBiUS hub.');
634
- } else {
635
- uiDeviceDiscovery
636
- .getServiceList(conn, hid)
637
- .then((response) => {
638
- res.json(response);
639
- })
640
- .catch((err) => {
641
- RED.log.warn(`Get services failed - ${err}`);
642
- });
643
- }
644
- });
645
-
646
- RED.httpAdmin.get('/mgetobjects', RED.auth.needsPermission('serial.read'), function (req, res) {
647
- let conn = RED.nodes.getNode(req.query.mobius);
648
- let hid = req.query.hid;
649
- let sid = req.query.sid;
650
- if (conn === null || !conn.service.connected) {
651
- RED.log.error('Get objects failed - could not to connect to MOBiUS hub.');
652
- throw new Error('Get objects failed - could not to connect to MOBiUS hub.');
653
- } else {
654
- uiDeviceDiscovery
655
- .getObjectList(conn, hid, sid)
656
- .then((response) => {
657
- res.json(response);
658
- })
659
- .catch((err) => {
660
- RED.log.warn(`Get objects failed - ${err}`);
661
- });
662
- }
663
- });
664
-
665
- RED.httpAdmin.get('/mgethid', RED.auth.needsPermission('serial.read'), function (req, res) {
666
- let conn = RED.nodes.getNode(req.query.mobius);
667
- if (conn === null || !conn.service.connected) {
668
- RED.log.error('Get hid failed - could not to connect to MOBiUS hub.');
669
- throw new Error('Get hid failed - could not to connect to MOBiUS hub.');
670
- } else {
671
- res.json(conn.service.srvcAPI.status.hubId);
672
- }
673
- });
674
627
  };
@@ -53,13 +53,10 @@ POSSIBILITY OF SUCH DAMAGE.
53
53
  <option value="array">Array of Items</option>
54
54
  </select>
55
55
  </div>
56
- <div id="node-input-subs-container-row" class="form-row node-input-subs-container-row">
56
+ <div class="form-row node-input-subs-container-row">
57
57
  <label for="node-input-subs-container" style="width:105px;float:left;"><i class="fa fa-bars"></i> Discover</label>
58
58
  <ol id="node-input-subs-container"></ol>
59
59
  </div>
60
-
61
- <div id="mobsearch"></div>
62
-
63
60
  <div class="form-row">
64
61
  <label for="node-input-useRIDValueFiltering" style="width:178px;float:left;"><i class="fa fa-filter"></i> Filter by Resource Value</label>
65
62
  <input type="checkbox" id="node-input-useRIDValueFiltering" style="display: inline-block; width: auto; vertical-align: top;">
@@ -80,8 +77,6 @@ POSSIBILITY OF SUCH DAMAGE.
80
77
  </div>
81
78
  </script>
82
79
 
83
- <script src="common/mobsearch.js"></script>
84
-
85
80
  <script type="text/javascript">
86
81
  RED.nodes.registerType('mobius discover object list', {
87
82
  category: 'mobius',
@@ -124,7 +119,6 @@ POSSIBILITY OF SUCH DAMAGE.
124
119
  },
125
120
  oneditprepare: function () {
126
121
  var node = this;
127
- let mobiusSrvc = $("#node-input-connection").val();
128
122
 
129
123
  /** Create the subs container and populate it */
130
124
  $('#node-input-subs-container').css('min-height', '200px').css('min-width', '345px').editableList ({
@@ -143,12 +137,7 @@ POSSIBILITY OF SUCH DAMAGE.
143
137
  }
144
138
 
145
139
  var row = $('<div>URI</div>').appendTo(container);
146
- var uriField = $('<input/>',{class: "node-input-sub-uri", type: "text", style: "width: 150px; margin-left: 5px; text-align: left;"}).appendTo(row);
147
-
148
- // *** MOBSEARCH *** //
149
- var searchField = $('<a class="searchbutton" style="vertical-align: middle"><i id="node-lookup-instance-icon" class="fa fa-search"></i></a>').appendTo(row);
150
- // *** END MOBSEARCH *** //
151
-
140
+ var uriField = $('<input/>',{class: "node-input-sub-uri", type: "text", style: "width: 170px; margin-left: 5px; text-align: left;"}).appendTo(row);
152
141
  var typeField = $('<select/>',{class: "node-input-sub-type", style: "width:auto; margin-left: 5px; text-align: center;"}).appendTo(row);
153
142
  typeField.append($("<option></option>").val('include').text('Include'));
154
143
  typeField.append($("<option></option>").val('exclude').text('Exclude'));
@@ -156,15 +145,6 @@ POSSIBILITY OF SUCH DAMAGE.
156
145
  // Populate the new stat
157
146
  uriField.val(subscription.uri);
158
147
  typeField.val(subscription.type);
159
-
160
- // *** MOBSEARCH *** //
161
-
162
- if (!node.subscriptions[i]) {
163
- node.subscriptions[i] = {uri: '', type: 'include'}
164
- }
165
-
166
- addMobsearchListButton(searchField, i, mobsearchOpts)
167
- // *** END MOBSEARCH *** //
168
148
  }
169
149
  });
170
150
 
@@ -174,20 +154,7 @@ POSSIBILITY OF SUCH DAMAGE.
174
154
  if (!node.subscriptions) {
175
155
  node.subscriptions = [subscription = {uri: '', type: 'include'}];
176
156
  }
177
-
178
- // *** MOBSEARCH *** //
179
-
180
- mobsearchOpts = {
181
- htmlElementId: 'mobsearch',
182
- list: node.subscriptions,
183
- containerRowName: 'node-input-subs-container-row',
184
- containerName: 'node-input-subs-container',
185
- containerSecondFieldName: 'node-input-sub-type',
186
- };
187
- initMobsearch.toIns_listed(mobiusSrvc, mobsearchOpts);
188
-
189
- // *** END MOBSEARCH *** //
190
-
157
+ // Populate list with all saved filters
191
158
  for (let i = 0; i < node.subscriptions.length; i++) {
192
159
  let subscription = node.subscriptions[i];
193
160
  $("#node-input-subs-container").editableList('addItem', subscription);
@@ -28,7 +28,7 @@
28
28
  'use strict';
29
29
 
30
30
  module.exports = function (RED) {
31
- function MobiusFlowNode(n) {
31
+ function MobiusFlowNode (n) {
32
32
  RED.nodes.createNode(this, n);
33
33
  this.subscriptions = n.subscriptions;
34
34
  this.sendType = n.send;
@@ -45,7 +45,7 @@ module.exports = function (RED) {
45
45
  node.status({
46
46
  fill: 'red',
47
47
  shape: 'ring',
48
- text: 'Disconnected',
48
+ text: 'Disconnected'
49
49
  });
50
50
 
51
51
  node.serviceConn.register(node);
@@ -54,57 +54,54 @@ module.exports = function (RED) {
54
54
  node.status({
55
55
  fill: 'green',
56
56
  shape: 'ring',
57
- text: 'Busy',
57
+ text: 'Busy'
58
58
  });
59
59
 
60
- node
61
- .discoverAllObjectURIs(msg)
62
- .then((objectList) => {
63
- if (node.sendType === 'individual') {
64
- objectList.forEach((mobiusObject) => {
65
- if (node.outputType === 'uris') {
66
- node.send({
67
- topic: mobiusObject.uri,
68
- payload: mobiusObject.uri,
69
- });
70
- } else {
71
- node.send({
72
- topic: mobiusObject.uri,
73
- payload: mobiusObject,
74
- });
75
- }
76
- });
77
- } else {
60
+ node.discoverAllObjectURIs(msg).then((objectList) => {
61
+ if (node.sendType === 'individual') {
62
+ objectList.forEach((mobiusObject) => {
78
63
  if (node.outputType === 'uris') {
79
- const uris = [];
80
- objectList.forEach((mobiusObject) => {
81
- uris.push(mobiusObject.uri);
82
- });
83
64
  node.send({
84
- topic: msg.topic,
85
- payload: uris,
65
+ topic: mobiusObject.uri,
66
+ payload: mobiusObject.uri
86
67
  });
87
68
  } else {
88
69
  node.send({
89
- topic: msg.topic,
90
- payload: objectList,
70
+ topic: mobiusObject.uri,
71
+ payload: mobiusObject
91
72
  });
92
- }
93
- }
94
-
95
- node.status({
96
- fill: 'green',
97
- shape: 'dot',
98
- text: 'Done',
99
- });
100
- })
101
- .catch(() => {
102
- node.status({
103
- fill: 'yellow',
104
- shape: 'dot',
105
- text: 'Failed discovery',
73
+ }
106
74
  });
75
+ } else {
76
+ if (node.outputType === 'uris') {
77
+ const uris = [];
78
+ objectList.forEach((mobiusObject) => {
79
+ uris.push(mobiusObject.uri);
80
+ });
81
+ node.send({
82
+ topic: msg.topic,
83
+ payload: uris
84
+ });
85
+ } else {
86
+ node.send({
87
+ topic: msg.topic,
88
+ payload: objectList
89
+ });
90
+ }
91
+ }
92
+
93
+ node.status({
94
+ fill: 'green',
95
+ shape: 'dot',
96
+ text: 'Done'
97
+ });
98
+ }).catch(() => {
99
+ node.status({
100
+ fill: 'yellow',
101
+ shape: 'dot',
102
+ text: 'Failed discovery'
107
103
  });
104
+ });
108
105
  if (done) {
109
106
  done();
110
107
  }
@@ -134,7 +131,7 @@ module.exports = function (RED) {
134
131
  pids: pids,
135
132
  rid: node.rid,
136
133
  func: node.func,
137
- limit: node.limit,
134
+ limit: node.limit
138
135
  };
139
136
  } else {
140
137
  discoverParams = {
@@ -142,21 +139,19 @@ module.exports = function (RED) {
142
139
  pids: pids,
143
140
  rid: '00',
144
141
  func: 'return true;',
145
- limit: 512,
142
+ limit: 512
146
143
  };
147
144
  }
148
145
  try {
149
146
  let objects = await discover(node.serviceConn, discoverParams);
150
147
  for (let lp = 0; lp < objects.value.length; lp++) {
151
- objects.value[lp][
152
- 'uri'
153
- ] = `${serviceURI}/${objects.value[lp].pid}/${objects.value[lp].ins}`;
148
+ objects.value[lp]['uri'] = `${serviceURI}/${objects.value[lp].pid}/${objects.value[lp].ins}`;
154
149
  objectList.push(objects.value[lp]);
155
150
  }
156
151
  } catch (err) {
157
152
  node.warn(`Discover object failed for service (${serviceURI}) - ${err.message}`);
158
153
  }
159
- }
154
+ }
160
155
 
161
156
  if (objectList.length === 0) {
162
157
  throw new Error('No discovery data found');
@@ -181,28 +176,23 @@ module.exports = function (RED) {
181
176
  let profiles = await discover(serviceConn, `${hid}/${sid}`);
182
177
  let pids = [];
183
178
  for (const pid of profiles.value) {
184
- if (
185
- isIncluded(`${hid}/${sid}/${pid}/#`, subscriptions) &&
186
- !isExcluded(`${hid}/${sid}/${pid}/#`, subscriptions)
187
- ) {
179
+ if (isIncluded(`${hid}/${sid}/${pid}/#`, subscriptions) && !isExcluded(`${hid}/${sid}/${pid}/#`, subscriptions)) {
188
180
  pids.push(pid);
189
- }
181
+ }
190
182
  }
191
183
  if (pids.length > 0) {
192
184
  discoveredProfiles.set(`${hid}/${sid}`, pids);
193
185
  }
194
186
  }
195
187
  } else {
196
- RED.log.warn(
197
- `Failed to discover objects for service ${service.id.split('/')[1]} as it is offline.`
198
- );
188
+ RED.log.warn(`Failed to discover objects for service ${service.id.split('/')[1]} as it is offline.`);
199
189
  }
200
190
  }
201
191
  resolve(discoveredProfiles);
202
192
  });
203
193
  }
204
194
 
205
- async function discover(serviceConn, params) {
195
+ async function discover (serviceConn, params) {
206
196
  return new Promise((resolve, reject) => {
207
197
  serviceConn.discover(params, (err, response) => {
208
198
  if (err) {
@@ -212,7 +202,7 @@ module.exports = function (RED) {
212
202
  }
213
203
  });
214
204
  });
215
- }
205
+ };
216
206
 
217
207
  function isIncluded(uri, subscriptions) {
218
208
  let include = false;
@@ -226,7 +216,7 @@ module.exports = function (RED) {
226
216
  return include;
227
217
  }
228
218
 
229
- function isExcluded(uri, subscriptions) {
219
+ function isExcluded (uri, subscriptions) {
230
220
  let exclude = false;
231
221
  for (const subscription of subscriptions) {
232
222
  if (subscription.type === 'exclude' && validateSubscription(subscription.uri)) {
@@ -238,7 +228,7 @@ module.exports = function (RED) {
238
228
  return exclude;
239
229
  }
240
230
 
241
- function validateSubscription(uri) {
231
+ function validateSubscription (uri) {
242
232
  let parts = uri.split('/');
243
233
  for (let lp = 0; lp < parts.length; lp++) {
244
234
  if (parts[lp] === null || parts[lp] === '') {
@@ -254,11 +244,11 @@ module.exports = function (RED) {
254
244
  return false;
255
245
  }
256
246
 
257
- function matchTopic(filter, topic) {
247
+ function matchTopic (filter, topic) {
258
248
  const filterArray = filter.split('/');
259
249
  const topicArray = topic.split('/');
260
250
  const length = filterArray.length < topicArray.length ? filterArray.length : topicArray.length;
261
-
251
+
262
252
  for (let i = 0; i < length; ++i) {
263
253
  const left = filterArray[i];
264
254
  const right = topicArray[i];
@@ -270,12 +260,4 @@ module.exports = function (RED) {
270
260
  }
271
261
 
272
262
  RED.nodes.registerType('mobius discover object list', MobiusFlowNode);
273
-
274
- RED.httpAdmin.get('/common/*', function (req, res) {
275
- var options = {
276
- root: __dirname + '/common/',
277
- dotfiles: 'deny',
278
- };
279
- res.sendFile(req.params[0], options);
280
- });
281
263
  };
@@ -34,16 +34,12 @@ POSSIBILITY OF SUCH DAMAGE.
34
34
  <label for="node-input-connection"><i class="fa fa-globe"></i> MOBiUS</label>
35
35
  <input type="text" id="node-input-connection">
36
36
  </div>
37
- <div id="node-input-subs-container-row" class="form-row node-input-subs-container-row">
37
+ <div class="form-row node-input-subs-container-row">
38
38
  <label for="node-input-subs-container"><i class="fa fa-bars"></i> Subscriptions</label>
39
39
  <ol id="node-input-subs-container"></ol>
40
40
  </div>
41
-
42
- <div id="mobsearch"></div>
43
41
  </script>
44
42
 
45
- <script src="common/mobsearch.js"></script>
46
-
47
43
  <script type="text/javascript">
48
44
  RED.nodes.registerType('mobius flow inject', {
49
45
  category: 'mobius',
@@ -71,7 +67,6 @@ POSSIBILITY OF SUCH DAMAGE.
71
67
  },
72
68
  oneditprepare: function () {
73
69
  var node = this;
74
- let mobiusSrvc = $("#node-input-connection").val();
75
70
 
76
71
  /** Create the subs container and populate it */
77
72
  $('#node-input-subs-container').css('min-height', '300px').css('min-width', '450px').editableList ({
@@ -91,11 +86,6 @@ POSSIBILITY OF SUCH DAMAGE.
91
86
 
92
87
  var row = $('<div>URI</div>').appendTo(container);
93
88
  var uriField = $('<input/>',{class: "node-input-sub-uri", type: "text", style: "width: 200px; margin-left: 5px; text-align: left;"}).appendTo(row);
94
-
95
- // *** MOBSEARCH *** //
96
- var searchField = $('<a class="searchbutton" style="vertical-align: middle"><i id="node-lookup-instance-icon" class="fa fa-search"></i></a>').appendTo(row);
97
- // *** END MOBSEARCH *** //
98
-
99
89
  var typeField = $('<select/>',{class: "node-input-sub-type", style: "width:auto; margin-left: 5px; text-align: center;"}).appendTo(row);
100
90
  typeField.append($("<option></option>").val('include').text('Include'));
101
91
  typeField.append($("<option></option>").val('exclude').text('Exclude'));
@@ -103,15 +93,6 @@ POSSIBILITY OF SUCH DAMAGE.
103
93
  // Populate the new stat
104
94
  uriField.val(subscription.uri);
105
95
  typeField.val(subscription.type);
106
-
107
- // *** MOBSEARCH *** //
108
-
109
- if (!node.subscriptions[i]) {
110
- node.subscriptions[i] = {uri: '', type: 'include'}
111
- }
112
-
113
- addMobsearchListButton(searchField, i, mobsearchOpts)
114
- // *** END MOBSEARCH *** //
115
96
  }
116
97
  });
117
98
 
@@ -119,20 +100,7 @@ POSSIBILITY OF SUCH DAMAGE.
119
100
  if (!node.subscriptions) {
120
101
  node.subscriptions = [subscription = {uri: '', type: 'include'}];
121
102
  }
122
-
123
- // *** MOBSEARCH *** //
124
-
125
- mobsearchOpts = {
126
- htmlElementId: 'mobsearch',
127
- list: node.subscriptions,
128
- containerRowName: 'node-input-subs-container-row',
129
- containerName: 'node-input-subs-container',
130
- containerSecondFieldName: 'node-input-sub-type',
131
- };
132
- initMobsearch.toIns_listed(mobiusSrvc, mobsearchOpts);
133
-
134
- // *** END MOBSEARCH *** //
135
-
103
+ // Populate list with all saved filters
136
104
  for (let i = 0; i < node.subscriptions.length; i++) {
137
105
  let subscription = node.subscriptions[i];
138
106
  $("#node-input-subs-container").editableList('addItem', subscription);