Skip to content

Commit 8c8235c

Browse files
committed
Enable adding queues with plugins, Management UI
1 parent 3c1a890 commit 8c8235c

21 files changed

+695
-544
lines changed

deps/rabbitmq_management/priv/www/js/global.js

Lines changed: 357 additions & 118 deletions
Large diffs are not rendered by default.

deps/rabbitmq_management/priv/www/js/main.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,11 +1585,8 @@ function collapse_multifields(params0) {
15851585
if (queue_type != 'default') {
15861586
params['arguments']['x-queue-type'] = queue_type;
15871587
}
1588-
if (queue_type == 'quorum' ||
1589-
queue_type == 'stream') {
1590-
params['durable'] = true;
1591-
params['auto_delete'] = false;
1592-
}
1588+
1589+
params = Object.assign(params, QUEUE_TYPE[queue_type].params)
15931590
}
15941591
return params;
15951592
}
Lines changed: 17 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,23 @@
11
<%
2-
if (binary == "not_available") {
2+
if (binary == "not_available") {
33
%>
4-
<p class="warning">
5-
Binary statistics not available.
6-
</p>
4+
<p class="warning">
5+
Binary statistics not available.
6+
</p>
77
<% } else { %>
8-
<%
9-
var sections = {'queue_procs' : ['classic', 'Classic queues'],
10-
'quorum_queue_procs' : ['quorum', 'Quorum queues'],
11-
'quorum_queue_dlx_procs' : ['quorum', 'Dead letter workers'],
12-
'stream_queue_procs' : ['stream', 'Stream queues'],
13-
'stream_queue_replica_reader_procs' : ['stream', 'Stream queues (replica reader)'],
14-
'stream_queue_coordinator_procs' : ['stream', 'Stream queues (coordinator)'],
15-
'connection_readers' : ['conn', 'Connection readers'],
16-
'connection_writers' : ['conn', 'Connection writers'],
17-
'connection_channels' : ['conn', 'Connection channels'],
18-
'connection_other' : ['conn', 'Connections (other)'],
19-
'msg_index' : ['table', 'Message store index'],
20-
'mgmt_db' : ['table', 'Management database'],
21-
'plugins' : ['proc', 'Plugins'],
22-
'metadata_store' : ['metadata_store', 'Metadata store'],
23-
'other' : ['system', 'Other binary references']};
24-
var total_out = [];
25-
%>
26-
<%= format('memory-bar', {sections: sections, memory: binary, total_out: total_out}) %>
27-
<span class="clear">&nbsp;</span>
28-
<div class="box">
29-
<%
30-
var key = [[{name: 'Classic Queues', colour: 'classic',
31-
keys: [['queue_procs', 'queues']]},
32-
{name: 'Quorum Queues', colour: 'quorum',
33-
keys: [['quorum_queue_procs', 'quorum'],
34-
['quorum_queue_dlx_procs', 'dead letter workers']]},
35-
{name: 'Streams', colour: 'stream',
36-
keys: [['stream_queue_procs', 'stream'],
37-
['stream_queue_replica_reader_procs', 'stream replica reader'],
38-
['stream_queue_coordinator_procs', 'stream coordinator']]}],
39-
40-
[{name: 'Connections', colour: 'conn',
41-
keys: [['connection_readers', 'readers'],
42-
['connection_writers', 'writers'],
43-
['connection_channels', 'channels'],
44-
['connection_other', 'other']]}],
45-
46-
[{name: 'Tables', colour: 'table',
47-
keys: [['msg_index', 'message store index'],
48-
['mgmt_db', 'management database']]}],
49-
50-
[{name: 'Processes', colour: 'proc',
51-
keys: [['plugins', 'plugins'],
52-
['metadata_store', 'metadata store']]},
53-
{name: 'System', colour: 'system',
54-
keys: [['other', 'other']]}]];
55-
%>
56-
<%= format('memory-table', {key: key, memory: binary}) %>
57-
</div>
8+
<%
9+
var total_out = [];
10+
%>
11+
<%= format('memory-bar', {sections: BINARY_STATISTICS.sections, memory: binary, total_out: total_out}) %>
12+
<span class="clear">&nbsp;</span>
13+
<div class="box">
14+
<%= format('memory-table', {key: BINARY_STATISTICS. key, memory: binary}) %>
15+
</div>
5816
59-
<div class="memory-info">
60-
Last updated: <b><%= fmt_date(new Date()) %></b>.<br/>
61-
Total referenced binaries at last update: <b><%= fmt_bytes(total_out[0]) %></b>
62-
<span class="help" id="binary-use"></span>
63-
</div>
17+
<div class="memory-info">
18+
Last updated: <b><%= fmt_date(new Date()) %></b>.<br/>
19+
Total referenced binaries at last update: <b><%= fmt_bytes(total_out[0]) %></b>
20+
<span class="help" id="binary-use"></span>
21+
</div>
6422
6523
<% } %>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<span class="argument-link" field="arguments" key="x-expires" type="number">Auto expire</span> <span class="help" id="queue-expires"></span> |
2+
<span class="argument-link" field="arguments" key="x-message-ttl" type="number">Message TTL</span> <span class="help" id="queue-message-ttl"></span> |
3+
<span class="argument-link" field="arguments" key="x-overflow" type="string">Overflow behaviour</span> <span class="help" id="queue-overflow"></span><br/>
4+
<span class="argument-link" field="arguments" key="x-single-active-consumer" type="boolean">Single active consumer</span> <span class="help" id="queue-single-active-consumer"></span> |
5+
<span class="argument-link" field="arguments" key="x-dead-letter-exchange" type="string">Dead letter exchange</span> <span class="help" id="queue-dead-letter-exchange"></span> |
6+
<span class="argument-link" field="arguments" key="x-dead-letter-routing-key" type="string">Dead letter routing key</span> <span class="help" id="queue-dead-letter-routing-key"></span><br/>
7+
<span class="argument-link" field="arguments" key="x-max-length" type="number">Max length</span> <span class="help" id="queue-max-length"></span> |
8+
<span class="argument-link" field="arguments" key="x-max-length-bytes" type="number">Max length bytes</span> <span class="help" id="queue-max-length-bytes"></span>
9+
| <span class="argument-link" field="arguments" key="x-max-priority" type="number">Maximum priority</span> <span class="help" id="queue-max-priority"></span>
10+
| <span class="argument-link" field="arguments" key="x-queue-leader-locator" type="string">Leader locator</span><span class="help" id="queue-leader-locator"></span>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<tr>
2+
<th>Node</th>
3+
<td><%= fmt_node(queue.node) %></td>
4+
</tr>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<tr>
2+
<td>Queues [Classic]</td>
3+
<td>
4+
<span class="argument-link" field="definitionop" key="expires" type="number">Auto expire</span> |
5+
<span class="argument-link" field="definitionop" key="max-length" type="number">Max length</span> |
6+
<span class="argument-link" field="definitionop" key="max-length-bytes" type="number">Max length bytes</span> |
7+
<span class="argument-link" field="definitionop" key="message-ttl" type="number">Message TTL</span> |
8+
<span class="help" id="queue-message-ttl"></span> |
9+
<span class="argument-link" field="definitionop" key="overflow" type="string">Length limit overflow behaviour</span> <span class="help" id="queue-overflow"></span> </br>
10+
</td>
11+
</tr>

deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-user-policy-arguments.ejs

Whitespace-only changes.

deps/rabbitmq_management/priv/www/js/tmpl/memory.ejs

Lines changed: 6 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,14 @@
11
<%
2-
if (memory == "not_available") {
2+
if (memory == "not_available") {
33
%>
4-
<p class="warning">
5-
Memory statistics not available.
6-
</p>
4+
<p class="warning">
5+
Memory statistics not available.
6+
</p>
77
<% } else { %>
8-
<%
9-
var sections = {'queue_procs' : ['classic', 'Classic queues'],
10-
'quorum_queue_procs' : ['quorum', 'Quorum queues'],
11-
'quorum_queue_dlx_procs' : ['quorum', 'Dead letter workers'],
12-
'stream_queue_procs' : ['stream', 'Stream queues'],
13-
'stream_queue_replica_reader_procs' : ['stream', 'Stream queues (replica reader)'],
14-
'stream_queue_coordinator_procs' : ['stream', 'Stream queues (coordinator)'],
15-
'binary' : ['binary', 'Binaries'],
16-
'connection_readers' : ['conn', 'Connection readers'],
17-
'connection_writers' : ['conn', 'Connection writers'],
18-
'connection_channels' : ['conn', 'Connection channels'],
19-
'connection_other' : ['conn', 'Connections (other)'],
20-
'mnesia' : ['table', 'Mnesia'],
21-
'msg_index' : ['table', 'Message store index'],
22-
'mgmt_db' : ['table', 'Management database'],
23-
'quorum_ets' : ['table', 'Quorum queue ETS tables'],
24-
'other_ets' : ['table', 'Other ETS tables'],
25-
'plugins' : ['proc', 'Plugins'],
26-
'other_proc' : ['proc', 'Other process memory'],
27-
'code' : ['system', 'Code'],
28-
'atom' : ['system', 'Atoms'],
29-
'other_system' : ['system', 'Other system'],
30-
'allocated_unused' : ['unused', 'Allocated unused'],
31-
'reserved_unallocated': ['unused', 'Unallocated reserved by the OS']};
32-
%>
33-
<%= format('memory-bar', {sections: sections, memory: memory, total_out: []}) %>
8+
<%= format('memory-bar', {sections: MEMORY_STATISTICS.sections, memory: memory, total_out: []}) %>
349
<span class="clear">&nbsp;</span>
3510
<div class="box">
36-
<%
37-
var key = [[{name: 'Classic Queues', colour: 'classic',
38-
keys: [['queue_procs', 'queues']]},
39-
{name: 'Quorum Queues', colour: 'quorum',
40-
keys: [['quorum_queue_procs','quorum'],
41-
['quorum_queue_dlx_procs', 'dead letter workers']]},
42-
{name: 'Streams', colour: 'stream',
43-
keys: [['stream_queue_procs', 'stream'],
44-
['stream_queue_replica_reader_procs', 'stream replica reader'],
45-
['stream_queue_coordinator_procs', 'stream coordinator']]},
46-
{name: 'Binaries', colour: 'binary',
47-
keys: [['binary', '']]}],
48-
49-
[{name: 'Connections', colour: 'conn',
50-
keys: [['connection_readers', 'readers'],
51-
['connection_writers', 'writers'],
52-
['connection_channels', 'channels'],
53-
['connection_other', 'other']]}],
54-
55-
[{name: 'Tables', colour: 'table',
56-
keys: [['mnesia', 'internal database tables'],
57-
['msg_index', 'message store index'],
58-
['mgmt_db', 'management database'],
59-
['quorum_ets', 'quorum queue tables'],
60-
['other_ets', 'other']]}],
61-
62-
[{name: 'Processes', colour: 'proc',
63-
keys: [['plugins', 'plugins'],
64-
['metadata_store', 'metadata store'],
65-
['other_proc', 'other']]},
66-
{name: 'System', colour: 'system',
67-
keys: [['code', 'code'],
68-
['atom', 'atoms'],
69-
['other_system', 'other']
70-
]}],
71-
72-
[{name: 'Preallocated memory', colour: 'unused',
73-
keys: [['allocated_unused', 'preallocated by runtime, unused'],
74-
['reserved_unallocated', 'unallocated, reserved by the OS']]}]];
75-
%>
76-
<%= format('memory-table', {key: key, memory: memory}) %>
11+
<%= format('memory-table', {key: MEMORY_STATISTICS.keys, memory: memory}) %>
7712
</div>
7813
7914
<div class="memory-info">

deps/rabbitmq_management/priv/www/js/tmpl/policies.ejs

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@
8383
<option value="all">Exchanges and queues</option>
8484
<option value="exchanges">Exchanges</option>
8585
<option value="queues">Queues</option>
86-
<option value="classic_queues">Classic Queues</option>
87-
<option value="quorum_queues">Quorum Queues</option>
88-
<option value="streams">Streams</option>
86+
<% for (const [typename, type_config] of Object.entries(QUEUE_TYPE)) { %>
87+
<% if (typename != "default") { %>
88+
<option value="<%= type_config.policy_apply_to %>"><%= type_config.label %> Queues</option>
89+
<% } %>
90+
<% } %>
8991
</select>
9092
</td>
9193
</tr>
@@ -111,15 +113,11 @@
111113
<span class="argument-link" field="definition" key="consumer-timeout" type="number">Consumer Timeout</span><span class="help" id="queue-consumer-timeout"></span> |
112114
<span class="argument-link" field="definition" key="queue-leader-locator" type="string">Leader locator</span><span class="help" id="queue-leader-locator"></span></br>
113115
</td>
114-
<tr>
115-
<td>Queues [Quorum]</td>
116-
<td>
117-
<span class="argument-link" field="definition" key="delivery-limit" type="number">Delivery limit</span>
118-
<span class="help" id="delivery-limit"></span> |
119-
<span class="argument-link" field="definition" key="dead-letter-strategy" type="string">Dead letter strategy</span>
120-
<span class="help" id="queue-dead-letter-strategy"></span> |
121-
</td>
122-
</tr>
116+
<% for (const [typename, type_config] of Object.entries(QUEUE_TYPE)) { %>
117+
<% if (typename != "default") { %>
118+
<%= format(type_config.tmpl.user_policy_arguments, {}) %>
119+
<% } %>
120+
<% } %>
123121
<tr>
124122
<td>Streams</td>
125123
<td>
@@ -246,9 +244,11 @@
246244
<td>
247245
<select name="apply-to">
248246
<option value="queues">Queues</option>
249-
<option value="classic_queues">Classic Queues</option>
250-
<option value="quorum_queues">Quorum Queues</option>
251-
<option value="streams">Streams</option>
247+
<% for (const [typename, type_config] of Object.entries(QUEUE_TYPE)) { %>
248+
<% if (typename != "default") { %>
249+
<option value="<%= type_config.policy_apply_to %>"><%= type_config.label %> Queues</option>
250+
<% } %>
251+
<% } %>
252252
</select>
253253
</td>
254254
</tr>
@@ -261,34 +261,12 @@
261261
<td>
262262
<div class="multifield" id="definitionop"></div>
263263
<table class="argument-links">
264-
<tr>
265-
<td>Queues [Classic]</td>
266-
<td>
267-
<span class="argument-link" field="definitionop" key="expires" type="number">Auto expire</span> |
268-
<span class="argument-link" field="definitionop" key="max-length" type="number">Max length</span> |
269-
<span class="argument-link" field="definitionop" key="max-length-bytes" type="number">Max length bytes</span> |
270-
<span class="argument-link" field="definitionop" key="message-ttl" type="number">Message TTL</span> |
271-
<span class="help" id="queue-message-ttl"></span> |
272-
<span class="argument-link" field="definitionop" key="overflow" type="string">Length limit overflow behaviour</span> <span class="help" id="queue-overflow"></span> </br>
273-
</td>
274-
</tr>
275-
<tr>
276-
<td>Queues [Quorum]</td>
277-
<td>
278-
<span class="argument-link" field="definitionop" key="delivery-limit" type="number">Delivery limit</span>
279-
<span class="help" id="delivery-limit"></span> |
280-
<span class="argument-link" field="definitionop" key="expires" type="number">Auto expire</span> |
281-
<span class="argument-link" field="definitionop" key="max-in-memory-bytes" type="number">Max in-memory bytes</span> |
282-
<span class="argument-link" field="definitionop" key="max-in-memory-length" type="number">Max in-memory length</span> <br>
283-
<span class="argument-link" field="definitionop" key="max-length" type="number">Max length</span> |
284-
<span class="argument-link" field="definitionop" key="max-length-bytes" type="number">Max length bytes</span> |
285-
<span class="argument-link" field="definitionop" key="message-ttl" type="number">Message TTL</span>
286-
<span class="help" id="queue-message-ttl"></span> |
287-
<span class="argument-link" field="definitionop" key="target-group-size" type="number">Target group size</span> |
288-
<span class="argument-link" field="definitionop" key="overflow" type="string">Length limit overflow behaviour</span> <span class="help" id="queue-overflow"></span> </br>
289-
</td>
290-
</tr>
291-
<tr>
264+
<% for (const [typename, type_config] of Object.entries(QUEUE_TYPE)) { %>
265+
<% if (typename != "default") { %>
266+
<%= format(type_config.tmpl.operator_policy_arguments, {}) %>
267+
<% } %>
268+
<% } %>
269+
<tr>
292270
<td>Queues [Streams]</td>
293271
<td>
294272
<span class="argument-link" field="definitionop" key="max-length-bytes" type="number">Max length bytes</span>

0 commit comments

Comments
 (0)