feat(web): 站点显示 Cloudflare 状态(CF-2)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
16083942c0
commit
f16b97151b
4 files changed
+155
-3
No files matched your search
@@ -29,6 +29,7 @@ import type { SiteDialog, useSiteChecks } from "./site-dialogs.tsx";
|
||||
import {
|
||||
ACCOUNT_OVERALL,
|
||||
bytes,
|
||||
cloudflareLine,
|
||||
dataAccount,
|
||||
hasLogin,
|
||||
healthLine,
|
||||
@@ -291,6 +292,7 @@ function AccountSiteCard({ site, checks, onDialog }: Props) {
|
||||
const hmsg = healthMessage(site.lastHealth);
|
||||
const stale = site.snapshotEnabled && snapshotStale(site);
|
||||
const circuit = circuitLabel(site);
|
||||
const cf = cloudflareLine(site.config);
|
||||
const lastErr = acc && acc.status !== "active" ? acc.lastError : null;
|
||||
|
||||
return (
|
||||
@@ -321,6 +323,15 @@ function AccountSiteCard({ site, checks, onDialog }: Props) {
|
||||
<AccountBadges site={site} />
|
||||
{u?.vip ? <StatusBadge tone="neutral">VIP</StatusBadge> : null}
|
||||
{circuit ? <StatusBadge tone="warning">{circuit}</StatusBadge> : null}
|
||||
{cf ? (
|
||||
cf.takeover ? (
|
||||
<Link to={`${consolePath("sites", site.id)}?tab=origin`} title="在原站视图里接管会话,完成验证后交还">
|
||||
<StatusBadge tone={cf.tone}>{cf.text}</StatusBadge>
|
||||
</Link>
|
||||
) : (
|
||||
<StatusBadge tone={cf.tone}>{cf.text}</StatusBadge>
|
||||
)
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{lastErr ? (
|
||||
|
||||
Reference in new issue
Block a user