Add fixed conversion modes to base64 node

to close #401
This commit is contained in:
Dave Conway-Jones
2018-02-03 15:08:05 +00:00
parent b406b32909
commit f9ac210a41
3 changed files with 50 additions and 24 deletions

View File

@@ -1,5 +1,13 @@
<script type="text/x-red" data-template-name="base64">
<div class="form-row">
<label for="node-input-action"><i class="fa fa-dot-circle-o"></i> Action</label>
<select style="width:70%" id="node-input-action">
<option value="">Convert Buffer <-> Base64</option>
<option value="str">Convert String to Base64</option>
<option value="b64">Convert Base64 to String</option>
</select>
</div>
<div class="form-row">
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="node-red:common.label.property"></span></label>
<input type="text" id="node-input-property" style="width:70%;"/>
@@ -11,9 +19,10 @@
</script>
<script type="text/x-red" data-help-name="base64">
<p>A function that converts the chosen proerty (default <code>msg.payload</code>) to and from base64 format.</p>
<p>A function that converts the chosen property (default <code>msg.payload</code>) to and from base64 format.</p>
<p>If the input is a buffer it converts it to a Base64 encoded string.</p>
<p>If the input is a Base64 string it converts it back to a binary buffer.</p>
<p>You can also fix conversion string to base64,and base64 to string if required.</p>
</script>
<script type="text/javascript">
@@ -22,6 +31,7 @@
color:"#DEBD5C",
defaults: {
name: {value:""},
action: {value:""},
property: {value:"payload",required:true}
},
inputs:1,