fix: show anchor names on blacklist; redesign settings with tabs
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
e959325772
commit
c4fcc086be
@ -1366,12 +1366,53 @@ def is_blacklisted(room_id: str, url: str = "") -> dict[str, Any] | None:
|
|||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
|
||||||
|
def _blacklist_resolve_anchor(conn: sqlite3.Connection, room_id: str, value: str) -> str:
|
||||||
|
rid = (room_id or "").strip()
|
||||||
|
val = (value or "").strip()
|
||||||
|
if rid:
|
||||||
|
row = conn.execute(
|
||||||
|
"SELECT last_anchor, note FROM rooms WHERE room_id = ? ORDER BY updated_at DESC LIMIT 1",
|
||||||
|
(rid,),
|
||||||
|
).fetchone()
|
||||||
|
if row:
|
||||||
|
name = str(row["last_anchor"] or row["note"] or "").strip()
|
||||||
|
if name:
|
||||||
|
return name
|
||||||
|
row = conn.execute(
|
||||||
|
"SELECT anchor_name FROM sessions WHERE room_id = ? ORDER BY started_at DESC LIMIT 1",
|
||||||
|
(rid,),
|
||||||
|
).fetchone()
|
||||||
|
if row and row["anchor_name"]:
|
||||||
|
return str(row["anchor_name"]).strip()
|
||||||
|
if val:
|
||||||
|
row = conn.execute(
|
||||||
|
"""
|
||||||
|
SELECT last_anchor, note FROM rooms
|
||||||
|
WHERE room_id = ? OR url LIKE ? OR note LIKE ? OR last_anchor LIKE ?
|
||||||
|
ORDER BY updated_at DESC LIMIT 1
|
||||||
|
""",
|
||||||
|
(val, f"%{val}%", f"%{val}%", f"%{val}%"),
|
||||||
|
).fetchone()
|
||||||
|
if row:
|
||||||
|
name = str(row["last_anchor"] or row["note"] or "").strip()
|
||||||
|
if name:
|
||||||
|
return name
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
def list_blacklist() -> list[dict[str, Any]]:
|
def list_blacklist() -> list[dict[str, Any]]:
|
||||||
with _lock:
|
with _lock:
|
||||||
conn = _connect()
|
conn = _connect()
|
||||||
try:
|
try:
|
||||||
rows = conn.execute("SELECT * FROM blacklist ORDER BY created_at DESC").fetchall()
|
rows = conn.execute("SELECT * FROM blacklist ORDER BY created_at DESC").fetchall()
|
||||||
return [dict(r) for r in rows]
|
items: list[dict[str, Any]] = []
|
||||||
|
for row in rows:
|
||||||
|
item = dict(row)
|
||||||
|
item["anchor_name"] = _blacklist_resolve_anchor(
|
||||||
|
conn, str(item.get("room_id") or ""), str(item.get("value") or "")
|
||||||
|
)
|
||||||
|
items.append(item)
|
||||||
|
return items
|
||||||
finally:
|
finally:
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ type Item = {
|
|||||||
id: string;
|
id: string;
|
||||||
value: string;
|
value: string;
|
||||||
room_id?: string;
|
room_id?: string;
|
||||||
|
anchor_name?: string;
|
||||||
reason?: string;
|
reason?: string;
|
||||||
created_at?: number;
|
created_at?: number;
|
||||||
};
|
};
|
||||||
@ -65,9 +66,10 @@ export default function BlacklistPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function remove(item: Item) {
|
async function remove(item: Item) {
|
||||||
|
const label = item.anchor_name || item.value;
|
||||||
const ok = await confirm({
|
const ok = await confirm({
|
||||||
title: "移出黑名单",
|
title: "移出黑名单",
|
||||||
message: `确定移除「${item.value}」?相关房间将恢复可监控状态。`,
|
message: `确定移除「${label}」?相关房间将恢复可监控状态。`,
|
||||||
confirmLabel: "移除",
|
confirmLabel: "移除",
|
||||||
destructive: true,
|
destructive: true,
|
||||||
});
|
});
|
||||||
@ -132,8 +134,9 @@ export default function BlacklistPage() {
|
|||||||
<table className="min-w-full text-left text-sm">
|
<table className="min-w-full text-left text-sm">
|
||||||
<thead className="bg-white/5 text-xs uppercase text-slate-400">
|
<thead className="bg-white/5 text-xs uppercase text-slate-400">
|
||||||
<tr>
|
<tr>
|
||||||
<th className="px-3 py-3">内容</th>
|
<th className="px-3 py-3">直播间名称</th>
|
||||||
<th className="px-3 py-3">房间号</th>
|
<th className="px-3 py-3">房间号</th>
|
||||||
|
<th className="px-3 py-3">匹配内容</th>
|
||||||
<th className="px-3 py-3">原因</th>
|
<th className="px-3 py-3">原因</th>
|
||||||
<th className="px-3 py-3">时间</th>
|
<th className="px-3 py-3">时间</th>
|
||||||
<th className="px-3 py-3">操作</th>
|
<th className="px-3 py-3">操作</th>
|
||||||
@ -142,8 +145,11 @@ export default function BlacklistPage() {
|
|||||||
<tbody>
|
<tbody>
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<tr key={item.id} className="border-t border-white/5">
|
<tr key={item.id} className="border-t border-white/5">
|
||||||
<td className="px-3 py-3 font-mono text-xs">{item.value}</td>
|
<td className="px-3 py-3 font-medium text-slate-100">{item.anchor_name || "—"}</td>
|
||||||
<td className="px-3 py-3">{item.room_id || "—"}</td>
|
<td className="px-3 py-3 font-mono text-xs text-slate-300">{item.room_id || "—"}</td>
|
||||||
|
<td className="max-w-[12rem] truncate px-3 py-3 font-mono text-xs text-slate-400" title={item.value}>
|
||||||
|
{item.value}
|
||||||
|
</td>
|
||||||
<td className="px-3 py-3 text-slate-400">{item.reason || "—"}</td>
|
<td className="px-3 py-3 text-slate-400">{item.reason || "—"}</td>
|
||||||
<td className="px-3 py-3 text-slate-400">{fmtTs(item.created_at)}</td>
|
<td className="px-3 py-3 text-slate-400">{fmtTs(item.created_at)}</td>
|
||||||
<td className="px-3 py-3">
|
<td className="px-3 py-3">
|
||||||
|
|||||||
@ -13,6 +13,7 @@ type Item = {
|
|||||||
id: string;
|
id: string;
|
||||||
value: string;
|
value: string;
|
||||||
room_id?: string;
|
room_id?: string;
|
||||||
|
anchor_name?: string;
|
||||||
reason?: string;
|
reason?: string;
|
||||||
created_at?: number;
|
created_at?: number;
|
||||||
};
|
};
|
||||||
@ -67,9 +68,10 @@ export default function BlacklistPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function remove(item: Item) {
|
async function remove(item: Item) {
|
||||||
|
const label = item.anchor_name || item.value;
|
||||||
const ok = await confirm({
|
const ok = await confirm({
|
||||||
title: "移出黑名单",
|
title: "移出黑名单",
|
||||||
message: `确定移除「${item.value}」?相关房间将恢复可监控状态。`,
|
message: `确定移除「${label}」?相关房间将恢复可监控状态。`,
|
||||||
confirmLabel: "移除",
|
confirmLabel: "移除",
|
||||||
destructive: true,
|
destructive: true,
|
||||||
});
|
});
|
||||||
@ -131,11 +133,12 @@ export default function BlacklistPage() {
|
|||||||
<EmptyState emoji="🚫" title="黑名单为空" desc="添加房间号、URL 或关键词后,命中项将自动停用并不再轮询。" />
|
<EmptyState emoji="🚫" title="黑名单为空" desc="添加房间号、URL 或关键词后,命中项将自动停用并不再轮询。" />
|
||||||
) : (
|
) : (
|
||||||
<div className="table-scroll overflow-hidden rounded-xl border border-white/10 bg-black/20">
|
<div className="table-scroll overflow-hidden rounded-xl border border-white/10 bg-black/20">
|
||||||
<table className="min-w-[560px] w-full text-left text-sm">
|
<table className="min-w-[640px] w-full text-left text-sm">
|
||||||
<thead className="bg-white/5 text-xs uppercase text-slate-400">
|
<thead className="bg-white/5 text-xs uppercase text-slate-400">
|
||||||
<tr>
|
<tr>
|
||||||
<th className="px-3 py-3">内容</th>
|
<th className="px-3 py-3">直播间名称</th>
|
||||||
<th className="px-3 py-3">房间号</th>
|
<th className="px-3 py-3">房间号</th>
|
||||||
|
<th className="px-3 py-3">匹配内容</th>
|
||||||
<th className="px-3 py-3">原因</th>
|
<th className="px-3 py-3">原因</th>
|
||||||
<th className="px-3 py-3">时间</th>
|
<th className="px-3 py-3">时间</th>
|
||||||
<th className="px-3 py-3">操作</th>
|
<th className="px-3 py-3">操作</th>
|
||||||
@ -144,10 +147,15 @@ export default function BlacklistPage() {
|
|||||||
<tbody>
|
<tbody>
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<tr key={item.id} className="border-t border-white/5">
|
<tr key={item.id} className="border-t border-white/5">
|
||||||
<td className="px-3 py-3 font-mono text-xs">{item.value}</td>
|
<td className="px-3 py-3 font-medium text-slate-100">
|
||||||
<td className="px-3 py-3">{item.room_id || "—"}</td>
|
{item.anchor_name || <span className="text-slate-500">—</span>}
|
||||||
|
</td>
|
||||||
|
<td className="px-3 py-3 font-mono text-xs text-slate-300">{item.room_id || "—"}</td>
|
||||||
|
<td className="max-w-[12rem] truncate px-3 py-3 font-mono text-xs text-slate-400" title={item.value}>
|
||||||
|
{item.value}
|
||||||
|
</td>
|
||||||
<td className="px-3 py-3 text-slate-400">{item.reason || "—"}</td>
|
<td className="px-3 py-3 text-slate-400">{item.reason || "—"}</td>
|
||||||
<td className="px-3 py-3 text-slate-400">{fmtTs(item.created_at)}</td>
|
<td className="whitespace-nowrap px-3 py-3 text-slate-400">{fmtTs(item.created_at)}</td>
|
||||||
<td className="px-3 py-3">
|
<td className="px-3 py-3">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState, type ReactNode } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { Loader2, Save, ShieldOff } from "lucide-react";
|
import { Loader2, Save, ShieldOff } from "lucide-react";
|
||||||
|
|
||||||
@ -21,6 +21,73 @@ const FIELDS: Array<{ key: string; label: string; hint: string; step?: number }>
|
|||||||
{ key: "global_pause_on_risk_sec", label: "风控全局暂停(秒)", hint: "触发验证码后全体停检", step: 1 },
|
{ key: "global_pause_on_risk_sec", label: "风控全局暂停(秒)", hint: "触发验证码后全体停检", step: 1 },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
type SettingsTab = "runtime" | "douyin" | "youtube" | "shorts" | "notify" | "advanced" | "account";
|
||||||
|
|
||||||
|
const SETTINGS_TABS: Array<{ id: SettingsTab; label: string; emoji: string }> = [
|
||||||
|
{ id: "runtime", label: "运行", emoji: "📡" },
|
||||||
|
{ id: "douyin", label: "抖音", emoji: "🎬" },
|
||||||
|
{ id: "youtube", label: "YouTube", emoji: "▶️" },
|
||||||
|
{ id: "shorts", label: "Shorts", emoji: "📱" },
|
||||||
|
{ id: "notify", label: "通知", emoji: "🔔" },
|
||||||
|
{ id: "advanced", label: "高级", emoji: "🔧" },
|
||||||
|
{ id: "account", label: "账号", emoji: "🔐" },
|
||||||
|
];
|
||||||
|
|
||||||
|
function SettingsCard({
|
||||||
|
title,
|
||||||
|
desc,
|
||||||
|
children,
|
||||||
|
className = "",
|
||||||
|
}: {
|
||||||
|
title: string;
|
||||||
|
desc?: string;
|
||||||
|
children: ReactNode;
|
||||||
|
className?: string;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<section className={`rounded-2xl border border-white/10 bg-black/25 p-4 sm:p-5 ${className}`}>
|
||||||
|
<div className="mb-4">
|
||||||
|
<h3 className="text-sm font-medium text-slate-100">{title}</h3>
|
||||||
|
{desc ? <p className="mt-1 text-xs leading-relaxed text-slate-500">{desc}</p> : null}
|
||||||
|
</div>
|
||||||
|
{children}
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function TogglePair({
|
||||||
|
enabled,
|
||||||
|
onEnable,
|
||||||
|
onDisable,
|
||||||
|
enableLabel = "启用",
|
||||||
|
disableLabel = "暂停",
|
||||||
|
}: {
|
||||||
|
enabled: boolean;
|
||||||
|
onEnable: () => void;
|
||||||
|
onDisable: () => void;
|
||||||
|
enableLabel?: string;
|
||||||
|
disableLabel?: string;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<div className="inline-flex rounded-xl border border-white/10 bg-black/30 p-1">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={onEnable}
|
||||||
|
className={`rounded-lg px-3 py-1.5 text-sm transition ${enabled ? "bg-teal-500/25 text-teal-100" : "text-slate-400 hover:text-white"}`}
|
||||||
|
>
|
||||||
|
{enableLabel}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={onDisable}
|
||||||
|
className={`rounded-lg px-3 py-1.5 text-sm transition ${!enabled ? "bg-rose-500/20 text-rose-100" : "text-slate-400 hover:text-white"}`}
|
||||||
|
>
|
||||||
|
{disableLabel}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default function SettingsPage() {
|
export default function SettingsPage() {
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [settings, setSettings] = useState<Settings>({});
|
const [settings, setSettings] = useState<Settings>({});
|
||||||
@ -31,6 +98,7 @@ export default function SettingsPage() {
|
|||||||
const [msg, setMsg] = useState("");
|
const [msg, setMsg] = useState("");
|
||||||
const [error, setError] = useState("");
|
const [error, setError] = useState("");
|
||||||
const [notifPerm, setNotifPerm] = useState("default");
|
const [notifPerm, setNotifPerm] = useState("default");
|
||||||
|
const [tab, setTab] = useState<SettingsTab>("runtime");
|
||||||
|
|
||||||
const load = useCallback(async () => {
|
const load = useCallback(async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@ -222,46 +290,197 @@ export default function SettingsPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Shell>
|
<Shell>
|
||||||
<div className="mb-4">
|
<div className="mb-5 flex flex-wrap items-start justify-between gap-3">
|
||||||
<h2 className="font-display text-2xl font-semibold">⚙️ 设置中心</h2>
|
<div>
|
||||||
<p className="text-sm text-slate-400">防风控参数、Cookie/代理、Webhook 通知。</p>
|
<h2 className="font-display text-2xl font-semibold">⚙️ 设置</h2>
|
||||||
|
<p className="mt-1 text-sm text-slate-400">按模块分组,改完记得点底部「保存设置」。</p>
|
||||||
|
</div>
|
||||||
|
<div className="hidden text-xs text-slate-500 sm:block">
|
||||||
|
{status?.running ? "抖音监控运行中" : "抖音监控已停"} ·{" "}
|
||||||
|
{ytStatus?.running ? "YouTube 轮询中" : "YouTube 已停"}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mb-4 flex flex-wrap items-center gap-3 rounded-xl border border-white/10 bg-black/30 p-4 text-sm">
|
<div className="mb-4 -mx-1 flex gap-1.5 overflow-x-auto px-1 pb-1">
|
||||||
<span>监控开关:</span>
|
{SETTINGS_TABS.map((item) => (
|
||||||
<button type="button" onClick={() => void toggleMonitor(true)} className={`rounded-lg px-3 py-1.5 ${settings.monitor_enabled ? "bg-teal-500/20 text-teal-100" : "bg-white/5"}`}>启用</button>
|
<button
|
||||||
<button type="button" onClick={() => void toggleMonitor(false)} className={`rounded-lg px-3 py-1.5 ${!settings.monitor_enabled ? "bg-rose-500/20 text-rose-100" : "bg-white/5"}`}>暂停</button>
|
key={item.id}
|
||||||
<button type="button" onClick={() => void clearRisk()} className="inline-flex items-center gap-1 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-1.5 text-amber-100">
|
type="button"
|
||||||
|
onClick={() => setTab(item.id)}
|
||||||
|
className={`shrink-0 rounded-xl px-3 py-2 text-sm transition ${
|
||||||
|
tab === item.id
|
||||||
|
? "bg-teal-500/20 text-teal-100 ring-1 ring-teal-400/35"
|
||||||
|
: "bg-white/5 text-slate-400 hover:bg-white/10 hover:text-slate-200"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<span className="mr-1">{item.emoji}</span>
|
||||||
|
{item.label}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="space-y-4 pb-24">
|
||||||
|
{tab === "runtime" ? (
|
||||||
|
<>
|
||||||
|
<SettingsCard title="抖音监控" desc="主轮询开关与风控恢复。">
|
||||||
|
<div className="flex flex-wrap items-center gap-3">
|
||||||
|
<TogglePair
|
||||||
|
enabled={Boolean(settings.monitor_enabled)}
|
||||||
|
onEnable={() => void toggleMonitor(true)}
|
||||||
|
onDisable={() => void toggleMonitor(false)}
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => void clearRisk()}
|
||||||
|
className="inline-flex items-center gap-1 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-1.5 text-sm text-amber-100"
|
||||||
|
>
|
||||||
<ShieldOff className="h-3.5 w-3.5" />
|
<ShieldOff className="h-3.5 w-3.5" />
|
||||||
清除风控暂停
|
清除风控暂停
|
||||||
</button>
|
</button>
|
||||||
<span className="text-slate-400">
|
<span className="text-sm text-slate-400">
|
||||||
状态:{status?.running ? "循环运行中" : "未运行"} · 上次检查 {fmtTs(Number(status?.last_check_at || 0))}
|
{status?.running ? "循环运行中" : "未运行"} · 上次 {fmtTs(Number(status?.last_check_at || 0))}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
</SettingsCard>
|
||||||
|
|
||||||
<div className="mb-4 space-y-3 rounded-xl border border-white/10 bg-black/30 p-4 text-sm">
|
<SettingsCard title="YouTube 分组轮询" desc="与上方通知开关配合;静默时段内自动暂停。">
|
||||||
<div className="flex flex-wrap items-center gap-3">
|
<div className="flex flex-wrap items-center gap-3">
|
||||||
<span>YouTube 分组轮询:</span>
|
<TogglePair
|
||||||
<button
|
enabled={settings.yt_monitor_enabled !== false}
|
||||||
type="button"
|
onEnable={() => void toggleYtMonitor(true)}
|
||||||
onClick={() => void toggleYtMonitor(true)}
|
onDisable={() => void toggleYtMonitor(false)}
|
||||||
className={`rounded-lg px-3 py-1.5 ${settings.yt_monitor_enabled !== false ? "bg-teal-500/20 text-teal-100" : "bg-white/5"}`}
|
/>
|
||||||
>
|
<span className="text-sm text-slate-400">
|
||||||
启用
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => void toggleYtMonitor(false)}
|
|
||||||
className={`rounded-lg px-3 py-1.5 ${settings.yt_monitor_enabled === false ? "bg-rose-500/20 text-rose-100" : "bg-white/5"}`}
|
|
||||||
>
|
|
||||||
暂停
|
|
||||||
</button>
|
|
||||||
<span className="text-slate-400">
|
|
||||||
{ytStatus?.running ? "循环运行中" : "未运行"} · 直播 {String((ytStatus?.groups as any)?.live ?? "—")} · 启用{" "}
|
{ytStatus?.running ? "循环运行中" : "未运行"} · 直播 {String((ytStatus?.groups as any)?.live ?? "—")} · 启用{" "}
|
||||||
{String((ytStatus?.groups as any)?.enabled ?? "—")} · 上次 {fmtTs(Number(ytStatus?.last_check_at || 0))}
|
{String((ytStatus?.groups as any)?.enabled ?? "—")} · 上次 {fmtTs(Number(ytStatus?.last_check_at || 0))}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<p className="mt-3 text-xs text-slate-500">轮询间隔等参数在「YouTube」标签页。</p>
|
||||||
|
</SettingsCard>
|
||||||
|
|
||||||
|
<SettingsCard title="Shorts 旁路" desc="默认关闭,不影响抖音监控主路径。">
|
||||||
|
<div className="flex flex-wrap items-center gap-3">
|
||||||
|
<TogglePair
|
||||||
|
enabled={Boolean(settings.shorts_enabled)}
|
||||||
|
onEnable={() => void toggleShorts(true)}
|
||||||
|
onDisable={() => void toggleShorts(false)}
|
||||||
|
enableLabel="启用"
|
||||||
|
disableLabel="关闭"
|
||||||
|
/>
|
||||||
|
<Link href="/shorts" className="rounded-lg border border-white/10 bg-white/5 px-3 py-1.5 text-xs text-slate-300 hover:bg-white/10">
|
||||||
|
管理频道 / 任务 →
|
||||||
|
</Link>
|
||||||
|
<span className="text-sm text-slate-400">
|
||||||
|
{shortsStatus?.running ? "worker 运行中" : "worker 未运行"} ·{" "}
|
||||||
|
{shortsStatus?.enabled ? "已启用" : "已关闭"}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p className="mt-3 text-xs text-slate-500">采样、OAuth、SOCKS 等详细配置在「Shorts」标签页。</p>
|
||||||
|
</SettingsCard>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{tab === "douyin" ? (
|
||||||
|
<>
|
||||||
|
<SettingsCard title="轮询参数" desc="防风控核心参数,一般保持默认即可。">
|
||||||
|
<div className="grid gap-3 sm:grid-cols-2">
|
||||||
|
{FIELDS.map((f) => (
|
||||||
|
<label key={f.key} className="rounded-xl border border-white/10 bg-black/20 p-3 text-sm">
|
||||||
|
<div className="font-medium text-slate-200">{f.label}</div>
|
||||||
|
<div className="mt-0.5 text-[11px] text-slate-500">{f.hint}</div>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
step={f.step || 1}
|
||||||
|
value={Number(settings[f.key] ?? 0)}
|
||||||
|
onChange={(e) => setSettings((prev) => ({ ...prev, [f.key]: Number(e.target.value) }))}
|
||||||
|
className="mt-2 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</SettingsCard>
|
||||||
|
|
||||||
|
<SettingsCard title="静默时段 / 重点加速" desc="北京时间;普通房暂停轮询,收藏/重点房可继续。">
|
||||||
|
<div className="space-y-3">
|
||||||
|
<label className="inline-flex items-center gap-2 text-sm">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={Boolean(settings.quiet_hours_enabled)}
|
||||||
|
onChange={(e) => setSettings((prev) => ({ ...prev, quiet_hours_enabled: e.target.checked }))}
|
||||||
|
/>
|
||||||
|
启用静默时段
|
||||||
|
</label>
|
||||||
|
<label className="inline-flex items-center gap-2 text-sm">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={settings.quiet_hours_allow_priority !== false}
|
||||||
|
onChange={(e) => setSettings((prev) => ({ ...prev, quiet_hours_allow_priority: e.target.checked }))}
|
||||||
|
/>
|
||||||
|
静默时段仍探测「收藏 / 重点 / priority / vip / 高优」
|
||||||
|
</label>
|
||||||
|
<div className="grid gap-3 sm:grid-cols-3">
|
||||||
|
<label className="block text-xs text-slate-400">
|
||||||
|
开始小时 (0-23)
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
min={0}
|
||||||
|
max={23}
|
||||||
|
value={Number(settings.quiet_hours_start ?? 2)}
|
||||||
|
onChange={(e) => setSettings((prev) => ({ ...prev, quiet_hours_start: Number(e.target.value) }))}
|
||||||
|
className="mt-1 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<label className="block text-xs text-slate-400">
|
||||||
|
结束小时 (0-23)
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
min={0}
|
||||||
|
max={23}
|
||||||
|
value={Number(settings.quiet_hours_end ?? 7)}
|
||||||
|
onChange={(e) => setSettings((prev) => ({ ...prev, quiet_hours_end: Number(e.target.value) }))}
|
||||||
|
className="mt-1 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<label className="block text-xs text-slate-400">
|
||||||
|
重点标签复查间隔(秒)
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
value={Number(settings.priority_interval_sec ?? 25)}
|
||||||
|
onChange={(e) => setSettings((prev) => ({ ...prev, priority_interval_sec: Number(e.target.value) }))}
|
||||||
|
className="mt-1 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</SettingsCard>
|
||||||
|
|
||||||
|
<SettingsCard title="Cookie / 代理" desc="降低抖音接口风控概率。">
|
||||||
|
<div className="space-y-3">
|
||||||
|
<label className="block text-xs text-slate-400">
|
||||||
|
抖音 Cookie(浏览器登录后复制)
|
||||||
|
<textarea
|
||||||
|
value={String(settings.dy_cookie || "")}
|
||||||
|
onChange={(e) => setSettings((prev) => ({ ...prev, dy_cookie: e.target.value }))}
|
||||||
|
rows={3}
|
||||||
|
className="mt-1 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2 font-mono text-xs"
|
||||||
|
placeholder="ttwid=...; ..."
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<label className="block text-xs text-slate-400">
|
||||||
|
HTTP 代理(可选,如 http://127.0.0.1:7890)
|
||||||
|
<input
|
||||||
|
value={String(settings.http_proxy || "")}
|
||||||
|
onChange={(e) => setSettings((prev) => ({ ...prev, http_proxy: e.target.value }))}
|
||||||
|
className="mt-1 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2 text-sm"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</SettingsCard>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{tab === "youtube" ? (
|
||||||
|
<SettingsCard title="YouTube 轮询参数" desc="分组频道开播/停播检测间隔。">
|
||||||
<div className="grid gap-3 md:grid-cols-2 lg:grid-cols-4">
|
<div className="grid gap-3 md:grid-cols-2 lg:grid-cols-4">
|
||||||
{(
|
{(
|
||||||
[
|
[
|
||||||
@ -282,35 +501,12 @@ export default function SettingsPage() {
|
|||||||
</label>
|
</label>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xs text-slate-500">开播/停播沿用上方「Webhook / 浏览器通知」开关;静默时段内暂停 YouTube 轮询。</p>
|
<p className="mt-3 text-xs text-slate-500">开播/停播通知沿用「通知」标签页中的 Webhook 开关。</p>
|
||||||
</div>
|
</SettingsCard>
|
||||||
|
) : null}
|
||||||
|
|
||||||
<div className="mb-4 space-y-3 rounded-xl border border-dashed border-amber-500/25 bg-black/30 p-4 text-sm">
|
{tab === "shorts" ? (
|
||||||
<div className="flex flex-wrap items-center gap-3">
|
<div className="space-y-3 rounded-2xl border border-dashed border-amber-500/25 bg-black/30 p-4 text-sm">
|
||||||
<span>Shorts 旁路(默认关,不影响监控):</span>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => void toggleShorts(true)}
|
|
||||||
className={`rounded-lg px-3 py-1.5 ${settings.shorts_enabled ? "bg-amber-500/20 text-amber-100" : "bg-white/5"}`}
|
|
||||||
>
|
|
||||||
启用
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => void toggleShorts(false)}
|
|
||||||
className={`rounded-lg px-3 py-1.5 ${!settings.shorts_enabled ? "bg-rose-500/20 text-rose-100" : "bg-white/5"}`}
|
|
||||||
>
|
|
||||||
关闭
|
|
||||||
</button>
|
|
||||||
<a href="/shorts" className="rounded-lg border border-white/10 bg-white/5 px-3 py-1.5 text-xs text-slate-300 hover:bg-white/10">
|
|
||||||
管理频道 / 任务 →
|
|
||||||
</a>
|
|
||||||
<span className="text-slate-400">
|
|
||||||
{shortsStatus?.running ? "worker 运行中" : "worker 未运行"} ·{" "}
|
|
||||||
{shortsStatus?.enabled ? "已启用" : "已关闭"} · 今日{" "}
|
|
||||||
{JSON.stringify((shortsStatus?.stats as any)?.by_status || {})}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className="grid gap-3 md:grid-cols-2 lg:grid-cols-4">
|
<div className="grid gap-3 md:grid-cols-2 lg:grid-cols-4">
|
||||||
<label className="block text-xs text-slate-400">
|
<label className="block text-xs text-slate-400">
|
||||||
触发方式
|
触发方式
|
||||||
@ -830,103 +1026,13 @@ export default function SettingsPage() {
|
|||||||
Shorts 页新建/编辑频道时选择配置档 A/B/C/D,再点「Google 授权」登录对应谷歌账号即可。
|
Shorts 页新建/编辑频道时选择配置档 A/B/C/D,再点「Google 授权」登录对应谷歌账号即可。
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
) : null}
|
||||||
|
|
||||||
<div className="mb-6 grid gap-3 md:grid-cols-2">
|
{tab === "notify" ? (
|
||||||
{FIELDS.map((f) => (
|
<SettingsCard title="Webhook 通知" desc="开播 / 停播 / 风控 / Shorts / TikTok 等事件推送。">
|
||||||
<label key={f.key} className="rounded-xl border border-white/10 bg-black/25 p-4 text-sm">
|
<div className="space-y-3">
|
||||||
<div className="font-medium text-slate-200">{f.label}</div>
|
|
||||||
<div className="mt-1 text-xs text-slate-500">{f.hint}</div>
|
|
||||||
<input
|
|
||||||
type="number"
|
|
||||||
step={f.step || 1}
|
|
||||||
value={Number(settings[f.key] ?? 0)}
|
|
||||||
onChange={(e) => setSettings((prev) => ({ ...prev, [f.key]: Number(e.target.value) }))}
|
|
||||||
className="mt-2 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mb-6 space-y-3 rounded-xl border border-white/10 bg-black/25 p-4">
|
|
||||||
<h3 className="text-sm font-medium text-slate-200">🌙 静默时段 / 重点加速(北京时间)</h3>
|
|
||||||
<label className="inline-flex items-center gap-2 text-sm">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={Boolean(settings.quiet_hours_enabled)}
|
|
||||||
onChange={(e) => setSettings((prev) => ({ ...prev, quiet_hours_enabled: e.target.checked }))}
|
|
||||||
/>
|
|
||||||
启用静默时段(按北京时间;普通房暂停轮询;重点房可继续探测)
|
|
||||||
</label>
|
|
||||||
<label className="inline-flex items-center gap-2 text-sm">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={settings.quiet_hours_allow_priority !== false}
|
|
||||||
onChange={(e) => setSettings((prev) => ({ ...prev, quiet_hours_allow_priority: e.target.checked }))}
|
|
||||||
/>
|
|
||||||
静默时段仍探测「收藏 / 重点 / priority / vip / 高优」
|
|
||||||
</label>
|
|
||||||
<div className="grid gap-3 sm:grid-cols-3">
|
|
||||||
<label className="block text-xs text-slate-400">
|
<label className="block text-xs text-slate-400">
|
||||||
开始小时 (0-23)
|
Webhook URL(POST JSON)
|
||||||
<input
|
|
||||||
type="number"
|
|
||||||
min={0}
|
|
||||||
max={23}
|
|
||||||
value={Number(settings.quiet_hours_start ?? 2)}
|
|
||||||
onChange={(e) => setSettings((prev) => ({ ...prev, quiet_hours_start: Number(e.target.value) }))}
|
|
||||||
className="mt-1 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
<label className="block text-xs text-slate-400">
|
|
||||||
结束小时 (0-23)
|
|
||||||
<input
|
|
||||||
type="number"
|
|
||||||
min={0}
|
|
||||||
max={23}
|
|
||||||
value={Number(settings.quiet_hours_end ?? 7)}
|
|
||||||
onChange={(e) => setSettings((prev) => ({ ...prev, quiet_hours_end: Number(e.target.value) }))}
|
|
||||||
className="mt-1 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
<label className="block text-xs text-slate-400">
|
|
||||||
重点标签复查间隔(秒)
|
|
||||||
<input
|
|
||||||
type="number"
|
|
||||||
value={Number(settings.priority_interval_sec ?? 25)}
|
|
||||||
onChange={(e) => setSettings((prev) => ({ ...prev, priority_interval_sec: Number(e.target.value) }))}
|
|
||||||
className="mt-1 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<p className="text-xs text-slate-500">点「收藏」会打上「收藏 + 重点」标签,优先检查、间隔更短;也可在各页快捷拉黑。</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mb-6 space-y-3 rounded-xl border border-white/10 bg-black/25 p-4">
|
|
||||||
<h3 className="text-sm font-medium text-slate-200">Cookie / 代理(降低风控)</h3>
|
|
||||||
<label className="block text-xs text-slate-400">
|
|
||||||
抖音 Cookie(浏览器登录后复制)
|
|
||||||
<textarea
|
|
||||||
value={String(settings.dy_cookie || "")}
|
|
||||||
onChange={(e) => setSettings((prev) => ({ ...prev, dy_cookie: e.target.value }))}
|
|
||||||
rows={3}
|
|
||||||
className="mt-1 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2 font-mono text-xs"
|
|
||||||
placeholder="ttwid=...; ..."
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
<label className="block text-xs text-slate-400">
|
|
||||||
HTTP 代理(可选,如 http://127.0.0.1:7890)
|
|
||||||
<input
|
|
||||||
value={String(settings.http_proxy || "")}
|
|
||||||
onChange={(e) => setSettings((prev) => ({ ...prev, http_proxy: e.target.value }))}
|
|
||||||
className="mt-1 w-full rounded-lg border border-white/10 bg-slate-900 px-3 py-2 text-sm"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mb-6 space-y-3 rounded-xl border border-white/10 bg-black/25 p-4">
|
|
||||||
<h3 className="text-sm font-medium text-slate-200">Webhook 通知</h3>
|
|
||||||
<label className="block text-xs text-slate-400">
|
|
||||||
Webhook URL(开播/停播/风控 POST JSON)
|
|
||||||
<input
|
<input
|
||||||
value={String(settings.notify_webhook_url || "")}
|
value={String(settings.notify_webhook_url || "")}
|
||||||
onChange={(e) => setSettings((prev) => ({ ...prev, notify_webhook_url: e.target.value }))}
|
onChange={(e) => setSettings((prev) => ({ ...prev, notify_webhook_url: e.target.value }))}
|
||||||
@ -934,7 +1040,7 @@ export default function SettingsPage() {
|
|||||||
placeholder="https://hooks.example.com/..."
|
placeholder="https://hooks.example.com/..."
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<div className="flex flex-wrap gap-4 text-sm">
|
<div className="flex flex-wrap gap-x-4 gap-y-2 text-sm">
|
||||||
{[
|
{[
|
||||||
["notify_on_live", "开播通知"],
|
["notify_on_live", "开播通知"],
|
||||||
["notify_on_offline", "停播通知"],
|
["notify_on_offline", "停播通知"],
|
||||||
@ -1000,10 +1106,13 @@ export default function SettingsPage() {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</SettingsCard>
|
||||||
|
) : null}
|
||||||
|
|
||||||
<div className="mb-6 space-y-3 rounded-xl border border-white/10 bg-black/25 p-4">
|
{tab === "advanced" ? (
|
||||||
<h3 className="text-sm font-medium text-slate-200">运维增强(默认关闭,不影响现有业务)</h3>
|
<>
|
||||||
<div className="grid gap-3 md:grid-cols-2">
|
<SettingsCard title="运维增强" desc="默认关闭,不影响现有业务。">
|
||||||
|
<div className="grid gap-3 sm:grid-cols-2">
|
||||||
{[
|
{[
|
||||||
["db_backup_enabled", "自动备份 monitor.db"],
|
["db_backup_enabled", "自动备份 monitor.db"],
|
||||||
["ops_alerts_enabled", "配额/磁盘/积压预警"],
|
["ops_alerts_enabled", "配额/磁盘/积压预警"],
|
||||||
@ -1022,9 +1131,17 @@ export default function SettingsPage() {
|
|||||||
</label>
|
</label>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className="grid gap-2 md:grid-cols-2">
|
</SettingsCard>
|
||||||
|
<OpsPanel />
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{tab === "account" ? (
|
||||||
|
<div className="space-y-4">
|
||||||
|
<SettingsCard title="只读账号" desc="可浏览全部页面,不能保存或启停 worker。">
|
||||||
|
<div className="grid gap-3 sm:grid-cols-2">
|
||||||
<label className="block text-xs text-slate-400">
|
<label className="block text-xs text-slate-400">
|
||||||
只读账号用户名
|
用户名
|
||||||
<input
|
<input
|
||||||
value={String(settings.readonly_username || "")}
|
value={String(settings.readonly_username || "")}
|
||||||
onChange={(e) => setSettings((prev) => ({ ...prev, readonly_username: e.target.value }))}
|
onChange={(e) => setSettings((prev) => ({ ...prev, readonly_username: e.target.value }))}
|
||||||
@ -1033,7 +1150,7 @@ export default function SettingsPage() {
|
|||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<label className="block text-xs text-slate-400">
|
<label className="block text-xs text-slate-400">
|
||||||
只读账号密码
|
密码
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
value={String(settings.readonly_password || "")}
|
value={String(settings.readonly_password || "")}
|
||||||
@ -1043,25 +1160,30 @@ export default function SettingsPage() {
|
|||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-[11px] text-slate-500">
|
<p className="mt-3 text-[11px] text-slate-500">
|
||||||
只读账号可查看全部页面,不能 POST/保存/启停 worker。备份文件见 API{" "}
|
备份文件列表见 API <code className="text-slate-400">/api/ops/backups</code>。
|
||||||
<code className="text-slate-400">/api/ops/backups</code>。
|
|
||||||
</p>
|
</p>
|
||||||
|
</SettingsCard>
|
||||||
|
<ChangePasswordPanel />
|
||||||
|
<ApiKeyPanel />
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<OpsPanel />
|
<div className="fixed inset-x-0 bottom-[calc(4.5rem+env(safe-area-inset-bottom))] z-30 border-t border-white/10 bg-[#071018]/95 px-4 py-3 backdrop-blur-md md:bottom-0">
|
||||||
|
<div className="mx-auto flex max-w-7xl flex-wrap items-center gap-3">
|
||||||
<ApiKeyPanel />
|
<button
|
||||||
|
type="button"
|
||||||
<ChangePasswordPanel />
|
onClick={() => void save()}
|
||||||
|
className="inline-flex items-center gap-2 rounded-lg bg-[#ff2d55] px-4 py-2 text-sm font-medium text-white hover:bg-[#ff4d6d]"
|
||||||
<div className="flex items-center gap-3">
|
>
|
||||||
<button type="button" onClick={() => void save()} className="inline-flex items-center gap-2 rounded-lg bg-[#ff2d55] px-4 py-2 text-sm font-medium text-white hover:bg-[#ff4d6d]">
|
|
||||||
{loading ? <Loader2 className="h-4 w-4 animate-spin" /> : <Save className="h-4 w-4" />}
|
{loading ? <Loader2 className="h-4 w-4 animate-spin" /> : <Save className="h-4 w-4" />}
|
||||||
保存设置
|
保存设置
|
||||||
</button>
|
</button>
|
||||||
{msg ? <span className="text-sm text-teal-300">{msg}</span> : null}
|
{msg ? <span className="text-sm text-teal-300">{msg}</span> : null}
|
||||||
{error ? <span className="text-sm text-rose-300">{error}</span> : null}
|
{error ? <span className="text-sm text-rose-300">{error}</span> : null}
|
||||||
|
<span className="ml-auto hidden text-xs text-slate-500 sm:inline">当前:{SETTINGS_TABS.find((t) => t.id === tab)?.label}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Shell>
|
</Shell>
|
||||||
);
|
);
|
||||||
@ -1102,9 +1224,7 @@ function ChangePasswordPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-6 rounded-xl border border-white/10 bg-black/25 p-4">
|
<SettingsCard title="修改登录密码" desc="密码哈希存储在服务器;修改成功后将退出登录。">
|
||||||
<h3 className="mb-2 text-sm font-medium text-slate-100">修改登录密码</h3>
|
|
||||||
<p className="mb-3 text-xs text-slate-500">密码保存在服务器数据库(哈希存储)。修改成功后将退出登录,请用新密码重新登录。</p>
|
|
||||||
<div className="grid gap-3 sm:grid-cols-3">
|
<div className="grid gap-3 sm:grid-cols-3">
|
||||||
<label className="block text-xs text-slate-400">
|
<label className="block text-xs text-slate-400">
|
||||||
当前密码
|
当前密码
|
||||||
@ -1149,7 +1269,7 @@ function ChangePasswordPanel() {
|
|||||||
{msg ? <span className="text-xs text-teal-300">{msg}</span> : null}
|
{msg ? <span className="text-xs text-teal-300">{msg}</span> : null}
|
||||||
{error ? <span className="text-xs text-rose-300">{error}</span> : null}
|
{error ? <span className="text-xs text-rose-300">{error}</span> : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</SettingsCard>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1175,15 +1295,12 @@ function ApiKeyPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-6 rounded-xl border border-white/10 bg-black/25 p-4">
|
<SettingsCard title="API Key(写操作保护)" desc="服务端设置 DY_API_KEY 后,POST/PATCH/DELETE 需携带 X-API-Key;密钥仅存浏览器本地。">
|
||||||
<h3 className="mb-2 text-sm font-medium text-slate-100">API Key(写操作保护)</h3>
|
|
||||||
<p className="mb-3 text-xs text-slate-500">
|
<p className="mb-3 text-xs text-slate-500">
|
||||||
服务端设置环境变量 <code className="text-slate-400">DY_API_KEY</code> 后,所有 POST/PATCH/DELETE 需携带请求头{" "}
|
|
||||||
<code className="text-slate-400">X-API-Key</code>。密钥仅存浏览器本地,不会写入服务器设置。
|
|
||||||
{required ? (
|
{required ? (
|
||||||
<span className="ml-1 text-amber-300">当前服务端已启用 Key 校验。</span>
|
<span className="text-amber-300">当前服务端已启用 Key 校验。</span>
|
||||||
) : (
|
) : (
|
||||||
<span className="ml-1 text-slate-600">当前服务端未启用(留空即无限制)。</span>
|
<span className="text-slate-600">当前服务端未启用(留空即无限制)。</span>
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex flex-wrap items-center gap-2">
|
<div className="flex flex-wrap items-center gap-2">
|
||||||
@ -1199,7 +1316,7 @@ function ApiKeyPanel() {
|
|||||||
</button>
|
</button>
|
||||||
{saved ? <span className="text-xs text-teal-300">已保存</span> : null}
|
{saved ? <span className="text-xs text-teal-300">已保存</span> : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</SettingsCard>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1246,7 +1363,7 @@ function OpsPanel() {
|
|||||||
const s3Enabled = Boolean(health?.s3?.enabled);
|
const s3Enabled = Boolean(health?.s3?.enabled);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-6 space-y-3 rounded-xl border border-teal-500/20 bg-teal-500/5 p-4">
|
<div className="space-y-3 rounded-2xl border border-teal-500/20 bg-teal-500/5 p-4 sm:p-5">
|
||||||
<div className="flex flex-wrap items-center justify-between gap-2">
|
<div className="flex flex-wrap items-center justify-between gap-2">
|
||||||
<h3 className="text-sm font-medium text-teal-100">运维:PocketBase / S3 / 封面</h3>
|
<h3 className="text-sm font-medium text-teal-100">运维:PocketBase / S3 / 封面</h3>
|
||||||
<button type="button" onClick={() => void refresh()} className="text-xs text-slate-400 hover:text-white">
|
<button type="button" onClick={() => void refresh()} className="text-xs text-slate-400 hover:text-white">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user