Expose web app version and bump assets

This commit is contained in:
wuyang
2026-07-09 14:24:44 +08:00
parent ac6e0e03da
commit 15b5cec933
2 changed files with 24 additions and 2 deletions
+22
View File
@@ -8,6 +8,7 @@ import hashlib
import json
import os
import re
import subprocess
import threading
import time
import urllib.error
@@ -30,6 +31,25 @@ CACHE_ROOT = WEB_ROOT / "cache"
ARXIV_CACHE = CACHE_ROOT / "arxiv"
AI_CACHE = CACHE_ROOT / "ai"
OLLAMA_URL = os.environ.get("OLLAMA_URL", "http://192.168.1.10:11434").rstrip("/")
ASSET_VERSION = "atlas-20260709-01"
def detect_app_version() -> str:
env_version = os.environ.get("APP_VERSION") or os.environ.get("GIT_COMMIT")
if env_version:
return env_version
try:
return subprocess.check_output(
["git", "rev-parse", "--short", "HEAD"],
cwd=ROOT,
text=True,
timeout=1,
).strip()
except (OSError, subprocess.SubprocessError):
return "unknown"
APP_VERSION = detect_app_version()
DEFAULT_MODELS = {
"translate": "ChatGPT-5.6:light",
@@ -1367,6 +1387,8 @@ class PaperBrowserHandler(SimpleHTTPRequestHandler):
{
"ok": True,
"paper_count": len(papers),
"app_version": APP_VERSION,
"asset_version": ASSET_VERSION,
"ollama_url": OLLAMA_URL,
"ollama_ok": ollama_ok,
"default_models": DEFAULT_MODELS,
+2 -2
View File
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Agent Knowledge Atlas</title>
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='12' fill='%23cfe8e3'/%3E%3Ctext x='32' y='40' text-anchor='middle' font-size='24' font-family='Arial' font-weight='700' fill='%23064c47'%3EAK%3C/text%3E%3C/svg%3E" />
<link rel="stylesheet" href="/static/styles.css?v=atlas-20260708-12" />
<link rel="stylesheet" href="/static/styles.css?v=atlas-20260709-01" />
</head>
<body>
<main class="atlas-app">
@@ -79,6 +79,6 @@
</footer>
</main>
<script src="/static/app.js?v=atlas-20260708-12"></script>
<script src="/static/app.js?v=atlas-20260709-01"></script>
</body>
</html>