Skip to content

Commit

Permalink
revert out of scope changes
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorerlingsson committed Jun 19, 2024
1 parent 7ec9d75 commit 8882bdd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 43 deletions.
26 changes: 2 additions & 24 deletions static/js/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ loadMoreConsumersBtn.addEventListener('click', (e) => {
updateQueue(true)
})

function handleQueueState (state, closed_reason) {
function handleQueueState (state) {
document.getElementById('q-state').textContent = state
switch (state) {
case 'paused':
Expand All @@ -81,28 +81,6 @@ function handleQueueState (state, closed_reason) {
pauseQueueForm.disabled = true
resumeQueueForm.disabled = true
}

if (state === 'closed') {
const tooltip = document.createElement('span')
tooltip.classList.add('tooltiptext')
tooltip.classList.add('tooltiptext-long')
tooltip.textContent = closed_reason
document.getElementById('q-state').appendChild(tooltip)
const button = document.createElement('button')
button.textContent = 'Try to recover'
button.classList.add('btn-warn')
button.id='recover-queue'
// button.onclick = function () {
// text about recovering queue maybe loosing messages
// add confirm dialog?

// const url = 'api/queues/' + urlEncodedVhost + '/' + urlEncodedQueue + '/recover'
// HTTP.request('POST', url)

document.getElementById('q-state').appendChild(button)


}
}

const chart = Chart.render('chart', 'msgs/s')
Expand All @@ -111,7 +89,7 @@ function updateQueue (all) {
HTTP.request('GET', queueUrl + '?consumer_list_length=' + consumerListLength)
.then(item => {
Chart.update(chart, item.message_stats)
handleQueueState(item.state, item.closed_reason)
handleQueueState(item.state)
document.getElementById('q-unacked').textContent = item.unacked
document.getElementById('q-unacked-bytes').textContent = Helpers.nFormatter(item.unacked_bytes) + 'B'
document.getElementById('q-unacked-avg-bytes').textContent = Helpers.nFormatter(item.unacked_avg_bytes) + 'B'
Expand Down
18 changes: 0 additions & 18 deletions static/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1011,20 +1011,6 @@ fieldset.inline {
z-index: 1;
white-space: normal;
}
.arg-tooltip .tooltiptext.tooltiptext-long {
width: 500px;
}

#q-state {
display: table-cell;
}

#recover-queue {
padding: 0 10px;
margin-left:10px;
font-size: 10pt;
line-height: 16pt;
}

.prop-tooltip .prop-tooltiptext {
margin-left: -65px;
Expand Down Expand Up @@ -1114,7 +1100,3 @@ pre.arguments > div {
#livelog table th {
text-align: left;
}

#q-closed-reason-row {
display: none;
}
2 changes: 1 addition & 1 deletion views/queue.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</tr>
<tr>
<th>State</th>
<td id="q-state" class="arg-tooltip"></td>
<td id="q-state"></td>
</tr>
<tr>
<th>Consumers</th>
Expand Down

0 comments on commit 8882bdd

Please sign in to comment.