@yuku123/z-team-component 0.2.103 → 0.2.104
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/dist/ChangeLogView-DG-ogBff.js +542 -0
- package/dist/ComponentDoc-BW1SyDxk.js +8035 -0
- package/dist/InvitationManagementPage-hYvoPEcm.js +495 -0
- package/dist/OnboardingPage-KDp-DrzY.js +393 -0
- package/dist/ScheduledTasks-CErSDgyW.js +12127 -0
- package/dist/SystemShell-DvrY4Bl7.js +688 -0
- package/dist/_commonjsHelpers-B52_cu2H.js +26 -0
- package/dist/admin-logs-uPnnclwN.js +198 -0
- package/dist/api-B__qdRIf.js +20 -0
- package/dist/browser-jb_PFvU3.js +1538 -0
- package/dist/createWorkspaceWsHandler-BXbn5-Ft.js +13142 -0
- package/dist/ctc-sso-DtJHC-2M.js +117 -0
- package/dist/echarts-B1OU1xr4.js +16 -0
- package/dist/history-BlrA1eaW.js +41 -0
- package/dist/index-0smeCTnr.js +42049 -0
- package/dist/index-2isWwv1X.js +10169 -0
- package/dist/index-BC8f-JP9.js +242 -0
- package/dist/index-BK3YDeXH.js +2217 -0
- package/dist/index-BOJm25by.js +999 -0
- package/dist/index-B_LJRFsK.js +339 -0
- package/dist/index-BnJ8UEeZ.js +5892 -0
- package/dist/index-BohoJQPr.js +7631 -0
- package/dist/index-BwJPAN8f.js +112 -0
- package/dist/index-ByhCWenF.js +434 -0
- package/dist/index-C2_tfpEj.js +118 -0
- package/dist/index-C815hPWS.js +430 -0
- package/dist/index-C9fGup9t.js +189 -0
- package/dist/index-Cb88Xdh4.js +169 -0
- package/dist/index-Cih0yoxc.js +178 -0
- package/dist/index-CkWKJORv.js +1645 -0
- package/dist/index-CsaGecGX.js +132 -0
- package/dist/index-D-xPVrY3.js +316 -0
- package/dist/index-DAGa9v8r.js +142 -0
- package/dist/index-DBnH-lRh.js +956 -0
- package/dist/index-DIFIvVWE.js +93 -0
- package/dist/index-DOgCfVB2.js +574 -0
- package/dist/index-DWsfQMp8.js +208 -0
- package/dist/index-DcurzowX.js +2699 -0
- package/dist/index-DhDdFRHC.js +279 -0
- package/dist/index-Dpii3P5J.js +1302 -0
- package/dist/index-DtHoMz1H.js +8 -0
- package/dist/index-YVtm1SRy.js +913 -0
- package/dist/index-aI2EXKED.js +479 -0
- package/dist/index-q_TPea69.js +315 -0
- package/dist/index.js +10 -0
- package/dist/index.module-CAa-2T7m.js +72 -0
- package/dist/index.module-UI0iz8K0.js +42 -0
- package/dist/instance-pdQ_wAhB.js +216 -0
- package/dist/menuPermission-CCQjJVXg.js +60 -0
- package/dist/mobile-client-O3yr9h6t.js +24 -0
- package/dist/pages.js +21 -0
- package/dist/send-default-agent-team-message-BzeR4ahf.js +35 -0
- package/dist/spark-md5-Dld54a-T.js +178 -0
- package/dist/sso-user-DI7oiDdc.js +43 -0
- package/dist/training-Bz7Sr5yC.js +450 -0
- package/dist/webide-NcHLDiSn.js +5233 -0
- package/dist/z-team-component.css +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as L, useMemo as p } from "react";
|
|
3
|
+
import { useNavigate as v, useLocation as A } from "react-router-dom";
|
|
4
|
+
import { DownOutlined as k, RightOutlined as w } from "@ant-design/icons";
|
|
5
|
+
import { P as W, R as $ } from "./index-DIFIvVWE.js";
|
|
6
|
+
import { f as E, M as g } from "./menuPermission-CCQjJVXg.js";
|
|
7
|
+
import { d as j } from "./ComponentDoc-BW1SyDxk.js";
|
|
8
|
+
const H = "_shell_1jjcx_7", M = "_sidebar_1jjcx_15", R = "_menuList_1jjcx_37", T = "_menuGroup_1jjcx_43", C = "_menuGroupHeader_1jjcx_47", P = "_menuGroupIcon_1jjcx_65", z = "_menuGroupLabel_1jjcx_70", K = "_menuGroupArrow_1jjcx_74", U = "_menuSubList_1jjcx_80", Z = "_menuSubItem_1jjcx_86", B = "_menuSubItemActive_1jjcx_103", D = "_menuSubItemIcon_1jjcx_110", O = "_menuSubItemLabel_1jjcx_115", q = "_menuSubItemWrap_1jjcx_119", F = "_main_1jjcx_123", J = "_empty_1jjcx_134", Q = "_emptyIcon_1jjcx_144", V = "_emptyText_1jjcx_149", n = {
|
|
9
|
+
shell: H,
|
|
10
|
+
sidebar: M,
|
|
11
|
+
menuList: R,
|
|
12
|
+
menuGroup: T,
|
|
13
|
+
menuGroupHeader: C,
|
|
14
|
+
menuGroupIcon: P,
|
|
15
|
+
menuGroupLabel: z,
|
|
16
|
+
menuGroupArrow: K,
|
|
17
|
+
menuSubList: U,
|
|
18
|
+
menuSubItem: Z,
|
|
19
|
+
menuSubItemActive: B,
|
|
20
|
+
menuSubItemIcon: D,
|
|
21
|
+
menuSubItemLabel: O,
|
|
22
|
+
menuSubItemWrap: q,
|
|
23
|
+
main: F,
|
|
24
|
+
empty: J,
|
|
25
|
+
emptyIcon: Q,
|
|
26
|
+
emptyText: V
|
|
27
|
+
};
|
|
28
|
+
function X(m, r) {
|
|
29
|
+
for (const s of m)
|
|
30
|
+
if (s.path === r) return s.element;
|
|
31
|
+
for (const s of m)
|
|
32
|
+
if (s.path.includes("*") || s.path.includes(":")) {
|
|
33
|
+
const i = "^" + s.path.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g, "[^/]+") + "$";
|
|
34
|
+
if (new RegExp(i).test(r)) return s.element;
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
function Y({ text: m }) {
|
|
39
|
+
return /* @__PURE__ */ o("div", { className: n.empty, children: [
|
|
40
|
+
/* @__PURE__ */ t("div", { className: n.emptyIcon, children: "⚙️" }),
|
|
41
|
+
/* @__PURE__ */ t("div", { className: n.emptyText, children: m })
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
function ue({
|
|
45
|
+
groups: m,
|
|
46
|
+
routes: r,
|
|
47
|
+
mode: s,
|
|
48
|
+
emptyText: i,
|
|
49
|
+
activePathOverride: _,
|
|
50
|
+
menuOnly: h = !1
|
|
51
|
+
}) {
|
|
52
|
+
const I = v(), { pathname: a } = A(), d = j((e) => e.currentUser), b = j((e) => e.permissionState), [x, S] = L(
|
|
53
|
+
new Set(m.map((e) => e.title))
|
|
54
|
+
), l = p(
|
|
55
|
+
() => b === "failed" ? m : E(m, d),
|
|
56
|
+
[m, d, b]
|
|
57
|
+
), f = p(() => {
|
|
58
|
+
const e = _ ?? a;
|
|
59
|
+
for (const u of l)
|
|
60
|
+
for (const c of u.items)
|
|
61
|
+
if (c.path === e) return c.key;
|
|
62
|
+
return null;
|
|
63
|
+
}, [l, _, a]), G = (e) => {
|
|
64
|
+
S((u) => {
|
|
65
|
+
const c = new Set(u);
|
|
66
|
+
return c.has(e) ? c.delete(e) : c.add(e), c;
|
|
67
|
+
});
|
|
68
|
+
}, y = (e) => {
|
|
69
|
+
I(`${e.path}?mode=${s}`);
|
|
70
|
+
}, N = p(() => X(r, a), [r, a]);
|
|
71
|
+
return /* @__PURE__ */ o("div", { className: n.shell, children: [
|
|
72
|
+
/* @__PURE__ */ o("aside", { className: n.sidebar, children: [
|
|
73
|
+
/* @__PURE__ */ t(g, {}),
|
|
74
|
+
/* @__PURE__ */ t("nav", { className: n.menuList, children: l.map((e) => {
|
|
75
|
+
const u = x.has(e.title);
|
|
76
|
+
return /* @__PURE__ */ o("div", { className: n.menuGroup, children: [
|
|
77
|
+
/* @__PURE__ */ o(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: n.menuGroupHeader,
|
|
81
|
+
onClick: () => G(e.title),
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ t("span", { className: n.menuGroupIcon, children: e.icon }),
|
|
84
|
+
/* @__PURE__ */ t("span", { className: n.menuGroupLabel, children: e.title }),
|
|
85
|
+
/* @__PURE__ */ t("span", { className: n.menuGroupArrow, children: u ? /* @__PURE__ */ t(k, {}) : /* @__PURE__ */ t(w, {}) })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
u && /* @__PURE__ */ t("ul", { className: n.menuSubList, children: e.items.map((c) => /* @__PURE__ */ o(
|
|
90
|
+
"li",
|
|
91
|
+
{
|
|
92
|
+
className: `${n.menuSubItemWrap} ${n.menuSubItem} ${f === c.key ? n.menuSubItemActive : ""}`,
|
|
93
|
+
onClick: () => y(c),
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ t("span", { className: n.menuSubItemIcon, children: c.icon }),
|
|
96
|
+
/* @__PURE__ */ t("span", { className: n.menuSubItemLabel, children: c.label })
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
c.key
|
|
100
|
+
)) })
|
|
101
|
+
] }, e.title);
|
|
102
|
+
}) })
|
|
103
|
+
] }),
|
|
104
|
+
h ? null : /* @__PURE__ */ o("main", { className: n.main, children: [
|
|
105
|
+
/* @__PURE__ */ t(W, {}),
|
|
106
|
+
/* @__PURE__ */ t($, { resetKey: a, children: N ?? /* @__PURE__ */ t(Y, { text: i }) })
|
|
107
|
+
] })
|
|
108
|
+
] });
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
ue as W
|
|
112
|
+
};
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import { jsxs as a, jsx as i, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d, useRef as F, useCallback as D, useEffect as R } from "react";
|
|
3
|
+
import { T as O, k as U, d as P } from "./ComponentDoc-BW1SyDxk.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
async function y(o, s) {
|
|
6
|
+
const n = await o.text().catch(() => "");
|
|
7
|
+
let t = {};
|
|
8
|
+
if (n)
|
|
9
|
+
try {
|
|
10
|
+
t = JSON.parse(n);
|
|
11
|
+
} catch {
|
|
12
|
+
if (!o.ok) throw new Error(s);
|
|
13
|
+
return n;
|
|
14
|
+
}
|
|
15
|
+
if (typeof t.success == "boolean") {
|
|
16
|
+
if (t.success)
|
|
17
|
+
return U(t.data !== void 0 ? t.data : !0);
|
|
18
|
+
throw new Error(t.message || s);
|
|
19
|
+
}
|
|
20
|
+
if (!o.ok) throw new Error(s);
|
|
21
|
+
return U(t);
|
|
22
|
+
}
|
|
23
|
+
const m = O;
|
|
24
|
+
async function q(o, s) {
|
|
25
|
+
const n = s ? `?token=${encodeURIComponent(s)}` : "", t = { ...o, extend_params: { skip_init_task: "true" } }, r = await fetch(`${m}/scenario-instances${n}`, {
|
|
26
|
+
method: "POST",
|
|
27
|
+
credentials: "include",
|
|
28
|
+
headers: {
|
|
29
|
+
Accept: "application/json",
|
|
30
|
+
"Content-Type": "application/json",
|
|
31
|
+
"project-env": "local"
|
|
32
|
+
},
|
|
33
|
+
body: JSON.stringify(t)
|
|
34
|
+
});
|
|
35
|
+
return y(r, "Failed to create scenario instance");
|
|
36
|
+
}
|
|
37
|
+
async function K(o) {
|
|
38
|
+
const s = o ? `?token=${encodeURIComponent(o)}` : "", n = await fetch(`${m}/scenario-instances${s}`, {
|
|
39
|
+
credentials: "include",
|
|
40
|
+
headers: {
|
|
41
|
+
Accept: "application/json",
|
|
42
|
+
"project-env": "local"
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return y(n, "Failed to list scenario instances");
|
|
46
|
+
}
|
|
47
|
+
async function G(o, s, n) {
|
|
48
|
+
const t = n ? `?token=${encodeURIComponent(n)}` : "", r = await fetch(
|
|
49
|
+
`${m}/scenario-instances/${o}/messages${t}`,
|
|
50
|
+
{
|
|
51
|
+
method: "POST",
|
|
52
|
+
credentials: "include",
|
|
53
|
+
headers: {
|
|
54
|
+
Accept: "application/json",
|
|
55
|
+
"Content-Type": "application/json",
|
|
56
|
+
"project-env": "local"
|
|
57
|
+
},
|
|
58
|
+
body: JSON.stringify(s)
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
return y(r, "Failed to send message");
|
|
62
|
+
}
|
|
63
|
+
async function _(o, s = 50, n, t) {
|
|
64
|
+
const r = new URLSearchParams({ limit: String(s) });
|
|
65
|
+
t && r.set("token", t);
|
|
66
|
+
const h = await fetch(
|
|
67
|
+
`${m}/scenario-instances/${o}/messages?${r}`,
|
|
68
|
+
{
|
|
69
|
+
credentials: "include",
|
|
70
|
+
headers: {
|
|
71
|
+
Accept: "application/json",
|
|
72
|
+
"project-env": "local"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
return y(h, "Failed to list messages");
|
|
77
|
+
}
|
|
78
|
+
async function J(o, s) {
|
|
79
|
+
const n = s ? `?token=${encodeURIComponent(s)}` : "", t = await fetch(
|
|
80
|
+
// 后端成员列表在 /team(TeamController),没有 /members
|
|
81
|
+
`${m}/scenario-instances/${o}/team${n}`,
|
|
82
|
+
{
|
|
83
|
+
credentials: "include",
|
|
84
|
+
headers: {
|
|
85
|
+
Accept: "application/json",
|
|
86
|
+
"project-env": "local"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
return y(t, "Failed to list members");
|
|
91
|
+
}
|
|
92
|
+
const L = "dev_brain_scenario";
|
|
93
|
+
function Z() {
|
|
94
|
+
var M;
|
|
95
|
+
const [o, s] = d([]), [n, t] = d(
|
|
96
|
+
null
|
|
97
|
+
), [r, h] = d([]), [u, z] = d([]), [v, b] = d(""), [W, w] = d(!1), [g, S] = d(!1), [A, T] = d(""), k = F(null), { token: f } = P(), C = D(() => {
|
|
98
|
+
var e;
|
|
99
|
+
(e = k.current) == null || e.scrollIntoView({ behavior: "smooth" });
|
|
100
|
+
}, []);
|
|
101
|
+
R(() => {
|
|
102
|
+
C();
|
|
103
|
+
}, [r, C]), R(() => {
|
|
104
|
+
I();
|
|
105
|
+
}, []);
|
|
106
|
+
const I = async () => {
|
|
107
|
+
try {
|
|
108
|
+
const e = await K(f || void 0);
|
|
109
|
+
s(e || []);
|
|
110
|
+
} catch (e) {
|
|
111
|
+
console.error("Failed to load instances:", e);
|
|
112
|
+
}
|
|
113
|
+
}, N = async () => {
|
|
114
|
+
const e = A.trim();
|
|
115
|
+
if (e) {
|
|
116
|
+
S(!0);
|
|
117
|
+
try {
|
|
118
|
+
const c = await q(
|
|
119
|
+
{ scenario_code: L, name: e },
|
|
120
|
+
f || void 0
|
|
121
|
+
);
|
|
122
|
+
T(""), await I(), $(c);
|
|
123
|
+
} catch (c) {
|
|
124
|
+
alert(c instanceof Error ? c.message : "Create failed");
|
|
125
|
+
} finally {
|
|
126
|
+
S(!1);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}, $ = async (e) => {
|
|
130
|
+
t(e), w(!0);
|
|
131
|
+
try {
|
|
132
|
+
const [c, p] = await Promise.all([
|
|
133
|
+
_(e.id, 50, void 0, f || void 0),
|
|
134
|
+
J(e.id, f || void 0)
|
|
135
|
+
]);
|
|
136
|
+
h(c || []), z(p || []);
|
|
137
|
+
} catch (c) {
|
|
138
|
+
console.error("Failed to load instance data:", c);
|
|
139
|
+
} finally {
|
|
140
|
+
w(!1);
|
|
141
|
+
}
|
|
142
|
+
}, E = async () => {
|
|
143
|
+
const e = v.trim();
|
|
144
|
+
if (!e || !n) return;
|
|
145
|
+
const c = u.filter((l) => l.memberType === "AGENT");
|
|
146
|
+
let p, j = "TEXT";
|
|
147
|
+
for (const l of c)
|
|
148
|
+
if (e.includes(`@${l.displayName}`)) {
|
|
149
|
+
p = String(l.id), j = "AT_AGENT";
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
b("");
|
|
153
|
+
try {
|
|
154
|
+
await G(
|
|
155
|
+
n.id,
|
|
156
|
+
{
|
|
157
|
+
content: e,
|
|
158
|
+
message_type: j,
|
|
159
|
+
...p ? { at_agent_ref_id: p } : {}
|
|
160
|
+
},
|
|
161
|
+
f || void 0
|
|
162
|
+
);
|
|
163
|
+
const l = await _(
|
|
164
|
+
n.id,
|
|
165
|
+
50,
|
|
166
|
+
void 0,
|
|
167
|
+
f || void 0
|
|
168
|
+
);
|
|
169
|
+
h(l || []);
|
|
170
|
+
} catch (l) {
|
|
171
|
+
alert(l instanceof Error ? l.message : "Send failed");
|
|
172
|
+
}
|
|
173
|
+
}, x = u.filter((e) => e.memberType === "AGENT"), H = u.filter((e) => e.memberType === "HUMAN");
|
|
174
|
+
return /* @__PURE__ */ a("div", { style: { display: "flex", height: "100vh", fontFamily: "sans-serif" }, children: [
|
|
175
|
+
/* @__PURE__ */ a(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
style: {
|
|
179
|
+
width: 260,
|
|
180
|
+
borderRight: "1px solid #e8e8e8",
|
|
181
|
+
display: "flex",
|
|
182
|
+
flexDirection: "column",
|
|
183
|
+
background: "#fafafa"
|
|
184
|
+
},
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ a("div", { style: { padding: 16, borderBottom: "1px solid #e8e8e8" }, children: [
|
|
187
|
+
/* @__PURE__ */ i("h3", { style: { margin: "0 0 12px" }, children: "Scenario Instances" }),
|
|
188
|
+
/* @__PURE__ */ a("div", { style: { display: "flex", gap: 8 }, children: [
|
|
189
|
+
/* @__PURE__ */ i(
|
|
190
|
+
"input",
|
|
191
|
+
{
|
|
192
|
+
style: {
|
|
193
|
+
flex: 1,
|
|
194
|
+
padding: "6px 8px",
|
|
195
|
+
border: "1px solid #d9d9d9",
|
|
196
|
+
borderRadius: 4
|
|
197
|
+
},
|
|
198
|
+
placeholder: "Instance name",
|
|
199
|
+
value: A,
|
|
200
|
+
onChange: (e) => T(e.target.value),
|
|
201
|
+
onKeyDown: (e) => e.key === "Enter" && N()
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
/* @__PURE__ */ i(
|
|
205
|
+
"button",
|
|
206
|
+
{
|
|
207
|
+
style: {
|
|
208
|
+
padding: "6px 12px",
|
|
209
|
+
background: "#1677ff",
|
|
210
|
+
color: "#fff",
|
|
211
|
+
border: "none",
|
|
212
|
+
borderRadius: 4,
|
|
213
|
+
cursor: g ? "not-allowed" : "pointer"
|
|
214
|
+
},
|
|
215
|
+
disabled: g,
|
|
216
|
+
onClick: N,
|
|
217
|
+
children: g ? "..." : "+"
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] })
|
|
221
|
+
] }),
|
|
222
|
+
/* @__PURE__ */ a("div", { style: { flex: 1, overflow: "auto" }, children: [
|
|
223
|
+
o.map((e) => /* @__PURE__ */ a(
|
|
224
|
+
"div",
|
|
225
|
+
{
|
|
226
|
+
onClick: () => $(e),
|
|
227
|
+
style: {
|
|
228
|
+
padding: "10px 16px",
|
|
229
|
+
cursor: "pointer",
|
|
230
|
+
background: (n == null ? void 0 : n.id) === e.id ? "#e6f4ff" : "transparent",
|
|
231
|
+
borderBottom: "1px solid #f0f0f0"
|
|
232
|
+
},
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ i("div", { style: { fontWeight: 500, fontSize: 13 }, children: e.name }),
|
|
235
|
+
/* @__PURE__ */ a("div", { style: { fontSize: 11, color: "#999" }, children: [
|
|
236
|
+
e.scenarioCode,
|
|
237
|
+
" · ",
|
|
238
|
+
e.status
|
|
239
|
+
] })
|
|
240
|
+
]
|
|
241
|
+
},
|
|
242
|
+
e.id
|
|
243
|
+
)),
|
|
244
|
+
o.length === 0 ? /* @__PURE__ */ i("div", { style: { padding: 16, color: "#999", fontSize: 12 }, children: "No instances yet. Create one above." }) : null
|
|
245
|
+
] })
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
/* @__PURE__ */ i("div", { style: { flex: 1, display: "flex", flexDirection: "column" }, children: n ? /* @__PURE__ */ a(B, { children: [
|
|
250
|
+
/* @__PURE__ */ a(
|
|
251
|
+
"div",
|
|
252
|
+
{
|
|
253
|
+
style: {
|
|
254
|
+
padding: "12px 20px",
|
|
255
|
+
borderBottom: "1px solid #e8e8e8",
|
|
256
|
+
display: "flex",
|
|
257
|
+
justifyContent: "space-between",
|
|
258
|
+
alignItems: "center"
|
|
259
|
+
},
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ a("div", { children: [
|
|
262
|
+
/* @__PURE__ */ i("span", { style: { fontWeight: 600, fontSize: 15 }, children: n.name }),
|
|
263
|
+
/* @__PURE__ */ a("span", { style: { marginLeft: 8, fontSize: 12, color: "#999" }, children: [
|
|
264
|
+
"ID: ",
|
|
265
|
+
n.id
|
|
266
|
+
] })
|
|
267
|
+
] }),
|
|
268
|
+
/* @__PURE__ */ a("div", { style: { fontSize: 12, color: "#666" }, children: [
|
|
269
|
+
"Members: ",
|
|
270
|
+
H.length,
|
|
271
|
+
" human · ",
|
|
272
|
+
x.length,
|
|
273
|
+
" ",
|
|
274
|
+
"agent"
|
|
275
|
+
] })
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
),
|
|
279
|
+
/* @__PURE__ */ a(
|
|
280
|
+
"div",
|
|
281
|
+
{
|
|
282
|
+
style: {
|
|
283
|
+
flex: 1,
|
|
284
|
+
overflow: "auto",
|
|
285
|
+
padding: "16px 20px",
|
|
286
|
+
background: "#fff"
|
|
287
|
+
},
|
|
288
|
+
children: [
|
|
289
|
+
r.length === 0 ? /* @__PURE__ */ i(
|
|
290
|
+
"div",
|
|
291
|
+
{
|
|
292
|
+
style: { color: "#999", textAlign: "center", marginTop: 80 },
|
|
293
|
+
children: "Send a message to start. Use @agent_name to mention an agent."
|
|
294
|
+
}
|
|
295
|
+
) : null,
|
|
296
|
+
r.map((e) => /* @__PURE__ */ a(
|
|
297
|
+
"div",
|
|
298
|
+
{
|
|
299
|
+
style: {
|
|
300
|
+
marginBottom: 12,
|
|
301
|
+
display: "flex",
|
|
302
|
+
flexDirection: e.senderType === "HUMAN" ? "row-reverse" : "row",
|
|
303
|
+
gap: 8
|
|
304
|
+
},
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ i(
|
|
307
|
+
"div",
|
|
308
|
+
{
|
|
309
|
+
style: {
|
|
310
|
+
width: 32,
|
|
311
|
+
height: 32,
|
|
312
|
+
borderRadius: "50%",
|
|
313
|
+
background: e.senderType === "HUMAN" ? "#1677ff" : "#52c41a",
|
|
314
|
+
color: "#fff",
|
|
315
|
+
display: "flex",
|
|
316
|
+
alignItems: "center",
|
|
317
|
+
justifyContent: "center",
|
|
318
|
+
fontSize: 14,
|
|
319
|
+
flexShrink: 0
|
|
320
|
+
},
|
|
321
|
+
children: e.senderType === "HUMAN" ? "U" : "A"
|
|
322
|
+
}
|
|
323
|
+
),
|
|
324
|
+
/* @__PURE__ */ a("div", { style: { maxWidth: "70%" }, children: [
|
|
325
|
+
/* @__PURE__ */ a(
|
|
326
|
+
"div",
|
|
327
|
+
{
|
|
328
|
+
style: {
|
|
329
|
+
fontSize: 11,
|
|
330
|
+
color: "#999",
|
|
331
|
+
marginBottom: 2,
|
|
332
|
+
textAlign: e.senderType === "HUMAN" ? "right" : "left"
|
|
333
|
+
},
|
|
334
|
+
children: [
|
|
335
|
+
e.senderType === "HUMAN" ? "You" : "Agent",
|
|
336
|
+
" ·",
|
|
337
|
+
" ",
|
|
338
|
+
e.messageType
|
|
339
|
+
]
|
|
340
|
+
}
|
|
341
|
+
),
|
|
342
|
+
/* @__PURE__ */ i(
|
|
343
|
+
"div",
|
|
344
|
+
{
|
|
345
|
+
style: {
|
|
346
|
+
padding: "8px 12px",
|
|
347
|
+
borderRadius: 8,
|
|
348
|
+
background: e.senderType === "HUMAN" ? "#1677ff" : "#f5f5f5",
|
|
349
|
+
color: e.senderType === "HUMAN" ? "#fff" : "#333",
|
|
350
|
+
fontSize: 13,
|
|
351
|
+
whiteSpace: "pre-wrap",
|
|
352
|
+
wordBreak: "break-word"
|
|
353
|
+
},
|
|
354
|
+
children: e.content
|
|
355
|
+
}
|
|
356
|
+
)
|
|
357
|
+
] })
|
|
358
|
+
]
|
|
359
|
+
},
|
|
360
|
+
e.id
|
|
361
|
+
)),
|
|
362
|
+
/* @__PURE__ */ i("div", { ref: k })
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
),
|
|
366
|
+
/* @__PURE__ */ a(
|
|
367
|
+
"div",
|
|
368
|
+
{
|
|
369
|
+
style: {
|
|
370
|
+
padding: "12px 20px",
|
|
371
|
+
borderTop: "1px solid #e8e8e8",
|
|
372
|
+
display: "flex",
|
|
373
|
+
gap: 8,
|
|
374
|
+
background: "#fafafa"
|
|
375
|
+
},
|
|
376
|
+
children: [
|
|
377
|
+
/* @__PURE__ */ i(
|
|
378
|
+
"textarea",
|
|
379
|
+
{
|
|
380
|
+
style: {
|
|
381
|
+
flex: 1,
|
|
382
|
+
padding: "8px 12px",
|
|
383
|
+
border: "1px solid #d9d9d9",
|
|
384
|
+
borderRadius: 4,
|
|
385
|
+
resize: "none",
|
|
386
|
+
minHeight: 40,
|
|
387
|
+
maxHeight: 120,
|
|
388
|
+
fontSize: 13
|
|
389
|
+
},
|
|
390
|
+
placeholder: x.length > 0 ? `Type message. @${(M = x[0]) == null ? void 0 : M.displayName} to mention agent.` : "Type message...",
|
|
391
|
+
value: v,
|
|
392
|
+
onChange: (e) => b(e.target.value),
|
|
393
|
+
onKeyDown: (e) => {
|
|
394
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), E());
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
/* @__PURE__ */ i(
|
|
399
|
+
"button",
|
|
400
|
+
{
|
|
401
|
+
style: {
|
|
402
|
+
padding: "8px 20px",
|
|
403
|
+
background: "#1677ff",
|
|
404
|
+
color: "#fff",
|
|
405
|
+
border: "none",
|
|
406
|
+
borderRadius: 4,
|
|
407
|
+
cursor: "pointer",
|
|
408
|
+
fontSize: 13
|
|
409
|
+
},
|
|
410
|
+
onClick: E,
|
|
411
|
+
children: "Send"
|
|
412
|
+
}
|
|
413
|
+
)
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
)
|
|
417
|
+
] }) : /* @__PURE__ */ i(
|
|
418
|
+
"div",
|
|
419
|
+
{
|
|
420
|
+
style: {
|
|
421
|
+
flex: 1,
|
|
422
|
+
display: "flex",
|
|
423
|
+
alignItems: "center",
|
|
424
|
+
justifyContent: "center",
|
|
425
|
+
color: "#999"
|
|
426
|
+
},
|
|
427
|
+
children: "Select or create a scenario instance to start"
|
|
428
|
+
}
|
|
429
|
+
) })
|
|
430
|
+
] });
|
|
431
|
+
}
|
|
432
|
+
export {
|
|
433
|
+
Z as default
|
|
434
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useMemo as d } from "react";
|
|
3
|
+
import { useNavigate as G, useLocation as k } from "react-router-dom";
|
|
4
|
+
import { CodeOutlined as L, DownOutlined as N, RightOutlined as O, AppstoreOutlined as v, TableOutlined as A, DatabaseOutlined as w, RobotOutlined as H, FunctionOutlined as M, ApartmentOutlined as W, EyeOutlined as C, BranchesOutlined as $, DeploymentUnitOutlined as p, SafetyCertificateOutlined as g } from "@ant-design/icons";
|
|
5
|
+
import R from "@yuku123/z-lc-component";
|
|
6
|
+
import { f as U, M as x } from "./menuPermission-CCQjJVXg.js";
|
|
7
|
+
import { d as b } from "./ComponentDoc-BW1SyDxk.js";
|
|
8
|
+
const D = "_shell_1n5c7_7", E = "_sidebar_1n5c7_15", P = "_sidebarHeader_1n5c7_26", j = "_menuList_1n5c7_37", K = "_menuGroup_1n5c7_43", T = "_menuGroupHeader_1n5c7_47", B = "_menuGroupLabel_1n5c7_65", F = "_menuGroupArrow_1n5c7_69", q = "_menuSubList_1n5c7_74", z = "_menuSubItemWrap_1n5c7_80", J = "_menuSubItem_1n5c7_80", Q = "_menuSubItemActive_1n5c7_101", V = "_menuSubItemIcon_1n5c7_108", X = "_menuSubItemLabel_1n5c7_113", Y = "_main_1n5c7_118", t = {
|
|
9
|
+
shell: D,
|
|
10
|
+
sidebar: E,
|
|
11
|
+
sidebarHeader: P,
|
|
12
|
+
menuList: j,
|
|
13
|
+
menuGroup: K,
|
|
14
|
+
menuGroupHeader: T,
|
|
15
|
+
menuGroupLabel: B,
|
|
16
|
+
menuGroupArrow: F,
|
|
17
|
+
menuSubList: q,
|
|
18
|
+
menuSubItemWrap: z,
|
|
19
|
+
menuSubItem: J,
|
|
20
|
+
menuSubItemActive: Q,
|
|
21
|
+
menuSubItemIcon: V,
|
|
22
|
+
menuSubItemLabel: X,
|
|
23
|
+
main: Y
|
|
24
|
+
}, r = [
|
|
25
|
+
{
|
|
26
|
+
title: "应用",
|
|
27
|
+
items: [
|
|
28
|
+
{ key: "apps", label: "应用列表", icon: /* @__PURE__ */ e(v, {}), path: "apps" }
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
title: "建模",
|
|
33
|
+
items: [
|
|
34
|
+
{ key: "designer", label: "Schema 设计器", icon: /* @__PURE__ */ e(A, {}), path: "designer" },
|
|
35
|
+
{ key: "db-import", label: "从数据库导入", icon: /* @__PURE__ */ e(w, {}), path: "db-import" },
|
|
36
|
+
{ key: "admin-ai", label: "AI 建模", icon: /* @__PURE__ */ e(H, {}), path: "admin/ai" }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: "配置",
|
|
41
|
+
items: [
|
|
42
|
+
{ key: "admin-dicts", label: "数据字典", icon: /* @__PURE__ */ e(M, {}), path: "admin/dicts" },
|
|
43
|
+
{ key: "admin-relations", label: "实体关系", icon: /* @__PURE__ */ e(W, {}), path: "admin/relations" },
|
|
44
|
+
{ key: "admin-views", label: "视图配置", icon: /* @__PURE__ */ e(C, {}), path: "admin/views" },
|
|
45
|
+
{ key: "admin-pipelines", label: "Pipeline", icon: /* @__PURE__ */ e($, {}), path: "admin/pipelines" },
|
|
46
|
+
{ key: "admin-workflows", label: "流程绑定", icon: /* @__PURE__ */ e(p, {}), path: "admin/workflows" }
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: "运行",
|
|
51
|
+
items: [
|
|
52
|
+
{ key: "admin-permissions", label: "权限矩阵", icon: /* @__PURE__ */ e(g, {}), path: "admin/permissions", permission: "PERMISSION_MANAGE" },
|
|
53
|
+
{ key: "admin-deployments", label: "部署记录", icon: /* @__PURE__ */ e(p, {}), path: "admin/deployments" }
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
], c = "/lc";
|
|
57
|
+
function Z(l) {
|
|
58
|
+
if (!l.startsWith(c)) return null;
|
|
59
|
+
const m = l.slice(c.length).replace(/^\//, "");
|
|
60
|
+
for (const o of r)
|
|
61
|
+
for (const s of o.items)
|
|
62
|
+
if (m === s.path || m.startsWith(`${s.path}/`)) return s.key;
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
function le() {
|
|
66
|
+
const l = G(), { pathname: m } = k(), o = b((n) => n.currentUser), s = b((n) => n.permissionState), [_, h] = y(
|
|
67
|
+
new Set(r.map((n) => n.title))
|
|
68
|
+
), S = d(
|
|
69
|
+
() => s === "failed" ? r : U(r, o),
|
|
70
|
+
[o, s]
|
|
71
|
+
), I = d(() => Z(m), [m]), f = (n) => {
|
|
72
|
+
h((u) => {
|
|
73
|
+
const i = new Set(u);
|
|
74
|
+
return i.has(n) ? i.delete(n) : i.add(n), i;
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
return /* @__PURE__ */ a("div", { className: t.shell, children: [
|
|
78
|
+
/* @__PURE__ */ a("aside", { className: t.sidebar, children: [
|
|
79
|
+
/* @__PURE__ */ a("div", { className: t.sidebarHeader, children: [
|
|
80
|
+
/* @__PURE__ */ e(L, {}),
|
|
81
|
+
/* @__PURE__ */ e("span", { children: "研发工作台" })
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ e(x, {}),
|
|
84
|
+
/* @__PURE__ */ e("nav", { className: t.menuList, children: S.map((n) => {
|
|
85
|
+
const u = !_.has(n.title);
|
|
86
|
+
return /* @__PURE__ */ a("div", { className: t.menuGroup, children: [
|
|
87
|
+
/* @__PURE__ */ a(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
className: t.menuGroupHeader,
|
|
91
|
+
onClick: () => f(n.title),
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ e("span", { className: t.menuGroupLabel, children: n.title }),
|
|
94
|
+
/* @__PURE__ */ e("span", { className: t.menuGroupArrow, children: u ? /* @__PURE__ */ e(N, {}) : /* @__PURE__ */ e(O, {}) })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
u && /* @__PURE__ */ e("ul", { className: t.menuSubList, children: n.items.map((i) => /* @__PURE__ */ a(
|
|
99
|
+
"li",
|
|
100
|
+
{
|
|
101
|
+
className: `${t.menuSubItemWrap} ${t.menuSubItem} ${I === i.key ? t.menuSubItemActive : ""}`,
|
|
102
|
+
onClick: () => l(`${c}/${i.path}`),
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ e("span", { className: t.menuSubItemIcon, children: i.icon }),
|
|
105
|
+
/* @__PURE__ */ e("span", { className: t.menuSubItemLabel, children: i.label })
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
i.key
|
|
109
|
+
)) })
|
|
110
|
+
] }, n.title);
|
|
111
|
+
}) })
|
|
112
|
+
] }),
|
|
113
|
+
/* @__PURE__ */ e("main", { className: t.main, children: /* @__PURE__ */ e(R, {}) })
|
|
114
|
+
] });
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
le as default
|
|
118
|
+
};
|