Remove task pulse from overview

This commit is contained in:
npc0-hue
2026-08-21 12:12:30 +08:00
parent fb5adf06d6
commit fc86b24699
2 changed files with 2 additions and 46 deletions
+1 -46
View File
@@ -7,8 +7,7 @@ import {
Info,
MoonStar,
RotateCw,
Sparkles,
Workflow
Sparkles
} from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
@@ -120,7 +119,6 @@ export function HomePage({ session, onNavigate, initialState }: HomePageProps) {
}, [core]);
const overviewSignals = useMemo<PlatformOverviewSignal[]>(() => buildOverviewSignals(core, providers), [core, providers]);
const jobs = core.status === "ready" ? jobBuckets(core.data.jobs) : null;
const onlineCount = core.status === "ready" ? core.data.instances.filter((item) => serverIsOnline(item.state)).length : 0;
const offlineCount = core.status === "ready" ? core.data.instances.length - onlineCount : 0;
const activeProviders = providers.status === "ready" ? providers.data.filter((item) => item.status === "active").length : 0;
@@ -198,44 +196,6 @@ export function HomePage({ session, onNavigate, initialState }: HomePageProps) {
</section>
)}
<section className="operations-command-grid" 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>
</div>
{core.status === "loading" && <LoadingState label="正在汇总任务…" compact />}
{core.status === "error" && <ErrorState title="任务状态不可用" reason={core.reason} diagnosticId={core.diagnosticId} onRetry={() => void refreshCore()} compact />}
{core.status === "ready" && jobs && (
<>
<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="console-empty-note"></p>
) : (
<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("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>{jobCapabilityLabel(job.capability)}</strong><small>{job.serverInstanceId ? `服务器 ${job.serverInstanceId}` : "平台任务"}</small></span>
<span>{job.state === "retrying" ? `重试 ${job.attempt}/${job.retryPolicy.maxAttempts}` : jobStateLabel(job.state)}</span>
<span>{Math.round(job.progress.percent)}%</span>
</button>
))}
</div>
)}
</>
)}
</article>
</section>
<section className="overview-two-col">
<article className="console-panel" aria-label="resource usage">
<div className="panel-header">
@@ -340,8 +300,3 @@ function refreshedNow(): string {
function errorMessage(error: unknown, fallback: string): string {
return error instanceof Error ? error.message : fallback;
}
function jobStateLabel(state: JobResponse["state"]): string {
const labels: Record<JobResponse["state"], string> = { queued: "排队", accepted: "已领取", running: "执行中", retrying: "等待重试", succeeded: "完成", failed: "失败", cancelled: "已取消" };
return labels[state];
}