This commit is contained in:
eric
2026-03-29 03:35:05 -05:00
parent 895dafc0e0
commit 22061fb3c8
14 changed files with 669 additions and 94 deletions

View File

@@ -8,7 +8,6 @@ import {
CirclePlay,
Clock,
Cpu,
FolderOpen,
HardDrive,
Languages,
Loader2,
@@ -31,7 +30,6 @@ import { LiveStudioScene3D } from "@/components/LiveStudioScene3D";
import OverviewCharts from "@/components/OverviewCharts";
import { LiveConsoleWorkspace } from "@/components/console/LiveConsoleWorkspace";
import { LiveAndroidWorkstation } from "@/components/live-product/LiveAndroidWorkstation";
import { LiveFilebrowserPanel } from "@/components/live-product/LiveFilebrowserPanel";
import { LiveTiktokHdmiView } from "@/components/live-product/LiveTiktokHdmiView";
import type { PortalNavTarget } from "@/components/live-product/LivePipelineStrip";
import { LiveYoutubeUnmannedView } from "@/components/live-product/LiveYoutubeUnmannedView";
@@ -42,7 +40,6 @@ type PortalTheme = "dark" | "light";
type ViewKey =
| "dashboard"
| "services"
| "files"
| "live_youtube"
| "live_tiktok"
| "android"
@@ -218,7 +215,10 @@ export default function LiveControlApp() {
setDash(d);
setDashErr(null);
const devs = d.android?.devices || [];
if (devs.length && !androidSerial) setAndroidSerial(devs[0].serial);
if (devs.length && !androidSerial) {
const ready = devs.find((x) => (x.state || "").toLowerCase() === "device");
setAndroidSerial((ready ?? devs[0]).serial);
}
} catch (e) {
setDashErr((e as Error).message);
} finally {
@@ -276,7 +276,7 @@ export default function LiveControlApp() {
}, [currentProc, fetchJson]);
useEffect(() => {
if (!currentProc || (view !== "live_youtube" && view !== "live_tiktok")) return;
if (!currentProc || view !== "live_youtube") return;
void (async () => {
try {
const data = await fetchJson<{ content?: string }>(
@@ -395,7 +395,6 @@ export default function LiveControlApp() {
const navItems: { id: ViewKey; icon: typeof Activity; labelZh: string; labelEn: string }[] = [
{ id: "dashboard", icon: Activity, labelZh: "总览", labelEn: "Dashboard" },
{ id: "services", icon: Server, labelZh: "服务", labelEn: "Services" },
{ id: "files", icon: FolderOpen, labelZh: "文件(File Browser)", labelEn: "Files" },
{ id: "live_youtube", icon: CirclePlay, labelZh: "YouTube 无人直播", labelEn: "YouTube unmanned" },
{ id: "live_tiktok", icon: MonitorPlay, labelZh: "TikTok 无人直播", labelEn: "TikTok unmanned" },
{ id: "android", icon: Smartphone, labelZh: "安卓", labelEn: "Android" },
@@ -1047,14 +1046,6 @@ export default function LiveControlApp() {
</div>
) : null}
{view === "files" ? (
<LiveFilebrowserPanel
t={t}
portalTheme={portalTheme}
filebrowserUrl={ql.filebrowser || ""}
/>
) : null}
{view === "services" ? (
<div className="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
{(dash?.services || []).map((s, i) => (
@@ -1186,8 +1177,16 @@ export default function LiveControlApp() {
setUrlConfig={setUrlConfig}
onRunProcess={(a) => void runProcess(a)}
onSaveUrlConfig={(c) => saveUrlConfig(c)}
onReplayGoLive={async (replayUrl, label) => {
const safe = label.replace(/[,,|]/g, "_");
await saveUrlConfig(`原画,${replayUrl},主播: ${safe}`);
await runProcess("start");
}}
onCopy={copyText}
fetchJson={fetchJson}
apiPrefix={base}
quickLinks={ql}
notify={notify}
onNavigate={(target: PortalNavTarget) => setView(target)}
/>
) : null}