Files
node-red-contrib-couchdb/couchdb.html
T
2016-03-04 11:04:16 -06:00

79 lines
2.5 KiB
HTML

<!--
Copyright 2015 Neil Kolban.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/javascript">
RED.nodes.registerType('couchdb',{
// node definition
category: "storage",
inputs: 1,
outputs: 1,
icon: "db.png",
color: "#3FADB5",
label: function () {
return this.name || "couchdb"
},
paletteLabel: "couchdb",
defaults: {
name: {
value: ""
},
serverUrl: {
value: "",
required: true
},
database: {
value: "",
required: true
},
retrievalType: {
value: "byId"
}
}
});
</script>
<script type="text/x-red" data-help-name="couchdb">
<p>A node for searching documents in a couchdb database.</p>
<p>Searching for documents can be done in a few modes. Directly by using the documents
<b>_id</b> or by using a key lookup in a view.</p>
<p>When querying using the <b>_id</b> option, the value for the documents <code>_id</code>
should be passed in the <code>msg.payload</code> as a string.</p>
<p>The database name must follow these rules:
<ul>
<li>No spaces</li>
<li>All letters in lower case</li>
<li>The first character must not be <code>_</code></li>
</ul>
</p>
</script>
<script type="text/x-red" data-template-name="couchdb">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-serverUrl"><i class="icon-tasks"></i> Server URL</label>
<input type="text" id="node-input-serverUrl" placeholder="Server URL">
</div>
<div class="form-row">
<label for="node-input-database"><i class="icon-tasks"></i> Database</label>
<input type="text" id="node-input-database" placeholder="Database">
</div>
<div class="form-row">
<label for="node-input-retrievalType"><i class="icon-tasks"></i> Retrieval Type</label>
<input type="text" id="node-input-retrievalType" placeholder="Retrieval Type">
</div>
</script>