prisme-flow
Version:
prisme platform flow engine
91 lines (82 loc) • 3.38 kB
HTML
<!--
Created by prisme.io on 09/06/2017.
@author <a href="mailto:hello@prisme.io">savane vamara</a> (prisme.io)
-->
<script type="text/x-red" data-template-name="CassandraDatabase">
<div class="form-row">
<label for="node-config-input-hosts"><i class="fa fa-globe"></i> Hosts</label>
<input type="text" id="node-config-input-hosts">
</div>
<div class="form-row">
<label for="node-config-input-port"><i class="fa fa-random"></i> Port</label>
<input type="text" id="node-config-input-port">
</div>
<div class="form-row">
<label for="node-config-input-user"><i class="fa fa-user"></i> User</label>
<input type="text" id="node-config-input-user">
</div>
<div class="form-row">
<label for="node-config-input-pass"><i class="fa fa-lock"></i> Password</label>
<input type="password" id="node-config-input-password">
</div>
<div class="form-row">
<label for="node-config-input-keyspace"><i class="fa fa-database"></i> Keyspace</label>
<input type="text" id="node-config-input-keyspace">
</div>
</script>
<script type="text/javascript">
RED.nodes.registerType('CassandraDatabase',{
category: 'config',
defaults: {
hosts: {value:"127.0.0.1",required:true},
port: {value:"9042",required:true},
keyspace: {value:"",required:true}
},
credentials: {
user: {type: "text"},
password: {type: "password"}
},
label: function() {
return this.keyspace;
}
});
</script>
<script type="text/x-red" data-template-name="cassandra">
<div class="form-row">
<label for="node-input-mydb"><i class="fa fa-database"></i> Keyspace</label>
<input type="text" id="node-input-mydb">
</div>
<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>
</script>
<script type="text/x-red" data-help-name="cassandra">
<p>Allows basic access to a Cassandra database.</p>
<p>This node uses the <b>query</b> operation against the configured database. This does allow SELECTS, INSERTS, UPDATES and DELETES.</p>
<p><code>msg.topic</code> must either hold the <i>query</i> (string) for the database or an array of <i>queries</i> (which triggers a batch execution),
and the result is returned in <code>msg.payload</code>.</p>
<p><code>msg.payload</code> can contain an optional array of values to bind to the topic.</p>
<p>Typically the returned payload will be an array of the result rows.</p>
<p>If nothing is found for the key then <i>null</i> is returned,</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('cassandra',{
category: 'storage-input',
color:"#e2d96e",
defaults: {
mydb: {type:"CassandraDatabase",required:true},
name: {value:""}
},
inputs:1,
outputs:1,
icon: "cassandra.png",
label: function() {
var levelNode = RED.nodes.node(this.mydb);
return this.name||(levelNode?levelNode.label():"cassandra");
},
labelStyle: function() {
return this.name?"node_label_italic":"";
}
});
</script>