@duxi999/usdp-eacp-conversation 0.0.1 → 0.0.2
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/components/UsdpEacpConversation.vue.d.ts +7 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +212 -192
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,42 +1,58 @@
|
|
|
1
|
-
import { defineComponent as Xe, computed as
|
|
2
|
-
import { Loading as
|
|
3
|
-
import { ElMessage as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as Xe, computed as j, ref as s, watch as K, onMounted as We, onUnmounted as Ye, resolveComponent as I, resolveDirective as Fe, openBlock as w, createElementBlock as L, createVNode as i, withCtx as r, createTextVNode as C, unref as he, createElementVNode as z, toDisplayString as H, createCommentVNode as Ge, withDirectives as Je, createBlock as Ke } from "vue";
|
|
2
|
+
import { Loading as we } from "@element-plus/icons-vue";
|
|
3
|
+
import { ElMessage as Q } from "element-plus";
|
|
4
|
+
const Qe = { class: "conversation-session" }, Ze = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "status-placeholder"
|
|
7
|
-
},
|
|
7
|
+
}, et = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "status-placeholder"
|
|
10
|
-
},
|
|
10
|
+
}, tt = {
|
|
11
11
|
key: 2,
|
|
12
12
|
class: "status-placeholder"
|
|
13
|
-
},
|
|
13
|
+
}, nt = {
|
|
14
14
|
key: 3,
|
|
15
15
|
class: "iframe-container"
|
|
16
|
-
},
|
|
16
|
+
}, at = ["src"], ot = {
|
|
17
17
|
key: 4,
|
|
18
18
|
class: "status-placeholder"
|
|
19
|
-
},
|
|
19
|
+
}, it = {
|
|
20
20
|
key: 5,
|
|
21
21
|
class: "status-placeholder"
|
|
22
|
-
},
|
|
22
|
+
}, st = { class: "env-limit-dialog" }, Ce = 30, rt = 2e3, lt = 45, ut = 300 * 1e3, ct = /* @__PURE__ */ Xe({
|
|
23
23
|
name: "UsdpXjgzConversation",
|
|
24
24
|
__name: "UsdpEacpConversation",
|
|
25
25
|
props: {
|
|
26
26
|
appCode: {},
|
|
27
|
-
request: {}
|
|
27
|
+
request: {},
|
|
28
|
+
appConfig: {}
|
|
28
29
|
},
|
|
29
30
|
emits: ["state-change"],
|
|
30
|
-
setup(b, { expose:
|
|
31
|
-
const o = b,
|
|
31
|
+
setup(b, { expose: Z, emit: X }) {
|
|
32
|
+
const o = b, ee = X, te = j(
|
|
32
33
|
() => o.appCode !== void 0 && o.appCode !== null && o.appCode !== "" ? String(o.appCode) : void 0
|
|
33
|
-
),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
), W = j(() => {
|
|
35
|
+
const e = o.appConfig;
|
|
36
|
+
if (e == null) return;
|
|
37
|
+
let t = null;
|
|
38
|
+
if (typeof e == "string")
|
|
39
|
+
try {
|
|
40
|
+
t = JSON.parse(e);
|
|
41
|
+
} catch {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
else typeof e == "object" && (t = e);
|
|
45
|
+
const a = t == null ? void 0 : t.projectId;
|
|
46
|
+
if (a == null) return;
|
|
47
|
+
const l = String(a).trim();
|
|
48
|
+
return l === "" ? void 0 : l;
|
|
49
|
+
}), n = s("not_exist"), ne = s(""), c = s(""), u = s(""), m = s(""), k = s(""), g = s(!1), y = j(() => n.value);
|
|
50
|
+
j(() => u.value || "智能助手");
|
|
51
|
+
const Te = j(() => k.value || te.value || null);
|
|
52
|
+
K(
|
|
53
|
+
[y, () => u.value, Te],
|
|
38
54
|
([e, t, a]) => {
|
|
39
|
-
|
|
55
|
+
ee("state-change", {
|
|
40
56
|
status: e,
|
|
41
57
|
nickname: t,
|
|
42
58
|
appCode: a
|
|
@@ -44,15 +60,15 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
44
60
|
},
|
|
45
61
|
{ immediate: !0 }
|
|
46
62
|
);
|
|
47
|
-
const x = s(!1),
|
|
63
|
+
const x = s(!1), Se = {
|
|
48
64
|
workspace: "工作区",
|
|
49
65
|
knowledge_base: "知识库",
|
|
50
66
|
agent: "智能体",
|
|
51
67
|
skill: "技能构建",
|
|
52
68
|
personal_assistant: "个人助手",
|
|
53
69
|
bid: "智能投标"
|
|
54
|
-
},
|
|
55
|
-
function
|
|
70
|
+
}, ae = s(!1), oe = s(!1), ie = s([]), D = s([]), Ee = s();
|
|
71
|
+
function Ie(e) {
|
|
56
72
|
if (!e) return "-";
|
|
57
73
|
try {
|
|
58
74
|
return new Date(e).toLocaleString("zh-CN", {
|
|
@@ -66,40 +82,42 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
66
82
|
return e;
|
|
67
83
|
}
|
|
68
84
|
}
|
|
69
|
-
async function
|
|
70
|
-
|
|
85
|
+
async function Le() {
|
|
86
|
+
ae.value = !0, D.value = [];
|
|
71
87
|
try {
|
|
72
|
-
|
|
88
|
+
ie.value = await o.request.get("/app-conversation/my-running-environments");
|
|
73
89
|
} catch {
|
|
74
|
-
|
|
90
|
+
Q.error("获取运行中环境列表失败"), ie.value = [];
|
|
75
91
|
} finally {
|
|
76
|
-
|
|
92
|
+
ae.value = !1;
|
|
77
93
|
}
|
|
78
94
|
}
|
|
79
|
-
|
|
80
|
-
e &&
|
|
95
|
+
K(x, (e) => {
|
|
96
|
+
e && Le();
|
|
81
97
|
});
|
|
82
|
-
function
|
|
98
|
+
function ke(e) {
|
|
83
99
|
D.value = e;
|
|
84
100
|
}
|
|
85
|
-
async function
|
|
101
|
+
async function xe() {
|
|
86
102
|
if (D.value.length !== 0) {
|
|
87
|
-
|
|
103
|
+
oe.value = !0;
|
|
88
104
|
try {
|
|
89
105
|
const e = D.value.map((a) => ({
|
|
90
|
-
appCode: a.appCode
|
|
106
|
+
appCode: a.appCode,
|
|
107
|
+
// appConfig 配置了 projectId 时携带(与 start-environment 对齐)
|
|
108
|
+
...W.value ? { projectId: W.value } : {}
|
|
91
109
|
})), t = await o.request.post("/app-conversation/batch-stop-environments", { environments: e });
|
|
92
|
-
t.allSuccess ||
|
|
110
|
+
t.allSuccess || Q.warning(`关闭完成:成功 ${t.successCount} 个,失败 ${t.failedCount} 个`), x.value = !1, await Ae();
|
|
93
111
|
} catch {
|
|
94
|
-
|
|
112
|
+
Q.error("关闭环境失败,请重试");
|
|
95
113
|
} finally {
|
|
96
|
-
|
|
114
|
+
oe.value = !1;
|
|
97
115
|
}
|
|
98
116
|
}
|
|
99
117
|
}
|
|
100
|
-
const _ = s(""),
|
|
101
|
-
let U = 0,
|
|
102
|
-
function
|
|
118
|
+
const _ = s(""), ve = s(null), h = s("");
|
|
119
|
+
let U = 0, P = null, q = null, M = null, T = null, O = !1, Y = null, F = 0, G = null;
|
|
120
|
+
function J(e) {
|
|
103
121
|
if (!e) return "";
|
|
104
122
|
try {
|
|
105
123
|
const t = new URL(e);
|
|
@@ -108,13 +126,15 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
108
126
|
return e;
|
|
109
127
|
}
|
|
110
128
|
}
|
|
111
|
-
async function
|
|
129
|
+
async function se() {
|
|
112
130
|
g.value = !0;
|
|
113
131
|
try {
|
|
114
132
|
const e = await o.request.post("/app-conversation/start-environment", {
|
|
115
|
-
appCode: o.appCode
|
|
133
|
+
appCode: o.appCode,
|
|
134
|
+
// appConfig 配置了 projectId 时携带(dynamic_project 模式后端必需)
|
|
135
|
+
...W.value ? { projectId: W.value } : {}
|
|
116
136
|
});
|
|
117
|
-
return e.status !== n.value && (n.value = e.status), e.environmentId && e.environmentId !== m.value && (m.value = e.environmentId), e.proxyUrl && e.proxyUrl !==
|
|
137
|
+
return e.status !== n.value && (n.value = e.status), e.environmentId && e.environmentId !== m.value && (m.value = e.environmentId), e.proxyUrl && e.proxyUrl !== c.value && (c.value = e.proxyUrl), e;
|
|
118
138
|
} finally {
|
|
119
139
|
g.value = !1;
|
|
120
140
|
}
|
|
@@ -124,11 +144,11 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
124
144
|
const e = await o.request.get("/app-conversation/environment-status", {
|
|
125
145
|
appCode: o.appCode
|
|
126
146
|
}, { silent: !0 });
|
|
127
|
-
e.status !== n.value && (n.value = e.status), e.environmentId && e.environmentId !== m.value && (m.value = e.environmentId), e.proxyUrl && e.proxyUrl !==
|
|
147
|
+
e.status !== n.value && (n.value = e.status), e.environmentId && e.environmentId !== m.value && (m.value = e.environmentId), e.proxyUrl && e.proxyUrl !== c.value && (c.value = e.proxyUrl);
|
|
128
148
|
} catch {
|
|
129
149
|
}
|
|
130
150
|
}
|
|
131
|
-
async function
|
|
151
|
+
async function de() {
|
|
132
152
|
g.value = !0;
|
|
133
153
|
try {
|
|
134
154
|
await o.request.post("/app-conversation/stop-environment", {
|
|
@@ -138,70 +158,70 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
138
158
|
g.value = !1;
|
|
139
159
|
}
|
|
140
160
|
}
|
|
141
|
-
async function
|
|
161
|
+
async function Ue() {
|
|
142
162
|
g.value = !0;
|
|
143
163
|
try {
|
|
144
164
|
await o.request.post("/app-conversation/destroy-environment", {
|
|
145
165
|
appCode: o.appCode
|
|
146
|
-
}), n.value = "not_exist",
|
|
166
|
+
}), n.value = "not_exist", c.value = "", m.value = "";
|
|
147
167
|
} finally {
|
|
148
168
|
g.value = !1;
|
|
149
169
|
}
|
|
150
170
|
}
|
|
151
|
-
async function
|
|
171
|
+
async function S() {
|
|
152
172
|
try {
|
|
153
173
|
const e = await o.request.get("/app-conversation/session-info", {
|
|
154
174
|
appCode: o.appCode
|
|
155
175
|
}, { silent: !0 });
|
|
156
|
-
return e.sessionId !==
|
|
176
|
+
return e.sessionId !== ne.value && (ne.value = e.sessionId), e.proxyUrl !== c.value && (c.value = e.proxyUrl), e.agentNickname !== u.value && (u.value = e.agentNickname), e.environmentId !== m.value && (m.value = e.environmentId), e.appCode && e.appCode !== k.value && (k.value = e.appCode), e.environmentStatus !== n.value && (n.value = e.environmentStatus), e;
|
|
157
177
|
} catch {
|
|
158
178
|
return;
|
|
159
179
|
}
|
|
160
180
|
}
|
|
161
|
-
function
|
|
162
|
-
|
|
163
|
-
if (
|
|
181
|
+
function V() {
|
|
182
|
+
v(), F = 0, Y = setInterval(async () => {
|
|
183
|
+
if (F++, F > lt) {
|
|
164
184
|
if (await A(), n.value === "running") {
|
|
165
|
-
|
|
185
|
+
v(), E(), u.value || S();
|
|
166
186
|
return;
|
|
167
187
|
}
|
|
168
|
-
|
|
188
|
+
v(), n.value = "start_failed";
|
|
169
189
|
return;
|
|
170
190
|
}
|
|
171
|
-
await A(), n.value === "running" ? (
|
|
172
|
-
},
|
|
191
|
+
await A(), n.value === "running" ? (v(), E(), u.value || S()) : n.value === "start_failed" && v();
|
|
192
|
+
}, rt);
|
|
173
193
|
}
|
|
174
|
-
function
|
|
175
|
-
|
|
194
|
+
function v() {
|
|
195
|
+
Y !== null && (clearInterval(Y), Y = null), F = 0;
|
|
176
196
|
}
|
|
177
|
-
function
|
|
178
|
-
N(),
|
|
197
|
+
function E() {
|
|
198
|
+
N(), G = setInterval(async () => {
|
|
179
199
|
document.visibilityState === "visible" && await A();
|
|
180
|
-
},
|
|
200
|
+
}, ut);
|
|
181
201
|
}
|
|
182
202
|
function N() {
|
|
183
|
-
|
|
203
|
+
G !== null && (clearInterval(G), G = null);
|
|
184
204
|
}
|
|
185
|
-
function
|
|
186
|
-
|
|
205
|
+
function re() {
|
|
206
|
+
v(), N(), n.value = "not_exist", ne.value = "", c.value = "", u.value = "", m.value = "", k.value = "", g.value = !1;
|
|
187
207
|
}
|
|
188
|
-
|
|
189
|
-
[() => n.value, () =>
|
|
190
|
-
([e, t], [a,
|
|
208
|
+
K(
|
|
209
|
+
[() => n.value, () => c.value],
|
|
210
|
+
([e, t], [a, l]) => {
|
|
191
211
|
if (!t || e !== "running") {
|
|
192
|
-
_.value = "", h.value = "",
|
|
212
|
+
_.value = "", h.value = "", d(), $();
|
|
193
213
|
return;
|
|
194
214
|
}
|
|
195
|
-
|
|
215
|
+
J(t) !== J(l || "") && me(t, a === "starting");
|
|
196
216
|
},
|
|
197
217
|
{ immediate: !0 }
|
|
198
|
-
),
|
|
218
|
+
), K(
|
|
199
219
|
() => n.value,
|
|
200
220
|
(e, t) => {
|
|
201
221
|
if (e === "running" && t === "starting") {
|
|
202
|
-
const a =
|
|
222
|
+
const a = c.value;
|
|
203
223
|
if (!a) return;
|
|
204
|
-
(!_.value ||
|
|
224
|
+
(!_.value || J(a) === J(_.value)) && me(a, !0);
|
|
205
225
|
}
|
|
206
226
|
}
|
|
207
227
|
);
|
|
@@ -213,16 +233,16 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
213
233
|
await A();
|
|
214
234
|
const t = n.value;
|
|
215
235
|
if (t === "running") {
|
|
216
|
-
|
|
236
|
+
E();
|
|
217
237
|
return;
|
|
218
238
|
}
|
|
219
239
|
if (t === "starting") {
|
|
220
|
-
|
|
240
|
+
V();
|
|
221
241
|
return;
|
|
222
242
|
}
|
|
223
243
|
}
|
|
224
244
|
try {
|
|
225
|
-
await
|
|
245
|
+
await se(), u.value || S(), n.value === "starting" ? V() : n.value === "running" && E();
|
|
226
246
|
} catch (t) {
|
|
227
247
|
if ((t == null ? void 0 : t.code) === 23010) {
|
|
228
248
|
x.value = !0;
|
|
@@ -231,36 +251,36 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
231
251
|
}
|
|
232
252
|
}
|
|
233
253
|
}
|
|
234
|
-
async function
|
|
254
|
+
async function Ae() {
|
|
235
255
|
await new Promise((e) => setTimeout(e, 500)), await R();
|
|
236
256
|
}
|
|
237
|
-
async function
|
|
238
|
-
n.value = "stopping",
|
|
257
|
+
async function Ne() {
|
|
258
|
+
n.value = "stopping", v(), N(), d(), $();
|
|
239
259
|
try {
|
|
240
|
-
return await
|
|
260
|
+
return await de(), !0;
|
|
241
261
|
} catch {
|
|
242
262
|
return n.value = "running", !1;
|
|
243
263
|
}
|
|
244
264
|
}
|
|
245
|
-
async function
|
|
246
|
-
let e = k.value ||
|
|
247
|
-
return e || (await
|
|
265
|
+
async function Re() {
|
|
266
|
+
let e = k.value || te.value;
|
|
267
|
+
return e || (await S(), e = k.value || te.value), e || void 0;
|
|
248
268
|
}
|
|
249
|
-
function
|
|
269
|
+
function $e() {
|
|
250
270
|
const e = _.value;
|
|
251
271
|
if (!e) return;
|
|
252
|
-
|
|
272
|
+
d(), U = 0;
|
|
253
273
|
const t = e.includes("?") ? "&" : "?";
|
|
254
|
-
h.value = `${e}${t}_refresh=${Date.now()}`,
|
|
255
|
-
}
|
|
256
|
-
function $e() {
|
|
257
|
-
de();
|
|
274
|
+
h.value = `${e}${t}_refresh=${Date.now()}`, ue(h.value);
|
|
258
275
|
}
|
|
259
276
|
function De() {
|
|
260
|
-
|
|
277
|
+
fe();
|
|
278
|
+
}
|
|
279
|
+
function Pe() {
|
|
280
|
+
ce("network");
|
|
261
281
|
}
|
|
262
|
-
function
|
|
263
|
-
|
|
282
|
+
function fe() {
|
|
283
|
+
O && (d(), U = 0);
|
|
264
284
|
}
|
|
265
285
|
function qe(e) {
|
|
266
286
|
try {
|
|
@@ -272,133 +292,133 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
272
292
|
}
|
|
273
293
|
async function Me(e) {
|
|
274
294
|
try {
|
|
275
|
-
const t = qe(e), a = new AbortController(),
|
|
295
|
+
const t = qe(e), a = new AbortController(), l = setTimeout(() => a.abort(), 5e3), f = await fetch(t, {
|
|
276
296
|
method: "HEAD",
|
|
277
297
|
mode: "cors",
|
|
278
298
|
cache: "no-cache",
|
|
279
299
|
signal: a.signal
|
|
280
300
|
});
|
|
281
|
-
return clearTimeout(
|
|
301
|
+
return clearTimeout(l), f.status === 200;
|
|
282
302
|
} catch {
|
|
283
303
|
return !1;
|
|
284
304
|
}
|
|
285
305
|
}
|
|
286
306
|
async function le(e, t = 0) {
|
|
287
307
|
if (await Me(e)) {
|
|
288
|
-
|
|
308
|
+
pe(e);
|
|
289
309
|
return;
|
|
290
310
|
}
|
|
291
|
-
t <
|
|
311
|
+
t < Ce ? P = setTimeout(() => {
|
|
292
312
|
le(e, t + 1);
|
|
293
|
-
}, 100) :
|
|
313
|
+
}, 100) : pe(e);
|
|
294
314
|
}
|
|
295
|
-
function
|
|
296
|
-
_.value = e, h.value = e,
|
|
315
|
+
function pe(e) {
|
|
316
|
+
_.value = e, h.value = e, ue(e);
|
|
297
317
|
}
|
|
298
|
-
function
|
|
299
|
-
|
|
300
|
-
le(e),
|
|
318
|
+
function me(e, t) {
|
|
319
|
+
d(), $(), U = 0, t ? q = setTimeout(() => {
|
|
320
|
+
le(e), q = null;
|
|
301
321
|
}, 1500) : le(e);
|
|
302
322
|
}
|
|
303
323
|
function $() {
|
|
304
|
-
|
|
324
|
+
P && (clearTimeout(P), P = null), q && (clearTimeout(q), q = null), T && (clearTimeout(T), T = null);
|
|
305
325
|
}
|
|
306
|
-
function
|
|
307
|
-
if (
|
|
308
|
-
|
|
326
|
+
function ue(e) {
|
|
327
|
+
if (d(), !window.PerformanceObserver) {
|
|
328
|
+
ge();
|
|
309
329
|
return;
|
|
310
330
|
}
|
|
311
|
-
|
|
331
|
+
O = !0;
|
|
312
332
|
try {
|
|
313
|
-
|
|
333
|
+
M = new PerformanceObserver((t) => {
|
|
314
334
|
for (const a of t.getEntries()) {
|
|
315
|
-
const
|
|
335
|
+
const l = a;
|
|
316
336
|
if (a.name !== e && a.name !== h.value) continue;
|
|
317
|
-
const f =
|
|
337
|
+
const f = l.responseStatus;
|
|
318
338
|
if (f === 502) {
|
|
319
|
-
|
|
339
|
+
ce("502");
|
|
320
340
|
return;
|
|
321
341
|
}
|
|
322
|
-
f >= 200 && f < 400 &&
|
|
342
|
+
f >= 200 && f < 400 && fe();
|
|
323
343
|
}
|
|
324
|
-
}),
|
|
344
|
+
}), M.observe({ type: "resource", buffered: !0 });
|
|
325
345
|
} catch {
|
|
326
346
|
}
|
|
327
|
-
|
|
347
|
+
ge();
|
|
328
348
|
}
|
|
329
|
-
function
|
|
330
|
-
|
|
349
|
+
function d() {
|
|
350
|
+
M && (M.disconnect(), M = null), T && (clearTimeout(T), T = null), O = !1;
|
|
331
351
|
}
|
|
332
|
-
function
|
|
352
|
+
function ge(e) {
|
|
333
353
|
T = setTimeout(() => {
|
|
334
|
-
|
|
354
|
+
O && ce("timeout");
|
|
335
355
|
}, 15e3);
|
|
336
356
|
}
|
|
337
|
-
function
|
|
338
|
-
if (!
|
|
339
|
-
if (
|
|
340
|
-
|
|
357
|
+
function ce(e) {
|
|
358
|
+
if (!O) return;
|
|
359
|
+
if (d(), U++, U > Ce) {
|
|
360
|
+
Q.error("应用加载失败,请刷新页面重试");
|
|
341
361
|
return;
|
|
342
362
|
}
|
|
343
|
-
console.warn(`[ConversationSession] 加载失败: ${e === "network" ? "网络错误" : e === "timeout" ? "加载超时" : "应用暂不可用"}, 第 ${U} 次重试`),
|
|
363
|
+
console.warn(`[ConversationSession] 加载失败: ${e === "network" ? "网络错误" : e === "timeout" ? "加载超时" : "应用暂不可用"}, 第 ${U} 次重试`), P = setTimeout(() => {
|
|
344
364
|
if (!_.value) return;
|
|
345
365
|
const a = _.value.includes("?") ? "&" : "?";
|
|
346
|
-
h.value = `${_.value}${a}_retry=${Date.now()}`,
|
|
366
|
+
h.value = `${_.value}${a}_retry=${Date.now()}`, ue(h.value);
|
|
347
367
|
}, 1e3);
|
|
348
368
|
}
|
|
349
|
-
function
|
|
369
|
+
function ye() {
|
|
350
370
|
document.visibilityState === "visible" && y.value === "running" && A();
|
|
351
371
|
}
|
|
352
372
|
We(async () => {
|
|
353
|
-
document.addEventListener("visibilitychange",
|
|
373
|
+
document.addEventListener("visibilitychange", ye), await A();
|
|
354
374
|
const e = n.value;
|
|
355
|
-
e === "not_exist" || e === "stopped" ? R() : (await
|
|
375
|
+
e === "not_exist" || e === "stopped" ? R() : (await S(), e === "starting" ? V() : e === "running" && E());
|
|
356
376
|
});
|
|
357
|
-
async function
|
|
377
|
+
async function Oe() {
|
|
358
378
|
const e = n.value;
|
|
359
|
-
if (n.value = "stopping",
|
|
379
|
+
if (n.value = "stopping", v(), N(), d(), $(), e === "running" || e === "starting")
|
|
360
380
|
try {
|
|
361
|
-
await
|
|
381
|
+
await de();
|
|
362
382
|
} catch {
|
|
363
383
|
}
|
|
364
|
-
|
|
384
|
+
re(), n.value = "starting";
|
|
365
385
|
try {
|
|
366
|
-
await
|
|
386
|
+
await se(), S(), n.value === "starting" ? V() : n.value === "running" && E();
|
|
367
387
|
} catch {
|
|
368
388
|
}
|
|
369
389
|
}
|
|
370
390
|
async function Ve() {
|
|
371
|
-
n.value = "stopping",
|
|
391
|
+
n.value = "stopping", v(), N(), d(), $();
|
|
372
392
|
try {
|
|
373
|
-
await
|
|
393
|
+
await Ue();
|
|
374
394
|
} catch {
|
|
375
395
|
}
|
|
376
|
-
|
|
396
|
+
re(), n.value = "starting";
|
|
377
397
|
try {
|
|
378
|
-
await
|
|
398
|
+
await se(), S(), n.value === "starting" ? V() : n.value === "running" && E();
|
|
379
399
|
} catch {
|
|
380
400
|
}
|
|
381
401
|
}
|
|
382
|
-
function
|
|
383
|
-
var
|
|
384
|
-
const a = (
|
|
402
|
+
function Be(e, t) {
|
|
403
|
+
var l;
|
|
404
|
+
const a = (l = ve.value) == null ? void 0 : l.contentWindow;
|
|
385
405
|
a && a.postMessage({ target: "dsh", type: e, payload: t }, "*");
|
|
386
406
|
}
|
|
387
|
-
return
|
|
388
|
-
|
|
407
|
+
return Z({ start: R, stop: Ne, restart: Oe, rebuild: Ve, refresh: $e, resolveAgentId: Re, postDshEvent: Be }), Ye(() => {
|
|
408
|
+
v(), N(), document.removeEventListener("visibilitychange", ye), d(), $(), re();
|
|
389
409
|
}), (e, t) => {
|
|
390
|
-
const a = I("el-button"),
|
|
391
|
-
return w(), L("div",
|
|
392
|
-
y.value === "not_exist" ? (w(), L("div",
|
|
393
|
-
i(
|
|
394
|
-
description: `${
|
|
410
|
+
const a = I("el-button"), l = I("el-empty"), f = I("el-icon"), _e = I("el-result"), B = I("el-table-column"), je = I("el-table"), ze = I("el-dialog"), He = Fe("loading");
|
|
411
|
+
return w(), L("div", Qe, [
|
|
412
|
+
y.value === "not_exist" ? (w(), L("div", Ze, [
|
|
413
|
+
i(l, {
|
|
414
|
+
description: `${u.value} 环境未启动`
|
|
395
415
|
}, {
|
|
396
|
-
default:
|
|
416
|
+
default: r(() => [
|
|
397
417
|
i(a, {
|
|
398
418
|
type: "primary",
|
|
399
419
|
onClick: R
|
|
400
420
|
}, {
|
|
401
|
-
default:
|
|
421
|
+
default: r(() => [...t[2] || (t[2] = [
|
|
402
422
|
C("启动环境", -1)
|
|
403
423
|
])]),
|
|
404
424
|
_: 1
|
|
@@ -406,48 +426,48 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
406
426
|
]),
|
|
407
427
|
_: 1
|
|
408
428
|
}, 8, ["description"])
|
|
409
|
-
])) : y.value === "starting" ? (w(), L("div",
|
|
429
|
+
])) : y.value === "starting" ? (w(), L("div", et, [
|
|
410
430
|
i(f, {
|
|
411
431
|
class: "is-loading",
|
|
412
432
|
size: 48
|
|
413
433
|
}, {
|
|
414
|
-
default:
|
|
415
|
-
i(
|
|
434
|
+
default: r(() => [
|
|
435
|
+
i(he(we))
|
|
416
436
|
]),
|
|
417
437
|
_: 1
|
|
418
438
|
}),
|
|
419
|
-
z("p", null, H(
|
|
420
|
-
])) : y.value === "stopping" ? (w(), L("div",
|
|
439
|
+
z("p", null, H(u.value) + " 环境启动中...", 1)
|
|
440
|
+
])) : y.value === "stopping" ? (w(), L("div", tt, [
|
|
421
441
|
i(f, {
|
|
422
442
|
class: "is-loading",
|
|
423
443
|
size: 48
|
|
424
444
|
}, {
|
|
425
|
-
default:
|
|
426
|
-
i(
|
|
445
|
+
default: r(() => [
|
|
446
|
+
i(he(we))
|
|
427
447
|
]),
|
|
428
448
|
_: 1
|
|
429
449
|
}),
|
|
430
|
-
z("p", null, "正在停止 " + H(
|
|
431
|
-
])) : y.value === "running" ? (w(), L("div",
|
|
450
|
+
z("p", null, "正在停止 " + H(u.value) + "...", 1)
|
|
451
|
+
])) : y.value === "running" ? (w(), L("div", nt, [
|
|
432
452
|
z("iframe", {
|
|
433
453
|
ref_key: "iframeRef",
|
|
434
|
-
ref:
|
|
454
|
+
ref: ve,
|
|
435
455
|
src: h.value,
|
|
436
456
|
class: "conversation-iframe",
|
|
437
|
-
onLoad:
|
|
438
|
-
onError:
|
|
439
|
-
}, null, 40,
|
|
440
|
-
])) : y.value === "start_failed" ? (w(), L("div",
|
|
441
|
-
i(
|
|
457
|
+
onLoad: De,
|
|
458
|
+
onError: Pe
|
|
459
|
+
}, null, 40, at)
|
|
460
|
+
])) : y.value === "start_failed" ? (w(), L("div", ot, [
|
|
461
|
+
i(_e, {
|
|
442
462
|
icon: "error",
|
|
443
463
|
title: "环境启动失败"
|
|
444
464
|
}, {
|
|
445
|
-
extra:
|
|
465
|
+
extra: r(() => [
|
|
446
466
|
i(a, {
|
|
447
467
|
type: "primary",
|
|
448
468
|
onClick: R
|
|
449
469
|
}, {
|
|
450
|
-
default:
|
|
470
|
+
default: r(() => [...t[3] || (t[3] = [
|
|
451
471
|
C("重新启动", -1)
|
|
452
472
|
])]),
|
|
453
473
|
_: 1
|
|
@@ -455,17 +475,17 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
455
475
|
]),
|
|
456
476
|
_: 1
|
|
457
477
|
})
|
|
458
|
-
])) : y.value === "stopped" ? (w(), L("div",
|
|
459
|
-
i(
|
|
478
|
+
])) : y.value === "stopped" ? (w(), L("div", it, [
|
|
479
|
+
i(_e, {
|
|
460
480
|
icon: "info",
|
|
461
481
|
title: "环境已停止"
|
|
462
482
|
}, {
|
|
463
|
-
extra:
|
|
483
|
+
extra: r(() => [
|
|
464
484
|
i(a, {
|
|
465
485
|
type: "primary",
|
|
466
486
|
onClick: R
|
|
467
487
|
}, {
|
|
468
|
-
default:
|
|
488
|
+
default: r(() => [...t[4] || (t[4] = [
|
|
469
489
|
C("重新启动", -1)
|
|
470
490
|
])]),
|
|
471
491
|
_: 1
|
|
@@ -473,7 +493,7 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
473
493
|
]),
|
|
474
494
|
_: 1
|
|
475
495
|
})
|
|
476
|
-
])) :
|
|
496
|
+
])) : Ge("", !0),
|
|
477
497
|
i(ze, {
|
|
478
498
|
"model-value": x.value,
|
|
479
499
|
title: "运行中环境数量已达上限",
|
|
@@ -481,39 +501,39 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
481
501
|
"close-on-click-modal": !1,
|
|
482
502
|
"onUpdate:modelValue": t[1] || (t[1] = (p) => x.value = p)
|
|
483
503
|
}, {
|
|
484
|
-
footer:
|
|
504
|
+
footer: r(() => [
|
|
485
505
|
i(a, {
|
|
486
506
|
onClick: t[0] || (t[0] = (p) => x.value = !1)
|
|
487
507
|
}, {
|
|
488
|
-
default:
|
|
508
|
+
default: r(() => [...t[6] || (t[6] = [
|
|
489
509
|
C("暂不关闭", -1)
|
|
490
510
|
])]),
|
|
491
511
|
_: 1
|
|
492
512
|
}),
|
|
493
513
|
i(a, {
|
|
494
514
|
type: "primary",
|
|
495
|
-
loading:
|
|
515
|
+
loading: oe.value,
|
|
496
516
|
disabled: D.value.length === 0,
|
|
497
|
-
onClick:
|
|
517
|
+
onClick: xe
|
|
498
518
|
}, {
|
|
499
|
-
default:
|
|
519
|
+
default: r(() => [...t[7] || (t[7] = [
|
|
500
520
|
C(" 关闭已选环境 ", -1)
|
|
501
521
|
])]),
|
|
502
522
|
_: 1
|
|
503
523
|
}, 8, ["loading", "disabled"])
|
|
504
524
|
]),
|
|
505
|
-
default:
|
|
506
|
-
z("div",
|
|
525
|
+
default: r(() => [
|
|
526
|
+
z("div", st, [
|
|
507
527
|
t[5] || (t[5] = z("p", { class: "env-limit-dialog__tip" }, " 您的运行中智能会话数量已达上限,请选择需要关闭的会话后重试。 ", -1)),
|
|
508
|
-
|
|
528
|
+
Je((w(), Ke(je, {
|
|
509
529
|
ref_key: "envLimitTableRef",
|
|
510
530
|
ref: Ee,
|
|
511
|
-
data:
|
|
531
|
+
data: ie.value,
|
|
512
532
|
"max-height": "520",
|
|
513
533
|
"header-cell-style": { textAlign: "center" },
|
|
514
|
-
onSelectionChange:
|
|
534
|
+
onSelectionChange: ke
|
|
515
535
|
}, {
|
|
516
|
-
default:
|
|
536
|
+
default: r(() => [
|
|
517
537
|
i(B, {
|
|
518
538
|
type: "selection",
|
|
519
539
|
width: "42"
|
|
@@ -522,8 +542,8 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
522
542
|
label: "场景类型",
|
|
523
543
|
"min-width": "100"
|
|
524
544
|
}, {
|
|
525
|
-
default:
|
|
526
|
-
C(H(
|
|
545
|
+
default: r(({ row: p }) => [
|
|
546
|
+
C(H(Se[p.sceneType] || p.sceneType), 1)
|
|
527
547
|
]),
|
|
528
548
|
_: 1
|
|
529
549
|
}),
|
|
@@ -538,7 +558,7 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
538
558
|
"min-width": "130",
|
|
539
559
|
"show-overflow-tooltip": ""
|
|
540
560
|
}, {
|
|
541
|
-
default:
|
|
561
|
+
default: r(({ row: p }) => [
|
|
542
562
|
C(H(p.agentNickname || "-"), 1)
|
|
543
563
|
]),
|
|
544
564
|
_: 1
|
|
@@ -547,15 +567,15 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
547
567
|
label: "创建时间",
|
|
548
568
|
"min-width": "170"
|
|
549
569
|
}, {
|
|
550
|
-
default:
|
|
551
|
-
C(H(
|
|
570
|
+
default: r(({ row: p }) => [
|
|
571
|
+
C(H(Ie(p.createdAt)), 1)
|
|
552
572
|
]),
|
|
553
573
|
_: 1
|
|
554
574
|
})
|
|
555
575
|
]),
|
|
556
576
|
_: 1
|
|
557
577
|
}, 8, ["data"])), [
|
|
558
|
-
[He,
|
|
578
|
+
[He, ae.value]
|
|
559
579
|
])
|
|
560
580
|
])
|
|
561
581
|
]),
|
|
@@ -564,18 +584,18 @@ const Ke = { class: "conversation-session" }, Qe = {
|
|
|
564
584
|
]);
|
|
565
585
|
};
|
|
566
586
|
}
|
|
567
|
-
}),
|
|
587
|
+
}), vt = (b, Z) => {
|
|
568
588
|
const X = b.__vccOpts || b;
|
|
569
|
-
for (const [o,
|
|
570
|
-
X[o] =
|
|
589
|
+
for (const [o, ee] of Z)
|
|
590
|
+
X[o] = ee;
|
|
571
591
|
return X;
|
|
572
|
-
},
|
|
592
|
+
}, be = /* @__PURE__ */ vt(ct, [["__scopeId", "data-v-f0ca27ea"]]), dt = "usdp-eacp-conversation", gt = {
|
|
573
593
|
install(b) {
|
|
574
|
-
b.component(
|
|
594
|
+
b.component(dt, be), b.component("UsdpEacpConversation", be);
|
|
575
595
|
}
|
|
576
596
|
};
|
|
577
597
|
export {
|
|
578
|
-
|
|
579
|
-
|
|
598
|
+
be as ConversationSession,
|
|
599
|
+
gt as default
|
|
580
600
|
};
|
|
581
601
|
//# sourceMappingURL=index.js.map
|