node-red-contrib-questdb 0.6.9 → 0.6.23
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/nodes/icons/questdb-logo.png +0 -0
- package/nodes/questdb-flatten.html +45 -0
- package/nodes/questdb-flatten.js +15 -0
- package/nodes/questdb-mapper.html +281 -277
- package/nodes/questdb-type-router.html +2 -1
- package/nodes/questdb-value.html +145 -0
- package/nodes/questdb-value.js +280 -0
- package/nodes/questdb.html +290 -289
- package/nodes/questdb.js +93 -40
- package/package.json +4 -2
package/nodes/questdb.html
CHANGED
|
@@ -1,289 +1,290 @@
|
|
|
1
|
-
<script type="text/javascript">
|
|
2
|
-
// Configuration node
|
|
3
|
-
RED.nodes.registerType('questdb-config',{
|
|
4
|
-
category: 'config',
|
|
5
|
-
defaults: {
|
|
6
|
-
name: {value:""},
|
|
7
|
-
protocol: {value:"http"},
|
|
8
|
-
host: {value:"localhost", required:true},
|
|
9
|
-
port: {value:9000, required:true, validate:RED.validators.number()},
|
|
10
|
-
tlsVerify: {value:true},
|
|
11
|
-
tlsCa: {value:""},
|
|
12
|
-
autoFlush: {value:true},
|
|
13
|
-
autoFlushRows: {value:
|
|
14
|
-
autoFlushInterval: {value:1000, validate:RED.validators.number()},
|
|
15
|
-
requestTimeout: {value:10000, validate:RED.validators.number()},
|
|
16
|
-
retryTimeout: {value:10000, validate:RED.validators.number()},
|
|
17
|
-
initBufSize: {value:65536, validate:RED.validators.number()},
|
|
18
|
-
maxBufSize: {value:104857600, validate:RED.validators.number()},
|
|
19
|
-
useAuth: {value:false},
|
|
20
|
-
authType: {value:"basic"}
|
|
21
|
-
},
|
|
22
|
-
credentials: {
|
|
23
|
-
username: {type:"text"},
|
|
24
|
-
password: {type:"password"},
|
|
25
|
-
token: {type:"password"}
|
|
26
|
-
},
|
|
27
|
-
label: function() {
|
|
28
|
-
return this.name || `${this.host}:${this.port}`;
|
|
29
|
-
},
|
|
30
|
-
oneditprepare: function() {
|
|
31
|
-
var tabs = RED.tabs.create({
|
|
32
|
-
id: "questdb-config-tabs",
|
|
33
|
-
onchange: function(tab) {
|
|
34
|
-
$("#questdb-config-tabs-content").children().hide();
|
|
35
|
-
$("#" + tab.id).show();
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
tabs.addTab({
|
|
39
|
-
id: "questdb-tab-connection",
|
|
40
|
-
label: "Connection"
|
|
41
|
-
});
|
|
42
|
-
tabs.addTab({
|
|
43
|
-
id: "questdb-tab-security",
|
|
44
|
-
label: "Security"
|
|
45
|
-
});
|
|
46
|
-
tabs.addTab({
|
|
47
|
-
id: "questdb-tab-advanced",
|
|
48
|
-
label: "Advanced"
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// Show/hide TLS options based on protocol
|
|
52
|
-
$("#node-config-input-protocol").on("change", function() {
|
|
53
|
-
var proto = $(this).val();
|
|
54
|
-
if (proto === "https" || proto === "tcps") {
|
|
55
|
-
$(".tls-row").show();
|
|
56
|
-
} else {
|
|
57
|
-
$(".tls-row").hide();
|
|
58
|
-
}
|
|
59
|
-
// Update default port
|
|
60
|
-
if (proto === "tcp" || proto === "tcps") {
|
|
61
|
-
if ($("#node-config-input-port").val() === "9000") {
|
|
62
|
-
$("#node-config-input-port").val("9009");
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
if ($("#node-config-input-port").val() === "9009") {
|
|
66
|
-
$("#node-config-input-port").val("9000");
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
$("#node-config-input-protocol").trigger("change");
|
|
71
|
-
|
|
72
|
-
// Show/hide auth options
|
|
73
|
-
$("#node-config-input-useAuth").on("change", function() {
|
|
74
|
-
if ($(this).is(":checked")) {
|
|
75
|
-
$(".auth-type-row").show();
|
|
76
|
-
$("#node-config-input-authType").trigger("change");
|
|
77
|
-
} else {
|
|
78
|
-
$(".auth-type-row").hide();
|
|
79
|
-
$(".auth-row").hide();
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
$("#node-config-input-useAuth").trigger("change");
|
|
83
|
-
|
|
84
|
-
// Show/hide auth fields based on auth type
|
|
85
|
-
$("#node-config-input-authType").on("change", function() {
|
|
86
|
-
var authType = $(this).val();
|
|
87
|
-
if (authType === "basic") {
|
|
88
|
-
$(".basic-auth-row").show();
|
|
89
|
-
$(".token-auth-row").hide();
|
|
90
|
-
} else {
|
|
91
|
-
$(".basic-auth-row").hide();
|
|
92
|
-
$(".token-auth-row").show();
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
$("#node-config-input-authType").trigger("change");
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
</script>
|
|
99
|
-
|
|
100
|
-
<script type="text/html" data-template-name="questdb-config">
|
|
101
|
-
<div class="form-row">
|
|
102
|
-
<ul style="min-width: 450px; margin-bottom: 20px;" id="questdb-config-tabs"></ul>
|
|
103
|
-
</div>
|
|
104
|
-
<div id="questdb-config-tabs-content">
|
|
105
|
-
<div id="questdb-tab-connection" style="display:block;">
|
|
106
|
-
<div class="form-row">
|
|
107
|
-
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
108
|
-
<input type="text" id="node-config-input-name" placeholder="QuestDB Server">
|
|
109
|
-
</div>
|
|
110
|
-
<div class="form-row">
|
|
111
|
-
<label for="node-config-input-protocol"><i class="fa fa-exchange"></i> Protocol</label>
|
|
112
|
-
<select id="node-config-input-protocol" style="width:70%;">
|
|
113
|
-
<option value="http">HTTP</option>
|
|
114
|
-
<option value="https">HTTPS (TLS)</option>
|
|
115
|
-
<option value="tcp">TCP</option>
|
|
116
|
-
<option value="tcps">TCPS (TLS)</option>
|
|
117
|
-
</select>
|
|
118
|
-
</div>
|
|
119
|
-
<div class="form-row">
|
|
120
|
-
<label for="node-config-input-host"><i class="fa fa-server"></i> Host</label>
|
|
121
|
-
<input type="text" id="node-config-input-host" placeholder="localhost or IP address">
|
|
122
|
-
</div>
|
|
123
|
-
<div class="form-row">
|
|
124
|
-
<label for="node-config-input-port"><i class="fa fa-plug"></i> Port</label>
|
|
125
|
-
<input type="text" id="node-config-input-port" placeholder="9000">
|
|
126
|
-
</div>
|
|
127
|
-
<div class="form-row tls-row">
|
|
128
|
-
<label for="node-config-input-tlsVerify"><i class="fa fa-certificate"></i> Verify TLS</label>
|
|
129
|
-
<input type="checkbox" id="node-config-input-tlsVerify" style="display:inline-block; width:auto; vertical-align:baseline;" checked>
|
|
130
|
-
<span style="margin-left:8px;">Verify server certificate</span>
|
|
131
|
-
</div>
|
|
132
|
-
<div class="form-row tls-row">
|
|
133
|
-
<label for="node-config-input-tlsCa"><i class="fa fa-file-text-o"></i> CA Cert Path</label>
|
|
134
|
-
<input type="text" id="node-config-input-tlsCa" placeholder="Path to CA certificate (PEM)">
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
<div id="questdb-tab-security" style="display:none;">
|
|
138
|
-
<div class="form-row">
|
|
139
|
-
<label for="node-config-input-useAuth"><i class="fa fa-lock"></i> Enable Auth</label>
|
|
140
|
-
<input type="checkbox" id="node-config-input-useAuth" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
141
|
-
<span style="margin-left:8px;">Enable authentication</span>
|
|
142
|
-
</div>
|
|
143
|
-
<div class="form-row auth-type-row">
|
|
144
|
-
<label for="node-config-input-authType"><i class="fa fa-id-card"></i> Auth Type</label>
|
|
145
|
-
<select id="node-config-input-authType" style="width:70%;">
|
|
146
|
-
<option value="basic">Username / Password</option>
|
|
147
|
-
<option value="token">Bearer Token</option>
|
|
148
|
-
</select>
|
|
149
|
-
</div>
|
|
150
|
-
<div class="form-row auth-row basic-auth-row">
|
|
151
|
-
<label for="node-config-input-username"><i class="fa fa-user"></i> Username</label>
|
|
152
|
-
<input type="text" id="node-config-input-username" placeholder="Username">
|
|
153
|
-
</div>
|
|
154
|
-
<div class="form-row auth-row basic-auth-row">
|
|
155
|
-
<label for="node-config-input-password"><i class="fa fa-key"></i> Password</label>
|
|
156
|
-
<input type="password" id="node-config-input-password" placeholder="Password">
|
|
157
|
-
</div>
|
|
158
|
-
<div class="form-row auth-row token-auth-row">
|
|
159
|
-
<label for="node-config-input-token"><i class="fa fa-ticket"></i> Token</label>
|
|
160
|
-
<input type="password" id="node-config-input-token" placeholder="Bearer token">
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
<div id="questdb-tab-advanced" style="display:none;">
|
|
164
|
-
<div class="form-row">
|
|
165
|
-
<label for="node-config-input-autoFlush"><i class="fa fa-refresh"></i> Auto Flush</label>
|
|
166
|
-
<input type="checkbox" id="node-config-input-autoFlush" style="display:inline-block; width:auto; vertical-align:baseline;" checked>
|
|
167
|
-
<span style="margin-left:8px;">Enable automatic flushing</span>
|
|
168
|
-
</div>
|
|
169
|
-
<div class="form-row">
|
|
170
|
-
<label for="node-config-input-autoFlushRows"><i class="fa fa-bars"></i> Flush Rows</label>
|
|
171
|
-
<input type="text" id="node-config-input-autoFlushRows" placeholder="75000">
|
|
172
|
-
<span style="margin-left:8px; font-size:0.9em; color:#888;">Rows before auto-flush</span>
|
|
173
|
-
</div>
|
|
174
|
-
<div class="form-row">
|
|
175
|
-
<label for="node-config-input-autoFlushInterval"><i class="fa fa-clock-o"></i> Flush Interval</label>
|
|
176
|
-
<input type="text" id="node-config-input-autoFlushInterval" placeholder="1000">
|
|
177
|
-
<span style="margin-left:8px; font-size:0.9em; color:#888;">ms</span>
|
|
178
|
-
</div>
|
|
179
|
-
<div class="form-row">
|
|
180
|
-
<label for="node-config-input-requestTimeout"><i class="fa fa-hourglass"></i> Request Timeout</label>
|
|
181
|
-
<input type="text" id="node-config-input-requestTimeout" placeholder="10000">
|
|
182
|
-
<span style="margin-left:8px; font-size:0.9em; color:#888;">ms</span>
|
|
183
|
-
</div>
|
|
184
|
-
<div class="form-row">
|
|
185
|
-
<label for="node-config-input-retryTimeout"><i class="fa fa-repeat"></i> Retry Timeout</label>
|
|
186
|
-
<input type="text" id="node-config-input-retryTimeout" placeholder="10000">
|
|
187
|
-
<span style="margin-left:8px; font-size:0.9em; color:#888;">ms</span>
|
|
188
|
-
</div>
|
|
189
|
-
<div class="form-row">
|
|
190
|
-
<label for="node-config-input-initBufSize"><i class="fa fa-database"></i> Init Buffer</label>
|
|
191
|
-
<input type="text" id="node-config-input-initBufSize" placeholder="65536">
|
|
192
|
-
<span style="margin-left:8px; font-size:0.9em; color:#888;">bytes (64 KiB)</span>
|
|
193
|
-
</div>
|
|
194
|
-
<div class="form-row">
|
|
195
|
-
<label for="node-config-input-maxBufSize"><i class="fa fa-database"></i> Max Buffer</label>
|
|
196
|
-
<input type="text" id="node-config-input-maxBufSize" placeholder="104857600">
|
|
197
|
-
<span style="margin-left:8px; font-size:0.9em; color:#888;">bytes (100 MiB)</span>
|
|
198
|
-
</div>
|
|
199
|
-
</div>
|
|
200
|
-
</div>
|
|
201
|
-
</script>
|
|
202
|
-
|
|
203
|
-
<script type="text/javascript">
|
|
204
|
-
// Main QuestDB node
|
|
205
|
-
RED.nodes.registerType('questdb',{
|
|
206
|
-
category: 'questdb',
|
|
207
|
-
color: '#a23154',
|
|
208
|
-
defaults: {
|
|
209
|
-
name: {value:""},
|
|
210
|
-
questdb: {value:"", type:"questdb-config", required:true},
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
<
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
</
|
|
237
|
-
|
|
238
|
-
<script type="text/html" data-
|
|
239
|
-
<
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
<
|
|
245
|
-
<
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
</
|
|
256
|
-
|
|
257
|
-
<
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
<
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
</
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
// Configuration node
|
|
3
|
+
RED.nodes.registerType('questdb-config',{
|
|
4
|
+
category: 'config',
|
|
5
|
+
defaults: {
|
|
6
|
+
name: {value:""},
|
|
7
|
+
protocol: {value:"http"},
|
|
8
|
+
host: {value:"localhost", required:true},
|
|
9
|
+
port: {value:9000, required:true, validate:RED.validators.number()},
|
|
10
|
+
tlsVerify: {value:true},
|
|
11
|
+
tlsCa: {value:""},
|
|
12
|
+
autoFlush: {value:true},
|
|
13
|
+
autoFlushRows: {value:500, validate:RED.validators.number()},
|
|
14
|
+
autoFlushInterval: {value:1000, validate:RED.validators.number()},
|
|
15
|
+
requestTimeout: {value:10000, validate:RED.validators.number()},
|
|
16
|
+
retryTimeout: {value:10000, validate:RED.validators.number()},
|
|
17
|
+
initBufSize: {value:65536, validate:RED.validators.number()},
|
|
18
|
+
maxBufSize: {value:104857600, validate:RED.validators.number()},
|
|
19
|
+
useAuth: {value:false},
|
|
20
|
+
authType: {value:"basic"}
|
|
21
|
+
},
|
|
22
|
+
credentials: {
|
|
23
|
+
username: {type:"text"},
|
|
24
|
+
password: {type:"password"},
|
|
25
|
+
token: {type:"password"}
|
|
26
|
+
},
|
|
27
|
+
label: function() {
|
|
28
|
+
return this.name || `${this.host}:${this.port}`;
|
|
29
|
+
},
|
|
30
|
+
oneditprepare: function() {
|
|
31
|
+
var tabs = RED.tabs.create({
|
|
32
|
+
id: "questdb-config-tabs",
|
|
33
|
+
onchange: function(tab) {
|
|
34
|
+
$("#questdb-config-tabs-content").children().hide();
|
|
35
|
+
$("#" + tab.id).show();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
tabs.addTab({
|
|
39
|
+
id: "questdb-tab-connection",
|
|
40
|
+
label: "Connection"
|
|
41
|
+
});
|
|
42
|
+
tabs.addTab({
|
|
43
|
+
id: "questdb-tab-security",
|
|
44
|
+
label: "Security"
|
|
45
|
+
});
|
|
46
|
+
tabs.addTab({
|
|
47
|
+
id: "questdb-tab-advanced",
|
|
48
|
+
label: "Advanced"
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Show/hide TLS options based on protocol
|
|
52
|
+
$("#node-config-input-protocol").on("change", function() {
|
|
53
|
+
var proto = $(this).val();
|
|
54
|
+
if (proto === "https" || proto === "tcps") {
|
|
55
|
+
$(".tls-row").show();
|
|
56
|
+
} else {
|
|
57
|
+
$(".tls-row").hide();
|
|
58
|
+
}
|
|
59
|
+
// Update default port
|
|
60
|
+
if (proto === "tcp" || proto === "tcps") {
|
|
61
|
+
if ($("#node-config-input-port").val() === "9000") {
|
|
62
|
+
$("#node-config-input-port").val("9009");
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
if ($("#node-config-input-port").val() === "9009") {
|
|
66
|
+
$("#node-config-input-port").val("9000");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
$("#node-config-input-protocol").trigger("change");
|
|
71
|
+
|
|
72
|
+
// Show/hide auth options
|
|
73
|
+
$("#node-config-input-useAuth").on("change", function() {
|
|
74
|
+
if ($(this).is(":checked")) {
|
|
75
|
+
$(".auth-type-row").show();
|
|
76
|
+
$("#node-config-input-authType").trigger("change");
|
|
77
|
+
} else {
|
|
78
|
+
$(".auth-type-row").hide();
|
|
79
|
+
$(".auth-row").hide();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
$("#node-config-input-useAuth").trigger("change");
|
|
83
|
+
|
|
84
|
+
// Show/hide auth fields based on auth type
|
|
85
|
+
$("#node-config-input-authType").on("change", function() {
|
|
86
|
+
var authType = $(this).val();
|
|
87
|
+
if (authType === "basic") {
|
|
88
|
+
$(".basic-auth-row").show();
|
|
89
|
+
$(".token-auth-row").hide();
|
|
90
|
+
} else {
|
|
91
|
+
$(".basic-auth-row").hide();
|
|
92
|
+
$(".token-auth-row").show();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
$("#node-config-input-authType").trigger("change");
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<script type="text/html" data-template-name="questdb-config">
|
|
101
|
+
<div class="form-row">
|
|
102
|
+
<ul style="min-width: 450px; margin-bottom: 20px;" id="questdb-config-tabs"></ul>
|
|
103
|
+
</div>
|
|
104
|
+
<div id="questdb-config-tabs-content">
|
|
105
|
+
<div id="questdb-tab-connection" style="display:block;">
|
|
106
|
+
<div class="form-row">
|
|
107
|
+
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
108
|
+
<input type="text" id="node-config-input-name" placeholder="QuestDB Server">
|
|
109
|
+
</div>
|
|
110
|
+
<div class="form-row">
|
|
111
|
+
<label for="node-config-input-protocol"><i class="fa fa-exchange"></i> Protocol</label>
|
|
112
|
+
<select id="node-config-input-protocol" style="width:70%;">
|
|
113
|
+
<option value="http">HTTP</option>
|
|
114
|
+
<option value="https">HTTPS (TLS)</option>
|
|
115
|
+
<option value="tcp">TCP</option>
|
|
116
|
+
<option value="tcps">TCPS (TLS)</option>
|
|
117
|
+
</select>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="form-row">
|
|
120
|
+
<label for="node-config-input-host"><i class="fa fa-server"></i> Host</label>
|
|
121
|
+
<input type="text" id="node-config-input-host" placeholder="localhost or IP address">
|
|
122
|
+
</div>
|
|
123
|
+
<div class="form-row">
|
|
124
|
+
<label for="node-config-input-port"><i class="fa fa-plug"></i> Port</label>
|
|
125
|
+
<input type="text" id="node-config-input-port" placeholder="9000">
|
|
126
|
+
</div>
|
|
127
|
+
<div class="form-row tls-row">
|
|
128
|
+
<label for="node-config-input-tlsVerify"><i class="fa fa-certificate"></i> Verify TLS</label>
|
|
129
|
+
<input type="checkbox" id="node-config-input-tlsVerify" style="display:inline-block; width:auto; vertical-align:baseline;" checked>
|
|
130
|
+
<span style="margin-left:8px;">Verify server certificate</span>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="form-row tls-row">
|
|
133
|
+
<label for="node-config-input-tlsCa"><i class="fa fa-file-text-o"></i> CA Cert Path</label>
|
|
134
|
+
<input type="text" id="node-config-input-tlsCa" placeholder="Path to CA certificate (PEM)">
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
<div id="questdb-tab-security" style="display:none;">
|
|
138
|
+
<div class="form-row">
|
|
139
|
+
<label for="node-config-input-useAuth"><i class="fa fa-lock"></i> Enable Auth</label>
|
|
140
|
+
<input type="checkbox" id="node-config-input-useAuth" style="display:inline-block; width:auto; vertical-align:baseline;">
|
|
141
|
+
<span style="margin-left:8px;">Enable authentication</span>
|
|
142
|
+
</div>
|
|
143
|
+
<div class="form-row auth-type-row">
|
|
144
|
+
<label for="node-config-input-authType"><i class="fa fa-id-card"></i> Auth Type</label>
|
|
145
|
+
<select id="node-config-input-authType" style="width:70%;">
|
|
146
|
+
<option value="basic">Username / Password</option>
|
|
147
|
+
<option value="token">Bearer Token</option>
|
|
148
|
+
</select>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="form-row auth-row basic-auth-row">
|
|
151
|
+
<label for="node-config-input-username"><i class="fa fa-user"></i> Username</label>
|
|
152
|
+
<input type="text" id="node-config-input-username" placeholder="Username">
|
|
153
|
+
</div>
|
|
154
|
+
<div class="form-row auth-row basic-auth-row">
|
|
155
|
+
<label for="node-config-input-password"><i class="fa fa-key"></i> Password</label>
|
|
156
|
+
<input type="password" id="node-config-input-password" placeholder="Password">
|
|
157
|
+
</div>
|
|
158
|
+
<div class="form-row auth-row token-auth-row">
|
|
159
|
+
<label for="node-config-input-token"><i class="fa fa-ticket"></i> Token</label>
|
|
160
|
+
<input type="password" id="node-config-input-token" placeholder="Bearer token">
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
<div id="questdb-tab-advanced" style="display:none;">
|
|
164
|
+
<div class="form-row">
|
|
165
|
+
<label for="node-config-input-autoFlush"><i class="fa fa-refresh"></i> Auto Flush</label>
|
|
166
|
+
<input type="checkbox" id="node-config-input-autoFlush" style="display:inline-block; width:auto; vertical-align:baseline;" checked>
|
|
167
|
+
<span style="margin-left:8px;">Enable automatic flushing</span>
|
|
168
|
+
</div>
|
|
169
|
+
<div class="form-row">
|
|
170
|
+
<label for="node-config-input-autoFlushRows"><i class="fa fa-bars"></i> Flush Rows</label>
|
|
171
|
+
<input type="text" id="node-config-input-autoFlushRows" placeholder="75000">
|
|
172
|
+
<span style="margin-left:8px; font-size:0.9em; color:#888;">Rows before auto-flush</span>
|
|
173
|
+
</div>
|
|
174
|
+
<div class="form-row">
|
|
175
|
+
<label for="node-config-input-autoFlushInterval"><i class="fa fa-clock-o"></i> Flush Interval</label>
|
|
176
|
+
<input type="text" id="node-config-input-autoFlushInterval" placeholder="1000">
|
|
177
|
+
<span style="margin-left:8px; font-size:0.9em; color:#888;">ms</span>
|
|
178
|
+
</div>
|
|
179
|
+
<div class="form-row">
|
|
180
|
+
<label for="node-config-input-requestTimeout"><i class="fa fa-hourglass"></i> Request Timeout</label>
|
|
181
|
+
<input type="text" id="node-config-input-requestTimeout" placeholder="10000">
|
|
182
|
+
<span style="margin-left:8px; font-size:0.9em; color:#888;">ms</span>
|
|
183
|
+
</div>
|
|
184
|
+
<div class="form-row">
|
|
185
|
+
<label for="node-config-input-retryTimeout"><i class="fa fa-repeat"></i> Retry Timeout</label>
|
|
186
|
+
<input type="text" id="node-config-input-retryTimeout" placeholder="10000">
|
|
187
|
+
<span style="margin-left:8px; font-size:0.9em; color:#888;">ms</span>
|
|
188
|
+
</div>
|
|
189
|
+
<div class="form-row">
|
|
190
|
+
<label for="node-config-input-initBufSize"><i class="fa fa-database"></i> Init Buffer</label>
|
|
191
|
+
<input type="text" id="node-config-input-initBufSize" placeholder="65536">
|
|
192
|
+
<span style="margin-left:8px; font-size:0.9em; color:#888;">bytes (64 KiB)</span>
|
|
193
|
+
</div>
|
|
194
|
+
<div class="form-row">
|
|
195
|
+
<label for="node-config-input-maxBufSize"><i class="fa fa-database"></i> Max Buffer</label>
|
|
196
|
+
<input type="text" id="node-config-input-maxBufSize" placeholder="104857600">
|
|
197
|
+
<span style="margin-left:8px; font-size:0.9em; color:#888;">bytes (100 MiB)</span>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</script>
|
|
202
|
+
|
|
203
|
+
<script type="text/javascript">
|
|
204
|
+
// Main QuestDB node
|
|
205
|
+
RED.nodes.registerType('questdb',{
|
|
206
|
+
category: 'questdb',
|
|
207
|
+
color: '#a23154',
|
|
208
|
+
defaults: {
|
|
209
|
+
name: {value:""},
|
|
210
|
+
questdb: {value:"", type:"questdb-config", required:true},
|
|
211
|
+
},
|
|
212
|
+
inputs:1,
|
|
213
|
+
outputs:2,
|
|
214
|
+
outputLabels: ["success", "error"],
|
|
215
|
+
icon: "questdb-logo.png",
|
|
216
|
+
label: function() {
|
|
217
|
+
return this.name || "Write";
|
|
218
|
+
},
|
|
219
|
+
paletteLabel: "Write",
|
|
220
|
+
labelStyle: function() {
|
|
221
|
+
return (this.name ? "node_label_italic" : "") + " questdb-white-text";
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
</script>
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
<script type="text/html" data-template-name="questdb">
|
|
228
|
+
<div class="form-row">
|
|
229
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
230
|
+
<input type="text" id="node-input-name" placeholder="Name">
|
|
231
|
+
</div>
|
|
232
|
+
<div class="form-row">
|
|
233
|
+
<label for="node-input-questdb"><i class="fa fa-server"></i> Server</label>
|
|
234
|
+
<input type="text" id="node-input-questdb" placeholder="QuestDB Server">
|
|
235
|
+
</div>
|
|
236
|
+
</script>
|
|
237
|
+
|
|
238
|
+
<script type="text/html" data-help-name="questdb">
|
|
239
|
+
<p>Writes data to QuestDB using ILP protocol.</p>
|
|
240
|
+
|
|
241
|
+
<h3>Inputs</h3>
|
|
242
|
+
<dl class="message-properties">
|
|
243
|
+
<dt>topic <span class="property-type">string</span></dt>
|
|
244
|
+
<dd>Table name to write to (required)</dd>
|
|
245
|
+
<dt>payload <span class="property-type">object</span></dt>
|
|
246
|
+
<dd>Data to write:
|
|
247
|
+
<ul>
|
|
248
|
+
<li><code>symbols</code> - Tag columns (indexed)</li>
|
|
249
|
+
<li><code>columns</code> - Value columns</li>
|
|
250
|
+
<li><code>timestamp</code> - Optional (Date, number, or string)</li>
|
|
251
|
+
</ul>
|
|
252
|
+
</dd>
|
|
253
|
+
</dl>
|
|
254
|
+
|
|
255
|
+
<h3>Outputs</h3>
|
|
256
|
+
<dl class="message-properties">
|
|
257
|
+
<dt>payload <span class="property-type">object</span></dt>
|
|
258
|
+
<dd><code>{ success: true/false, table: "name" }</code></dd>
|
|
259
|
+
</dl>
|
|
260
|
+
|
|
261
|
+
<h3>Example</h3>
|
|
262
|
+
<pre>{
|
|
263
|
+
topic: "history_float",
|
|
264
|
+
payload: {
|
|
265
|
+
symbols: { tag_name: "temp1" },
|
|
266
|
+
columns: { value: 23.5 },
|
|
267
|
+
timestamp: new Date()
|
|
268
|
+
}
|
|
269
|
+
}</pre>
|
|
270
|
+
</script>
|
|
271
|
+
|
|
272
|
+
<style>
|
|
273
|
+
/* White label text on canvas */
|
|
274
|
+
.questdb-white-text { fill: #ffffff !important; }
|
|
275
|
+
/* White label text in palette */
|
|
276
|
+
.red-ui-palette-node[data-palette-type="questdb"] .red-ui-palette-label { color: #ffffff !important; }
|
|
277
|
+
/* Light grey icon background - palette */
|
|
278
|
+
.red-ui-palette-node[data-palette-type="questdb"] .red-ui-palette-icon-container,
|
|
279
|
+
.red-ui-palette-node[data-palette-type="questdb-mapper"] .red-ui-palette-icon-container,
|
|
280
|
+
.red-ui-palette-node[data-palette-type="questdb-type-router"] .red-ui-palette-icon-container,
|
|
281
|
+
.red-ui-palette-node[data-palette-type="questdb-flatten"] .red-ui-palette-icon-container,
|
|
282
|
+
.red-ui-palette-node[data-palette-type="questdb-value"] .red-ui-palette-icon-container {
|
|
283
|
+
background-color: #f0f0f0 !important;
|
|
284
|
+
}
|
|
285
|
+
/* Light grey icon background - canvas (survives redraws via :has selector) */
|
|
286
|
+
g.red-ui-flow-node-icon-group:has(image[*|href*="questdb-logo"]) .red-ui-flow-node-icon-shade {
|
|
287
|
+
fill: #f0f0f0 !important;
|
|
288
|
+
}
|
|
289
|
+
</style>
|
|
290
|
+
|