From bbd703288dba30b771f794fccf696edddf1351f3 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Tue, 6 Apr 2021 15:28:38 +0800 Subject: [PATCH] feat(socketio): support options --- socketio.html | 31 ++++++++++++++++++++++++++----- socketio.js | 10 ++++++++-- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/socketio.html b/socketio.html index 59dbd20..ee3bcbe 100644 --- a/socketio.html +++ b/socketio.html @@ -4,6 +4,7 @@ category: 'config', defaults: { port:{value:80, required:true, validate:RED.validators.number()}, + options: {value: ''}, sendClient: {value:true}, path: {value:"/socket.io"}, bindToNode: {value: false} @@ -26,11 +27,25 @@ $("#node-config-input-bindToNode").prop('checked', false); } $("#node-config-input-bindToNode").change(); + this.editor = RED.editor.createEditor({ + id: 'node-config-input-options-editor', + mode: 'ace/mode/json', + value: $("#node-config-input-options").val() + }); + }, + oneditsave: function () { + $("#node-config-input-options").val(this.editor.getValue()); + this.editor.destroy(); + delete this.editor; + }, + oneditcancel: function () { + this.editor.destroy(); + delete this.editor; } }); - - @@ -108,7 +129,7 @@ }); - -