Extend Douyin/YouTube live badge styling to dashboard, groups, and shorts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
eric 2026-09-01 11:52:00 -05:00
parent e51df6f35e
commit c1501f6e16
6 changed files with 31 additions and 19 deletions

View File

@ -251,7 +251,7 @@ export default function AnchorsPage() {
{a.room_id ? ( {a.room_id ? (
<DouyinLiveBadge roomId={a.room_id} compact showOffline /> <DouyinLiveBadge roomId={a.room_id} compact showOffline />
) : a.active ? ( ) : a.active ? (
<LivePulse label="LIVE" /> <LivePulse label="DY·LIVE" variant="douyin" />
) : null} ) : null}
</div> </div>
<div className="mt-1 text-[11px] text-slate-500"> <div className="mt-1 text-[11px] text-slate-500">
@ -275,7 +275,7 @@ export default function AnchorsPage() {
{profile.room_id ? ( {profile.room_id ? (
<DouyinLiveBadge roomId={profile.room_id} showOffline /> <DouyinLiveBadge roomId={profile.room_id} showOffline />
) : profile.overview.active ? ( ) : profile.overview.active ? (
<LivePulse /> <LivePulse label="DY·LIVE" variant="douyin" />
) : null} ) : null}
</div> </div>
<p className="mt-1 font-mono text-xs text-cyan-300/80">{profile.room_id || "—"}</p> <p className="mt-1 font-mono text-xs text-cyan-300/80">{profile.room_id || "—"}</p>

View File

@ -518,9 +518,14 @@ export default function GroupsPage() {
<div className="font-mono text-[10px] text-slate-500">{ch.channel_id || ch.room_id || "—"}</div> <div className="font-mono text-[10px] text-slate-500">{ch.channel_id || ch.room_id || "—"}</div>
</td> </td>
<td className="px-3 py-2"> <td className="px-3 py-2">
<span className={Number(ch.active) > 0 || ch.last_status === "live" ? "text-rose-300" : "text-slate-500"}> {Number(ch.active) > 0 || ch.last_status === "live" ? (
{Number(ch.active) > 0 || ch.last_status === "live" ? "LIVE" : ch.last_status || "offline"} <span className="inline-flex items-center gap-1 text-[11px] font-semibold text-red-200">
<span className="live-dot-youtube" />
YT·LIVE
</span> </span>
) : (
<span className="text-slate-500">{ch.last_status || "offline"}</span>
)}
</td> </td>
<td className="px-3 py-2 tabular-nums">{ch.sessions ?? 0}</td> <td className="px-3 py-2 tabular-nums">{ch.sessions ?? 0}</td>
<td className="px-3 py-2 tabular-nums">{Number(ch.hours_total || 0).toFixed(1)}</td> <td className="px-3 py-2 tabular-nums">{Number(ch.hours_total || 0).toFixed(1)}</td>

View File

@ -328,13 +328,10 @@ export default function HomePage() {
{status?.monitor_enabled ? <LivePulse label="MONITOR ON" /> : ( {status?.monitor_enabled ? <LivePulse label="MONITOR ON" /> : (
<span className="rounded-md border border-slate-500/30 bg-slate-500/10 px-2 py-1 text-[11px] text-slate-300">⏸ 已暂停</span> <span className="rounded-md border border-slate-500/30 bg-slate-500/10 px-2 py-1 text-[11px] text-slate-300">⏸ 已暂停</span>
)} )}
{liveRooms.length > 0 ? <LivePulse label={`抖音 ${liveRooms.length} 路`} /> : null} {liveRooms.length > 0 ? <LivePulse label={`抖音 ${liveRooms.length} 路`} variant="douyin" /> : null}
{ytLiveCount > 0 ? ( {ytLiveCount > 0 ? (
<Link href="/groups" className="rounded-md border border-red-500/30 bg-red-500/10 px-2 py-1 text-[11px] text-red-100"> <Link href="/groups" className="inline-block hover:opacity-90">
<span className="inline-flex items-center gap-1.5"> <LivePulse label={`YouTube ${ytLiveCount} 路`} variant="youtube" />
<span className="live-dot" />
YT 在播 {ytLiveCount}
</span>
</Link> </Link>
) : ytStatus?.yt_monitor_enabled !== false && ytStatus?.running ? ( ) : ytStatus?.yt_monitor_enabled !== false && ytStatus?.running ? (
<Link href="/groups" className="rounded-md border border-white/10 bg-white/5 px-2 py-1 text-[11px] text-slate-400"> <Link href="/groups" className="rounded-md border border-white/10 bg-white/5 px-2 py-1 text-[11px] text-slate-400">
@ -686,8 +683,8 @@ export default function HomePage() {
{(liveRooms.length > 0 || events.length > 0) ? ( {(liveRooms.length > 0 || events.length > 0) ? (
<div className="mb-6 overflow-hidden rounded-2xl border border-rose-500/20 bg-rose-500/5"> <div className="mb-6 overflow-hidden rounded-2xl border border-rose-500/20 bg-rose-500/5">
<div className="flex items-center gap-2 border-b border-white/5 px-4 py-2 text-xs text-rose-100/80"> <div className="flex items-center gap-2 border-b border-white/5 px-4 py-2 text-xs text-fuchsia-100/80">
<span className="live-dot" /> <span className="live-dot-douyin" />
实时动态条 实时动态条
</div> </div>
<div className="relative overflow-hidden py-3"> <div className="relative overflow-hidden py-3">
@ -697,9 +694,9 @@ export default function HomePage() {
if ("last_status" in item) { if ("last_status" in item) {
return ( return (
<a key={`live-${item.id}-${idx}`} href={item.url} target="_blank" rel="noreferrer" className="inline-flex items-center gap-2 whitespace-nowrap hover:text-white"> <a key={`live-${item.id}-${idx}`} href={item.url} target="_blank" rel="noreferrer" className="inline-flex items-center gap-2 whitespace-nowrap hover:text-white">
<span>🔴</span> <span className="live-dot-douyin" />
<span className="font-medium">{item.last_anchor || item.room_id}</span> <span className="font-medium">{item.last_anchor || item.room_id}</span>
<span className="text-slate-500">在播中</span> <span className="text-fuchsia-300/70">抖音·在播</span>
</a> </a>
); );
} }

View File

@ -861,9 +861,14 @@ export default function ShortsPage() {
) : null} ) : null}
</td> </td>
<td className="px-3 py-2"> <td className="px-3 py-2">
<span className={Number(ch.active) > 0 || ch.last_status === "live" ? "text-rose-300" : "text-slate-500"}> {Number(ch.active) > 0 || ch.last_status === "live" ? (
{Number(ch.active) > 0 || ch.last_status === "live" ? "LIVE" : ch.last_status || "offline"} <span className="inline-flex items-center gap-1 text-[11px] font-semibold text-red-200">
<span className="live-dot-youtube" />
YT·LIVE
</span> </span>
) : (
<span className="text-slate-500">{ch.last_status || "offline"}</span>
)}
</td> </td>
<td className="px-3 py-2 tabular-nums">{ch.sessions ?? 0}</td> <td className="px-3 py-2 tabular-nums">{ch.sessions ?? 0}</td>
<td className="px-3 py-2 tabular-nums">{Number(ch.hours_total || 0).toFixed(1)}</td> <td className="px-3 py-2 tabular-nums">{Number(ch.hours_total || 0).toFixed(1)}</td>

View File

@ -50,7 +50,7 @@ export function YtRelayLiveLogCard({ row, pollMs = 3500, onRefresh }: Props) {
<div className="flex flex-wrap items-center gap-2"> <div className="flex flex-wrap items-center gap-2">
<h3 className="text-sm font-semibold text-white">当前直播日志</h3> <h3 className="text-sm font-semibold text-white">当前直播日志</h3>
<span className={`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-[10px] font-medium ring-1 ${businessStatusBadgeClass(row)}`}> <span className={`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-[10px] font-medium ring-1 ${businessStatusBadgeClass(row)}`}>
{pushingNow ? <span className="live-dot" /> : null} {pushingNow ? <span className="live-dot-youtube" /> : null}
{statusLabel} {statusLabel}
</span> </span>
<span className="rounded-full bg-zinc-500/15 px-2 py-0.5 text-[10px] font-medium text-zinc-200 ring-1 ring-zinc-500/25"> <span className="rounded-full bg-zinc-500/15 px-2 py-0.5 text-[10px] font-medium text-zinc-200 ring-1 ring-zinc-500/25">

View File

@ -15,6 +15,11 @@ FILES = [
"frontend/src/components/Shell.tsx", "frontend/src/components/Shell.tsx",
"frontend/src/components/YouTubeLiveTicker.tsx", "frontend/src/components/YouTubeLiveTicker.tsx",
"frontend/src/app/youtube/health/page.tsx", "frontend/src/app/youtube/health/page.tsx",
"frontend/src/app/page.tsx",
"frontend/src/app/anchors/page.tsx",
"frontend/src/components/YtRelayLiveLogCard.tsx",
"frontend/src/app/groups/page.tsx",
"frontend/src/app/shorts/page.tsx",
] ]
c = paramiko.SSHClient() c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.set_missing_host_key_policy(paramiko.AutoAddPolicy())