From 42c4a7494ef12236c79b2d87a84963da12579c77 Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 20 Aug 2026 21:38:48 -0500 Subject: [PATCH] feat(youtube): add Assign tab as default next to OAuth manage Co-authored-by: Cursor --- frontend/src/app/youtube/page.tsx | 22 +- frontend/src/components/YtAssignPanel.tsx | 580 ++++++++++++++++++++++ 2 files changed, 598 insertions(+), 4 deletions(-) create mode 100644 frontend/src/components/YtAssignPanel.tsx diff --git a/frontend/src/app/youtube/page.tsx b/frontend/src/app/youtube/page.tsx index 8b31cc7..2a24d03 100644 --- a/frontend/src/app/youtube/page.tsx +++ b/frontend/src/app/youtube/page.tsx @@ -16,16 +16,18 @@ import { Search, Trash2, LayoutDashboard, + Layers, } from "lucide-react"; import { Shell } from "@/components/Shell"; import { useConfirm } from "@/components/ConfirmDialog"; import { useToast } from "@/components/Toast"; import { YouTubeLiveBadge } from "@/components/YouTubeLiveBadge"; +import { YtAssignPanel } from "@/components/YtAssignPanel"; import { fetchJson, fmtTs } from "@/lib/api"; import { shortsLiveRef } from "@/lib/youtubeLive"; -type Mode = "manage" | "probe"; +type Mode = "assign" | "manage" | "probe"; type ProbeTab = "channel" | "live" | "video" | "search" | "resolve"; type ManagedChannel = { @@ -55,7 +57,7 @@ type YtVideo = { export default function YouTubePage() { const confirm = useConfirm(); const toast = useToast(); - const [mode, setMode] = useState("manage"); + const [mode, setMode] = useState("assign"); const [channels, setChannels] = useState([]); const [channelPk, setChannelPk] = useState(""); const [dash, setDash] = useState(null); @@ -250,7 +252,7 @@ export default function YouTubePage() {

YouTube Studio Lite

▶️ YouTube

- 已授权频道:片库 / 改元数据 / 可见性 / 定时公开 / 删除 / 播放列表只读。探测仍用 InnerTube。 + 分配:频道 + 直播 KEY → 抖音 URL 池 → 精选转播。频道管理:片库 / 元数据 / 可见性。探测仍用 InnerTube。

@@ -264,6 +266,16 @@ export default function YouTubePage() {
+ +
+ +
+ + setNewStreamKey(e.target.value)} + placeholder="直播推流 KEY(可后填)" + className="rounded-xl border border-white/10 bg-slate-900 px-3 py-2 text-sm" + /> + +
+ {channels.length === 0 ? ( +

+ 还没有已授权频道。请先到{" "} + + Shorts + {" "} + 完成 Google 授权。 +

+ ) : null} + + + {groups.length === 0 ? ( +
+ 暂无分配分组。上方选择频道并新建。 +
+ ) : ( +
+ + + {selected ? ( +
+ + +
+

直播 KEY / 备注

+
+
+ setStreamKeyDraft(e.target.value)} + placeholder="YouTube 直播推流密钥" + className="w-full rounded-xl border border-white/10 bg-slate-900 px-3 py-2 pr-10 text-sm" + /> + +
+ setNoteDraft(e.target.value)} + placeholder="备注" + className="w-full min-w-0 flex-1 rounded-xl border border-white/10 bg-slate-900 px-3 py-2 text-sm sm:max-w-xs" + /> + + +
+
+ +
+
+

+ 普通列表(URL 池)· {(selected.pool || []).length} +

+

分配给该频道的抖音直播间 URL,可增删。

+