|
13 | 13 | See the License for the specific language governing permissions and |
14 | 14 | limitations under the License. |
15 | 15 | --> |
| 16 | + |
| 17 | +<!-- Service Credentials Configuration Node --> |
| 18 | +<script type="text/x-red" data-template-name="watson-retrieve-rank-credentials"> |
| 19 | + <div class="form-row"> |
| 20 | + <label for="node-config-input-username"><i class="fa fa-user"></i> Username</label> |
| 21 | + <input type="text" id="node-config-input-username" placeholder="Username"> |
| 22 | + </div> |
| 23 | + <div class="form-row"> |
| 24 | + <label for="node-config-input-password"><i class="fa fa-key"></i> Password</label> |
| 25 | + <input type="password" id="node-config-input-password" placeholder="Password"> |
| 26 | + </div> |
| 27 | +</script> |
| 28 | + |
| 29 | +<script type="text/javascript"> |
| 30 | +(function() { |
| 31 | + console.log("hello"); |
| 32 | + RED.nodes.registerType('watson-retrieve-rank-credentials',{ |
| 33 | + category: 'config', |
| 34 | + defaults: { |
| 35 | + username:{value: ""}, |
| 36 | + password:{value: ""} |
| 37 | + }, |
| 38 | + label: function() { |
| 39 | + return 'Retrieve and Rank Credentials'; |
| 40 | + } |
| 41 | + }); |
| 42 | +})(); |
| 43 | +</script> |
| 44 | + |
| 45 | + |
16 | 46 | <!-- Create Cluster Node --> |
17 | 47 | <script type="text/x-red" data-template-name="watson-retrieve-rank-create-cluster"> |
18 | 48 | <div id="credentials-check" class="form-row"> |
|
24 | 54 | <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
25 | 55 | <input type="text" id="node-input-name" placeholder="Name"> |
26 | 56 | </div> |
27 | | - <div class="form-row credentials" style="display: none;"> |
28 | | - <label for="node-input-username"><i class="fa fa-user"></i> Username</label> |
29 | | - <input type="text" id="node-input-username" placeholder="Username"> |
30 | | - </div> |
31 | | - <div class="form-row credentials" style="display: none;"> |
32 | | - <label for="node-input-password"><i class="fa fa-key"></i> Password</label> |
33 | | - <input type="password" id="node-input-password" placeholder="Password"> |
| 57 | + <div class="form-row servicecreds"> |
| 58 | + <label for="node-input-bluemix"><i class="fa fa-user"></i> Service Credentials</label> |
| 59 | + <input type="text" id="node-input-servicecreds"> |
34 | 60 | </div> |
35 | 61 | <div class="form-row clustername"> |
36 | 62 | <label for="node-input-clustername"><i class="fa fa-tag"></i> Cluster Name</label> |
|
64 | 90 | category: 'IBM Watson', |
65 | 91 | defaults: { |
66 | 92 | name: {value: ""}, |
| 93 | + servicecreds: {value: "", type: 'watson-retrieve-rank-credentials', required: false}, |
67 | 94 | clustername: {value: ""}, |
68 | 95 | clustersize: {value: "free"} |
69 | 96 | }, |
70 | | - credentials: { |
71 | | - username: {type:"text"}, |
72 | | - password: {type:"password"} |
73 | | - }, |
74 | 97 | color: "rgb(85, 150, 230)", |
75 | 98 | inputs: 1, |
76 | 99 | outputs: 1, |
|
84 | 107 | }, |
85 | 108 | oneditprepare: function() { |
86 | 109 | $.getJSON('watson-retrieve-and-rank/vcap/').done(function (service) { |
87 | | - $('.credentials').toggle(!service); |
| 110 | + $('.servicecreds').toggle(!service); |
88 | 111 | }).fail(function () { |
89 | | - $('.credentials').show(); |
| 112 | + $('.servicecreds').show(); |
90 | 113 | }).always(function () { |
91 | 114 | $('#credentials-check').hide(); |
92 | 115 | }) |
|
106 | 129 | <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
107 | 130 | <input type="text" id="node-input-name" placeholder="Name"> |
108 | 131 | </div> |
109 | | - <div class="form-row credentials" style="display: none;"> |
110 | | - <label for="node-input-username"><i class="fa fa-user"></i> Username</label> |
111 | | - <input type="text" id="node-input-username" placeholder="Username"> |
112 | | - </div> |
113 | | - <div class="form-row credentials" style="display: none;"> |
114 | | - <label for="node-input-password"><i class="fa fa-key"></i> Password</label> |
115 | | - <input type="password" id="node-input-password" placeholder="Password"> |
| 132 | + <div class="form-row servicecreds"> |
| 133 | + <label for="node-input-bluemix"><i class="fa fa-user"></i> Service Credentials</label> |
| 134 | + <input type="text" id="node-input-servicecreds"> |
116 | 135 | </div> |
117 | 136 | <div class="form-row"> |
118 | 137 | <label for="node-input-mode"><i class="fa fa-question"></i> Mode</label> |
|
147 | 166 | defaults: { |
148 | 167 | name: {value: ""}, |
149 | 168 | mode: {value: "list"}, |
| 169 | + servicecreds: {value: "", type: 'watson-retrieve-rank-credentials', required: false}, |
150 | 170 | clusterid: {value: ""} |
151 | 171 | }, |
152 | 172 | credentials: { |
|
174 | 194 | } |
175 | 195 | }); |
176 | 196 | $.getJSON('watson-retrieve-and-rank/vcap/').done(function (service) { |
177 | | - $('.credentials').toggle(!service); |
| 197 | + $('.servicecreds').toggle(!service); |
178 | 198 | }).fail(function () { |
179 | | - $('.credentials').show(); |
| 199 | + $('.servicecreds').show(); |
180 | 200 | }).always(function () { |
181 | 201 | $('#credentials-check').hide(); |
182 | 202 | }) |
|
196 | 216 | <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
197 | 217 | <input type="text" id="node-input-name" placeholder="Name"> |
198 | 218 | </div> |
199 | | - <div class="form-row credentials" style="display: none;"> |
200 | | - <label for="node-input-username"><i class="fa fa-user"></i> Username</label> |
201 | | - <input type="text" id="node-input-username" placeholder="Username"> |
202 | | - </div> |
203 | | - <div class="form-row credentials" style="display: none;"> |
204 | | - <label for="node-input-password"><i class="fa fa-key"></i> Password</label> |
205 | | - <input type="password" id="node-input-password" placeholder="Password"> |
| 219 | + <div class="form-row servicecreds"> |
| 220 | + <label for="node-input-bluemix"><i class="fa fa-user"></i> Service Credentials</label> |
| 221 | + <input type="text" id="node-input-servicecreds"> |
206 | 222 | </div> |
207 | 223 | <div class="form-row mode clusterid"> |
208 | 224 | <label for="node-input-clusterid"><i class="fa fa-tag"></i> Cluster ID</label> |
|
228 | 244 | category: 'IBM Watson', |
229 | 245 | defaults: { |
230 | 246 | name: {value: ""}, |
| 247 | + servicecreds: {value: "", type: 'watson-retrieve-rank-credentials', required: false}, |
231 | 248 | clusterid: {value: "", required: true}, |
232 | 249 | configname: {value: "", required: true} |
233 | 250 | }, |
234 | | - credentials: { |
235 | | - username: {type:"text"}, |
236 | | - password: {type:"password"} |
237 | | - }, |
238 | 251 | color: "rgb(85, 150, 230)", |
239 | 252 | inputs: 1, |
240 | 253 | outputs: 1, |
|
248 | 261 | }, |
249 | 262 | oneditprepare: function() { |
250 | 263 | $.getJSON('watson-retrieve-and-rank/vcap/').done(function (service) { |
251 | | - $('.credentials').toggle(!service); |
| 264 | + $('.servicecreds').toggle(!service); |
252 | 265 | }).fail(function () { |
253 | | - $('.credentials').show(); |
| 266 | + $('.servicecreds').show(); |
254 | 267 | }).always(function () { |
255 | 268 | $('#credentials-check').hide(); |
256 | 269 | }) |
|
270 | 283 | <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
271 | 284 | <input type="text" id="node-input-name" placeholder="Name"> |
272 | 285 | </div> |
273 | | - <div class="form-row credentials" style="display: none;"> |
274 | | - <label for="node-input-username"><i class="fa fa-user"></i> Username</label> |
275 | | - <input type="text" id="node-input-username" placeholder="Username"> |
276 | | - </div> |
277 | | - <div class="form-row credentials" style="display: none;"> |
278 | | - <label for="node-input-password"><i class="fa fa-key"></i> Password</label> |
279 | | - <input type="password" id="node-input-password" placeholder="Password"> |
| 286 | + <div class="form-row servicecreds"> |
| 287 | + <label for="node-input-bluemix"><i class="fa fa-user"></i> Service Credentials</label> |
| 288 | + <input type="text" id="node-input-servicecreds"> |
280 | 289 | </div> |
281 | 290 | <div class="form-row clusterid"> |
282 | 291 | <label for="node-input-clusterid"><i class="fa fa-tag"></i> Cluster ID</label> |
|
314 | 323 | category: 'IBM Watson', |
315 | 324 | defaults: { |
316 | 325 | name: {value: ""}, |
| 326 | + servicecreds: {value: "", type: 'watson-retrieve-rank-credentials', required: false}, |
317 | 327 | clusterid: {value: "", required: true}, |
318 | 328 | mode: {value: "list"}, |
319 | 329 | configname: {value: ""} |
320 | 330 |
|
321 | 331 | }, |
322 | | - credentials: { |
323 | | - username: {type:"text"}, |
324 | | - password: {type:"password"} |
325 | | - }, |
326 | 332 | color: "rgb(85, 150, 230)", |
327 | 333 | inputs: 1, |
328 | 334 | outputs: 1, |
|
344 | 350 | } |
345 | 351 | }); |
346 | 352 | $.getJSON('watson-retrieve-and-rank/vcap/').done(function (service) { |
347 | | - $('.credentials').toggle(!service); |
| 353 | + $('.servicecreds').toggle(!service); |
348 | 354 | }).fail(function () { |
349 | | - $('.credentials').show(); |
| 355 | + $('.servicecreds').show(); |
350 | 356 | }).always(function () { |
351 | 357 | $('#credentials-check').hide(); |
352 | 358 | }) |
|
366 | 372 | <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
367 | 373 | <input type="text" id="node-input-name" placeholder="Name"> |
368 | 374 | </div> |
369 | | - <div class="form-row credentials" style="display: none;"> |
370 | | - <label for="node-input-username"><i class="fa fa-user"></i> Username</label> |
371 | | - <input type="text" id="node-input-username" placeholder="Username"> |
372 | | - </div> |
373 | | - <div class="form-row credentials" style="display: none;"> |
374 | | - <label for="node-input-password"><i class="fa fa-key"></i> Password</label> |
375 | | - <input type="password" id="node-input-password" placeholder="Password"> |
| 375 | + <div class="form-row servicecreds"> |
| 376 | + <label for="node-input-bluemix"><i class="fa fa-user"></i> Service Credentials</label> |
| 377 | + <input type="text" id="node-input-servicecreds"> |
376 | 378 | </div> |
377 | 379 | <div class="form-row clusterid"> |
378 | 380 | <label for="node-input-clusterid"><i class="fa fa-tag"></i> Cluster ID</label> |
|
418 | 420 | category: 'IBM Watson', |
419 | 421 | defaults: { |
420 | 422 | name: {value: ""}, |
| 423 | + servicecreds: {value: "", type: 'watson-retrieve-rank-credentials', required: false}, |
421 | 424 | clusterid: {value: "", required: true}, |
422 | 425 | collectionname: {value: "", required: true}, |
423 | 426 | mode: {value: "create"}, |
424 | 427 | configname: {value: ""} |
425 | 428 |
|
426 | | - }, |
427 | | - credentials: { |
428 | | - username: {type:"text"}, |
429 | | - password: {type:"password"} |
430 | | - }, |
| 429 | + }, |
431 | 430 | color: "rgb(85, 150, 230)", |
432 | 431 | inputs: 1, |
433 | 432 | outputs: 1, |
|
449 | 448 | } |
450 | 449 | }); |
451 | 450 | $.getJSON('watson-retrieve-and-rank/vcap/').done(function (service) { |
452 | | - $('.credentials').toggle(!service); |
| 451 | + $('.servicecreds').toggle(!service); |
453 | 452 | }).fail(function () { |
454 | | - $('.credentials').show(); |
| 453 | + $('.servicecreds').show(); |
455 | 454 | }).always(function () { |
456 | 455 | $('#credentials-check').hide(); |
457 | 456 | }) |
|
471 | 470 | <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
472 | 471 | <input type="text" id="node-input-name" placeholder="Name"> |
473 | 472 | </div> |
474 | | - <div class="form-row credentials" style="display: none;"> |
475 | | - <label for="node-input-username"><i class="fa fa-user"></i> Username</label> |
476 | | - <input type="text" id="node-input-username" placeholder="Username"> |
477 | | - </div> |
478 | | - <div class="form-row credentials" style="display: none;"> |
479 | | - <label for="node-input-password"><i class="fa fa-key"></i> Password</label> |
480 | | - <input type="password" id="node-input-password" placeholder="Password"> |
| 473 | + <div class="form-row servicecreds"> |
| 474 | + <label for="node-input-bluemix"><i class="fa fa-user"></i> Service Credentials</label> |
| 475 | + <input type="text" id="node-input-servicecreds"> |
481 | 476 | </div> |
482 | 477 | <div class="form-row rankername"> |
483 | 478 | <label for="node-input-rankername"><i class="fa fa-tag"></i> Ranker Name</label> |
|
501 | 496 | category: 'IBM Watson', |
502 | 497 | defaults: { |
503 | 498 | name: {value: ""}, |
| 499 | + servicecreds: {value: "", type: 'watson-retrieve-rank-credentials', required: false}, |
504 | 500 | rankername: {value: ""} |
505 | 501 | }, |
506 | | - credentials: { |
507 | | - username: {type:"text"}, |
508 | | - password: {type:"password"} |
509 | | - }, |
510 | 502 | color: "rgb(85, 150, 230)", |
511 | 503 | inputs: 1, |
512 | 504 | outputs: 1, |
|
520 | 512 | }, |
521 | 513 | oneditprepare: function() { |
522 | 514 | $.getJSON('watson-retrieve-and-rank/vcap/').done(function (service) { |
523 | | - $('.credentials').toggle(!service); |
| 515 | + $('.servicecreds').toggle(!service); |
524 | 516 | }).fail(function () { |
525 | | - $('.credentials').show(); |
| 517 | + $('.servicecreds').show(); |
526 | 518 | }).always(function () { |
527 | 519 | $('#credentials-check').hide(); |
528 | 520 | }) |
|
542 | 534 | <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
543 | 535 | <input type="text" id="node-input-name" placeholder="Name"> |
544 | 536 | </div> |
545 | | - <div class="form-row credentials" style="display: none;"> |
546 | | - <label for="node-input-username"><i class="fa fa-user"></i> Username</label> |
547 | | - <input type="text" id="node-input-username" placeholder="Username"> |
548 | | - </div> |
549 | | - <div class="form-row credentials" style="display: none;"> |
550 | | - <label for="node-input-password"><i class="fa fa-key"></i> Password</label> |
551 | | - <input type="password" id="node-input-password" placeholder="Password"> |
| 537 | + <div class="form-row servicecreds"> |
| 538 | + <label for="node-input-bluemix"><i class="fa fa-user"></i> Service Credentials</label> |
| 539 | + <input type="text" id="node-input-servicecreds"> |
552 | 540 | </div> |
553 | 541 | <div class="form-row"> |
554 | 542 | <label for="node-input-mode"><i class="fa fa-question"></i> Mode</label> |
|
584 | 572 | category: 'IBM Watson', |
585 | 573 | defaults: { |
586 | 574 | name: {value: ""}, |
| 575 | + servicecreds: {value: "", type: 'watson-retrieve-rank-credentials', required: false}, |
587 | 576 | mode: {value: "list"}, |
588 | 577 | rankerid: {value: ""} |
589 | 578 | }, |
590 | | - credentials: { |
591 | | - username: {type:"text"}, |
592 | | - password: {type:"password"} |
593 | | - }, |
594 | 579 | color: "rgb(85, 150, 230)", |
595 | 580 | inputs: 1, |
596 | 581 | outputs: 1, |
|
612 | 597 | } |
613 | 598 | }); |
614 | 599 | $.getJSON('watson-retrieve-and-rank/vcap/').done(function (service) { |
615 | | - $('.credentials').toggle(!service); |
| 600 | + $('.servicecreds').toggle(!service); |
616 | 601 | }).fail(function () { |
617 | | - $('.credentials').show(); |
| 602 | + $('.servicecreds').show(); |
618 | 603 | }).always(function () { |
619 | 604 | $('#credentials-check').hide(); |
620 | 605 | }) |
|
634 | 619 | <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
635 | 620 | <input type="text" id="node-input-name" placeholder="Name"> |
636 | 621 | </div> |
637 | | - <div class="form-row credentials" style="display: none;"> |
638 | | - <label for="node-input-username"><i class="fa fa-user"></i> Username</label> |
639 | | - <input type="text" id="node-input-username" placeholder="Username"> |
640 | | - </div> |
641 | | - <div class="form-row credentials" style="display: none;"> |
642 | | - <label for="node-input-password"><i class="fa fa-key"></i> Password</label> |
643 | | - <input type="password" id="node-input-password" placeholder="Password"> |
| 622 | + <div class="form-row servicecreds"> |
| 623 | + <label for="node-input-bluemix"><i class="fa fa-user"></i> Service Credentials</label> |
| 624 | + <input type="text" id="node-input-servicecreds"> |
644 | 625 | </div> |
645 | 626 | <div class="form-row mode clusterid"> |
646 | 627 | <label for="node-input-clusterid"><i class="fa fa-tag"></i> Cluster ID</label> |
|
683 | 664 | category: 'IBM Watson', |
684 | 665 | defaults: { |
685 | 666 | name: {value: ""}, |
| 667 | + servicecreds: {value: "", type: 'watson-retrieve-rank-credentials', required: false}, |
686 | 668 | clusterid: {value: "", required: true}, |
687 | 669 | collectionname: {value: "", required: true}, |
688 | 670 | searchmode: {value: "search-and-rank"}, |
689 | 671 | rankerid: {value: ""} |
690 | 672 | }, |
691 | | - credentials: { |
692 | | - username: {type:"text"}, |
693 | | - password: {type:"password"} |
694 | | - }, |
695 | 673 | color: "rgb(85, 150, 230)", |
696 | 674 | inputs: 1, |
697 | 675 | outputs: 1, |
|
705 | 683 | }, |
706 | 684 | oneditprepare: function() { |
707 | 685 | $.getJSON('watson-retrieve-and-rank/vcap/').done(function (service) { |
708 | | - $('.credentials').toggle(!service); |
| 686 | + $('.servicecreds').toggle(!service); |
709 | 687 | }).fail(function () { |
710 | | - $('.credentials').show(); |
| 688 | + $('.servicecreds').show(); |
711 | 689 | }).always(function () { |
712 | 690 | $('#credentials-check').hide(); |
713 | 691 | }) |
|
0 commit comments