@theotherwillembotha/node-red-plugincore 0.0.55 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/build/Nodes.html +23 -21
- package/build/Plugins.js +0 -1
- package/build/core/NodeConstructor.d.ts +1 -0
- package/build/core/NodeConstructor.d.ts.map +1 -1
- package/build/core/NodeConstructor.js +5 -12
- package/build/core/NodeGenerator.d.ts.map +1 -1
- package/build/core/NodeGenerator.js +0 -1
- package/build/core/webhook/WebhookDecorator.d.ts.map +1 -1
- package/build/core/webhook/WebhookDecorator.js +43 -6
- package/build/core/webhook/service/ReverseProxyTypeService.d.ts +1 -0
- package/build/core/webhook/service/ReverseProxyTypeService.d.ts.map +1 -1
- package/build/core/webhook/service/WebhookServerService.d.ts.map +1 -1
- package/build/core/webhook/service/WebhookServerService.js +0 -5
- package/package.json +2 -3
- package/src/core/NodeConstructor.ts +6 -13
- package/src/core/NodeGenerator.ts +0 -1
- package/src/core/logger/template/LoggerTemplate.html +2 -2
- package/src/core/metrics/node/TimerMetricConfigNode.html +2 -2
- package/src/core/other/template/BasicTemplate.html +5 -2
- package/src/core/webhook/WebhookDecorator.ts +53 -10
- package/src/core/webhook/service/ReverseProxyTypeService.ts +1 -0
- package/src/core/webhook/service/WebhookServerService.ts +0 -5
- package/src/core/webhook/template/WebhookTemplate.html +1 -1
- package/build/core/logger/node/ConsoleLoggerConfigNode.html +0 -90
- package/build/core/logger/node/RestLoggerConfigNode.html +0 -183
- package/build/core/logger/template/LoggerTemplate.html +0 -331
- package/build/core/metrics/node/CounterMetricConfigNode.html +0 -48
- package/build/core/metrics/node/GaugeMetricConfigNode.html +0 -48
- package/build/core/metrics/node/MetricsConfigNode.html +0 -21
- package/build/core/metrics/node/TimerMetricConfigNode.html +0 -190
- package/build/core/metrics/template/CounterMetricTemplate.html +0 -40
- package/build/core/metrics/template/GaugeMetricTemplate.html +0 -39
- package/build/core/metrics/template/MetricsTemplate.html +0 -54
- package/build/core/metrics/template/TimerMetricTemplate.html +0 -39
- package/build/core/other/node/DelegatedConfigReferenceNode.html +0 -1
- package/build/core/other/template/BasicTemplate.html +0 -76
- package/build/core/other/template/SettingsTemplate.html +0 -128
- package/build/core/ui/template/ScriptEditorTemplate.html +0 -50
- package/build/core/ui/template/UIHelperTemplate.html +0 -229
- package/build/core/webhook/node/WebhookServerConfigNode.html +0 -61
- package/build/core/webhook/template/WebhookTemplate.html +0 -442
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<script type="text/javascript" template-section="onCompose">
|
|
3
|
-
node
|
|
4
|
-
.addDefault("settingsTimestamp", { value:0})
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<div template-section="onIncludeOnce">
|
|
8
|
-
<script type="text/javascript">
|
|
9
|
-
getNodeSettings = function(nodeId, callback){
|
|
10
|
-
console.log("Rerieving settings for node id: " + nodeId);
|
|
11
|
-
|
|
12
|
-
$.ajax({
|
|
13
|
-
url: "utils/getNodeSettings" ,
|
|
14
|
-
type: "POST",
|
|
15
|
-
data: JSON.stringify({nodeId:nodeId}),
|
|
16
|
-
contentType: "application/json; charset=utf-8",
|
|
17
|
-
success: function (response) {
|
|
18
|
-
callback(response.settings);
|
|
19
|
-
},
|
|
20
|
-
error: function (jqXHR, textStatus, errorThrown) {
|
|
21
|
-
console.log(jqXHR);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
handleNodeSettings = function(node){
|
|
27
|
-
|
|
28
|
-
// if "settingsTimestamp" is "0" then there shouldnt be any settings to retrieve.
|
|
29
|
-
if(node.settingsTimestamp === undefined || node.settingsTimestamp === 0){
|
|
30
|
-
console.log("settingstimestamp = 0. No settings to retrieve");
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// if "settingsTimestamp" is not "0", retieve the settings.
|
|
35
|
-
console.log("settingstimestamp != 0. Load settings");
|
|
36
|
-
getNodeSettings(node.id, settings => {
|
|
37
|
-
//console.log("settings retrieved: " + JSON.stringify(settings, null, 2));
|
|
38
|
-
// if the settings is undefined, it means that the node has not been persisted yet.
|
|
39
|
-
if(settings === undefined){
|
|
40
|
-
console.log("no settings retrieved");
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
console.log("Settings timestamp: " + settings.settingsTimestamp);
|
|
45
|
-
console.log("Node timestamp: " + node.settingsTimestamp);
|
|
46
|
-
|
|
47
|
-
if(settings.settingsTimestamp !== node.settingsTimestamp){
|
|
48
|
-
// if "settingsTimestamp" is different than the one that was returned by getSettings(),
|
|
49
|
-
// then dont replace the current values with settings.
|
|
50
|
-
console.log("config timestamp different than settings timestamp. no update")
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// TODO:
|
|
55
|
-
// if "settingsTimestamp" is the same as the one returned by getSettings(), then replace the config values with those from settings.
|
|
56
|
-
console.log("Replacing Settings");
|
|
57
|
-
|
|
58
|
-
// go through the defaults and find the elements and their types that are assigned to them.
|
|
59
|
-
let inputValueSetters = {
|
|
60
|
-
"text" : (input, value) => { input.val(value) },
|
|
61
|
-
"number" : (input, value) => { input.val(value) },
|
|
62
|
-
"select-one" : (input, value) => { input.val(value) },
|
|
63
|
-
"hidden" : (input, value) => { input.val(value) },
|
|
64
|
-
"checkbox" : (input, value) => { input.val(value).prop("checked", value).trigger('change') },
|
|
65
|
-
// todo: add the other types of inputs here.
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
let prefix = (node._def.category === "config") ? "#node-config-input-" : "#node-input-";
|
|
69
|
-
Object.keys(node._def.defaults)
|
|
70
|
-
.filter(entry => settings.hasOwnProperty(entry))
|
|
71
|
-
.forEach(entry => {
|
|
72
|
-
try{
|
|
73
|
-
// get the field.
|
|
74
|
-
let field = $(prefix + entry);
|
|
75
|
-
|
|
76
|
-
if(!field[0]){
|
|
77
|
-
console.log("field " + (prefix + entry) + "[0] not found");
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// get the setter for the field.
|
|
82
|
-
let setValue = inputValueSetters[field[0].type];
|
|
83
|
-
if(setValue){
|
|
84
|
-
try{
|
|
85
|
-
//console.log("setting " + prefix + entry + " to " + settings[entry]);
|
|
86
|
-
setValue(field, settings[entry]);
|
|
87
|
-
}
|
|
88
|
-
catch(error){
|
|
89
|
-
console.log(error);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
else{
|
|
93
|
-
console.log("no setter for type: " + field[0].type + " (" + entry + ")")
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
catch(error){
|
|
97
|
-
console.log(error);
|
|
98
|
-
}
|
|
99
|
-
})
|
|
100
|
-
return;
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
</script>
|
|
104
|
-
</div>
|
|
105
|
-
|
|
106
|
-
<script type="text/javascript" template-section="onIncludeEditPrepare">
|
|
107
|
-
handleNodeSettings(node);
|
|
108
|
-
</script>
|
|
109
|
-
|
|
110
|
-
<script type="text/javascript" template-section="onIncludeEditSave">
|
|
111
|
-
// set the value for "settingsTimestamp" to now() - this will ensure that values are not overwritten if the editor is opened again before a deploy.
|
|
112
|
-
|
|
113
|
-
// NOTE on ONDEPLOY on the server side:
|
|
114
|
-
// when the deployment is being done and there are no settings, then this is a first deployment. Do the intialization and persist to settings (remember to include 'settingsTimestamp')
|
|
115
|
-
// when the deployment is being done and 'settingsTimestamp' from config is the same as 'settingsTimestamp' from settings, then nothing actually changed. its a redeployment
|
|
116
|
-
// when the deployment is being done and 'settingsTimestamp' from config is different from 'settingsTimestamp' from settings then its an update. (save to settings + include settingsTimestap)
|
|
117
|
-
$("#node-config-input-settingsTimestamp").val(new Date().getTime());
|
|
118
|
-
$("#node-input-settingsTimestamp").val(new Date().getTime());
|
|
119
|
-
</script>
|
|
120
|
-
|
|
121
|
-
<script type="text/html" template-section="onIncludeEditForm">
|
|
122
|
-
<input type="hidden" id="node-config-input-settingsTimestamp" />
|
|
123
|
-
<input type="hidden" id="node-input-settingsTimestamp" />
|
|
124
|
-
</script>
|
|
125
|
-
|
|
126
|
-
<script type="text/markdown" template-section="onIncludeDocumentation">
|
|
127
|
-
|
|
128
|
-
</script>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<div template-section="onIncludeOnce">
|
|
3
|
-
|
|
4
|
-
<script src="resources/@theotherwillembotha/node-red-plugincore/editorLanguageExtension.js"></script>
|
|
5
|
-
|
|
6
|
-
<script type="text/javascript">
|
|
7
|
-
|
|
8
|
-
window.PluginCore = window.PluginCore || {};
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* PluginCore.createScriptEditor(elementId, template, initialValue)
|
|
12
|
-
*
|
|
13
|
-
* Creates a Monaco editor instance with TypeScript-aware diagnostics,
|
|
14
|
-
* completions, and hover info scoped to the provided type template.
|
|
15
|
-
*
|
|
16
|
-
* @param {string} elementId - DOM id of the container element.
|
|
17
|
-
* @param {string} template - TypeScript template string. Use `${script}`
|
|
18
|
-
* as the placeholder for the user's code.
|
|
19
|
-
* @param {string} initialValue - The starting content of the editor.
|
|
20
|
-
* @returns \{{ getValue(): string, dispose(): void \}}
|
|
21
|
-
*/
|
|
22
|
-
PluginCore.createScriptEditor = function(elementId, template, initialValue) {
|
|
23
|
-
var editorInstance = null;
|
|
24
|
-
var currentValue = initialValue || '';
|
|
25
|
-
|
|
26
|
-
ScriptEditorLanguageManager.createLanguage(monaco, template).then(function(language) {
|
|
27
|
-
editorInstance = monaco.editor.create(document.getElementById(elementId), {
|
|
28
|
-
value: currentValue,
|
|
29
|
-
language: language.getName(),
|
|
30
|
-
automaticLayout: true,
|
|
31
|
-
wordBasedSuggestions: 'currentDocument',
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
getValue: function() {
|
|
37
|
-
return editorInstance ? editorInstance.getValue() : currentValue;
|
|
38
|
-
},
|
|
39
|
-
dispose: function() {
|
|
40
|
-
if (editorInstance) {
|
|
41
|
-
editorInstance.dispose();
|
|
42
|
-
editorInstance = null;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
</script>
|
|
49
|
-
|
|
50
|
-
</div>
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<div template-section="onIncludeOnce">
|
|
3
|
-
|
|
4
|
-
<style>
|
|
5
|
-
/* ─── PluginCore Dialog overlay ─────────────────────────────────────────── */
|
|
6
|
-
|
|
7
|
-
.plugincore-overlay {
|
|
8
|
-
position: fixed;
|
|
9
|
-
top: 0; left: 0; right: 0; bottom: 0;
|
|
10
|
-
background: rgba(0, 0, 0, 0.5);
|
|
11
|
-
z-index: 2000;
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.plugincore-dialog {
|
|
18
|
-
background: #fff;
|
|
19
|
-
border: 1px solid #aaa;
|
|
20
|
-
border-radius: 4px;
|
|
21
|
-
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
|
|
22
|
-
min-width: 540px;
|
|
23
|
-
max-width: 85vw;
|
|
24
|
-
max-height: 80vh;
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* Title bar — matches Node-RED's main nav bar colour */
|
|
31
|
-
.plugincore-dialog-titlebar {
|
|
32
|
-
display: flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
background: #3d3d3d;
|
|
35
|
-
color: #fff;
|
|
36
|
-
padding: 6px 8px 6px 12px;
|
|
37
|
-
flex-shrink: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.plugincore-dialog-title {
|
|
41
|
-
flex: 1;
|
|
42
|
-
font-weight: 600;
|
|
43
|
-
font-size: 13px;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* Close button — jQuery UI styling as used in Node-RED dialogs */
|
|
47
|
-
.plugincore-dialog-close {
|
|
48
|
-
color: #ccc !important;
|
|
49
|
-
background: transparent !important;
|
|
50
|
-
border-color: transparent !important;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.plugincore-dialog-close:hover {
|
|
54
|
-
color: #fff !important;
|
|
55
|
-
background: rgba(255, 255, 255, 0.15) !important;
|
|
56
|
-
border-color: rgba(255, 255, 255, 0.3) !important;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* Scrollable body that contains the jQuery UI tab widget */
|
|
60
|
-
.plugincore-dialog-body {
|
|
61
|
-
flex: 1;
|
|
62
|
-
overflow: auto;
|
|
63
|
-
padding: 10px;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/* ─── PluginCore Table ───────────────────────────────────────────────────── */
|
|
67
|
-
|
|
68
|
-
.plugincore-table {
|
|
69
|
-
width: 100%;
|
|
70
|
-
border-collapse: collapse;
|
|
71
|
-
font-size: 12px;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.plugincore-table th {
|
|
75
|
-
background: #f3f3f3;
|
|
76
|
-
border: 1px solid #ddd;
|
|
77
|
-
padding: 5px 10px;
|
|
78
|
-
text-align: left;
|
|
79
|
-
font-weight: 600;
|
|
80
|
-
white-space: nowrap;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.plugincore-table td {
|
|
84
|
-
border: 1px solid #eee;
|
|
85
|
-
padding: 5px 10px;
|
|
86
|
-
vertical-align: middle;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.plugincore-table tbody tr:nth-child(even) td {
|
|
90
|
-
background: #fafafa;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.plugincore-table tbody tr:hover td {
|
|
94
|
-
background: #f0f6ff;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.plugincore-status-enabled { color: #27ae60; }
|
|
98
|
-
.plugincore-status-disabled { color: #c0392b; }
|
|
99
|
-
</style>
|
|
100
|
-
|
|
101
|
-
<script type="text/javascript">
|
|
102
|
-
|
|
103
|
-
window.PluginCore = window.PluginCore || {};
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* PluginCore.table(config) → jQuery <table>
|
|
107
|
-
*
|
|
108
|
-
* config: {
|
|
109
|
-
* columns : [{ key, label, render?(value, row) → string | jQuery }],
|
|
110
|
-
* rows : object[]
|
|
111
|
-
* }
|
|
112
|
-
*/
|
|
113
|
-
PluginCore.table = function(config) {
|
|
114
|
-
var $table = $('<table class="plugincore-table">');
|
|
115
|
-
|
|
116
|
-
// Header
|
|
117
|
-
var $thead = $('<thead>');
|
|
118
|
-
var $hr = $('<tr>');
|
|
119
|
-
config.columns.forEach(function(col) {
|
|
120
|
-
$hr.append($('<th>').text(col.label));
|
|
121
|
-
});
|
|
122
|
-
$thead.append($hr);
|
|
123
|
-
$table.append($thead);
|
|
124
|
-
|
|
125
|
-
// Body
|
|
126
|
-
var $tbody = $('<tbody>');
|
|
127
|
-
(config.rows || []).forEach(function(row) {
|
|
128
|
-
var $tr = $('<tr>');
|
|
129
|
-
config.columns.forEach(function(col) {
|
|
130
|
-
var $td = $('<td>');
|
|
131
|
-
var val = row[col.key];
|
|
132
|
-
if (col.render) {
|
|
133
|
-
var rendered = col.render(val, row);
|
|
134
|
-
if (rendered && typeof rendered === 'object' && rendered.jquery) {
|
|
135
|
-
$td.append(rendered);
|
|
136
|
-
} else {
|
|
137
|
-
$td.html(rendered != null ? String(rendered) : '');
|
|
138
|
-
}
|
|
139
|
-
} else {
|
|
140
|
-
$td.text(val != null ? String(val) : '');
|
|
141
|
-
}
|
|
142
|
-
$tr.append($td);
|
|
143
|
-
});
|
|
144
|
-
$tbody.append($tr);
|
|
145
|
-
});
|
|
146
|
-
$table.append($tbody);
|
|
147
|
-
|
|
148
|
-
return $table;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* PluginCore.dialog(options) → { close() }
|
|
153
|
-
*
|
|
154
|
-
* options: {
|
|
155
|
-
* title : string,
|
|
156
|
-
* tabs : [{ label: string, render($container) }]
|
|
157
|
-
* }
|
|
158
|
-
*
|
|
159
|
-
* Uses jQuery UI tabs for the tab widget (already bundled with Node-RED).
|
|
160
|
-
* Closes on: close button click, overlay click, or Escape key.
|
|
161
|
-
*/
|
|
162
|
-
PluginCore.dialog = function(options) {
|
|
163
|
-
// Only one dialog at a time
|
|
164
|
-
$('.plugincore-overlay').remove();
|
|
165
|
-
|
|
166
|
-
var uid = 'plugincore-' + Date.now();
|
|
167
|
-
|
|
168
|
-
var $overlay = $('<div class="plugincore-overlay">');
|
|
169
|
-
var $dialog = $('<div class="plugincore-dialog">');
|
|
170
|
-
|
|
171
|
-
// ── Title bar ──────────────────────────────────────────────────────
|
|
172
|
-
var $titlebar = $('<div class="plugincore-dialog-titlebar">');
|
|
173
|
-
$titlebar.append(
|
|
174
|
-
$('<span class="plugincore-dialog-title">').text(options.title || '')
|
|
175
|
-
);
|
|
176
|
-
var $closeBtn = $(
|
|
177
|
-
'<button type="button" class="ui-button ui-corner-all ui-widget plugincore-dialog-close" title="Close">' +
|
|
178
|
-
'<span class="ui-icon ui-icon-closethick"></span></button>'
|
|
179
|
-
);
|
|
180
|
-
$titlebar.append($closeBtn);
|
|
181
|
-
|
|
182
|
-
// ── Body + jQuery UI tabs ──────────────────────────────────────────
|
|
183
|
-
var $body = $('<div class="plugincore-dialog-body">');
|
|
184
|
-
var $tabsEl = $('<div>').attr('id', uid + '-tabs');
|
|
185
|
-
var $ul = $('<ul>');
|
|
186
|
-
|
|
187
|
-
(options.tabs || []).forEach(function(tab, i) {
|
|
188
|
-
var paneId = uid + '-pane-' + i;
|
|
189
|
-
$ul.append(
|
|
190
|
-
$('<li>').append($('<a>').attr('href', '#' + paneId).text(tab.label))
|
|
191
|
-
);
|
|
192
|
-
var $pane = $('<div>').attr('id', paneId);
|
|
193
|
-
if (tab.render) { tab.render($pane); }
|
|
194
|
-
$tabsEl.append($pane);
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
$tabsEl.prepend($ul);
|
|
198
|
-
$body.append($tabsEl);
|
|
199
|
-
|
|
200
|
-
// ── Assemble ───────────────────────────────────────────────────────
|
|
201
|
-
$dialog.append($titlebar).append($body);
|
|
202
|
-
$overlay.append($dialog);
|
|
203
|
-
$('body').append($overlay);
|
|
204
|
-
|
|
205
|
-
// Initialise jQuery UI tabs (bundled with Node-RED)
|
|
206
|
-
$tabsEl.tabs();
|
|
207
|
-
|
|
208
|
-
// ── Close logic ───────────────────────────────────────────────────
|
|
209
|
-
var escNs = 'keydown.plugincore-dialog-' + uid;
|
|
210
|
-
|
|
211
|
-
function close() {
|
|
212
|
-
$overlay.fadeOut(150, function() { $overlay.remove(); });
|
|
213
|
-
$(document).off(escNs);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
$closeBtn.on('click', close);
|
|
217
|
-
$overlay.on('click', function(e) {
|
|
218
|
-
if ($(e.target).is($overlay)) { close(); }
|
|
219
|
-
});
|
|
220
|
-
$(document).on(escNs, function(e) {
|
|
221
|
-
if (e.key === 'Escape') { close(); }
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
return { close: close };
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
</script>
|
|
228
|
-
|
|
229
|
-
</div>
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<script type="text/javascript" template-section="onCompose">
|
|
3
|
-
node
|
|
4
|
-
.addDefault("name", { value:"Webhook Example", required:true})
|
|
5
|
-
.addDefault("port", { value:6644, required:true})
|
|
6
|
-
.addDefault("externalHost", { value:"localhost", required:true })
|
|
7
|
-
.addDefault("externalPort", { value:6644, required:true})
|
|
8
|
-
.addDefault("name", { value:"Example Test Node", required:true})
|
|
9
|
-
.setPaletteLabel("Webhook")
|
|
10
|
-
.setLabelStyle("node_label_white")
|
|
11
|
-
.setLabel(function() {return this.name })
|
|
12
|
-
.setColor("#0050E5")
|
|
13
|
-
.setInput("testInput")
|
|
14
|
-
.addOutputs("testOutput1","testOutput2","testOutput3")
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div template-section="onIncludeOnce">
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<script type="text/html" template-section="onIncludeEditForm">
|
|
22
|
-
<div id="WebhookServerConfig">
|
|
23
|
-
<div class="form-row">
|
|
24
|
-
<label class="towb_editorlabel" for="node-config-input-name"><i class="fa fa-font"></i> Name</label>
|
|
25
|
-
<input type="text" id="node-config-input-name" />
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
<div class="form-row">
|
|
29
|
-
<label class="towb_editorlabel" for="node-config-input-port"><i class="fa fa-plug"></i> Port</label>
|
|
30
|
-
<input type="number" id="node-config-input-port" />
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
<div class="form-row">
|
|
34
|
-
<label class="towb_editorlabel" for="node-config-input-externalHost"><i class="fa fa-globe"></i> External Host</label>
|
|
35
|
-
<input type="text" id="node-config-input-externalHost" />
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<div class="form-row">
|
|
39
|
-
<label class="towb_editorlabel" for="node-config-input-externalPort"><i class="fa fa-plug"></i> External Port</label>
|
|
40
|
-
<input type="number" id="node-config-input-externalPort" />
|
|
41
|
-
</div>
|
|
42
|
-
<!-- add a button here to autmatically find an open port -->
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<script type="text/markdown" template-section="onIncludeDocumentation">
|
|
48
|
-
Configuration node for an Express HTTP server that webhook nodes attach to. A single server instance is shared by all webhook nodes that reference it. The server is started when the flow is first deployed and stopped when it is torn down.
|
|
49
|
-
|
|
50
|
-
### Inputs
|
|
51
|
-
: *name* (string) : A descriptive name for this webhook server.
|
|
52
|
-
: *port* (number) : The local port the HTTP server will listen on. Defaults to `6644`. Each server instance must use a unique port.
|
|
53
|
-
|
|
54
|
-
### Reverse Proxy
|
|
55
|
-
When this server sits behind a reverse proxy, configure the following fields so that webhook nodes know the externally-visible address. This is used when registering endpoints with a reverse proxy service.
|
|
56
|
-
|
|
57
|
-
: *external host* (string) : The public hostname or IP of the reverse proxy (e.g. `myserver.example.com`).
|
|
58
|
-
: *external port* (number) : The public port exposed by the reverse proxy.
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
|