node-red-contrib-netvar-utils
Version:
Network Variable List utility nodes for node-red
66 lines (62 loc) • 2.01 kB
HTML
<script type="text/javascript">
(function () {
'use strict';
RED.nodes.registerType('nvl-config', {
category: 'config',
defaults: {
name: { value: '' },
netvarListId: {
value: '',
required: true,
validate: RED.validators.number(),
},
netvarList: {
value: '',
required: true,
},
},
label: function () {
return this.name || 'nvl config';
},
oneditprepare: function () {
this.editor = RED.editor.createEditor({
id: 'node-config-input-netvarList-editor',
mode: 'ace/mode/text',
value: this.netvarList,
});
},
oneditsave: function () {
if (this.editor) {
this.netvarList = this.editor.getValue();
this.editor.destroy();
}
},
oneditcancel: function () {
var _a;
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.destroy();
},
});
})();
</script>
<script type="text/html" data-template-name="nvl-config">
<div class="form-row">
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-config-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-config-input-netvarListId"><i class="fa fa-hashtag"></i> List ID</label>
<input type="number" id="node-config-input-netvarListId" />
</div>
<div class="form-row">
<label style="width: 150px"><i class="fa fa-list"></i> Network variable list</label>
<div
style="height: 400px; min-height:250px;"
class="node-text-editor"
id="node-config-input-netvarList-editor"
></div>
</div>
</script>
<script type="text/html" data-help-name="nvl-config">
<p>Node description goes here.</p>
</script>
//# sourceMappingURL=nvl-config.html.map