feat: implement dashboard download caching and fallback mechanism

- Add local file caching for dashboard downloads with version validation
- Implement fallback to 'latest' version if specific version download fails
- Add robust error handling in CLI check_dashboard to prevent crashes
- Remove dashboard caching from smoke tests (backend-only mode)
This commit is contained in:
LIghtJUNction
2026-03-15 19:14:13 +08:00
parent c18165909e
commit 04aee2890a
3 changed files with 113 additions and 36 deletions
+10 -7
View File
@@ -45,13 +45,16 @@ async def check_dashboard(astrbot_root: Path) -> None:
abort=True,
):
click.echo("Installing dashboard...")
await download_dashboard(
path="data/dashboard.zip",
extract_path=str(astrbot_root / "data"),
version=f"v{VERSION}",
latest=False,
)
click.echo("Dashboard installed successfully")
try:
await download_dashboard(
path="data/dashboard.zip",
extract_path=str(astrbot_root / "data"),
version=f"v{VERSION}",
latest=False,
)
click.echo("Dashboard installed successfully")
except Exception as e:
click.echo(f"Failed to install dashboard: {e}")
case str():
if VersionComparator.compare_version(VERSION, dashboard_version) <= 0: