import Icon from "../../components/common/Icon"; import { useAuth } from "../../context/AuthContext"; import "../../styles/admin.css"; import "../../styles/dashboard.css"; export function DashboardPage({ scriptCount, online, onNavigate, }: { scriptCount: number; online: boolean; onNavigate: (page: "scripts" | "schedules" | "system") => void; }) { const { user, currentWorkspace } = useAuth(); const isSystemAdmin = user?.is_system_admin ?? false; return (
MODEL DEVELOPMENT PLATFORM

下午好,{user?.display_name ?? "用户"}

当前位于 {currentWorkspace?.workspace_name ?? "(未选择 Workspace)"} ,可以继续构建脚本或配置调度。

{online ? "服务正常" : "服务连接中"}
{scriptCount}工作副本
2Workspace
4平台用户
{online ? "正常" : "检查中"}平台状态
{isSystemAdmin && ( )}
运行趋势

近 7 天调度执行

成功率 92.6%
{[38, 55, 44, 73, 61, 86, 78].map((value, index) => (
{Math.round(value / 7)} {["周一", "周二", "周三", "周四", "周五", "周六", "今天"][index]}
))}
成功 75失败 6
脚本资产

类型分布

{scriptCount}全部脚本
Notebook{Math.max(1, Math.round(scriptCount * .67))} 个 · 67% Python{Math.max(0, scriptCount - Math.round(scriptCount * .67))} 个 · 33% 稳定版本3 个已发布
ACTIVITY

最近平台活动

操作内容执行人状态时间
{[ ["数据探索.ipynb 发布稳定版本 v3.0", "张三", "成功", "16:42"], ["每日模型训练流程完成调度运行", "Scheduler", "成功", "15:25"], ["批量预测.py 更新工作副本", "王五", "已同步", "14:18"], ["风险验证流程完成 DAG 校验", "李四", "成功", "11:06"], ].map((row) => (
{row[0]} {row[1]}{row[2]}{row[3]}
))}
); }