web: Show the broker's version in the header
CI / Check (pull_request) Successful in 5m45s
CI / Check (push) Successful in 5m43s

Signed-in pages show which version of the broker is running, next to
the approver's name, to check a deploy of the broker took effect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #23.
This commit is contained in:
jackos1998andClaude Opus 5.5 committed 2026-11-29 13:27:48 +00:00
1 parent 76eb39fb7e
commit 83a9e9d0d6
3 files changed
+9

No files matched your search

+4
View File
@@ -72,6 +72,10 @@ nav a {
margin-right: 16px;
}
.account .version {
font-size: 0.875em;
}
main {
max-width: 960px;
margin: 0 auto;
+4
View File
@@ -13,6 +13,9 @@ use crate::detail::{Column, Detail, Section};
use crate::ops::printable;
use crate::queue::{Decision, PendingInfo};
/// The broker's version, which signed-in pages show.
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
/// HTML escaping, after replacing what [`printable`] replaces.
#[derive(Debug, Clone, Copy)]
pub struct Printable;
@@ -300,5 +303,6 @@ mod tests {
assert!(html.contains("<dt>Command</dt><dd class=\"neutral\"><code>uptime</code></dd>"), "{html}");
assert!(html.contains("<span class=\"diff-add\">+a</span>"), "{html}");
assert!(html.contains("Details (Text)") && html.contains("<pre>Old: text</pre>"), "{html}");
assert!(html.contains(&format!("slop-broker {VERSION}")), "{html}");
}
}
+1
View File
@@ -14,6 +14,7 @@
<header>
<nav><a href="/">Pending</a> <a href="/log">Log</a></nav>
<form method="post" action="/auth/logout" class="account">
<span class="version">slop-broker {{ crate::web::page::VERSION }}</span>
<span>{{ name }}</span>
<input type="hidden" name="csrf" value="{{ csrf }}">
<button type="submit" class="quiet">Sign out</button>