added on nodes for rtdb and firestore andmade nodes pass through msg objects with as little changes as possible
This commit is contained in:
61
firestore/firestore-on.html
Normal file
61
firestore/firestore-on.html
Normal file
@ -0,0 +1,61 @@
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('firestore-on',{
|
||||
|
||||
category: 'firebase-admin',
|
||||
color: '#a6bbcf',
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
path: {value:""},
|
||||
cred: {value: "", type: 'firebase-config'}
|
||||
},
|
||||
inputs:1,
|
||||
outputs:1,
|
||||
icon: "firebase-admin-icon.png",
|
||||
label: function() {
|
||||
return this.name||"firestore-on";
|
||||
},
|
||||
|
||||
oneditsave: function() {
|
||||
let type = $('#apitype-select').val()
|
||||
console.log('type is set to '+type)
|
||||
|
||||
},
|
||||
|
||||
oneditprepare: function() {
|
||||
$('#apitype-select').change(function () {
|
||||
$("#node-input-apitype").val($(this).find('option:selected').val())
|
||||
});
|
||||
$("#apitype-select").val($("#node-input-apitype").val())
|
||||
$('#apitype-select').trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-template-name="firestore-on">
|
||||
<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>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-path"><i class="icon-tag"></i> Path</label>
|
||||
<input type="text" id="node-input-path" placeholder="Path">
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-cred"><i class="icon-tag"></i> Credentials</label>
|
||||
<input type="text" id="node-input-cred" placeholder="Credentials">
|
||||
</div>
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="firestore-on">
|
||||
<p>A node that wraps the firestore-on SDK</p>
|
||||
Get data from a document path in the firestore database
|
||||
<p>
|
||||
input: {"payload": {"path": "foo/bar"}}
|
||||
<p>
|
||||
output: <the document at the path "foo/bar" in the firestore database>
|
||||
</script>
|
||||
Reference in New Issue
Block a user