node-red-contrib-mobius-flow-base 2.5.86-beta.40 → 2.5.86-beta.45
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.
- package/dist/nodes/mobius-discover-object-list.html +10 -1
- package/dist/nodes/mobius-flow-inject.html +270 -2
- package/dist/nodes/mobius-get-multi-object.html +4 -6
- package/dist/nodes/mobius-get-multi-resource.html +325 -4
- package/dist/nodes/mobius-get-resource.html +307 -3
- package/dist/nodes/mobius-object-cov.html +3 -0
- package/dist/nodes/mobius-resource-cov.html +309 -4
- package/dist/nodes/mobius-set-multi-resource.html +271 -4
- package/dist/nodes/mobius-set-multi-resource.js +10 -12
- package/dist/nodes/mobius-set-resource.html +307 -3
- package/package.json +1 -1
|
@@ -410,16 +410,25 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
410
410
|
// *** MOBSEARCH *** //
|
|
411
411
|
|
|
412
412
|
function updateList() {
|
|
413
|
+
$("#node-input-subs-container").editableList('items').each(function (i) {
|
|
414
|
+
let sub = $(this);
|
|
415
|
+
let type = sub.find(".node-input-sub-type").val();
|
|
416
|
+
node.subscriptions[i].type = type;
|
|
417
|
+
})
|
|
413
418
|
$("#node-input-subs-container").editableList('empty');
|
|
414
419
|
for (let i = 0; i < node.subscriptions.length; i++) {
|
|
415
420
|
let subscription = node.subscriptions[i];
|
|
416
421
|
$("#node-input-subs-container").editableList('addItem', subscription);
|
|
417
422
|
}
|
|
418
423
|
}
|
|
419
|
-
updateList()
|
|
420
424
|
|
|
421
425
|
// *** END MOBSEARCH *** //
|
|
422
426
|
|
|
427
|
+
for (let i = 0; i < node.subscriptions.length; i++) {
|
|
428
|
+
let subscription = node.subscriptions[i];
|
|
429
|
+
$("#node-input-subs-container").editableList('addItem', subscription);
|
|
430
|
+
}
|
|
431
|
+
|
|
423
432
|
function showRIDFilterInputs() {
|
|
424
433
|
if($("#node-input-useRIDValueFiltering").is(':checked')) {
|
|
425
434
|
$("#use-rid-filter-row").show();
|
|
@@ -34,10 +34,28 @@ 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 class="form-row node-input-subs-container-row">
|
|
37
|
+
<div id="node-input-subs-container-row" 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="instance-search-row">
|
|
43
|
+
<div class="form-row">
|
|
44
|
+
<label for="instance-search-sid"><i class="fa fa-search"></i> Search</label>
|
|
45
|
+
<input type="text" id="instance-search-hid" style="width:15%;" placeholder="HID">
|
|
46
|
+
<input type="text" id="instance-search-sid" style="width:10%;" placeholder="SID">
|
|
47
|
+
<input type="text" id="instance-search-pid" style="width:10%;" placeholder="PID">
|
|
48
|
+
<input type="text" id="instance-search-ins" style="width:10%;" placeholder="INS">
|
|
49
|
+
<a id="node-search-return" class="searchbutton" style="vertical-align: middle"><i id="node-search-return-icon" class="fa fa-arrow-left"></i></a>
|
|
50
|
+
<a id="node-search-accept" class="searchbutton" style="vertical-align: middle"><i id="node-search-accept-icon" class="fa fa-check"></i></a>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<div id="wildcard-alert-row" class="form-row hidden" style="color:#555555" align="center">
|
|
54
|
+
<p>Please note: The selection of wildcard '+'
|
|
55
|
+
means a search for a specific instance or resource
|
|
56
|
+
cannot be performed. As such, enter the
|
|
57
|
+
INS manually.</p>
|
|
58
|
+
</div>
|
|
41
59
|
</script>
|
|
42
60
|
|
|
43
61
|
<script type="text/javascript">
|
|
@@ -67,6 +85,215 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
67
85
|
},
|
|
68
86
|
oneditprepare: function () {
|
|
69
87
|
var node = this;
|
|
88
|
+
let mobiusSrvc = $("#node-input-connection").val();
|
|
89
|
+
|
|
90
|
+
// *** MOBSEARCH *** //
|
|
91
|
+
|
|
92
|
+
$("#instance-search-row").hide();
|
|
93
|
+
$("#wildcard-alert-row").hide();
|
|
94
|
+
$("#node-search-return").addClass('disabled');
|
|
95
|
+
$.getJSON(`mgethid?mobius=${mobiusSrvc}`, function (response) {
|
|
96
|
+
$("#instance-search-hid").val(response);
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
let globalSubscriptionIndex = 0;
|
|
100
|
+
|
|
101
|
+
let searchObject = {
|
|
102
|
+
hid: '',
|
|
103
|
+
sid: '',
|
|
104
|
+
pid: '',
|
|
105
|
+
ins: '',
|
|
106
|
+
objects: []
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//Function to search for INSs
|
|
110
|
+
function insSearch (objects, pid) {
|
|
111
|
+
let inss = ['#'];
|
|
112
|
+
for (let i = 0; i < objects.length; i++) {
|
|
113
|
+
if (objects[i].pid === pid) {
|
|
114
|
+
const name = objects[i].resources[1].pv;
|
|
115
|
+
if (name === '') {
|
|
116
|
+
inss.push(objects[i].ins);
|
|
117
|
+
} else {
|
|
118
|
+
inss.push(`${objects[i].ins} - ${name}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
$("#instance-search-ins").autocomplete({
|
|
123
|
+
source: inss,
|
|
124
|
+
minLength: 0,
|
|
125
|
+
close: function (event, ui) {
|
|
126
|
+
acceptCheck();
|
|
127
|
+
$("#instance-search-ins").autocomplete('destroy');
|
|
128
|
+
if ($("#instance-search-ins").val().length > 4) {
|
|
129
|
+
$("#instance-search-ins").val($("#instance-search-ins").val().substring(0, 4))
|
|
130
|
+
}
|
|
131
|
+
searchObject.ins = $("#instance-search-ins").val();
|
|
132
|
+
}
|
|
133
|
+
}).autocomplete('search', '');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
//Function to search for PIDs
|
|
137
|
+
function pidsSearch(objects) {
|
|
138
|
+
searchObject.objects = objects;
|
|
139
|
+
let pids = ['#', '+'];
|
|
140
|
+
for (let i = 0; i < objects.length; i++) {
|
|
141
|
+
pids.push(`${objects[i].pid} - ${objects[i].profileName}`);
|
|
142
|
+
}
|
|
143
|
+
pids = [...new Set(pids)];
|
|
144
|
+
$("#instance-search-pid").autocomplete({
|
|
145
|
+
source: pids,
|
|
146
|
+
minLength: 0,
|
|
147
|
+
close: function (event, ui) {
|
|
148
|
+
acceptCheck();
|
|
149
|
+
$("#instance-search-pid").autocomplete('destroy');
|
|
150
|
+
if ($("#instance-search-pid").val().length > 4) {
|
|
151
|
+
$("#instance-search-pid").val($("#instance-search-pid").val().substring(0, 4))
|
|
152
|
+
}
|
|
153
|
+
searchObject.pid = $("#instance-search-pid").val();
|
|
154
|
+
}
|
|
155
|
+
}).autocomplete('search', '');
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
//Function to search for SIDs, and then fetch child objects based on selection
|
|
159
|
+
function serviceSearch(response) {
|
|
160
|
+
let services = ['#', '+'];
|
|
161
|
+
for (let i = 0; i < response.length; i++) {
|
|
162
|
+
if (response[i].sid !== '009') {
|
|
163
|
+
services.push(`${response[i].sid} - ${response[i].name}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
$("#instance-search-sid").autocomplete({
|
|
167
|
+
source: services,
|
|
168
|
+
minLength: 0,
|
|
169
|
+
close: function (event, ui) {
|
|
170
|
+
acceptCheck();
|
|
171
|
+
$("#instance-search-sid").autocomplete('destroy');
|
|
172
|
+
if ($("#instance-search-sid").val().length > 3) {
|
|
173
|
+
$("#instance-search-sid").val($("#instance-search-sid").val().substring(0, 3))
|
|
174
|
+
}
|
|
175
|
+
searchObject.sid = $("#instance-search-sid").val();
|
|
176
|
+
if (searchObject.sid === '+') {
|
|
177
|
+
for (let i = 2; i < services.length; i++) {
|
|
178
|
+
$.getJSON(`mgetobjects?mobius=${mobiusSrvc}&hid=${searchObject.hid}&sid=${services[i].substring(0, 3)}`, (objects) => {
|
|
179
|
+
searchObject.objects = searchObject.objects.concat(objects);
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
$.getJSON(`mgetobjects?mobius=${mobiusSrvc}&hid=${searchObject.hid}&sid=${searchObject.sid}`, (objects) => {
|
|
184
|
+
searchObject.objects = objects;
|
|
185
|
+
})
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}).autocomplete('search', '');
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
//Start a new search
|
|
192
|
+
function startSearch() {
|
|
193
|
+
$("#wildcard-alert-row").hide();
|
|
194
|
+
$("#instance-search-sid").val('');
|
|
195
|
+
$("#instance-search-pid").val('');
|
|
196
|
+
$("#instance-search-ins").val('');
|
|
197
|
+
searchObject.hid = $("#instance-search-hid").val()
|
|
198
|
+
searchObject.sid = '';
|
|
199
|
+
searchObject.pid = '';
|
|
200
|
+
searchObject.ins = '';
|
|
201
|
+
searchObject.objects = [];
|
|
202
|
+
if (/((^([0-9A-F]){6}$)|^$)/.test(searchObject.hid)) {
|
|
203
|
+
$.getJSON(`mgetservices?mobius=${mobiusSrvc}&hid=${searchObject.hid}`, serviceSearch)
|
|
204
|
+
.fail((err) => {
|
|
205
|
+
console.log('Some kind of html failure message on service discovery');
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
//Finish a search
|
|
211
|
+
function finishSearch() {
|
|
212
|
+
$("#wildcard-alert-row").hide();
|
|
213
|
+
let uri = `${searchObject.hid}/${searchObject.sid}/${searchObject.pid}/${searchObject.ins}`
|
|
214
|
+
if (uri.includes('#')) {
|
|
215
|
+
uri = uri.substring(0,uri.indexOf('#') + 1)
|
|
216
|
+
}
|
|
217
|
+
node.subscriptions[globalSubscriptionIndex].uri = uri;
|
|
218
|
+
updateList()
|
|
219
|
+
$("#node-search-accept").css('color', '#CCCCCC');
|
|
220
|
+
readyToAccept = false;
|
|
221
|
+
$("#node-search-return").addClass('disabled');
|
|
222
|
+
$("#node-search-accept").addClass('disabled');
|
|
223
|
+
$("#instance-search-row").hide();
|
|
224
|
+
$('#node-input-subs-container-row').show();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
//Function to update if accept button is grade out and functions based on conditions of fields
|
|
228
|
+
function acceptCheck() {
|
|
229
|
+
if (($("#instance-search-hid").val() !== '' && $("#instance-search-sid").val() !== '' && $("#instance-search-pid").val() !== '' && $("#instance-search-ins").val() !== '') ||
|
|
230
|
+
$("#instance-search-sid").val() === '#' || $("#instance-search-pid").val() === '#' || $("#instance-search-ins").val() === '#') {
|
|
231
|
+
$("#node-search-accept").css('color', '#555555');
|
|
232
|
+
readyToAccept = true;
|
|
233
|
+
} else {
|
|
234
|
+
$("#node-search-accept").css('color', '#CCCCCC');
|
|
235
|
+
readyToAccept = false;
|
|
236
|
+
}
|
|
237
|
+
if ($("#instance-search-sid").val() !== '+' && $("#instance-search-pid").val() !== '+') {
|
|
238
|
+
$("#wildcard-alert-row").hide();
|
|
239
|
+
} else {
|
|
240
|
+
$("#wildcard-alert-row").show();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
$("#instance-search-sid").click(function () { //SID field clicked
|
|
245
|
+
$("#instance-search-pid").val('')
|
|
246
|
+
$("#instance-search-ins").val('')
|
|
247
|
+
searchObject.pid = '';
|
|
248
|
+
searchObject.ins = '';
|
|
249
|
+
searchObject.objects = [];
|
|
250
|
+
startSearch();
|
|
251
|
+
})
|
|
252
|
+
$("#instance-search-pid").click(function () { //PID field clicked
|
|
253
|
+
$("#instance-search-ins").val('')
|
|
254
|
+
searchObject.ins = '';
|
|
255
|
+
if (searchObject.sid !== '') {
|
|
256
|
+
pidsSearch(searchObject.objects);
|
|
257
|
+
}
|
|
258
|
+
})
|
|
259
|
+
$("#instance-search-ins").click(function () { //INS field clicked
|
|
260
|
+
if (searchObject.pid !== '' && searchObject.pid !== '+' && searchObject.sid !== '+') {
|
|
261
|
+
insSearch(searchObject.objects, searchObject.pid);
|
|
262
|
+
}
|
|
263
|
+
})
|
|
264
|
+
$("#node-search-return").click(function () { //Return/Back button clicked
|
|
265
|
+
$("#node-search-return").addClass('disabled');
|
|
266
|
+
$("#node-search-accept").addClass('disabled');
|
|
267
|
+
$("#instance-search-row").hide();
|
|
268
|
+
$('#node-input-subs-container-row').show();
|
|
269
|
+
});
|
|
270
|
+
$("#node-search-accept").click(function () { //Accept button clicked
|
|
271
|
+
if (readyToAccept) {
|
|
272
|
+
finishSearch();
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// Respond to search field changes
|
|
277
|
+
$("#instance-search-hid").change(function () {
|
|
278
|
+
acceptCheck();
|
|
279
|
+
$("#instance-search-sid").val('');
|
|
280
|
+
$("#instance-search-pid").val('');
|
|
281
|
+
$("#instance-search-ins").val('');
|
|
282
|
+
});
|
|
283
|
+
$("#instance-search-sid").change(function () {
|
|
284
|
+
searchObject.sid = $("#instance-search-sid").val()
|
|
285
|
+
acceptCheck();
|
|
286
|
+
});
|
|
287
|
+
$("#instance-search-pid").change(function () {
|
|
288
|
+
searchObject.pid = $("#instance-search-pid").val()
|
|
289
|
+
acceptCheck();
|
|
290
|
+
});
|
|
291
|
+
$("#instance-search-ins").change(function () {
|
|
292
|
+
searchObject.ins = $("#instance-search-ins").val()
|
|
293
|
+
acceptCheck();
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
// *** END MOBSEARCH *** //
|
|
70
297
|
|
|
71
298
|
/** Create the subs container and populate it */
|
|
72
299
|
$('#node-input-subs-container').css('min-height', '300px').css('min-width', '450px').editableList ({
|
|
@@ -86,6 +313,11 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
86
313
|
|
|
87
314
|
var row = $('<div>URI</div>').appendTo(container);
|
|
88
315
|
var uriField = $('<input/>',{class: "node-input-sub-uri", type: "text", style: "width: 200px; margin-left: 5px; text-align: left;"}).appendTo(row);
|
|
316
|
+
|
|
317
|
+
// *** MOBSEARCH *** //
|
|
318
|
+
var searchField = $('<a class="searchbutton" style="vertical-align: middle"><i id="node-lookup-instance-icon" class="fa fa-search"></i></a>').appendTo(row);
|
|
319
|
+
// *** END MOBSEARCH *** //
|
|
320
|
+
|
|
89
321
|
var typeField = $('<select/>',{class: "node-input-sub-type", style: "width:auto; margin-left: 5px; text-align: center;"}).appendTo(row);
|
|
90
322
|
typeField.append($("<option></option>").val('include').text('Include'));
|
|
91
323
|
typeField.append($("<option></option>").val('exclude').text('Exclude'));
|
|
@@ -93,6 +325,25 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
93
325
|
// Populate the new stat
|
|
94
326
|
uriField.val(subscription.uri);
|
|
95
327
|
typeField.val(subscription.type);
|
|
328
|
+
|
|
329
|
+
// *** MOBSEARCH *** //
|
|
330
|
+
|
|
331
|
+
if (!node.subscriptions[i]) {
|
|
332
|
+
node.subscriptions[i] = {uri: '', type: 'include'}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
searchField.click(function () {
|
|
336
|
+
globalSubscriptionIndex = i;
|
|
337
|
+
$('#node-input-subs-container-row').hide();
|
|
338
|
+
$("#instance-search-sid").val('');
|
|
339
|
+
$("#instance-search-pid").val('');
|
|
340
|
+
$("#instance-search-ins").val('');
|
|
341
|
+
$("#node-search-return").removeClass('disabled');
|
|
342
|
+
$("#node-search-accept").removeClass('disabled');
|
|
343
|
+
$("#instance-search-row").show();
|
|
344
|
+
|
|
345
|
+
});
|
|
346
|
+
// *** END MOBSEARCH *** //
|
|
96
347
|
}
|
|
97
348
|
});
|
|
98
349
|
|
|
@@ -100,7 +351,24 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
100
351
|
if (!node.subscriptions) {
|
|
101
352
|
node.subscriptions = [subscription = {uri: '', type: 'include'}];
|
|
102
353
|
}
|
|
103
|
-
|
|
354
|
+
|
|
355
|
+
// *** MOBSEARCH *** //
|
|
356
|
+
|
|
357
|
+
function updateList() {
|
|
358
|
+
$("#node-input-subs-container").editableList('items').each(function (i) {
|
|
359
|
+
let sub = $(this);
|
|
360
|
+
let type = sub.find(".node-input-sub-type").val();
|
|
361
|
+
node.subscriptions[i].type = type;
|
|
362
|
+
})
|
|
363
|
+
$("#node-input-subs-container").editableList('empty');
|
|
364
|
+
for (let i = 0; i < node.subscriptions.length; i++) {
|
|
365
|
+
let subscription = node.subscriptions[i];
|
|
366
|
+
$("#node-input-subs-container").editableList('addItem', subscription);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// *** END MOBSEARCH *** //
|
|
371
|
+
|
|
104
372
|
for (let i = 0; i < node.subscriptions.length; i++) {
|
|
105
373
|
let subscription = node.subscriptions[i];
|
|
106
374
|
$("#node-input-subs-container").editableList('addItem', subscription);
|
|
@@ -319,7 +319,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
var row = $('<div>URI</div>').appendTo(container);
|
|
322
|
-
var uriField = $('<input/>',{class: "node-input-mobject-uri", type: "text", style: "width:
|
|
322
|
+
var uriField = $('<input/>',{class: "node-input-mobject-uri", type: "text", style: "width: 180px; margin-left: 5px; text-align: left;"}).appendTo(row);
|
|
323
323
|
|
|
324
324
|
// *** MOBSEARCH *** //
|
|
325
325
|
var searchField = $('<a class="searchbutton" style="vertical-align: middle"><i id="node-lookup-instance-icon" class="fa fa-search"></i></a>').appendTo(row);
|
|
@@ -327,7 +327,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
327
327
|
|
|
328
328
|
row.append(' - ');
|
|
329
329
|
|
|
330
|
-
var commentField = $('<input/>',{class: "node-input-mobject-comment", type: "text", style: "width:
|
|
330
|
+
var commentField = $('<input/>',{class: "node-input-mobject-comment", type: "text", style: "width: 120px; margin-left: 5px; text-align: left;"}).appendTo(row);
|
|
331
331
|
|
|
332
332
|
// Populate the new stat
|
|
333
333
|
uriField.val(mobject.uri);
|
|
@@ -365,9 +365,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
365
365
|
function updateList() {
|
|
366
366
|
$("#node-input-mobjects-container").editableList('items').each(function (i) {
|
|
367
367
|
let mobject = $(this);
|
|
368
|
-
let uri = mobject.find(".node-input-mobject-uri").val();
|
|
369
368
|
let comment = mobject.find(".node-input-mobject-comment").val();
|
|
370
|
-
console.log(i);
|
|
371
369
|
node.mobjects[i].comment = comment;
|
|
372
370
|
})
|
|
373
371
|
$("#node-input-mobjects-container").editableList('empty');
|
|
@@ -377,12 +375,12 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
377
375
|
}
|
|
378
376
|
}
|
|
379
377
|
|
|
378
|
+
// *** END MOBSEARCH *** //
|
|
379
|
+
|
|
380
380
|
for (let i = 0; i < node.mobjects.length; i++) {
|
|
381
381
|
let mobject = node.mobjects[i];
|
|
382
382
|
$("#node-input-mobjects-container").editableList('addItem', mobject);
|
|
383
383
|
}
|
|
384
|
-
|
|
385
|
-
// *** END MOBSEARCH *** //
|
|
386
384
|
},
|
|
387
385
|
oneditresize(size) {
|
|
388
386
|
var rows = $("#dialog-form>div:not(.node-input-mobjects-container)");
|