fix: 平台构建

This commit is contained in:
npc0-hue
2026-07-22 15:27:26 +08:00
parent 6c3eb6e45f
commit 8e34c8762a
12 changed files with 188 additions and 155 deletions
@@ -69,7 +69,7 @@ export function ProductionGovernancePanel({ compact = false, title = "容量与
const visibleEndpoints = compact ? capacity?.endpoints.slice(0, 3) ?? [] : capacity?.endpoints ?? [];
return (
<section className="console-panel production-governance-panel" aria-label="production capacity and alerts">
<section className="console-panel console-module production-governance-panel" aria-label="production capacity and alerts">
<div className="panel-header">
<h2><AlertTriangle size={16} /> {title}</h2>
<button type="button" className="icon-command" disabled={loading || Boolean(busyKey)} onClick={() => void refresh()} title="刷新容量与告警">
@@ -82,39 +82,39 @@ export function ProductionGovernancePanel({ compact = false, title = "容量与
{!loading && error && <ErrorState title="生产治理状态不可用" reason={error} diagnosticId="production-governance" onRetry={() => void refresh()} compact />}
{!loading && !error && capacity && (
<>
<dl className="operations-pulse-strip production-capacity-strip">
<dl className="console-stat-strip console-stat-strip-spaced">
<div><dt></dt><dd>{capacity.totalRunningJobs}/{capacity.totalMaxJobs}</dd></div>
<div><dt></dt><dd>{capacity.totalQueuedJobs}</dd></div>
<div><dt></dt><dd>{capacity.activeAlerts}</dd></div>
</dl>
<div className="operations-endpoint-list" aria-label="capacity endpoints">
<div className="console-row-list" aria-label="capacity endpoints">
{visibleEndpoints.map((endpoint) => (
<div key={endpoint.runEndpointId} className="operations-endpoint-row">
<div key={endpoint.runEndpointId} className="console-row">
<span><strong>{endpoint.displayName}</strong><small>{endpoint.pressureCodes?.join(", ") || "capacity.available"}</small></span>
<span className={cx("status-pill", endpoint.pressureCodes?.length ? "status-warning" : `status-${endpoint.status}`)}>{endpoint.pressureCodes?.length ? "压力" : endpoint.status}</span>
<span>{endpoint.runningJobs}/{endpoint.maxJobs} · {endpoint.queuedJobs}</span>
</div>
))}
</div>
<div className="operation-list production-alert-list" aria-label="durable alerts">
{visibleAlerts.length === 0 && <p className="operations-module-empty"></p>}
<div className="console-record-list console-record-list-spaced production-alert-list" aria-label="durable alerts">
{visibleAlerts.length === 0 && <p className="console-empty-note"></p>}
{visibleAlerts.map((alert) => {
const pending = busyKey.startsWith(`${alert.id}:`);
return (
<div key={alert.id} className="operation-item">
<div className="operation-item-head">
<div key={alert.id} className="console-record operation-item">
<div className="console-record-head">
<strong>{alert.title}</strong>
<span className={cx("status-pill", alert.severity === "critical" ? "status-failed" : alert.state === "resolved" ? "status-succeeded" : "status-warning")}>{alert.state}</span>
</div>
<p>{alert.message}</p>
<div className="operation-meta">
<div className="console-record-meta">
<span>{alert.sourceKind} · {alert.sourceId}</span>
<span> {alert.occurrenceCount} </span>
{alert.lastJobId && <span> {alert.lastJobId}</span>}
{alert.lastAuditEventId && <span> {alert.lastAuditEventId}</span>}
</div>
{alert.state !== "resolved" && (
<div className="row-actions production-alert-actions">
<div className="row-actions console-row-actions production-alert-actions">
{alert.state === "active" && <button type="button" disabled={pending} onClick={() => setIntent({ alert, action: "acknowledge" })}><Check size={14} /><span></span></button>}
<button type="button" disabled={pending} onClick={() => setIntent({ alert, action: "resolve" })}><CheckCheck size={14} /><span></span></button>
{alert.retryable && <button type="button" disabled={pending} onClick={() => setIntent({ alert, action: "retry" })}><Activity size={14} /><span></span></button>}