mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-14 19:55:03 +01:00
even more queuing around
This commit is contained in:
parent
4643483d70
commit
d90d61504c
5 changed files with 24 additions and 7 deletions
|
|
@ -14,6 +14,8 @@
|
|||
<h1>AMQP Data</h1>
|
||||
<h2>Connections</h2>
|
||||
<div id="connection-wrapper"></div>
|
||||
<h2>Queues</h2>
|
||||
<div id="queue-wrapper"></div>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -39,10 +39,23 @@ const renderConnections = (connections) => {
|
|||
wrapper.replaceChildren(table);
|
||||
};
|
||||
|
||||
const renderQueues = (queues) => {
|
||||
const wrapper = document.getElementById('queue-wrapper');
|
||||
|
||||
const table = renderTable(
|
||||
['Queue ID', 'Name', 'Durable'],
|
||||
queues.map((queue) => {
|
||||
return [queue.id, queue.name, queue.durable ? 'Yes' : 'No'];
|
||||
})
|
||||
);
|
||||
wrapper.replaceChildren(table);
|
||||
};
|
||||
|
||||
const refresh = async () => {
|
||||
const fetched = await fetch('api/data');
|
||||
const data = await fetched.json();
|
||||
renderConnections(data.connections);
|
||||
renderQueues(data.queues);
|
||||
};
|
||||
|
||||
setInterval(refresh, 1000);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue