Skip to content

Commit

Permalink
fmt: Minor lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesread committed Oct 2, 2024
1 parent d8b21c2 commit bc8f17c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions webui/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const severityWeighting = new Map([
export default function main () {
window.timeUntilNextUpdate = 0

setInterval(updateProgressBar, 1000)
window.intervalTimer = setInterval(updateProgressBar, 1000)
}

function updateProgressBar () {
Expand All @@ -21,7 +21,7 @@ function updateProgressBar () {

window.timeUntilNextUpdate--

if (timeUntilNextUpdate < 0) {
if (window.timeUntilNextUpdate < 0) {
fetchAlertList()
window.timeUntilNextUpdate = 30
}
Expand All @@ -31,7 +31,7 @@ function fetchAlertList () {
const alertList = document.getElementById('alert-list')
alertList.innerHTML = ''

fetch('/alert_list')
window.fetch('/alert_list')
.then(response => response.json())
.then(res => {
const alerts = res.Alerts
Expand All @@ -42,6 +42,8 @@ function fetchAlertList () {

renderLastUpdated(res)
}).catch(error => {
console.error('Fetch error:', error)

document.getElementById('last-updated').textContent = 'Fetch error'
document.getElementById('last-updated').classList.add('critical')
})
Expand Down

0 comments on commit bc8f17c

Please sign in to comment.