fix: 初次下载 webui 构建文件时下载指定版本而非 latest

This commit is contained in:
Soulter
2025-09-04 13:27:55 +08:00
parent 1e5f243edb
commit ba2ee1c0aa
5 changed files with 1504 additions and 1498 deletions
+12 -3
View File
@@ -37,7 +37,10 @@ async def check_dashboard(astrbot_root: Path) -> None:
): ):
click.echo("正在安装管理面板...") click.echo("正在安装管理面板...")
await download_dashboard( await download_dashboard(
path="data/dashboard.zip", extract_path=str(astrbot_root) path="data/dashboard.zip",
extract_path=str(astrbot_root),
version=f"v{VERSION}",
latest=False,
) )
click.echo("管理面板安装完成") click.echo("管理面板安装完成")
@@ -50,7 +53,10 @@ async def check_dashboard(astrbot_root: Path) -> None:
version = dashboard_version.split("v")[1] version = dashboard_version.split("v")[1]
click.echo(f"管理面板版本: {version}") click.echo(f"管理面板版本: {version}")
await download_dashboard( await download_dashboard(
path="data/dashboard.zip", extract_path=str(astrbot_root) path="data/dashboard.zip",
extract_path=str(astrbot_root),
version=f"v{VERSION}",
latest=False,
) )
except Exception as e: except Exception as e:
click.echo(f"下载管理面板失败: {e}") click.echo(f"下载管理面板失败: {e}")
@@ -59,7 +65,10 @@ async def check_dashboard(astrbot_root: Path) -> None:
click.echo("初始化管理面板目录...") click.echo("初始化管理面板目录...")
try: try:
await download_dashboard( await download_dashboard(
path=str(astrbot_root / "dashboard.zip"), extract_path=str(astrbot_root) path=str(astrbot_root / "dashboard.zip"),
extract_path=str(astrbot_root),
version=f"v{VERSION}",
latest=False,
) )
click.echo("管理面板初始化完成") click.echo("管理面板初始化完成")
except Exception as e: except Exception as e:
+2 -4
View File
@@ -83,9 +83,7 @@ class UpdateRoute(Route):
) )
try: try:
await download_dashboard( await download_dashboard(latest=latest, version=version, proxy=proxy)
latest=latest, version=version, proxy=proxy
)
except Exception as e: except Exception as e:
logger.error(f"下载管理面板文件失败: {e}") logger.error(f"下载管理面板文件失败: {e}")
@@ -116,7 +114,7 @@ class UpdateRoute(Route):
async def update_dashboard(self): async def update_dashboard(self):
try: try:
try: try:
await download_dashboard() await download_dashboard(version=f"v{VERSION}", latest=False)
except Exception as e: except Exception as e:
logger.error(f"下载管理面板文件失败: {e}") logger.error(f"下载管理面板文件失败: {e}")
return Response().error(f"下载管理面板文件失败: {e}").__dict__ return Response().error(f"下载管理面板文件失败: {e}").__dict__
+1 -1
View File
@@ -56,7 +56,7 @@ async def check_dashboard_files():
) )
try: try:
await download_dashboard() await download_dashboard(version=f"v{VERSION}", latest=False)
except Exception as e: except Exception as e:
logger.critical(f"下载管理面板文件失败: {e}") logger.critical(f"下载管理面板文件失败: {e}")
return return
+1 -1
View File
@@ -1119,7 +1119,7 @@ UID: {user_id} 此 ID 可用于设置管理员。
@filter.command("dashboard_update") @filter.command("dashboard_update")
async def update_dashboard(self, event: AstrMessageEvent): async def update_dashboard(self, event: AstrMessageEvent):
yield event.plain_result("正在尝试更新管理面板...") yield event.plain_result("正在尝试更新管理面板...")
await download_dashboard() await download_dashboard(version=f"v{VERSION}", latest=False)
yield event.plain_result("管理面板更新完成。") yield event.plain_result("管理面板更新完成。")
@filter.command("set") @filter.command("set")
Generated
+1488 -1489
View File
File diff suppressed because it is too large Load Diff