diff --git a/gui/web_gui.py b/gui/web_gui.py index 2e34710..37569a4 100644 --- a/gui/web_gui.py +++ b/gui/web_gui.py @@ -1738,6 +1738,16 @@ class Handler(BaseHTTPRequestHandler): # 提供 CSRF token 给前端 if u.path == "/api/csrf-token": return self._send_json({"token": _CSRF_TOKEN}) + if u.path == "/api/version": + try: + from version import APP_VERSION, APP_BUILD_DATE, APP_NAME + except Exception: + APP_VERSION, APP_BUILD_DATE, APP_NAME = "?", "?", "douyin_guaji" + return self._send_json({ + "name": APP_NAME, + "version": str(APP_VERSION).lstrip("Vv"), + "build": APP_BUILD_DATE, + }) if u.path == "/api/devices": adb = find_adb_executable() return self._send_json({"adb": adb, "devices": list_adb_devices(adb)}) diff --git a/webui/index.html b/webui/index.html index cae8912..9100389 100644 --- a/webui/index.html +++ b/webui/index.html @@ -15,7 +15,7 @@ } catch (e) {} })(); - +