@redkern/node-red-redis 0.0.0-stage → 1.0.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/CHANGELOG.md +24 -0
- package/LICENSE +188 -0
- package/README.md +283 -2
- package/SECURITY.md +11 -0
- package/examples/commands-and-pubsub.json +15 -0
- package/examples/streams-at-least-once.json +23 -0
- package/lib/completion.js +79 -0
- package/lib/control.js +59 -0
- package/lib/denylist.js +118 -0
- package/lib/dlq.js +49 -0
- package/lib/format.js +122 -0
- package/lib/inflight.js +131 -0
- package/lib/list-consumer.js +125 -0
- package/lib/metrics.js +85 -0
- package/lib/node-helpers.js +77 -0
- package/lib/palette.js +168 -0
- package/lib/slot.js +33 -0
- package/lib/stream-consumer.js +669 -0
- package/nodes/icons/redkern-redis-command.svg +4 -0
- package/nodes/icons/redkern-redis-list-in.svg +4 -0
- package/nodes/icons/redkern-redis-multi.svg +4 -0
- package/nodes/icons/redkern-redis-scan.svg +4 -0
- package/nodes/icons/redkern-redis-stream-ack.svg +4 -0
- package/nodes/icons/redkern-redis-stream-claim.svg +4 -0
- package/nodes/icons/redkern-redis-stream-control.svg +4 -0
- package/nodes/icons/redkern-redis-stream-gc.svg +4 -0
- package/nodes/icons/redkern-redis-stream-in.svg +4 -0
- package/nodes/icons/redkern-redis-stream-metrics.svg +4 -0
- package/nodes/icons/redkern-redis-stream-out.svg +4 -0
- package/nodes/icons/redkern-redis-subscribe.svg +4 -0
- package/nodes/icons/redkern-redis.svg +4 -0
- package/nodes/locales/en-US/redkern-redis.html +299 -0
- package/nodes/locales/en-US/redkern-redis.json +308 -0
- package/nodes/redkern-redis-command.js +49 -0
- package/nodes/redkern-redis-config.js +273 -0
- package/nodes/redkern-redis-list-in.js +88 -0
- package/nodes/redkern-redis-multi.js +75 -0
- package/nodes/redkern-redis-scan.js +105 -0
- package/nodes/redkern-redis-stream-ack.js +66 -0
- package/nodes/redkern-redis-stream-claim.js +60 -0
- package/nodes/redkern-redis-stream-control.js +35 -0
- package/nodes/redkern-redis-stream-gc.js +77 -0
- package/nodes/redkern-redis-stream-in.js +155 -0
- package/nodes/redkern-redis-stream-metrics.js +85 -0
- package/nodes/redkern-redis-stream-out.js +55 -0
- package/nodes/redkern-redis-subscribe.js +51 -0
- package/nodes/redkern-redis.html +1126 -0
- package/nodes/redkern-redis.js +31 -0
- package/package.json +76 -4
|
@@ -0,0 +1,1126 @@
|
|
|
1
|
+
<!-- Generated by scripts/build-editor.js from editor/*.html. Do not edit. -->
|
|
2
|
+
<!-- editor/redkern-redis-config.html -->
|
|
3
|
+
<script type="text/javascript">
|
|
4
|
+
(function () {
|
|
5
|
+
"use strict";
|
|
6
|
+
var ENV = /^\$\{[A-Za-z_][A-Za-z0-9_]*\}$/;
|
|
7
|
+
function envOrInt(min, max) {
|
|
8
|
+
return function (value) {
|
|
9
|
+
var text = String(value === undefined ? "" : value).trim();
|
|
10
|
+
if (ENV.test(text)) { return true; }
|
|
11
|
+
if (!/^\d+$/.test(text)) { return false; }
|
|
12
|
+
var number = Number(text);
|
|
13
|
+
return number >= min && number <= max;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
RED.nodes.registerType("redkern-redis-config", {
|
|
18
|
+
category: "config",
|
|
19
|
+
color: "#F4B3A1",
|
|
20
|
+
defaults: {
|
|
21
|
+
name: { value: "" },
|
|
22
|
+
mode: { value: "standalone" },
|
|
23
|
+
host: { value: "127.0.0.1", required: true },
|
|
24
|
+
port: { value: 6379, required: true, validate: envOrInt(1, 65535) },
|
|
25
|
+
clusterNodes: { value: "" },
|
|
26
|
+
db: { value: 0, validate: envOrInt(0, 1024) },
|
|
27
|
+
username: { value: "" },
|
|
28
|
+
tls: { value: false },
|
|
29
|
+
tlsServername: { value: "" },
|
|
30
|
+
connectTimeout: { value: 10000, validate: envOrInt(100, 600000) },
|
|
31
|
+
commandTimeout: { value: 5000, validate: envOrInt(100, 600000) }
|
|
32
|
+
},
|
|
33
|
+
credentials: {
|
|
34
|
+
password: { type: "password" }
|
|
35
|
+
},
|
|
36
|
+
paletteLabel: function () { return this._("config.paletteLabel"); },
|
|
37
|
+
label: function () {
|
|
38
|
+
if (this.name) { return this.name; }
|
|
39
|
+
var base = (this.host || "127.0.0.1") + ":" + (this.port || 6379);
|
|
40
|
+
return this.mode === "cluster" ? "cluster " + base : base;
|
|
41
|
+
},
|
|
42
|
+
oneditprepare: function () {
|
|
43
|
+
var node = this;
|
|
44
|
+
var tabs = RED.tabs.create({
|
|
45
|
+
id: "redkern-redis-config-tabs",
|
|
46
|
+
onchange: function (tab) {
|
|
47
|
+
$("#redkern-redis-config-tabs-content").children().hide();
|
|
48
|
+
$("#" + tab.id).show();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
tabs.addTab({ id: "redkern-redis-config-tab-general", label: node._("common.tabs.general") });
|
|
52
|
+
tabs.addTab({ id: "redkern-redis-config-tab-reliability", label: node._("common.tabs.reliability") });
|
|
53
|
+
tabs.addTab({ id: "redkern-redis-config-tab-advanced", label: node._("common.tabs.advanced") });
|
|
54
|
+
function toggleMode() {
|
|
55
|
+
var cluster = $("#node-config-input-mode").val() === "cluster";
|
|
56
|
+
$(".redkern-redis-config-cluster").toggle(cluster);
|
|
57
|
+
$(".redkern-redis-config-standalone").toggle(!cluster);
|
|
58
|
+
}
|
|
59
|
+
$("#node-config-input-mode").on("change", toggleMode);
|
|
60
|
+
toggleMode();
|
|
61
|
+
var target = $("#redkern-redis-config-connections");
|
|
62
|
+
if (node.id && RED.nodes.node(node.id) && !node.changed) {
|
|
63
|
+
$.getJSON("redkern/redis/connections?id=" + encodeURIComponent(node.id)).done(function (data) {
|
|
64
|
+
var entry = data && data.configs && data.configs[0];
|
|
65
|
+
if (!entry) { target.text(node._("config.status.none")); return; }
|
|
66
|
+
var c = entry.connections;
|
|
67
|
+
target.text(node._("config.status.state") + ": " + entry.state + " · shared " + c.shared + " · blocking " + c.blocking + " · subscriber " + c.subscriber);
|
|
68
|
+
}).fail(function () {
|
|
69
|
+
target.text(node._("config.status.unavailable"));
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
target.text(node._("config.status.unavailable"));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
})();
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<script type="text/html" data-template-name="redkern-redis-config">
|
|
80
|
+
<div class="form-row">
|
|
81
|
+
<label for="node-config-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
82
|
+
<input type="text" id="node-config-input-name" data-i18n="[placeholder]common.label.name">
|
|
83
|
+
</div>
|
|
84
|
+
<div class="form-row redkern-redis-tabs-row">
|
|
85
|
+
<ul style="min-width: 500px; margin-bottom: 20px;" id="redkern-redis-config-tabs"></ul>
|
|
86
|
+
</div>
|
|
87
|
+
<div id="redkern-redis-config-tabs-content">
|
|
88
|
+
<div id="redkern-redis-config-tab-general">
|
|
89
|
+
<div class="form-row">
|
|
90
|
+
<label for="node-config-input-mode"><i class="fa fa-sitemap"></i> <span data-i18n="config.label.mode"></span></label>
|
|
91
|
+
<select id="node-config-input-mode" style="width: 70%;">
|
|
92
|
+
<option value="standalone" data-i18n="config.mode.standalone"></option>
|
|
93
|
+
<option value="cluster" data-i18n="config.mode.cluster"></option>
|
|
94
|
+
</select>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="form-row">
|
|
97
|
+
<label for="node-config-input-host"><i class="fa fa-server"></i> <span data-i18n="config.label.host"></span></label>
|
|
98
|
+
<input type="text" id="node-config-input-host" style="width: 70%;">
|
|
99
|
+
</div>
|
|
100
|
+
<div class="form-row">
|
|
101
|
+
<label for="node-config-input-port"><i class="fa fa-plug"></i> <span data-i18n="config.label.port"></span></label>
|
|
102
|
+
<input type="text" id="node-config-input-port" style="width: 120px;">
|
|
103
|
+
</div>
|
|
104
|
+
<div class="form-row redkern-redis-config-cluster">
|
|
105
|
+
<label for="node-config-input-clusterNodes"><i class="fa fa-th"></i> <span data-i18n="config.label.clusterNodes"></span></label>
|
|
106
|
+
<input type="text" id="node-config-input-clusterNodes" style="width: 70%;" data-i18n="[placeholder]config.placeholder.clusterNodes">
|
|
107
|
+
</div>
|
|
108
|
+
<div class="form-row redkern-redis-config-standalone">
|
|
109
|
+
<label for="node-config-input-db"><i class="fa fa-database"></i> <span data-i18n="config.label.db"></span></label>
|
|
110
|
+
<input type="text" id="node-config-input-db" style="width: 120px;">
|
|
111
|
+
</div>
|
|
112
|
+
<div class="form-row">
|
|
113
|
+
<label for="node-config-input-username"><i class="fa fa-user"></i> <span data-i18n="config.label.username"></span></label>
|
|
114
|
+
<input type="text" id="node-config-input-username" style="width: 70%;" data-i18n="[placeholder]common.placeholder.optional">
|
|
115
|
+
</div>
|
|
116
|
+
<div class="form-row">
|
|
117
|
+
<label for="node-config-input-password"><i class="fa fa-lock"></i> <span data-i18n="config.label.password"></span></label>
|
|
118
|
+
<input type="password" id="node-config-input-password" style="width: 70%;" autocomplete="new-password">
|
|
119
|
+
</div>
|
|
120
|
+
<div class="form-row">
|
|
121
|
+
<label for="node-config-input-tls"><i class="fa fa-shield"></i> <span data-i18n="config.label.tls"></span></label>
|
|
122
|
+
<input type="checkbox" id="node-config-input-tls" style="display: inline-block; width: auto; vertical-align: top;">
|
|
123
|
+
</div>
|
|
124
|
+
<div class="form-tips"><span data-i18n="common.tip.env"></span></div>
|
|
125
|
+
<div class="form-tips redkern-redis-config-cluster" style="margin-top: 8px;"><span data-i18n="config.tip.cluster"></span></div>
|
|
126
|
+
</div>
|
|
127
|
+
<div id="redkern-redis-config-tab-reliability" style="display: none;">
|
|
128
|
+
<div class="form-row">
|
|
129
|
+
<label for="node-config-input-connectTimeout" style="width: 170px;"><span data-i18n="config.label.connectTimeout"></span></label>
|
|
130
|
+
<input type="text" id="node-config-input-connectTimeout" style="width: 120px;">
|
|
131
|
+
</div>
|
|
132
|
+
<div class="form-row">
|
|
133
|
+
<label for="node-config-input-commandTimeout" style="width: 170px;"><span data-i18n="config.label.commandTimeout"></span></label>
|
|
134
|
+
<input type="text" id="node-config-input-commandTimeout" style="width: 120px;">
|
|
135
|
+
</div>
|
|
136
|
+
<div class="form-row">
|
|
137
|
+
<label style="width: 170px;"><span data-i18n="config.label.connections"></span></label>
|
|
138
|
+
<span id="redkern-redis-config-connections"></span>
|
|
139
|
+
</div>
|
|
140
|
+
<div class="form-tips"><span data-i18n="config.tip.connections"></span></div>
|
|
141
|
+
</div>
|
|
142
|
+
<div id="redkern-redis-config-tab-advanced" style="display: none;">
|
|
143
|
+
<div class="form-row">
|
|
144
|
+
<label for="node-config-input-tlsServername" style="width: 170px;"><span data-i18n="config.label.tlsServername"></span></label>
|
|
145
|
+
<input type="text" id="node-config-input-tlsServername" style="width: 60%;" data-i18n="[placeholder]config.placeholder.tlsServername">
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</script>
|
|
150
|
+
|
|
151
|
+
<!-- editor/redkern-redis-command.html -->
|
|
152
|
+
<script type="text/javascript">
|
|
153
|
+
(function () {
|
|
154
|
+
"use strict";
|
|
155
|
+
function intRange(min, max) {
|
|
156
|
+
return function (value) {
|
|
157
|
+
var text = String(value === undefined ? "" : value).trim();
|
|
158
|
+
if (!/^\d+$/.test(text)) { return false; }
|
|
159
|
+
var number = Number(text);
|
|
160
|
+
return number >= min && number <= max;
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
RED.nodes.registerType("redkern-redis-command", {
|
|
165
|
+
category: "redkern redis",
|
|
166
|
+
color: "#F4B3A1",
|
|
167
|
+
icon: "redkern-redis-command.svg",
|
|
168
|
+
defaults: {
|
|
169
|
+
name: { value: "" },
|
|
170
|
+
server: { value: "", type: "redkern-redis-config", required: true },
|
|
171
|
+
command: { value: "", validate: function (v) { return v === "" || /^[A-Za-z][A-Za-z0-9_.|-]*(\s+[A-Za-z][A-Za-z0-9_.|-]*)?$/.test(String(v).trim()); } },
|
|
172
|
+
allowMsgCommand: { value: false },
|
|
173
|
+
disableDenylist: { value: false },
|
|
174
|
+
errorOutput: { value: false },
|
|
175
|
+
concurrency: { value: 64, validate: intRange(1, 10000) },
|
|
176
|
+
maxQueue: { value: 10000, validate: intRange(0, 1000000) },
|
|
177
|
+
legacyMsgFields: { value: false },
|
|
178
|
+
outputs: { value: 1 }
|
|
179
|
+
},
|
|
180
|
+
inputs: 1,
|
|
181
|
+
outputs: 1,
|
|
182
|
+
paletteLabel: function () { return this._("command.paletteLabel"); },
|
|
183
|
+
label: function () { return this.name || this.command || this._("command.default"); },
|
|
184
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
185
|
+
inputLabels: function () { return this._("common.ports.input"); },
|
|
186
|
+
outputLabels: function (index) { return index === 0 ? this._("command.ports.result") : this._("common.ports.error"); },
|
|
187
|
+
oneditprepare: function () {
|
|
188
|
+
function toggleDenylist() {
|
|
189
|
+
$("#redkern-redis-command-denylist-warning").toggle($("#node-input-disableDenylist").prop("checked"));
|
|
190
|
+
}
|
|
191
|
+
$("#node-input-disableDenylist").on("change", toggleDenylist);
|
|
192
|
+
toggleDenylist();
|
|
193
|
+
$("#node-input-errorOutput").on("change", function () {
|
|
194
|
+
$("#node-input-outputs").val($(this).prop("checked") ? 2 : 1);
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
oneditsave: function () {
|
|
198
|
+
$("#node-input-outputs").val($("#node-input-errorOutput").prop("checked") ? 2 : 1);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
})();
|
|
202
|
+
</script>
|
|
203
|
+
|
|
204
|
+
<script type="text/html" data-template-name="redkern-redis-command">
|
|
205
|
+
<input type="hidden" id="node-input-outputs">
|
|
206
|
+
<div class="form-row">
|
|
207
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
208
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
209
|
+
</div>
|
|
210
|
+
<div class="form-row">
|
|
211
|
+
<label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="common.label.server"></span></label>
|
|
212
|
+
<input type="text" id="node-input-server">
|
|
213
|
+
</div>
|
|
214
|
+
<div class="form-row">
|
|
215
|
+
<label for="node-input-command"><i class="fa fa-terminal"></i> <span data-i18n="command.label.command"></span></label>
|
|
216
|
+
<input type="text" id="node-input-command" data-i18n="[placeholder]command.placeholder.command">
|
|
217
|
+
</div>
|
|
218
|
+
<div class="form-tips" style="margin-bottom: 12px;"><span data-i18n="command.tip.command"></span></div>
|
|
219
|
+
<div class="form-row">
|
|
220
|
+
<input type="checkbox" id="node-input-allowMsgCommand" style="display: inline-block; width: auto; vertical-align: top;">
|
|
221
|
+
<label for="node-input-allowMsgCommand" style="width: auto;"><span data-i18n="command.label.allowMsgCommand"></span></label>
|
|
222
|
+
<div class="form-tips"><span data-i18n="command.tip.allowMsgCommand"></span></div>
|
|
223
|
+
</div>
|
|
224
|
+
<div class="form-row">
|
|
225
|
+
<input type="checkbox" id="node-input-disableDenylist" style="display: inline-block; width: auto; vertical-align: top;">
|
|
226
|
+
<label for="node-input-disableDenylist" style="width: auto;"><i class="fa fa-exclamation-triangle"></i> <span data-i18n="command.label.disableDenylist"></span></label>
|
|
227
|
+
<div class="form-tips" id="redkern-redis-command-denylist-warning"><i class="fa fa-exclamation-triangle"></i> <span data-i18n="command.tip.denylist"></span></div>
|
|
228
|
+
</div>
|
|
229
|
+
<div class="form-row">
|
|
230
|
+
<input type="checkbox" id="node-input-errorOutput" style="display: inline-block; width: auto; vertical-align: top;">
|
|
231
|
+
<label for="node-input-errorOutput" style="width: auto;"><span data-i18n="common.label.errorOutput"></span></label>
|
|
232
|
+
<div class="form-tips"><span data-i18n="common.tip.errorOutput"></span></div>
|
|
233
|
+
</div>
|
|
234
|
+
<div class="form-row">
|
|
235
|
+
<label for="node-input-concurrency"><span data-i18n="common.label.concurrency"></span></label>
|
|
236
|
+
<input type="text" id="node-input-concurrency" style="width: 100px;">
|
|
237
|
+
</div>
|
|
238
|
+
<div class="form-tips" style="margin-bottom: 12px;"><span data-i18n="common.tip.concurrency"></span></div>
|
|
239
|
+
<div class="form-row">
|
|
240
|
+
<label for="node-input-maxQueue"><span data-i18n="common.label.maxQueue"></span></label>
|
|
241
|
+
<input type="text" id="node-input-maxQueue" style="width: 100px;">
|
|
242
|
+
</div>
|
|
243
|
+
<div class="form-row">
|
|
244
|
+
<input type="checkbox" id="node-input-legacyMsgFields" style="display: inline-block; width: auto; vertical-align: top;">
|
|
245
|
+
<label for="node-input-legacyMsgFields" style="width: auto;"><span data-i18n="common.label.legacyMsgFields"></span></label>
|
|
246
|
+
</div>
|
|
247
|
+
</script>
|
|
248
|
+
|
|
249
|
+
<!-- editor/redkern-redis-multi.html -->
|
|
250
|
+
<script type="text/javascript">
|
|
251
|
+
(function () {
|
|
252
|
+
"use strict";
|
|
253
|
+
function intRange(min, max) {
|
|
254
|
+
return function (value) {
|
|
255
|
+
var text = String(value === undefined ? "" : value).trim();
|
|
256
|
+
if (!/^\d+$/.test(text)) { return false; }
|
|
257
|
+
var number = Number(text);
|
|
258
|
+
return number >= min && number <= max;
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function commandCount(value) {
|
|
262
|
+
if (!value) { return 0; }
|
|
263
|
+
try {
|
|
264
|
+
var list = JSON.parse(value);
|
|
265
|
+
return Array.isArray(list) ? list.length : 0;
|
|
266
|
+
} catch (e) {
|
|
267
|
+
return 0;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
RED.nodes.registerType("redkern-redis-multi", {
|
|
272
|
+
category: "redkern redis",
|
|
273
|
+
color: "#F4B3A1",
|
|
274
|
+
icon: "redkern-redis-multi.svg",
|
|
275
|
+
defaults: {
|
|
276
|
+
name: { value: "" },
|
|
277
|
+
server: { value: "", type: "redkern-redis-config", required: true },
|
|
278
|
+
commands: {
|
|
279
|
+
value: "",
|
|
280
|
+
validate: function (value) {
|
|
281
|
+
if (!value) { return true; }
|
|
282
|
+
try {
|
|
283
|
+
var list = JSON.parse(value);
|
|
284
|
+
return Array.isArray(list) && list.length > 0 && list.every(function (entry) { return Array.isArray(entry) && entry.length > 0; });
|
|
285
|
+
} catch (e) {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
disableDenylist: { value: false },
|
|
291
|
+
errorOutput: { value: false },
|
|
292
|
+
concurrency: { value: 64, validate: intRange(1, 10000) },
|
|
293
|
+
maxQueue: { value: 10000, validate: intRange(0, 1000000) },
|
|
294
|
+
outputs: { value: 1 }
|
|
295
|
+
},
|
|
296
|
+
inputs: 1,
|
|
297
|
+
outputs: 1,
|
|
298
|
+
paletteLabel: function () { return this._("multi.paletteLabel"); },
|
|
299
|
+
label: function () {
|
|
300
|
+
if (this.name) { return this.name; }
|
|
301
|
+
var count = commandCount(this.commands);
|
|
302
|
+
return count ? this._("multi.default") + " " + count : this._("multi.default");
|
|
303
|
+
},
|
|
304
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
305
|
+
inputLabels: function () { return this._("common.ports.input"); },
|
|
306
|
+
outputLabels: function (index) { return index === 0 ? this._("multi.ports.results") : this._("common.ports.error"); },
|
|
307
|
+
oneditprepare: function () {
|
|
308
|
+
$("#node-input-errorOutput").on("change", function () {
|
|
309
|
+
$("#node-input-outputs").val($(this).prop("checked") ? 2 : 1);
|
|
310
|
+
});
|
|
311
|
+
},
|
|
312
|
+
oneditsave: function () {
|
|
313
|
+
$("#node-input-outputs").val($("#node-input-errorOutput").prop("checked") ? 2 : 1);
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
})();
|
|
317
|
+
</script>
|
|
318
|
+
|
|
319
|
+
<script type="text/html" data-template-name="redkern-redis-multi">
|
|
320
|
+
<input type="hidden" id="node-input-outputs">
|
|
321
|
+
<div class="form-row">
|
|
322
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
323
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
324
|
+
</div>
|
|
325
|
+
<div class="form-row">
|
|
326
|
+
<label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="common.label.server"></span></label>
|
|
327
|
+
<input type="text" id="node-input-server">
|
|
328
|
+
</div>
|
|
329
|
+
<div class="form-row">
|
|
330
|
+
<label for="node-input-commands"><i class="fa fa-list"></i> <span data-i18n="multi.label.commands"></span></label>
|
|
331
|
+
<input type="text" id="node-input-commands" data-i18n="[placeholder]multi.placeholder.commands">
|
|
332
|
+
</div>
|
|
333
|
+
<div class="form-tips" style="margin-bottom: 12px;"><span data-i18n="multi.tip.commands"></span></div>
|
|
334
|
+
<div class="form-row">
|
|
335
|
+
<input type="checkbox" id="node-input-disableDenylist" style="display: inline-block; width: auto; vertical-align: top;">
|
|
336
|
+
<label for="node-input-disableDenylist" style="width: auto;"><i class="fa fa-exclamation-triangle"></i> <span data-i18n="multi.label.disableDenylist"></span></label>
|
|
337
|
+
</div>
|
|
338
|
+
<div class="form-row">
|
|
339
|
+
<input type="checkbox" id="node-input-errorOutput" style="display: inline-block; width: auto; vertical-align: top;">
|
|
340
|
+
<label for="node-input-errorOutput" style="width: auto;"><span data-i18n="common.label.errorOutput"></span></label>
|
|
341
|
+
<div class="form-tips"><span data-i18n="common.tip.errorOutput"></span></div>
|
|
342
|
+
</div>
|
|
343
|
+
<div class="form-row">
|
|
344
|
+
<label for="node-input-concurrency"><span data-i18n="common.label.concurrency"></span></label>
|
|
345
|
+
<input type="text" id="node-input-concurrency" style="width: 100px;">
|
|
346
|
+
</div>
|
|
347
|
+
<div class="form-tips" style="margin-bottom: 12px;"><span data-i18n="common.tip.concurrency"></span></div>
|
|
348
|
+
<div class="form-row">
|
|
349
|
+
<label for="node-input-maxQueue"><span data-i18n="common.label.maxQueue"></span></label>
|
|
350
|
+
<input type="text" id="node-input-maxQueue" style="width: 100px;">
|
|
351
|
+
</div>
|
|
352
|
+
</script>
|
|
353
|
+
|
|
354
|
+
<!-- editor/redkern-redis-scan.html -->
|
|
355
|
+
<script type="text/javascript">
|
|
356
|
+
(function () {
|
|
357
|
+
"use strict";
|
|
358
|
+
function intRange(min, max) {
|
|
359
|
+
return function (value) {
|
|
360
|
+
var text = String(value === undefined ? "" : value).trim();
|
|
361
|
+
if (!/^\d+$/.test(text)) { return false; }
|
|
362
|
+
var number = Number(text);
|
|
363
|
+
return number >= min && number <= max;
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
RED.nodes.registerType("redkern-redis-scan", {
|
|
368
|
+
category: "redkern redis",
|
|
369
|
+
color: "#F4B3A1",
|
|
370
|
+
icon: "redkern-redis-scan.svg",
|
|
371
|
+
defaults: {
|
|
372
|
+
name: { value: "" },
|
|
373
|
+
server: { value: "", type: "redkern-redis-config", required: true },
|
|
374
|
+
scanType: { value: "SCAN" },
|
|
375
|
+
match: { value: "" },
|
|
376
|
+
count: { value: 100, validate: intRange(1, 100000) },
|
|
377
|
+
maxResults: { value: 10000, validate: intRange(1, 1000000) },
|
|
378
|
+
timeoutMs: { value: 10000, validate: intRange(100, 600000) },
|
|
379
|
+
legacyMsgFields: { value: false }
|
|
380
|
+
},
|
|
381
|
+
inputs: 1,
|
|
382
|
+
outputs: 1,
|
|
383
|
+
paletteLabel: function () { return this._("scan.paletteLabel"); },
|
|
384
|
+
label: function () { return this.name || this.match || this._("scan.default"); },
|
|
385
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
386
|
+
inputLabels: function () { return this._("common.ports.input"); },
|
|
387
|
+
outputLabels: function () { return this._("scan.ports.items"); }
|
|
388
|
+
});
|
|
389
|
+
})();
|
|
390
|
+
</script>
|
|
391
|
+
|
|
392
|
+
<script type="text/html" data-template-name="redkern-redis-scan">
|
|
393
|
+
<div class="form-row">
|
|
394
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
395
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
396
|
+
</div>
|
|
397
|
+
<div class="form-row">
|
|
398
|
+
<label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="common.label.server"></span></label>
|
|
399
|
+
<input type="text" id="node-input-server">
|
|
400
|
+
</div>
|
|
401
|
+
<div class="form-row">
|
|
402
|
+
<label for="node-input-scanType"><i class="fa fa-search"></i> <span data-i18n="scan.label.scanType"></span></label>
|
|
403
|
+
<select id="node-input-scanType" style="width: 140px;">
|
|
404
|
+
<option value="SCAN">SCAN</option>
|
|
405
|
+
<option value="HSCAN">HSCAN</option>
|
|
406
|
+
<option value="SSCAN">SSCAN</option>
|
|
407
|
+
<option value="ZSCAN">ZSCAN</option>
|
|
408
|
+
</select>
|
|
409
|
+
</div>
|
|
410
|
+
<div class="form-row">
|
|
411
|
+
<label for="node-input-match"><i class="fa fa-filter"></i> <span data-i18n="scan.label.match"></span></label>
|
|
412
|
+
<input type="text" id="node-input-match" data-i18n="[placeholder]scan.placeholder.match">
|
|
413
|
+
</div>
|
|
414
|
+
<div class="form-row">
|
|
415
|
+
<label for="node-input-count" style="width: 140px;"><span data-i18n="scan.label.count"></span></label>
|
|
416
|
+
<input type="text" id="node-input-count" style="width: 100px;">
|
|
417
|
+
</div>
|
|
418
|
+
<div class="form-row">
|
|
419
|
+
<label for="node-input-maxResults" style="width: 140px;"><span data-i18n="scan.label.maxResults"></span></label>
|
|
420
|
+
<input type="text" id="node-input-maxResults" style="width: 100px;">
|
|
421
|
+
</div>
|
|
422
|
+
<div class="form-row">
|
|
423
|
+
<label for="node-input-timeoutMs" style="width: 140px;"><span data-i18n="scan.label.timeoutMs"></span></label>
|
|
424
|
+
<input type="text" id="node-input-timeoutMs" style="width: 100px;">
|
|
425
|
+
</div>
|
|
426
|
+
<div class="form-row">
|
|
427
|
+
<input type="checkbox" id="node-input-legacyMsgFields" style="display: inline-block; width: auto; vertical-align: top;">
|
|
428
|
+
<label for="node-input-legacyMsgFields" style="width: auto;"><span data-i18n="common.label.legacyMsgFields"></span></label>
|
|
429
|
+
</div>
|
|
430
|
+
<div class="form-tips"><span data-i18n="scan.tip.scan"></span></div>
|
|
431
|
+
</script>
|
|
432
|
+
|
|
433
|
+
<!-- editor/redkern-redis-subscribe.html -->
|
|
434
|
+
<script type="text/javascript">
|
|
435
|
+
(function () {
|
|
436
|
+
"use strict";
|
|
437
|
+
RED.nodes.registerType("redkern-redis-subscribe", {
|
|
438
|
+
category: "redkern redis",
|
|
439
|
+
color: "#F4B3A1",
|
|
440
|
+
icon: "redkern-redis-subscribe.svg",
|
|
441
|
+
defaults: {
|
|
442
|
+
name: { value: "" },
|
|
443
|
+
server: { value: "", type: "redkern-redis-config", required: true },
|
|
444
|
+
mode: { value: "subscribe" },
|
|
445
|
+
channels: { value: "", required: true, validate: function (value) { return String(value || "").split(",").some(function (item) { return item.trim() !== ""; }); } }
|
|
446
|
+
},
|
|
447
|
+
inputs: 0,
|
|
448
|
+
outputs: 1,
|
|
449
|
+
paletteLabel: function () { return this._("subscribe.paletteLabel"); },
|
|
450
|
+
label: function () { return this.name || this.channels || this._("subscribe.default"); },
|
|
451
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
452
|
+
outputLabels: function () { return this._("subscribe.ports.message"); }
|
|
453
|
+
});
|
|
454
|
+
})();
|
|
455
|
+
</script>
|
|
456
|
+
|
|
457
|
+
<script type="text/html" data-template-name="redkern-redis-subscribe">
|
|
458
|
+
<div class="form-row">
|
|
459
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
460
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
461
|
+
</div>
|
|
462
|
+
<div class="form-row">
|
|
463
|
+
<label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="common.label.server"></span></label>
|
|
464
|
+
<input type="text" id="node-input-server">
|
|
465
|
+
</div>
|
|
466
|
+
<div class="form-row">
|
|
467
|
+
<label for="node-input-channels"><i class="fa fa-rss"></i> <span data-i18n="subscribe.label.channels"></span></label>
|
|
468
|
+
<input type="text" id="node-input-channels" data-i18n="[placeholder]subscribe.placeholder.channels">
|
|
469
|
+
</div>
|
|
470
|
+
<div class="form-row">
|
|
471
|
+
<label for="node-input-mode"><i class="fa fa-random"></i> <span data-i18n="subscribe.label.mode"></span></label>
|
|
472
|
+
<select id="node-input-mode" style="width: 70%;">
|
|
473
|
+
<option value="subscribe" data-i18n="subscribe.mode.subscribe"></option>
|
|
474
|
+
<option value="psubscribe" data-i18n="subscribe.mode.psubscribe"></option>
|
|
475
|
+
</select>
|
|
476
|
+
</div>
|
|
477
|
+
<div class="form-tips"><span data-i18n="subscribe.tip.subscribe"></span></div>
|
|
478
|
+
</script>
|
|
479
|
+
|
|
480
|
+
<!-- editor/redkern-redis-list-in.html -->
|
|
481
|
+
<script type="text/javascript">
|
|
482
|
+
(function () {
|
|
483
|
+
"use strict";
|
|
484
|
+
function intRange(min, max) {
|
|
485
|
+
return function (value) {
|
|
486
|
+
var text = String(value === undefined ? "" : value).trim();
|
|
487
|
+
if (!/^\d+$/.test(text)) { return false; }
|
|
488
|
+
var number = Number(text);
|
|
489
|
+
return number >= min && number <= max;
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
RED.nodes.registerType("redkern-redis-list-in", {
|
|
494
|
+
category: "redkern redis",
|
|
495
|
+
color: "#F4B3A1",
|
|
496
|
+
icon: "redkern-redis-list-in.svg",
|
|
497
|
+
defaults: {
|
|
498
|
+
name: { value: "" },
|
|
499
|
+
server: { value: "", type: "redkern-redis-config", required: true },
|
|
500
|
+
key: { value: "", required: true },
|
|
501
|
+
direction: { value: "BLPOP" },
|
|
502
|
+
timeout: { value: 5, validate: intRange(0, 3600) },
|
|
503
|
+
prefetch: { value: 1, validate: intRange(0, 100000) },
|
|
504
|
+
releaseTimeoutMs: { value: 300000, validate: intRange(1000, 86400000) }
|
|
505
|
+
},
|
|
506
|
+
inputs: 0,
|
|
507
|
+
outputs: 1,
|
|
508
|
+
paletteLabel: function () { return this._("listIn.paletteLabel"); },
|
|
509
|
+
label: function () { return this.name || this.key || this._("listIn.default"); },
|
|
510
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
511
|
+
outputLabels: function () { return this._("listIn.ports.element"); }
|
|
512
|
+
});
|
|
513
|
+
})();
|
|
514
|
+
</script>
|
|
515
|
+
|
|
516
|
+
<script type="text/html" data-template-name="redkern-redis-list-in">
|
|
517
|
+
<div class="form-row">
|
|
518
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
519
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
520
|
+
</div>
|
|
521
|
+
<div class="form-row">
|
|
522
|
+
<label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="common.label.server"></span></label>
|
|
523
|
+
<input type="text" id="node-input-server">
|
|
524
|
+
</div>
|
|
525
|
+
<div class="form-row">
|
|
526
|
+
<label for="node-input-key"><i class="fa fa-key"></i> <span data-i18n="listIn.label.key"></span></label>
|
|
527
|
+
<input type="text" id="node-input-key">
|
|
528
|
+
</div>
|
|
529
|
+
<div class="form-row">
|
|
530
|
+
<label for="node-input-direction"><i class="fa fa-arrows-h"></i> <span data-i18n="listIn.label.direction"></span></label>
|
|
531
|
+
<select id="node-input-direction" style="width: 70%;">
|
|
532
|
+
<option value="BLPOP" data-i18n="listIn.direction.BLPOP"></option>
|
|
533
|
+
<option value="BRPOP" data-i18n="listIn.direction.BRPOP"></option>
|
|
534
|
+
</select>
|
|
535
|
+
</div>
|
|
536
|
+
<div class="form-row">
|
|
537
|
+
<label for="node-input-prefetch" style="width: 160px;"><span data-i18n="listIn.label.prefetch"></span></label>
|
|
538
|
+
<input type="text" id="node-input-prefetch" style="width: 100px;">
|
|
539
|
+
</div>
|
|
540
|
+
<div class="form-tips" style="margin-bottom: 12px;"><span data-i18n="listIn.tip.prefetch"></span></div>
|
|
541
|
+
<div class="form-row">
|
|
542
|
+
<label for="node-input-timeout" style="width: 160px;"><span data-i18n="listIn.label.timeout"></span></label>
|
|
543
|
+
<input type="text" id="node-input-timeout" style="width: 100px;">
|
|
544
|
+
</div>
|
|
545
|
+
<div class="form-row">
|
|
546
|
+
<label for="node-input-releaseTimeoutMs" style="width: 160px;"><span data-i18n="listIn.label.releaseTimeoutMs"></span></label>
|
|
547
|
+
<input type="text" id="node-input-releaseTimeoutMs" style="width: 100px;">
|
|
548
|
+
</div>
|
|
549
|
+
<div class="form-tips"><span data-i18n="listIn.tip.listIn"></span></div>
|
|
550
|
+
</script>
|
|
551
|
+
|
|
552
|
+
<!-- editor/redkern-redis-stream-in.html -->
|
|
553
|
+
<script type="text/javascript">
|
|
554
|
+
(function () {
|
|
555
|
+
"use strict";
|
|
556
|
+
function intRange(min, max) {
|
|
557
|
+
return function (value) {
|
|
558
|
+
var text = String(value === undefined ? "" : value).trim();
|
|
559
|
+
if (!/^\d+$/.test(text)) { return false; }
|
|
560
|
+
var number = Number(text);
|
|
561
|
+
return number >= min && number <= max;
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
function floatRange(min, max) {
|
|
565
|
+
return function (value) {
|
|
566
|
+
var number = Number(value);
|
|
567
|
+
return String(value).trim() !== "" && isFinite(number) && number >= min && number <= max;
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
var FIELDS = {
|
|
571
|
+
reliability: ["maxPending", "maxDeliveries", "reclaimIdleMs", "reclaimIntervalMs", "reclaimCount", "drainTimeoutMs"],
|
|
572
|
+
advanced: ["count", "blockMs", "readIntervalMs", "rateLimitPerSecond", "batchWindowMs", "batchIntervalMs", "capacityCheckIntervalMs", "capacityPollMs", "initialBackoffMs", "maxBackoffMs", "backoffMultiplier"]
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
RED.nodes.registerType("redkern-redis-stream-in", {
|
|
576
|
+
category: "redkern redis",
|
|
577
|
+
color: "#F4B3A1",
|
|
578
|
+
icon: "redkern-redis-stream-in.svg",
|
|
579
|
+
defaults: {
|
|
580
|
+
name: { value: "" },
|
|
581
|
+
server: { value: "", type: "redkern-redis-config", required: true },
|
|
582
|
+
streamKey: { value: "", required: true },
|
|
583
|
+
group: { value: "", required: true },
|
|
584
|
+
consumer: { value: "" },
|
|
585
|
+
ackMode: { value: "manual" },
|
|
586
|
+
startId: { value: "$", required: true },
|
|
587
|
+
startPaused: { value: false },
|
|
588
|
+
maxPending: { value: 1000, validate: intRange(1, 1000000) },
|
|
589
|
+
backpressureScope: { value: "consumer" },
|
|
590
|
+
maxDeliveries: { value: 5, validate: intRange(0, 1000) },
|
|
591
|
+
deadLetterStream: { value: "" },
|
|
592
|
+
autoClaim: { value: true },
|
|
593
|
+
reclaimIdleMs: { value: 60000, validate: intRange(1000, 86400000) },
|
|
594
|
+
reclaimIntervalMs: { value: 30000, validate: intRange(1000, 86400000) },
|
|
595
|
+
reclaimCount: { value: 100, validate: intRange(1, 100000) },
|
|
596
|
+
drainTimeoutMs: { value: 30000, validate: intRange(0, 1800000) },
|
|
597
|
+
count: { value: 100, validate: intRange(1, 100000) },
|
|
598
|
+
blockMs: { value: 5000, validate: intRange(1, 600000) },
|
|
599
|
+
readIntervalMs: { value: 0, validate: intRange(0, 3600000) },
|
|
600
|
+
rateLimitPerSecond: { value: 0, validate: floatRange(0, 1000000) },
|
|
601
|
+
batchWindowMs: { value: 0, validate: intRange(0, 3600000) },
|
|
602
|
+
batchIntervalMs: { value: 0, validate: intRange(0, 3600000) },
|
|
603
|
+
capacityCheckIntervalMs: { value: 250, validate: intRange(50, 600000) },
|
|
604
|
+
capacityPollMs: { value: 500, validate: intRange(50, 600000) },
|
|
605
|
+
initialBackoffMs: { value: 500, validate: intRange(50, 600000) },
|
|
606
|
+
maxBackoffMs: { value: 30000, validate: intRange(50, 3600000) },
|
|
607
|
+
backoffMultiplier: { value: 2, validate: floatRange(1, 10) },
|
|
608
|
+
legacyMsgFields: { value: false }
|
|
609
|
+
},
|
|
610
|
+
inputs: 0,
|
|
611
|
+
outputs: 1,
|
|
612
|
+
paletteLabel: function () { return this._("streamIn.paletteLabel"); },
|
|
613
|
+
label: function () {
|
|
614
|
+
if (this.name) { return this.name; }
|
|
615
|
+
if (this.streamKey && this.group) { return this.streamKey + ":" + this.group; }
|
|
616
|
+
return this._("streamIn.default");
|
|
617
|
+
},
|
|
618
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
619
|
+
outputLabels: function () { return this._("streamIn.ports.entries"); },
|
|
620
|
+
oneditprepare: function () {
|
|
621
|
+
var node = this;
|
|
622
|
+
var tabs = RED.tabs.create({
|
|
623
|
+
id: "redkern-redis-stream-in-tabs",
|
|
624
|
+
onchange: function (tab) {
|
|
625
|
+
$("#redkern-redis-stream-in-tabs-content").children().hide();
|
|
626
|
+
$("#" + tab.id).show();
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
tabs.addTab({ id: "redkern-redis-stream-in-tab-general", label: node._("common.tabs.general") });
|
|
630
|
+
tabs.addTab({ id: "redkern-redis-stream-in-tab-reliability", label: node._("common.tabs.reliability") });
|
|
631
|
+
tabs.addTab({ id: "redkern-redis-stream-in-tab-advanced", label: node._("common.tabs.advanced") });
|
|
632
|
+
["reliability", "advanced"].forEach(function (tab) {
|
|
633
|
+
var container = $("#redkern-redis-stream-in-" + tab + "-fields");
|
|
634
|
+
FIELDS[tab].forEach(function (field) {
|
|
635
|
+
var row = $('<div class="form-row"></div>').appendTo(container);
|
|
636
|
+
$('<label style="width: 170px;"></label>').attr("for", "node-input-" + field).text(node._("streamIn.label." + field)).appendTo(row);
|
|
637
|
+
$('<input type="text" style="width: 120px;">').attr("id", "node-input-" + field).val(node[field]).appendTo(row);
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
function toggleAck() {
|
|
641
|
+
var manual = $("#node-input-ackMode").val() === "manual";
|
|
642
|
+
$(".redkern-redis-stream-in-manual").toggle(manual);
|
|
643
|
+
}
|
|
644
|
+
$("#node-input-ackMode").on("change", toggleAck);
|
|
645
|
+
toggleAck();
|
|
646
|
+
},
|
|
647
|
+
oneditsave: function () {
|
|
648
|
+
var node = this;
|
|
649
|
+
FIELDS.reliability.concat(FIELDS.advanced).forEach(function (field) {
|
|
650
|
+
node[field] = $("#node-input-" + field).val();
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
})();
|
|
655
|
+
</script>
|
|
656
|
+
|
|
657
|
+
<script type="text/html" data-template-name="redkern-redis-stream-in">
|
|
658
|
+
<div class="form-row">
|
|
659
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
660
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
661
|
+
</div>
|
|
662
|
+
<div class="form-row">
|
|
663
|
+
<label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="common.label.server"></span></label>
|
|
664
|
+
<input type="text" id="node-input-server">
|
|
665
|
+
</div>
|
|
666
|
+
<div class="form-row redkern-redis-tabs-row">
|
|
667
|
+
<ul style="min-width: 500px; margin-bottom: 20px;" id="redkern-redis-stream-in-tabs"></ul>
|
|
668
|
+
</div>
|
|
669
|
+
<div id="redkern-redis-stream-in-tabs-content">
|
|
670
|
+
<div id="redkern-redis-stream-in-tab-general">
|
|
671
|
+
<div class="form-row">
|
|
672
|
+
<label for="node-input-streamKey"><i class="fa fa-bars"></i> <span data-i18n="common.label.stream"></span></label>
|
|
673
|
+
<input type="text" id="node-input-streamKey">
|
|
674
|
+
</div>
|
|
675
|
+
<div class="form-row">
|
|
676
|
+
<label for="node-input-group"><i class="fa fa-users"></i> <span data-i18n="common.label.group"></span></label>
|
|
677
|
+
<input type="text" id="node-input-group">
|
|
678
|
+
</div>
|
|
679
|
+
<div class="form-row">
|
|
680
|
+
<label for="node-input-consumer"><i class="fa fa-user"></i> <span data-i18n="common.label.consumer"></span></label>
|
|
681
|
+
<input type="text" id="node-input-consumer" data-i18n="[placeholder]common.placeholder.consumer">
|
|
682
|
+
</div>
|
|
683
|
+
<div class="form-row">
|
|
684
|
+
<label for="node-input-ackMode"><i class="fa fa-check"></i> <span data-i18n="streamIn.label.ackMode"></span></label>
|
|
685
|
+
<select id="node-input-ackMode" style="width: 70%;">
|
|
686
|
+
<option value="manual" data-i18n="streamIn.ackMode.manual"></option>
|
|
687
|
+
<option value="auto" data-i18n="streamIn.ackMode.auto"></option>
|
|
688
|
+
</select>
|
|
689
|
+
</div>
|
|
690
|
+
<div class="form-tips" style="margin-bottom: 12px;"><span data-i18n="streamIn.tip.ackMode"></span></div>
|
|
691
|
+
<div class="form-row">
|
|
692
|
+
<label for="node-input-startId"><span data-i18n="streamIn.label.startId"></span></label>
|
|
693
|
+
<input type="text" id="node-input-startId" style="width: 120px;">
|
|
694
|
+
</div>
|
|
695
|
+
<div class="form-row">
|
|
696
|
+
<input type="checkbox" id="node-input-startPaused" style="display: inline-block; width: auto; vertical-align: top;">
|
|
697
|
+
<label for="node-input-startPaused" style="width: auto;"><span data-i18n="streamIn.label.startPaused"></span></label>
|
|
698
|
+
<div class="form-tips"><span data-i18n="streamIn.tip.startPaused"></span></div>
|
|
699
|
+
</div>
|
|
700
|
+
</div>
|
|
701
|
+
<div id="redkern-redis-stream-in-tab-reliability" style="display: none;">
|
|
702
|
+
<div class="form-row redkern-redis-stream-in-manual">
|
|
703
|
+
<label for="node-input-backpressureScope" style="width: 170px;"><span data-i18n="streamIn.label.backpressureScope"></span></label>
|
|
704
|
+
<select id="node-input-backpressureScope" style="width: 55%;">
|
|
705
|
+
<option value="consumer" data-i18n="streamIn.backpressureScope.consumer"></option>
|
|
706
|
+
<option value="group" data-i18n="streamIn.backpressureScope.group"></option>
|
|
707
|
+
</select>
|
|
708
|
+
</div>
|
|
709
|
+
<div class="form-row redkern-redis-stream-in-manual">
|
|
710
|
+
<label for="node-input-deadLetterStream" style="width: 170px;"><span data-i18n="streamIn.label.deadLetterStream"></span></label>
|
|
711
|
+
<input type="text" id="node-input-deadLetterStream" style="width: 55%;" data-i18n="[placeholder]streamIn.placeholder.deadLetterStream">
|
|
712
|
+
</div>
|
|
713
|
+
<div class="form-row redkern-redis-stream-in-manual">
|
|
714
|
+
<input type="checkbox" id="node-input-autoClaim" style="display: inline-block; width: auto; vertical-align: top;">
|
|
715
|
+
<label for="node-input-autoClaim" style="width: auto;"><span data-i18n="streamIn.label.autoClaim"></span></label>
|
|
716
|
+
</div>
|
|
717
|
+
<div id="redkern-redis-stream-in-reliability-fields"></div>
|
|
718
|
+
<div class="form-tips"><span data-i18n="streamIn.tip.reclaimIdleMs"></span></div>
|
|
719
|
+
</div>
|
|
720
|
+
<div id="redkern-redis-stream-in-tab-advanced" style="display: none;">
|
|
721
|
+
<div id="redkern-redis-stream-in-advanced-fields"></div>
|
|
722
|
+
<div class="form-tips" style="margin-bottom: 12px;"><span data-i18n="streamIn.tip.batch"></span></div>
|
|
723
|
+
<div class="form-row">
|
|
724
|
+
<input type="checkbox" id="node-input-legacyMsgFields" style="display: inline-block; width: auto; vertical-align: top;">
|
|
725
|
+
<label for="node-input-legacyMsgFields" style="width: auto;"><span data-i18n="common.label.legacyMsgFields"></span></label>
|
|
726
|
+
<div class="form-tips"><span data-i18n="common.tip.legacyMsgFields"></span></div>
|
|
727
|
+
</div>
|
|
728
|
+
</div>
|
|
729
|
+
</div>
|
|
730
|
+
</script>
|
|
731
|
+
|
|
732
|
+
<!-- editor/redkern-redis-stream-out.html -->
|
|
733
|
+
<script type="text/javascript">
|
|
734
|
+
(function () {
|
|
735
|
+
"use strict";
|
|
736
|
+
function intRange(min, max) {
|
|
737
|
+
return function (value) {
|
|
738
|
+
var text = String(value === undefined ? "" : value).trim();
|
|
739
|
+
if (!/^\d+$/.test(text)) { return false; }
|
|
740
|
+
var number = Number(text);
|
|
741
|
+
return number >= min && number <= max;
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
RED.nodes.registerType("redkern-redis-stream-out", {
|
|
746
|
+
category: "redkern redis",
|
|
747
|
+
color: "#F4B3A1",
|
|
748
|
+
icon: "redkern-redis-stream-out.svg",
|
|
749
|
+
defaults: {
|
|
750
|
+
name: { value: "" },
|
|
751
|
+
server: { value: "", type: "redkern-redis-config", required: true },
|
|
752
|
+
streamKey: {
|
|
753
|
+
value: "",
|
|
754
|
+
validate: function (value) { return Boolean(value) || $("#node-input-allowMsgStream").prop("checked") === true || this.allowMsgStream === true; }
|
|
755
|
+
},
|
|
756
|
+
allowMsgStream: { value: false },
|
|
757
|
+
maxlen: { value: 0, validate: intRange(0, 9007199254740991) },
|
|
758
|
+
approxTrim: { value: true },
|
|
759
|
+
unsafeTrim: { value: false },
|
|
760
|
+
errorOutput: { value: false },
|
|
761
|
+
concurrency: { value: 64, validate: intRange(1, 10000) },
|
|
762
|
+
maxQueue: { value: 10000, validate: intRange(0, 1000000) },
|
|
763
|
+
legacyMsgFields: { value: false },
|
|
764
|
+
outputs: { value: 1 }
|
|
765
|
+
},
|
|
766
|
+
inputs: 1,
|
|
767
|
+
outputs: 1,
|
|
768
|
+
paletteLabel: function () { return this._("streamOut.paletteLabel"); },
|
|
769
|
+
label: function () { return this.name || this.streamKey || this._("streamOut.default"); },
|
|
770
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
771
|
+
inputLabels: function () { return this._("common.ports.input"); },
|
|
772
|
+
outputLabels: function (index) { return index === 0 ? this._("streamOut.ports.added") : this._("common.ports.error"); },
|
|
773
|
+
oneditprepare: function () {
|
|
774
|
+
$("#node-input-errorOutput").on("change", function () {
|
|
775
|
+
$("#node-input-outputs").val($(this).prop("checked") ? 2 : 1);
|
|
776
|
+
});
|
|
777
|
+
},
|
|
778
|
+
oneditsave: function () {
|
|
779
|
+
$("#node-input-outputs").val($("#node-input-errorOutput").prop("checked") ? 2 : 1);
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
})();
|
|
783
|
+
</script>
|
|
784
|
+
|
|
785
|
+
<script type="text/html" data-template-name="redkern-redis-stream-out">
|
|
786
|
+
<input type="hidden" id="node-input-outputs">
|
|
787
|
+
<div class="form-row">
|
|
788
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
789
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
790
|
+
</div>
|
|
791
|
+
<div class="form-row">
|
|
792
|
+
<label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="common.label.server"></span></label>
|
|
793
|
+
<input type="text" id="node-input-server">
|
|
794
|
+
</div>
|
|
795
|
+
<div class="form-row">
|
|
796
|
+
<label for="node-input-streamKey"><i class="fa fa-bars"></i> <span data-i18n="common.label.stream"></span></label>
|
|
797
|
+
<input type="text" id="node-input-streamKey">
|
|
798
|
+
</div>
|
|
799
|
+
<div class="form-row">
|
|
800
|
+
<input type="checkbox" id="node-input-allowMsgStream" style="display: inline-block; width: auto; vertical-align: top;">
|
|
801
|
+
<label for="node-input-allowMsgStream" style="width: auto;"><span data-i18n="streamOut.label.allowMsgStream"></span></label>
|
|
802
|
+
</div>
|
|
803
|
+
<div class="form-tips" style="margin-bottom: 12px;"><span data-i18n="streamOut.tip.payload"></span></div>
|
|
804
|
+
<div class="form-row">
|
|
805
|
+
<label for="node-input-maxlen"><span data-i18n="streamOut.label.maxlen"></span></label>
|
|
806
|
+
<input type="text" id="node-input-maxlen" style="width: 120px;">
|
|
807
|
+
</div>
|
|
808
|
+
<div class="form-row">
|
|
809
|
+
<input type="checkbox" id="node-input-approxTrim" style="display: inline-block; width: auto; vertical-align: top;">
|
|
810
|
+
<label for="node-input-approxTrim" style="width: auto;"><span data-i18n="streamOut.label.approxTrim"></span></label>
|
|
811
|
+
</div>
|
|
812
|
+
<div class="form-row">
|
|
813
|
+
<input type="checkbox" id="node-input-unsafeTrim" style="display: inline-block; width: auto; vertical-align: top;">
|
|
814
|
+
<label for="node-input-unsafeTrim" style="width: auto;"><i class="fa fa-exclamation-triangle"></i> <span data-i18n="streamOut.label.unsafeTrim"></span></label>
|
|
815
|
+
<div class="form-tips"><span data-i18n="streamOut.tip.trim"></span></div>
|
|
816
|
+
</div>
|
|
817
|
+
<div class="form-row">
|
|
818
|
+
<input type="checkbox" id="node-input-errorOutput" style="display: inline-block; width: auto; vertical-align: top;">
|
|
819
|
+
<label for="node-input-errorOutput" style="width: auto;"><span data-i18n="common.label.errorOutput"></span></label>
|
|
820
|
+
<div class="form-tips"><span data-i18n="common.tip.errorOutput"></span></div>
|
|
821
|
+
</div>
|
|
822
|
+
<div class="form-row">
|
|
823
|
+
<label for="node-input-concurrency"><span data-i18n="common.label.concurrency"></span></label>
|
|
824
|
+
<input type="text" id="node-input-concurrency" style="width: 100px;">
|
|
825
|
+
</div>
|
|
826
|
+
<div class="form-row">
|
|
827
|
+
<label for="node-input-maxQueue"><span data-i18n="common.label.maxQueue"></span></label>
|
|
828
|
+
<input type="text" id="node-input-maxQueue" style="width: 100px;">
|
|
829
|
+
</div>
|
|
830
|
+
<div class="form-row">
|
|
831
|
+
<input type="checkbox" id="node-input-legacyMsgFields" style="display: inline-block; width: auto; vertical-align: top;">
|
|
832
|
+
<label for="node-input-legacyMsgFields" style="width: auto;"><span data-i18n="common.label.legacyMsgFields"></span></label>
|
|
833
|
+
</div>
|
|
834
|
+
</script>
|
|
835
|
+
|
|
836
|
+
<!-- editor/redkern-redis-stream-ack.html -->
|
|
837
|
+
<script type="text/javascript">
|
|
838
|
+
(function () {
|
|
839
|
+
"use strict";
|
|
840
|
+
RED.nodes.registerType("redkern-redis-stream-ack", {
|
|
841
|
+
category: "redkern redis",
|
|
842
|
+
color: "#F4B3A1",
|
|
843
|
+
icon: "redkern-redis-stream-ack.svg",
|
|
844
|
+
align: "right",
|
|
845
|
+
defaults: {
|
|
846
|
+
name: { value: "" },
|
|
847
|
+
server: { value: "", type: "redkern-redis-config", required: true },
|
|
848
|
+
streamKey: { value: "" },
|
|
849
|
+
group: { value: "" },
|
|
850
|
+
deleteAfterAck: { value: false },
|
|
851
|
+
legacyMsgFields: { value: false },
|
|
852
|
+
outputs: { value: 0 }
|
|
853
|
+
},
|
|
854
|
+
inputs: 1,
|
|
855
|
+
outputs: 0,
|
|
856
|
+
paletteLabel: function () { return this._("streamAck.paletteLabel"); },
|
|
857
|
+
label: function () { return this.name || this.streamKey || this._("streamAck.default"); },
|
|
858
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
859
|
+
inputLabels: function () { return this._("common.ports.input"); },
|
|
860
|
+
outputLabels: function () { return this._("streamAck.ports.acked"); },
|
|
861
|
+
oneditprepare: function () {
|
|
862
|
+
$("#redkern-redis-stream-ack-pass").prop("checked", Number(this.outputs) > 0);
|
|
863
|
+
},
|
|
864
|
+
oneditsave: function () {
|
|
865
|
+
$("#node-input-outputs").val($("#redkern-redis-stream-ack-pass").prop("checked") ? 1 : 0);
|
|
866
|
+
}
|
|
867
|
+
});
|
|
868
|
+
})();
|
|
869
|
+
</script>
|
|
870
|
+
|
|
871
|
+
<script type="text/html" data-template-name="redkern-redis-stream-ack">
|
|
872
|
+
<input type="hidden" id="node-input-outputs">
|
|
873
|
+
<div class="form-row">
|
|
874
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
875
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
876
|
+
</div>
|
|
877
|
+
<div class="form-row">
|
|
878
|
+
<label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="common.label.server"></span></label>
|
|
879
|
+
<input type="text" id="node-input-server">
|
|
880
|
+
</div>
|
|
881
|
+
<div class="form-row">
|
|
882
|
+
<label for="node-input-streamKey"><i class="fa fa-bars"></i> <span data-i18n="common.label.stream"></span></label>
|
|
883
|
+
<input type="text" id="node-input-streamKey" data-i18n="[placeholder]common.placeholder.fromMsg">
|
|
884
|
+
</div>
|
|
885
|
+
<div class="form-row">
|
|
886
|
+
<label for="node-input-group"><i class="fa fa-users"></i> <span data-i18n="common.label.group"></span></label>
|
|
887
|
+
<input type="text" id="node-input-group" data-i18n="[placeholder]common.placeholder.fromMsg">
|
|
888
|
+
</div>
|
|
889
|
+
<div class="form-tips" style="margin-bottom: 12px;"><span data-i18n="streamAck.tip.ack"></span></div>
|
|
890
|
+
<div class="form-row">
|
|
891
|
+
<input type="checkbox" id="node-input-deleteAfterAck" style="display: inline-block; width: auto; vertical-align: top;">
|
|
892
|
+
<label for="node-input-deleteAfterAck" style="width: auto;"><span data-i18n="streamAck.label.deleteAfterAck"></span></label>
|
|
893
|
+
</div>
|
|
894
|
+
<div class="form-row">
|
|
895
|
+
<input type="checkbox" id="redkern-redis-stream-ack-pass" style="display: inline-block; width: auto; vertical-align: top;">
|
|
896
|
+
<label for="redkern-redis-stream-ack-pass" style="width: auto;"><span data-i18n="streamAck.label.passThrough"></span></label>
|
|
897
|
+
</div>
|
|
898
|
+
<div class="form-row">
|
|
899
|
+
<input type="checkbox" id="node-input-legacyMsgFields" style="display: inline-block; width: auto; vertical-align: top;">
|
|
900
|
+
<label for="node-input-legacyMsgFields" style="width: auto;"><span data-i18n="common.label.legacyMsgFields"></span></label>
|
|
901
|
+
</div>
|
|
902
|
+
</script>
|
|
903
|
+
|
|
904
|
+
<!-- editor/redkern-redis-stream-claim.html -->
|
|
905
|
+
<script type="text/javascript">
|
|
906
|
+
(function () {
|
|
907
|
+
"use strict";
|
|
908
|
+
function intRange(min, max) {
|
|
909
|
+
return function (value) {
|
|
910
|
+
var text = String(value === undefined ? "" : value).trim();
|
|
911
|
+
if (!/^\d+$/.test(text)) { return false; }
|
|
912
|
+
var number = Number(text);
|
|
913
|
+
return number >= min && number <= max;
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
RED.nodes.registerType("redkern-redis-stream-claim", {
|
|
918
|
+
category: "redkern redis",
|
|
919
|
+
color: "#F4B3A1",
|
|
920
|
+
icon: "redkern-redis-stream-claim.svg",
|
|
921
|
+
defaults: {
|
|
922
|
+
name: { value: "" },
|
|
923
|
+
server: { value: "", type: "redkern-redis-config", required: true },
|
|
924
|
+
streamKey: { value: "" },
|
|
925
|
+
group: { value: "" },
|
|
926
|
+
consumer: { value: "" },
|
|
927
|
+
minIdleMs: { value: 60000, validate: intRange(0, 86400000) },
|
|
928
|
+
count: { value: 100, validate: intRange(1, 100000) },
|
|
929
|
+
maxMessages: { value: 1000, validate: intRange(1, 1000000) },
|
|
930
|
+
legacyMsgFields: { value: false }
|
|
931
|
+
},
|
|
932
|
+
inputs: 1,
|
|
933
|
+
outputs: 1,
|
|
934
|
+
paletteLabel: function () { return this._("streamClaim.paletteLabel"); },
|
|
935
|
+
label: function () { return this.name || this.streamKey || this._("streamClaim.default"); },
|
|
936
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
937
|
+
inputLabels: function () { return this._("common.ports.input"); },
|
|
938
|
+
outputLabels: function () { return this._("streamClaim.ports.claimed"); }
|
|
939
|
+
});
|
|
940
|
+
})();
|
|
941
|
+
</script>
|
|
942
|
+
|
|
943
|
+
<script type="text/html" data-template-name="redkern-redis-stream-claim">
|
|
944
|
+
<div class="form-row">
|
|
945
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
946
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
947
|
+
</div>
|
|
948
|
+
<div class="form-row">
|
|
949
|
+
<label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="common.label.server"></span></label>
|
|
950
|
+
<input type="text" id="node-input-server">
|
|
951
|
+
</div>
|
|
952
|
+
<div class="form-row">
|
|
953
|
+
<label for="node-input-streamKey"><i class="fa fa-bars"></i> <span data-i18n="common.label.stream"></span></label>
|
|
954
|
+
<input type="text" id="node-input-streamKey" data-i18n="[placeholder]common.placeholder.fromMsg">
|
|
955
|
+
</div>
|
|
956
|
+
<div class="form-row">
|
|
957
|
+
<label for="node-input-group"><i class="fa fa-users"></i> <span data-i18n="common.label.group"></span></label>
|
|
958
|
+
<input type="text" id="node-input-group" data-i18n="[placeholder]common.placeholder.fromMsg">
|
|
959
|
+
</div>
|
|
960
|
+
<div class="form-row">
|
|
961
|
+
<label for="node-input-consumer"><i class="fa fa-user"></i> <span data-i18n="common.label.consumer"></span></label>
|
|
962
|
+
<input type="text" id="node-input-consumer" data-i18n="[placeholder]common.placeholder.consumer">
|
|
963
|
+
</div>
|
|
964
|
+
<div class="form-row">
|
|
965
|
+
<label for="node-input-minIdleMs" style="width: 140px;"><span data-i18n="streamClaim.label.minIdleMs"></span></label>
|
|
966
|
+
<input type="text" id="node-input-minIdleMs" style="width: 120px;">
|
|
967
|
+
</div>
|
|
968
|
+
<div class="form-row">
|
|
969
|
+
<label for="node-input-count" style="width: 140px;"><span data-i18n="streamClaim.label.count"></span></label>
|
|
970
|
+
<input type="text" id="node-input-count" style="width: 120px;">
|
|
971
|
+
</div>
|
|
972
|
+
<div class="form-row">
|
|
973
|
+
<label for="node-input-maxMessages" style="width: 140px;"><span data-i18n="streamClaim.label.maxMessages"></span></label>
|
|
974
|
+
<input type="text" id="node-input-maxMessages" style="width: 120px;">
|
|
975
|
+
</div>
|
|
976
|
+
<div class="form-row">
|
|
977
|
+
<input type="checkbox" id="node-input-legacyMsgFields" style="display: inline-block; width: auto; vertical-align: top;">
|
|
978
|
+
<label for="node-input-legacyMsgFields" style="width: auto;"><span data-i18n="common.label.legacyMsgFields"></span></label>
|
|
979
|
+
</div>
|
|
980
|
+
</script>
|
|
981
|
+
|
|
982
|
+
<!-- editor/redkern-redis-stream-gc.html -->
|
|
983
|
+
<script type="text/javascript">
|
|
984
|
+
(function () {
|
|
985
|
+
"use strict";
|
|
986
|
+
RED.nodes.registerType("redkern-redis-stream-gc", {
|
|
987
|
+
category: "redkern redis",
|
|
988
|
+
color: "#F4B3A1",
|
|
989
|
+
icon: "redkern-redis-stream-gc.svg",
|
|
990
|
+
defaults: {
|
|
991
|
+
name: { value: "" },
|
|
992
|
+
server: { value: "", type: "redkern-redis-config", required: true },
|
|
993
|
+
streamKey: { value: "" },
|
|
994
|
+
group: { value: "" },
|
|
995
|
+
minIdleMs: { value: 600000, validate: function (value) { return /^\d+$/.test(String(value).trim()); } },
|
|
996
|
+
legacyMsgFields: { value: false }
|
|
997
|
+
},
|
|
998
|
+
inputs: 1,
|
|
999
|
+
outputs: 1,
|
|
1000
|
+
paletteLabel: function () { return this._("streamGc.paletteLabel"); },
|
|
1001
|
+
label: function () { return this.name || this.streamKey || this._("streamGc.default"); },
|
|
1002
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
1003
|
+
inputLabels: function () { return this._("common.ports.input"); },
|
|
1004
|
+
outputLabels: function () { return this._("streamGc.ports.report"); }
|
|
1005
|
+
});
|
|
1006
|
+
})();
|
|
1007
|
+
</script>
|
|
1008
|
+
|
|
1009
|
+
<script type="text/html" data-template-name="redkern-redis-stream-gc">
|
|
1010
|
+
<div class="form-row">
|
|
1011
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
1012
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
1013
|
+
</div>
|
|
1014
|
+
<div class="form-row">
|
|
1015
|
+
<label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="common.label.server"></span></label>
|
|
1016
|
+
<input type="text" id="node-input-server">
|
|
1017
|
+
</div>
|
|
1018
|
+
<div class="form-row">
|
|
1019
|
+
<label for="node-input-streamKey"><i class="fa fa-bars"></i> <span data-i18n="common.label.stream"></span></label>
|
|
1020
|
+
<input type="text" id="node-input-streamKey" data-i18n="[placeholder]common.placeholder.fromMsg">
|
|
1021
|
+
</div>
|
|
1022
|
+
<div class="form-row">
|
|
1023
|
+
<label for="node-input-group"><i class="fa fa-users"></i> <span data-i18n="common.label.group"></span></label>
|
|
1024
|
+
<input type="text" id="node-input-group" data-i18n="[placeholder]common.placeholder.fromMsg">
|
|
1025
|
+
</div>
|
|
1026
|
+
<div class="form-row">
|
|
1027
|
+
<label for="node-input-minIdleMs" style="width: 140px;"><span data-i18n="streamGc.label.minIdleMs"></span></label>
|
|
1028
|
+
<input type="text" id="node-input-minIdleMs" style="width: 120px;">
|
|
1029
|
+
</div>
|
|
1030
|
+
<div class="form-row">
|
|
1031
|
+
<input type="checkbox" id="node-input-legacyMsgFields" style="display: inline-block; width: auto; vertical-align: top;">
|
|
1032
|
+
<label for="node-input-legacyMsgFields" style="width: auto;"><span data-i18n="common.label.legacyMsgFields"></span></label>
|
|
1033
|
+
</div>
|
|
1034
|
+
<div class="form-tips"><span data-i18n="streamGc.tip.gc"></span></div>
|
|
1035
|
+
</script>
|
|
1036
|
+
|
|
1037
|
+
<!-- editor/redkern-redis-stream-metrics.html -->
|
|
1038
|
+
<script type="text/javascript">
|
|
1039
|
+
(function () {
|
|
1040
|
+
"use strict";
|
|
1041
|
+
RED.nodes.registerType("redkern-redis-stream-metrics", {
|
|
1042
|
+
category: "redkern redis",
|
|
1043
|
+
color: "#F4B3A1",
|
|
1044
|
+
icon: "redkern-redis-stream-metrics.svg",
|
|
1045
|
+
defaults: {
|
|
1046
|
+
name: { value: "" },
|
|
1047
|
+
server: { value: "", type: "redkern-redis-config", required: true },
|
|
1048
|
+
streamKey: { value: "" },
|
|
1049
|
+
group: { value: "" },
|
|
1050
|
+
deadLetterStream: { value: "" }
|
|
1051
|
+
},
|
|
1052
|
+
inputs: 1,
|
|
1053
|
+
outputs: 1,
|
|
1054
|
+
paletteLabel: function () { return this._("streamMetrics.paletteLabel"); },
|
|
1055
|
+
label: function () { return this.name || this.streamKey || this._("streamMetrics.default"); },
|
|
1056
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
1057
|
+
inputLabels: function () { return this._("common.ports.input"); },
|
|
1058
|
+
outputLabels: function () { return this._("streamMetrics.ports.sample"); }
|
|
1059
|
+
});
|
|
1060
|
+
})();
|
|
1061
|
+
</script>
|
|
1062
|
+
|
|
1063
|
+
<script type="text/html" data-template-name="redkern-redis-stream-metrics">
|
|
1064
|
+
<div class="form-row">
|
|
1065
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
1066
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
1067
|
+
</div>
|
|
1068
|
+
<div class="form-row">
|
|
1069
|
+
<label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="common.label.server"></span></label>
|
|
1070
|
+
<input type="text" id="node-input-server">
|
|
1071
|
+
</div>
|
|
1072
|
+
<div class="form-row">
|
|
1073
|
+
<label for="node-input-streamKey"><i class="fa fa-bars"></i> <span data-i18n="common.label.stream"></span></label>
|
|
1074
|
+
<input type="text" id="node-input-streamKey" data-i18n="[placeholder]common.placeholder.fromMsg">
|
|
1075
|
+
</div>
|
|
1076
|
+
<div class="form-row">
|
|
1077
|
+
<label for="node-input-group"><i class="fa fa-users"></i> <span data-i18n="common.label.group"></span></label>
|
|
1078
|
+
<input type="text" id="node-input-group" data-i18n="[placeholder]common.placeholder.fromMsg">
|
|
1079
|
+
</div>
|
|
1080
|
+
<div class="form-row">
|
|
1081
|
+
<label for="node-input-deadLetterStream"><i class="fa fa-inbox"></i> <span data-i18n="streamMetrics.label.deadLetterStream"></span></label>
|
|
1082
|
+
<input type="text" id="node-input-deadLetterStream" data-i18n="[placeholder]common.placeholder.optional">
|
|
1083
|
+
</div>
|
|
1084
|
+
<div class="form-tips"><span data-i18n="streamMetrics.tip.metrics"></span></div>
|
|
1085
|
+
</script>
|
|
1086
|
+
|
|
1087
|
+
<!-- editor/redkern-redis-stream-control.html -->
|
|
1088
|
+
<script type="text/javascript">
|
|
1089
|
+
(function () {
|
|
1090
|
+
"use strict";
|
|
1091
|
+
RED.nodes.registerType("redkern-redis-stream-control", {
|
|
1092
|
+
category: "redkern redis",
|
|
1093
|
+
color: "#F4B3A1",
|
|
1094
|
+
icon: "redkern-redis-stream-control.svg",
|
|
1095
|
+
defaults: {
|
|
1096
|
+
name: { value: "" },
|
|
1097
|
+
action: { value: "" }
|
|
1098
|
+
},
|
|
1099
|
+
inputs: 1,
|
|
1100
|
+
outputs: 1,
|
|
1101
|
+
paletteLabel: function () { return this._("streamControl.paletteLabel"); },
|
|
1102
|
+
label: function () { return this.name || this.action || this._("streamControl.default"); },
|
|
1103
|
+
labelStyle: function () { return this.name ? "node_label" : "node_label_italic"; },
|
|
1104
|
+
inputLabels: function () { return this._("common.ports.input"); },
|
|
1105
|
+
outputLabels: function () { return this._("streamControl.ports.result"); }
|
|
1106
|
+
});
|
|
1107
|
+
})();
|
|
1108
|
+
</script>
|
|
1109
|
+
|
|
1110
|
+
<script type="text/html" data-template-name="redkern-redis-stream-control">
|
|
1111
|
+
<div class="form-row">
|
|
1112
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
1113
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
1114
|
+
</div>
|
|
1115
|
+
<div class="form-row">
|
|
1116
|
+
<label for="node-input-action"><i class="fa fa-sliders"></i> <span data-i18n="streamControl.label.action"></span></label>
|
|
1117
|
+
<select id="node-input-action" style="width: 70%;">
|
|
1118
|
+
<option value="" data-i18n="streamControl.action.msg"></option>
|
|
1119
|
+
<option value="pause" data-i18n="streamControl.action.pause"></option>
|
|
1120
|
+
<option value="resume" data-i18n="streamControl.action.resume"></option>
|
|
1121
|
+
<option value="drain" data-i18n="streamControl.action.drain"></option>
|
|
1122
|
+
<option value="status" data-i18n="streamControl.action.status"></option>
|
|
1123
|
+
</select>
|
|
1124
|
+
</div>
|
|
1125
|
+
<div class="form-tips"><span data-i18n="streamControl.tip.control"></span></div>
|
|
1126
|
+
</script>
|