Extend Douyin/YouTube live badge styling to dashboard, groups, and shorts.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
e51df6f35e
commit
c1501f6e16
@ -251,7 +251,7 @@ export default function AnchorsPage() {
|
||||
{a.room_id ? (
|
||||
<DouyinLiveBadge roomId={a.room_id} compact showOffline />
|
||||
) : a.active ? (
|
||||
<LivePulse label="LIVE" />
|
||||
<LivePulse label="DY·LIVE" variant="douyin" />
|
||||
) : null}
|
||||
</div>
|
||||
<div className="mt-1 text-[11px] text-slate-500">
|
||||
@ -275,7 +275,7 @@ export default function AnchorsPage() {
|
||||
{profile.room_id ? (
|
||||
<DouyinLiveBadge roomId={profile.room_id} showOffline />
|
||||
) : profile.overview.active ? (
|
||||
<LivePulse />
|
||||
<LivePulse label="DY·LIVE" variant="douyin" />
|
||||
) : null}
|
||||
</div>
|
||||
<p className="mt-1 font-mono text-xs text-cyan-300/80">{profile.room_id || "—"}</p>
|
||||
|
||||
@ -518,9 +518,14 @@ export default function GroupsPage() {
|
||||
<div className="font-mono text-[10px] text-slate-500">{ch.channel_id || ch.room_id || "—"}</div>
|
||||
</td>
|
||||
<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" ? "LIVE" : ch.last_status || "offline"}
|
||||
</span>
|
||||
{Number(ch.active) > 0 || ch.last_status === "live" ? (
|
||||
<span className="inline-flex items-center gap-1 text-[11px] font-semibold text-red-200">
|
||||
<span className="live-dot-youtube" />
|
||||
YT·LIVE
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-slate-500">{ch.last_status || "offline"}</span>
|
||||
)}
|
||||
</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>
|
||||
|
||||
@ -328,13 +328,10 @@ export default function HomePage() {
|
||||
{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>
|
||||
)}
|
||||
{liveRooms.length > 0 ? <LivePulse label={`抖音 ${liveRooms.length} 路`} /> : null}
|
||||
{liveRooms.length > 0 ? <LivePulse label={`抖音 ${liveRooms.length} 路`} variant="douyin" /> : null}
|
||||
{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">
|
||||
<span className="inline-flex items-center gap-1.5">
|
||||
<span className="live-dot" />
|
||||
YT 在播 {ytLiveCount}
|
||||
</span>
|
||||
<Link href="/groups" className="inline-block hover:opacity-90">
|
||||
<LivePulse label={`YouTube ${ytLiveCount} 路`} variant="youtube" />
|
||||
</Link>
|
||||
) : 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">
|
||||
@ -686,8 +683,8 @@ export default function HomePage() {
|
||||
|
||||
{(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="flex items-center gap-2 border-b border-white/5 px-4 py-2 text-xs text-rose-100/80">
|
||||
<span className="live-dot" />
|
||||
<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-douyin" />
|
||||
实时动态条
|
||||
</div>
|
||||
<div className="relative overflow-hidden py-3">
|
||||
@ -697,9 +694,9 @@ export default function HomePage() {
|
||||
if ("last_status" in item) {
|
||||
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">
|
||||
<span>🔴</span>
|
||||
<span className="live-dot-douyin" />
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
||||
@ -861,9 +861,14 @@ export default function ShortsPage() {
|
||||
) : null}
|
||||
</td>
|
||||
<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" ? "LIVE" : ch.last_status || "offline"}
|
||||
</span>
|
||||
{Number(ch.active) > 0 || ch.last_status === "live" ? (
|
||||
<span className="inline-flex items-center gap-1 text-[11px] font-semibold text-red-200">
|
||||
<span className="live-dot-youtube" />
|
||||
YT·LIVE
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-slate-500">{ch.last_status || "offline"}</span>
|
||||
)}
|
||||
</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>
|
||||
|
||||
@ -50,7 +50,7 @@ export function YtRelayLiveLogCard({ row, pollMs = 3500, onRefresh }: Props) {
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<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)}`}>
|
||||
{pushingNow ? <span className="live-dot" /> : null}
|
||||
{pushingNow ? <span className="live-dot-youtube" /> : null}
|
||||
{statusLabel}
|
||||
</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">
|
||||
|
||||
@ -15,6 +15,11 @@ FILES = [
|
||||
"frontend/src/components/Shell.tsx",
|
||||
"frontend/src/components/YouTubeLiveTicker.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.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user