feat(ui): auto-refresh overview/modules, quick config, HW re-probe, link-tile layout; deploy: npm ci+build, restart live-console
Made-with: Cursor
This commit is contained in:
@@ -6,6 +6,7 @@ from __future__ import annotations
|
||||
import os
|
||||
import posixpath
|
||||
import sys
|
||||
import time
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
@@ -23,13 +24,19 @@ REMOTE_BASE = os.environ.get("LIVE_DEPLOY_PATH", "/home/live/douyinyoutube").rst
|
||||
REPO_ROOT = Path(__file__).resolve().parent.parent
|
||||
|
||||
FILES = [
|
||||
"src/control_plane.py",
|
||||
"src/web_process_backend.py",
|
||||
"web.py",
|
||||
"main.py",
|
||||
"scripts/hardware_probe.py",
|
||||
"douyin_youtube_ffplay.py",
|
||||
"web-console/package.json",
|
||||
"web-console/package-lock.json",
|
||||
"web-console/app/globals.css",
|
||||
"web-console/app/layout.tsx",
|
||||
"web-console/app/page.tsx",
|
||||
"web-console/middleware.ts",
|
||||
"web-console/components/OverviewCharts.tsx",
|
||||
]
|
||||
|
||||
LOG_DIR = REPO_ROOT / ".deploy_logs"
|
||||
@@ -182,7 +189,8 @@ def main() -> int:
|
||||
|
||||
py_compile = (
|
||||
f"cd {REMOTE_BASE} && python3 -m py_compile web.py "
|
||||
"src/web_process_backend.py scripts/hardware_probe.py douyin_youtube_ffplay.py main.py"
|
||||
"src/control_plane.py src/web_process_backend.py "
|
||||
"scripts/hardware_probe.py douyin_youtube_ffplay.py main.py"
|
||||
)
|
||||
code_py, _ = run_logged(client, log_path, "python_py_compile", py_compile, timeout=90)
|
||||
if code_py != 0:
|
||||
@@ -191,6 +199,7 @@ def main() -> int:
|
||||
|
||||
build_cmd = (
|
||||
f"cd {REMOTE_BASE}/web-console && "
|
||||
"(npm ci 2>/dev/null || npm install) && "
|
||||
"(command -v pnpm >/dev/null 2>&1 && pnpm run build || npm run build)"
|
||||
)
|
||||
code_b, _ = run_logged(client, log_path, "web_console_build", build_cmd, timeout=900)
|
||||
@@ -212,15 +221,23 @@ def main() -> int:
|
||||
"echo try_restart_done'"
|
||||
)
|
||||
run_logged(client, log_path, "sudo_try_restart_units", restart_cmd, timeout=60)
|
||||
|
||||
run_logged(
|
||||
client,
|
||||
log_path,
|
||||
"curl_health",
|
||||
"curl -sS -m 10 http://127.0.0.1:8001/health 2>&1 || "
|
||||
"curl -sS -m 10 http://127.0.0.1:8101/health 2>&1 || "
|
||||
"sudo_restart_live_console",
|
||||
f"echo '{PASS}' | sudo -S systemctl restart live-console.service",
|
||||
timeout=120,
|
||||
)
|
||||
_safe_print("等待服务监听…")
|
||||
time.sleep(6)
|
||||
run_logged(
|
||||
client,
|
||||
log_path,
|
||||
"curl_health_after_restart",
|
||||
"curl -sS -m 15 http://127.0.0.1:8001/health 2>&1 || "
|
||||
"curl -sS -m 15 http://127.0.0.1:8101/health 2>&1 || "
|
||||
"echo 'curl_health_failed'",
|
||||
timeout=20,
|
||||
timeout=25,
|
||||
)
|
||||
|
||||
run_logged(
|
||||
|
||||
Reference in New Issue
Block a user