Add version numbering (v1.0.0)
- package.json: bump to 1.0.0
- server/config.js: export APP_VERSION (from package.json) and GIT_COMMIT
(from COMMIT_SHA env var set by CI, or git rev-parse --short HEAD fallback)
- GET /api/version: new public endpoint returning { version, commit }
- GET /api/admin-auth/status: includes version and commit in response
- AdminPage sidebar: displays version string (e.g. "v1.0.0 (1d43875)")
below the Log Out button, styled as muted metadata text
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+8
-1
@@ -1070,6 +1070,7 @@ export default function AdminPage({ content, onSave, onLogout }: Props) {
|
||||
|
||||
// TOTP management state
|
||||
const [totpEnabled, setTotpEnabled] = useState<boolean | null>(null)
|
||||
const [appVersion, setAppVersion] = useState<string>('')
|
||||
const [totpSetupQr, setTotpSetupQr] = useState<string | null>(null)
|
||||
const [totpSetupSecret, setTotpSetupSecret] = useState<string | null>(null)
|
||||
const [totpConfirmCode, setTotpConfirmCode] = useState('')
|
||||
@@ -1291,7 +1292,10 @@ export default function AdminPage({ content, onSave, onLogout }: Props) {
|
||||
useEffect(() => {
|
||||
fetch('/api/admin-auth/status')
|
||||
.then(r => r.ok ? r.json() : Promise.reject())
|
||||
.then(data => setTotpEnabled(!!(data as { totpEnabled?: boolean }).totpEnabled))
|
||||
.then((data: { totpEnabled?: boolean; version?: string; commit?: string }) => {
|
||||
setTotpEnabled(!!data.totpEnabled)
|
||||
if (data.version) setAppVersion(data.commit ? `v${data.version} (${data.commit})` : `v${data.version}`)
|
||||
})
|
||||
.catch(() => {})
|
||||
}, [])
|
||||
|
||||
@@ -3102,6 +3106,9 @@ export default function AdminPage({ content, onSave, onLogout }: Props) {
|
||||
Log Out
|
||||
</button>
|
||||
</div>
|
||||
{appVersion && (
|
||||
<div className="admin-sidebar-version">{appVersion}</div>
|
||||
)}
|
||||
|
||||
<div className="admin-nav-search">
|
||||
<label htmlFor="admin-nav-search-input">Find a section</label>
|
||||
|
||||
@@ -7203,6 +7203,13 @@
|
||||
color: var(--brand-warm-white);
|
||||
}
|
||||
|
||||
.admin-sidebar-version {
|
||||
padding: 0.5rem 1.1rem 0.75rem;
|
||||
font-size: 0.72rem;
|
||||
color: rgba(240,234,216,0.28);
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.admin-nav-search {
|
||||
display: grid;
|
||||
gap: 0.4rem;
|
||||
|
||||
Reference in New Issue
Block a user