@glodon-aiot/dataset-annotation 3.19.0-alpha.19 → 3.19.0-alpha.21
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/DatasetContext/index.mjs +3 -2
- package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +183 -177
- package/dist/es/components/VLMAnnotationDetail/index.mjs +73 -71
- package/dist/es/createClassificationDatasetAnnotation/index.mjs +99 -80
- package/dist/es/createDatasetAnnotation/index.mjs +95 -76
- package/dist/es/createDetectionDatasetAnnotation/index.mjs +103 -84
- package/dist/es/createOcrDatasetAnnotation/index.mjs +103 -84
- package/dist/es/createVlmtasetAnnotation/index.mjs +100 -80
- package/dist/es/index.mjs +1 -1
- package/dist/es/utils/index.mjs +44 -17
- package/dist/lib/index.js +3 -3
- package/dist/src/DatasetContext/index.d.ts +2 -0
- package/dist/src/api.d.ts +2 -1
- package/dist/src/createClassificationDatasetAnnotation/index.d.ts +2 -0
- package/dist/src/createDatasetAnnotation/index.d.ts +2 -0
- package/dist/src/createDetectionDatasetAnnotation/index.d.ts +2 -0
- package/dist/src/createOcrDatasetAnnotation/index.d.ts +2 -0
- package/dist/src/createVlmtasetAnnotation/index.d.ts +2 -0
- package/dist/src/featuresConfig.d.ts +2 -0
- package/dist/src/utils/index.d.ts +5 -0
- package/package.json +2 -2
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ze = Object.defineProperty, _e = Object.defineProperties;
|
|
2
|
+
var $e = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var fe = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var me = (h, o, t) => o in h ?
|
|
4
|
+
var je = Object.prototype.hasOwnProperty, qe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var me = (h, o, t) => o in h ? Ze(h, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[o] = t, g = (h, o) => {
|
|
6
6
|
for (var t in o || (o = {}))
|
|
7
|
-
|
|
7
|
+
je.call(o, t) && me(h, t, o[t]);
|
|
8
8
|
if (fe)
|
|
9
9
|
for (var t of fe(o))
|
|
10
|
-
|
|
10
|
+
qe.call(o, t) && me(h, t, o[t]);
|
|
11
11
|
return h;
|
|
12
|
-
}, S = (h, o) =>
|
|
13
|
-
import { jsx as i, jsxs as b, Fragment as
|
|
14
|
-
import { useState as l, useRef as he, useLayoutEffect as
|
|
15
|
-
import { message as J, ConfigProvider as
|
|
16
|
-
import
|
|
12
|
+
}, S = (h, o) => _e(h, $e(o));
|
|
13
|
+
import { jsx as i, jsxs as b, Fragment as We } from "react/jsx-runtime";
|
|
14
|
+
import { useState as l, useRef as he, useLayoutEffect as Ge, useEffect as m } from "react";
|
|
15
|
+
import { message as J, ConfigProvider as Je, Space as K, Select as Qe, Button as Q, Tabs as Xe, Col as Ye, Empty as et } from "antd";
|
|
16
|
+
import tt from "antd/es/locale/zh_CN";
|
|
17
17
|
import "./style.less.mjs";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
18
|
+
import rt from "./VlmModal/index.mjs";
|
|
19
|
+
import nt from "lodash/merge";
|
|
20
20
|
import { UploadZipsStatus as T } from "@glodon-aiot/apis";
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import { DEFAULT_FILTER_SWITCH as
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { Prompt as
|
|
29
|
-
import
|
|
30
|
-
const
|
|
21
|
+
import it from "rc-virtual-list";
|
|
22
|
+
import ot from "../../Common/Page/index.mjs";
|
|
23
|
+
import st from "../Thumbnail/index.mjs";
|
|
24
|
+
import lt from "../../DatasetContext/index.mjs";
|
|
25
|
+
import { DEFAULT_FILTER_SWITCH as ct } from "../../constant.mjs";
|
|
26
|
+
import at from "../PageNav/index.mjs";
|
|
27
|
+
import dt from "../PicZipImportModal/index.mjs";
|
|
28
|
+
import { Prompt as ut } from "../hooks/Prompt.mjs";
|
|
29
|
+
import ft from "../DetectionAnnotation/icon_item_empty.svg.mjs";
|
|
30
|
+
const Nt = (h) => {
|
|
31
31
|
const {
|
|
32
32
|
services: o,
|
|
33
33
|
datasetId: t,
|
|
@@ -41,12 +41,13 @@ const Tt = (h) => {
|
|
|
41
41
|
},
|
|
42
42
|
exampleSrcRoot: Se,
|
|
43
43
|
apiUrl: be,
|
|
44
|
-
token: ye
|
|
45
|
-
|
|
44
|
+
token: ye,
|
|
45
|
+
getToken: Ie
|
|
46
|
+
} = h, [c, O] = l(), [r, L] = l(), [F, X] = l([]), [Y, H] = l(!1), [Ce, ee] = l(!1), [B, P] = l(!1), [ke, U] = l("preview"), [Z, te] = l(0), [f, Ve] = l([]), [_, D] = l(), [Le, re] = l(), [$, w] = l(-1), [s, x] = l({
|
|
46
47
|
current: 0,
|
|
47
48
|
pageSize: 100
|
|
48
|
-
}), [ne, ie] = l(0), [z, j] = l(""), [I,
|
|
49
|
-
|
|
49
|
+
}), [ne, ie] = l(0), [z, j] = l(""), [I, De] = l(""), [we, xe] = l(), [Me, Te] = l(), [oe, q] = l(!1), [se, Ne] = l(!1), [le, ze] = l(!0), [Ee, Re] = l(!1), W = he(null), [Ae, Fe] = l(0), ce = he(-1), G = g({}, ct);
|
|
50
|
+
nt(G, h.filterSwitch), Ge(() => {
|
|
50
51
|
const e = W.current;
|
|
51
52
|
if (!e)
|
|
52
53
|
return;
|
|
@@ -54,7 +55,7 @@ const Tt = (h) => {
|
|
|
54
55
|
const a = () => {
|
|
55
56
|
cancelAnimationFrame(n), n = requestAnimationFrame(() => {
|
|
56
57
|
const C = e.clientHeight, k = Math.max(1, Math.round(C));
|
|
57
|
-
k !== ce.current && (ce.current = k,
|
|
58
|
+
k !== ce.current && (ce.current = k, Fe(k));
|
|
58
59
|
});
|
|
59
60
|
};
|
|
60
61
|
a();
|
|
@@ -65,9 +66,9 @@ const Tt = (h) => {
|
|
|
65
66
|
cancelAnimationFrame(n), d == null || d.disconnect(), p == null || p.removeEventListener("resize", a), window.removeEventListener("resize", a);
|
|
66
67
|
};
|
|
67
68
|
}, [c]);
|
|
68
|
-
const
|
|
69
|
+
const He = () => {
|
|
69
70
|
j("nocode"), U("annotation"), P(!0);
|
|
70
|
-
},
|
|
71
|
+
}, Be = (e) => {
|
|
71
72
|
if (!f)
|
|
72
73
|
return;
|
|
73
74
|
w(e);
|
|
@@ -75,10 +76,10 @@ const Tt = (h) => {
|
|
|
75
76
|
D(n), U("preview"), P(!0);
|
|
76
77
|
};
|
|
77
78
|
m(() => {
|
|
78
|
-
o.cvforceDatahub && o.cvforceDatahub.getOptionsImgproxy().then((e) =>
|
|
79
|
+
o.cvforceDatahub && o.cvforceDatahub.getOptionsImgproxy().then((e) => xe(e));
|
|
79
80
|
}, [o.cvforceDatahub]), m(() => {
|
|
80
81
|
t && o.cvforceDatahub.getS3Iam(t).then((e) => {
|
|
81
|
-
|
|
82
|
+
Te(e);
|
|
82
83
|
});
|
|
83
84
|
}, [t]), m(() => {
|
|
84
85
|
!t || r || (H(!0), Promise.all([
|
|
@@ -109,7 +110,7 @@ const Tt = (h) => {
|
|
|
109
110
|
}, []);
|
|
110
111
|
const ae = () => {
|
|
111
112
|
!t || !r || o.cvforceDatahub.getDatasetsIdVersionsVid(t, r.id).then((e) => {
|
|
112
|
-
L(e),
|
|
113
|
+
L(e), De(e.versionAsyncTask.state);
|
|
113
114
|
});
|
|
114
115
|
};
|
|
115
116
|
m(() => {
|
|
@@ -117,7 +118,7 @@ const Tt = (h) => {
|
|
|
117
118
|
}, [t, r == null ? void 0 : r.id]), m(() => {
|
|
118
119
|
I !== T.Pending && I !== T.Started || J.warning("文件导入中,请刷新页面再试");
|
|
119
120
|
}, [I]), m(() => {
|
|
120
|
-
|
|
121
|
+
Re(!le && se);
|
|
121
122
|
}, [le, se]);
|
|
122
123
|
const E = () => {
|
|
123
124
|
!t || !r || o.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(t, r.id).then((e) => {
|
|
@@ -147,7 +148,7 @@ const Tt = (h) => {
|
|
|
147
148
|
labels: k()
|
|
148
149
|
}).then((R) => {
|
|
149
150
|
const v = R.recordList || [], A = a === 1 ? v : p === "prev" ? [...v, ...C] : [...C, ...v];
|
|
150
|
-
if (
|
|
151
|
+
if (Ve(A), x(S(g({}, s), {
|
|
151
152
|
current: a,
|
|
152
153
|
pageSize: d,
|
|
153
154
|
type: void 0,
|
|
@@ -178,7 +179,7 @@ const Tt = (h) => {
|
|
|
178
179
|
})).then((e) => {
|
|
179
180
|
});
|
|
180
181
|
}, [z]);
|
|
181
|
-
const
|
|
182
|
+
const Pe = () => {
|
|
182
183
|
if (!f)
|
|
183
184
|
return;
|
|
184
185
|
const e = $ + 1;
|
|
@@ -193,7 +194,7 @@ const Tt = (h) => {
|
|
|
193
194
|
const n = f[e];
|
|
194
195
|
D(n);
|
|
195
196
|
}
|
|
196
|
-
},
|
|
197
|
+
}, Ue = () => {
|
|
197
198
|
if (!f)
|
|
198
199
|
return;
|
|
199
200
|
const e = $ - 1;
|
|
@@ -208,7 +209,7 @@ const Tt = (h) => {
|
|
|
208
209
|
const n = f[e];
|
|
209
210
|
D(n);
|
|
210
211
|
}
|
|
211
|
-
},
|
|
212
|
+
}, Ke = [{
|
|
212
213
|
key: "",
|
|
213
214
|
label: `全部(${Z})`,
|
|
214
215
|
children: null
|
|
@@ -232,7 +233,7 @@ const Tt = (h) => {
|
|
|
232
233
|
(n = (e = W.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || n.scrollTo({
|
|
233
234
|
top: 0
|
|
234
235
|
});
|
|
235
|
-
},
|
|
236
|
+
}, Oe = (e) => {
|
|
236
237
|
var v, A;
|
|
237
238
|
const {
|
|
238
239
|
scrollTop: n,
|
|
@@ -246,9 +247,9 @@ const Tt = (h) => {
|
|
|
246
247
|
});
|
|
247
248
|
});
|
|
248
249
|
};
|
|
249
|
-
return /* @__PURE__ */ i(
|
|
250
|
-
locale:
|
|
251
|
-
children: /* @__PURE__ */ i(
|
|
250
|
+
return /* @__PURE__ */ i(Je, {
|
|
251
|
+
locale: tt,
|
|
252
|
+
children: /* @__PURE__ */ i(lt.Provider, {
|
|
252
253
|
value: {
|
|
253
254
|
datasetId: t,
|
|
254
255
|
versionId: (r == null ? void 0 : r.id) || "",
|
|
@@ -260,6 +261,7 @@ const Tt = (h) => {
|
|
|
260
261
|
pagination: s,
|
|
261
262
|
services: o,
|
|
262
263
|
token: ye,
|
|
264
|
+
getToken: Ie,
|
|
263
265
|
apiUrl: be,
|
|
264
266
|
featuresConfig: {
|
|
265
267
|
labelManager: ge,
|
|
@@ -272,9 +274,9 @@ const Tt = (h) => {
|
|
|
272
274
|
},
|
|
273
275
|
children: c ? c.markType === "vlm" ? /* @__PURE__ */ b("div", {
|
|
274
276
|
className: "vlm-version-detail",
|
|
275
|
-
children: [/* @__PURE__ */ b(
|
|
277
|
+
children: [/* @__PURE__ */ b(ot, {
|
|
276
278
|
className: "product-details-page",
|
|
277
|
-
header: u === !1 ? void 0 : /* @__PURE__ */ i(
|
|
279
|
+
header: u === !1 ? void 0 : /* @__PURE__ */ i(at, {
|
|
278
280
|
backTo: pe,
|
|
279
281
|
onBackClick: u != null && u.onBackClick ? () => {
|
|
280
282
|
u.onBackClick && u.onBackClick();
|
|
@@ -285,7 +287,7 @@ const Tt = (h) => {
|
|
|
285
287
|
fontWeight: "bold"
|
|
286
288
|
},
|
|
287
289
|
children: c == null ? void 0 : c.name
|
|
288
|
-
}), /* @__PURE__ */ i(
|
|
290
|
+
}), /* @__PURE__ */ i(Qe, {
|
|
289
291
|
disabled: (u == null ? void 0 : u.versionSelect) === !1,
|
|
290
292
|
value: r == null ? void 0 : r.id,
|
|
291
293
|
style: {
|
|
@@ -314,12 +316,12 @@ const Tt = (h) => {
|
|
|
314
316
|
onClick: () => q(!0),
|
|
315
317
|
disabled: I === T.Pending || I === T.Started,
|
|
316
318
|
children: "导入数据"
|
|
317
|
-
}, "del"), /* @__PURE__ */ i(
|
|
318
|
-
when:
|
|
319
|
+
}, "del"), /* @__PURE__ */ i(ut, {
|
|
320
|
+
when: Ee,
|
|
319
321
|
content: "确认要离开此页面吗?",
|
|
320
322
|
subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
|
|
321
|
-
}), oe && /* @__PURE__ */ i(
|
|
322
|
-
datasetIam:
|
|
323
|
+
}), oe && /* @__PURE__ */ i(dt, {
|
|
324
|
+
datasetIam: Me,
|
|
323
325
|
datasetId: t,
|
|
324
326
|
currentVersion: r,
|
|
325
327
|
tenCode: c == null ? void 0 : c.tenantCode,
|
|
@@ -327,9 +329,9 @@ const Tt = (h) => {
|
|
|
327
329
|
isVisible: oe,
|
|
328
330
|
setIsVisible: q,
|
|
329
331
|
getVersionListRequest: E,
|
|
330
|
-
setIsConfirm:
|
|
332
|
+
setIsConfirm: ze,
|
|
331
333
|
onUploadStatusChange: (e) => {
|
|
332
|
-
|
|
334
|
+
Ne(e);
|
|
333
335
|
},
|
|
334
336
|
tableReload: () => {
|
|
335
337
|
r != null && r.id && (de(), M(S(g({}, s), {
|
|
@@ -343,7 +345,7 @@ const Tt = (h) => {
|
|
|
343
345
|
children: [/* @__PURE__ */ b("div", {
|
|
344
346
|
className: "vlm-header",
|
|
345
347
|
children: [/* @__PURE__ */ i(K, {
|
|
346
|
-
children: G.tabs && /* @__PURE__ */ i(
|
|
348
|
+
children: G.tabs && /* @__PURE__ */ i(Xe, {
|
|
347
349
|
className: "header-tab",
|
|
348
350
|
activeKey: z,
|
|
349
351
|
onChange: (e) => {
|
|
@@ -352,13 +354,13 @@ const Tt = (h) => {
|
|
|
352
354
|
// total: 0,
|
|
353
355
|
})), j(e);
|
|
354
356
|
},
|
|
355
|
-
items:
|
|
357
|
+
items: Ke
|
|
356
358
|
})
|
|
357
359
|
}), /* @__PURE__ */ i(K, {
|
|
358
360
|
children: y && y.label && /* @__PURE__ */ i(Q, {
|
|
359
361
|
type: "primary",
|
|
360
362
|
disabled: !Z,
|
|
361
|
-
onClick:
|
|
363
|
+
onClick: He,
|
|
362
364
|
style: {
|
|
363
365
|
marginRight: "10px"
|
|
364
366
|
},
|
|
@@ -370,26 +372,26 @@ const Tt = (h) => {
|
|
|
370
372
|
children: /* @__PURE__ */ i("div", {
|
|
371
373
|
className: "d-right",
|
|
372
374
|
ref: W,
|
|
373
|
-
children: _ ? /* @__PURE__ */ i("div", {}) : s.total !== void 0 && s.total > 0 ? /* @__PURE__ */ i(
|
|
374
|
-
children: /* @__PURE__ */ i(
|
|
375
|
+
children: _ ? /* @__PURE__ */ i("div", {}) : s.total !== void 0 && s.total > 0 ? /* @__PURE__ */ i(We, {
|
|
376
|
+
children: /* @__PURE__ */ i(it, {
|
|
375
377
|
innerProps: {
|
|
376
378
|
className: "d-right-row"
|
|
377
379
|
},
|
|
378
380
|
data: f,
|
|
379
381
|
itemKey: "id",
|
|
380
|
-
height: Math.max(
|
|
381
|
-
onScroll:
|
|
382
|
-
children: (e, n) => /* @__PURE__ */ i(
|
|
382
|
+
height: Math.max(Ae, 1),
|
|
383
|
+
onScroll: Oe,
|
|
384
|
+
children: (e, n) => /* @__PURE__ */ i(Ye, {
|
|
383
385
|
className: "d-right-col",
|
|
384
|
-
onClick: () =>
|
|
386
|
+
onClick: () => Be(n),
|
|
385
387
|
children: /* @__PURE__ */ b("div", {
|
|
386
388
|
className: "right-col-wrapper",
|
|
387
389
|
children: [/* @__PURE__ */ i("div", {
|
|
388
390
|
className: "right-col-img",
|
|
389
|
-
children: /* @__PURE__ */ i(
|
|
391
|
+
children: /* @__PURE__ */ i(st, {
|
|
390
392
|
fileKey: e.fileKey,
|
|
391
393
|
width: 124,
|
|
392
|
-
imgProxy:
|
|
394
|
+
imgProxy: we
|
|
393
395
|
})
|
|
394
396
|
}), /* @__PURE__ */ i("div", {
|
|
395
397
|
className: "right-col-text",
|
|
@@ -402,8 +404,8 @@ const Tt = (h) => {
|
|
|
402
404
|
})
|
|
403
405
|
}) : /* @__PURE__ */ i("div", {
|
|
404
406
|
className: "empty",
|
|
405
|
-
children: s.total === 0 ? /* @__PURE__ */ i(
|
|
406
|
-
image:
|
|
407
|
+
children: s.total === 0 ? /* @__PURE__ */ i(et, {
|
|
408
|
+
image: ft,
|
|
407
409
|
description: /* @__PURE__ */ b("span", {
|
|
408
410
|
children: ["暂无数据", z !== "hascode" && /* @__PURE__ */ i("span", {
|
|
409
411
|
children: y && y.add && /* @__PURE__ */ b(Q, {
|
|
@@ -427,17 +429,17 @@ const Tt = (h) => {
|
|
|
427
429
|
})
|
|
428
430
|
})
|
|
429
431
|
})]
|
|
430
|
-
}), B && /* @__PURE__ */ i(
|
|
432
|
+
}), B && /* @__PURE__ */ i(rt, {
|
|
431
433
|
isVlmModalVisible: B,
|
|
432
434
|
setIsVlmModalVisible: P,
|
|
433
435
|
record: _,
|
|
434
|
-
onNextClick: () =>
|
|
435
|
-
onPrevClick: () =>
|
|
436
|
-
listLoading:
|
|
436
|
+
onNextClick: () => Pe(),
|
|
437
|
+
onPrevClick: () => Ue(),
|
|
438
|
+
listLoading: Ce,
|
|
437
439
|
ocrMarkTmpl: c == null ? void 0 : c.ocrMarkTmpl,
|
|
438
440
|
datasetId: t,
|
|
439
441
|
versionId: r == null ? void 0 : r.id,
|
|
440
|
-
initialMode:
|
|
442
|
+
initialMode: ke,
|
|
441
443
|
filterMode: z,
|
|
442
444
|
onFilterModeChange: (e) => {
|
|
443
445
|
j(e);
|
|
@@ -453,7 +455,7 @@ const Tt = (h) => {
|
|
|
453
455
|
current: 1
|
|
454
456
|
})), E();
|
|
455
457
|
},
|
|
456
|
-
selectSampleId:
|
|
458
|
+
selectSampleId: Le,
|
|
457
459
|
onClose: () => {
|
|
458
460
|
M(S(g({}, s), {
|
|
459
461
|
current: 1
|
|
@@ -476,5 +478,5 @@ const Tt = (h) => {
|
|
|
476
478
|
});
|
|
477
479
|
};
|
|
478
480
|
export {
|
|
479
|
-
|
|
481
|
+
Nt as default
|
|
480
482
|
};
|
|
@@ -1,129 +1,148 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var B = Object.defineProperty, L = Object.defineProperties;
|
|
2
|
+
var $ = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var d = Object.getOwnPropertySymbols;
|
|
4
|
+
var S = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var h = (e, r, o) => r in e ? B(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o, f = (e, r) => {
|
|
6
6
|
for (var o in r || (r = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var o of
|
|
10
|
-
|
|
7
|
+
S.call(r, o) && h(e, o, r[o]);
|
|
8
|
+
if (d)
|
|
9
|
+
for (var o of d(r))
|
|
10
|
+
D.call(r, o) && h(e, o, r[o]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, M = (e, r) => L(e, $(r));
|
|
13
|
+
var b = (e, r) => {
|
|
14
14
|
var o = {};
|
|
15
15
|
for (var t in e)
|
|
16
|
-
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var t of
|
|
19
|
-
r.indexOf(t) < 0 &&
|
|
16
|
+
S.call(e, t) && r.indexOf(t) < 0 && (o[t] = e[t]);
|
|
17
|
+
if (e != null && d)
|
|
18
|
+
for (var t of d(e))
|
|
19
|
+
r.indexOf(t) < 0 && D.call(e, t) && (o[t] = e[t]);
|
|
20
20
|
return o;
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
var w = (e, r, o) => new Promise((t, i) => {
|
|
23
|
+
var p = (s) => {
|
|
24
|
+
try {
|
|
25
|
+
l(o.next(s));
|
|
26
|
+
} catch (m) {
|
|
27
|
+
i(m);
|
|
28
|
+
}
|
|
29
|
+
}, v = (s) => {
|
|
30
|
+
try {
|
|
31
|
+
l(o.throw(s));
|
|
32
|
+
} catch (m) {
|
|
33
|
+
i(m);
|
|
34
|
+
}
|
|
35
|
+
}, l = (s) => s.done ? t(s.value) : Promise.resolve(s.value).then(p, v);
|
|
36
|
+
l((o = o.apply(e, r)).next());
|
|
37
|
+
});
|
|
38
|
+
import { jsx as V } from "react/jsx-runtime";
|
|
39
|
+
import j from "react-dom";
|
|
40
|
+
import { defaultApiUrl as z } from "../constant.mjs";
|
|
41
|
+
import G from "../components/ClassificationAnnotation/index.mjs";
|
|
42
|
+
import { CVForceDatahubApi as N, ModelServiceApi as W } from "@glodon-aiot/apis";
|
|
43
|
+
import { isExpired as J, createTokenResolver as K } from "../utils/index.mjs";
|
|
44
|
+
import { notification as I } from "antd";
|
|
45
|
+
import P from "axios";
|
|
46
|
+
import Q from "lodash/merge";
|
|
47
|
+
import { VIEW_MODE_FEATURES as X, LABEL_MODE_FEATURES as Y, MANAGE_MODE_FEATURES as Z } from "../featuresConfig.mjs";
|
|
48
|
+
function q(e) {
|
|
33
49
|
switch (e) {
|
|
34
50
|
case "manage":
|
|
35
|
-
return
|
|
51
|
+
return f({}, Z);
|
|
36
52
|
case "label":
|
|
37
|
-
return
|
|
53
|
+
return f({}, Y);
|
|
38
54
|
case "view":
|
|
39
|
-
return
|
|
55
|
+
return f({}, X);
|
|
40
56
|
default:
|
|
41
57
|
return null;
|
|
42
58
|
}
|
|
43
59
|
}
|
|
44
|
-
const
|
|
45
|
-
const
|
|
60
|
+
const me = (e) => {
|
|
61
|
+
const T = e, {
|
|
46
62
|
getContainer: r = () => document.createElement("div"),
|
|
47
63
|
token: o,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
64
|
+
getToken: t,
|
|
65
|
+
errorHandlers: i,
|
|
66
|
+
apiUrl: p = z,
|
|
67
|
+
datasetId: v,
|
|
68
|
+
versionId: l,
|
|
69
|
+
mode: s = "label"
|
|
70
|
+
} = T, m = b(T, [
|
|
54
71
|
"getContainer",
|
|
55
72
|
"token",
|
|
73
|
+
"getToken",
|
|
56
74
|
"errorHandlers",
|
|
57
75
|
"apiUrl",
|
|
58
76
|
"datasetId",
|
|
59
77
|
"versionId",
|
|
60
78
|
"mode"
|
|
61
|
-
]),
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
var
|
|
66
|
-
|
|
79
|
+
]), E = f({}, q(s));
|
|
80
|
+
Q(E, m);
|
|
81
|
+
const x = r(), C = (() => {
|
|
82
|
+
const R = p, U = K(o, t), _ = (n) => w(void 0, null, function* () {
|
|
83
|
+
var c;
|
|
84
|
+
const a = yield U();
|
|
85
|
+
if (!a)
|
|
67
86
|
return n;
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
|
|
87
|
+
if (J(a)) {
|
|
88
|
+
const u = "aiotToken is timeout";
|
|
89
|
+
i.aiotToken ? typeof i.aiotToken == "function" ? i.aiotToken(
|
|
71
90
|
// @ts-ignore
|
|
72
|
-
new Error(
|
|
91
|
+
new Error(u, {
|
|
73
92
|
cause: {
|
|
74
93
|
status: 401,
|
|
75
|
-
message:
|
|
94
|
+
message: u
|
|
76
95
|
}
|
|
77
96
|
})
|
|
78
|
-
) : console.error("errorHandlers.aiotToken is not a function") : console.error(
|
|
97
|
+
) : console.error("errorHandlers.aiotToken is not a function") : console.error(u);
|
|
79
98
|
}
|
|
80
|
-
return n.headers = (
|
|
81
|
-
Authorization:
|
|
99
|
+
return n.headers = (c = n.headers) != null ? c : {}, n.headers = M(f({}, n.headers), {
|
|
100
|
+
Authorization: a ? `Bearer ${a}` : ""
|
|
82
101
|
}), n;
|
|
83
|
-
};
|
|
84
|
-
function
|
|
85
|
-
const
|
|
86
|
-
baseURL:
|
|
102
|
+
});
|
|
103
|
+
function g(n, a = !0) {
|
|
104
|
+
const c = `${R}${n}`, u = P.create({
|
|
105
|
+
baseURL: c
|
|
87
106
|
});
|
|
88
|
-
return
|
|
107
|
+
return a && u.interceptors.request.use(_), u;
|
|
89
108
|
}
|
|
90
|
-
const
|
|
91
|
-
n !== 10001 && n !== 10215 && (
|
|
109
|
+
const k = (n, a) => {
|
|
110
|
+
n !== 10001 && n !== 10215 && (I.config({
|
|
92
111
|
getContainer: r
|
|
93
|
-
}),
|
|
94
|
-
message:
|
|
112
|
+
}), I.error({
|
|
113
|
+
message: a
|
|
95
114
|
}));
|
|
96
|
-
},
|
|
115
|
+
}, A = (n, a) => {
|
|
97
116
|
if (n === 401) {
|
|
98
|
-
const
|
|
99
|
-
|
|
117
|
+
const c = "aiotToken is invalid";
|
|
118
|
+
i.aiotToken ? typeof i.aiotToken == "function" ? i.aiotToken(
|
|
100
119
|
// @ts-ignore
|
|
101
|
-
new Error(
|
|
120
|
+
new Error(c, {
|
|
102
121
|
cause: {
|
|
103
122
|
status: 401,
|
|
104
|
-
message:
|
|
123
|
+
message: c
|
|
105
124
|
}
|
|
106
125
|
})
|
|
107
|
-
) : console.error("errorHandlers.aiotToken is not a function") : console.error(
|
|
126
|
+
) : console.error("errorHandlers.aiotToken is not a function") : console.error(c);
|
|
108
127
|
}
|
|
109
|
-
},
|
|
110
|
-
onHttpStatusError:
|
|
111
|
-
onAppStatusError:
|
|
112
|
-
}),
|
|
113
|
-
onHttpStatusError:
|
|
114
|
-
onAppStatusError:
|
|
128
|
+
}, y = g("/datahub/v1"), F = new N(y, {
|
|
129
|
+
onHttpStatusError: A,
|
|
130
|
+
onAppStatusError: k
|
|
131
|
+
}), H = g("/mlopsdeploy/v1"), O = new W(H, {
|
|
132
|
+
onHttpStatusError: A,
|
|
133
|
+
onAppStatusError: k
|
|
115
134
|
});
|
|
116
135
|
return {
|
|
117
|
-
cvforceDatahub:
|
|
118
|
-
cvforceModelService:
|
|
136
|
+
cvforceDatahub: F,
|
|
137
|
+
cvforceModelService: O
|
|
119
138
|
};
|
|
120
139
|
})();
|
|
121
|
-
|
|
122
|
-
services:
|
|
123
|
-
datasetId:
|
|
124
|
-
versionId:
|
|
125
|
-
},
|
|
140
|
+
j.render(/* @__PURE__ */ V(G, f({
|
|
141
|
+
services: C,
|
|
142
|
+
datasetId: v,
|
|
143
|
+
versionId: l
|
|
144
|
+
}, E)), x);
|
|
126
145
|
};
|
|
127
146
|
export {
|
|
128
|
-
|
|
147
|
+
me as default
|
|
129
148
|
};
|