fixed typo in rtdb get node and added auto setup for firestore and rtdb get

This commit is contained in:
Peter Svensson
2019-07-12 15:09:13 +02:00
parent ae7eb94ee3
commit d353f02b6f
2 changed files with 12 additions and 3 deletions

View File

@ -5,6 +5,7 @@
color: '#a6bbcf',
defaults: {
name: {value:""},
path: {value:""},
cred: {value: "", type: 'firebase-config'}
},
inputs:1,
@ -38,9 +39,14 @@
<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="Name">
<input type="text" id="node-input-cred" placeholder="Credentials">
</div>
</script>

View File

@ -30,12 +30,15 @@ module.exports = function(RED) {
node.on('input', function(msg) {
if(msg && msg.payload){
const path = msg.payload.path
setup()
setup(path)
}
}.bind(this));
setup()
if(config.path){
setup(config.path)
}
}
RED.nodes.registerType("firestore-get", FirebaseAdmin);