|
137 | 137 | </script>
|
138 | 138 | </script>
|
139 | 139 |
|
| 140 | +<script type="text/x-red" data-template-name="cloudant in"> |
| 141 | + <div class="form-row"> |
| 142 | + <label for="node-input-service"><i class="fa fa-folder-close"></i> Service</label> |
| 143 | + <select id="node-input-service"> |
| 144 | + <option value="" disabled></option> |
| 145 | + <option value="_ext_"> External service</option> |
| 146 | + </select> |
| 147 | + </div> |
| 148 | + |
| 149 | + <div class="form-row hide" id="node-input-external-details"> |
| 150 | + <label for="node-input-cloudant"><i class=" fa fa-bookmark"></i> Server</label> |
| 151 | + <input type="text" id="node-input-cloudant"> |
| 152 | + </div> |
| 153 | + |
| 154 | + <div class="form-row"> |
| 155 | + <label for="node-input-database"><i class="fa fa-briefcase"></i> Database</label> |
| 156 | + <input type="text" id="node-input-database" placeholder="database"> |
| 157 | + </div> |
| 158 | + |
| 159 | + <div class="form-row"> |
| 160 | + <label for="node-input-design-doc"><i class="fa fa-search"></i> Search Idx.</label> |
| 161 | + <input type="text" id="node-input-design" style="width: 30%" placeholder="design document"> |
| 162 | + / |
| 163 | + <input type="text" id="node-input-index" style="width: 30%" placeholder="index name"> |
| 164 | + </div> |
| 165 | + |
| 166 | + <div class="form-row"> |
| 167 | + <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> |
| 168 | + <input type="text" id="node-input-name" placeholder="Name"> |
| 169 | + </div> |
| 170 | + |
| 171 | + <script> |
| 172 | + $("#node-input-operation").change(function() { |
| 173 | + var id = $("#node-input-operation option:selected").val(); |
| 174 | + if (id == "delete") $(".node-input-payonly").hide(); |
| 175 | + else $(".node-input-payonly").show(); |
| 176 | + }); |
| 177 | + </script> |
| 178 | +</script> |
| 179 | + |
140 | 180 | <script type="text/javascript">
|
141 | 181 | RED.nodes.registerType("cloudant out", {
|
142 | 182 | category: "storage-output",
|
|
160 | 200 | oneditprepare: oneditprepare
|
161 | 201 | });
|
162 | 202 |
|
| 203 | + RED.nodes.registerType("cloudant in", { |
| 204 | + category: "storage-input", |
| 205 | + color: "rgb(114, 199, 231)", |
| 206 | + defaults: { |
| 207 | + service : { value: "", required: true }, |
| 208 | + cloudant: { type: "cloudant", validate: validateServer }, |
| 209 | + name : { value: "" }, |
| 210 | + database: { value: "", required: true }, |
| 211 | + design : { value: "", required: true }, |
| 212 | + index : { value: "", required: true } |
| 213 | + }, |
| 214 | + inputs : 1, |
| 215 | + outputs: 1, |
| 216 | + icon : "cloudant.png", |
| 217 | + label : label, |
| 218 | + labelStyle: function() { |
| 219 | + return this.name?"node_label_italic":""; |
| 220 | + }, |
| 221 | + oneditprepare: oneditprepare |
| 222 | + }); |
| 223 | + |
163 | 224 | function oneditprepare() {
|
164 | 225 | var select = $('#node-input-service');
|
165 | 226 | var node = this;
|
|
228 | 289 | and selecting the <b>remove</b> option for the node.
|
229 | 290 | </p>
|
230 | 291 | </script>
|
| 292 | + |
| 293 | +<script type="text/x-red" data-help-name="cloudant in"> |
| 294 | + <p> |
| 295 | + A node for searching a Cloudant database using a Search Index. |
| 296 | + </p> |
| 297 | + <p> |
| 298 | + Query is performed on existing <b>Search Indexes</b> stored on the desired |
| 299 | + database. The query argument should be passed on the <code>msg.payload</code> |
| 300 | + following the <code>indexName:value</code> pattern. |
| 301 | + </p> |
| 302 | +</script> |
0 commit comments