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
+11 -11
View File
@@ -224,7 +224,7 @@ export function HomePage({ session, onNavigate, initialState }: HomePageProps) {
)}
<section className="operations-command-grid" aria-label="平台运营模块">
<article className="console-panel operations-module" aria-label="任务脉冲">
<article className="console-panel console-module" aria-label="任务脉冲">
<div className="panel-header">
<h2><Workflow size={16} /> </h2>
<span className="page-status">{moduleFreshnessLabel(core.status === "ready" ? core.refreshedAt : core.refreshedAt)}</span>
@@ -233,20 +233,20 @@ export function HomePage({ session, onNavigate, initialState }: HomePageProps) {
{core.status === "error" && <ErrorState title="任务状态不可用" reason={core.reason} diagnosticId={core.diagnosticId} onRetry={() => void refreshCore()} compact />}
{core.status === "ready" && jobs && (
<>
<dl className="operations-pulse-strip">
<dl className="console-stat-strip">
<div><dt></dt><dd>{jobs.active.length}</dd></div>
<div><dt></dt><dd>{jobs.retrying.length}</dd></div>
<div><dt></dt><dd>{jobs.failed.length}</dd></div>
</dl>
{jobs.active.length === 0 && jobs.failed.length === 0 ? (
<p className="operations-module-empty"></p>
<p className="console-empty-note"></p>
) : (
<div className="operations-job-list">
<div className="console-row-list">
{[...jobs.active.slice(0, 3), ...jobs.failed.slice(0, 2)].map((job) => (
<button
key={job.id}
type="button"
className={cx("operations-job-row", job.state === "failed" && "operations-job-row-failed")}
className={cx("console-row console-row-button", job.state === "failed" && "console-row-danger")}
onClick={() => onNavigate(job.serverInstanceId ? "serverDetail" : "maintenance", job.serverInstanceId ? { serverId: job.serverInstanceId } : undefined)}
>
<span><strong>{job.capability}</strong><small>{job.serverInstanceId ? `服务器 ${job.serverInstanceId}` : "平台任务"}</small></span>
@@ -260,7 +260,7 @@ export function HomePage({ session, onNavigate, initialState }: HomePageProps) {
)}
</article>
<article className="console-panel operations-module" aria-label="运行节点状态">
<article className="console-panel console-module" aria-label="运行节点状态">
<div className="panel-header">
<h2><ServerCog size={16} /> </h2>
<button type="button" className="icon-command" onClick={() => onNavigate("maintenance")}><CircleGauge size={14} /> </button>
@@ -269,17 +269,17 @@ export function HomePage({ session, onNavigate, initialState }: HomePageProps) {
{core.status === "error" && <ErrorState title="节点状态不可用" reason={core.reason} diagnosticId={core.diagnosticId} onRetry={() => void refreshCore()} compact />}
{core.status === "ready" && endpointSummary && (
<>
<dl className="operations-pulse-strip">
<dl className="console-stat-strip">
<div><dt>线</dt><dd>{endpointSummary.online}</dd></div>
<div><dt></dt><dd>{endpointSummary.activeJobs}</dd></div>
<div><dt></dt><dd>{endpointSummary.queuedJobs}</dd></div>
</dl>
{core.data.endpoints.length === 0 ? (
<p className="operations-module-empty">Platform </p>
<p className="console-empty-note">Platform </p>
) : (
<div className="operations-endpoint-list">
<div className="console-row-list">
{core.data.endpoints.slice(0, 4).map((endpoint) => (
<div key={endpoint.id} className="operations-endpoint-row">
<div key={endpoint.id} className="console-row">
<span><strong>{endpoint.displayName}</strong><small>{endpoint.version}</small></span>
<span className={cx("status-pill", `status-${endpoint.status}`)}>{endpointStatusLabel(endpoint.status)}</span>
<span>{endpoint.capacity.runningJobs}/{endpoint.capacity.maxJobs} </span>
@@ -311,7 +311,7 @@ export function HomePage({ session, onNavigate, initialState }: HomePageProps) {
<UsageMeter label="内存" percent={metricAverages.memory} />
<UsageMeter label="磁盘" percent={metricAverages.disk} />
</div>
<span className="operations-module-freshness">{moduleFreshnessLabel(metricAverages.refreshedAt)}</span>
<span className="console-note">{moduleFreshnessLabel(metricAverages.refreshedAt)}</span>
{(usage.status === "error" || metrics.status === "error") && (
<button type="button" className="operations-inline-warning" onClick={() => { void refreshUsage(); void refreshMetrics(); }}>
<AlertTriangle size={14} />