refactord, tidied up, added icon for storage and a new node for writing buffers to storage files
This commit is contained in:
50
rtdb/rtdb-set.html
Normal file
50
rtdb/rtdb-set.html
Normal file
@ -0,0 +1,50 @@
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('rtdb-set',{
|
||||
|
||||
category: 'firebase-admin',
|
||||
color: '#a6bbcf',
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
cred: {value: "", type: 'firebase-config'}
|
||||
},
|
||||
inputs:1,
|
||||
outputs:0,
|
||||
icon: "firebase-admin-icon.png",
|
||||
label: function() {
|
||||
return this.name||"rtdb-set";
|
||||
},
|
||||
|
||||
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="rtdb-set">
|
||||
<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-cred"><i class="icon-tag"></i> Credentials</label>
|
||||
<input type="text" id="node-input-cred" placeholder="Name">
|
||||
</div>
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="rtdb-set">
|
||||
<p>A node that wraps the rtdb-set SDK</p>
|
||||
</script>
|
||||
Reference in New Issue
Block a user