mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-13 02:56:39 +07:00
feat: показывать версию приложения в настройках, версия 1.1.0
Версии бэкенда и фронтенда были не синхронизированы и нигде не отображались в интерфейсе — непонятно было, обновилось ли приложение после пересборки. Теперь единая версия 1.1.0 приходит с бэкенда через /api/health и мелким текстом выводится внизу страницы настроек.
This commit is contained in:
@@ -4,9 +4,10 @@ from functools import lru_cache
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
# Single source of truth for the running app's version — surfaced in the API
|
||||
# title and embedded in exported backups so an old file can be told apart
|
||||
# from a current one.
|
||||
APP_VERSION = "0.20.0"
|
||||
# title, /api/health (which the frontend reads to show it in Settings), and
|
||||
# embedded in exported backups so an old file can be told apart from a
|
||||
# current one.
|
||||
APP_VERSION = "1.1.0"
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
|
||||
@@ -88,4 +88,7 @@ app.include_router(crypto.router, prefix="/api")
|
||||
|
||||
@app.get("/api/health")
|
||||
async def health() -> dict[str, str]:
|
||||
return {"status": "ok"}
|
||||
# version rides along so the frontend's Settings page can show which
|
||||
# release is actually running without a separate authenticated endpoint —
|
||||
# this route is already auth_basic-exempt for Docker's HEALTHCHECK.
|
||||
return {"status": "ok", "version": APP_VERSION}
|
||||
|
||||
Reference in New Issue
Block a user