1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
node-red/nodes/storage/66-mongodb.html
2013-09-05 15:02:48 +01:00

92 lines
3.1 KiB
HTML

<!--
Copyright 2013 IBM Corp.
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/x-red" data-template-name="mongodb">
<div class="form-row">
<label for="node-config-input-hostname"><i class="icon-bookmark"></i> Host</label>
<input class="input-append-left" type="text" id="node-config-input-hostname" placeholder="localhost" style="width: 40%;" >
<label for="node-config-input-port" style="margin-left: 10px; width: 35px; "> Port</label>
<input type="text" id="node-config-input-port" placeholder="27017" style="width:45px">
</div>
<div class="form-row">
<label for="node-config-input-db"><i class="icon-briefcase"></i> Database</label>
<input type="text" id="node-config-input-db" placeholder="test">
</div>
</script>
<script type="text/x-red" data-help-name="mongodb out">
<p>A MongoDB output node.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('mongodb',{
category: 'config',
color:"rgb(218, 196, 180)",
defaults: {
hostname: { value:"127.0.0.1",required:true},
port: { value: 27017,required:true},
db: { value:"",required:true},
},
label: function() {
return this.hostname+":"+this.port+"//"+this.db;
}
});
</script>
<script type="text/x-red" data-template-name="mongodb out">
<div class="form-row">
<label for="node-input-mongodb"><i class="icon-tag"></i> Server</label>
<input type="text" id="node-input-mongodb">
</div>
<div class="form-row">
<label for="node-input-collection"><i class="icon-briefcase"></i> Collection</label>
<input type="text" id="node-input-collection" placeholder="collection">
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="mongodb out">
<p>A MongoDB output node.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('mongodb out',{
category: 'storage-output',
color:"rgb(218, 196, 180)",
defaults: {
mongodb: { type:"mongodb",required:true},
name: {value:""},
collection: {value:"",required:true},
},
inputs:1,
outputs:0,
icon: "mongodb.png",
align: "right",
label: function() {
return this.name||this.collection||((this.mongodb)?RED.nodes.node(this.mongodb).label():"mongodb");
}
});
</script>