From 0c3e5ec57bd2d33f268d85dabbd22ae35d291533 Mon Sep 17 00:00:00 2001 From: Tomas Kracmar Date: Mon, 20 Apr 2026 17:09:02 +0200 Subject: [PATCH] feat: add version display to frontend and /api/version endpoint (v1.2.5) - Add GET /api/version endpoint that reads VERSION file - Frontend fetches version on init and displays it as a badge in the header - Add version-badge CSS styling - Update docker-compose.yml comment to v1.2.5 --- VERSION | 2 +- backend/frontend/index.html | 14 +++++++++++++- backend/frontend/style.css | 14 ++++++++++++++ backend/main.py | 6 ++++++ docker-compose.yml | 2 +- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index d2d61a7..3a1f10e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.2 \ No newline at end of file +1.2.5 \ No newline at end of file diff --git a/backend/frontend/index.html b/backend/frontend/index.html index 9f0f11b..b411a0f 100644 --- a/backend/frontend/index.html +++ b/backend/frontend/index.html @@ -12,7 +12,7 @@
-

Admin Operations Center

+

Admin Operations Center

Directory Audit Explorer

Filter Microsoft Entra audit events by user, app, time, action, and action type.

@@ -243,6 +243,7 @@ actor: '', selectedServices: [], search: '', operation: '', result: '', start: '', end: '', limit: 100, includeTags: '', excludeTags: '', }, options: { actors: [], services: [], operations: [], results: [] }, + appVersion: '', askQuestionText: '', askLoading: false, askAnswer: '', @@ -252,6 +253,7 @@ askLlmError: '', async initApp() { + await this.loadVersion(); await this.initAuth(); if (!this.authConfig?.auth_enabled || this.accessToken) { await this.loadFilterOptions(); @@ -260,6 +262,16 @@ } }, + async loadVersion() { + try { + const res = await fetch('/api/version'); + if (res.ok) { + const body = await res.json(); + this.appVersion = body.version || ''; + } + } catch {} + }, + authHeader() { return this.accessToken ? { Authorization: `Bearer ${this.accessToken}` } : {}; }, diff --git a/backend/frontend/style.css b/backend/frontend/style.css index f9c9627..70c7d50 100644 --- a/backend/frontend/style.css +++ b/backend/frontend/style.css @@ -433,6 +433,20 @@ input { color: var(--muted); } +.version-badge { + display: inline-block; + margin-left: 8px; + padding: 2px 8px; + border-radius: 999px; + background: rgba(125, 211, 252, 0.15); + border: 1px solid rgba(125, 211, 252, 0.3); + color: var(--accent-strong); + font-size: 11px; + font-weight: 600; + letter-spacing: 0.05em; + vertical-align: middle; +} + .ask-events { margin-bottom: 14px; } diff --git a/backend/main.py b/backend/main.py index 27ea709..5284838 100644 --- a/backend/main.py +++ b/backend/main.py @@ -134,6 +134,12 @@ async def metrics(): return Response(content=prometheus_metrics(), media_type="text/plain") +@app.get("/api/version") +async def version(): + version_file = Path(__file__).parent.parent / "VERSION" + return {"version": version_file.read_text().strip() if version_file.exists() else "unknown"} + + frontend_dir = Path(__file__).parent / "frontend" app.mount("/", StaticFiles(directory=frontend_dir, html=True), name="frontend") diff --git a/docker-compose.yml b/docker-compose.yml index 1c8d6b9..3ecde35 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: backend: build: ./backend # For production, use the pre-built image instead: - # image: git.cqre.net/cqrenet/aoc-backend:v1.1.0 + # image: git.cqre.net/cqrenet/aoc-backend:v1.2.5 container_name: aoc-backend restart: always env_file: