@topdatasec/probe 1.0.8 → 1.0.9

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.
@@ -1,298 +1,325 @@
1
- import { defineComponent as K, useModel as re, resolveComponent as d, openBlock as y, createElementBlock as x, Fragment as B, renderList as W, createVNode as e, withCtx as T, unref as q, createCommentVNode as O, ref as w, reactive as H, createTextVNode as F, createElementVNode as f, toDisplayString as C, mergeProps as Y, createBlock as G } from "vue";
2
- import { CircleClose as ae, UploadFilled as se } from "@element-plus/icons-vue";
3
- import { TdsTable as ue, TdsForm as ee } from "topdatasec-ui";
4
- import ie from "spark-md5";
5
- import { ElMessage as X } from "element-plus";
6
- const pe = {
1
+ import { defineComponent as W, useModel as de, resolveComponent as c, openBlock as h, createElementBlock as x, Fragment as z, renderList as G, createVNode as t, withCtx as b, unref as F, createCommentVNode as K, ref as w, reactive as H, createTextVNode as E, createElementVNode as p, toDisplayString as q, normalizeClass as te, withModifiers as le, mergeProps as oe, onUnmounted as pe, createBlock as Q } from "vue";
2
+ import { CircleClose as ce, UploadFilled as me } from "@element-plus/icons-vue";
3
+ import { TdsTable as _e, TdsForm as re } from "topdatasec-ui";
4
+ import ye from "spark-md5";
5
+ import { ElMessage as ee } from "element-plus";
6
+ const fe = {
7
7
  key: 0,
8
8
  class: "absolute right--13px text-#f56c6c hover:cursor-pointer"
9
- }, de = /* @__PURE__ */ K({
9
+ }, ve = /* @__PURE__ */ W({
10
10
  __name: "IpPortList",
11
11
  props: {
12
12
  modelValue: { default: () => [{ ip: "", port: "" }] },
13
13
  modelModifiers: {}
14
14
  },
15
15
  emits: ["update:modelValue"],
16
- setup(t) {
17
- const l = re(t, "modelValue"), { $t: a } = window;
18
- function r() {
19
- l.value = [...l.value, { ip: "", port: "" }];
16
+ setup(l) {
17
+ const o = de(l, "modelValue"), { $t: n } = window;
18
+ function a() {
19
+ o.value = [...o.value, { ip: "", port: "" }];
20
20
  }
21
- function c(v) {
22
- const n = [...l.value];
23
- n.splice(v, 1), l.value = n;
21
+ function m(_) {
22
+ const r = [...o.value];
23
+ r.splice(_, 1), o.value = r;
24
24
  }
25
- return (v, n) => {
26
- const m = d("el-input"), E = d("el-form-item"), b = d("el-icon"), s = d("el-button");
27
- return y(), x("div", null, [
28
- (y(!0), x(B, null, W(l.value, (p, $) => (y(), x("div", {
29
- key: $,
25
+ return (_, r) => {
26
+ const v = c("el-input"), k = c("el-form-item"), g = c("el-icon"), u = c("el-button");
27
+ return h(), x("div", null, [
28
+ (h(!0), x(z, null, G(o.value, (y, U) => (h(), x("div", {
29
+ key: U,
30
30
  class: "flex form-m0 w-100% mb-5px"
31
31
  }, [
32
- e(E, { class: "w-70%" }, {
33
- default: T(() => [
34
- e(m, {
35
- modelValue: p.ip,
36
- "onUpdate:modelValue": (M) => p.ip = M,
32
+ t(k, { class: "w-70%" }, {
33
+ default: b(() => [
34
+ t(v, {
35
+ modelValue: y.ip,
36
+ "onUpdate:modelValue": (M) => y.ip = M,
37
37
  class: "min-w-300px w-100%",
38
38
  placeholder: "IP"
39
39
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
40
40
  ]),
41
41
  _: 2
42
42
  }, 1024),
43
- e(E, { class: "ml-auto w-30%" }, {
44
- default: T(() => [
45
- e(m, {
46
- modelValue: p.port,
47
- "onUpdate:modelValue": (M) => p.port = M,
43
+ t(k, { class: "ml-auto w-30%" }, {
44
+ default: b(() => [
45
+ t(v, {
46
+ modelValue: y.port,
47
+ "onUpdate:modelValue": (M) => y.port = M,
48
48
  class: "ml-10",
49
- placeholder: q(a)("global.port")
49
+ placeholder: F(n)("global.port")
50
50
  }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
51
51
  ]),
52
52
  _: 2
53
53
  }, 1024),
54
- l.value.length > 1 ? (y(), x("div", pe, [
55
- e(b, {
56
- onClick: (M) => c($)
54
+ o.value.length > 1 ? (h(), x("div", fe, [
55
+ t(g, {
56
+ onClick: (M) => m(U)
57
57
  }, {
58
- default: T(() => [
59
- e(q(ae))
58
+ default: b(() => [
59
+ t(F(ce))
60
60
  ]),
61
61
  _: 1
62
62
  }, 8, ["onClick"])
63
- ])) : O("", !0)
63
+ ])) : K("", !0)
64
64
  ]))), 128)),
65
- e(s, {
65
+ t(u, {
66
66
  class: "w-100% mt-10px border-dashed!",
67
67
  icon: "Plus",
68
- onClick: r
68
+ onClick: a
69
69
  })
70
70
  ]);
71
71
  };
72
72
  }
73
73
  });
74
- const te = (t, l) => {
75
- const a = t.__vccOpts || t;
76
- for (const [r, c] of l)
77
- a[r] = c;
78
- return a;
79
- }, V = /* @__PURE__ */ te(de, [["__scopeId", "data-v-16fc9c64"]]), P = 5 * 1024 * 1024;
80
- function ce(t, l) {
81
- return new Promise((a, r) => {
82
- const c = new ie.ArrayBuffer(), v = new FileReader(), n = Math.ceil(t.size / P);
83
- let m = 0;
84
- v.onload = (b) => {
85
- var s;
86
- if (c.append((s = b.target) == null ? void 0 : s.result), m++, l) {
87
- const p = Math.floor(m / n * 100);
88
- l(p);
74
+ const ne = (l, o) => {
75
+ const n = l.__vccOpts || l;
76
+ for (const [a, m] of o)
77
+ n[a] = m;
78
+ return n;
79
+ }, P = /* @__PURE__ */ ne(ve, [["__scopeId", "data-v-16fc9c64"]]), V = 5 * 1024 * 1024;
80
+ function ge(l, o) {
81
+ return new Promise((n, a) => {
82
+ const m = new ye.ArrayBuffer(), _ = new FileReader(), r = Math.ceil(l.size / V);
83
+ let v = 0;
84
+ _.onload = (g) => {
85
+ var u;
86
+ if (m.append((u = g.target) == null ? void 0 : u.result), v++, o) {
87
+ const y = Math.floor(v / r * 100);
88
+ o(y);
89
89
  }
90
- if (m < n)
91
- E();
90
+ if (v < r)
91
+ k();
92
92
  else {
93
- const p = c.end();
94
- a(p);
93
+ const y = m.end();
94
+ n(y);
95
95
  }
96
- }, v.onerror = () => {
97
- r(new Error("MD5计算失败"));
96
+ }, _.onerror = () => {
97
+ a(new Error("MD5计算失败"));
98
98
  };
99
- function E() {
100
- const b = m * P, s = Math.min(b + P, t.size);
101
- v.readAsArrayBuffer(t.slice(b, s));
99
+ function k() {
100
+ const g = v * V, u = Math.min(g + V, l.size);
101
+ _.readAsArrayBuffer(l.slice(g, u));
102
102
  }
103
- E();
103
+ k();
104
104
  });
105
105
  }
106
- async function me(t, l, a, r, c, v = "/api/upload/chunk") {
107
- const n = l * P, m = Math.min(n + P, t.size), E = t.slice(n, m), b = m - n, s = new FormData();
108
- s.append("file", E, t.name), s.append("chunkIndex", String(l + 1)), s.append("totalChunkNum", String(a)), s.append("fileMd5", r), s.append("tds_token", c), s.append("fileName", t.name), s.append("fileSize", String(t.size)), s.append("fileExt", t.name.substring(t.name.lastIndexOf(".") + 1)), s.append("chunkSize", String(P)), s.append("currentChunkSize", String(b));
106
+ async function he(l, o, n, a, m, _ = "/api/upload/chunk") {
107
+ const r = o * V, v = Math.min(r + V, l.size), k = l.slice(r, v), g = v - r, u = new FormData();
108
+ u.append("file", k, l.name), u.append("chunkIndex", String(o + 1)), u.append("totalChunkNum", String(n)), u.append("fileMd5", a), u.append("tds_token", m), u.append("fileName", l.name), u.append("fileSize", String(l.size)), u.append("fileExt", l.name.substring(l.name.lastIndexOf(".") + 1)), u.append("chunkSize", String(V)), u.append("currentChunkSize", String(g));
109
109
  try {
110
- const p = await fetch(v, {
110
+ const y = await fetch(_, {
111
111
  method: "POST",
112
- body: s
112
+ body: u
113
113
  });
114
- if (console.log(p, "upload response"), !p.ok)
115
- throw new Error(`分片 ${l + 1} 上传失败,HTTP状态码: ${p.status}`);
116
- const $ = await p.json();
117
- if (console.log($, "upload result"), $.recode !== 0)
118
- throw new Error(`上传失败: ${$.remsg || "未知错误"}`);
114
+ if (console.log(y, "upload response"), !y.ok)
115
+ throw new Error(`分片 ${o + 1} 上传失败,HTTP状态码: ${y.status}`);
116
+ const U = await y.json();
117
+ if (console.log(U, "upload result"), U.recode !== 0)
118
+ throw new Error(`上传失败: ${U.remsg || "未知错误"}`);
119
119
  return !0;
120
- } catch (p) {
121
- throw console.error(`上传分片 ${l + 1} 时出错:`, p), p;
120
+ } catch (y) {
121
+ throw console.error(`上传分片 ${o + 1} 时出错:`, y), y;
122
122
  }
123
123
  }
124
- async function _e(t, l = "/api/upload/merge") {
124
+ async function be(l, o = "/api/upload/merge") {
125
125
  try {
126
- if (!(await fetch(l, {
126
+ if (!(await fetch(o, {
127
127
  method: "POST",
128
128
  headers: {
129
129
  "Content-Type": "application/json"
130
130
  },
131
- body: JSON.stringify(t)
131
+ body: JSON.stringify(l)
132
132
  })).ok)
133
133
  throw new Error("文件合并失败");
134
134
  return !0;
135
- } catch (a) {
136
- return console.error("合并分片时出错:", a), !1;
135
+ } catch (n) {
136
+ return console.error("合并分片时出错:", n), !1;
137
137
  }
138
138
  }
139
- async function fe(t) {
140
- const { token: l, file: a, fileDesc: r = "", uploadUrl: c = "/api/upload/chunk", mergeUrl: v = "/api/upload/merge", onProgress: n, onSuccess: m, onError: E } = t;
139
+ async function we(l) {
140
+ const { token: o, file: n, fileDesc: a = "", uploadUrl: m = "/api/upload/chunk", mergeUrl: _ = "/api/upload/merge", onProgress: r, onSuccess: v, onError: k } = l;
141
141
  try {
142
- n == null || n({
142
+ r == null || r({
143
143
  progress: 0,
144
144
  statusText: "正在计算文件MD5...",
145
145
  status: "preparing"
146
146
  });
147
- const s = await ce(a, (S) => {
148
- n == null || n({
147
+ const u = await ge(n, (S) => {
148
+ r == null || r({
149
149
  progress: Math.floor(S * 0.1),
150
150
  // MD5计算占10%进度
151
151
  statusText: `正在计算文件MD5... ${S}%`,
152
152
  status: "preparing"
153
153
  });
154
154
  });
155
- n == null || n({
155
+ r == null || r({
156
156
  progress: 10,
157
157
  statusText: "MD5计算完成",
158
158
  status: "preparing",
159
- fileMd5: s
159
+ fileMd5: u
160
160
  });
161
- const p = Math.ceil(a.size / P);
162
- n == null || n({
161
+ const y = Math.ceil(n.size / V);
162
+ r == null || r({
163
163
  progress: 10,
164
- statusText: `开始上传 (共${p}个分片)`,
164
+ statusText: `开始上传 (共${y}个分片)`,
165
165
  status: "uploading",
166
- fileMd5: s
166
+ fileMd5: u
167
167
  });
168
- for (let S = 0; S < p; S++) {
169
- const U = Math.floor(S / p * 80);
170
- n == null || n({
171
- progress: 10 + U,
172
- statusText: `正在上传分片 ${S + 1}/${p}`,
168
+ for (let S = 0; S < y; S++) {
169
+ const I = Math.floor(S / y * 80);
170
+ r == null || r({
171
+ progress: 10 + I,
172
+ statusText: `正在上传分片 ${S + 1}/${y}`,
173
173
  status: "uploading",
174
- fileMd5: s
175
- }), await me(a, S, p, s, l, c);
174
+ fileMd5: u
175
+ }), await he(n, S, y, u, o, m);
176
176
  }
177
- n == null || n({
177
+ r == null || r({
178
178
  progress: 90,
179
179
  statusText: "正在合并文件...",
180
180
  status: "merging",
181
- fileMd5: s
181
+ fileMd5: u
182
182
  });
183
- const $ = a.name.substring(a.name.lastIndexOf(".") + 1), M = {
184
- fileDesc: r,
185
- fileExt: $,
186
- fileMd5: s,
187
- fileName: a.name,
188
- fileSize: String(a.size),
189
- tds_token: l,
190
- totalChunkNum: String(p)
183
+ const U = n.name.substring(n.name.lastIndexOf(".") + 1), M = {
184
+ fileDesc: a,
185
+ fileExt: U,
186
+ fileMd5: u,
187
+ fileName: n.name,
188
+ fileSize: String(n.size),
189
+ tds_token: o,
190
+ totalChunkNum: String(y)
191
191
  };
192
- if (!await _e(M, v))
192
+ if (!await be(M, _))
193
193
  throw new Error("文件合并失败");
194
- n == null || n({
194
+ r == null || r({
195
195
  progress: 100,
196
196
  statusText: "上传成功",
197
197
  status: "success",
198
- fileMd5: s
199
- }), X.success(`${a.name} 上传成功`), m == null || m(s);
200
- } catch (b) {
201
- n == null || n({
198
+ fileMd5: u
199
+ }), ee.success(`${n.name} 上传成功`), v == null || v(u);
200
+ } catch (g) {
201
+ r == null || r({
202
202
  progress: 0,
203
- statusText: b.message || "上传失败",
203
+ statusText: g.message || "上传失败",
204
204
  status: "error"
205
- }), X.error(`${a.name} 上传失败: ${b.message}`), E == null || E(b);
205
+ }), ee.error(`${n.name} 上传失败: ${g.message}`), k == null || k(g);
206
206
  }
207
207
  }
208
- function ye(t) {
209
- if (t === 0)
208
+ function xe(l) {
209
+ if (l === 0)
210
210
  return "0 B";
211
- const l = 1024, a = ["B", "KB", "MB", "GB", "TB"], r = Math.floor(Math.log(t) / Math.log(l));
212
- return Math.round(t / Math.pow(l, r) * 100) / 100 + " " + a[r];
211
+ const o = 1024, n = ["B", "KB", "MB", "GB", "TB"], a = Math.floor(Math.log(l) / Math.log(o));
212
+ return Math.round(l / Math.pow(o, a) * 100) / 100 + " " + n[a];
213
213
  }
214
- const L = {
214
+ const $ = {
215
215
  get deployURL() {
216
216
  return window.$probeURL || "";
217
+ },
218
+ get dockerURL() {
219
+ return window.$dockerURL || "";
217
220
  }
218
- }, le = (t = {}) => window.$http.request({
219
- url: `${L.deployURL}/service_deploy/deployment/deploy`,
221
+ }, ae = (l = {}) => window.$http.request({
222
+ url: `${$.deployURL}/service_deploy/deployment/deploy`,
223
+ method: "post",
224
+ data: l
225
+ }), ke = (l = {}) => window.$http.request({
226
+ url: `${$.deployURL}/service_deploy/deployment/servers/add`,
220
227
  method: "post",
221
- data: t
222
- }), ve = (t = {}) => window.$http.request({
223
- url: `${L.deployURL}/service_deploy/deployment/servers/add`,
228
+ data: l
229
+ }), Te = (l = {}) => window.$http.request({
230
+ url: `${$.deployURL}/service_deploy/deployment/servers/update`,
224
231
  method: "post",
225
- data: t
226
- }), oe = (t = {}) => window.$http.request({
227
- url: `${L.deployURL}/service_deploy/deployment/packages/get`,
232
+ data: l
233
+ }), se = (l = {}) => window.$http.request({
234
+ url: `${$.deployURL}/service_deploy/deployment/packages/get`,
228
235
  method: "post",
229
- data: t,
236
+ data: l,
230
237
  isError: !1
231
- }), ne = (t = {}) => window.$http.request({
232
- url: `${L.deployURL}/service_deploy/deployment/servers/get`,
238
+ }), ie = (l = {}) => window.$http.request({
239
+ url: `${$.deployURL}/service_deploy/deployment/servers/get`,
233
240
  method: "post",
234
- data: t,
241
+ data: l,
235
242
  isError: !1
236
- }), ge = (t = {}) => window.$http.request({
237
- url: `${L.deployURL}/service_deploy/deployment/servers/del`,
243
+ }), $e = (l = {}) => window.$http.request({
244
+ url: `${$.deployURL}/service_deploy/deployment/servers/del`,
238
245
  method: "post",
239
- data: t
240
- }), he = (t = {}) => window.$http.request({
241
- url: `${L.deployURL}/service_deploy/deployment/packages/del`,
246
+ data: l
247
+ }), Le = (l = {}) => window.$http.request({
248
+ url: `${$.deployURL}/service_deploy/deployment/packages/del`,
242
249
  method: "post",
243
- data: t
244
- }), be = (t = {}) => window.$http.request({
245
- url: `${L.deployURL}/service_deploy/deployment/servers/get_arch`,
250
+ data: l
251
+ }), Ee = (l = {}) => window.$http.request({
252
+ url: `${$.deployURL}/service_deploy/deployment/servers/get_arch`,
246
253
  method: "post",
247
- data: t,
254
+ data: l,
248
255
  isError: !1
249
- }), we = (t = {}) => window.$http.request({
250
- url: `${L.deployURL}/service_deploy/deployment/deployment_history/get`,
256
+ }), Ue = (l = {}) => window.$http.request({
257
+ url: `${$.deployURL}/service_deploy/deployment/deployment_history/get`,
251
258
  method: "post",
252
- data: t,
259
+ data: l,
253
260
  isError: !1
254
- }), xe = (t = {}) => window.$http.request({
255
- url: `${L.deployURL}/service_deploy/deployment/servers/test_ssh`,
261
+ }), Se = (l = {}) => window.$http.request({
262
+ url: `${$.deployURL}/service_deploy/deployment/servers/test_ssh`,
263
+ method: "post",
264
+ data: l
265
+ }), Ce = (l = {}) => window.$http.request({
266
+ url: `${$.deployURL}/service_deploy/deployment/servers/check_env`,
267
+ method: "post",
268
+ data: l
269
+ }), qe = (l = {}) => window.$http.request({
270
+ url: `${$.deployURL}/service_deploy/deployment/servers/install_env`,
256
271
  method: "post",
257
- data: t
258
- }), ke = (t = {}) => window.$http.request({
259
- url: `${L.deployURL}/service_deploy/deployment/servers/check_env`,
272
+ data: l
273
+ }), ue = (l = {}) => window.$http.request({
274
+ url: `${$.deployURL}/service_deploy/deployment/deploy/del`,
260
275
  method: "post",
261
- data: t
262
- }), Te = (t = {}) => window.$http.request({
263
- url: `${L.deployURL}/service_deploy/deployment/servers/install_env`,
276
+ data: l
277
+ }), Me = (l = {}) => window.$http.request({
278
+ url: `${$.dockerURL}/api/auth`,
264
279
  method: "post",
265
- data: t
266
- }), $e = {
280
+ data: l,
281
+ isError: !1
282
+ }), Ae = (l = {}) => window.$http.request({
283
+ url: `${$.dockerURL}/api/endpoints`,
284
+ method: "post",
285
+ data: l.data,
286
+ headers: l.headers
287
+ }), De = {
267
288
  class: "h-100%"
268
- }, Ee = {
289
+ }, Re = {
269
290
  key: 0,
270
291
  class: "upload-progress-list"
271
- }, Se = {
292
+ }, Fe = {
272
293
  class: "file-info"
273
- }, Ue = {
294
+ }, ze = {
274
295
  class: "file-name"
275
- }, Le = {
296
+ }, Ne = {
276
297
  class: "file-size"
277
- }, Me = {
298
+ }, Be = {
278
299
  class: "progress-text"
279
- }, Ce = {
300
+ }, Ie = {
280
301
  class: "table-box h-[calc(100%-220px)]",
281
302
  style: {
282
303
  height: "calc(100% - 220px)"
283
304
  }
284
- }, qe = {
305
+ }, Pe = {
285
306
  key: 0
286
- }, Ae = {
307
+ }, Ve = {
287
308
  class: "flex flex-wrap gap-12px p-12px"
288
- }, Fe = {
289
- class: "font-bold text-14px mb-8px text-[var(--el-text-color-primary)]"
290
- }, Be = {
309
+ }, Oe = {
310
+ class: "font-bold text-14px mb-8px text-[var(--el-text-color-primary)] pr-12"
311
+ }, je = {
291
312
  class: "text-12px text-[var(--el-text-color-regular)] space-y-4px"
292
- }, De = {
313
+ }, Ke = {
314
+ class: "flex items-center"
315
+ }, He = {
316
+ class: "flex items-center"
317
+ }, We = {
318
+ class: "absolute inset-0 bg-black/60 backdrop-blur-[2px] flex flex-col items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-300 z-10"
319
+ }, Ge = {
293
320
  key: 1,
294
321
  class: "font-bold text-center text-gray-500 py-20"
295
- }, Ne = /* @__PURE__ */ K({
322
+ }, Je = /* @__PURE__ */ W({
296
323
  __name: "index",
297
324
  props: {
298
325
  token: {
@@ -300,75 +327,83 @@ const L = {
300
327
  default: ""
301
328
  }
302
329
  },
303
- setup(t) {
304
- const l = w(), a = w(), r = w("快速部署"), c = w({}), {
305
- $t: v,
306
- $messageBox: n
307
- } = window, m = t;
308
- function E(u) {
309
- c.value = {
310
- id: u.id
311
- }, a.value.open();
330
+ setup(l) {
331
+ const o = w(), n = w(), a = w("快速部署"), m = w({}), {
332
+ $t: _,
333
+ $messageBox: r
334
+ } = window, v = l;
335
+ function k(s) {
336
+ m.value = {
337
+ id: s.id
338
+ }, n.value.open();
312
339
  }
313
- const b = w([{
340
+ const g = w([{
314
341
  ip: "",
315
342
  port: ""
316
- }]), s = w([{
343
+ }]), u = w([{
317
344
  ip: "",
318
345
  port: ""
319
- }]), p = w([{
346
+ }]), y = w([{
320
347
  ip: "",
321
348
  port: ""
322
- }]), $ = w([{
349
+ }]), U = w([{
323
350
  ip: "",
324
351
  port: ""
325
352
  }]);
326
- async function M(u) {
327
- const g = (o, i) => {
328
- const _ = Math.max(o.length, i.length);
353
+ async function M(s) {
354
+ const f = (A, e) => {
355
+ const i = Math.max(A.length, e.length);
329
356
  return Array.from({
330
- length: _
331
- }, (h, k) => {
332
- var D, N, z, R;
357
+ length: i
358
+ }, (B, L) => {
359
+ var d, T, j, D;
333
360
  return {
334
- src_ip: ((D = o[k]) == null ? void 0 : D.ip) || "",
335
- src_port: Number((N = o[k]) == null ? void 0 : N.port) || 0,
336
- dst_ip: ((z = i[k]) == null ? void 0 : z.ip) || "",
337
- dst_port: Number((R = i[k]) == null ? void 0 : R.port) || 0
361
+ src_ip: ((d = A[L]) == null ? void 0 : d.ip) || "",
362
+ src_port: Number((T = A[L]) == null ? void 0 : T.port) || 0,
363
+ dst_ip: ((j = e[L]) == null ? void 0 : j.ip) || "",
364
+ dst_port: Number((D = e[L]) == null ? void 0 : D.port) || 0
338
365
  };
339
366
  });
340
- }, A = {
341
- packages_id: [c.value.id],
342
- server_id: u.server_id,
367
+ }, N = {
368
+ packages_id: [m.value.id],
369
+ server_id: s.server_id,
343
370
  service_type: window.$prodType,
344
371
  deploy_params: {
345
- probe_name: u.probe_name || "",
346
- collection_mode: u.collection_mode,
347
- interface: u.interface || "",
348
- engine_ip: u.engine_ip || "",
349
- engine_port: u.engine_port || "",
350
- filterWhitelist: g(b.value, s.value),
351
- filterBlacklist: g(p.value, $.value)
372
+ probe_name: s.probe_name || "",
373
+ collection_mode: s.collection_mode,
374
+ interface: s.interface || "",
375
+ engine_ip: s.engine_ip || "",
376
+ engine_port: s.engine_port || "",
377
+ filterWhitelist: f(g.value, u.value),
378
+ filterBlacklist: f(y.value, U.value)
352
379
  }
353
380
  };
354
- await le({
355
- data: A
356
- }), l.value.getTableList(), a.value.close();
381
+ await ae({
382
+ data: N
383
+ }), o.value.getTableList(), n.value.close();
384
+ }
385
+ async function O(s) {
386
+ r(s, "file_name", _("button.delete"), "error").then(async () => {
387
+ const f = s.map((N) => N.id);
388
+ await Le({
389
+ data: f
390
+ }), o.value.getTableList();
391
+ });
357
392
  }
358
- async function I(u) {
359
- n(u, "file_name", v("button.delete"), "error").then(async () => {
360
- const g = u.map((A) => A.id);
361
- await he({
362
- data: g
363
- }), l.value.getTableList();
393
+ async function S(s) {
394
+ r([s], "server_name", _("button.delete"), "error").then(async () => {
395
+ await ue({
396
+ deploy_id: [s.id],
397
+ service_type: window.$prodType
398
+ }), o.value.getTableList();
364
399
  });
365
400
  }
366
- const S = H([
401
+ const I = H([
367
402
  // { type: 'selection', align: 'center', field: 'id', hide: true },
368
403
  {
369
404
  field: "server_id",
370
405
  name: "选择服务器",
371
- enum: () => ne({
406
+ enum: () => ie({
372
407
  service_type: window.$prodType
373
408
  }),
374
409
  fieldNames: {
@@ -406,9 +441,9 @@ const L = {
406
441
  {
407
442
  field: "deployment_server",
408
443
  name: "已部署服务器数",
409
- render: (u) => {
410
- var g;
411
- return ((g = u.row.deployment_server) == null ? void 0 : g.length) || 0;
444
+ render: (s) => {
445
+ var f;
446
+ return ((f = s.row.deployment_server) == null ? void 0 : f.length) || 0;
412
447
  }
413
448
  },
414
449
  {
@@ -470,14 +505,19 @@ const L = {
470
505
  show: {
471
506
  type: "input"
472
507
  },
473
- hide: !0
508
+ hide: !0,
509
+ rules: [{
510
+ required: !0,
511
+ type: "any"
512
+ }]
474
513
  },
475
514
  {
476
515
  field: "engine_port",
477
516
  name: "流量接收引擎端口",
478
517
  show: {
479
518
  type: "input",
480
- dataType: "number"
519
+ dataType: "number",
520
+ value: 6379
481
521
  },
482
522
  hide: !0,
483
523
  rules: [{
@@ -491,20 +531,20 @@ const L = {
491
531
  show: {
492
532
  type: "input",
493
533
  tooltip: "白名单配置后,仅采集白名单内相关流量,如不填写,则采集所有流量",
494
- render: () => e(B, null, [e("div", {
534
+ render: () => t(z, null, [t("div", {
495
535
  style: "width: 100%"
496
- }, [e("p", {
536
+ }, [t("p", {
497
537
  class: "color-[var(--el-text-color-regular)]"
498
- }, [F("源ip端口:")]), e(V, {
499
- modelValue: b.value,
500
- "onUpdate:modelValue": (u) => b.value = u
501
- }, null)]), e("div", {
538
+ }, [E("源ip端口:")]), t(P, {
539
+ modelValue: g.value,
540
+ "onUpdate:modelValue": (s) => g.value = s
541
+ }, null)]), t("div", {
502
542
  style: "width: 100%"
503
- }, [e("p", {
543
+ }, [t("p", {
504
544
  class: "color-[var(--el-text-color-regular)]"
505
- }, [F("目的ip端口:")]), e(V, {
506
- modelValue: s.value,
507
- "onUpdate:modelValue": (u) => s.value = u
545
+ }, [E("目的ip端口:")]), t(P, {
546
+ modelValue: u.value,
547
+ "onUpdate:modelValue": (s) => u.value = s
508
548
  }, null)])])
509
549
  },
510
550
  hide: !0
@@ -515,16 +555,16 @@ const L = {
515
555
  show: {
516
556
  type: "input",
517
557
  tooltip: "黑名单配置后,将不再采集黑名单内相关流量",
518
- render: () => e(B, null, [e("p", {
558
+ render: () => t(z, null, [t("p", {
519
559
  class: "color-[var(--el-text-color-regular)]"
520
- }, [F("源ip端口:")]), e(V, {
521
- modelValue: p.value,
522
- "onUpdate:modelValue": (u) => p.value = u
523
- }, null), e("p", {
560
+ }, [E("源ip端口:")]), t(P, {
561
+ modelValue: y.value,
562
+ "onUpdate:modelValue": (s) => y.value = s
563
+ }, null), t("p", {
524
564
  class: "color-[var(--el-text-color-regular)]"
525
- }, [F("目的ip端口:")]), e(V, {
526
- modelValue: $.value,
527
- "onUpdate:modelValue": (u) => $.value = u
565
+ }, [E("目的ip端口:")]), t(P, {
566
+ modelValue: U.value,
567
+ "onUpdate:modelValue": (s) => U.value = s
528
568
  }, null)])
529
569
  },
530
570
  hide: !0
@@ -534,230 +574,292 @@ const L = {
534
574
  name: window.$t("global.operate"),
535
575
  width: 140,
536
576
  fixed: "right",
537
- render: (u) => e("div", null, [e(d("el-button"), {
577
+ render: (s) => t("div", null, [t(c("el-button"), {
538
578
  link: !0,
539
579
  type: "primary",
540
580
  class: "custom-btn",
541
- onClick: () => E(u.row)
581
+ onClick: () => k(s.row)
542
582
  }, {
543
- icon: () => e(d("tds-svg-icon"), {
583
+ icon: () => t(c("tds-svg-icon"), {
544
584
  name: "deployed",
545
585
  tip: "部署"
546
586
  }, null)
547
- }), e(d("el-button"), {
587
+ }), t(c("el-button"), {
548
588
  link: !0,
549
589
  type: "danger",
550
590
  icon: "Delete",
551
- title: v("button.delete"),
552
- onClick: () => I([u.row])
591
+ title: _("button.delete"),
592
+ onClick: () => O([s.row])
553
593
  }, null)])
554
594
  }
555
- ]), U = w([]);
556
- function j(u) {
557
- const g = u.raw;
558
- if (!g)
595
+ ]), R = w([]);
596
+ function J(s) {
597
+ const f = s.raw;
598
+ if (!f)
559
599
  return;
560
- const A = {
561
- fileName: g.name,
562
- fileSize: g.size,
600
+ const N = {
601
+ fileName: f.name,
602
+ fileSize: f.size,
563
603
  progress: 0,
564
604
  progressStatus: "",
565
605
  statusText: "准备上传..."
566
606
  };
567
- U.value.push(A);
568
- const o = U.value.length - 1;
569
- fe({
570
- file: g,
607
+ R.value.push(N);
608
+ const A = R.value.length - 1;
609
+ we({
610
+ file: f,
571
611
  fileDesc: "探针安装包",
572
612
  // 替换为你实际的接口地址
573
- uploadUrl: L.deployURL + "/service_deploy/deployment/packages/upload",
574
- mergeUrl: L.deployURL + "/service_deploy/deployment/packages/upload_merge",
575
- token: m.token,
613
+ uploadUrl: $.deployURL + "/service_deploy/deployment/packages/upload",
614
+ mergeUrl: $.deployURL + "/service_deploy/deployment/packages/upload_merge",
615
+ token: v.token,
576
616
  // 进度回调
577
- onProgress: (i) => {
578
- const _ = U.value[o];
579
- _ && (_.progress = i.progress, _.statusText = i.statusText, i.fileMd5 && (_.fileMd5 = i.fileMd5), i.status === "error" ? _.progressStatus = "exception" : i.status === "success" ? _.progressStatus = "success" : _.progressStatus = "");
617
+ onProgress: (e) => {
618
+ const i = R.value[A];
619
+ i && (i.progress = e.progress, i.statusText = e.statusText, e.fileMd5 && (i.fileMd5 = e.fileMd5), e.status === "error" ? i.progressStatus = "exception" : e.status === "success" ? i.progressStatus = "success" : i.progressStatus = "");
580
620
  },
581
621
  // 成功回调
582
622
  onSuccess: () => {
583
- var _;
584
- const i = U.value[o];
585
- i && (i.progress = 100, i.progressStatus = "success", i.statusText = "上传成功"), (_ = l.value) == null || _.getTableList(), setTimeout(() => {
586
- const h = U.value.findIndex((k) => k.fileName === g.name);
587
- h !== -1 && U.value.splice(h, 1);
623
+ var i;
624
+ const e = R.value[A];
625
+ e && (e.progress = 100, e.progressStatus = "success", e.statusText = "上传成功"), (i = o.value) == null || i.getTableList(), setTimeout(() => {
626
+ const B = R.value.findIndex((L) => L.fileName === f.name);
627
+ B !== -1 && R.value.splice(B, 1);
588
628
  }, 3e3);
589
629
  },
590
630
  // 失败回调
591
- onError: (i) => {
592
- console.error("文件上传失败:", i);
593
- const _ = U.value[o];
594
- _ && (_.progressStatus = "exception", _.statusText = i.message || "上传失败");
631
+ onError: (e) => {
632
+ console.error("文件上传失败:", e);
633
+ const i = R.value[A];
634
+ i && (i.progressStatus = "exception", i.statusText = e.message || "上传失败");
595
635
  }
596
636
  });
597
637
  }
598
- return (u, g) => {
599
- const A = d("el-icon"), o = d("el-upload"), i = d("el-progress"), _ = d("el-table-column");
600
- return y(), x("div", $e, [e(o, {
638
+ return (s, f) => {
639
+ const N = c("el-icon"), A = c("el-upload"), e = c("el-progress"), i = c("Delete"), B = c("el-button"), L = c("el-table-column");
640
+ return h(), x("div", De, [t(A, {
601
641
  class: "upload-demo mt-10px",
602
642
  drag: "",
603
643
  action: "",
604
644
  "auto-upload": !1,
605
645
  accept: ".tar.gz,.zip",
606
- "on-change": j,
646
+ "on-change": J,
607
647
  "show-file-list": !1,
608
648
  multiple: ""
609
649
  }, {
610
- default: T(() => [e(A, {
650
+ default: b(() => [t(N, {
611
651
  class: "el-icon--upload"
612
652
  }, {
613
- default: T(() => [e(q(se))]),
653
+ default: b(() => [t(F(me))]),
614
654
  _: 1
615
- }), g[0] || (g[0] = f("div", {
655
+ }), f[0] || (f[0] = p("div", {
616
656
  class: "el-upload__text"
617
- }, [F(" 点击或拖拽文件到此处上传  "), f("br"), f("em", null, "支持的格式: tar.gz, zip")], -1))]),
657
+ }, [E(" 点击或拖拽文件到此处上传  "), p("br"), p("em", null, "支持的格式: tar.gz, zip")], -1))]),
618
658
  _: 1
619
- }), U.value.length > 0 ? (y(), x("div", Ee, [(y(!0), x(B, null, W(U.value, (h) => (y(), x("div", {
620
- key: h.fileName,
659
+ }), R.value.length > 0 ? (h(), x("div", Re, [(h(!0), x(z, null, G(R.value, (d) => (h(), x("div", {
660
+ key: d.fileName,
621
661
  class: "upload-progress-item"
622
- }, [f("div", Se, [f("span", Ue, C(h.fileName), 1), f("span", Le, C(q(ye)(h.fileSize)), 1)]), e(i, {
623
- percentage: h.progress,
624
- status: h.progressStatus
625
- }, null, 8, ["percentage", "status"]), f("div", Me, C(h.statusText), 1)]))), 128))])) : O("", !0), f("div", Ce, [e(q(ue), {
662
+ }, [p("div", Fe, [p("span", ze, q(d.fileName), 1), p("span", Ne, q(F(xe)(d.fileSize)), 1)]), t(e, {
663
+ percentage: d.progress,
664
+ status: d.progressStatus
665
+ }, null, 8, ["percentage", "status"]), p("div", Be, q(d.statusText), 1)]))), 128))])) : K("", !0), p("div", Ie, [t(F(_e), {
626
666
  ref_key: "refTdsTable",
627
- ref: l,
628
- columns: S,
629
- "request-api": q(oe),
630
- options: u.$tableOptions()
667
+ ref: o,
668
+ columns: I,
669
+ "request-api": F(se),
670
+ options: s.$tableOptions()
631
671
  }, {
632
- default: T(() => [e(_, {
672
+ default: b(() => [t(L, {
633
673
  type: "expand"
634
674
  }, {
635
- default: T((h) => [h.row.deployment_server && h.row.deployment_server.length > 0 ? (y(), x("div", qe, [g[1] || (g[1] = f("div", {
675
+ default: b((d) => [d.row.deployment_server && d.row.deployment_server.length > 0 ? (h(), x("div", Pe, [f[4] || (f[4] = p("div", {
636
676
  class: "font-bold text-14px mt-12px"
637
- }, "已部署的服务器", -1)), f("div", Ae, [(y(!0), x(B, null, W(h.row.deployment_server, (k) => (y(), x("div", {
638
- key: k.id,
639
- class: "w-30% px-20px py-10px rounded-8px bg-[var(--el-fill-color-light)] border border-solid border-[var(--el-border-color-lighter)] hover:shadow-md transition-shadow"
640
- }, [f("div", Fe, C(k.server_name), 1), f("div", Be, [f("p", null, "IP: " + C(k.ip_address), 1), f("p", null, "部署时间: " + C(k.deployment_time), 1)])]))), 128))])])) : (y(), x("div", De, "暂无部署服务器记录"))]),
677
+ }, "已部署的服务器", -1)), p("div", Ve, [(h(!0), x(z, null, G(d.row.deployment_server, (T) => (h(), x("div", {
678
+ key: T.id,
679
+ class: "group w-25% px-20px py-10px rounded-8px bg-[var(--el-fill-color-light)] border border-solid border-[var(--el-border-color-lighter)] hover:shadow-lg transition-all duration-300 relative overflow-hidden"
680
+ }, [p("div", {
681
+ class: te(["absolute top-0 right-0 px-2 py-1 text-12px font-medium border-b border-l rounded-bl-8px", {
682
+ "text-green-600 bg-green-50 border-green-200": T.deploy_type === 0,
683
+ "text-amber-600 bg-amber-50 border-amber-200": T.deploy_type === 1,
684
+ "text-red-600 bg-red-50 border-red-200": T.deploy_type === 2
685
+ }])
686
+ }, q(T.deploy_type === 0 ? "安装" : T.deploy_type === 1 ? "升级" : "卸载"), 3), p("div", Oe, q(T.server_name), 1), p("div", je, [p("p", Ke, [f[1] || (f[1] = p("span", {
687
+ class: "opacity-70 mr-2"
688
+ }, "IP:", -1)), E(" " + q(T.ip_address), 1)]), p("p", He, [f[2] || (f[2] = p("span", {
689
+ class: "opacity-70 mr-2"
690
+ }, "时间:", -1)), E(" " + q(T.deployment_time), 1)])]), p("div", We, [t(B, {
691
+ type: "danger",
692
+ circle: "",
693
+ class: "mb-2 transform scale-90 group-hover:scale-100 transition-transform duration-300",
694
+ onClick: le((j) => S(T), ["stop"])
695
+ }, {
696
+ default: b(() => [t(N, {
697
+ size: "20"
698
+ }, {
699
+ default: b(() => [t(i)]),
700
+ _: 1
701
+ })]),
702
+ _: 1
703
+ }, 8, ["onClick"]), f[3] || (f[3] = p("span", {
704
+ class: "text-white text-12px font-medium tracking-wide"
705
+ }, "卸载", -1))])]))), 128))])])) : (h(), x("div", Ge, "暂无部署服务器记录"))]),
641
706
  _: 1
642
707
  })]),
643
708
  _: 1
644
- }, 8, ["columns", "request-api", "options"])]), e(q(ee), Y({
709
+ }, 8, ["columns", "request-api", "options"])]), t(F(re), oe({
645
710
  ref_key: "refTdsForm",
646
- ref: a
647
- }, u.$formBindProps({
648
- title: r.value,
649
- form: c.value,
650
- columns: S
711
+ ref: n
712
+ }, s.$formBindProps({
713
+ title: a.value,
714
+ form: m.value,
715
+ columns: I
651
716
  }), {
652
717
  onSubmit: M
653
718
  }), null, 16)]);
654
719
  };
655
720
  }
656
- }), Ve = {
721
+ }), Ze = {
657
722
  class: "table-box"
658
- }, ze = {
723
+ }, Qe = {
659
724
  class: "flex items-center"
660
- }, Pe = {
725
+ }, Xe = {
661
726
  key: 0
662
- }, Ie = {
727
+ }, Ye = {
663
728
  class: "flex flex-wrap gap-12px p-12px"
664
- }, Re = {
665
- class: "font-bold text-14px mb-8px text-[var(--el-text-color-primary)]"
666
- }, Oe = {
729
+ }, et = {
730
+ class: "font-bold text-14px mb-8px text-[var(--el-text-color-primary)] pr-12"
731
+ }, tt = {
667
732
  class: "text-12px text-[var(--el-text-color-regular)] space-y-4px"
668
- }, He = {
733
+ }, lt = {
734
+ class: "flex items-center"
735
+ }, ot = {
736
+ class: "flex items-center"
737
+ }, rt = {
738
+ class: "absolute inset-0 bg-black/60 backdrop-blur-[2px] flex flex-col items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-300 z-10"
739
+ }, nt = {
669
740
  key: 1,
670
741
  class: "font-bold text-center text-gray-500 py-20"
671
- }, Ke = /* @__PURE__ */ K({
742
+ }, at = /* @__PURE__ */ W({
672
743
  __name: "index",
673
- setup(t) {
744
+ setup(l) {
674
745
  const {
675
- $t: l,
676
- $messageBox: a
677
- } = window, r = w(), c = w(), v = w(""), n = w({}), m = w("show"), E = H({
746
+ $t: o,
747
+ $messageBox: n
748
+ } = window, a = w(), m = w(), _ = w(""), r = w({}), v = w("show"), k = H({
678
749
  service_type: window.$prodType
679
750
  });
680
- function b() {
681
- n.value = {}, m.value = "show", v.value = "添加服务器", c.value.open();
751
+ function g(e) {
752
+ r.value = e ? Object.assign({}, e) : {}, v.value = "show", _.value = e ? "修改服务器" : "添加服务器", m.value.open();
682
753
  }
683
- const s = (o) => {
684
- a(o, "server_name", l("button.delete"), "error").then(async () => {
685
- await ge({
686
- data: o.map((i) => i.id),
754
+ const u = (e) => {
755
+ n(e, "server_name", o("button.delete"), "error").then(async () => {
756
+ await $e({
757
+ data: e.map((i) => i.id),
687
758
  service_type: window.$prodType
688
- }), r.value.getTableList();
759
+ }), a.value.getTableList();
689
760
  });
690
761
  };
691
- function p(o) {
692
- n.value = {
693
- id: o.id
694
- }, m.value = "deploy", v.value = "快速部署", c.value.open();
762
+ function y(e) {
763
+ r.value = {
764
+ id: e.id
765
+ }, v.value = "deploy", _.value = "快速部署", m.value.open();
695
766
  }
696
- const $ = w([{
767
+ async function U(e) {
768
+ n([e], "server_name", o("button.delete"), "error").then(async () => {
769
+ await ue({
770
+ deploy_id: [e.id],
771
+ service_type: window.$prodType
772
+ }), a.value.getTableList();
773
+ });
774
+ }
775
+ const M = w([{
697
776
  ip: "",
698
777
  port: ""
699
- }]), M = w([{
778
+ }]), O = w([{
700
779
  ip: "",
701
780
  port: ""
702
- }]), I = w([{
781
+ }]), S = w([{
703
782
  ip: "",
704
783
  port: ""
705
- }]), S = w([{
784
+ }]), I = w([{
706
785
  ip: "",
707
786
  port: ""
708
787
  }]);
709
- async function U(o) {
710
- if (m.value === "show") {
711
- await ve({
712
- data: o
713
- }), r.value.getTableList(), c.value.close();
788
+ async function R(e) {
789
+ if (v.value === "show") {
790
+ r.value.id ? (await Te({
791
+ data: {
792
+ ...e,
793
+ id: r.value.id
794
+ }
795
+ }), a.value.getTableList(), m.value.close()) : (await ke({
796
+ data: e
797
+ }), a.value.getTableList(), m.value.close());
714
798
  return;
715
799
  }
716
- const i = (h, k) => {
717
- const D = Math.max(h.length, k.length);
800
+ if (v.value === "docker") {
801
+ const L = await Me({
802
+ password: "Tds@12345",
803
+ username: "admin"
804
+ }), d = new FormData();
805
+ d.append("Name", e.Name), d.append("EndpointType", "1"), d.append("URL", "tcp://" + e.URL), d.append("PublicURL", e.URL), d.append("GroupID", "1"), d.append("TagIds", "[]"), d.append("TLS", "false"), d.append("TLSSkipVerify", "false"), d.append("TLSSkipClientVerify", "false"), d.append("TLSCACertFile", ""), d.append("TLSCertFile", ""), d.append("TLSKeyFile", ""), await Ae({
806
+ data: d,
807
+ headers: {
808
+ Authorization: `${L.jwt}`
809
+ }
810
+ }), m.value.close();
811
+ return;
812
+ }
813
+ const i = (L, d) => {
814
+ const T = Math.max(L.length, d.length);
718
815
  return Array.from({
719
- length: D
720
- }, (N, z) => {
721
- var R, J, Z, Q;
816
+ length: T
817
+ }, (j, D) => {
818
+ var C, Z, X, Y;
722
819
  return {
723
- src_ip: ((R = h[z]) == null ? void 0 : R.ip) || "",
724
- src_port: Number((J = h[z]) == null ? void 0 : J.port) || 0,
725
- dst_ip: ((Z = k[z]) == null ? void 0 : Z.ip) || "",
726
- dst_port: Number((Q = k[z]) == null ? void 0 : Q.port) || 0
820
+ src_ip: ((C = L[D]) == null ? void 0 : C.ip) || "",
821
+ src_port: Number((Z = L[D]) == null ? void 0 : Z.port) || 0,
822
+ dst_ip: ((X = d[D]) == null ? void 0 : X.ip) || "",
823
+ dst_port: Number((Y = d[D]) == null ? void 0 : Y.port) || 0
727
824
  };
728
825
  });
729
- }, _ = {
730
- packages_id: [o.packages_id],
731
- server_id: [n.value.id],
826
+ }, B = {
827
+ packages_id: [e.packages_id],
828
+ server_id: [r.value.id],
732
829
  service_type: window.$prodType,
733
830
  deploy_params: {
734
- probe_name: o.probe_name || "",
735
- collection_mode: o.collection_mode,
736
- interface: o.interface || "",
737
- engine_ip: o.engine_ip || "",
738
- engine_port: o.engine_port || "",
739
- filterWhitelist: i($.value, M.value),
740
- filterBlacklist: i(I.value, S.value)
831
+ probe_name: e.probe_name || "",
832
+ collection_mode: e.collection_mode,
833
+ interface: e.interface || "",
834
+ engine_ip: e.engine_ip || "",
835
+ engine_port: e.engine_port || "",
836
+ filterWhitelist: i(M.value, O.value),
837
+ filterBlacklist: i(S.value, I.value)
741
838
  }
742
839
  };
743
- await le({
744
- data: _
745
- }), r.value.getTableList(), c.value.close();
840
+ await ae({
841
+ data: B
842
+ }), a.value.getTableList(), m.value.close();
843
+ }
844
+ function J(e) {
845
+ Se({
846
+ data: [e.id]
847
+ }), a.value.getTableList();
746
848
  }
747
- function j(o) {
748
- xe({
749
- data: [o.id]
750
- }), r.value.getTableList();
849
+ function s(e) {
850
+ Ce({
851
+ data: [e.id]
852
+ }), a.value.getTableList();
751
853
  }
752
- function u(o) {
753
- ke({
754
- data: [o.id]
755
- }), r.value.getTableList();
854
+ function f(e) {
855
+ qe({
856
+ data: [e.id]
857
+ }), a.value.getTableList();
756
858
  }
757
- function g(o) {
758
- Te({
759
- data: [o.id]
760
- }), r.value.getTableList();
859
+ function N(e) {
860
+ v.value = "docker", _.value = "添加容器监控", r.value = {
861
+ URL: `${e.ip_address}:${e.ssh_port}`
862
+ }, m.value.open();
761
863
  }
762
864
  const A = H([{
763
865
  field: "server_name",
@@ -791,6 +893,7 @@ const L = {
791
893
  }, {
792
894
  field: "ssh_username",
793
895
  name: "SSH用户",
896
+ hide: !0,
794
897
  show: {
795
898
  type: "input"
796
899
  },
@@ -814,7 +917,8 @@ const L = {
814
917
  }, {
815
918
  field: "arch",
816
919
  name: "架构",
817
- enum: be,
920
+ enum: Ee,
921
+ hide: !0,
818
922
  show: {
819
923
  type: "select"
820
924
  },
@@ -824,7 +928,7 @@ const L = {
824
928
  }, {
825
929
  field: "deployed_count",
826
930
  name: "已部署探针数量",
827
- render: (o) => e("span", null, [o.row.deployment_packages.length])
931
+ render: (e) => t("span", null, [e.row.deployment_packages.length])
828
932
  }, {
829
933
  field: "status",
830
934
  name: "状态",
@@ -843,31 +947,55 @@ const L = {
843
947
  name: "连通性检查",
844
948
  tag: !0,
845
949
  enum: [{
950
+ label: "失败",
951
+ value: 3,
952
+ tagType: "danger"
953
+ }, {
846
954
  label: "成功",
847
- value: 1,
955
+ value: 2,
848
956
  tagType: "success"
849
957
  }, {
850
- label: "失败",
958
+ label: "检测中",
959
+ value: 1,
960
+ tagType: "warning"
961
+ }, {
962
+ label: "未检测",
851
963
  value: 0,
852
- tagType: "danger"
964
+ tagType: "default"
853
965
  }]
966
+ }, {
967
+ field: "check_ssh_msg",
968
+ name: "连通性检查失败原因",
969
+ width: 150
854
970
  }, {
855
971
  field: "check_env_ok",
856
972
  name: "安装环境",
857
973
  tag: !0,
858
974
  enum: [{
859
- label: "具备",
860
- value: 1,
975
+ label: "失败",
976
+ value: 3,
977
+ tagType: "danger"
978
+ }, {
979
+ label: "成功",
980
+ value: 2,
861
981
  tagType: "success"
862
982
  }, {
863
- label: "不具备",
983
+ label: "检测中",
984
+ value: 1,
985
+ tagType: "warning"
986
+ }, {
987
+ label: "未检测",
864
988
  value: 0,
865
- tagType: "danger"
989
+ tagType: "default"
866
990
  }]
991
+ }, {
992
+ field: "check_env_msg",
993
+ name: "环境检查失败原因",
994
+ width: 150
867
995
  }, {
868
996
  field: "packages_id",
869
997
  name: "安装包",
870
- enum: oe,
998
+ enum: se,
871
999
  fieldNames: {
872
1000
  value: "id",
873
1001
  label: "file_name"
@@ -927,7 +1055,8 @@ const L = {
927
1055
  name: "流量接收引擎端口",
928
1056
  deploy: {
929
1057
  type: "input",
930
- dataType: "number"
1058
+ dataType: "number",
1059
+ value: 6379
931
1060
  },
932
1061
  hide: !0,
933
1062
  rules: [{
@@ -940,16 +1069,16 @@ const L = {
940
1069
  deploy: {
941
1070
  type: "input",
942
1071
  tooltip: "白名单配置后,仅采集白名单内相关流量,如不填写,则采集所有流量",
943
- render: () => e(B, null, [e("p", {
1072
+ render: () => t(z, null, [t("p", {
944
1073
  class: "color-[var(--el-text-color-regular)]"
945
- }, [F("源ip端口:")]), e(V, {
946
- modelValue: $.value,
947
- "onUpdate:modelValue": (o) => $.value = o
948
- }, null), e("p", {
949
- class: "color-[var(--el-text-color-regular)]"
950
- }, [F("目的ip端口:")]), e(V, {
1074
+ }, [E("源ip端口:")]), t(P, {
951
1075
  modelValue: M.value,
952
- "onUpdate:modelValue": (o) => M.value = o
1076
+ "onUpdate:modelValue": (e) => M.value = e
1077
+ }, null), t("p", {
1078
+ class: "color-[var(--el-text-color-regular)]"
1079
+ }, [E("目的ip端口:")]), t(P, {
1080
+ modelValue: O.value,
1081
+ "onUpdate:modelValue": (e) => O.value = e
953
1082
  }, null)])
954
1083
  },
955
1084
  hide: !0
@@ -959,143 +1088,208 @@ const L = {
959
1088
  deploy: {
960
1089
  type: "input",
961
1090
  tooltip: "黑名单配置后,将不再采集黑名单内相关流量",
962
- render: () => e(B, null, [e("p", {
1091
+ render: () => t(z, null, [t("p", {
963
1092
  class: "color-[var(--el-text-color-regular)]"
964
- }, [F("源ip端口:")]), e(V, {
965
- modelValue: I.value,
966
- "onUpdate:modelValue": (o) => I.value = o
967
- }, null), e("p", {
968
- class: "color-[var(--el-text-color-regular)]"
969
- }, [F("目的ip端口:")]), e(V, {
1093
+ }, [E("源ip端口:")]), t(P, {
970
1094
  modelValue: S.value,
971
- "onUpdate:modelValue": (o) => S.value = o
1095
+ "onUpdate:modelValue": (e) => S.value = e
1096
+ }, null), t("p", {
1097
+ class: "color-[var(--el-text-color-regular)]"
1098
+ }, [E("目的ip端口:")]), t(P, {
1099
+ modelValue: I.value,
1100
+ "onUpdate:modelValue": (e) => I.value = e
972
1101
  }, null)])
973
1102
  },
974
1103
  hide: !0
1104
+ }, {
1105
+ field: "Name",
1106
+ name: "名称",
1107
+ hide: !0,
1108
+ docker: {
1109
+ type: "input"
1110
+ },
1111
+ rules: [{
1112
+ required: !0
1113
+ }]
1114
+ }, {
1115
+ field: "URL",
1116
+ name: "端点 URL ",
1117
+ hide: !0,
1118
+ docker: {
1119
+ type: "input",
1120
+ disabled: !0
1121
+ }
1122
+ }, {
1123
+ field: "status_monitorning",
1124
+ name: "状态监控",
1125
+ render: (e) => t(z, null, [t(c("el-button"), {
1126
+ class: "custom-btn",
1127
+ type: "primary",
1128
+ icon: "Plus",
1129
+ link: !0,
1130
+ onClick: () => N(e.row)
1131
+ }, {
1132
+ default: () => [E("添加")]
1133
+ })])
975
1134
  }, {
976
1135
  field: "operation",
977
1136
  name: window.$t("global.operate"),
978
1137
  width: 180,
979
1138
  fixed: "right",
980
- render: (o) => e("div", null, [e(d("el-button"), {
1139
+ render: (e) => t("div", null, [t(c("el-button"), {
1140
+ link: !0,
1141
+ type: "primary",
1142
+ icon: "Edit",
1143
+ title: "修改",
1144
+ class: "custom-btn",
1145
+ onClick: () => g(e.row)
1146
+ }, null), t(c("el-button"), {
981
1147
  link: !0,
982
1148
  type: "primary",
983
1149
  icon: "Connection",
984
1150
  title: "连通性检查",
985
1151
  class: "custom-btn",
986
- onClick: () => j(o.row)
987
- }, null), e(d("el-button"), {
1152
+ onClick: () => J(e.row)
1153
+ }, null), t(c("el-button"), {
988
1154
  link: !0,
989
1155
  type: "primary",
990
1156
  class: "custom-btn",
991
- onClick: () => u(o.row)
1157
+ onClick: () => s(e.row)
992
1158
  }, {
993
- icon: () => e(d("tds-svg-icon"), {
1159
+ icon: () => t(c("tds-svg-icon"), {
994
1160
  name: "install_env",
995
1161
  tip: "测试安装环境"
996
1162
  }, null)
997
- }), e(d("el-button"), {
1163
+ }), t(c("el-button"), {
998
1164
  link: !0,
999
1165
  type: "primary",
1000
1166
  class: "custom-btn",
1001
- onClick: () => g(o.row)
1167
+ onClick: () => f(e.row)
1002
1168
  }, {
1003
- icon: () => e(d("tds-svg-icon"), {
1169
+ icon: () => t(c("tds-svg-icon"), {
1004
1170
  name: "docker",
1005
1171
  tip: "自动安装docker环境"
1006
1172
  }, null)
1007
- }), e(d("el-button"), {
1173
+ }), t(c("el-button"), {
1008
1174
  link: !0,
1009
1175
  type: "primary",
1010
1176
  class: "custom-btn",
1011
- onClick: () => p(o.row)
1177
+ onClick: () => y(e.row)
1012
1178
  }, {
1013
- icon: () => e(d("tds-svg-icon"), {
1179
+ icon: () => t(c("tds-svg-icon"), {
1014
1180
  name: "deployed",
1015
1181
  tip: "部署"
1016
1182
  }, null)
1017
- }), e(d("el-button"), {
1183
+ }), t(c("el-button"), {
1018
1184
  link: !0,
1019
1185
  type: "danger",
1020
1186
  icon: "Delete",
1021
- title: l("button.delete"),
1022
- onClick: () => s([o.row])
1187
+ title: o("button.delete"),
1188
+ onClick: () => u([e.row])
1023
1189
  }, null)])
1024
1190
  }]);
1025
- return (o, i) => {
1026
- const _ = d("el-button"), h = d("el-table-column"), k = d("TdsTable");
1027
- return y(), x("div", Ve, [e(k, {
1191
+ return (e, i) => {
1192
+ const B = c("el-button"), L = c("Delete"), d = c("el-icon"), T = c("el-table-column"), j = c("TdsTable");
1193
+ return h(), x("div", Ze, [t(j, {
1028
1194
  ref_key: "refTdsTable",
1029
- ref: r,
1195
+ ref: a,
1030
1196
  columns: A,
1031
- "request-api": q(ne),
1197
+ "request-api": F(ie),
1032
1198
  "search-col": 4,
1033
- "init-param": E,
1034
- options: o.$tableOptions(),
1199
+ "init-param": k,
1200
+ options: e.$tableOptions({
1201
+ refresh: {
1202
+ ssh_status: [1],
1203
+ check_env_ok: [1]
1204
+ }
1205
+ }),
1035
1206
  "reserve-selection": ""
1036
1207
  }, {
1037
- tableHeader: T(() => [f("div", ze, [e(_, {
1208
+ tableHeader: b(() => [p("div", Qe, [t(B, {
1038
1209
  class: "custom-btn",
1039
1210
  type: "primary",
1040
1211
  icon: "Plus",
1041
1212
  plain: "",
1042
- onClick: i[0] || (i[0] = (D) => b())
1213
+ onClick: i[0] || (i[0] = (D) => g())
1043
1214
  }, {
1044
- default: T(() => [F(C(q(l)("button.add")), 1)]),
1215
+ default: b(() => [E(q(F(o)("button.add")), 1)]),
1045
1216
  _: 1
1046
1217
  })])]),
1047
- default: T(() => [e(h, {
1218
+ default: b(() => [t(T, {
1048
1219
  type: "expand"
1049
1220
  }, {
1050
- default: T((D) => [D.row.deployment_packages && D.row.deployment_packages.length > 0 ? (y(), x("div", Pe, [i[1] || (i[1] = f("div", {
1221
+ default: b((D) => [D.row.deployment_packages && D.row.deployment_packages.length > 0 ? (h(), x("div", Xe, [i[4] || (i[4] = p("div", {
1051
1222
  class: "font-bold text-14px mt-12px"
1052
- }, "已部署的探针包", -1)), f("div", Ie, [(y(!0), x(B, null, W(D.row.deployment_packages, (N) => (y(), x("div", {
1053
- key: N.id,
1054
- class: "w-30% px-20px py-10px rounded-8px bg-[var(--el-fill-color-light)] border border-solid border-[var(--el-border-color-lighter)] hover:shadow-md transition-shadow"
1055
- }, [f("div", Re, C(N.file_name), 1), f("div", Oe, [f("p", null, "版本: " + C(N.version), 1), f("p", null, "部署时间: " + C(N.deployment_time), 1)])]))), 128))])])) : (y(), x("div", He, "暂无部署服务器记录"))]),
1223
+ }, "已部署的探针包", -1)), p("div", Ye, [(h(!0), x(z, null, G(D.row.deployment_packages, (C) => (h(), x("div", {
1224
+ key: C.id,
1225
+ class: "group w-25% px-20px py-10px rounded-8px bg-[var(--el-fill-color-light)] border border-solid border-[var(--el-border-color-lighter)] hover:shadow-lg transition-all duration-300 relative overflow-hidden"
1226
+ }, [p("div", {
1227
+ class: te(["absolute top-0 right-0 px-2 py-1 text-12px font-medium border-b border-l rounded-bl-8px", {
1228
+ "text-green-600 bg-green-50 border-green-200": C.deploy_type === 0,
1229
+ "text-amber-600 bg-amber-50 border-amber-200": C.deploy_type === 1,
1230
+ "text-red-600 bg-red-50 border-red-200": C.deploy_type === 2
1231
+ }])
1232
+ }, q(C.deploy_type === 0 ? "安装" : C.deploy_type === 1 ? "升级" : "卸载"), 3), p("div", et, q(C.file_name), 1), p("div", tt, [p("p", lt, [i[1] || (i[1] = p("span", {
1233
+ class: "opacity-70 mr-2"
1234
+ }, "版本:", -1)), E(" " + q(C.version), 1)]), p("p", ot, [i[2] || (i[2] = p("span", {
1235
+ class: "opacity-70 mr-2"
1236
+ }, "部署时间:", -1)), E(" " + q(C.deployment_time), 1)])]), p("div", rt, [t(B, {
1237
+ type: "danger",
1238
+ circle: "",
1239
+ class: "mb-2 transform scale-90 group-hover:scale-100 transition-transform duration-300",
1240
+ onClick: le((Z) => U(C), ["stop"])
1241
+ }, {
1242
+ default: b(() => [t(d, {
1243
+ size: "20"
1244
+ }, {
1245
+ default: b(() => [t(L)]),
1246
+ _: 1
1247
+ })]),
1248
+ _: 1
1249
+ }, 8, ["onClick"]), i[3] || (i[3] = p("span", {
1250
+ class: "text-white text-12px font-medium tracking-wide"
1251
+ }, "卸载", -1))])]))), 128))])])) : (h(), x("div", nt, "暂无部署服务器记录"))]),
1056
1252
  _: 1
1057
1253
  })]),
1058
1254
  _: 1
1059
- }, 8, ["columns", "request-api", "init-param", "options"]), e(q(ee), Y({
1255
+ }, 8, ["columns", "request-api", "init-param", "options"]), t(F(re), oe({
1060
1256
  ref_key: "refTdsForm",
1061
- ref: c
1062
- }, o.$formBindProps({
1063
- title: v.value,
1064
- form: n.value,
1257
+ ref: m
1258
+ }, e.$formBindProps({
1259
+ title: _.value,
1260
+ form: r.value,
1065
1261
  columns: A,
1066
- formKey: m.value
1262
+ formKey: v.value
1067
1263
  }), {
1068
- onSubmit: U
1264
+ onSubmit: R
1069
1265
  }), null, 16)]);
1070
1266
  };
1071
1267
  }
1072
- }), We = {
1268
+ }), st = {
1073
1269
  class: "table-box"
1074
- }, je = {
1075
- style: {
1076
- padding: "0 50px"
1077
- }
1078
- }, Ge = /* @__PURE__ */ K({
1270
+ }, it = {
1271
+ class: "whitespace-pre-wrap font-mono py-20px px-10px bg-gray-100 rounded text-sm text-gray-800"
1272
+ }, ut = /* @__PURE__ */ W({
1079
1273
  __name: "index",
1080
- setup(t) {
1081
- const l = H({
1274
+ setup(l) {
1275
+ const o = H({
1082
1276
  service_type: window.$prodType
1083
- }), a = H([{
1277
+ }), n = w(), a = H([{
1084
1278
  field: "packages_name",
1085
1279
  name: "探针包",
1086
- render: (r) => e(B, null, [e("p", {
1280
+ render: (_) => t(z, null, [t("p", {
1087
1281
  class: "font-bold"
1088
- }, [r.row.packages_name]), e("p", {
1282
+ }, [_.row.packages_name]), t("p", {
1089
1283
  class: "text-gray-400"
1090
- }, [r.row.packages_version])])
1284
+ }, [_.row.packages_version])])
1091
1285
  }, {
1092
1286
  field: "server_name",
1093
1287
  name: "服务器",
1094
- render: (r) => e(B, null, [e("p", {
1288
+ render: (_) => t(z, null, [t("p", {
1095
1289
  class: "font-bold"
1096
- }, [r.row.server_name]), e("p", {
1290
+ }, [_.row.server_name]), t("p", {
1097
1291
  class: "text-gray-400"
1098
- }, [r.row.ip_address])])
1292
+ }, [_.row.ip_address])])
1099
1293
  }, {
1100
1294
  field: "deployment_time",
1101
1295
  name: "部署时间"
@@ -1104,9 +1298,13 @@ const L = {
1104
1298
  name: "状态",
1105
1299
  tag: !0,
1106
1300
  enum: [{
1107
- label: "部署失败",
1301
+ label: "未知",
1302
+ value: -1,
1303
+ tagType: "default"
1304
+ }, {
1305
+ label: "待执行",
1108
1306
  value: 0,
1109
- tagType: "danger"
1307
+ tagType: "default"
1110
1308
  }, {
1111
1309
  label: "部署中",
1112
1310
  value: 1,
@@ -1115,30 +1313,39 @@ const L = {
1115
1313
  label: "部署成功",
1116
1314
  value: 2,
1117
1315
  tagType: "success"
1316
+ }, {
1317
+ label: "部署失败",
1318
+ value: 3,
1319
+ tagType: "danger"
1118
1320
  }]
1119
- }]);
1120
- return (r, c) => {
1121
- const v = d("el-table-column"), n = d("TdsTable");
1122
- return y(), x("div", We, [e(n, {
1123
- ref: "refTdsTable",
1321
+ }]), m = setInterval(() => {
1322
+ n.value && n.value.getTableList();
1323
+ }, 5e3);
1324
+ return pe(() => {
1325
+ clearInterval(m);
1326
+ }), (_, r) => {
1327
+ const v = c("el-table-column"), k = c("TdsTable");
1328
+ return h(), x("div", st, [t(k, {
1329
+ ref_key: "refTdsTable",
1330
+ ref: n,
1124
1331
  columns: a,
1125
1332
  "search-col": 4,
1126
- "request-api": q(we),
1127
- options: r.$tableOptions(),
1128
- "init-param": l,
1333
+ "request-api": F(Ue),
1334
+ options: _.$tableOptions(),
1335
+ "init-param": o,
1129
1336
  "reserve-selection": ""
1130
1337
  }, {
1131
- default: T(() => [e(v, {
1338
+ default: b(() => [t(v, {
1132
1339
  type: "expand"
1133
1340
  }, {
1134
- default: T((m) => [f("div", je, C(m.row.deployment_log), 1)]),
1341
+ default: b((g) => [p("div", it, q(g.row.deployment_log), 1)]),
1135
1342
  _: 1
1136
1343
  })]),
1137
1344
  _: 1
1138
1345
  }, 8, ["columns", "request-api", "options", "init-param"])]);
1139
1346
  };
1140
1347
  }
1141
- }), Je = { class: "main-wrapper" }, Ze = /* @__PURE__ */ K({
1348
+ }), dt = { class: "main-wrapper" }, pt = /* @__PURE__ */ W({
1142
1349
  name: "TCProbe",
1143
1350
  __name: "index",
1144
1351
  props: {
@@ -1147,44 +1354,44 @@ const L = {
1147
1354
  default: ""
1148
1355
  }
1149
1356
  },
1150
- setup(t) {
1151
- const l = w("package");
1152
- return (a, r) => {
1153
- const c = d("el-tab-pane"), v = d("el-tabs");
1154
- return y(), x("div", Je, [
1155
- e(v, {
1156
- modelValue: l.value,
1157
- "onUpdate:modelValue": r[0] || (r[0] = (n) => l.value = n),
1357
+ setup(l) {
1358
+ const o = w("package");
1359
+ return (n, a) => {
1360
+ const m = c("el-tab-pane"), _ = c("el-tabs");
1361
+ return h(), x("div", dt, [
1362
+ t(_, {
1363
+ modelValue: o.value,
1364
+ "onUpdate:modelValue": a[0] || (a[0] = (r) => o.value = r),
1158
1365
  class: "demo-tabs"
1159
1366
  }, {
1160
- default: T(() => [
1161
- e(c, {
1367
+ default: b(() => [
1368
+ t(m, {
1162
1369
  label: "安装包管理",
1163
1370
  name: "package"
1164
1371
  }, {
1165
- default: T(() => [
1166
- l.value === "package" ? (y(), G(Ne, {
1372
+ default: b(() => [
1373
+ o.value === "package" ? (h(), Q(Je, {
1167
1374
  key: 0,
1168
- token: t.token
1169
- }, null, 8, ["token"])) : O("", !0)
1375
+ token: l.token
1376
+ }, null, 8, ["token"])) : K("", !0)
1170
1377
  ]),
1171
1378
  _: 1
1172
1379
  }),
1173
- e(c, {
1380
+ t(m, {
1174
1381
  label: "探针部署",
1175
1382
  name: "deploy"
1176
1383
  }, {
1177
- default: T(() => [
1178
- l.value === "deploy" ? (y(), G(Ke, { key: 0 })) : O("", !0)
1384
+ default: b(() => [
1385
+ o.value === "deploy" ? (h(), Q(at, { key: 0 })) : K("", !0)
1179
1386
  ]),
1180
1387
  _: 1
1181
1388
  }),
1182
- e(c, {
1389
+ t(m, {
1183
1390
  label: "部署历史",
1184
1391
  name: "history"
1185
1392
  }, {
1186
- default: T(() => [
1187
- l.value === "history" ? (y(), G(Ge, { key: 0 })) : O("", !0)
1393
+ default: b(() => [
1394
+ o.value === "history" ? (h(), Q(ut, { key: 0 })) : K("", !0)
1188
1395
  ]),
1189
1396
  _: 1
1190
1397
  })
@@ -1195,24 +1402,24 @@ const L = {
1195
1402
  };
1196
1403
  }
1197
1404
  });
1198
- const Qe = /* @__PURE__ */ te(Ze, [["__scopeId", "data-v-f99b9b23"]]), Xe = (t, l) => {
1199
- if (t.install = (a) => {
1200
- for (const r of [t, ...Object.values(l ?? {})])
1201
- a.component(r.name, r);
1202
- }, l)
1203
- for (const [a, r] of Object.entries(l))
1204
- t[a] = r;
1205
- return t;
1206
- }, Ye = Xe(Qe), et = {
1207
- TCProbe: Ye
1208
- }, at = {
1209
- install(t, l) {
1210
- Object.entries(et).forEach(([a, r]) => {
1211
- t.component(a, r);
1212
- }), l != null && l.prodType && (window.$prodType = l.prodType), l != null && l.envURL && (window.$probeURL = l.envURL);
1405
+ const ct = /* @__PURE__ */ ne(pt, [["__scopeId", "data-v-f99b9b23"]]), mt = (l, o) => {
1406
+ if (l.install = (n) => {
1407
+ for (const a of [l, ...Object.values(o ?? {})])
1408
+ n.component(a.name, a);
1409
+ }, o)
1410
+ for (const [n, a] of Object.entries(o))
1411
+ l[n] = a;
1412
+ return l;
1413
+ }, _t = mt(ct), yt = {
1414
+ TCProbe: _t
1415
+ }, wt = {
1416
+ install(l, o) {
1417
+ Object.entries(yt).forEach(([n, a]) => {
1418
+ l.component(n, a);
1419
+ }), o != null && o.prodType && (window.$prodType = o.prodType), o != null && o.envURL && (window.$probeURL = o.envURL), o != null && o.dockerURL && (window.$dockerURL = o.dockerURL);
1213
1420
  }
1214
1421
  };
1215
1422
  export {
1216
- Ye as TCProbe,
1217
- at as default
1423
+ _t as TCProbe,
1424
+ wt as default
1218
1425
  };