diff --git a/server/api.py b/server/api.py index ff7e987..8d36a73 100644 --- a/server/api.py +++ b/server/api.py @@ -606,6 +606,21 @@ async def api_market_install(id: str = "", filename: str = ""): zip_data = resp.content from models.dashboard import dashboard_manager ok = dashboard_manager.import_theme_zip(zip_data) + + if ok: + try: + async with httpx.AsyncClient(timeout=5) as client2: + # Get current downloads + r = await client2.get(f"{url}/api/collections/dashboards/records/{id}") + current = r.json().get("downloads", 0) or 0 + # Increment + await client2.patch( + f"{url}/api/collections/dashboards/records/{id}", + json={"downloads": current + 1} + ) + except Exception: + pass + return {"ok": ok} except Exception as e: return {"ok": False, "error": str(e)} diff --git a/static/manifest.json b/static/manifest.json index 087970a..8c9717c 100644 --- a/static/manifest.json +++ b/static/manifest.json @@ -1,10 +1,12 @@ { - "name": "TurboSu", + "name": "TurboSu - 极速中枢", "short_name": "TurboSu", "description": "赛车遥测仪表盘", "start_url": "/", "display": "standalone", - "background_color": "#0a0a0f", - "theme_color": "#0a0a0f", - "icons": [] + "background_color": "#060a16", + "theme_color": "#060a16", + "icons": [ + {"src": "/static/img/logo.svg", "sizes": "any", "type": "image/svg+xml"} + ] }