From cdce8227bc1280d79155d230a0f7f3fcd1b22d31 Mon Sep 17 00:00:00 2001 From: que01 Date: Tue, 22 Sep 2026 17:49:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E5=90=8E=E5=8F=B0=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E8=BF=90=E8=A1=8C=E6=97=B6=E5=B7=A5=E4=BD=9C=E7=A9=BA?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/features/workspace/WorkspacePage.tsx | 33 ++++++++++++++++++- docs/template-runtime-progress.md | 1 + 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/apps/admin/src/features/workspace/WorkspacePage.tsx b/apps/admin/src/features/workspace/WorkspacePage.tsx index 887870d..86f72ce 100644 --- a/apps/admin/src/features/workspace/WorkspacePage.tsx +++ b/apps/admin/src/features/workspace/WorkspacePage.tsx @@ -14,7 +14,11 @@ import { import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { createApiClient } from "../../lib/api.js"; import { ApiClientError } from "@personal-brand/api-client"; -import type { BrandFieldDefinition, BrandModule } from "@personal-brand/api-client"; +import type { + BrandFieldDefinition, + BrandModule, + PublicWorkspace, +} from "@personal-brand/api-client"; import { useState } from "react"; import { AdminPageHeader } from "../../components/AdminPageHeader.js"; import { MutationError } from "../../components/QueryState.js"; @@ -30,6 +34,10 @@ export function WorkspacePage() { queryKey: ["admin-workspace"], queryFn: () => client.getAdminWorkspace(), }); + const runtimeQuery = useQuery({ + queryKey: ["public-runtime-workspace"], + queryFn: () => client.getPublicWorkspace(), + }); const install = useMutation({ mutationFn: (key: "personal" | "food") => client.installAdminTemplate(key), onSuccess: () => { @@ -129,6 +137,29 @@ export function WorkspacePage() { title="模板与设置" description="用行业模板组织业务表达,同时保留个人品牌定位、信任内容和合作方式的长期扩展空间。" /> + + {runtimeQuery.isError ? ( + 公开运行时工作空间暂时无法加载。 + ) : ( + + + Schema {runtimeQuery.data?.schemaVersion ?? "-"} + 模块 {runtimeQuery.data?.runtimeModules?.length ?? 0} + 能力 {runtimeQuery.data?.runtimeCapabilities?.length ?? 0} + + 公开业务{" "} + {runtimeQuery.data?.runtimeOfferings?.length ?? + runtimeQuery.data?.offerings?.length ?? + 0} + + + + 小程序和后台预览消费同一份 Runtime Workspace;模板 key + 只用于安装和版本管理,不作为客户端业务分支。 + + + )} +