feat: add Pyramid home dashboard
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user