diff --git a/src/main/kotlin/de/hoennig/gittally/server/UiViews.kt b/src/main/kotlin/de/hoennig/gittally/server/UiViews.kt index 1c19cbf..3d7f347 100644 --- a/src/main/kotlin/de/hoennig/gittally/server/UiViews.kt +++ b/src/main/kotlin/de/hoennig/gittally/server/UiViews.kt @@ -80,6 +80,8 @@ data class BuildRowView( val branchUrl: String?, val commitUrl: String?, val latestGreenUrl: String? = null, + /** True while the build has no artifacts yet — the artifact link then shows the log-only icon. */ + val inProgress: Boolean = false, ) { companion object { fun from( @@ -96,6 +98,7 @@ data class BuildRowView( artifactKey = result.artifactKey, branchUrl = links.branchUrl(result.branch), commitUrl = links.commitUrl(result.commit), + inProgress = !result.status.isTerminal, ) /** A branches-view row; never-built branches have no timestamps and no artifact. */ @@ -114,6 +117,7 @@ data class BuildRowView( branchUrl = links.branchUrl(entry.branch), commitUrl = links.commitUrl(entry.commit), latestGreenUrl = entry.latestGreenUrl, + inProgress = entry.status == "running" || entry.status == "pending", ) } } diff --git a/src/main/resources/static/gittally.js b/src/main/resources/static/gittally.js index acba770..72da677 100644 --- a/src/main/resources/static/gittally.js +++ b/src/main/resources/static/gittally.js @@ -241,9 +241,10 @@ function renderBuildRow(build, allowRestart) { const artifactsCell = elem("td"); artifactsCell.dataset.label = "Artifacts"; if (build.artifactKey) { - const artifactLink = elem("a", "artifact-link", "📄"); + const inProgress = build.status === "running" || build.status === "pending"; + const artifactLink = elem("a", "artifact-link", inProgress ? "⏳" : "📄"); artifactLink.href = "/builds/" + encodeURIComponent(build.artifactKey); - artifactLink.title = "Open artifacts"; + artifactLink.title = inProgress ? "Open build log — no artifacts yet" : "Open artifacts"; artifactsCell.appendChild(artifactLink); } if (build.latestGreenUrl) { diff --git a/src/main/resources/templates/builds.html b/src/main/resources/templates/builds.html index 4947450..9722981 100644 --- a/src/main/resources/templates/builds.html +++ b/src/main/resources/templates/builds.html @@ -52,7 +52,9 @@