Skip to content

Commit

Permalink
Change the way order works
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesread committed Aug 21, 2024
1 parent 18279c5 commit 36da7b8
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion webui/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,25 @@ function renderAlert (alert) {
alertElement.classList.add('alert')
alertElement.appendChild(linkElement)

alertElement.classList.add(alert.Labels.severity)
if ('severity' in alert.Labels) {
switch (alert.Labels.severity) {
case 'critical':
alertElement.style.order = '1'
break
case 'warning':
alertElement.style.order = '2'
break
case 'info':
alertElement.style.order = '3'
break
default:
alertElement.style.order = '5'
}

alertElement.classList.add(alert.Labels.severity)
} else {
alertElement.style.order = '10'
}

return alertElement
}

0 comments on commit 36da7b8

Please sign in to comment.