openxiangda 1.0.67 → 1.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/openxiangda-react-spa/AGENTS.md +26 -19
- package/templates/openxiangda-react-spa/src/app/navigation.ts +165 -0
- package/templates/openxiangda-react-spa/src/app/router.tsx +20 -62
- package/templates/openxiangda-react-spa/src/app/starter-content.ts +182 -0
- package/templates/openxiangda-react-spa/src/layouts/AdminShell.tsx +94 -217
- package/templates/openxiangda-react-spa/src/layouts/PublicShell.tsx +6 -6
- package/templates/openxiangda-react-spa/src/layouts/UserShell.tsx +15 -15
- package/templates/openxiangda-react-spa/src/pages/admin/AdminDashboardPage.tsx +193 -0
- package/templates/openxiangda-react-spa/src/pages/admin/DataCenterPage.tsx +96 -0
- package/templates/openxiangda-react-spa/src/pages/admin/ServiceCenterPage.tsx +100 -0
- package/templates/openxiangda-react-spa/src/pages/admin/TaskCenterPage.tsx +135 -0
- package/templates/openxiangda-react-spa/src/pages/defaults/DataRoutePage.tsx +22 -25
- package/templates/openxiangda-react-spa/src/pages/defaults/FilePreviewRoutePage.tsx +41 -45
- package/templates/openxiangda-react-spa/src/pages/defaults/FormRoutePage.tsx +22 -30
- package/templates/openxiangda-react-spa/src/pages/portal/UserPortalPage.tsx +47 -42
- package/templates/openxiangda-react-spa/src/pages/public/PublicHomePage.tsx +30 -31
- package/templates/openxiangda-react-spa/src/pages/states/NotFoundPage.tsx +7 -7
- package/templates/openxiangda-react-spa/src/resources/menus/menus.json +32 -5
- package/templates/openxiangda-react-spa/src/resources/roles/roles.json +2 -2
- package/templates/openxiangda-react-spa/src/shared/mac-admin.tsx +2 -2
- package/templates/openxiangda-react-spa/src/shared/ui.tsx +13 -0
- package/templates/openxiangda-react-spa/src/pages/admin/RuntimeWorkspacePage.tsx +0 -219
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Activity,
|
|
3
|
-
CheckCircle2,
|
|
4
|
-
Clock3,
|
|
5
|
-
Cookie,
|
|
6
|
-
Database,
|
|
7
|
-
FileText,
|
|
8
|
-
GitBranch,
|
|
9
|
-
Rocket,
|
|
10
|
-
ShieldCheck,
|
|
11
|
-
Sparkles,
|
|
12
|
-
Workflow,
|
|
13
|
-
} from "lucide-react";
|
|
14
|
-
import type { ReactNode } from "react";
|
|
15
|
-
import { useRuntimeBootstrap } from "openxiangda/runtime/react";
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
MacDiagnosticPanel,
|
|
19
|
-
MacListItem,
|
|
20
|
-
MacMetricCard,
|
|
21
|
-
MacPageHeader,
|
|
22
|
-
MacPanel,
|
|
23
|
-
MacPrimaryButton,
|
|
24
|
-
MacSecondaryButton,
|
|
25
|
-
MacStatusPill,
|
|
26
|
-
MacTrendBars,
|
|
27
|
-
} from "@/shared/mac-admin";
|
|
28
|
-
|
|
29
|
-
const metrics = [
|
|
30
|
-
{
|
|
31
|
-
caption: "较昨日 +12.4%,来自用户门户与公开页。",
|
|
32
|
-
icon: Activity,
|
|
33
|
-
label: "页面访问",
|
|
34
|
-
tone: "blue" as const,
|
|
35
|
-
value: "24,680",
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
caption: "流程节点、办理任务和待确认数据。",
|
|
39
|
-
icon: Clock3,
|
|
40
|
-
label: "待处理",
|
|
41
|
-
tone: "amber" as const,
|
|
42
|
-
value: "18",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
caption: "表单、流程和数据列表均由 SDK 默认页承载。",
|
|
46
|
-
icon: FileText,
|
|
47
|
-
label: "默认页",
|
|
48
|
-
tone: "emerald" as const,
|
|
49
|
-
value: "6",
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
caption: "Playwright 可使用真实用户一次性登录验证。",
|
|
53
|
-
icon: Sparkles,
|
|
54
|
-
label: "AI 校验",
|
|
55
|
-
tone: "violet" as const,
|
|
56
|
-
value: "Ready",
|
|
57
|
-
},
|
|
58
|
-
];
|
|
59
|
-
|
|
60
|
-
const activities = [
|
|
61
|
-
{ icon: <CheckCircle2 size={17} />, text: "加载应用菜单与当前用户页面权限。", tone: "emerald" as const },
|
|
62
|
-
{ icon: <GitBranch size={17} />, text: "React Router 接管 /view 下的应用路由。", tone: "blue" as const },
|
|
63
|
-
{ icon: <ShieldCheck size={17} />, text: "后端继续兜底表单、字段、数据和流程权限。", tone: "amber" as const },
|
|
64
|
-
{ icon: <Sparkles size={17} />, text: "AI 验证登录以真实用户身份进入页面。", tone: "violet" as const },
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
const tasks = [
|
|
68
|
-
{ label: "运行时需求", meta: "普通表单 · 待提交", tone: "blue" as const },
|
|
69
|
-
{ label: "运行时审批", meta: "流程表单 · 待处理", tone: "amber" as const },
|
|
70
|
-
{ label: "用户门户", meta: "页面权限 · 已发布", tone: "emerald" as const },
|
|
71
|
-
{ label: "公开访问", meta: "ticket 链路 · 待验证", tone: "violet" as const },
|
|
72
|
-
];
|
|
73
|
-
|
|
74
|
-
export function RuntimeWorkspacePage() {
|
|
75
|
-
const runtime = useRuntimeBootstrap();
|
|
76
|
-
const appName = String(runtime.data?.app?.name || "OpenXiangda React SPA");
|
|
77
|
-
const appType = runtime.appType || String(runtime.data?.appType || "");
|
|
78
|
-
const buildId = String(runtime.data?.runtime?.activeBuildId || "local-dev");
|
|
79
|
-
const releaseId = String(runtime.data?.runtime?.activeReleaseId || "draft");
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<div className="min-w-0 space-y-5">
|
|
83
|
-
<MacPageHeader
|
|
84
|
-
actions={
|
|
85
|
-
<>
|
|
86
|
-
<MacSecondaryButton>
|
|
87
|
-
<Database size={17} />
|
|
88
|
-
同步资源
|
|
89
|
-
</MacSecondaryButton>
|
|
90
|
-
<MacPrimaryButton>
|
|
91
|
-
<Rocket size={17} />
|
|
92
|
-
发布版本
|
|
93
|
-
</MacPrimaryButton>
|
|
94
|
-
</>
|
|
95
|
-
}
|
|
96
|
-
description="应用路由、布局、用户门户、公开访问和默认表单页均由当前 React SPA 接管;平台继续负责登录、权限、数据和流程接口。"
|
|
97
|
-
eyebrow="Runtime Workspace"
|
|
98
|
-
meta={
|
|
99
|
-
<>
|
|
100
|
-
<MacStatusPill tone="emerald">SDK 已连接</MacStatusPill>
|
|
101
|
-
<MacStatusPill tone="blue">Cookie 同域代理</MacStatusPill>
|
|
102
|
-
<MacStatusPill tone="amber">后端权限兜底</MacStatusPill>
|
|
103
|
-
<MacStatusPill tone="violet">React SPA</MacStatusPill>
|
|
104
|
-
</>
|
|
105
|
-
}
|
|
106
|
-
title={appName}
|
|
107
|
-
/>
|
|
108
|
-
|
|
109
|
-
<section className="grid min-w-0 gap-4 md:grid-cols-2 xl:grid-cols-4">
|
|
110
|
-
{metrics.map(metric => (
|
|
111
|
-
<MacMetricCard key={metric.label} {...metric} />
|
|
112
|
-
))}
|
|
113
|
-
</section>
|
|
114
|
-
|
|
115
|
-
<section className="grid min-w-0 gap-4 xl:grid-cols-[minmax(0,1.35fr)_minmax(320px,0.65fr)]">
|
|
116
|
-
<MacPanel
|
|
117
|
-
description="用于检查新应用运行质量、AI 验证覆盖度和默认页接入情况。"
|
|
118
|
-
title="运行概览"
|
|
119
|
-
>
|
|
120
|
-
<div className="grid min-w-0 gap-4 lg:grid-cols-[minmax(0,1fr)_280px]">
|
|
121
|
-
<div className="min-w-0">
|
|
122
|
-
<MacTrendBars tone="blue" values={[36, 48, 42, 66, 58, 78, 86, 71, 92, 88, 104, 118]} />
|
|
123
|
-
<div className="mt-4 grid gap-3 sm:grid-cols-3">
|
|
124
|
-
<RuntimeChip icon={<Cookie size={17} />} label="Service Proxy" value="/service" />
|
|
125
|
-
<RuntimeChip icon={<ShieldCheck size={17} />} label="Route Guard" value="backend" />
|
|
126
|
-
<RuntimeChip icon={<Workflow size={17} />} label="Workflow" value="enabled" />
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
129
|
-
<div className="rounded-2xl border border-slate-200/80 bg-slate-950 p-5 text-white">
|
|
130
|
-
<div className="text-sm text-slate-300">AI 验证覆盖</div>
|
|
131
|
-
<div
|
|
132
|
-
className="mx-auto mt-6 grid h-36 w-36 place-items-center rounded-full"
|
|
133
|
-
style={{ background: "conic-gradient(#22c55e 0 72%, #38bdf8 72% 88%, #f59e0b 88% 100%)" }}
|
|
134
|
-
>
|
|
135
|
-
<div className="grid h-24 w-24 place-items-center rounded-full bg-slate-950 text-center">
|
|
136
|
-
<span className="text-3xl font-semibold">88%</span>
|
|
137
|
-
<span className="-mt-4 text-xs text-slate-400">verified</span>
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
<div className="mt-5 grid gap-2 text-xs text-slate-300">
|
|
141
|
-
<span>真实用户登录链路</span>
|
|
142
|
-
<span>默认页 + override 双路径</span>
|
|
143
|
-
<span>401 / 403 状态分离</span>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
147
|
-
</MacPanel>
|
|
148
|
-
|
|
149
|
-
<MacPanel title="待办与入口" description="这些入口可以替换成你的真实业务菜单。">
|
|
150
|
-
<div className="space-y-3">
|
|
151
|
-
{tasks.map(task => (
|
|
152
|
-
<MacListItem key={task.label} tone={task.tone}>
|
|
153
|
-
<div className="flex items-center justify-between gap-3">
|
|
154
|
-
<div className="min-w-0">
|
|
155
|
-
<div className="truncate text-sm font-semibold text-slate-950">{task.label}</div>
|
|
156
|
-
<div className="mt-1 truncate text-xs text-slate-500">{task.meta}</div>
|
|
157
|
-
</div>
|
|
158
|
-
<span className="rounded-full bg-slate-100 px-2.5 py-1 text-xs text-slate-500">open</span>
|
|
159
|
-
</div>
|
|
160
|
-
</MacListItem>
|
|
161
|
-
))}
|
|
162
|
-
</div>
|
|
163
|
-
</MacPanel>
|
|
164
|
-
</section>
|
|
165
|
-
|
|
166
|
-
<section className="grid min-w-0 gap-4 xl:grid-cols-[minmax(0,1fr)_380px]">
|
|
167
|
-
<MacPanel title="最近活动">
|
|
168
|
-
<div className="grid gap-3 md:grid-cols-2">
|
|
169
|
-
{activities.map(activity => (
|
|
170
|
-
<MacListItem icon={activity.icon} key={activity.text} tone={activity.tone}>
|
|
171
|
-
<div className="text-sm leading-6 text-slate-600">{activity.text}</div>
|
|
172
|
-
</MacListItem>
|
|
173
|
-
))}
|
|
174
|
-
</div>
|
|
175
|
-
</MacPanel>
|
|
176
|
-
|
|
177
|
-
<MacPanel title="运行环境" description="诊断信息默认收起,避免首页出现横向滚动。">
|
|
178
|
-
<div className="space-y-3 text-sm">
|
|
179
|
-
<InfoRow label="appType" value={appType} />
|
|
180
|
-
<InfoRow label="buildId" value={buildId} />
|
|
181
|
-
<InfoRow label="releaseId" value={releaseId} />
|
|
182
|
-
<InfoRow label="mode" value={String(runtime.data?.runtime?.mode || "react-spa")} />
|
|
183
|
-
</div>
|
|
184
|
-
</MacPanel>
|
|
185
|
-
</section>
|
|
186
|
-
|
|
187
|
-
<MacDiagnosticPanel data={runtime.data} title="Runtime Bootstrap" />
|
|
188
|
-
</div>
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function RuntimeChip({
|
|
193
|
-
icon,
|
|
194
|
-
label,
|
|
195
|
-
value,
|
|
196
|
-
}: {
|
|
197
|
-
icon: ReactNode;
|
|
198
|
-
label: string;
|
|
199
|
-
value: string;
|
|
200
|
-
}) {
|
|
201
|
-
return (
|
|
202
|
-
<div className="rounded-2xl border border-slate-200/80 bg-white/75 p-3">
|
|
203
|
-
<div className="flex items-center gap-2 text-xs text-slate-500">
|
|
204
|
-
<span className="text-blue-600">{icon}</span>
|
|
205
|
-
{label}
|
|
206
|
-
</div>
|
|
207
|
-
<div className="mt-2 truncate text-sm font-semibold text-slate-950">{value}</div>
|
|
208
|
-
</div>
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function InfoRow({ label, value }: { label: string; value: string }) {
|
|
213
|
-
return (
|
|
214
|
-
<div className="flex min-w-0 items-center justify-between gap-3 rounded-xl bg-slate-50 px-3 py-2">
|
|
215
|
-
<span className="shrink-0 text-xs font-medium text-slate-500">{label}</span>
|
|
216
|
-
<span className="min-w-0 truncate text-xs font-semibold text-slate-800">{value}</span>
|
|
217
|
-
</div>
|
|
218
|
-
);
|
|
219
|
-
}
|