node-red-contrib-mobius-flow-base 2.5.86-beta.62 → 2.5.86-beta.63

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.
@@ -21,10 +21,25 @@ initMobsearch = {
21
21
  // opts.containerName
22
22
  // opts.containerSecondFieldName
23
23
 
24
- if (selectionIndex === undefined) {
24
+ if (typeof selectionIndex === undefined) {
25
25
  let selectionIndex = 0;
26
26
  }
27
27
 
28
+ const resourceHtml = `
29
+ <input type="text" id="instance-search-hid" style="width:13%;" placeholder="HID">
30
+ <input type="text" id="instance-search-sid" style="width:8%;" placeholder="SID">
31
+ <input type="text" id="instance-search-pid" style="width:10%;" placeholder="PID">
32
+ <input type="text" id="instance-search-ins" style="width:10%;" placeholder="INS">
33
+ <input type="text" id="instance-search-rid" style="width:8%;" placeholder="RID">
34
+ `;
35
+
36
+ const instanceHtml = `
37
+ <input type="text" id="instance-search-hid" style="width:15%;" placeholder="HID">
38
+ <input type="text" id="instance-search-sid" style="width:10%;" placeholder="SID">
39
+ <input type="text" id="instance-search-pid" style="width:10%;" placeholder="PID">
40
+ <input type="text" id="instance-search-ins" style="width:10%;" placeholder="INS">
41
+ `;
42
+
28
43
  function addMobsearchListButton(field, i) {
29
44
  field.click(function () {
30
45
  selectionIndex = i;
@@ -42,29 +57,17 @@ function addMobsearchListButton(field, i) {
42
57
  function getMobsearch(mobiusSrvc, useRid, listed, opts) {
43
58
  selectionIndex = 0;
44
59
 
45
- if (useRid) {
60
+ if (!listed) {
61
+ console.log('lalalal');
62
+ console.log($(`#${opts.uriFieldName}`).val());
46
63
  $(`#${opts.uriFieldName}`).val($(`#${opts.uriFieldName}`).val());
47
64
  }
48
65
 
49
- //level dependent html
50
- let rows =
51
- useRid === true
52
- ? `
53
- <input type="text" id="instance-search-hid" style="width:13%;" placeholder="HID">
54
- <input type="text" id="instance-search-sid" style="width:8%;" placeholder="SID">
55
- <input type="text" id="instance-search-pid" style="width:10%;" placeholder="PID">
56
- <input type="text" id="instance-search-ins" style="width:10%;" placeholder="INS">
57
- <input type="text" id="instance-search-rid" style="width:8%;" placeholder="RID">
58
- `
59
- : `
60
- <input type="text" id="instance-search-hid" style="width:15%;" placeholder="HID">
61
- <input type="text" id="instance-search-sid" style="width:10%;" placeholder="SID">
62
- <input type="text" id="instance-search-pid" style="width:10%;" placeholder="PID">
63
- <input type="text" id="instance-search-ins" style="width:10%;" placeholder="INS">
64
- `;
66
+ //set level dependent html
67
+ let rows = useRid === true ? resourceHtml : instanceHtml;
65
68
  let alertMsg = useRid === true ? `and/or RID ` : ``;
66
69
 
67
- //Add new html
70
+ //Inject new html
68
71
  document.getElementById(opts.htmlElementId).innerHTML += `
69
72
  <div id="instance-search-row">
70
73
  <div class="form-row">
@@ -290,40 +293,52 @@ function getMobsearch(mobiusSrvc, useRid, listed, opts) {
290
293
  //Function to update if accept button is grade out and functions based on conditions of fields
291
294
  function acceptCheck() {
292
295
  if (useRid) {
293
- if (
294
- ($('#instance-search-hid').val() !== '' &&
295
- $('#instance-search-sid').val() !== '' &&
296
- $('#instance-search-pid').val() !== '' &&
297
- $('#instance-search-ins').val() !== '' &&
298
- $('#instance-search-rid').val() !== '') ||
299
- $('#instance-search-sid').val() === '#' ||
300
- $('#instance-search-pid').val() === '#' ||
301
- $('#instance-search-ins').val() === '#' ||
302
- $('#instance-search-rid').val() === '#'
303
- ) {
304
- $('#node-search-accept').css('color', '#555555');
305
- readyToAccept = true;
306
- } else {
307
- $('#node-search-accept').css('color', '#CCCCCC');
308
- readyToAccept = false;
309
- }
296
+ checkFieldsToRid();
310
297
  } else {
311
- if (
312
- ($('#instance-search-hid').val() !== '' &&
313
- $('#instance-search-sid').val() !== '' &&
314
- $('#instance-search-pid').val() !== '' &&
315
- $('#instance-search-ins').val() !== '') ||
316
- $('#instance-search-sid').val() === '#' ||
317
- $('#instance-search-pid').val() === '#' ||
318
- $('#instance-search-ins').val() === '#'
319
- ) {
320
- $('#node-search-accept').css('color', '#555555');
321
- readyToAccept = true;
322
- } else {
323
- $('#node-search-accept').css('color', '#CCCCCC');
324
- readyToAccept = false;
325
- }
298
+ checkFieldsToIns();
299
+ }
300
+ checkWildcards();
301
+ }
302
+
303
+ function checkFieldsToRid() {
304
+ if (
305
+ ($('#instance-search-hid').val() !== '' &&
306
+ $('#instance-search-sid').val() !== '' &&
307
+ $('#instance-search-pid').val() !== '' &&
308
+ $('#instance-search-ins').val() !== '' &&
309
+ $('#instance-search-rid').val() !== '') ||
310
+ $('#instance-search-sid').val() === '#' ||
311
+ $('#instance-search-pid').val() === '#' ||
312
+ $('#instance-search-ins').val() === '#' ||
313
+ $('#instance-search-rid').val() === '#'
314
+ ) {
315
+ $('#node-search-accept').css('color', '#555555');
316
+ readyToAccept = true;
317
+ } else {
318
+ $('#node-search-accept').css('color', '#CCCCCC');
319
+ readyToAccept = false;
320
+ }
321
+ }
322
+
323
+ function checkFieldsToIns() {
324
+ if (
325
+ ($('#instance-search-hid').val() !== '' &&
326
+ $('#instance-search-sid').val() !== '' &&
327
+ $('#instance-search-pid').val() !== '' &&
328
+ $('#instance-search-ins').val() !== '') ||
329
+ $('#instance-search-sid').val() === '#' ||
330
+ $('#instance-search-pid').val() === '#' ||
331
+ $('#instance-search-ins').val() === '#'
332
+ ) {
333
+ $('#node-search-accept').css('color', '#555555');
334
+ readyToAccept = true;
335
+ } else {
336
+ $('#node-search-accept').css('color', '#CCCCCC');
337
+ readyToAccept = false;
326
338
  }
339
+ }
340
+
341
+ function checkWildcards() {
327
342
  if (
328
343
  $('#instance-search-sid').val() !== '+' &&
329
344
  $('#instance-search-pid').val() !== '+' &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-mobius-flow-base",
3
- "version": "2.5.86-beta.62",
3
+ "version": "2.5.86-beta.63",
4
4
  "description": "Node-RED base nodes for Mobius Flow",
5
5
  "main": "index.js",
6
6
  "types": "dist/index.d.ts",