Indicate task result in window title
Alpine 3.24 Success

Though still only if we start in a Running state.
This commit is contained in:
2026-07-20 08:46:03 +02:00
parent 3b50d67a3f
commit 775a4601c1
+12
View File
@@ -330,6 +330,17 @@ function refreshLog(log, top, changed) {
log.header.hidden = empty
log.log.hidden = empty
}
function refreshTitle(state) {
let title = "Task {{.ID}}"
switch (state) {
case 'Running': title += " 🟡"; break
case 'Error': title += " 🔴"; break
case 'Failed': title += " 🔴"; break
case 'Success': title += " 🟢"; break
}
document.title = title
}
refreshTitle('Running')
let refresher = setInterval(() => {
const run = getLog('run'), task = getLog('task'), deploy = getLog('deploy')
const url = new URL(window.location.href)
@@ -360,6 +371,7 @@ let refresher = setInterval(() => {
if (data.Duration)
get('duration').textContent = data.Duration
refreshTitle(data.State)
refreshLog(run, data.RunLogTop, data.RunLog)
refreshLog(task, data.TaskLogTop, data.TaskLog)
refreshLog(deploy, data.DeployLogTop, data.DeployLog)