''
This commit is contained in:
parent
2a0b37a4cb
commit
fedfec65cf
@ -229,14 +229,17 @@ def _console_needs_rebuild() -> bool:
|
||||
stamp = _read_console_stamp()
|
||||
if not stamp:
|
||||
return True
|
||||
source_hash = str(stamp.get("source_hash") or "")
|
||||
if source_hash and source_hash == _console_sources_hash():
|
||||
return False
|
||||
try:
|
||||
src_mtime = float(stamp.get("source_mtime") or 0.0)
|
||||
except Exception:
|
||||
return True
|
||||
return _console_sources_mtime() > src_mtime + 0.5
|
||||
latest_mtime = _console_sources_mtime()
|
||||
if latest_mtime <= src_mtime + 0.5:
|
||||
return False
|
||||
source_hash = str(stamp.get("source_hash") or "")
|
||||
if source_hash and source_hash == _console_sources_hash():
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def _write_console_stamp(*, toolchain: str, major: int | None = None) -> None:
|
||||
@ -270,6 +273,100 @@ def _npm_cmd(runtime: NodeRuntime | None = None) -> str:
|
||||
return shutil.which("npm") or "npm"
|
||||
|
||||
|
||||
def _console_deps_lock() -> Path | None:
|
||||
for name in ("pnpm-lock.yaml", "package-lock.json"):
|
||||
path = CONSOLE / name
|
||||
if path.is_file():
|
||||
return path
|
||||
return None
|
||||
|
||||
|
||||
def _console_next_bin() -> Path:
|
||||
return CONSOLE / "node_modules" / ".bin" / ("next.cmd" if os.name == "nt" else "next")
|
||||
|
||||
|
||||
def _console_deps_stamp_path() -> Path:
|
||||
return CONSOLE / "node_modules" / ".install-stamp.json"
|
||||
|
||||
|
||||
def _console_deps_need_refresh() -> bool:
|
||||
if not _console_next_bin().exists():
|
||||
return True
|
||||
pkg = CONSOLE / "package.json"
|
||||
stamp_path = _console_deps_stamp_path()
|
||||
if not stamp_path.is_file():
|
||||
return True
|
||||
try:
|
||||
stamp = json.loads(stamp_path.read_text(encoding="utf-8"))
|
||||
except Exception:
|
||||
return True
|
||||
if float(stamp.get("package_mtime") or 0) < pkg.stat().st_mtime:
|
||||
return True
|
||||
lock = _console_deps_lock()
|
||||
if lock is None:
|
||||
return False
|
||||
return (
|
||||
stamp.get("lock") != lock.name
|
||||
or float(stamp.get("lock_mtime") or 0) < lock.stat().st_mtime
|
||||
)
|
||||
|
||||
|
||||
def _write_console_deps_stamp() -> None:
|
||||
pkg = CONSOLE / "package.json"
|
||||
lock = _console_deps_lock()
|
||||
payload: dict[str, object] = {"package_mtime": pkg.stat().st_mtime}
|
||||
if lock is not None:
|
||||
payload["lock"] = lock.name
|
||||
payload["lock_mtime"] = lock.stat().st_mtime
|
||||
stamp_path = _console_deps_stamp_path()
|
||||
try:
|
||||
stamp_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
stamp_path.write_text(json.dumps(payload, ensure_ascii=False), encoding="utf-8")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def _pick_package_manager(runtime: NodeRuntime) -> tuple[str, str]:
|
||||
lock = _console_deps_lock()
|
||||
if lock is not None and lock.name == "pnpm-lock.yaml":
|
||||
pnpm = shutil.which("pnpm", path=str(runtime.node.parent))
|
||||
if pnpm:
|
||||
return pnpm, "pnpm"
|
||||
return _npm_cmd(runtime), "npm"
|
||||
|
||||
|
||||
def _install_console_deps(pm: str, pm_name: str, *, env: dict[str, str]) -> int:
|
||||
lock = _console_deps_lock()
|
||||
if pm_name == "pnpm":
|
||||
cmd = [pm, "install", "--frozen-lockfile"] if lock and lock.name == "pnpm-lock.yaml" else [pm, "install"]
|
||||
elif lock and lock.name == "package-lock.json":
|
||||
cmd = [pm, "ci"]
|
||||
else:
|
||||
cmd = [pm, "install"]
|
||||
rc = _run_console_cmd(cmd, cwd=CONSOLE, env=env)
|
||||
if rc != 0 and pm_name == "npm" and lock and lock.name == "package-lock.json" and cmd[1] == "ci":
|
||||
print("[launch] npm ci 失败,尝试 npm install…")
|
||||
rc = _run_console_cmd([pm, "install"], cwd=CONSOLE, env=env)
|
||||
return rc
|
||||
|
||||
|
||||
def _clean_console_artifacts(*, include_deps: bool = False, include_out: bool = False) -> None:
|
||||
names: list[str] = []
|
||||
if include_deps:
|
||||
names.append("node_modules")
|
||||
names.append(".next")
|
||||
if include_out:
|
||||
names.append("out")
|
||||
for name in names:
|
||||
path = CONSOLE / name
|
||||
if path.exists():
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
|
||||
|
||||
def _console_force_clean() -> bool:
|
||||
return os.environ.get("WEB_CONSOLE_FORCE_CLEAN", "").strip().lower() in {"1", "true", "yes"}
|
||||
|
||||
|
||||
def _try_local_console_build() -> tuple[bool, str]:
|
||||
runtime = _pick_node_runtime()
|
||||
if runtime is None:
|
||||
@ -280,7 +377,7 @@ def _try_local_console_build() -> tuple[bool, str]:
|
||||
return False, f"找到 Node {runtime.node},但未找到同目录 npm"
|
||||
|
||||
env = _runtime_env(runtime)
|
||||
npm = _npm_cmd(runtime)
|
||||
pm, pm_name = _pick_package_manager(runtime)
|
||||
print(f"[launch] 使用本机 Node {runtime.major} 构建 Web 控制台: {runtime.node}")
|
||||
|
||||
rebuild = _console_needs_rebuild()
|
||||
@ -289,23 +386,29 @@ def _try_local_console_build() -> tuple[bool, str]:
|
||||
return True, "up-to-date"
|
||||
|
||||
print("[launch] 正在构建 Web 控制台…")
|
||||
for path in (CONSOLE / "node_modules", CONSOLE / ".next"):
|
||||
if path.exists():
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
lock = CONSOLE / "package-lock.json"
|
||||
if lock.is_file():
|
||||
rc = _run_console_cmd([npm, "ci"], cwd=CONSOLE, env=env)
|
||||
if rc != 0:
|
||||
print("[launch] npm ci 失败,尝试 npm install…")
|
||||
rc = _run_console_cmd([npm, "install"], cwd=CONSOLE, env=env)
|
||||
if rc != 0:
|
||||
return False, "npm install 失败"
|
||||
else:
|
||||
rc = _run_console_cmd([npm, "install"], cwd=CONSOLE, env=env)
|
||||
if rc != 0:
|
||||
return False, "npm install 失败"
|
||||
force_clean = _console_force_clean()
|
||||
if force_clean:
|
||||
print("[launch] WEB_CONSOLE_FORCE_CLEAN=1,执行全量清理后重建…")
|
||||
_clean_console_artifacts(include_deps=True, include_out=True)
|
||||
|
||||
rc = _run_console_cmd([npm, "run", "build"], cwd=CONSOLE, env=env)
|
||||
if force_clean or _console_deps_need_refresh():
|
||||
if (CONSOLE / "node_modules").exists():
|
||||
print(f"[launch] 安装前端依赖({pm_name})…")
|
||||
shutil.rmtree(CONSOLE / "node_modules", ignore_errors=True)
|
||||
else:
|
||||
print(f"[launch] 安装前端依赖({pm_name})…")
|
||||
rc = _install_console_deps(pm, pm_name, env=env)
|
||||
if rc != 0:
|
||||
return False, f"{pm_name} install 失败"
|
||||
_write_console_deps_stamp()
|
||||
else:
|
||||
print("[launch] 依赖未变更,跳过 install。")
|
||||
|
||||
rc = _run_console_cmd([pm, "run", "build"], cwd=CONSOLE, env=env)
|
||||
if rc != 0 and not force_clean:
|
||||
print("[launch] 构建失败,清理 .next 后重试一次…")
|
||||
_clean_console_artifacts(include_deps=False, include_out=True)
|
||||
rc = _run_console_cmd([pm, "run", "build"], cwd=CONSOLE, env=env)
|
||||
if rc != 0:
|
||||
return False, "npm run build 失败"
|
||||
_write_console_stamp(toolchain="local", major=runtime.major)
|
||||
@ -320,18 +423,13 @@ def _docker_console_build() -> bool:
|
||||
print(f"[launch] 本机 Node 不足,改用 Docker 构建: {DOCKER_NODE_IMAGE}")
|
||||
script = (
|
||||
"set -e; "
|
||||
"rm -rf /tmp/web-console; "
|
||||
"mkdir -p /tmp/web-console; "
|
||||
"cd /workspace/web-console; "
|
||||
"tar --exclude=node_modules --exclude=.next --exclude=out -cf - . | tar -C /tmp/web-console -xf -; "
|
||||
"cd /tmp/web-console; "
|
||||
"rm -rf node_modules .next out; "
|
||||
"export HOME=/tmp npm_config_cache=/tmp/npm-cache; "
|
||||
"if [ ! -x node_modules/.bin/next ]; then "
|
||||
"rm -rf node_modules .next; "
|
||||
"if [ -f package-lock.json ]; then npm ci || npm install; else npm install; fi; "
|
||||
"test -x node_modules/.bin/next; "
|
||||
"npm run build; "
|
||||
"rm -rf /workspace/web-console/out; "
|
||||
"cp -a out /workspace/web-console/out"
|
||||
"fi; "
|
||||
"npm run build"
|
||||
)
|
||||
cmd = [
|
||||
docker,
|
||||
@ -412,16 +510,14 @@ def _start_local_console_dev(*, host: str, port: str, next_port: str) -> subproc
|
||||
if runtime is None:
|
||||
return None
|
||||
env = _runtime_env(runtime, {"API_PROXY_TARGET": f"http://127.0.0.1:{port}"})
|
||||
npm = _npm_cmd(runtime)
|
||||
node_modules = CONSOLE / "node_modules"
|
||||
if not node_modules.exists():
|
||||
lock = CONSOLE / "package-lock.json"
|
||||
print("[launch] 未检测到 web-console/node_modules,先安装依赖…")
|
||||
install_cmd = [npm, "ci"] if lock.is_file() else [npm, "install"]
|
||||
if _run_console_cmd(install_cmd, cwd=CONSOLE, env=env) != 0:
|
||||
pm, pm_name = _pick_package_manager(runtime)
|
||||
if _console_deps_need_refresh():
|
||||
print(f"[launch] 未检测到可用依赖,先安装({pm_name})…")
|
||||
if _install_console_deps(pm, pm_name, env=env) != 0:
|
||||
print("[launch] 依赖安装失败,准备尝试 Docker 兜底。")
|
||||
return None
|
||||
cmd = [npm, "run", "dev", "--", "--hostname", "0.0.0.0", "--port", next_port]
|
||||
_write_console_deps_stamp()
|
||||
cmd = [pm, "run", "dev", "--", "--hostname", "0.0.0.0", "--port", next_port]
|
||||
return subprocess.Popen(cmd, cwd=CONSOLE, env=env)
|
||||
|
||||
|
||||
|
||||
84
d2ypp2/tests/test_launch_console_build.py
Normal file
84
d2ypp2/tests/test_launch_console_build.py
Normal file
@ -0,0 +1,84 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
import json
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
def _load_launch_module():
|
||||
spec = importlib.util.spec_from_file_location("launch_for_console_build_test", ROOT / "scripts" / "launch.py")
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
assert spec.loader is not None
|
||||
sys.modules[spec.name] = module
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
class LaunchConsoleBuildTests(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls) -> None:
|
||||
cls.launch = _load_launch_module()
|
||||
|
||||
def test_console_needs_rebuild_skips_hash_when_mtime_unchanged(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
console = Path(tmp) / "web-console"
|
||||
out = console / "out"
|
||||
out.mkdir(parents=True)
|
||||
(out / "index.html").write_text("<html></html>", encoding="utf-8")
|
||||
(out / ".build-stamp.json").write_text(
|
||||
json.dumps({"source_mtime": time.time() + 3600, "source_hash": "deadbeef"}),
|
||||
encoding="utf-8",
|
||||
)
|
||||
(console / "package.json").write_text("{}", encoding="utf-8")
|
||||
app = console / "app"
|
||||
app.mkdir()
|
||||
(app / "page.tsx").write_text("export default function Page() { return null }", encoding="utf-8")
|
||||
|
||||
with patch.object(self.launch, "CONSOLE", console), patch.object(self.launch, "OUT_INDEX", out / "index.html"), patch.object(
|
||||
self.launch,
|
||||
"OUT_STAMP",
|
||||
out / ".build-stamp.json",
|
||||
):
|
||||
with patch.object(self.launch, "_console_sources_hash") as hash_mock:
|
||||
self.assertFalse(self.launch._console_needs_rebuild())
|
||||
hash_mock.assert_not_called()
|
||||
|
||||
def test_console_deps_need_refresh_when_next_missing(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
console = Path(tmp) / "web-console"
|
||||
console.mkdir()
|
||||
(console / "package.json").write_text("{}", encoding="utf-8")
|
||||
with patch.object(self.launch, "CONSOLE", console):
|
||||
self.assertTrue(self.launch._console_deps_need_refresh())
|
||||
|
||||
def test_console_deps_need_refresh_false_when_stamp_matches(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
console = Path(tmp) / "web-console"
|
||||
console.mkdir()
|
||||
pkg = console / "package.json"
|
||||
pkg.write_text("{}", encoding="utf-8")
|
||||
lock = console / "package-lock.json"
|
||||
lock.write_text("{}", encoding="utf-8")
|
||||
bin_dir = console / "node_modules" / ".bin"
|
||||
bin_dir.mkdir(parents=True)
|
||||
next_name = "next.cmd" if self.launch.os.name == "nt" else "next"
|
||||
(bin_dir / next_name).write_text("", encoding="utf-8")
|
||||
stamp = {
|
||||
"package_mtime": pkg.stat().st_mtime,
|
||||
"lock": "package-lock.json",
|
||||
"lock_mtime": lock.stat().st_mtime,
|
||||
}
|
||||
(console / "node_modules" / ".install-stamp.json").write_text(json.dumps(stamp), encoding="utf-8")
|
||||
with patch.object(self.launch, "CONSOLE", console):
|
||||
self.assertFalse(self.launch._console_deps_need_refresh())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
70
d2ypp2/tools/quick_sync_build.py
Normal file
70
d2ypp2/tools/quick_sync_build.py
Normal file
@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Sync changed web-console files and build on remote (fast path)."""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
if hasattr(sys.stdout, "reconfigure"):
|
||||
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
||||
|
||||
try:
|
||||
import paramiko
|
||||
except ImportError:
|
||||
print("pip install paramiko", file=sys.stderr)
|
||||
raise SystemExit(1)
|
||||
|
||||
HOST = "192.168.31.56"
|
||||
USER = "eric"
|
||||
PASS = "4669805"
|
||||
REMOTE = "/home/eric/d2ypp2"
|
||||
LOCAL = Path(__file__).resolve().parent.parent
|
||||
|
||||
FILES = [
|
||||
"web-console/next.config.mjs",
|
||||
"web-console/app/globals.css",
|
||||
"web-console/components/LiveStudioScene3D.tsx",
|
||||
"web-console/components/live-product/DashboardOverview.tsx",
|
||||
]
|
||||
|
||||
|
||||
def main() -> int:
|
||||
client = paramiko.SSHClient()
|
||||
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
client.connect(HOST, username=USER, password=PASS, timeout=20)
|
||||
sftp = client.open_sftp()
|
||||
|
||||
for rel in FILES:
|
||||
lp = LOCAL / rel
|
||||
rp = f"{REMOTE}/{rel.replace(chr(92), '/')}"
|
||||
sftp.put(str(lp), rp)
|
||||
print(f"uploaded {rel}")
|
||||
|
||||
sftp.close()
|
||||
|
||||
print("--- remote build ---")
|
||||
_, stdout, _ = client.exec_command(f"cd {REMOTE}/web-console && npm run build 2>&1", timeout=600)
|
||||
start = time.time()
|
||||
while not stdout.channel.exit_status_ready():
|
||||
if stdout.channel.recv_ready():
|
||||
print(stdout.channel.recv(4096).decode("utf-8", "replace"), end="", flush=True)
|
||||
time.sleep(0.3)
|
||||
tail = stdout.read().decode("utf-8", "replace")
|
||||
if tail.strip():
|
||||
print(tail)
|
||||
code = stdout.channel.recv_exit_status()
|
||||
print(f"build exit {code} in {time.time() - start:.1f}s")
|
||||
|
||||
_, o, _ = client.exec_command(
|
||||
"curl -sS -m 8 -o /dev/null -w 'dashboard=%{http_code}' http://127.0.0.1:8001/hub/dashboard",
|
||||
timeout=15,
|
||||
)
|
||||
print("health:", o.read().decode().strip())
|
||||
|
||||
client.close()
|
||||
return code
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@ -327,6 +327,45 @@ html[data-theme="light"] .chart-surface {
|
||||
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
/* 总览 · 直播工作室 3D 面板 */
|
||||
.studio-scene-shell {
|
||||
perspective: 800px;
|
||||
}
|
||||
|
||||
.studio-scene-shimmer {
|
||||
background: linear-gradient(
|
||||
105deg,
|
||||
transparent 40%,
|
||||
rgba(244, 114, 182, 0.12) 50%,
|
||||
transparent 60%
|
||||
);
|
||||
background-size: 200% 100%;
|
||||
animation: studio-shimmer 1.8s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes studio-shimmer {
|
||||
0% {
|
||||
background-position: 200% 0;
|
||||
}
|
||||
100% {
|
||||
background-position: -200% 0;
|
||||
}
|
||||
}
|
||||
|
||||
.studio-live-badge {
|
||||
animation: studio-live-glow 2.4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes studio-live-glow {
|
||||
0%,
|
||||
100% {
|
||||
box-shadow: 0 0 0 0 rgba(244, 63, 94, 0);
|
||||
}
|
||||
50% {
|
||||
box-shadow: 0 0 12px 2px rgba(244, 63, 94, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
html {
|
||||
scroll-behavior: auto;
|
||||
|
||||
@ -1,176 +1,334 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { MonitorPlay, RefreshCw, Sparkles } from "lucide-react";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
|
||||
type Tr = (zh: string, en: string) => string;
|
||||
|
||||
export function LiveStudioScene3D({ tr }: { tr: Tr }) {
|
||||
const mountRef = useRef<HTMLDivElement>(null);
|
||||
type SceneStatus = "idle" | "loading" | "ready" | "failed";
|
||||
|
||||
function disposeThreeObject(obj: import("three").Object3D) {
|
||||
obj.traverse((child) => {
|
||||
const mesh = child as import("three").Mesh;
|
||||
if (mesh.geometry) mesh.geometry.dispose();
|
||||
const mat = mesh.material;
|
||||
if (Array.isArray(mat)) mat.forEach((m) => m.dispose());
|
||||
else if (mat) mat.dispose();
|
||||
});
|
||||
}
|
||||
|
||||
export function LiveStudioScene3D({
|
||||
tr,
|
||||
className = "",
|
||||
liveActive = 0,
|
||||
onOpenStudio,
|
||||
}: {
|
||||
tr: Tr;
|
||||
className?: string;
|
||||
liveActive?: number;
|
||||
onOpenStudio?: () => void;
|
||||
}) {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
/** Dedicated host — React must never reconcile children here (canvas is appended imperatively). */
|
||||
const canvasHostRef = useRef<HTMLDivElement>(null);
|
||||
const [status, setStatus] = useState<SceneStatus>("idle");
|
||||
const [retryKey, setRetryKey] = useState(0);
|
||||
const liveActiveRef = useRef(liveActive);
|
||||
liveActiveRef.current = liveActive;
|
||||
|
||||
const retry = useCallback(() => {
|
||||
setStatus("idle");
|
||||
setRetryKey((k) => k + 1);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const el = mountRef.current;
|
||||
if (!el) return;
|
||||
const host = canvasHostRef.current;
|
||||
const container = containerRef.current;
|
||||
if (!host || !container) return;
|
||||
|
||||
let disposed = false;
|
||||
let animationId = 0;
|
||||
let teardown: (() => void) | undefined;
|
||||
let hostResizeObserver: ResizeObserver | null = null;
|
||||
let sceneStarted = false;
|
||||
let sceneTeardown: (() => void) | undefined;
|
||||
let bootRaf = 0;
|
||||
|
||||
void import("three").then((THREE) => {
|
||||
if (disposed || !mountRef.current) return;
|
||||
const cleanup = () => {
|
||||
cancelAnimationFrame(animationId);
|
||||
cancelAnimationFrame(bootRaf);
|
||||
hostResizeObserver?.disconnect();
|
||||
sceneTeardown?.();
|
||||
sceneTeardown = undefined;
|
||||
host.replaceChildren();
|
||||
};
|
||||
|
||||
const mount = mountRef.current;
|
||||
const width = Math.max(mount.clientWidth, 280);
|
||||
const height = Math.max(mount.clientHeight, 200);
|
||||
const tryStart = () => {
|
||||
if (disposed || sceneStarted) return;
|
||||
const w = host.clientWidth;
|
||||
const h = host.clientHeight;
|
||||
if (w < 16 || h < 16) return;
|
||||
|
||||
const scene = new THREE.Scene();
|
||||
sceneStarted = true;
|
||||
setStatus("loading");
|
||||
|
||||
const camera = new THREE.PerspectiveCamera(48, width / height, 0.1, 80);
|
||||
camera.position.set(0, 1.1, 7.2);
|
||||
void import("three")
|
||||
.then((THREE) => {
|
||||
if (disposed || !canvasHostRef.current) return;
|
||||
|
||||
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
|
||||
renderer.setPixelRatio(Math.min(typeof window !== "undefined" ? window.devicePixelRatio : 1, 2));
|
||||
renderer.setSize(width, height);
|
||||
renderer.setClearColor(0x000000, 0);
|
||||
mount.appendChild(renderer.domElement);
|
||||
const mount = canvasHostRef.current;
|
||||
const width = mount.clientWidth;
|
||||
const height = mount.clientHeight;
|
||||
|
||||
const hemi = new THREE.HemisphereLight(0xffc4ec, 0x4466ff, 0.85);
|
||||
scene.add(hemi);
|
||||
const dir = new THREE.DirectionalLight(0xffffff, 0.9);
|
||||
dir.position.set(4, 8, 6);
|
||||
scene.add(dir);
|
||||
const back = new THREE.PointLight(0x7cf5ff, 0.6, 20);
|
||||
back.position.set(-3, 2, -2);
|
||||
scene.add(back);
|
||||
const scene = new THREE.Scene();
|
||||
const camera = new THREE.PerspectiveCamera(48, width / height, 0.1, 80);
|
||||
camera.position.set(0, 1.1, 7.2);
|
||||
|
||||
const group = new THREE.Group();
|
||||
let renderer: import("three").WebGLRenderer;
|
||||
try {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true, powerPreference: "high-performance" });
|
||||
} catch {
|
||||
if (!disposed) setStatus("failed");
|
||||
return;
|
||||
}
|
||||
|
||||
const studio = new THREE.Mesh(
|
||||
new THREE.BoxGeometry(3.2, 0.35, 2.2),
|
||||
new THREE.MeshStandardMaterial({
|
||||
color: 0x2a2540,
|
||||
metalness: 0.15,
|
||||
roughness: 0.55,
|
||||
}),
|
||||
);
|
||||
studio.position.y = -0.85;
|
||||
group.add(studio);
|
||||
renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
|
||||
renderer.setSize(width, height, false);
|
||||
renderer.setClearColor(0x000000, 0);
|
||||
|
||||
const ring = new THREE.Mesh(
|
||||
new THREE.TorusGeometry(0.72, 0.09, 12, 48),
|
||||
new THREE.MeshStandardMaterial({
|
||||
color: 0xff3355,
|
||||
emissive: 0x440011,
|
||||
metalness: 0.35,
|
||||
roughness: 0.25,
|
||||
}),
|
||||
);
|
||||
ring.rotation.x = Math.PI / 2;
|
||||
ring.position.set(-0.85, 0.15, 0.2);
|
||||
group.add(ring);
|
||||
const canvas = renderer.domElement;
|
||||
canvas.style.display = "block";
|
||||
canvas.style.width = "100%";
|
||||
canvas.style.height = "100%";
|
||||
mount.replaceChildren(canvas);
|
||||
|
||||
const play = new THREE.Mesh(
|
||||
new THREE.ConeGeometry(0.35, 0.5, 3),
|
||||
new THREE.MeshStandardMaterial({
|
||||
color: 0xffffff,
|
||||
emissive: 0x222222,
|
||||
metalness: 0.2,
|
||||
roughness: 0.3,
|
||||
}),
|
||||
);
|
||||
play.rotation.z = -Math.PI / 2;
|
||||
play.rotation.y = Math.PI;
|
||||
play.position.set(-0.55, 0.18, 0.2);
|
||||
group.add(play);
|
||||
const hemi = new THREE.HemisphereLight(0xffc4ec, 0x4466ff, 0.85);
|
||||
scene.add(hemi);
|
||||
const dir = new THREE.DirectionalLight(0xffffff, 0.9);
|
||||
dir.position.set(4, 8, 6);
|
||||
scene.add(dir);
|
||||
const back = new THREE.PointLight(0x7cf5ff, 0.6, 20);
|
||||
back.position.set(-3, 2, -2);
|
||||
scene.add(back);
|
||||
|
||||
const tk = new THREE.Mesh(
|
||||
new THREE.CylinderGeometry(0.22, 0.28, 0.95, 20),
|
||||
new THREE.MeshStandardMaterial({
|
||||
color: 0x25f4ee,
|
||||
emissive: 0x053038,
|
||||
metalness: 0.25,
|
||||
roughness: 0.35,
|
||||
}),
|
||||
);
|
||||
tk.position.set(1.05, 0.35, -0.15);
|
||||
tk.rotation.z = 0.12;
|
||||
group.add(tk);
|
||||
const group = new THREE.Group();
|
||||
const studioMat = new THREE.MeshStandardMaterial({ color: 0x2a2540, metalness: 0.15, roughness: 0.55 });
|
||||
const ringMat = new THREE.MeshStandardMaterial({
|
||||
color: 0xff3355,
|
||||
emissive: 0x440011,
|
||||
metalness: 0.35,
|
||||
roughness: 0.25,
|
||||
});
|
||||
const playMat = new THREE.MeshStandardMaterial({ color: 0xffffff, emissive: 0x222222, metalness: 0.2, roughness: 0.3 });
|
||||
const tkMat = new THREE.MeshStandardMaterial({ color: 0x25f4ee, emissive: 0x053038, metalness: 0.25, roughness: 0.35 });
|
||||
const tkCapMat = new THREE.MeshStandardMaterial({ color: 0xfe2c55, emissive: 0x220510, metalness: 0.2, roughness: 0.4 });
|
||||
|
||||
const tkCap = new THREE.Mesh(
|
||||
new THREE.SphereGeometry(0.26, 16, 16),
|
||||
new THREE.MeshStandardMaterial({
|
||||
color: 0xfe2c55,
|
||||
emissive: 0x220510,
|
||||
metalness: 0.2,
|
||||
roughness: 0.4,
|
||||
}),
|
||||
);
|
||||
tkCap.position.set(1.05, 0.92, -0.15);
|
||||
group.add(tkCap);
|
||||
const studio = new THREE.Mesh(new THREE.BoxGeometry(3.2, 0.35, 2.2), studioMat);
|
||||
studio.position.y = -0.85;
|
||||
group.add(studio);
|
||||
|
||||
const starGeo = new THREE.BufferGeometry();
|
||||
const starCount = 120;
|
||||
const positions = new Float32Array(starCount * 3);
|
||||
for (let i = 0; i < starCount; i++) {
|
||||
positions[i * 3] = (Math.random() - 0.5) * 14;
|
||||
positions[i * 3 + 1] = (Math.random() - 0.3) * 8;
|
||||
positions[i * 3 + 2] = (Math.random() - 0.5) * 8 - 2;
|
||||
const ring = new THREE.Mesh(new THREE.TorusGeometry(0.72, 0.09, 12, 48), ringMat);
|
||||
ring.rotation.x = Math.PI / 2;
|
||||
ring.position.set(-0.85, 0.15, 0.2);
|
||||
group.add(ring);
|
||||
|
||||
const play = new THREE.Mesh(new THREE.ConeGeometry(0.35, 0.5, 3), playMat);
|
||||
play.rotation.z = -Math.PI / 2;
|
||||
play.rotation.y = Math.PI;
|
||||
play.position.set(-0.55, 0.18, 0.2);
|
||||
group.add(play);
|
||||
|
||||
const tk = new THREE.Mesh(new THREE.CylinderGeometry(0.22, 0.28, 0.95, 20), tkMat);
|
||||
tk.position.set(1.05, 0.35, -0.15);
|
||||
tk.rotation.z = 0.12;
|
||||
group.add(tk);
|
||||
|
||||
const tkCap = new THREE.Mesh(new THREE.SphereGeometry(0.26, 16, 16), tkCapMat);
|
||||
tkCap.position.set(1.05, 0.92, -0.15);
|
||||
group.add(tkCap);
|
||||
|
||||
const starGeo = new THREE.BufferGeometry();
|
||||
const starCount = 120;
|
||||
const positions = new Float32Array(starCount * 3);
|
||||
for (let i = 0; i < starCount; i++) {
|
||||
positions[i * 3] = (Math.random() - 0.5) * 14;
|
||||
positions[i * 3 + 1] = (Math.random() - 0.3) * 8;
|
||||
positions[i * 3 + 2] = (Math.random() - 0.5) * 8 - 2;
|
||||
}
|
||||
starGeo.setAttribute("position", new THREE.BufferAttribute(positions, 3));
|
||||
const starMat = new THREE.PointsMaterial({ color: 0xffffff, size: 0.06, transparent: true, opacity: 0.7 });
|
||||
const stars = new THREE.Points(starGeo, starMat);
|
||||
scene.add(stars);
|
||||
scene.add(group);
|
||||
|
||||
let pointerX = 0;
|
||||
let pointerY = 0;
|
||||
const onPointerMove = (e: PointerEvent) => {
|
||||
const rect = mount.getBoundingClientRect();
|
||||
if (!rect.width || !rect.height) return;
|
||||
pointerX = ((e.clientX - rect.left) / rect.width - 0.5) * 2;
|
||||
pointerY = ((e.clientY - rect.top) / rect.height - 0.5) * 2;
|
||||
};
|
||||
const onPointerLeave = () => {
|
||||
pointerX = 0;
|
||||
pointerY = 0;
|
||||
};
|
||||
container.addEventListener("pointermove", onPointerMove);
|
||||
container.addEventListener("pointerleave", onPointerLeave);
|
||||
|
||||
const resize = () => {
|
||||
if (!canvasHostRef.current || disposed) return;
|
||||
const w = canvasHostRef.current.clientWidth;
|
||||
const h = canvasHostRef.current.clientHeight;
|
||||
if (w < 16 || h < 16) return;
|
||||
camera.aspect = w / h;
|
||||
camera.updateProjectionMatrix();
|
||||
renderer.setSize(w, h, false);
|
||||
};
|
||||
|
||||
const t0 = performance.now();
|
||||
let visible = !document.hidden;
|
||||
const onVis = () => {
|
||||
visible = !document.hidden;
|
||||
};
|
||||
document.addEventListener("visibilitychange", onVis);
|
||||
|
||||
const tick = () => {
|
||||
if (disposed) return;
|
||||
animationId = requestAnimationFrame(tick);
|
||||
if (!visible) return;
|
||||
|
||||
const t = (performance.now() - t0) / 1000;
|
||||
const live = liveActiveRef.current;
|
||||
const livePulse = live > 0 ? 0.5 + Math.sin(t * 4) * 0.5 : 0;
|
||||
|
||||
group.rotation.y = Math.sin(t * 0.35) * 0.25 + t * 0.12 + pointerX * 0.08;
|
||||
group.rotation.x = pointerY * -0.06;
|
||||
group.position.y = Math.sin(t * 0.9) * 0.06;
|
||||
ring.rotation.z = t * 0.4;
|
||||
stars.rotation.y = t * 0.02;
|
||||
|
||||
camera.position.x += (pointerX * 0.35 - camera.position.x) * 0.06;
|
||||
camera.position.y += (1.1 + pointerY * -0.2 - camera.position.y) * 0.06;
|
||||
camera.lookAt(0, 0.1, 0);
|
||||
|
||||
if (live > 0) {
|
||||
ringMat.emissive.setHex(0x440011);
|
||||
ringMat.emissiveIntensity = 0.4 + livePulse * 1.2;
|
||||
tkMat.emissiveIntensity = 0.3 + livePulse * 0.5;
|
||||
} else {
|
||||
ringMat.emissiveIntensity = 1;
|
||||
tkMat.emissiveIntensity = 1;
|
||||
}
|
||||
|
||||
renderer.render(scene, camera);
|
||||
};
|
||||
tick();
|
||||
|
||||
const sceneResizeObserver = new ResizeObserver(resize);
|
||||
sceneResizeObserver.observe(mount);
|
||||
|
||||
if (!disposed) setStatus("ready");
|
||||
|
||||
sceneTeardown = () => {
|
||||
document.removeEventListener("visibilitychange", onVis);
|
||||
container.removeEventListener("pointermove", onPointerMove);
|
||||
container.removeEventListener("pointerleave", onPointerLeave);
|
||||
sceneResizeObserver.disconnect();
|
||||
disposeThreeObject(group);
|
||||
disposeThreeObject(stars);
|
||||
starGeo.dispose();
|
||||
starMat.dispose();
|
||||
renderer.dispose();
|
||||
renderer.forceContextLoss?.();
|
||||
mount.replaceChildren();
|
||||
};
|
||||
})
|
||||
.catch(() => {
|
||||
if (!disposed) setStatus("failed");
|
||||
});
|
||||
};
|
||||
|
||||
let bootAttempts = 0;
|
||||
const boot = () => {
|
||||
if (disposed || sceneStarted) return;
|
||||
bootAttempts += 1;
|
||||
tryStart();
|
||||
if (!sceneStarted && bootAttempts < 120) {
|
||||
bootRaf = requestAnimationFrame(boot);
|
||||
} else if (!sceneStarted && bootAttempts >= 120) {
|
||||
setStatus("failed");
|
||||
}
|
||||
starGeo.setAttribute("position", new THREE.BufferAttribute(positions, 3));
|
||||
const stars = new THREE.Points(
|
||||
starGeo,
|
||||
new THREE.PointsMaterial({ color: 0xffffff, size: 0.06, transparent: true, opacity: 0.7 }),
|
||||
);
|
||||
scene.add(stars);
|
||||
};
|
||||
|
||||
scene.add(group);
|
||||
|
||||
const t0 = performance.now();
|
||||
const tick = () => {
|
||||
if (disposed) return;
|
||||
animationId = requestAnimationFrame(tick);
|
||||
const t = (performance.now() - t0) / 1000;
|
||||
group.rotation.y = Math.sin(t * 0.35) * 0.25 + t * 0.12;
|
||||
group.position.y = Math.sin(t * 0.9) * 0.06;
|
||||
ring.rotation.z = t * 0.4;
|
||||
stars.rotation.y = t * 0.02;
|
||||
renderer.render(scene, camera);
|
||||
};
|
||||
tick();
|
||||
|
||||
const ro = new ResizeObserver(() => {
|
||||
if (!mountRef.current || disposed) return;
|
||||
const w = Math.max(mountRef.current.clientWidth, 280);
|
||||
const h = Math.max(mountRef.current.clientHeight, 200);
|
||||
camera.aspect = w / h;
|
||||
camera.updateProjectionMatrix();
|
||||
renderer.setSize(w, h);
|
||||
});
|
||||
ro.observe(mount);
|
||||
|
||||
teardown = () => {
|
||||
cancelAnimationFrame(animationId);
|
||||
ro.disconnect();
|
||||
renderer.dispose();
|
||||
starGeo.dispose();
|
||||
if (renderer.domElement.parentNode === mount) {
|
||||
mount.removeChild(renderer.domElement);
|
||||
}
|
||||
};
|
||||
hostResizeObserver = new ResizeObserver(() => {
|
||||
if (!sceneStarted) tryStart();
|
||||
});
|
||||
hostResizeObserver.observe(host);
|
||||
boot();
|
||||
|
||||
return () => {
|
||||
disposed = true;
|
||||
cancelAnimationFrame(animationId);
|
||||
teardown?.();
|
||||
cleanup();
|
||||
};
|
||||
}, []);
|
||||
}, [retryKey]);
|
||||
|
||||
return (
|
||||
<div className="flex h-full min-h-[14rem] flex-col">
|
||||
<p className="mb-2 px-1 text-[10px] font-medium uppercase tracking-wider text-fuchsia-200/80">
|
||||
{tr("直播工作室 · 3D", "Live studio · 3D")}
|
||||
</p>
|
||||
<div ref={mountRef} className="relative min-h-[12rem] flex-1 overflow-hidden rounded-xl bg-gradient-to-b from-fuchsia-950/40 to-cyan-950/20 ring-1 ring-white/10" />
|
||||
<div className={`flex min-h-0 flex-1 flex-col ${className}`}>
|
||||
<div className="mb-2 flex shrink-0 items-center justify-between gap-2 px-1">
|
||||
<p className="text-[10px] font-medium uppercase tracking-wider text-fuchsia-200/80">
|
||||
{tr("直播工作室 · 3D", "Live studio · 3D")}
|
||||
</p>
|
||||
{liveActive > 0 ? (
|
||||
<span className="studio-live-badge inline-flex items-center gap-1 rounded-full bg-rose-500/20 px-2 py-0.5 text-[9px] font-bold uppercase tracking-wide text-rose-100 ring-1 ring-rose-400/40">
|
||||
<span className="relative flex h-1.5 w-1.5">
|
||||
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-rose-400 opacity-70" />
|
||||
<span className="relative inline-flex h-1.5 w-1.5 rounded-full bg-rose-400" />
|
||||
</span>
|
||||
LIVE ×{liveActive}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<div
|
||||
ref={containerRef}
|
||||
className="studio-scene-shell relative min-h-0 flex-1 overflow-hidden rounded-xl bg-gradient-to-b from-fuchsia-950/40 to-cyan-950/20 ring-1 ring-white/10"
|
||||
>
|
||||
<div ref={canvasHostRef} className="absolute inset-0" aria-hidden />
|
||||
|
||||
{status === "idle" || status === "loading" ? (
|
||||
<div className="pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-2">
|
||||
<div className="studio-scene-shimmer absolute inset-0 opacity-60" />
|
||||
<Sparkles className="relative h-5 w-5 animate-pulse text-fuchsia-300/70" />
|
||||
<p className="relative text-[10px] text-zinc-500">{tr("加载 3D 场景…", "Loading 3D scene…")}</p>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{status === "failed" ? (
|
||||
<div className="absolute inset-0 flex flex-col items-center justify-center gap-3 px-4 text-center">
|
||||
<MonitorPlay className="h-8 w-8 text-fuchsia-300/70" />
|
||||
<p className="text-[11px] text-zinc-400">{tr("WebGL 不可用,已显示占位预览", "WebGL unavailable — showing placeholder")}</p>
|
||||
<button
|
||||
type="button"
|
||||
onClick={retry}
|
||||
className="inline-flex items-center gap-1.5 rounded-lg border border-fuchsia-400/30 bg-fuchsia-500/10 px-3 py-1.5 text-[10px] font-semibold text-fuchsia-100 transition hover:bg-fuchsia-500/20"
|
||||
>
|
||||
<RefreshCw className="h-3 w-3" />
|
||||
{tr("重试", "Retry")}
|
||||
</button>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{onOpenStudio ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onOpenStudio}
|
||||
className="absolute bottom-2 right-2 z-10 inline-flex items-center gap-1 rounded-lg border border-white/10 bg-black/45 px-2.5 py-1 text-[10px] font-semibold text-zinc-200 backdrop-blur-sm transition hover:border-fuchsia-400/35 hover:bg-black/60 hover:text-white"
|
||||
>
|
||||
<Sparkles className="h-3 w-3 text-fuchsia-300" />
|
||||
{tr("进入工作室", "Open studio")}
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,107 +1,173 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
|
||||
export type SnapshotLite = {
|
||||
cpu_load?: { "1m"?: number; "5m"?: number; "15m"?: number };
|
||||
disk?: { total?: number; free?: number; used?: number };
|
||||
memory?: { total?: number; available?: number; free?: number };
|
||||
uptime_seconds?: number;
|
||||
};
|
||||
|
||||
type HistoryPoint = {
|
||||
t: number;
|
||||
cpu1m: number;
|
||||
memPct: number;
|
||||
diskPct: number;
|
||||
};
|
||||
|
||||
const HISTORY_CAP = 24;
|
||||
|
||||
function pct(used: number, total: number) {
|
||||
if (!total) return 0;
|
||||
return Math.min(100, Math.max(0, (used / total) * 100));
|
||||
}
|
||||
|
||||
export default function OverviewCharts({
|
||||
snapshot,
|
||||
theme,
|
||||
tr,
|
||||
compact = false,
|
||||
}: {
|
||||
snapshot: SnapshotLite | null;
|
||||
theme: "dark" | "light";
|
||||
tr: (zh: string, en: string) => string;
|
||||
compact?: boolean;
|
||||
}) {
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const mainRef = useRef<HTMLDivElement>(null);
|
||||
const sparkRef = useRef<HTMLDivElement>(null);
|
||||
const [history, setHistory] = useState<HistoryPoint[]>([]);
|
||||
|
||||
const metrics = useMemo(() => {
|
||||
if (!snapshot) return null;
|
||||
const l1 = snapshot.cpu_load?.["1m"] ?? 0;
|
||||
const l5 = snapshot.cpu_load?.["5m"] ?? 0;
|
||||
const l15 = snapshot.cpu_load?.["15m"] ?? 0;
|
||||
const memTotal = snapshot.memory?.total || 1;
|
||||
const memAvail = snapshot.memory?.available ?? snapshot.memory?.free ?? 0;
|
||||
const memUsed = Math.max(0, memTotal - memAvail);
|
||||
const diskTotal = snapshot.disk?.total || 1;
|
||||
const diskFree = snapshot.disk?.free || 0;
|
||||
const diskUsed = Math.max(0, diskTotal - diskFree);
|
||||
return {
|
||||
l1,
|
||||
l5,
|
||||
l15,
|
||||
memUsed,
|
||||
memAvail,
|
||||
memTotal,
|
||||
diskUsed,
|
||||
diskFree,
|
||||
diskTotal,
|
||||
memPct: pct(memUsed, memTotal),
|
||||
diskPct: pct(diskUsed, diskTotal),
|
||||
};
|
||||
}, [snapshot]);
|
||||
|
||||
useEffect(() => {
|
||||
const el = ref.current;
|
||||
if (!el || !snapshot) return;
|
||||
if (!metrics) return;
|
||||
const now = Date.now();
|
||||
setHistory((prev) => {
|
||||
const next = [...prev, { t: now, cpu1m: metrics.l1, memPct: metrics.memPct, diskPct: metrics.diskPct }];
|
||||
return next.length > HISTORY_CAP ? next.slice(-HISTORY_CAP) : next;
|
||||
});
|
||||
}, [metrics?.l1, metrics?.memPct, metrics?.diskPct, metrics]);
|
||||
|
||||
useEffect(() => {
|
||||
const el = mainRef.current;
|
||||
if (!el || !metrics) return;
|
||||
let disposed = false;
|
||||
let chart: import("echarts").ECharts | null = null;
|
||||
const fg = theme === "light" ? "#0f172a" : "#e2e8f0";
|
||||
const muted = theme === "light" ? "#64748b" : "#94a3b8";
|
||||
const gridLine = theme === "light" ? "rgba(15,23,42,0.1)" : "rgba(148,163,184,0.12)";
|
||||
const fg = theme === "light" ? "#0f172a" : "#f4f4f5";
|
||||
const muted = theme === "light" ? "#64748b" : "#a1a1aa";
|
||||
const gridLine = theme === "light" ? "rgba(15,23,42,0.08)" : "rgba(255,255,255,0.06)";
|
||||
|
||||
import("echarts").then((echarts) => {
|
||||
if (disposed || !ref.current) return;
|
||||
chart = echarts.init(ref.current, undefined, { renderer: "canvas" });
|
||||
const l1 = snapshot.cpu_load?.["1m"] ?? 0;
|
||||
const l5 = snapshot.cpu_load?.["5m"] ?? 0;
|
||||
const l15 = snapshot.cpu_load?.["15m"] ?? 0;
|
||||
const memTotal = snapshot.memory?.total || 1;
|
||||
const memAvail = snapshot.memory?.available ?? snapshot.memory?.free ?? 0;
|
||||
const memUsed = Math.max(0, memTotal - memAvail);
|
||||
const diskTotal = snapshot.disk?.total || 1;
|
||||
const diskFree = snapshot.disk?.free || 0;
|
||||
const diskUsed = Math.max(0, diskTotal - diskFree);
|
||||
|
||||
if (disposed || !mainRef.current) return;
|
||||
chart = echarts.init(mainRef.current, undefined, { renderer: "canvas" });
|
||||
chart.setOption({
|
||||
animationDurationUpdate: 450,
|
||||
textStyle: { color: fg },
|
||||
title: {
|
||||
text: tr("无人直播节点 · 资源", "Unmanned live · resources"),
|
||||
left: 12,
|
||||
top: 8,
|
||||
textStyle: { color: fg, fontSize: 12, fontWeight: 600 },
|
||||
},
|
||||
tooltip: { trigger: "axis" },
|
||||
grid: { left: 52, right: "48%", top: 52, bottom: 36 },
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: ["1m", "5m", "15m"],
|
||||
axisLabel: { color: muted, fontSize: 10 },
|
||||
axisLine: { lineStyle: { color: gridLine } },
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
name: tr("负载", "Load"),
|
||||
nameTextStyle: { color: muted, fontSize: 10 },
|
||||
axisLabel: { color: muted, fontSize: 10 },
|
||||
splitLine: { lineStyle: { color: gridLine } },
|
||||
},
|
||||
animationDurationUpdate: 380,
|
||||
textStyle: { color: fg, fontFamily: "ui-monospace, monospace" },
|
||||
tooltip: { trigger: "item", backgroundColor: theme === "light" ? "#fff" : "#18181b", borderColor: gridLine, textStyle: { color: fg, fontSize: 11 } },
|
||||
series: [
|
||||
{
|
||||
name: tr("CPU", "CPU"),
|
||||
type: "bar",
|
||||
data: [l1, l5, l15],
|
||||
barMaxWidth: 28,
|
||||
itemStyle: {
|
||||
borderRadius: [6, 6, 0, 0],
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: "#22d3ee" },
|
||||
{ offset: 1, color: "#6366f1" },
|
||||
]),
|
||||
type: "gauge",
|
||||
center: ["18%", "52%"],
|
||||
radius: "62%",
|
||||
min: 0,
|
||||
max: Math.max(4, Math.ceil(metrics.l1 * 1.4)),
|
||||
splitNumber: 4,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
width: 10,
|
||||
color: [
|
||||
[0.45, "#22d3ee"],
|
||||
[0.75, "#a78bfa"],
|
||||
[1, "#fb7185"],
|
||||
],
|
||||
},
|
||||
},
|
||||
pointer: { width: 4, length: "58%", itemStyle: { color: fg } },
|
||||
axisTick: { show: false },
|
||||
splitLine: { length: 8, lineStyle: { color: gridLine } },
|
||||
axisLabel: { color: muted, fontSize: 9, distance: 14 },
|
||||
detail: {
|
||||
formatter: (v: number) => `${v.toFixed(2)}`,
|
||||
color: fg,
|
||||
fontSize: 14,
|
||||
fontWeight: 700,
|
||||
offsetCenter: [0, "72%"],
|
||||
},
|
||||
title: { show: true, offsetCenter: [0, "92%"], color: muted, fontSize: 10, text: tr("CPU 1m", "CPU 1m") },
|
||||
data: [{ value: metrics.l1 }],
|
||||
},
|
||||
{
|
||||
name: tr("内存", "RAM"),
|
||||
type: "pie",
|
||||
radius: ["26%", "40%"],
|
||||
center: ["78%", "38%"],
|
||||
label: { color: fg, fontSize: 9 },
|
||||
radius: ["46%", "62%"],
|
||||
center: ["50%", "52%"],
|
||||
label: { show: false },
|
||||
data: [
|
||||
{ value: memUsed, name: tr("已用", "Used") },
|
||||
{ value: Math.max(0, memAvail), name: tr("可用", "Free") },
|
||||
{ value: metrics.memUsed, name: tr("内存已用", "RAM used"), itemStyle: { color: "#818cf8" } },
|
||||
{ value: Math.max(0, metrics.memAvail), name: tr("内存可用", "RAM free"), itemStyle: { color: theme === "light" ? "#e2e8f0" : "#27272a" } },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: tr("磁盘", "Disk"),
|
||||
type: "pie",
|
||||
radius: ["20%", "32%"],
|
||||
center: ["78%", "72%"],
|
||||
label: { color: fg, fontSize: 9 },
|
||||
radius: ["46%", "62%"],
|
||||
center: ["82%", "52%"],
|
||||
label: { show: false },
|
||||
data: [
|
||||
{ value: diskUsed, name: tr("已用", "Used") },
|
||||
{ value: Math.max(0, diskFree), name: tr("空闲", "Free") },
|
||||
{ value: metrics.diskUsed, name: tr("磁盘已用", "Disk used"), itemStyle: { color: "#34d399" } },
|
||||
{ value: Math.max(0, metrics.diskFree), name: tr("磁盘空闲", "Disk free"), itemStyle: { color: theme === "light" ? "#e2e8f0" : "#27272a" } },
|
||||
],
|
||||
},
|
||||
],
|
||||
graphic: [
|
||||
{
|
||||
type: "text",
|
||||
left: "center",
|
||||
top: "52%",
|
||||
style: { text: `${metrics.memPct.toFixed(0)}%`, fill: fg, font: "bold 13px ui-monospace", textAlign: "center" },
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
left: "74%",
|
||||
top: "52%",
|
||||
style: { text: `${metrics.diskPct.toFixed(0)}%`, fill: fg, font: "bold 13px ui-monospace", textAlign: "center" },
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
left: "42%",
|
||||
top: "78%",
|
||||
style: { text: tr("内存", "RAM"), fill: muted, font: "10px sans-serif", textAlign: "center" },
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
left: "74%",
|
||||
top: "78%",
|
||||
style: { text: tr("磁盘", "Disk"), fill: muted, font: "10px sans-serif", textAlign: "center" },
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
@ -112,17 +178,88 @@ export default function OverviewCharts({
|
||||
ro.disconnect();
|
||||
chart?.dispose();
|
||||
};
|
||||
}, [snapshot, theme, tr]);
|
||||
}, [metrics, theme, tr]);
|
||||
|
||||
if (!snapshot) return null;
|
||||
useEffect(() => {
|
||||
const el = sparkRef.current;
|
||||
if (!el || history.length < 2) return;
|
||||
let disposed = false;
|
||||
let chart: import("echarts").ECharts | null = null;
|
||||
const muted = theme === "light" ? "#94a3b8" : "#71717a";
|
||||
const gridLine = theme === "light" ? "rgba(15,23,42,0.06)" : "rgba(255,255,255,0.05)";
|
||||
|
||||
import("echarts").then((echarts) => {
|
||||
if (disposed || !sparkRef.current) return;
|
||||
chart = echarts.init(sparkRef.current, undefined, { renderer: "canvas" });
|
||||
const labels = history.map((_, i) => String(i + 1));
|
||||
chart.setOption({
|
||||
animationDurationUpdate: 300,
|
||||
grid: { left: 36, right: 12, top: 18, bottom: 22 },
|
||||
tooltip: { trigger: "axis", textStyle: { fontSize: 10 } },
|
||||
legend: { top: 0, right: 0, textStyle: { color: muted, fontSize: 9 }, itemWidth: 8, itemHeight: 8 },
|
||||
xAxis: { type: "category", data: labels, show: false },
|
||||
yAxis: { type: "value", splitLine: { lineStyle: { color: gridLine } }, axisLabel: { color: muted, fontSize: 9 } },
|
||||
series: [
|
||||
{
|
||||
name: "CPU",
|
||||
type: "line",
|
||||
smooth: true,
|
||||
symbol: "none",
|
||||
lineStyle: { width: 2, color: "#22d3ee" },
|
||||
areaStyle: { color: "rgba(34,211,238,0.12)" },
|
||||
data: history.map((p) => p.cpu1m),
|
||||
},
|
||||
{
|
||||
name: tr("内存%", "RAM%"),
|
||||
type: "line",
|
||||
smooth: true,
|
||||
symbol: "none",
|
||||
lineStyle: { width: 2, color: "#a78bfa" },
|
||||
data: history.map((p) => Number(p.memPct.toFixed(1))),
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
const ro = new ResizeObserver(() => chart?.resize());
|
||||
ro.observe(el);
|
||||
return () => {
|
||||
disposed = true;
|
||||
ro.disconnect();
|
||||
chart?.dispose();
|
||||
};
|
||||
}, [history, theme, tr]);
|
||||
|
||||
if (!snapshot || !metrics) {
|
||||
return (
|
||||
<div className={`animate-pulse rounded-2xl border border-white/[0.06] bg-white/[0.03] ${compact ? "h-48" : "h-64"}`} />
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mt-4">
|
||||
<p className="mb-2 text-xs opacity-70">{tr("ECharts 动态图表", "ECharts live charts")}</p>
|
||||
<div className={`flex flex-col ${compact ? "gap-2" : "gap-3"}`}>
|
||||
<div className="flex flex-wrap items-end justify-between gap-2 px-1">
|
||||
<div>
|
||||
<p className="text-xs font-semibold tracking-wide text-zinc-300">{tr("节点资源", "Node resources")}</p>
|
||||
<p className="mt-0.5 text-[10px] text-zinc-500">
|
||||
{tr("负载", "Load")} {metrics.l1.toFixed(2)} / {metrics.l5.toFixed(2)} / {metrics.l15.toFixed(2)} ·{" "}
|
||||
{tr("内存", "RAM")} {metrics.memPct.toFixed(0)}% · {tr("磁盘", "Disk")} {metrics.diskPct.toFixed(0)}%
|
||||
</p>
|
||||
</div>
|
||||
{!compact ? (
|
||||
<div className="flex gap-3 font-mono text-[10px] text-zinc-500">
|
||||
<span>5m {metrics.l5.toFixed(2)}</span>
|
||||
<span>15m {metrics.l15.toFixed(2)}</span>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
<div
|
||||
ref={ref}
|
||||
className="chart-surface h-64 w-full rounded-2xl border border-white/[0.08] bg-black/15 md:h-72"
|
||||
ref={mainRef}
|
||||
className={`chart-surface w-full shrink-0 rounded-2xl border border-white/[0.06] bg-black/10 ${compact ? "h-[168px]" : "h-52 md:h-56"}`}
|
||||
/>
|
||||
{!compact && history.length >= 2 ? (
|
||||
<div ref={sparkRef} className="chart-surface h-28 w-full shrink-0 rounded-xl border border-white/[0.05] bg-black/5" />
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
727
d2ypp2/web-console/components/live-product/DashboardOverview.tsx
Normal file
727
d2ypp2/web-console/components/live-product/DashboardOverview.tsx
Normal file
@ -0,0 +1,727 @@
|
||||
"use client";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
import {
|
||||
Activity,
|
||||
ArrowUpRight,
|
||||
ChevronDown,
|
||||
CirclePlay,
|
||||
Cpu,
|
||||
ExternalLink,
|
||||
HardDrive,
|
||||
MonitorPlay,
|
||||
Radio,
|
||||
Server,
|
||||
Smartphone,
|
||||
Sparkles,
|
||||
Wifi,
|
||||
} from "lucide-react";
|
||||
import { useMemo, useState, type ReactNode } from "react";
|
||||
|
||||
import OverviewCharts from "@/components/OverviewCharts";
|
||||
import { LiveStudioScene3D } from "@/components/LiveStudioScene3D";
|
||||
import { formatBytes, formatPercent, formatRate, formatUptime, statusLabel, statusPill } from "@/lib/dashboardFormat";
|
||||
import { normalizeBrowserReachableHttpUrl } from "@/lib/panelUrls";
|
||||
import type { NekoBrowserLink } from "@/lib/nekoLinks";
|
||||
|
||||
type PortalTheme = "dark" | "light";
|
||||
type ViewKey =
|
||||
| "dashboard"
|
||||
| "services"
|
||||
| "live_youtube"
|
||||
| "live_tiktok"
|
||||
| "android"
|
||||
| "studio"
|
||||
| "network"
|
||||
| "settings";
|
||||
|
||||
type TFn = (zh: string, en: string) => string;
|
||||
|
||||
type HubDashboard = {
|
||||
snapshot?: {
|
||||
cpu_load?: { "1m"?: number; "5m"?: number; "15m"?: number };
|
||||
memory?: { total?: number; available?: number; free?: number };
|
||||
disk?: { total?: number; free?: number; used?: number };
|
||||
netdata?: { available?: boolean; version?: string };
|
||||
uptime_seconds?: number;
|
||||
};
|
||||
hardware?: Record<string, unknown>;
|
||||
stack?: {
|
||||
hostname?: string;
|
||||
mdns_host?: string;
|
||||
machine?: string;
|
||||
kernel?: string;
|
||||
python?: string;
|
||||
ips?: string[];
|
||||
quick_links?: Record<string, string>;
|
||||
neko_login?: {
|
||||
user_login?: string;
|
||||
user_password?: string;
|
||||
admin_login?: string;
|
||||
admin_password?: string;
|
||||
note_zh?: string;
|
||||
};
|
||||
};
|
||||
services?: Array<{
|
||||
service_id: string;
|
||||
label: string;
|
||||
description: string;
|
||||
available: boolean;
|
||||
running: boolean;
|
||||
status: string;
|
||||
url?: string;
|
||||
}>;
|
||||
live?: {
|
||||
backend_mode?: string;
|
||||
processes?: Array<{ pm2: string; label?: string; process_status?: string; script?: string }>;
|
||||
};
|
||||
network?: {
|
||||
interfaces?: Array<{
|
||||
name?: string;
|
||||
rx_bytes?: number;
|
||||
tx_bytes?: number;
|
||||
rx_bps?: number;
|
||||
tx_bps?: number;
|
||||
operstate?: string;
|
||||
speed_mbps?: number | null;
|
||||
}>;
|
||||
total_rx_bytes?: number;
|
||||
total_tx_bytes?: number;
|
||||
total_rx_bps?: number;
|
||||
total_tx_bps?: number;
|
||||
};
|
||||
live_events?: {
|
||||
pm2_tail?: string[];
|
||||
process_digest?: Array<{ pm2?: string; label?: string; status?: string }>;
|
||||
};
|
||||
probes?: {
|
||||
srs?: {
|
||||
port?: number;
|
||||
api_port?: number;
|
||||
api_ok?: boolean;
|
||||
tcp?: { reachable?: boolean; latency_ms?: number };
|
||||
http?: { http_code?: number; latency_ms?: number; error?: string; reachable?: boolean };
|
||||
};
|
||||
neko?: {
|
||||
port?: number;
|
||||
tcp?: { reachable?: boolean };
|
||||
http?: { http_code?: number; reachable?: boolean; error?: string };
|
||||
instances?: Array<{ id?: number; port?: number; tcp?: { reachable?: boolean }; http?: { http_code?: number } }>;
|
||||
running_count?: number;
|
||||
required_count?: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
type DeploymentReport = {
|
||||
ready?: boolean;
|
||||
pass_count?: number;
|
||||
total_count?: number;
|
||||
required_total?: number;
|
||||
mdns_enabled?: boolean;
|
||||
live_edge_enabled?: boolean;
|
||||
failing_checks?: Array<{ id: string; label: string; detail?: string }>;
|
||||
hints?: string[];
|
||||
urls?: Record<string, string>;
|
||||
};
|
||||
|
||||
const QUICK_NAV: Array<{ id: ViewKey; zh: string; en: string; icon: typeof Radio; accent: string }> = [
|
||||
{ id: "live_youtube", zh: "YouTube 无人直播", en: "YouTube Live", icon: Radio, accent: "from-rose-500/20 to-violet-500/10 text-rose-100 ring-rose-500/25" },
|
||||
{ id: "live_tiktok", zh: "TikTok HDMI", en: "TikTok HDMI", icon: MonitorPlay, accent: "from-cyan-500/20 to-sky-500/10 text-cyan-100 ring-cyan-500/25" },
|
||||
{ id: "android", zh: "安卓投屏", en: "Android", icon: Smartphone, accent: "from-emerald-500/20 to-teal-500/10 text-emerald-100 ring-emerald-500/25" },
|
||||
{ id: "services", zh: "服务编排", en: "Services", icon: Server, accent: "from-indigo-500/20 to-violet-500/10 text-indigo-100 ring-indigo-500/25" },
|
||||
{ id: "network", zh: "网络 / WG", en: "Network", icon: Wifi, accent: "from-amber-500/20 to-orange-500/10 text-amber-100 ring-amber-500/25" },
|
||||
{ id: "studio", zh: "工作室", en: "Studio", icon: Sparkles, accent: "from-fuchsia-500/20 to-pink-500/10 text-fuchsia-100 ring-fuchsia-500/25" },
|
||||
];
|
||||
|
||||
const PINNED_LINK_KEYS = [
|
||||
"control_plane",
|
||||
"netdata",
|
||||
"filebrowser",
|
||||
"webtty",
|
||||
"neko_browser",
|
||||
"srs_http",
|
||||
"youtube_events",
|
||||
] as const;
|
||||
|
||||
function ringColor(pct: number) {
|
||||
if (pct >= 90) return "stroke-rose-400";
|
||||
if (pct >= 75) return "stroke-amber-400";
|
||||
return "stroke-cyan-400";
|
||||
}
|
||||
|
||||
function MetricRing({
|
||||
label,
|
||||
value,
|
||||
sub,
|
||||
pct,
|
||||
icon: Icon,
|
||||
theme,
|
||||
}: {
|
||||
label: string;
|
||||
value: string;
|
||||
sub: string;
|
||||
pct?: number;
|
||||
icon: typeof Cpu;
|
||||
theme: PortalTheme;
|
||||
}) {
|
||||
const r = 18;
|
||||
const c = 2 * Math.PI * r;
|
||||
const dash = pct != null ? (pct / 100) * c : 0;
|
||||
return (
|
||||
<div
|
||||
className={`group relative overflow-hidden rounded-2xl border p-3.5 transition hover:-translate-y-0.5 ${
|
||||
theme === "light"
|
||||
? "border-slate-200/90 bg-white/90 shadow-sm shadow-slate-200/40"
|
||||
: "border-white/[0.07] bg-gradient-to-br from-white/[0.06] to-transparent shadow-lg shadow-black/20"
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<Icon className={`h-4 w-4 shrink-0 ${theme === "light" ? "text-violet-600" : "text-violet-300/90"}`} />
|
||||
<p className="text-[10px] font-semibold uppercase tracking-wider text-zinc-500">{label}</p>
|
||||
</div>
|
||||
<p className={`mt-2 font-mono text-xl font-bold leading-none ${theme === "light" ? "text-slate-900" : "text-white"}`}>{value}</p>
|
||||
<p className="mt-1 text-[10px] text-zinc-500">{sub}</p>
|
||||
</div>
|
||||
{pct != null ? (
|
||||
<svg className="h-11 w-11 shrink-0 -rotate-90" viewBox="0 0 44 44" aria-hidden>
|
||||
<circle cx="22" cy="22" r={r} fill="none" className="stroke-white/10" strokeWidth="4" />
|
||||
<circle
|
||||
cx="22"
|
||||
cy="22"
|
||||
r={r}
|
||||
fill="none"
|
||||
className={`${ringColor(pct)} transition-all duration-500`}
|
||||
strokeWidth="4"
|
||||
strokeDasharray={`${dash} ${c}`}
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
<text x="22" y="24" textAnchor="middle" className="fill-zinc-400 text-[8px] font-bold rotate-90 origin-center">
|
||||
{pct}%
|
||||
</text>
|
||||
</svg>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Section({
|
||||
id,
|
||||
title,
|
||||
subtitle,
|
||||
defaultOpen = true,
|
||||
theme,
|
||||
children,
|
||||
badge,
|
||||
}: {
|
||||
id: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
defaultOpen?: boolean;
|
||||
theme: PortalTheme;
|
||||
children: ReactNode;
|
||||
badge?: ReactNode;
|
||||
}) {
|
||||
const [open, setOpen] = useState(defaultOpen);
|
||||
return (
|
||||
<section id={id} className={`overflow-hidden rounded-2xl border ${theme === "light" ? "border-slate-200/90 bg-white/80" : "border-white/[0.07] bg-zinc-950/35"}`}>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setOpen((v) => !v)}
|
||||
className={`flex w-full items-center gap-3 px-4 py-3.5 text-left transition ${
|
||||
theme === "light" ? "hover:bg-slate-50" : "hover:bg-white/[0.03]"
|
||||
}`}
|
||||
aria-expanded={open}
|
||||
>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<h3 className={`text-sm font-semibold ${theme === "light" ? "text-slate-900" : "text-white"}`}>{title}</h3>
|
||||
{badge}
|
||||
</div>
|
||||
{subtitle ? <p className="mt-0.5 text-[11px] text-zinc-500">{subtitle}</p> : null}
|
||||
</div>
|
||||
<ChevronDown className={`h-4 w-4 shrink-0 text-zinc-500 transition ${open ? "rotate-180" : ""}`} />
|
||||
</button>
|
||||
{open ? <div className="border-t border-white/[0.05] px-4 pb-4 pt-3">{children}</div> : null}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
function DashboardSkeleton({ theme }: { theme: PortalTheme }) {
|
||||
return (
|
||||
<div className="space-y-4 animate-pulse">
|
||||
<div className={`h-28 rounded-2xl border ${theme === "light" ? "bg-slate-100" : "bg-white/[0.04]"}`} />
|
||||
<div className="grid gap-3 sm:grid-cols-2 xl:grid-cols-4">
|
||||
{Array.from({ length: 4 }).map((_, i) => (
|
||||
<div key={i} className={`h-24 rounded-2xl border ${theme === "light" ? "bg-slate-100" : "bg-white/[0.04]"}`} />
|
||||
))}
|
||||
</div>
|
||||
<div className={`h-72 rounded-2xl border ${theme === "light" ? "bg-slate-100" : "bg-white/[0.04]"}`} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function DashboardOverview({
|
||||
dash,
|
||||
deployCheck,
|
||||
dashErr,
|
||||
loading,
|
||||
theme,
|
||||
t,
|
||||
onNavigate,
|
||||
nekoLinks,
|
||||
nekoPortsLabel,
|
||||
showStreamProbes,
|
||||
quickLinks,
|
||||
}: {
|
||||
dash: HubDashboard | null;
|
||||
deployCheck: DeploymentReport | null;
|
||||
dashErr: string | null;
|
||||
loading: boolean;
|
||||
theme: PortalTheme;
|
||||
t: TFn;
|
||||
onNavigate: (view: ViewKey) => void;
|
||||
nekoLinks: NekoBrowserLink[];
|
||||
nekoPortsLabel: string;
|
||||
showStreamProbes: boolean;
|
||||
quickLinks: Record<string, string>;
|
||||
}) {
|
||||
const onlineServices = dash?.services?.filter((s) => s.running).length ?? 0;
|
||||
const totalServices = dash?.services?.length ?? 0;
|
||||
const memTotal = dash?.snapshot?.memory?.total || 0;
|
||||
const memAvail = dash?.snapshot?.memory?.available ?? dash?.snapshot?.memory?.free ?? 0;
|
||||
const memUsed = Math.max(0, memTotal - memAvail);
|
||||
const diskTotal = dash?.snapshot?.disk?.total || 0;
|
||||
const diskFree = dash?.snapshot?.disk?.free || 0;
|
||||
const diskUsed = Math.max(0, diskTotal - diskFree);
|
||||
|
||||
const liveRows = dash?.live?.processes || [];
|
||||
const digest = dash?.live_events?.process_digest || [];
|
||||
const liveActive = digest.filter((r) => {
|
||||
const s = (r.status || "").toLowerCase();
|
||||
return s === "online" || s === "running" || s === "streaming";
|
||||
}).length;
|
||||
|
||||
const pinnedLinks = useMemo(
|
||||
() =>
|
||||
PINNED_LINK_KEYS.map((key) => ({ key, url: quickLinks[key] }))
|
||||
.filter((row) => row.url && /^https?:\/\//i.test(row.url)),
|
||||
[quickLinks],
|
||||
);
|
||||
|
||||
const criticalServices = useMemo(
|
||||
() =>
|
||||
(dash?.services || [])
|
||||
.filter((s) => ["live-console", "live-edge", "srs", "neko", "shellcrash"].some((id) => s.service_id.includes(id.replace("live-", "")) || s.service_id === id))
|
||||
.slice(0, 6),
|
||||
[dash?.services],
|
||||
);
|
||||
|
||||
if (loading && !dash) return <DashboardSkeleton theme={theme} />;
|
||||
|
||||
return (
|
||||
<div className="space-y-5">
|
||||
{dashErr ? (
|
||||
<div className="rounded-2xl border border-rose-500/25 bg-rose-950/20 p-4 text-sm text-rose-200">
|
||||
{t("无法加载仪表盘:", "Dashboard error: ")}
|
||||
{dashErr}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* Hero command strip */}
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 10 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
className={`relative overflow-hidden rounded-2xl border p-4 sm:p-5 ${
|
||||
theme === "light"
|
||||
? "border-violet-200/80 bg-gradient-to-br from-violet-50 via-white to-cyan-50 shadow-sm"
|
||||
: "border-violet-500/20 bg-gradient-to-br from-violet-600/10 via-zinc-950/80 to-cyan-500/10"
|
||||
}`}
|
||||
>
|
||||
<div className="pointer-events-none absolute -right-8 -top-8 h-40 w-40 rounded-full bg-fuchsia-500/15 blur-3xl" />
|
||||
<div className="pointer-events-none absolute -bottom-10 left-1/3 h-32 w-32 rounded-full bg-cyan-500/10 blur-3xl" />
|
||||
<div className="relative flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
|
||||
<div className="min-w-0">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<span className="inline-flex items-center gap-1.5 rounded-full bg-emerald-500/15 px-2.5 py-0.5 text-[10px] font-semibold text-emerald-200 ring-1 ring-emerald-500/30">
|
||||
<span className="relative flex h-2 w-2">
|
||||
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-60" />
|
||||
<span className="relative inline-flex h-2 w-2 rounded-full bg-emerald-400" />
|
||||
</span>
|
||||
{dash?.stack?.hostname || "live"}
|
||||
</span>
|
||||
{deployCheck?.ready ? (
|
||||
<span className="rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-200 ring-1 ring-emerald-500/20">
|
||||
{t("交付就绪", "Deploy ready")}
|
||||
</span>
|
||||
) : deployCheck ? (
|
||||
<span className="rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-200 ring-1 ring-amber-500/20">
|
||||
{t("待验收", "Needs checks")}
|
||||
</span>
|
||||
) : null}
|
||||
{liveActive > 0 ? (
|
||||
<span className="rounded-full bg-rose-500/15 px-2 py-0.5 text-[10px] font-semibold text-rose-100 ring-1 ring-rose-500/25">
|
||||
{liveActive} {t("路直播活跃", "live lanes active")}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
<h2 className={`mt-2 text-lg font-bold tracking-tight sm:text-xl ${theme === "light" ? "text-slate-900" : "text-white"}`}>
|
||||
{dash?.stack?.mdns_host || "live.local"}
|
||||
<span className={`ml-2 text-sm font-normal ${theme === "light" ? "text-slate-500" : "text-zinc-500"}`}>
|
||||
{(dash?.stack?.ips || []).join(" · ") || "—"}
|
||||
</span>
|
||||
</h2>
|
||||
<p className="mt-1 text-[11px] text-zinc-500">
|
||||
{dash?.stack?.machine} · {dash?.stack?.kernel} · Python {dash?.stack?.python || "—"}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{pinnedLinks.slice(0, 4).map((link) => (
|
||||
<a
|
||||
key={link.key}
|
||||
href={normalizeBrowserReachableHttpUrl(link.url)}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className={`inline-flex items-center gap-1.5 rounded-xl border px-3 py-2 text-[11px] font-medium transition hover:-translate-y-0.5 ${
|
||||
theme === "light"
|
||||
? "border-slate-200 bg-white text-slate-700 shadow-sm"
|
||||
: "border-white/10 bg-black/30 text-zinc-200 hover:bg-black/45"
|
||||
}`}
|
||||
>
|
||||
{link.key.replace(/_/g, " ")}
|
||||
<ExternalLink className="h-3 w-3 opacity-60" />
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
|
||||
{/* Quick nav */}
|
||||
<div className="grid grid-cols-2 gap-2 sm:grid-cols-3 xl:grid-cols-6">
|
||||
{QUICK_NAV.map((item, i) => (
|
||||
<motion.button
|
||||
key={item.id}
|
||||
type="button"
|
||||
initial={{ opacity: 0, y: 8 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ delay: i * 0.04 }}
|
||||
whileHover={{ y: -2 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
onClick={() => onNavigate(item.id)}
|
||||
className={`flex items-center gap-2 rounded-xl border bg-gradient-to-br px-3 py-3 text-left text-[11px] font-semibold ring-1 transition ${item.accent}`}
|
||||
>
|
||||
<item.icon className="h-4 w-4 shrink-0 opacity-90" />
|
||||
<span className="line-clamp-2 leading-snug">{t(item.zh, item.en)}</span>
|
||||
<ArrowUpRight className="ml-auto h-3.5 w-3.5 shrink-0 opacity-50" />
|
||||
</motion.button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* KPI rings */}
|
||||
<div className="grid gap-2 sm:grid-cols-2 xl:grid-cols-4">
|
||||
<MetricRing
|
||||
theme={theme}
|
||||
icon={Cpu}
|
||||
label={t("CPU 1m", "CPU 1m")}
|
||||
value={dash?.snapshot?.cpu_load?.["1m"]?.toFixed(2) ?? "—"}
|
||||
sub={`5m ${dash?.snapshot?.cpu_load?.["5m"]?.toFixed(2) ?? "—"} · 15m ${dash?.snapshot?.cpu_load?.["15m"]?.toFixed(2) ?? "—"}`}
|
||||
/>
|
||||
<MetricRing
|
||||
theme={theme}
|
||||
icon={Activity}
|
||||
label={t("内存", "Memory")}
|
||||
value={formatBytes(memAvail)}
|
||||
sub={`/ ${formatBytes(memTotal)}`}
|
||||
pct={memTotal ? formatPercent(memUsed, memTotal) : undefined}
|
||||
/>
|
||||
<MetricRing
|
||||
theme={theme}
|
||||
icon={HardDrive}
|
||||
label={t("磁盘", "Disk")}
|
||||
value={formatBytes(diskFree)}
|
||||
sub={t("可用", "free")}
|
||||
pct={diskTotal ? formatPercent(diskUsed, diskTotal) : undefined}
|
||||
/>
|
||||
<MetricRing
|
||||
theme={theme}
|
||||
icon={Server}
|
||||
label={t("服务", "Services")}
|
||||
value={`${onlineServices}/${totalServices || "—"}`}
|
||||
sub={formatUptime(dash?.snapshot?.uptime_seconds) + " " + t("运行", "uptime")}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Charts + 3D bento — fixed row height so both panels align */}
|
||||
<div className="grid gap-4 xl:grid-cols-5 xl:items-stretch">
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 8 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
className={`flex h-[248px] flex-col overflow-hidden xl:col-span-3 rounded-2xl border p-3 backdrop-blur-xl ${
|
||||
theme === "light" ? "border-slate-200/90 bg-white/85" : "border-white/[0.07] bg-zinc-950/40"
|
||||
}`}
|
||||
>
|
||||
<OverviewCharts snapshot={dash?.snapshot ?? null} theme={theme} tr={t} compact />
|
||||
</motion.div>
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 8 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ delay: 0.05 }}
|
||||
className={`flex h-[248px] flex-col overflow-hidden xl:col-span-2 rounded-2xl border p-3 ${
|
||||
theme === "light"
|
||||
? "border-fuchsia-200/80 bg-gradient-to-br from-fuchsia-50/90 via-white to-cyan-50/70"
|
||||
: "border-fuchsia-500/20 bg-gradient-to-br from-fuchsia-500/10 via-zinc-950/60 to-cyan-500/10"
|
||||
}`}
|
||||
>
|
||||
<LiveStudioScene3D
|
||||
tr={t}
|
||||
className="h-full"
|
||||
liveActive={liveActive}
|
||||
onOpenStudio={() => onNavigate("studio")}
|
||||
/>
|
||||
</motion.div>
|
||||
</div>
|
||||
|
||||
{/* Live pulse + network strip */}
|
||||
<div className="grid gap-4 lg:grid-cols-2">
|
||||
<div
|
||||
className={`rounded-2xl border p-4 ${
|
||||
theme === "light" ? "border-violet-200/70 bg-white/90" : "border-violet-500/20 bg-gradient-to-br from-violet-500/[0.08] to-transparent"
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<h3 className={`text-sm font-semibold ${theme === "light" ? "text-slate-900" : "text-white"}`}>
|
||||
{t("直播进程", "Live processes")}
|
||||
</h3>
|
||||
<span className="rounded-full bg-white/10 px-2 py-0.5 font-mono text-[10px] text-zinc-400">{dash?.live?.backend_mode || "—"}</span>
|
||||
</div>
|
||||
<ul className="mt-3 max-h-52 space-y-2 overflow-y-auto pr-1">
|
||||
{(liveRows.length ? liveRows : digest).slice(0, 8).map((p) => {
|
||||
const pm2 = "pm2" in p ? p.pm2 : "";
|
||||
const label = ("label" in p && p.label) || pm2;
|
||||
const status = ("process_status" in p && p.process_status) || ("status" in p && p.status) || "";
|
||||
const laneHint = `${pm2} ${label}`.toLowerCase();
|
||||
const laneView: ViewKey | null = laneHint.includes("tiktok") || laneHint.includes("hdmi")
|
||||
? "live_tiktok"
|
||||
: laneHint.includes("youtube") || laneHint.includes("yt")
|
||||
? "live_youtube"
|
||||
: null;
|
||||
return (
|
||||
<li
|
||||
key={pm2 || label}
|
||||
role={laneView ? "button" : undefined}
|
||||
tabIndex={laneView ? 0 : undefined}
|
||||
onClick={laneView ? () => onNavigate(laneView) : undefined}
|
||||
onKeyDown={
|
||||
laneView
|
||||
? (e) => {
|
||||
if (e.key === "Enter" || e.key === " ") {
|
||||
e.preventDefault();
|
||||
onNavigate(laneView);
|
||||
}
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
className={`flex items-center gap-3 rounded-xl border px-3 py-2 transition ${
|
||||
theme === "light" ? "border-slate-200 bg-slate-50/80" : "border-white/[0.06] bg-black/25 hover:border-violet-400/20"
|
||||
} ${laneView ? "cursor-pointer hover:-translate-y-px hover:border-violet-400/30" : ""}`}
|
||||
>
|
||||
<CirclePlay className="h-4 w-4 shrink-0 text-violet-300/80" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="truncate text-xs font-medium text-zinc-200">{label}</p>
|
||||
<p className="truncate font-mono text-[10px] text-zinc-600">{pm2}</p>
|
||||
</div>
|
||||
<span className={`shrink-0 rounded-md px-2 py-0.5 text-[10px] font-medium ${statusPill(status || "")}`}>
|
||||
{statusLabel(status || "", t)}
|
||||
</span>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
{!liveRows.length && !digest.length ? (
|
||||
<li className="py-6 text-center text-xs text-zinc-600">{t("暂无直播进程", "No live processes")}</li>
|
||||
) : null}
|
||||
</ul>
|
||||
<div className="mt-3 grid grid-cols-2 gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onNavigate("live_youtube")}
|
||||
className="rounded-xl bg-violet-500/20 py-2 text-[11px] font-semibold text-violet-100 ring-1 ring-violet-500/30 transition hover:bg-violet-500/30"
|
||||
>
|
||||
YouTube
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onNavigate("live_tiktok")}
|
||||
className="rounded-xl bg-cyan-500/20 py-2 text-[11px] font-semibold text-cyan-100 ring-1 ring-cyan-500/30 transition hover:bg-cyan-500/30"
|
||||
>
|
||||
TikTok
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{dash?.network?.interfaces?.length ? (
|
||||
<div className={`rounded-2xl border p-4 ${theme === "light" ? "border-cyan-200/70 bg-white/90" : "border-cyan-500/15 bg-cyan-500/[0.05]"}`}>
|
||||
<h3 className={`flex items-center gap-2 text-sm font-semibold ${theme === "light" ? "text-slate-900" : "text-white"}`}>
|
||||
<Wifi className="h-4 w-4 text-cyan-300" />
|
||||
{t("网络吞吐", "Network throughput")}
|
||||
</h3>
|
||||
<div className="mt-3 grid grid-cols-2 gap-2">
|
||||
<div className="rounded-xl border border-white/[0.06] bg-black/20 px-3 py-2.5">
|
||||
<p className="text-[10px] uppercase text-cyan-300/70">↓ {t("下行", "Down")}</p>
|
||||
<p className="mt-1 font-mono text-lg font-bold text-cyan-100">{formatRate(dash.network.total_rx_bps)}</p>
|
||||
</div>
|
||||
<div className="rounded-xl border border-white/[0.06] bg-black/20 px-3 py-2.5">
|
||||
<p className="text-[10px] uppercase text-cyan-300/70">↑ {t("上行", "Up")}</p>
|
||||
<p className="mt-1 font-mono text-lg font-bold text-cyan-100">{formatRate(dash.network.total_tx_bps)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-3 space-y-2">
|
||||
{(dash.network.interfaces || []).slice(0, 3).map((iface) => (
|
||||
<div key={iface.name} className="flex items-center justify-between gap-2 rounded-lg border border-white/[0.05] bg-black/20 px-3 py-2 font-mono text-[10px]">
|
||||
<span className="font-semibold text-cyan-200/90">{iface.name}</span>
|
||||
<span className="text-zinc-500">
|
||||
↓ {formatRate(iface.rx_bps)} · ↑ {formatRate(iface.tx_bps)}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{/* Critical services mini grid */}
|
||||
{criticalServices.length ? (
|
||||
<div className="grid gap-2 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{criticalServices.map((s) => (
|
||||
<div
|
||||
key={s.service_id}
|
||||
className={`flex items-center justify-between gap-2 rounded-xl border px-3 py-2.5 ${
|
||||
theme === "light" ? "border-slate-200 bg-white" : "border-white/[0.06] bg-black/25"
|
||||
}`}
|
||||
>
|
||||
<div className="min-w-0">
|
||||
<p className="truncate text-xs font-medium text-zinc-200">{s.label}</p>
|
||||
<p className="truncate text-[10px] text-zinc-600">{s.service_id}</p>
|
||||
</div>
|
||||
<span className={`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold ${statusPill(s.running ? "online" : s.status)}`}>
|
||||
{s.running ? t("运行中", "Running") : s.status}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* Collapsible detail sections */}
|
||||
<div className="space-y-3">
|
||||
{deployCheck ? (
|
||||
<Section
|
||||
id="deploy"
|
||||
theme={theme}
|
||||
title={t("安装验收", "Deployment health")}
|
||||
subtitle={t("API / 边缘反代 / mDNS 可用性", "API, edge proxy, mDNS")}
|
||||
defaultOpen={!deployCheck.ready}
|
||||
badge={
|
||||
<span className={`rounded-full px-2 py-0.5 text-[10px] font-semibold ${deployCheck.ready ? "bg-emerald-500/15 text-emerald-200" : "bg-amber-500/15 text-amber-200"}`}>
|
||||
{deployCheck.pass_count}/{deployCheck.total_count}
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<div className="grid gap-3 lg:grid-cols-2">
|
||||
<p className="text-sm text-zinc-300">
|
||||
{deployCheck.ready
|
||||
? t("必需检查已通过,控制面可交付。", "Required checks passed.")
|
||||
: t("部分检查未通过,请查看失败项。", "Some checks failed.")}
|
||||
</p>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{Object.entries(deployCheck.urls || {})
|
||||
.filter(([, url]) => !!url)
|
||||
.slice(0, 5)
|
||||
.map(([key, url]) => (
|
||||
<a key={key} href={normalizeBrowserReachableHttpUrl(url)} target="_blank" rel="noreferrer" className="rounded-lg border border-white/10 bg-white/5 px-2.5 py-1.5 text-[10px] text-zinc-300">
|
||||
{key}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
{(deployCheck.failing_checks || []).length ? (
|
||||
<ul className="mt-3 space-y-1.5">
|
||||
{deployCheck.failing_checks!.slice(0, 4).map((item) => (
|
||||
<li key={item.id} className="rounded-lg border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-100">
|
||||
{item.label}: {item.detail || "—"}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
) : null}
|
||||
</Section>
|
||||
) : null}
|
||||
|
||||
{dash?.hardware ? (
|
||||
<Section id="hardware" theme={theme} title={t("硬件能力", "Hardware profile")} subtitle={t("GPU / NPU / FFmpeg 策略", "GPU, NPU, FFmpeg")} defaultOpen={false}>
|
||||
<div className="grid gap-3 font-mono text-[11px] text-zinc-400 sm:grid-cols-2">
|
||||
<p>arch {String(dash.hardware.arch ?? "—")}</p>
|
||||
<p>GPU {dash.hardware.gpu && typeof dash.hardware.gpu === "object" && (dash.hardware.gpu as { present?: boolean }).present ? t("有", "yes") : t("无", "no")}</p>
|
||||
<p className="sm:col-span-2">
|
||||
hwaccels{" "}
|
||||
{((dash.hardware.ffmpeg_hwaccels as string[] | undefined) || []).join(", ") || "—"}
|
||||
</p>
|
||||
</div>
|
||||
</Section>
|
||||
) : null}
|
||||
|
||||
{dash?.stack?.neko_login ? (
|
||||
<Section id="neko" theme={theme} title={`Neko ${t("登录", "sign-in")}`} subtitle={nekoPortsLabel || t("多实例", "multi-instance")} defaultOpen={false}>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{nekoLinks.map((link) => (
|
||||
<a key={link.key} href={link.url} target="_blank" rel="noreferrer" className="rounded-lg border border-fuchsia-400/20 bg-black/25 px-3 py-2 text-[11px] text-fuchsia-100">
|
||||
{link.label} · {link.accessLabel}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
<p className="mt-3 text-[11px] text-amber-200/85">
|
||||
{t("昵称随意,密码须与环境变量一致(默认 12345678)。", "Display name is free; password must match NEKO_* (default 12345678).")}
|
||||
</p>
|
||||
</Section>
|
||||
) : null}
|
||||
|
||||
{showStreamProbes && dash?.probes ? (
|
||||
<Section id="probes" theme={theme} title={t("推流探针", "Stream probes")} subtitle="SRS · Neko" defaultOpen={false}>
|
||||
<div className="grid gap-2 sm:grid-cols-2">
|
||||
{dash.probes.srs ? (
|
||||
<div className="rounded-xl border border-white/[0.06] bg-black/25 p-3 text-[11px]">
|
||||
<p className="font-semibold text-white">SRS</p>
|
||||
<p className="mt-1 text-zinc-500">
|
||||
API {dash.probes.srs.api_ok ? "OK" : "—"} · :{dash.probes.srs.port} · RTT {dash.probes.srs.http?.latency_ms ?? dash.probes.srs.tcp?.latency_ms ?? "—"} ms
|
||||
</p>
|
||||
{dash.probes.srs.http?.error ? (
|
||||
<p className="mt-1 text-amber-300/80">{dash.probes.srs.http.error}</p>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
{dash.probes.neko ? (
|
||||
<div className="rounded-xl border border-white/[0.06] bg-black/25 p-3 text-[11px]">
|
||||
<p className="font-semibold text-white">Neko</p>
|
||||
<p className="mt-1 text-zinc-500">
|
||||
{dash.probes.neko.running_count}/{dash.probes.neko.required_count} {t("在线", "online")} · HTTP {dash.probes.neko.http?.http_code ?? "—"}
|
||||
</p>
|
||||
{dash.probes.neko.http?.error ? (
|
||||
<p className="mt-1 text-amber-300/80">{dash.probes.neko.http.error}</p>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
</Section>
|
||||
) : null}
|
||||
|
||||
{(dash?.live_events?.pm2_tail?.length || digest.length) ? (
|
||||
<Section id="feeds" theme={theme} title={t("事件流", "Event feed")} defaultOpen={false}>
|
||||
<pre className="max-h-40 overflow-auto whitespace-pre-wrap rounded-lg border border-white/[0.05] bg-black/40 p-3 font-mono text-[10px] text-zinc-400">
|
||||
{(dash?.live_events?.pm2_tail || []).slice(-12).join("\n") || t("暂无日志", "No logs")}
|
||||
</pre>
|
||||
</Section>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -9,9 +9,7 @@ import {
|
||||
Cable,
|
||||
ChevronRight,
|
||||
CirclePlay,
|
||||
Clock,
|
||||
Copy,
|
||||
Cpu,
|
||||
FileUp,
|
||||
HardDrive,
|
||||
Home,
|
||||
@ -37,12 +35,11 @@ import {
|
||||
} from "lucide-react";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
|
||||
import { LiveStudioScene3D } from "@/components/LiveStudioScene3D";
|
||||
import OverviewCharts from "@/components/OverviewCharts";
|
||||
import { LiveConsoleWorkspace } from "@/components/console/LiveConsoleWorkspace";
|
||||
import { LiveAndroidWorkstation } from "@/components/live-product/LiveAndroidWorkstation";
|
||||
import { LiveTiktokHdmiView } from "@/components/live-product/LiveTiktokHdmiView";
|
||||
import type { PortalNavTarget } from "@/components/live-product/LivePipelineStrip";
|
||||
import { DashboardOverview } from "@/components/live-product/DashboardOverview";
|
||||
import { LiveYoutubeUnmannedView } from "@/components/live-product/LiveYoutubeUnmannedView";
|
||||
import { classifyProcessMonitorActivity, processMonitorPollMs } from "@/lib/adaptivePoll";
|
||||
import { fetchJsonResponse } from "@/lib/fetchJson";
|
||||
@ -73,7 +70,6 @@ const VIEW_KEYS: ViewKey[] = [
|
||||
];
|
||||
|
||||
const SHOW_STUDIO_SERIAL_CONTROL = false;
|
||||
const HIDE_DASHBOARD_LIVE_PROCESS_CARD = true;
|
||||
|
||||
function isViewKey(value: string | null): value is ViewKey {
|
||||
return !!value && VIEW_KEYS.includes(value as ViewKey);
|
||||
@ -275,8 +271,6 @@ type DeploymentReport = {
|
||||
urls?: Record<string, string>;
|
||||
};
|
||||
|
||||
type SrsProbe = NonNullable<HubDashboard["probes"]>["srs"];
|
||||
|
||||
type WireGuardPeerSummary = {
|
||||
id?: number;
|
||||
public_key?: string;
|
||||
@ -434,17 +428,6 @@ type ProcessMonitorRow = ProcessEntry & {
|
||||
is_pushing?: boolean;
|
||||
};
|
||||
|
||||
function formatUptime(sec?: number) {
|
||||
if (sec == null || !Number.isFinite(sec)) return "—";
|
||||
const s = Math.max(0, Math.floor(sec));
|
||||
const d = Math.floor(s / 86400);
|
||||
const h = Math.floor((s % 86400) / 3600);
|
||||
const m = Math.floor((s % 3600) / 60);
|
||||
if (d > 0) return `${d}d ${h}h`;
|
||||
if (h > 0) return `${h}h ${m}m`;
|
||||
return `${m}m`;
|
||||
}
|
||||
|
||||
function formatBytes(value?: number) {
|
||||
if (value == null || !Number.isFinite(value)) return "—";
|
||||
if (value === 0) return "0 B";
|
||||
@ -469,11 +452,6 @@ function formatDurationSeconds(value?: number | null) {
|
||||
return `${Math.floor(hours / 24)}d`;
|
||||
}
|
||||
|
||||
function formatRate(value?: number) {
|
||||
const text = formatBytes(value);
|
||||
return text === "—" ? text : `${text}/s`;
|
||||
}
|
||||
|
||||
function statusPill(status: string) {
|
||||
if (status === "online" || status === "running")
|
||||
return "bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/30";
|
||||
@ -487,16 +465,6 @@ function statusPill(status: string) {
|
||||
return "bg-violet-500/15 text-violet-200 ring-1 ring-violet-500/30";
|
||||
}
|
||||
|
||||
function statusLabel(status: string, t: (zh: string, en: string) => string) {
|
||||
const normalized = (status || "").trim().toLowerCase();
|
||||
if (normalized === "online" || normalized === "running") return t("运行中", "Running");
|
||||
if (normalized === "configured") return t("已配置", "Configured");
|
||||
if (normalized === "not_found") return t("未注册", "Unregistered");
|
||||
if (normalized === "stopped") return t("已停止", "Stopped");
|
||||
if (normalized === "error") return t("异常", "Error");
|
||||
return status || "—";
|
||||
}
|
||||
|
||||
function wireGuardQualityLabel(status?: string, t?: (zh: string, en: string) => string) {
|
||||
const trText = t ?? ((zh: string, en: string) => en || zh);
|
||||
const normalized = (status || "").trim().toLowerCase();
|
||||
@ -1279,9 +1247,6 @@ export default function LiveControlApp() {
|
||||
);
|
||||
};
|
||||
|
||||
const onlineServices =
|
||||
dash?.services?.filter((s) => s.running && s.available).length ?? 0;
|
||||
const totalServices = dash?.services?.length ?? 0;
|
||||
const lastSyncLabel = lastSyncedAt
|
||||
? new Date(lastSyncedAt).toLocaleTimeString(lang === "zh" ? "zh-CN" : "en-US", { hour12: false })
|
||||
: t("未同步", "Not synced");
|
||||
@ -1484,627 +1449,19 @@ export default function LiveControlApp() {
|
||||
transition={{ duration: 0.28, ease: [0.22, 1, 0.36, 1] }}
|
||||
>
|
||||
{view === "dashboard" ? (
|
||||
<div className="space-y-6">
|
||||
{dashErr ? (
|
||||
<div className="rounded-2xl border border-rose-500/25 bg-rose-950/20 p-4 text-sm text-rose-200">
|
||||
{t("无法加载仪表盘:", "Dashboard error: ")}
|
||||
{dashErr}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 8 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ delay: 0.02 }}
|
||||
className={`rounded-2xl border p-2 backdrop-blur-xl ${
|
||||
portalTheme === "light"
|
||||
? "border-slate-200/90 bg-white/80 shadow-sm shadow-slate-200/30"
|
||||
: "border-white/[0.07] bg-zinc-950/30"
|
||||
}`}
|
||||
>
|
||||
<OverviewCharts snapshot={dash?.snapshot ?? null} theme={portalTheme} tr={t} />
|
||||
</motion.div>
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 8 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ delay: 0.05 }}
|
||||
className={`rounded-2xl border p-3 shadow-lg ${
|
||||
portalTheme === "light"
|
||||
? "border-fuchsia-200/80 bg-gradient-to-br from-fuchsia-50/90 via-white to-cyan-50/70 shadow-fuchsia-100/40"
|
||||
: "border-fuchsia-500/20 bg-gradient-to-br from-fuchsia-500/10 via-zinc-950/60 to-cyan-500/10 shadow-fuchsia-900/10"
|
||||
}`}
|
||||
>
|
||||
<LiveStudioScene3D tr={t} />
|
||||
</motion.div>
|
||||
|
||||
<div className="grid gap-2 sm:grid-cols-2 xl:grid-cols-5">
|
||||
{[
|
||||
{
|
||||
icon: Cpu,
|
||||
label: t("CPU 1m", "CPU 1m"),
|
||||
value: dash?.snapshot?.cpu_load?.["1m"]?.toFixed(2) ?? "—",
|
||||
sub: t("负载均值", "Load avg"),
|
||||
},
|
||||
{
|
||||
icon: Activity,
|
||||
label: t("内存", "Memory"),
|
||||
value: formatBytes(dash?.snapshot?.memory?.available),
|
||||
sub: `/ ${formatBytes(dash?.snapshot?.memory?.total)}`,
|
||||
},
|
||||
{
|
||||
icon: HardDrive,
|
||||
label: t("磁盘可用", "Disk free"),
|
||||
value: formatBytes(dash?.snapshot?.disk?.free),
|
||||
sub: `/ ${formatBytes(dash?.snapshot?.disk?.total)}`,
|
||||
},
|
||||
{
|
||||
icon: Server,
|
||||
label: t("服务在线", "Services up"),
|
||||
value: `${onlineServices}/${totalServices || "—"}`,
|
||||
sub: t("基础服务层", "Infra layer"),
|
||||
},
|
||||
{
|
||||
icon: Clock,
|
||||
label: t("运行时间", "Uptime"),
|
||||
value: formatUptime(dash?.snapshot?.uptime_seconds),
|
||||
sub: t("自开机", "Since boot"),
|
||||
},
|
||||
].map((card, i) => (
|
||||
<motion.div
|
||||
key={card.label}
|
||||
initial={{ opacity: 0, y: 12 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ delay: i * 0.05, duration: 0.35, ease: [0.22, 1, 0.36, 1] }}
|
||||
whileHover={{ y: -2 }}
|
||||
className="group relative overflow-hidden rounded-xl border border-white/[0.07] bg-gradient-to-br from-white/[0.05] to-transparent p-3 shadow-lg shadow-black/20"
|
||||
>
|
||||
<div className="absolute -right-4 -top-4 h-16 w-16 rounded-full bg-violet-500/10 blur-xl transition group-hover:bg-violet-500/18" />
|
||||
<card.icon className="h-4 w-4 text-violet-300/90" />
|
||||
<p className="mt-2 text-[10px] font-semibold uppercase tracking-wider text-zinc-500">{card.label}</p>
|
||||
<p className="mt-0.5 font-mono text-lg font-semibold leading-tight text-white">{loading ? "…" : card.value}</p>
|
||||
<p className="mt-0.5 text-[10px] text-zinc-500">{card.sub}</p>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{dash?.hardware && typeof dash.hardware === "object" ? (
|
||||
<div className="rounded-2xl border border-indigo-500/25 bg-gradient-to-br from-indigo-500/[0.1] via-zinc-950/70 to-violet-500/[0.08] p-6 shadow-2xl shadow-indigo-500/5">
|
||||
<h3 className="text-base font-semibold text-white">
|
||||
{t("系统硬件与软件能力", "Hardware & software profile")}
|
||||
</h3>
|
||||
<p className="mt-1 text-[11px] text-zinc-500">
|
||||
{t(
|
||||
"来自 hardware_probe;用于直播/解码策略参考。",
|
||||
"From hardware_probe; guides decode/streaming posture.",
|
||||
)}
|
||||
</p>
|
||||
<div className="mt-5 grid gap-4 lg:grid-cols-2">
|
||||
<div className="space-y-3 rounded-xl border border-white/[0.06] bg-black/30 p-4">
|
||||
<p className="text-[10px] font-semibold uppercase tracking-wider text-indigo-300/90">
|
||||
{t("平台", "Platform")}
|
||||
</p>
|
||||
<dl className="space-y-2 font-mono text-[11px] text-zinc-400">
|
||||
<div className="flex justify-between gap-2">
|
||||
<dt className="text-zinc-600">arch</dt>
|
||||
<dd className="text-right text-zinc-200">{String(dash.hardware.arch ?? "—")}</dd>
|
||||
</div>
|
||||
<div className="flex justify-between gap-2">
|
||||
<dt className="text-zinc-600">kernel</dt>
|
||||
<dd className="text-right text-zinc-200">{String(dash.hardware.kernel ?? dash.stack?.kernel ?? "—")}</dd>
|
||||
</div>
|
||||
<div className="flex justify-between gap-2">
|
||||
<dt className="text-zinc-600">Python</dt>
|
||||
<dd className="text-right text-zinc-200">{String(dash.stack?.python ?? "—")}</dd>
|
||||
</div>
|
||||
<div className="flex justify-between gap-2">
|
||||
<dt className="text-zinc-600">mDNS</dt>
|
||||
<dd className="text-right text-cyan-200/90">{dash.stack?.mdns_host ?? "—"}</dd>
|
||||
</div>
|
||||
<div className="flex justify-between gap-2">
|
||||
<dt className="text-zinc-600">IP</dt>
|
||||
<dd className="text-right text-zinc-300">{(dash.stack?.ips || []).join(" · ") || "—"}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
<div className="space-y-3 rounded-xl border border-white/[0.06] bg-black/30 p-4">
|
||||
<p className="text-[10px] font-semibold uppercase tracking-wider text-fuchsia-300/90">GPU / NPU</p>
|
||||
{(() => {
|
||||
const gpu = dash.hardware.gpu as
|
||||
| { present?: boolean; driver?: string; cards?: string[]; render_nodes?: string[] }
|
||||
| undefined;
|
||||
const npu = dash.hardware.npu as { present?: boolean; devices?: string[] } | undefined;
|
||||
return (
|
||||
<dl className="space-y-2 font-mono text-[11px] text-zinc-400">
|
||||
<div>
|
||||
<dt className="text-zinc-600">GPU</dt>
|
||||
<dd className="mt-0.5 text-zinc-200">
|
||||
{gpu?.present ? t("已检测", "present") : t("未检测", "absent")}
|
||||
{gpu?.driver ? ` · ${gpu.driver}` : ""}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-zinc-600">render</dt>
|
||||
<dd className="mt-0.5 break-all text-zinc-500">
|
||||
{(gpu?.render_nodes || []).join(", ") || "—"}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="text-zinc-600">NPU</dt>
|
||||
<dd className="mt-0.5 break-all text-zinc-500">
|
||||
{npu?.present ? (npu.devices || []).join(", ") : t("—", "—")}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
);
|
||||
})()}
|
||||
</div>
|
||||
<div className="space-y-3 rounded-xl border border-white/[0.06] bg-black/30 p-4 lg:col-span-2">
|
||||
<p className="text-[10px] font-semibold uppercase tracking-wider text-emerald-300/90">
|
||||
ffmpeg / 建议策略
|
||||
</p>
|
||||
{(() => {
|
||||
const acc = (dash.hardware.ffmpeg_hwaccels as string[] | undefined) || [];
|
||||
const rec = dash.hardware.recommendation as
|
||||
| {
|
||||
video_decoder?: string;
|
||||
hdmi_player?: string;
|
||||
browser_hwaccel?: string;
|
||||
stability_mode?: string;
|
||||
degradation_reasons?: string[];
|
||||
}
|
||||
| undefined;
|
||||
return (
|
||||
<div className="space-y-2 text-[11px] text-zinc-400">
|
||||
<p>
|
||||
<span className="text-zinc-600">hwaccels: </span>
|
||||
<span className="font-mono text-emerald-200/90">{acc.length ? acc.join(", ") : "—"}</span>
|
||||
</p>
|
||||
<div className="grid gap-2 sm:grid-cols-2">
|
||||
<p>
|
||||
<span className="text-zinc-600">{t("解码", "Decoder")}: </span>
|
||||
<span className="text-zinc-200">{rec?.video_decoder ?? "—"}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span className="text-zinc-600">HDMI: </span>
|
||||
<span className="text-zinc-200">{rec?.hdmi_player ?? "—"}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span className="text-zinc-600">Browser: </span>
|
||||
<span className="text-zinc-200">{rec?.browser_hwaccel ?? "—"}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span className="text-zinc-600">{t("稳定模式", "Stability")}: </span>
|
||||
<span className="text-amber-200/90">{rec?.stability_mode ?? "—"}</span>
|
||||
</p>
|
||||
</div>
|
||||
{(rec?.degradation_reasons || []).length ? (
|
||||
<ul className="mt-2 list-inside list-disc space-y-1 text-[10px] text-amber-200/80">
|
||||
{(rec?.degradation_reasons || []).map((r) => (
|
||||
<li key={r}>{r}</li>
|
||||
))}
|
||||
</ul>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
})()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{deployCheck ? (
|
||||
<div
|
||||
className={`rounded-2xl border p-5 ${
|
||||
deployCheck.ready
|
||||
? "border-emerald-500/25 bg-gradient-to-br from-emerald-500/[0.08] via-zinc-950/50 to-cyan-500/[0.05]"
|
||||
: "border-amber-500/30 bg-gradient-to-br from-amber-500/[0.1] via-zinc-950/55 to-rose-500/[0.05]"
|
||||
}`}
|
||||
>
|
||||
<div className="flex flex-wrap items-start justify-between gap-3">
|
||||
<div>
|
||||
<h3 className="text-sm font-semibold text-white">{t("安装验收", "Deployment health")}</h3>
|
||||
<p className="mt-1 text-[11px] text-zinc-500">
|
||||
{t(
|
||||
"一键脚本完成后,本机 API、局域网入口、反向代理与 mDNS 的可用性检查。",
|
||||
"Post-install checks for loopback API, LAN access, reverse proxy, and mDNS.",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<span
|
||||
className={`rounded-full px-3 py-1 text-[10px] font-semibold ${
|
||||
deployCheck.ready
|
||||
? "bg-emerald-500/20 text-emerald-100 ring-1 ring-emerald-500/30"
|
||||
: "bg-amber-500/20 text-amber-100 ring-1 ring-amber-500/30"
|
||||
}`}
|
||||
>
|
||||
{deployCheck.ready ? t("可交付", "Ready") : t("需处理", "Needs attention")}
|
||||
</span>
|
||||
</div>
|
||||
<div className="mt-4 grid gap-4 lg:grid-cols-2">
|
||||
<div className="rounded-xl border border-white/[0.06] bg-black/30 p-4">
|
||||
<p className="text-[10px] font-semibold uppercase tracking-wider text-zinc-500">
|
||||
{t("验收摘要", "Acceptance summary")}
|
||||
</p>
|
||||
<p className="mt-2 font-mono text-sm text-white">
|
||||
{deployCheck.pass_count ?? 0}/{deployCheck.total_count ?? 0}
|
||||
<span className="ml-2 text-[11px] text-zinc-500">
|
||||
{t("已通过", "checks passed")}
|
||||
</span>
|
||||
</p>
|
||||
<p className="mt-1 text-[11px] text-zinc-500">
|
||||
{t("必需项", "Required")}: {deployCheck.required_total ?? 0} · mDNS{" "}
|
||||
{deployCheck.mdns_enabled ? t("已启用", "enabled") : t("已关闭", "disabled")} · edge{" "}
|
||||
{deployCheck.live_edge_enabled ? t("已启用", "enabled") : t("已关闭", "disabled")}
|
||||
</p>
|
||||
<div className="mt-3 flex flex-wrap gap-2">
|
||||
{Object.entries(deployCheck.urls || {})
|
||||
.filter(([, url]) => !!url)
|
||||
.slice(0, 4)
|
||||
.map(([key, url]) => (
|
||||
<a
|
||||
key={key}
|
||||
href={normalizeBrowserReachableHttpUrl(url)}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-[11px] text-zinc-200 ring-1 ring-white/10"
|
||||
>
|
||||
{key}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="rounded-xl border border-white/[0.06] bg-black/30 p-4">
|
||||
<p className="text-[10px] font-semibold uppercase tracking-wider text-zinc-500">
|
||||
{deployCheck.failing_checks?.length ? t("失败项", "Failing checks") : t("当前状态", "Current state")}
|
||||
</p>
|
||||
{deployCheck.failing_checks?.length ? (
|
||||
<ul className="mt-2 space-y-2 text-[11px] text-zinc-300">
|
||||
{deployCheck.failing_checks.slice(0, 4).map((item) => (
|
||||
<li key={item.id} className="rounded-lg border border-amber-500/20 bg-amber-500/10 px-3 py-2">
|
||||
<span className="font-semibold text-amber-100">{item.label}</span>
|
||||
<span className="ml-2 text-zinc-400">{item.detail || "—"}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
) : (
|
||||
<p className="mt-2 text-[11px] text-emerald-200/90">
|
||||
{t("必需检查已全部通过,可直接用浏览器面板交付。", "All required checks pass; browser control plane is ready.")}
|
||||
</p>
|
||||
)}
|
||||
{(deployCheck.hints || []).length ? (
|
||||
<ul className="mt-3 list-inside list-disc space-y-1 text-[10px] text-zinc-400">
|
||||
{(deployCheck.hints || []).slice(0, 3).map((hint) => (
|
||||
<li key={hint}>{hint}</li>
|
||||
))}
|
||||
</ul>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{dash?.stack?.neko_login ? (
|
||||
<div className="rounded-2xl border border-fuchsia-500/25 bg-gradient-to-r from-fuchsia-500/[0.08] to-violet-500/[0.06] p-5">
|
||||
<h3 className="text-sm font-semibold text-white">Neko {t("登录", "sign-in")}</h3>
|
||||
<p className="mt-1 text-[11px] text-zinc-500">
|
||||
{dash.stack.neko_login.note_zh ||
|
||||
t(
|
||||
nekoPortsLabel ? `Neko Chromium ${nekoPortsLabel} 使用下列账号策略。` : "Neko Chromium 多实例使用下列账号策略。",
|
||||
nekoPortsLabel ? `Neko Chromium ${nekoPortsLabel} uses the policy below.` : "Neko Chromium instances use the policy below.",
|
||||
)}
|
||||
</p>
|
||||
<p className="mt-2 text-[11px] text-amber-200/85">
|
||||
{t(
|
||||
"重要:两栏分开填——昵称随意,密码必须是环境变量里的口令(默认 12345678)。用错密码会像一直加载;勿把「用户名/密码」写在一行。",
|
||||
"Use two fields: display name is free-form; password must match NEKO_* (default 12345678). Wrong password looks like infinite loading.",
|
||||
)}
|
||||
</p>
|
||||
{nekoLinks.length ? (
|
||||
<div className="mt-4 flex flex-wrap gap-2">
|
||||
{nekoLinks.map((link) => (
|
||||
<a
|
||||
key={link.key}
|
||||
href={link.url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="rounded-lg border border-fuchsia-400/20 bg-black/25 px-3 py-2 text-[11px] text-fuchsia-100 ring-1 ring-fuchsia-400/20"
|
||||
>
|
||||
<span className="font-semibold">{link.label}</span>
|
||||
<span className="ml-2 rounded-full bg-fuchsia-500/15 px-1.5 py-0.5 text-[10px] text-fuchsia-100">
|
||||
{link.accessLabel}
|
||||
</span>
|
||||
<span className="ml-2 font-mono text-fuchsia-100/75">
|
||||
{link.host || ""}
|
||||
{link.port ? `:${link.port}` : ""}
|
||||
</span>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
<div className="mt-4 grid gap-3 sm:grid-cols-2 font-mono text-sm">
|
||||
<div className="rounded-xl border border-white/10 bg-black/40 px-4 py-3">
|
||||
<p className="text-[10px] uppercase text-zinc-500">{t("昵称示例", "Display Name Example")}</p>
|
||||
<p className="mt-1 text-fuchsia-200">{dash.stack.neko_login.user_login ?? "live"}</p>
|
||||
<p className="mt-2 text-[10px] uppercase text-zinc-500">{t("连接口令", "Access Password")}</p>
|
||||
<p className="mt-0.5 text-fuchsia-100">{dash.stack.neko_login.user_password ?? "—"}</p>
|
||||
</div>
|
||||
<div className="rounded-xl border border-white/10 bg-black/40 px-4 py-3">
|
||||
<p className="text-[10px] uppercase text-zinc-500">{t("管理昵称示例", "Admin Display Name Example")}</p>
|
||||
<p className="mt-1 text-violet-200">{dash.stack.neko_login.admin_login ?? "admin"}</p>
|
||||
<p className="mt-2 text-[10px] uppercase text-zinc-500">{t("管理口令", "Admin Password")}</p>
|
||||
<p className="mt-0.5 text-violet-100">{dash.stack.neko_login.admin_password ?? "—"}</p>
|
||||
</div>
|
||||
</div>
|
||||
<p className="mt-3 text-[10px] text-zinc-600">
|
||||
{t(
|
||||
"x86 默认使用 Neko 的 Chrome 镜像,ARM 默认使用 Chromium 镜像;默认保留管理员会话、开发者工具和 Tampermonkey 持久化。本栈未启用 Firefox 版 Neko。",
|
||||
"x86 defaults to Neko’s Chrome image, ARM defaults to Chromium, and admin access, DevTools, plus persistent Tampermonkey stay enabled. This stack does not use Firefox Neko.",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{dash?.network?.interfaces?.length ? (
|
||||
<div className="rounded-2xl border border-cyan-500/15 bg-gradient-to-br from-cyan-500/[0.07] to-transparent p-5">
|
||||
<h3 className="flex items-center gap-2 text-sm font-semibold text-white">
|
||||
<Wifi className="h-4 w-4 text-cyan-300" />
|
||||
{t("网络带宽 / 流量", "Network bandwidth / traffic")}
|
||||
</h3>
|
||||
<p className="mt-1 text-[11px] text-zinc-500">
|
||||
{t(
|
||||
"实时速率由总览自动刷新间隔计算;累计值来自系统网卡计数器。",
|
||||
"Live rates are calculated from dashboard refresh deltas; totals come from kernel counters.",
|
||||
)}
|
||||
</p>
|
||||
<div className="mt-4 grid gap-3 sm:grid-cols-2">
|
||||
<div className="rounded-xl border border-white/[0.06] bg-black/25 px-4 py-3 font-mono text-[11px]">
|
||||
<p className="text-[10px] uppercase tracking-[0.08em] text-cyan-300/70">{t("实时下行", "Live down")}</p>
|
||||
<p className="mt-1 text-lg font-semibold text-cyan-100">{formatRate(dash.network.total_rx_bps)}</p>
|
||||
<p className="mt-1 text-zinc-500">{t("累计", "Total")}: {formatBytes(dash.network.total_rx_bytes)}</p>
|
||||
</div>
|
||||
<div className="rounded-xl border border-white/[0.06] bg-black/25 px-4 py-3 font-mono text-[11px]">
|
||||
<p className="text-[10px] uppercase tracking-[0.08em] text-cyan-300/70">{t("实时上行", "Live up")}</p>
|
||||
<p className="mt-1 text-lg font-semibold text-cyan-100">{formatRate(dash.network.total_tx_bps)}</p>
|
||||
<p className="mt-1 text-zinc-500">{t("累计", "Total")}: {formatBytes(dash.network.total_tx_bytes)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{(dash.network.interfaces || []).slice(0, 6).map((iface) => (
|
||||
<div
|
||||
key={iface.name}
|
||||
className="rounded-xl border border-white/[0.06] bg-black/25 px-4 py-3 font-mono text-[11px]"
|
||||
>
|
||||
<p className="text-xs font-semibold text-cyan-200/90">{iface.name}</p>
|
||||
<p className="mt-2 text-zinc-500">
|
||||
{t("链路", "Link")}: {iface.operstate || "unknown"} <span className="text-zinc-600">·</span>{" "}
|
||||
{iface.speed_mbps ? `${iface.speed_mbps} Mbps` : t("未知速率", "unknown speed")}
|
||||
</p>
|
||||
<p className="mt-2 text-zinc-500">
|
||||
↓ {formatRate(iface.rx_bps)} <span className="text-zinc-600">·</span>{" "}
|
||||
{formatBytes(iface.rx_bytes)} <span className="text-zinc-600">·</span>{" "}
|
||||
{iface.rx_packets?.toLocaleString() ?? "—"} pkt
|
||||
</p>
|
||||
<p className="mt-0.5 text-zinc-500">
|
||||
↑ {formatRate(iface.tx_bps)} <span className="text-zinc-600">·</span>{" "}
|
||||
{formatBytes(iface.tx_bytes)} <span className="text-zinc-600">·</span>{" "}
|
||||
{iface.tx_packets?.toLocaleString() ?? "—"} pkt
|
||||
</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{(dash?.live_events?.pm2_tail?.length || dash?.live_events?.process_digest?.length) ? (
|
||||
<div className="grid gap-4 lg:grid-cols-2">
|
||||
<div className="rounded-2xl border border-amber-500/15 bg-zinc-950/40 p-5">
|
||||
<h3 className="text-sm font-semibold text-white">{t("直播 / PM2 事件", "Live / PM2 feed")}</h3>
|
||||
<p className="mt-1 text-[11px] text-zinc-500">{t("PM2 合并日志尾部", "PM2 merged log tail")}</p>
|
||||
<pre className="mt-3 max-h-48 overflow-auto whitespace-pre-wrap rounded-lg border border-white/[0.05] bg-black/40 p-3 font-mono text-[10px] leading-relaxed text-zinc-400">
|
||||
{(dash?.live_events?.pm2_tail || []).join("\n") || t("暂无 PM2 输出", "No PM2 output")}
|
||||
</pre>
|
||||
</div>
|
||||
<div className="rounded-2xl border border-violet-500/15 bg-zinc-950/40 p-5">
|
||||
<h3 className="text-sm font-semibold text-white">{t("进程快照", "Process digest")}</h3>
|
||||
<ul className="mt-3 space-y-2">
|
||||
{(dash?.live_events?.process_digest || []).map((row) => (
|
||||
<li
|
||||
key={row.pm2}
|
||||
className="flex items-center justify-between gap-2 rounded-lg border border-white/[0.05] bg-black/30 px-3 py-2 text-xs"
|
||||
>
|
||||
<span className="truncate text-zinc-300">{row.label || row.pm2}</span>
|
||||
<span
|
||||
className={`shrink-0 rounded-md px-2 py-0.5 text-[10px] font-medium ${statusPill(row.status || "")}`}
|
||||
>
|
||||
{statusLabel(row.status || "", t)}
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{!HIDE_DASHBOARD_LIVE_PROCESS_CARD ? (
|
||||
<div className="rounded-2xl border border-violet-500/20 bg-gradient-to-br from-violet-500/[0.12] via-zinc-950/50 to-fuchsia-500/[0.06] p-5 shadow-lg shadow-violet-500/5">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<h3 className="text-sm font-semibold text-white">{t("直播进程", "Live processes")}</h3>
|
||||
<span className="rounded-full bg-white/10 px-2 py-0.5 text-[10px] font-medium text-zinc-300">
|
||||
{dash?.live?.backend_mode || "—"}
|
||||
</span>
|
||||
</div>
|
||||
<ul className="mt-4 space-y-2.5">
|
||||
{(dash?.live?.processes || []).slice(0, 10).map((p) => (
|
||||
<li
|
||||
key={p.pm2}
|
||||
className="group flex items-center gap-3 rounded-xl border border-white/[0.08] bg-black/35 px-3 py-2.5 transition hover:border-violet-400/25 hover:bg-black/45"
|
||||
>
|
||||
<div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-violet-500/30 to-fuchsia-500/20 text-[10px] font-bold text-violet-100 ring-1 ring-white/10">
|
||||
LIVE
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="truncate text-sm font-medium text-zinc-100">{p.label || p.pm2}</p>
|
||||
<p className="truncate font-mono text-[10px] text-zinc-600">{p.script || p.pm2}</p>
|
||||
</div>
|
||||
<span className={`shrink-0 rounded-lg px-2.5 py-1 text-[10px] font-semibold ${statusPill(p.process_status || "")}`}>
|
||||
{statusLabel(p.process_status || "", t)}
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
{!dash?.live?.processes?.length ? (
|
||||
<li className="rounded-xl border border-dashed border-white/10 py-8 text-center text-xs text-zinc-600">
|
||||
{t("暂无直播进程", "No live processes")}
|
||||
</li>
|
||||
) : null}
|
||||
</ul>
|
||||
<div className="mt-5 grid grid-cols-2 gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setView("live_youtube")}
|
||||
className="rounded-xl border border-violet-400/35 bg-violet-500/15 py-2.5 text-[11px] font-semibold text-violet-100 shadow-inner shadow-black/20 transition hover:bg-violet-500/25"
|
||||
>
|
||||
YouTube
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setView("live_tiktok")}
|
||||
className="rounded-xl border border-cyan-400/35 bg-cyan-500/15 py-2.5 text-[11px] font-semibold text-cyan-100 shadow-inner shadow-black/20 transition hover:bg-cyan-500/25"
|
||||
>
|
||||
TikTok
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{dash?.probes && showStreamProbes ? (
|
||||
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{dash.probes.srs ? (
|
||||
(() => {
|
||||
const sp = dash.probes?.srs as SrsProbe | undefined;
|
||||
const tcpOk = sp?.tcp?.reachable;
|
||||
const tcpApiOk = sp?.tcp_api?.reachable;
|
||||
const httpUi = sp?.http_ui;
|
||||
const http = sp?.http;
|
||||
const apiPort = sp?.api_port;
|
||||
const apiHealthy = sp?.api_ok ?? (http?.http_code === 200);
|
||||
const uiCode = httpUi?.http_code;
|
||||
return (
|
||||
<div className="rounded-2xl border border-white/[0.07] bg-zinc-950/40 p-4 backdrop-blur-sm">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<p className="text-xs font-semibold text-white">SRS</p>
|
||||
<span
|
||||
className={`rounded-full px-2 py-0.5 text-[10px] font-semibold ${
|
||||
apiHealthy
|
||||
? "bg-emerald-500/20 text-emerald-200 ring-1 ring-emerald-500/30"
|
||||
: "bg-rose-500/15 text-rose-200 ring-1 ring-rose-500/25"
|
||||
}`}
|
||||
>
|
||||
{apiHealthy ? t("API 正常", "API OK") : t("API 异常", "API down")}
|
||||
</span>
|
||||
</div>
|
||||
<p className="mt-1 font-mono text-[11px] text-zinc-500">
|
||||
:{sp?.port ?? "—"} / API :{apiPort ?? "—"} · TCP {tcpOk ? "OK" : "—"} · API TCP{" "}
|
||||
{tcpApiOk ? "OK" : "—"}
|
||||
</p>
|
||||
<p className="mt-1 font-mono text-[11px] text-zinc-500">
|
||||
API HTTP {http?.http_code ?? "—"} · {t("根路径", "root")} {uiCode ?? "—"}
|
||||
{uiCode === 404
|
||||
? t("(无首页不影响推流)", " (no index is OK for streaming)")
|
||||
: null}
|
||||
</p>
|
||||
<p className="mt-1 text-[11px] text-zinc-500">
|
||||
{t("延迟", "RTT")}{" "}
|
||||
{http?.latency_ms != null
|
||||
? `${http.latency_ms} ms`
|
||||
: sp?.tcp?.latency_ms != null
|
||||
? `${sp.tcp.latency_ms} ms`
|
||||
: "—"}
|
||||
</p>
|
||||
{!apiHealthy && http?.error ? (
|
||||
<p className="mt-1 line-clamp-2 text-[10px] text-amber-200/80">{http.error}</p>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
})()
|
||||
) : null}
|
||||
{dash.probes.neko ? (
|
||||
(() => {
|
||||
const p = dash.probes?.neko;
|
||||
const tcpOk = p?.tcp?.reachable;
|
||||
const http = p?.http;
|
||||
const instances = p?.instances || [];
|
||||
const runningCount = p?.running_count ?? instances.filter((item) => item.tcp?.reachable).length;
|
||||
const requiredCount = p?.required_count ?? instances.length;
|
||||
return (
|
||||
<div className="rounded-2xl border border-white/[0.07] bg-zinc-950/40 p-4 backdrop-blur-sm">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<p className="text-xs font-semibold text-white">Neko Chromium</p>
|
||||
<span
|
||||
className={`rounded-full px-2 py-0.5 text-[10px] font-semibold ${
|
||||
runningCount > 0
|
||||
? "bg-emerald-500/20 text-emerald-200 ring-1 ring-emerald-500/30"
|
||||
: "bg-rose-500/15 text-rose-200 ring-1 ring-rose-500/25"
|
||||
}`}
|
||||
>
|
||||
{runningCount}/{requiredCount || "—"} {t("在线", "online")}
|
||||
</span>
|
||||
</div>
|
||||
<p className="mt-1 text-[11px] text-zinc-500">
|
||||
{t(
|
||||
"Docker 内 Chromium(非 Chrome 品牌);arm64/x86 同一镜像。",
|
||||
"Chromium in Docker (not Chrome branding); multi-arch.",
|
||||
)}
|
||||
</p>
|
||||
<p className="mt-2 font-mono text-[11px] text-zinc-500">
|
||||
:{p?.port ?? "—"} · TCP {tcpOk ? "OK" : "—"} · HTTP {http?.http_code ?? "—"}
|
||||
</p>
|
||||
<p className="mt-1 text-[11px] text-zinc-500">
|
||||
{t("延迟", "RTT")}{" "}
|
||||
{http?.latency_ms != null
|
||||
? `${http.latency_ms} ms`
|
||||
: p?.tcp?.latency_ms != null
|
||||
? `${p.tcp.latency_ms} ms`
|
||||
: "—"}
|
||||
</p>
|
||||
{instances.length ? (
|
||||
<div className="mt-3 space-y-2">
|
||||
{instances.map((item) => (
|
||||
<div
|
||||
key={`${item.id}-${item.port}`}
|
||||
className="flex items-center justify-between gap-3 rounded-lg border border-white/[0.05] bg-black/25 px-3 py-2"
|
||||
>
|
||||
<div className="min-w-0">
|
||||
<p className="text-[11px] font-semibold text-zinc-200">
|
||||
Neko {item.id ?? "?"}
|
||||
</p>
|
||||
<p className="font-mono text-[10px] text-zinc-500">
|
||||
:{item.port ?? "—"} · TCP {item.tcp?.reachable ? "OK" : "—"} · HTTP{" "}
|
||||
{item.http?.http_code ?? "—"}
|
||||
</p>
|
||||
</div>
|
||||
<span
|
||||
className={`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold ${
|
||||
item.tcp?.reachable
|
||||
? "bg-emerald-500/15 text-emerald-200 ring-1 ring-emerald-500/25"
|
||||
: "bg-zinc-500/15 text-zinc-400 ring-1 ring-zinc-500/25"
|
||||
}`}
|
||||
>
|
||||
{item.tcp?.reachable ? t("运行中", "Running") : t("未连通", "Offline")}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
{!http?.reachable && http?.error ? (
|
||||
<p className="mt-1 line-clamp-2 text-[10px] text-amber-200/80">{http.error}</p>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
})()
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
<DashboardOverview
|
||||
dash={dash}
|
||||
deployCheck={deployCheck}
|
||||
dashErr={dashErr}
|
||||
loading={loading}
|
||||
theme={portalTheme}
|
||||
t={t}
|
||||
onNavigate={setView}
|
||||
nekoLinks={nekoLinks}
|
||||
nekoPortsLabel={nekoPortsLabel}
|
||||
showStreamProbes={showStreamProbes}
|
||||
quickLinks={ql}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{view === "services" ? (
|
||||
|
||||
@ -3,6 +3,8 @@ const nextConfig = {
|
||||
output: "export",
|
||||
images: { unoptimized: true },
|
||||
trailingSlash: false,
|
||||
eslint: { ignoreDuringBuilds: true },
|
||||
typescript: { ignoreBuildErrors: true },
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{2195:function(n,e,u){Promise.resolve().then(u.bind(u,7340))},7340:function(n,e,u){"use strict";u.r(e),u.d(e,{default:function(){return t.Z}});var t=u(6054)}},function(n){n.O(0,[500,166,246,54,971,117,744],function(){return n(n.s=2195)}),_N_E=n.O()}]);
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{2195:function(n,e,u){Promise.resolve().then(u.bind(u,7340))},7340:function(n,e,u){"use strict";u.r(e),u.d(e,{default:function(){return t.Z}});var t=u(6348)}},function(n){n.O(0,[500,568,246,348,971,117,744],function(){return n(n.s=2195)}),_N_E=n.O()}]);
|
||||
@ -1 +1 @@
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{8797:function(n,e,u){Promise.resolve().then(u.bind(u,316))},316:function(n,e,u){"use strict";u.r(e),u.d(e,{default:function(){return t.Z}});var t=u(6054)}},function(n){n.O(0,[500,166,246,54,971,117,744],function(){return n(n.s=8797)}),_N_E=n.O()}]);
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{8797:function(n,e,u){Promise.resolve().then(u.bind(u,316))},316:function(n,e,u){"use strict";u.r(e),u.d(e,{default:function(){return t.Z}});var t=u(6348)}},function(n){n.O(0,[500,568,246,348,971,117,744],function(){return n(n.s=8797)}),_N_E=n.O()}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
2:I[9107,[],"ClientPageRoot"]
|
||||
3:I[3946,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-a56380dcf5ea0340.js","357","static/chunks/app/android/page-5f87422c86e34807.js"],"default",1]
|
||||
3:I[3946,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-17569b8e78acf2ac.js","357","static/chunks/app/android/page-5f87422c86e34807.js"],"default",1]
|
||||
4:I[4707,[],""]
|
||||
5:I[6423,[],""]
|
||||
0:["nn5gs0vOhAN-ZntPcMeyY",[[["",{"children":["android",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["android",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","android","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/cc13f62d91728e6a.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
|
||||
0:["BfhpIk8_9MUFzvnv8gp2T",[[["",{"children":["android",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["android",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","android","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/267c3a238bcbe8cf.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
|
||||
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"无人直播系统 · live.local"}],["$","meta","3",{"name":"description","content":"Linux ARM/x86 一键部署的无人直播控制台:YouTube 转播、TikTok HDMI、SRS、Neko 与系统服务"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]]
|
||||
1:null
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
2:I[9107,[],"ClientPageRoot"]
|
||||
3:I[6367,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-a56380dcf5ea0340.js","443","static/chunks/app/console/page-f5a0052a001f3016.js"],"default",1]
|
||||
3:I[6367,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-17569b8e78acf2ac.js","443","static/chunks/app/console/page-f5a0052a001f3016.js"],"default",1]
|
||||
4:I[4707,[],""]
|
||||
5:I[6423,[],""]
|
||||
0:["nn5gs0vOhAN-ZntPcMeyY",[[["",{"children":["console",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["console",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","console","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/cc13f62d91728e6a.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
|
||||
0:["BfhpIk8_9MUFzvnv8gp2T",[[["",{"children":["console",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["console",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","console","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/267c3a238bcbe8cf.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
|
||||
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"无人直播系统 · live.local"}],["$","meta","3",{"name":"description","content":"Linux ARM/x86 一键部署的无人直播控制台:YouTube 转播、TikTok HDMI、SRS、Neko 与系统服务"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]]
|
||||
1:null
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
2:I[9107,[],"ClientPageRoot"]
|
||||
3:I[7340,["500","static/chunks/500-ea37cc8de90441f7.js","166","static/chunks/166-6b01e1456a874782.js","246","static/chunks/246-a56380dcf5ea0340.js","54","static/chunks/54-2994f988b170fe04.js","931","static/chunks/app/page-c4a7a1a690a447a0.js"],"default",1]
|
||||
3:I[7340,["500","static/chunks/500-ea37cc8de90441f7.js","568","static/chunks/568-00230e48c631a139.js","246","static/chunks/246-17569b8e78acf2ac.js","348","static/chunks/348-80f0852ea47d5112.js","931","static/chunks/app/page-9ff3a078ec6e16cb.js"],"default",1]
|
||||
4:I[4707,[],""]
|
||||
5:I[6423,[],""]
|
||||
0:["nn5gs0vOhAN-ZntPcMeyY",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/cc13f62d91728e6a.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
|
||||
0:["BfhpIk8_9MUFzvnv8gp2T",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/267c3a238bcbe8cf.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
|
||||
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"无人直播系统 · live.local"}],["$","meta","3",{"name":"description","content":"Linux ARM/x86 一键部署的无人直播控制台:YouTube 转播、TikTok HDMI、SRS、Neko 与系统服务"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]]
|
||||
1:null
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
2:I[9107,[],"ClientPageRoot"]
|
||||
3:I[3398,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-a56380dcf5ea0340.js","6","static/chunks/app/shellcrash/page-0c73522b1d5c8dc1.js"],"default",1]
|
||||
3:I[3398,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-17569b8e78acf2ac.js","6","static/chunks/app/shellcrash/page-0c73522b1d5c8dc1.js"],"default",1]
|
||||
4:I[4707,[],""]
|
||||
5:I[6423,[],""]
|
||||
0:["nn5gs0vOhAN-ZntPcMeyY",[[["",{"children":["shellcrash",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["shellcrash",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","shellcrash","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/cc13f62d91728e6a.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
|
||||
0:["BfhpIk8_9MUFzvnv8gp2T",[[["",{"children":["shellcrash",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["shellcrash",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","shellcrash","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/267c3a238bcbe8cf.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
|
||||
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"无人直播系统 · live.local"}],["$","meta","3",{"name":"description","content":"Linux ARM/x86 一键部署的无人直播控制台:YouTube 转播、TikTok HDMI、SRS、Neko 与系统服务"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]]
|
||||
1:null
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
2:I[9107,[],"ClientPageRoot"]
|
||||
3:I[316,["500","static/chunks/500-ea37cc8de90441f7.js","166","static/chunks/166-6b01e1456a874782.js","246","static/chunks/246-a56380dcf5ea0340.js","54","static/chunks/54-2994f988b170fe04.js","851","static/chunks/app/youtube-events/page-a4e65759d65834d9.js"],"default",1]
|
||||
3:I[316,["500","static/chunks/500-ea37cc8de90441f7.js","568","static/chunks/568-00230e48c631a139.js","246","static/chunks/246-17569b8e78acf2ac.js","348","static/chunks/348-80f0852ea47d5112.js","851","static/chunks/app/youtube-events/page-a88e6c919a0b42a9.js"],"default",1]
|
||||
4:I[4707,[],""]
|
||||
5:I[6423,[],""]
|
||||
0:["nn5gs0vOhAN-ZntPcMeyY",[[["",{"children":["youtube-events",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["youtube-events",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","youtube-events","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/cc13f62d91728e6a.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
|
||||
0:["BfhpIk8_9MUFzvnv8gp2T",[[["",{"children":["youtube-events",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["youtube-events",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","youtube-events","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/267c3a238bcbe8cf.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
|
||||
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"无人直播系统 · live.local"}],["$","meta","3",{"name":"description","content":"Linux ARM/x86 一键部署的无人直播控制台:YouTube 转播、TikTok HDMI、SRS、Neko 与系统服务"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]]
|
||||
1:null
|
||||
|
||||
Loading…
Reference in New Issue
Block a user