feat: add Pyramid home dashboard

This commit is contained in:
yuxuanhui
2026-09-09 18:20:08 +08:00
parent be76b89e9d
commit e57b1f7a2e
17 changed files with 950 additions and 34 deletions
+1
View File
@@ -12,6 +12,7 @@ export type ModelSettings = {
};
export type PageContext = {
page:
| "home"
| "alphas"
| "account"
| "datasets"
+2 -3
View File
@@ -5,6 +5,7 @@ const contextLabels: Record<
PageContext["page"],
(context: PageContext) => string
> = {
home: () => "上下文:首页看板",
alphas: (context) =>
`上下文:${context.alpha_id ? `Alpha ${context.alpha_id}` : "Alpha 列表"}${context.selected_ids?.length ? ` · 已选 ${context.selected_ids.length} 条` : ""}`,
operators: () => "上下文:算子库",
@@ -30,9 +31,7 @@ export function pageFromHash(hash: string): WorkspacePage {
const value = hash.replace(/^#/, "").split("?")[0];
const page = value.startsWith("quantflow/") ? "quantflow" : value;
if (page === "mcp-keys") return page;
return Object.hasOwn(contextLabels, page)
? (page as WorkspacePage)
: "alphas";
return Object.hasOwn(contextLabels, page) ? (page as WorkspacePage) : "home";
}
type Destination = {