@glodon-aiot/agent-cli-ui 3.8.0-alpha.4 → 3.8.0-beta.6
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/es/Dialog/SessionList/index.mjs +200 -188
- package/dist/es/packages/agent-cli-ui/package.json.mjs +11 -11
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style10.css +1 -1
- package/dist/es/src/style11.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style17.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style22.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style26.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style29.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style33.css +1 -1
- package/dist/es/src/style5.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.js +36 -36
- package/package.json +3 -3
|
@@ -1,253 +1,265 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
for (var e in
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var e of
|
|
9
|
-
|
|
10
|
-
return
|
|
1
|
+
var Et = Object.defineProperty;
|
|
2
|
+
var et = Object.getOwnPropertySymbols;
|
|
3
|
+
var wt = Object.prototype.hasOwnProperty, At = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var at = (E, f, e) => f in E ? Et(E, f, { enumerable: !0, configurable: !0, writable: !0, value: e }) : E[f] = e, ot = (E, f) => {
|
|
5
|
+
for (var e in f || (f = {}))
|
|
6
|
+
wt.call(f, e) && at(E, e, f[e]);
|
|
7
|
+
if (et)
|
|
8
|
+
for (var e of et(f))
|
|
9
|
+
At.call(f, e) && at(E, e, f[e]);
|
|
10
|
+
return E;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
var k = (
|
|
12
|
+
var x = (E, f, e) => new Promise((l, b) => {
|
|
13
|
+
var k = (w) => {
|
|
14
14
|
try {
|
|
15
|
-
O(e.next(
|
|
16
|
-
} catch (
|
|
17
|
-
b(
|
|
15
|
+
O(e.next(w));
|
|
16
|
+
} catch (M) {
|
|
17
|
+
b(M);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, B = (w) => {
|
|
20
20
|
try {
|
|
21
|
-
O(e.throw(
|
|
22
|
-
} catch (
|
|
23
|
-
b(
|
|
21
|
+
O(e.throw(w));
|
|
22
|
+
} catch (M) {
|
|
23
|
+
b(M);
|
|
24
24
|
}
|
|
25
|
-
}, O = (
|
|
26
|
-
O((e = e.apply(
|
|
25
|
+
}, O = (w) => w.done ? l(w.value) : Promise.resolve(w.value).then(k, B);
|
|
26
|
+
O((e = e.apply(E, f)).next());
|
|
27
27
|
});
|
|
28
|
-
import { jsx as
|
|
29
|
-
import { forwardRef as
|
|
30
|
-
import { Button as
|
|
31
|
-
import
|
|
28
|
+
import { jsx as c, jsxs as L } from "react/jsx-runtime";
|
|
29
|
+
import { forwardRef as kt, useState as _, useContext as bt, useEffect as T, useImperativeHandle as Ot, useMemo as Lt } from "react";
|
|
30
|
+
import { Button as Mt, Typography as xt, Space as dt, Popconfirm as nt, Input as Ct, notification as F } from "antd";
|
|
31
|
+
import y from "dayjs";
|
|
32
32
|
import _t from "classnames";
|
|
33
|
-
import
|
|
33
|
+
import it from "../../components/Iconfont/index.mjs";
|
|
34
34
|
import jt from "../../context.mjs";
|
|
35
|
-
/* empty css */import { useMemoizedFn as
|
|
36
|
-
import { MAX_KNOWLEDGES_AND_FILES_COUNT as
|
|
37
|
-
import { useSessionState as
|
|
38
|
-
import { calcKnowledgesLeafCount as
|
|
39
|
-
const
|
|
35
|
+
/* empty css */import { useMemoizedFn as lt } from "ahooks";
|
|
36
|
+
import { MAX_KNOWLEDGES_AND_FILES_COUNT as D, NET_OPEN_STATUS as rt } from "../../constant.mjs";
|
|
37
|
+
import { useSessionState as Pt } from "../../hooks/useSessionState.mjs";
|
|
38
|
+
import { calcKnowledgesLeafCount as st } from "../../utils/index.mjs";
|
|
39
|
+
const K = 15, Tt = kt((E, f) => {
|
|
40
40
|
const {
|
|
41
41
|
currentSession: e,
|
|
42
42
|
setCurrentSession: l,
|
|
43
43
|
checkKnowledges: b,
|
|
44
44
|
application: k,
|
|
45
|
-
networkStatus:
|
|
45
|
+
networkStatus: B,
|
|
46
46
|
isShowHeader: O = !0,
|
|
47
|
-
afterSessionClick:
|
|
48
|
-
sessionId:
|
|
49
|
-
} =
|
|
50
|
-
agentClient:
|
|
51
|
-
mode:
|
|
52
|
-
features: o
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
47
|
+
afterSessionClick: w,
|
|
48
|
+
sessionId: M
|
|
49
|
+
} = E, [Y, $] = _(), {
|
|
50
|
+
agentClient: u,
|
|
51
|
+
mode: ct,
|
|
52
|
+
features: o,
|
|
53
|
+
popupContainer: V
|
|
54
|
+
} = bt(jt), [R, G] = _(b), {
|
|
55
|
+
sessions: C,
|
|
56
|
+
setSessions: j
|
|
57
|
+
} = Pt(), [U, H] = _(0), [mt, P] = _(""), [ft, z] = _(null), X = lt((t) => {
|
|
58
|
+
t.id && j((a) => [...a.map((d) => {
|
|
59
|
+
var r;
|
|
60
|
+
return ((r = d.data) == null ? void 0 : r.id) === t.id && (d.data = ot({}, t)), d;
|
|
61
|
+
})].sort((d, r) => {
|
|
62
|
+
var N, A;
|
|
63
|
+
const m = y((N = d.data) == null ? void 0 : N.createdAt).valueOf();
|
|
64
|
+
return y((A = r.data) == null ? void 0 : A.createdAt).valueOf() - m;
|
|
64
65
|
}));
|
|
65
66
|
});
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
T(() => {
|
|
68
|
+
u == null || u.getSessions().then((t) => x(void 0, null, function* () {
|
|
68
69
|
var a;
|
|
69
|
-
if (
|
|
70
|
-
const
|
|
71
|
-
|
|
70
|
+
if (j([...t]), !((a = e == null ? void 0 : e.data) != null && a.id) && (t != null && t.length) && ct === "inlay") {
|
|
71
|
+
const n = t[0];
|
|
72
|
+
M || l == null || l(n);
|
|
72
73
|
} else
|
|
73
|
-
e === void 0 && (
|
|
74
|
+
e === void 0 && (M || l == null || l(null));
|
|
74
75
|
}));
|
|
75
|
-
}, []),
|
|
76
|
+
}, []), T(() => {
|
|
76
77
|
var t;
|
|
77
78
|
if (!((t = e == null ? void 0 : e.data) != null && t.id) && b === void 0) {
|
|
78
79
|
const a = typeof (o == null ? void 0 : o.knowledges) == "object" && o.knowledges.default || void 0;
|
|
79
|
-
if (Array.isArray(a) && a.some((
|
|
80
|
+
if (Array.isArray(a) && a.some((d) => Array.isArray(d.fileIds) && d.fileIds.length === 0))
|
|
80
81
|
throw Error("fileIds cannot be an empty array");
|
|
81
|
-
if (
|
|
82
|
-
throw Error(`knowledges and fileIds total count cannot exceed ${
|
|
83
|
-
|
|
82
|
+
if (st(a || []) > D)
|
|
83
|
+
throw Error(`knowledges and fileIds total count cannot exceed ${D}`);
|
|
84
|
+
G(a);
|
|
84
85
|
return;
|
|
85
86
|
}
|
|
86
|
-
|
|
87
|
-
}, [b]),
|
|
88
|
-
e == null || e.addEventListener("data:updated",
|
|
89
|
-
}, [e]),
|
|
87
|
+
G(b);
|
|
88
|
+
}, [b]), T(() => {
|
|
89
|
+
e == null || e.addEventListener("data:updated", X);
|
|
90
|
+
}, [e]), Ot(f, () => ({
|
|
90
91
|
create(t) {
|
|
91
|
-
return
|
|
92
|
+
return W(t).then((a) => (l == null || l(a), a));
|
|
92
93
|
},
|
|
93
|
-
list: () => Promise.resolve(
|
|
94
|
+
list: () => Promise.resolve(C)
|
|
94
95
|
}));
|
|
95
|
-
const
|
|
96
|
+
const W = (t) => {
|
|
96
97
|
const a = typeof (o == null ? void 0 : o.connectNetwork) == "object" && typeof (o == null ? void 0 : o.connectNetwork.default) == "boolean" ? o.connectNetwork.default : !1;
|
|
97
|
-
return new Promise((
|
|
98
|
-
var
|
|
99
|
-
const
|
|
98
|
+
return new Promise((n) => x(void 0, null, function* () {
|
|
99
|
+
var m;
|
|
100
|
+
const p = typeof (o == null ? void 0 : o.promptVariables) == "object" ? (o == null ? void 0 : o.promptVariables.default) || [] : void 0, d = yield u == null ? void 0 : u.loadSession("", {
|
|
100
101
|
name: t == null ? void 0 : t.name,
|
|
101
102
|
// @ts-ignore netOpen入参是number 响应是boolen
|
|
102
103
|
// 只有对话有联网 其它没有
|
|
103
104
|
// 不传netOpen会默认取defaultNetOpen
|
|
104
|
-
netOpen: (k == null ? void 0 : k.type) === 0 ? t != null && t.netOpen ? t.netOpen : a ?
|
|
105
|
-
knowledges: (
|
|
106
|
-
promptVariables:
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
netOpen: (k == null ? void 0 : k.type) === 0 ? t != null && t.netOpen ? t.netOpen : a ? rt.OPEN : rt.CLOSE : void 0,
|
|
106
|
+
knowledges: (m = e == null ? void 0 : e.data) != null && m.id ? t == null ? void 0 : t.knowledges : R,
|
|
107
|
+
promptVariables: p
|
|
108
|
+
}), r = (g) => {
|
|
109
|
+
var N;
|
|
110
|
+
F.config({
|
|
111
|
+
getContainer: () => (V == null ? void 0 : V.current) || document.body,
|
|
112
|
+
prefixCls: "gbot-notification"
|
|
113
|
+
}), F.error({
|
|
114
|
+
message: ((N = g.cause) == null ? void 0 : N.message) || g.message
|
|
115
|
+
}), F.config({
|
|
116
|
+
getContainer: void 0,
|
|
117
|
+
prefixCls: "gbot-notification"
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
d == null || d.addEventListener("error", r), d == null || d.addEventListener("data:created", () => x(void 0, null, function* () {
|
|
121
|
+
d == null || d.removeEventListener("error", r), j([d, ...C]), n(d);
|
|
110
122
|
}));
|
|
111
123
|
}));
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
knowledges:
|
|
124
|
+
}, pt = () => {
|
|
125
|
+
W({
|
|
126
|
+
knowledges: R
|
|
115
127
|
}).then((t) => {
|
|
116
128
|
l == null || l(t);
|
|
117
129
|
});
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
var
|
|
121
|
-
const a =
|
|
122
|
-
var
|
|
123
|
-
return ((
|
|
130
|
+
}, ht = (t) => {
|
|
131
|
+
u == null || u.removeSession(t, !0).then(() => x(void 0, null, function* () {
|
|
132
|
+
var n, p;
|
|
133
|
+
const a = C.filter((d) => {
|
|
134
|
+
var r, m;
|
|
135
|
+
return ((r = d.data) == null ? void 0 : r.id) !== ((m = t.data) == null ? void 0 : m.id);
|
|
124
136
|
});
|
|
125
|
-
((
|
|
137
|
+
((n = t.data) == null ? void 0 : n.id) === ((p = e == null ? void 0 : e.data) == null ? void 0 : p.id) && (a != null && a.length ? l == null || l(a[0]) : l == null || l(null)), j([...a]);
|
|
126
138
|
}));
|
|
127
|
-
},
|
|
128
|
-
var a,
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
const a =
|
|
139
|
+
}, yt = (t) => {
|
|
140
|
+
var a, n;
|
|
141
|
+
$((a = t.data) == null ? void 0 : a.name), P(""), z(((n = t.data) == null ? void 0 : n.id) || null);
|
|
142
|
+
}, gt = (t) => {
|
|
143
|
+
const a = J(Y || "");
|
|
132
144
|
if (a) {
|
|
133
|
-
|
|
145
|
+
P(a);
|
|
134
146
|
return;
|
|
135
147
|
}
|
|
136
|
-
t.rename(
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
l == null || l(t),
|
|
143
|
-
}),
|
|
148
|
+
t.rename(Y.trim()), t == null || t.addEventListener("data:updated", X), q();
|
|
149
|
+
}, vt = () => {
|
|
150
|
+
q();
|
|
151
|
+
}, q = () => {
|
|
152
|
+
z(null), $(""), P(""), H((t) => t + 1);
|
|
153
|
+
}, J = (t) => !t || t.trim().length === 0 ? "会话名称不能为空" : t.length > K ? `不能超过${K}个字符` : "", ut = (t) => x(void 0, null, function* () {
|
|
154
|
+
l == null || l(t), w == null || w(t);
|
|
155
|
+
}), Nt = (t) => {
|
|
144
156
|
const a = t.target.value;
|
|
145
|
-
|
|
157
|
+
$(a), P(J(a));
|
|
146
158
|
};
|
|
147
|
-
|
|
148
|
-
var a,
|
|
159
|
+
T(() => {
|
|
160
|
+
var a, n, p, d;
|
|
149
161
|
if (!(e != null && e.id))
|
|
150
162
|
return;
|
|
151
163
|
const t = {};
|
|
152
164
|
if (typeof (o == null ? void 0 : o.knowledges) == "object" && ((a = o == null ? void 0 : o.knowledges) != null && a.default)) {
|
|
153
|
-
if (t.knowledges = (
|
|
165
|
+
if (t.knowledges = (n = o == null ? void 0 : o.knowledges) == null ? void 0 : n.default, Array.isArray(t.knowledges) && t.knowledges.some((g) => Array.isArray(g.fileIds) && g.fileIds.length === 0))
|
|
154
166
|
throw Error("fileIds cannot be an empty array");
|
|
155
|
-
if (
|
|
156
|
-
throw Error(`knowledges and fileIds total count cannot exceed ${
|
|
167
|
+
if (st(t.knowledges) > D)
|
|
168
|
+
throw Error(`knowledges and fileIds total count cannot exceed ${D}`);
|
|
157
169
|
}
|
|
158
|
-
typeof (o == null ? void 0 : o.promptVariables) == "object" && ((
|
|
170
|
+
typeof (o == null ? void 0 : o.promptVariables) == "object" && ((p = o == null ? void 0 : o.promptVariables) != null && p.default) && (t.promptVariables = (d = o == null ? void 0 : o.promptVariables) == null ? void 0 : d.default), u == null || u.loadSession(e.id, t);
|
|
159
171
|
}, [e]);
|
|
160
|
-
const
|
|
161
|
-
const a =
|
|
162
|
-
return t.forEach((
|
|
163
|
-
var
|
|
164
|
-
const i =
|
|
165
|
-
if (i.isAfter(
|
|
166
|
-
|
|
167
|
-
else if (i.isAfter(
|
|
168
|
-
|
|
169
|
-
else if (i.isAfter(
|
|
170
|
-
|
|
172
|
+
const Q = lt((t) => {
|
|
173
|
+
const a = y().endOf("day"), n = a.subtract(1, "day"), p = a.subtract(7, "day"), d = a.subtract(30, "day"), r = [], m = [], g = [], N = [], A = {};
|
|
174
|
+
return t.forEach((s) => {
|
|
175
|
+
var v;
|
|
176
|
+
const i = y((v = s.data) == null ? void 0 : v.createdAt);
|
|
177
|
+
if (i.isAfter(n))
|
|
178
|
+
m.push(s);
|
|
179
|
+
else if (i.isAfter(p))
|
|
180
|
+
g.push(s);
|
|
181
|
+
else if (i.isAfter(d))
|
|
182
|
+
N.push(s);
|
|
171
183
|
else {
|
|
172
|
-
const
|
|
173
|
-
|
|
184
|
+
const h = i.format("YYYY-MM");
|
|
185
|
+
A[h] || (A[h] = []), A[h].push(s);
|
|
174
186
|
}
|
|
175
|
-
}),
|
|
187
|
+
}), m.length > 0 && r.push({
|
|
176
188
|
title: "今天",
|
|
177
|
-
sessions:
|
|
178
|
-
var
|
|
179
|
-
return
|
|
189
|
+
sessions: m.sort((s, i) => {
|
|
190
|
+
var v, h;
|
|
191
|
+
return y((v = i.data) == null ? void 0 : v.createdAt).valueOf() - y((h = s.data) == null ? void 0 : h.createdAt).valueOf();
|
|
180
192
|
}),
|
|
181
193
|
key: "today"
|
|
182
|
-
}),
|
|
194
|
+
}), g.length > 0 && r.push({
|
|
183
195
|
title: "7天内",
|
|
184
|
-
sessions:
|
|
185
|
-
var
|
|
186
|
-
return
|
|
196
|
+
sessions: g.sort((s, i) => {
|
|
197
|
+
var v, h;
|
|
198
|
+
return y((v = i.data) == null ? void 0 : v.createdAt).valueOf() - y((h = s.data) == null ? void 0 : h.createdAt).valueOf();
|
|
187
199
|
}),
|
|
188
200
|
key: "seven-days"
|
|
189
|
-
}),
|
|
201
|
+
}), N.length > 0 && r.push({
|
|
190
202
|
title: "30天内",
|
|
191
|
-
sessions:
|
|
192
|
-
var
|
|
193
|
-
return
|
|
203
|
+
sessions: N.sort((s, i) => {
|
|
204
|
+
var v, h;
|
|
205
|
+
return y((v = i.data) == null ? void 0 : v.createdAt).valueOf() - y((h = s.data) == null ? void 0 : h.createdAt).valueOf();
|
|
194
206
|
}),
|
|
195
207
|
key: "thirty-days"
|
|
196
|
-
}), Object.keys(
|
|
197
|
-
const i =
|
|
198
|
-
var
|
|
199
|
-
return
|
|
208
|
+
}), Object.keys(A).sort((s, i) => i.localeCompare(s)).forEach((s) => {
|
|
209
|
+
const i = A[s].sort((v, h) => {
|
|
210
|
+
var Z, tt;
|
|
211
|
+
return y((Z = h.data) == null ? void 0 : Z.createdAt).valueOf() - y((tt = v.data) == null ? void 0 : tt.createdAt).valueOf();
|
|
200
212
|
});
|
|
201
|
-
|
|
202
|
-
title:
|
|
213
|
+
r.push({
|
|
214
|
+
title: y(s).format("YYYY年MM月"),
|
|
203
215
|
sessions: i,
|
|
204
|
-
key: `month-${
|
|
216
|
+
key: `month-${s}`
|
|
205
217
|
});
|
|
206
|
-
}),
|
|
207
|
-
}),
|
|
208
|
-
return /* @__PURE__ */
|
|
218
|
+
}), r;
|
|
219
|
+
}), I = Lt(() => Q(C), [C, Q]);
|
|
220
|
+
return /* @__PURE__ */ c("div", {
|
|
209
221
|
className: "bot-session-container",
|
|
210
|
-
children: /* @__PURE__ */
|
|
222
|
+
children: /* @__PURE__ */ L("div", {
|
|
211
223
|
className: "agent-sessions",
|
|
212
|
-
children: [O && (o == null ? void 0 : o.siderTitle) && /* @__PURE__ */
|
|
224
|
+
children: [O && (o == null ? void 0 : o.siderTitle) && /* @__PURE__ */ c("div", {
|
|
213
225
|
className: "sessions-header",
|
|
214
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ c("div", {
|
|
215
227
|
className: "session-header-title",
|
|
216
228
|
children: (k == null ? void 0 : k.name) || "-"
|
|
217
229
|
})
|
|
218
|
-
}), /* @__PURE__ */
|
|
230
|
+
}), /* @__PURE__ */ L("div", {
|
|
219
231
|
className: "sessions-main",
|
|
220
|
-
children: [O && /* @__PURE__ */
|
|
232
|
+
children: [O && /* @__PURE__ */ c("div", {
|
|
221
233
|
className: "session-header-btn-wrapper",
|
|
222
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ c(Mt, {
|
|
223
235
|
className: "session-header-btn",
|
|
224
|
-
onClick:
|
|
236
|
+
onClick: pt,
|
|
225
237
|
type: "primary",
|
|
226
238
|
children: "+ 新会话"
|
|
227
239
|
})
|
|
228
|
-
}),
|
|
240
|
+
}), I == null ? void 0 : I.map((t) => {
|
|
229
241
|
var a;
|
|
230
|
-
return /* @__PURE__ */
|
|
242
|
+
return /* @__PURE__ */ L("div", {
|
|
231
243
|
className: "session-group",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ c("div", {
|
|
233
245
|
className: "group-header",
|
|
234
246
|
style: {
|
|
235
247
|
top: O ? 48 : 0
|
|
236
248
|
},
|
|
237
249
|
children: t.title
|
|
238
|
-
}), (a = t.sessions) == null ? void 0 : a.map((
|
|
239
|
-
var
|
|
240
|
-
return /* @__PURE__ */
|
|
250
|
+
}), (a = t.sessions) == null ? void 0 : a.map((n) => {
|
|
251
|
+
var p, d, r, m, g, N, A, S, s;
|
|
252
|
+
return /* @__PURE__ */ c("div", {
|
|
241
253
|
className: _t({
|
|
242
254
|
"session-item": !0,
|
|
243
|
-
"session-item__active": ((
|
|
255
|
+
"session-item__active": ((p = n.data) == null ? void 0 : p.id) === ((d = e == null ? void 0 : e.data) == null ? void 0 : d.id)
|
|
244
256
|
}),
|
|
245
|
-
onClick: () =>
|
|
246
|
-
children: /* @__PURE__ */
|
|
257
|
+
onClick: () => ut(n),
|
|
258
|
+
children: /* @__PURE__ */ c("div", {
|
|
247
259
|
className: "session-item-wrapper",
|
|
248
|
-
children: /* @__PURE__ */
|
|
260
|
+
children: /* @__PURE__ */ L("div", {
|
|
249
261
|
className: "session-item-top",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
262
|
+
children: [/* @__PURE__ */ c(xt.Paragraph, {
|
|
251
263
|
className: "item-top-title",
|
|
252
264
|
style: {
|
|
253
265
|
margin: 0,
|
|
@@ -256,71 +268,71 @@ const F = 15, Pt = At((u, m) => {
|
|
|
256
268
|
ellipsis: {
|
|
257
269
|
rows: 1,
|
|
258
270
|
tooltip: {
|
|
259
|
-
title: ((
|
|
271
|
+
title: ((r = n.data) == null ? void 0 : r.name) || "-",
|
|
260
272
|
placement: "topLeft"
|
|
261
273
|
}
|
|
262
274
|
},
|
|
263
|
-
children: ((
|
|
264
|
-
}), /* @__PURE__ */
|
|
265
|
-
children: [/* @__PURE__ */
|
|
275
|
+
children: ((m = n.data) == null ? void 0 : m.name) || "-"
|
|
276
|
+
}), /* @__PURE__ */ L(dt, {
|
|
277
|
+
children: [/* @__PURE__ */ c("span", {
|
|
266
278
|
className: "item-top-time",
|
|
267
|
-
children:
|
|
268
|
-
}), /* @__PURE__ */
|
|
279
|
+
children: y((g = n.data) == null ? void 0 : g.createdAt).format("MM/DD HH:mm:ss")
|
|
280
|
+
}), /* @__PURE__ */ L("div", {
|
|
269
281
|
className: "item-top-action",
|
|
270
282
|
onClick: (i) => i.stopPropagation(),
|
|
271
|
-
children: [/* @__PURE__ */
|
|
272
|
-
open:
|
|
283
|
+
children: [/* @__PURE__ */ c(nt, {
|
|
284
|
+
open: ft === ((N = n.data) == null ? void 0 : N.id),
|
|
273
285
|
getPopupContainer: (i) => i.parentNode,
|
|
274
286
|
icon: !1,
|
|
275
|
-
title: /* @__PURE__ */
|
|
287
|
+
title: /* @__PURE__ */ c(Ct, {
|
|
276
288
|
placeholder: "请输入内容",
|
|
277
289
|
autoComplete: "off",
|
|
278
290
|
showCount: !0,
|
|
279
|
-
value:
|
|
280
|
-
onChange:
|
|
281
|
-
maxLength:
|
|
282
|
-
status:
|
|
291
|
+
value: Y,
|
|
292
|
+
onChange: Nt,
|
|
293
|
+
maxLength: K,
|
|
294
|
+
status: mt ? "error" : ""
|
|
283
295
|
}),
|
|
284
|
-
onConfirm: () =>
|
|
285
|
-
onCancel:
|
|
286
|
-
children: /* @__PURE__ */
|
|
296
|
+
onConfirm: () => gt(n),
|
|
297
|
+
onCancel: vt,
|
|
298
|
+
children: /* @__PURE__ */ c(it, {
|
|
287
299
|
type: "icon-bianji2",
|
|
288
|
-
onClick: () =>
|
|
300
|
+
onClick: () => yt(n),
|
|
289
301
|
className: "icon-action",
|
|
290
302
|
style: {
|
|
291
303
|
marginRight: "8px"
|
|
292
304
|
}
|
|
293
305
|
})
|
|
294
|
-
}, `edit-${(
|
|
306
|
+
}, `edit-${(A = n.data) == null ? void 0 : A.id}-${U}`), /* @__PURE__ */ c(nt, {
|
|
295
307
|
getPopupContainer: (i) => i.parentNode,
|
|
296
308
|
icon: !1,
|
|
297
|
-
title: /* @__PURE__ */
|
|
309
|
+
title: /* @__PURE__ */ L(dt, {
|
|
298
310
|
direction: "vertical",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ c("div", {
|
|
300
312
|
children: "删除确认?"
|
|
301
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ c("div", {
|
|
302
314
|
children: "会话删除后不可恢复,请确认是否删除!"
|
|
303
315
|
})]
|
|
304
316
|
}),
|
|
305
317
|
onConfirm: () => {
|
|
306
|
-
|
|
318
|
+
ht(n), H((i) => i + 1);
|
|
307
319
|
},
|
|
308
320
|
onCancel: () => {
|
|
309
|
-
|
|
321
|
+
H((i) => i + 1);
|
|
310
322
|
},
|
|
311
|
-
children: /* @__PURE__ */
|
|
323
|
+
children: /* @__PURE__ */ c(it, {
|
|
312
324
|
style: {
|
|
313
325
|
fontSize: "18px"
|
|
314
326
|
},
|
|
315
327
|
className: "icon-action",
|
|
316
328
|
type: "icon-del"
|
|
317
329
|
})
|
|
318
|
-
}, `delete-${(
|
|
330
|
+
}, `delete-${(S = n.data) == null ? void 0 : S.id}-${U}`)]
|
|
319
331
|
})]
|
|
320
332
|
})]
|
|
321
333
|
})
|
|
322
334
|
})
|
|
323
|
-
}, (
|
|
335
|
+
}, (s = n.data) == null ? void 0 : s.id);
|
|
324
336
|
})]
|
|
325
337
|
}, t.key);
|
|
326
338
|
})]
|
|
@@ -328,7 +340,7 @@ const F = 15, Pt = At((u, m) => {
|
|
|
328
340
|
})
|
|
329
341
|
});
|
|
330
342
|
});
|
|
331
|
-
|
|
343
|
+
Tt.displayName = "SessionList";
|
|
332
344
|
export {
|
|
333
|
-
|
|
345
|
+
Tt as default
|
|
334
346
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const e = "@glodon-aiot/agent-cli-ui", t = "3.8.0-
|
|
1
|
+
const e = "@glodon-aiot/agent-cli-ui", t = "3.8.0-beta.6", s = "./dist/es/index.mjs", i = "./dist/lib/index.js", o = "./dist/src/index.d.ts", n = {
|
|
2
2
|
import: "./dist/es/index.mjs",
|
|
3
3
|
require: "./dist/lib/index.js",
|
|
4
4
|
types: "./dist/src/index.d.ts"
|
|
5
|
-
},
|
|
5
|
+
}, r = [
|
|
6
6
|
"dist"
|
|
7
|
-
],
|
|
7
|
+
], c = "module", l = "dist/src/index.d.ts", d = {
|
|
8
8
|
dev: "vite",
|
|
9
9
|
start: "vite",
|
|
10
10
|
build: "tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod && yarn build:cdn",
|
|
@@ -25,8 +25,8 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.8.0-alpha.4", s = "./dist/es/index
|
|
|
25
25
|
webpack: "*"
|
|
26
26
|
}, p = {
|
|
27
27
|
"@ant-design/icons": "^5.3.4",
|
|
28
|
-
"@glodon-aiot/apis": "^3.8.0-
|
|
29
|
-
"@glodon-aiot/bot-client-sdk": "^3.8.0-
|
|
28
|
+
"@glodon-aiot/apis": "^3.8.0-beta.6",
|
|
29
|
+
"@glodon-aiot/bot-client-sdk": "^3.8.0-beta.6",
|
|
30
30
|
"@matejmazur/react-mathjax": "^0.1.10",
|
|
31
31
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
32
32
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|
|
@@ -125,9 +125,9 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.8.0-alpha.4", s = "./dist/es/index
|
|
|
125
125
|
main: i,
|
|
126
126
|
typings: o,
|
|
127
127
|
exports: n,
|
|
128
|
-
files:
|
|
129
|
-
type:
|
|
130
|
-
types:
|
|
128
|
+
files: r,
|
|
129
|
+
type: c,
|
|
130
|
+
types: l,
|
|
131
131
|
scripts: d,
|
|
132
132
|
peerDependencies: a,
|
|
133
133
|
dependencies: p,
|
|
@@ -148,7 +148,7 @@ export {
|
|
|
148
148
|
u as devDependencies,
|
|
149
149
|
b as development,
|
|
150
150
|
n as exports,
|
|
151
|
-
|
|
151
|
+
r as files,
|
|
152
152
|
v as husky,
|
|
153
153
|
i as main,
|
|
154
154
|
s as module,
|
|
@@ -157,8 +157,8 @@ export {
|
|
|
157
157
|
m as production,
|
|
158
158
|
y as publishConfig,
|
|
159
159
|
d as scripts,
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
c as type,
|
|
161
|
+
l as types,
|
|
162
162
|
o as typings,
|
|
163
163
|
t as version
|
|
164
164
|
};
|