@kong-ui-public/entities-shared 2.12.9 → 2.12.10-pr.1302.612aa1e9.0
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/entities-shared.es.js +284 -294
- package/dist/entities-shared.umd.js +5 -5
- package/dist/style.css +1 -1
- package/dist/types/components/entity-base-config-card/EntityBaseConfigCard.vue.d.ts.map +1 -1
- package/dist/types/components/entity-base-form/EntityBaseForm.vue.d.ts.map +1 -1
- package/dist/types/composables/useDebouncedFilter.d.ts.map +1 -1
- package/dist/types/composables/useFetcher.d.ts.map +1 -1
- package/dist/types/types/app-config.d.ts +1 -3
- package/dist/types/types/app-config.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject as In, ref as R, unref as I, computed as
|
|
1
|
+
import { inject as In, ref as R, unref as I, computed as k, watch as Ae, defineComponent as H, openBlock as h, createBlock as K, resolveDynamicComponent as fe, normalizeClass as ue, withCtx as x, createElementBlock as S, createElementVNode as L, toDisplayString as O, createCommentVNode as D, Fragment as le, renderList as ie, resolveComponent as B, createVNode as N, createTextVNode as V, useCssVars as Tt, useSlots as Ze, renderSlot as Y, createSlots as _e, normalizeProps as En, guardReactiveProps as Tn, mergeProps as Fn, normalizeStyle as Fe, pushScopeId as Oe, popScopeId as $e, onBeforeMount as Ft, withModifiers as Ve, onMounted as On, onUnmounted as $n, withDirectives as he, vShow as me, withKeys as Ln, Teleport as Nn } from "vue";
|
|
2
2
|
import ot from "axios";
|
|
3
3
|
import { createI18n as Bn, i18nTComponent as Rn } from "@kong-ui-public/i18n";
|
|
4
4
|
import { BadgeMethodAppearances as Kn } from "@kong/kongponents";
|
|
@@ -247,17 +247,15 @@ function nr(e, t, n, r = {
|
|
|
247
247
|
searchKeys: ["id"]
|
|
248
248
|
}) {
|
|
249
249
|
n || (n = "1000");
|
|
250
|
-
const { axiosInstance: i } = Qe({
|
|
251
|
-
headers: e.requestHeaders
|
|
252
|
-
}), { i18n: { t: a } } = De(), { debounce: o } = qn(), l = o(async (m) => {
|
|
250
|
+
const { axiosInstance: i } = Qe(e.axiosRequestConfig), { i18n: { t: a } } = De(), { debounce: o } = qn(), l = o(async (m) => {
|
|
253
251
|
await ee(m);
|
|
254
252
|
}, 200), s = R(!1), u = R(""), d = R(""), c = R([]), p = R([]), f = R(void 0), b = I(t);
|
|
255
|
-
let
|
|
256
|
-
e.app === "konnect" ?
|
|
257
|
-
const { isValidUuid:
|
|
253
|
+
let v = `${e.apiBaseUrl}${b}`;
|
|
254
|
+
e.app === "konnect" ? v = v.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "") : e.app === "kongManager" && (v = v.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : ""));
|
|
255
|
+
const { isValidUuid: A } = Ot(), M = async () => {
|
|
258
256
|
try {
|
|
259
257
|
s.value = !0;
|
|
260
|
-
const { data: m } = await i.get(`${
|
|
258
|
+
const { data: m } = await i.get(`${v}?size=${n}`);
|
|
261
259
|
m != null && m.next || (f.value = r.fetchedItemsKey in m ? m[r.fetchedItemsKey] : []), p.value = r.fetchedItemsKey in m ? m[r.fetchedItemsKey] : [], c.value = p.value;
|
|
262
260
|
} catch {
|
|
263
261
|
c.value = [], u.value = a("debouncedFilter.errors.fetch");
|
|
@@ -265,28 +263,28 @@ function nr(e, t, n, r = {
|
|
|
265
263
|
s.value = !1;
|
|
266
264
|
}
|
|
267
265
|
}, E = R(""), ee = async (m) => {
|
|
268
|
-
var
|
|
266
|
+
var y, g, $;
|
|
269
267
|
if (E.value !== m)
|
|
270
268
|
if (E.value = m || "", f.value === void 0)
|
|
271
269
|
try {
|
|
272
270
|
if (s.value = !0, u.value = "", d.value = "", e.app === "konnect") {
|
|
273
|
-
let F =
|
|
271
|
+
let F = v + "";
|
|
274
272
|
m && (F += `/${m}`);
|
|
275
|
-
const { data:
|
|
276
|
-
r.fetchedItemsKey in
|
|
273
|
+
const { data: _ } = await i.get(`${F}?size=${n}`);
|
|
274
|
+
r.fetchedItemsKey in _ ? c.value = _[r.fetchedItemsKey] : _ != null && _.id ? c.value = [_] : c.value = [];
|
|
277
275
|
} else if (m) {
|
|
278
276
|
const F = [];
|
|
279
|
-
|
|
280
|
-
const { data: T } = await i.get(`${
|
|
277
|
+
A(m) && r.searchKeys.includes("id") ? F.push((async () => {
|
|
278
|
+
const { data: T } = await i.get(`${v}/${m}`);
|
|
281
279
|
return [T[r.fetchedItemsKey] ?? T];
|
|
282
280
|
})()) : F.push(
|
|
283
281
|
...r.searchKeys.filter((T) => T !== "id").map(async (T) => {
|
|
284
|
-
const { data: w } = await i.get(`${
|
|
282
|
+
const { data: w } = await i.get(`${v}?${T}=${m}`);
|
|
285
283
|
return w[r.fetchedItemsKey];
|
|
286
284
|
})
|
|
287
285
|
);
|
|
288
|
-
const
|
|
289
|
-
c.value = [], (
|
|
286
|
+
const _ = await Promise.all(F), j = /* @__PURE__ */ new Set();
|
|
287
|
+
c.value = [], (y = _ == null ? void 0 : _.forEach) == null || y.call(_, (T) => {
|
|
290
288
|
var w;
|
|
291
289
|
(w = T == null ? void 0 : T.forEach) == null || w.call(T, (U) => {
|
|
292
290
|
j.has(U.id) || (j.add(U.id), c.value.push(U));
|
|
@@ -295,19 +293,19 @@ function nr(e, t, n, r = {
|
|
|
295
293
|
} else
|
|
296
294
|
c.value = p.value;
|
|
297
295
|
} catch (F) {
|
|
298
|
-
((
|
|
296
|
+
((g = F == null ? void 0 : F.response) == null ? void 0 : g.status) === 404 ? d.value = a("debouncedFilter.errors.invalid") : (c.value = [], u.value = a("debouncedFilter.errors.fetch"));
|
|
299
297
|
} finally {
|
|
300
298
|
s.value = !1;
|
|
301
299
|
}
|
|
302
300
|
else
|
|
303
301
|
s.value = !0, d.value = "", m ? (c.value = ($ = f.value) == null ? void 0 : $.filter((F) => {
|
|
304
302
|
var j;
|
|
305
|
-
let
|
|
303
|
+
let _ = !1;
|
|
306
304
|
for (const T of r.searchKeys) {
|
|
307
305
|
const w = typeof F[T] == "string" ? (j = F[T]) == null ? void 0 : j.toLowerCase() : F[T];
|
|
308
|
-
w != null && w.includes(m.toLowerCase()) && (
|
|
306
|
+
w != null && w.includes(m.toLowerCase()) && (_ = !0);
|
|
309
307
|
}
|
|
310
|
-
return
|
|
308
|
+
return _;
|
|
311
309
|
}), (!c.value || !c.value.length) && (d.value = a("debouncedFilter.errors.invalid"))) : c.value = f.value, s.value = !1;
|
|
312
310
|
};
|
|
313
311
|
return {
|
|
@@ -321,7 +319,7 @@ function nr(e, t, n, r = {
|
|
|
321
319
|
};
|
|
322
320
|
}
|
|
323
321
|
function rr(e, t) {
|
|
324
|
-
const n = I(t), r =
|
|
322
|
+
const n = I(t), r = k(
|
|
325
323
|
() => e.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${n}`) : new URL(n)
|
|
326
324
|
);
|
|
327
325
|
return r.value.search = "", (i) => `${r.value.href}/${i}`;
|
|
@@ -368,17 +366,17 @@ function ar(e) {
|
|
|
368
366
|
}
|
|
369
367
|
}
|
|
370
368
|
function $t(e, t) {
|
|
371
|
-
const n = R(I(e)), r = R(I(t)), i =
|
|
369
|
+
const n = R(I(e)), r = R(I(t)), i = k(
|
|
372
370
|
() => !!(n.value.app === "konnect" || n.value.isExactMatch)
|
|
373
|
-
), a =
|
|
371
|
+
), a = k(
|
|
374
372
|
() => r.value.startsWith("/") ? new URL(`${window.location.origin}${r.value}`) : new URL(r.value)
|
|
375
373
|
);
|
|
376
374
|
return (o) => {
|
|
377
375
|
const { page: l, pageSize: s, offset: u, sortColumnKey: d, sortColumnOrder: c, query: p } = o;
|
|
378
376
|
try {
|
|
379
377
|
let f = new URL(a.value.href);
|
|
380
|
-
return i.value && p ? (f.search = "", f = n.value.isExactMatch ? new URL(`${f.href}/${p}/`) : new URL(`${f.href}?filter[name][contains]=${p}`)) : (i.value || new URLSearchParams(p).forEach((b,
|
|
381
|
-
f.searchParams.append(
|
|
378
|
+
return i.value && p ? (f.search = "", f = n.value.isExactMatch ? new URL(`${f.href}/${p}/`) : new URL(`${f.href}?filter[name][contains]=${p}`)) : (i.value || new URLSearchParams(p).forEach((b, v) => {
|
|
379
|
+
f.searchParams.append(v, b);
|
|
382
380
|
}), d && f.searchParams.append("sort_by", d), c === "desc" && f.searchParams.append("sort_desc", "1"), f.searchParams.append("size", String(s))), u && l !== 1 && f.searchParams.append("offset", String(u)), f.href;
|
|
383
381
|
} catch (f) {
|
|
384
382
|
return console.error("RouteList(fetcher)", f), r.value;
|
|
@@ -386,52 +384,48 @@ function $t(e, t) {
|
|
|
386
384
|
};
|
|
387
385
|
}
|
|
388
386
|
function or(e, t, n = "data") {
|
|
389
|
-
|
|
390
|
-
const r = I(t), { axiosInstance: i } = Qe({
|
|
391
|
-
...e.axiosRequestConfig,
|
|
392
|
-
headers: { ...(s = e.axiosRequestConfig) == null ? void 0 : s.headers, ...e.requestHeaders }
|
|
393
|
-
}), a = $t(e, r), o = R({
|
|
387
|
+
const r = I(t), { axiosInstance: i } = Qe(e.axiosRequestConfig), a = $t(e, r), o = R({
|
|
394
388
|
status: ve.Idle
|
|
395
389
|
});
|
|
396
|
-
return { fetcher: async (
|
|
397
|
-
var
|
|
390
|
+
return { fetcher: async (s) => {
|
|
391
|
+
var u;
|
|
398
392
|
try {
|
|
399
393
|
o.value = { status: ve.Loading };
|
|
400
|
-
let
|
|
401
|
-
|
|
402
|
-
const
|
|
403
|
-
if (
|
|
404
|
-
throw
|
|
405
|
-
const
|
|
406
|
-
let
|
|
407
|
-
f
|
|
408
|
-
const
|
|
409
|
-
data:
|
|
410
|
-
total:
|
|
411
|
-
...
|
|
394
|
+
let d = a(s);
|
|
395
|
+
d.includes("filter[name]") && (d = `${d}&page[size]=${s.pageSize}&page[number]=${s.page}`);
|
|
396
|
+
const c = await i.get(d);
|
|
397
|
+
if (c.status >= 400)
|
|
398
|
+
throw c;
|
|
399
|
+
const p = c.data, f = n && n.replace(/[^\w-_]/gi, "");
|
|
400
|
+
let b;
|
|
401
|
+
p[f] && Array.isArray(p[f]) ? b = p[f] : Array.isArray(p) ? b = p : b = Object.keys(p).length ? [p] : [];
|
|
402
|
+
const v = {
|
|
403
|
+
data: b,
|
|
404
|
+
total: b.length,
|
|
405
|
+
...p.offset ? {
|
|
412
406
|
pagination: {
|
|
413
|
-
offset:
|
|
407
|
+
offset: p.offset
|
|
414
408
|
}
|
|
415
409
|
} : null
|
|
416
410
|
};
|
|
417
411
|
return o.value = {
|
|
418
412
|
status: ve.Idle,
|
|
419
|
-
response:
|
|
420
|
-
},
|
|
421
|
-
} catch (
|
|
422
|
-
const
|
|
413
|
+
response: v
|
|
414
|
+
}, v;
|
|
415
|
+
} catch (d) {
|
|
416
|
+
const c = {
|
|
423
417
|
data: [],
|
|
424
418
|
total: 0
|
|
425
419
|
};
|
|
426
|
-
return
|
|
420
|
+
return s.query && (((u = d.response) == null ? void 0 : u.status) === 404 || d.status === 404) ? (o.value = {
|
|
427
421
|
status: ve.NoResults,
|
|
428
|
-
response:
|
|
429
|
-
error:
|
|
430
|
-
},
|
|
422
|
+
response: c,
|
|
423
|
+
error: d.response ? d : { response: d }
|
|
424
|
+
}, c) : (o.value = {
|
|
431
425
|
status: ve.Error,
|
|
432
|
-
response:
|
|
433
|
-
error:
|
|
434
|
-
},
|
|
426
|
+
response: c,
|
|
427
|
+
error: d.response ? d : { response: d }
|
|
428
|
+
}, c);
|
|
435
429
|
}
|
|
436
430
|
}, fetcherState: o };
|
|
437
431
|
}
|
|
@@ -502,7 +496,7 @@ function hr(e) {
|
|
|
502
496
|
return Ae(e, (a) => {
|
|
503
497
|
a && !r.value && (t.value = a.offsetWidth, n.value = a.scrollWidth, r.value = !0);
|
|
504
498
|
}), {
|
|
505
|
-
isTruncated:
|
|
499
|
+
isTruncated: k(() => t.value < n.value)
|
|
506
500
|
};
|
|
507
501
|
}
|
|
508
502
|
function mr() {
|
|
@@ -545,10 +539,10 @@ const z = {
|
|
|
545
539
|
}
|
|
546
540
|
},
|
|
547
541
|
setup(e) {
|
|
548
|
-
const t = e, { i18n: { t: n } } = z.useI18n(), { convertKeyToTitle: r } = z.useStringHelpers(), i =
|
|
542
|
+
const t = e, { i18n: { t: n } } = z.useI18n(), { convertKeyToTitle: r } = z.useStringHelpers(), i = k(() => t.item.key ?? "json-array-item"), a = k(() => t.item.value ?? t.item), o = k(() => {
|
|
549
543
|
const s = JSON.parse(JSON.stringify(a.value));
|
|
550
544
|
return t.isArrayItem && delete s.name, s;
|
|
551
|
-
}), l =
|
|
545
|
+
}), l = k(() => {
|
|
552
546
|
var s;
|
|
553
547
|
return t.isArrayItem ? (s = a.value) != null && s.name ? r(a.value.name, "_") : n("baseConfigCard.general.entryTitle", { index: t.index }) : "";
|
|
554
548
|
});
|
|
@@ -654,7 +648,7 @@ const z = {
|
|
|
654
648
|
"5036b738": u.value && l.value ? "100%" : n.slim ? "50%" : "25%",
|
|
655
649
|
"5038fd13": u.value && l.value ? "100%" : n.slim ? "50%" : "75%"
|
|
656
650
|
}));
|
|
657
|
-
const n = e, r = t, i = Ze(), { i18n: { t: a, formatUnixTimeStamp: o } } = z.useI18n(), l =
|
|
651
|
+
const n = e, r = t, i = Ze(), { i18n: { t: a, formatUnixTimeStamp: o } } = z.useI18n(), l = k(() => n.item.value !== void 0 && n.item.value !== null && n.item.value !== ""), s = k(() => !!(n.item.tooltip || i["label-tooltip"])), u = k(() => n.item.type === P.Json || n.item.type === P.JsonArray), d = k(() => n.item.type === P.JsonArray), c = k(() => {
|
|
658
652
|
switch (n.item.type) {
|
|
659
653
|
case P.ID:
|
|
660
654
|
return {
|
|
@@ -765,15 +759,15 @@ const z = {
|
|
|
765
759
|
};
|
|
766
760
|
}
|
|
767
761
|
}), p = R(), { isTruncated: f } = z.useTruncationDetector(p);
|
|
768
|
-
return (b,
|
|
769
|
-
const
|
|
762
|
+
return (b, v) => {
|
|
763
|
+
const A = B("KLabel"), M = B("KBadge"), E = B("KCopy"), ee = B("KTooltip");
|
|
770
764
|
return h(), S("div", Tr, [
|
|
771
765
|
L("div", {
|
|
772
766
|
class: "config-card-details-label",
|
|
773
767
|
"data-testid": `${e.item.key}-label`
|
|
774
768
|
}, [
|
|
775
769
|
Y(b.$slots, "label", { item: e.item }, () => [
|
|
776
|
-
N(
|
|
770
|
+
N(A, { "tooltip-attributes": { maxWidth: "500px" } }, _e({
|
|
777
771
|
default: x(() => [
|
|
778
772
|
V(O(e.item.label) + " ", 1)
|
|
779
773
|
]),
|
|
@@ -809,10 +803,10 @@ const z = {
|
|
|
809
803
|
key: 0,
|
|
810
804
|
"data-testid": `${e.item.key}-badge-tags`
|
|
811
805
|
}, [
|
|
812
|
-
(h(!0), S(le, null, ie(e.item.value, (m,
|
|
813
|
-
key: `${e.item.key}-badge-tag-${
|
|
806
|
+
(h(!0), S(le, null, ie(e.item.value, (m, y) => (h(), K(M, {
|
|
807
|
+
key: `${e.item.key}-badge-tag-${y}`,
|
|
814
808
|
class: "config-badge",
|
|
815
|
-
"data-testid": `${e.item.key}-badge-tag-${
|
|
809
|
+
"data-testid": `${e.item.key}-badge-tag-${y}`,
|
|
816
810
|
tooltip: m,
|
|
817
811
|
"truncation-tooltip": ""
|
|
818
812
|
}, {
|
|
@@ -827,9 +821,9 @@ const z = {
|
|
|
827
821
|
class: "copy-uuid-array",
|
|
828
822
|
"data-testid": `${e.item.key}-copy-uuid-array`
|
|
829
823
|
}, [
|
|
830
|
-
(h(!0), S(le, null, ie(e.item.value, (m,
|
|
831
|
-
key: `${e.item.key}-copy-uuid-${
|
|
832
|
-
"data-testid": `${e.item.key}-copy-uuid-${
|
|
824
|
+
(h(!0), S(le, null, ie(e.item.value, (m, y) => (h(), K(E, Fn(c.value.childAttrs, {
|
|
825
|
+
key: `${e.item.key}-copy-uuid-${y}`,
|
|
826
|
+
"data-testid": `${e.item.key}-copy-uuid-${y}`,
|
|
833
827
|
text: m
|
|
834
828
|
}), null, 16, ["data-testid", "text"]))), 128))
|
|
835
829
|
], 8, Rr)) : c.value.additionalComponent === "KMethodBadge" ? (h(), S("div", {
|
|
@@ -837,11 +831,11 @@ const z = {
|
|
|
837
831
|
class: "method-badge-array",
|
|
838
832
|
"data-testid": `${e.item.key}-badge-methods`
|
|
839
833
|
}, [
|
|
840
|
-
(h(!0), S(le, null, ie(e.item.value, (m,
|
|
841
|
-
key: `${e.item.key}-badge-method-${
|
|
834
|
+
(h(!0), S(le, null, ie(e.item.value, (m, y) => (h(), K(M, {
|
|
835
|
+
key: `${e.item.key}-badge-method-${y}`,
|
|
842
836
|
appearance: Object.values(I(Kn)).includes(m.toLowerCase()) ? m.toLowerCase() : "custom",
|
|
843
837
|
class: "config-badge",
|
|
844
|
-
"data-testid": `${e.item.key}-badge-method-${
|
|
838
|
+
"data-testid": `${e.item.key}-badge-method-${y}`
|
|
845
839
|
}, {
|
|
846
840
|
default: x(() => [
|
|
847
841
|
V(O(m), 1)
|
|
@@ -853,9 +847,9 @@ const z = {
|
|
|
853
847
|
key: 3,
|
|
854
848
|
"data-testid": `${n.item.key}-json-array-content`
|
|
855
849
|
}, [
|
|
856
|
-
(h(!0), S(le, null, ie(e.item.value, (m,
|
|
857
|
-
key: `json-array-item-${
|
|
858
|
-
index:
|
|
850
|
+
(h(!0), S(le, null, ie(e.item.value, (m, y) => (h(), K(Bt, {
|
|
851
|
+
key: `json-array-item-${y}`,
|
|
852
|
+
index: y,
|
|
859
853
|
"is-array-item": "",
|
|
860
854
|
item: m
|
|
861
855
|
}, null, 8, ["index", "item"]))), 128))
|
|
@@ -918,7 +912,7 @@ const z = {
|
|
|
918
912
|
Tt((i) => ({
|
|
919
913
|
"954d3eca": `${r.value}ch`
|
|
920
914
|
}));
|
|
921
|
-
const t = e, n =
|
|
915
|
+
const t = e, n = k(() => t.jsonRecord), r = k(() => {
|
|
922
916
|
var o;
|
|
923
917
|
if (!t.fetcherUrl)
|
|
924
918
|
return 0;
|
|
@@ -1750,7 +1744,7 @@ function ea(e, t) {
|
|
|
1750
1744
|
C(e, "unexpected end of the stream within a double quoted scalar");
|
|
1751
1745
|
}
|
|
1752
1746
|
function ta(e, t) {
|
|
1753
|
-
var n = !0, r, i, a, o = e.tag, l, s = e.anchor, u, d, c, p, f, b = /* @__PURE__ */ Object.create(null),
|
|
1747
|
+
var n = !0, r, i, a, o = e.tag, l, s = e.anchor, u, d, c, p, f, b = /* @__PURE__ */ Object.create(null), v, A, M, E;
|
|
1754
1748
|
if (E = e.input.charCodeAt(e.position), E === 91)
|
|
1755
1749
|
d = 93, f = !1, l = [];
|
|
1756
1750
|
else if (E === 123)
|
|
@@ -1760,7 +1754,7 @@ function ta(e, t) {
|
|
|
1760
1754
|
for (e.anchor !== null && (e.anchorMap[e.anchor] = l), E = e.input.charCodeAt(++e.position); E !== 0; ) {
|
|
1761
1755
|
if (W(e, !0, t), E = e.input.charCodeAt(e.position), E === d)
|
|
1762
1756
|
return e.position++, e.tag = o, e.anchor = s, e.kind = f ? "mapping" : "sequence", e.result = l, !0;
|
|
1763
|
-
n ? E === 44 && C(e, "expected the node content, but found ','") : C(e, "missed comma between flow collection entries"),
|
|
1757
|
+
n ? E === 44 && C(e, "expected the node content, but found ','") : C(e, "missed comma between flow collection entries"), A = v = M = null, c = p = !1, E === 63 && (u = e.input.charCodeAt(e.position + 1), te(u) && (c = p = !0, e.position++, W(e, !0, t))), r = e.line, i = e.lineStart, a = e.position, ke(e, t, Ne, !1, !0), A = e.tag, v = e.result, W(e, !0, t), E = e.input.charCodeAt(e.position), (p || e.line === r) && E === 58 && (c = !0, E = e.input.charCodeAt(++e.position), W(e, !0, t), ke(e, t, Ne, !1, !0), M = e.result), f ? Ce(e, l, b, A, v, M, r, i, a) : c ? l.push(Ce(e, null, b, A, v, M, r, i, a)) : l.push(v), W(e, !0, t), E = e.input.charCodeAt(e.position), E === 44 ? (n = !0, E = e.input.charCodeAt(++e.position)) : n = !1;
|
|
1764
1758
|
}
|
|
1765
1759
|
C(e, "unexpected end of the stream within a flow collection");
|
|
1766
1760
|
}
|
|
@@ -1828,12 +1822,12 @@ function bt(e, t) {
|
|
|
1828
1822
|
return l ? (e.tag = r, e.anchor = i, e.kind = "sequence", e.result = a, !0) : !1;
|
|
1829
1823
|
}
|
|
1830
1824
|
function ra(e, t, n) {
|
|
1831
|
-
var r, i, a, o, l, s, u = e.tag, d = e.anchor, c = {}, p = /* @__PURE__ */ Object.create(null), f = null, b = null,
|
|
1825
|
+
var r, i, a, o, l, s, u = e.tag, d = e.anchor, c = {}, p = /* @__PURE__ */ Object.create(null), f = null, b = null, v = null, A = !1, M = !1, E;
|
|
1832
1826
|
if (e.firstTabInLine !== -1)
|
|
1833
1827
|
return !1;
|
|
1834
1828
|
for (e.anchor !== null && (e.anchorMap[e.anchor] = c), E = e.input.charCodeAt(e.position); E !== 0; ) {
|
|
1835
|
-
if (!
|
|
1836
|
-
E === 63 ? (
|
|
1829
|
+
if (!A && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, C(e, "tab characters must not be used in indentation")), r = e.input.charCodeAt(e.position + 1), a = e.line, (E === 63 || E === 58) && te(r))
|
|
1830
|
+
E === 63 ? (A && (Ce(e, c, p, f, b, null, o, l, s), f = b = v = null), M = !0, A = !0, i = !0) : A ? (A = !1, i = !0) : C(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, E = r;
|
|
1837
1831
|
else {
|
|
1838
1832
|
if (o = e.line, l = e.lineStart, s = e.position, !ke(e, n, on, !1, !0))
|
|
1839
1833
|
break;
|
|
@@ -1841,7 +1835,7 @@ function ra(e, t, n) {
|
|
|
1841
1835
|
for (E = e.input.charCodeAt(e.position); ge(E); )
|
|
1842
1836
|
E = e.input.charCodeAt(++e.position);
|
|
1843
1837
|
if (E === 58)
|
|
1844
|
-
E = e.input.charCodeAt(++e.position), te(E) || C(e, "a whitespace character is expected after the key-value separator within a block mapping"),
|
|
1838
|
+
E = e.input.charCodeAt(++e.position), te(E) || C(e, "a whitespace character is expected after the key-value separator within a block mapping"), A && (Ce(e, c, p, f, b, null, o, l, s), f = b = v = null), M = !0, A = !1, i = !1, f = e.tag, b = e.result;
|
|
1845
1839
|
else if (M)
|
|
1846
1840
|
C(e, "can not read an implicit mapping pair; a colon is missed");
|
|
1847
1841
|
else
|
|
@@ -1851,12 +1845,12 @@ function ra(e, t, n) {
|
|
|
1851
1845
|
else
|
|
1852
1846
|
return e.tag = u, e.anchor = d, !0;
|
|
1853
1847
|
}
|
|
1854
|
-
if ((e.line === a || e.lineIndent > t) && (
|
|
1848
|
+
if ((e.line === a || e.lineIndent > t) && (A && (o = e.line, l = e.lineStart, s = e.position), ke(e, t, Be, !0, i) && (A ? b = e.result : v = e.result), A || (Ce(e, c, p, f, b, v, o, l, s), f = b = v = null), W(e, !0, -1), E = e.input.charCodeAt(e.position)), (e.line === a || e.lineIndent > t) && E !== 0)
|
|
1855
1849
|
C(e, "bad indentation of a mapping entry");
|
|
1856
1850
|
else if (e.lineIndent < t)
|
|
1857
1851
|
break;
|
|
1858
1852
|
}
|
|
1859
|
-
return
|
|
1853
|
+
return A && Ce(e, c, p, f, b, null, o, l, s), M && (e.tag = u, e.anchor = d, e.kind = "mapping", e.result = c), M;
|
|
1860
1854
|
}
|
|
1861
1855
|
function ia(e) {
|
|
1862
1856
|
var t, n = !1, r = !1, i, a, o;
|
|
@@ -1897,11 +1891,11 @@ function oa(e) {
|
|
|
1897
1891
|
return e.position === t && C(e, "name of an alias node must contain at least one character"), n = e.input.slice(t, e.position), de.call(e.anchorMap, n) || C(e, 'unidentified alias "' + n + '"'), e.result = e.anchorMap[n], W(e, !0, -1), !0;
|
|
1898
1892
|
}
|
|
1899
1893
|
function ke(e, t, n, r, i) {
|
|
1900
|
-
var a, o, l, s = 1, u = !1, d = !1, c, p, f, b,
|
|
1894
|
+
var a, o, l, s = 1, u = !1, d = !1, c, p, f, b, v, A;
|
|
1901
1895
|
if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, a = o = l = Be === n || ln === n, r && W(e, !0, -1) && (u = !0, e.lineIndent > t ? s = 1 : e.lineIndent === t ? s = 0 : e.lineIndent < t && (s = -1)), s === 1)
|
|
1902
1896
|
for (; ia(e) || aa(e); )
|
|
1903
1897
|
W(e, !0, -1) ? (u = !0, l = a, e.lineIndent > t ? s = 1 : e.lineIndent === t ? s = 0 : e.lineIndent < t && (s = -1)) : l = !1;
|
|
1904
|
-
if (l && (l = u || i), (s === 1 || Be === n) && (Ne === n || on === n ?
|
|
1898
|
+
if (l && (l = u || i), (s === 1 || Be === n) && (Ne === n || on === n ? v = t : v = t + 1, A = e.position - e.lineStart, s === 1 ? l && (bt(e, A) || ra(e, A, v)) || ta(e, v) ? d = !0 : (o && na(e, v) || Xi(e, v) || ea(e, v) ? d = !0 : oa(e) ? (d = !0, (e.tag !== null || e.anchor !== null) && C(e, "alias node should not have any properties")) : Qi(e, v, Ne === n) && (d = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : s === 0 && (d = l && bt(e, A))), e.tag === null)
|
|
1905
1899
|
e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
|
|
1906
1900
|
else if (e.tag === "?") {
|
|
1907
1901
|
for (e.result !== null && e.kind !== "scalar" && C(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), c = 0, p = e.implicitTypes.length; c < p; c += 1)
|
|
@@ -2093,12 +2087,12 @@ function _n(e) {
|
|
|
2093
2087
|
}
|
|
2094
2088
|
var kn = 1, Je = 2, An = 3, wn = 4, be = 5;
|
|
2095
2089
|
function Ka(e, t, n, r, i, a, o, l) {
|
|
2096
|
-
var s, u = 0, d = null, c = !1, p = !1, f = r !== -1, b = -1,
|
|
2090
|
+
var s, u = 0, d = null, c = !1, p = !1, f = r !== -1, b = -1, v = Ba(we(e, 0)) && Ra(we(e, e.length - 1));
|
|
2097
2091
|
if (t || o)
|
|
2098
2092
|
for (s = 0; s < e.length; u >= 65536 ? s += 2 : s++) {
|
|
2099
2093
|
if (u = we(e, s), !Te(u))
|
|
2100
2094
|
return be;
|
|
2101
|
-
|
|
2095
|
+
v = v && _t(u, d, l), d = u;
|
|
2102
2096
|
}
|
|
2103
2097
|
else {
|
|
2104
2098
|
for (s = 0; s < e.length; u >= 65536 ? s += 2 : s++) {
|
|
@@ -2107,11 +2101,11 @@ function Ka(e, t, n, r, i, a, o, l) {
|
|
|
2107
2101
|
s - b - 1 > r && e[b + 1] !== " ", b = s);
|
|
2108
2102
|
else if (!Te(u))
|
|
2109
2103
|
return be;
|
|
2110
|
-
|
|
2104
|
+
v = v && _t(u, d, l), d = u;
|
|
2111
2105
|
}
|
|
2112
2106
|
p = p || f && s - b - 1 > r && e[b + 1] !== " ";
|
|
2113
2107
|
}
|
|
2114
|
-
return !c && !p ?
|
|
2108
|
+
return !c && !p ? v && !o && !i(e) ? kn : a === Ee ? be : Je : n > 9 && _n(e) ? be : o ? a === Ee ? be : Je : p ? wn : An;
|
|
2115
2109
|
}
|
|
2116
2110
|
function Ma(e, t, n, r, i) {
|
|
2117
2111
|
e.dump = function() {
|
|
@@ -2336,7 +2330,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2336
2330
|
}
|
|
2337
2331
|
},
|
|
2338
2332
|
setup(e) {
|
|
2339
|
-
const t = e, n =
|
|
2333
|
+
const t = e, n = k(() => {
|
|
2340
2334
|
const r = Object.fromEntries(Object.entries(t.yamlRecord).filter(([, i]) => i && (Array.isArray(i) ? i.length !== 0 : !0)));
|
|
2341
2335
|
return Object.keys(r).length === 0 && r.constructor === Object ? "" : so.dump(r).trim();
|
|
2342
2336
|
});
|
|
@@ -2398,7 +2392,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2398
2392
|
}
|
|
2399
2393
|
},
|
|
2400
2394
|
setup(e) {
|
|
2401
|
-
const t = e, n = Ze(), { i18n: { t: r } } = z.useI18n(), i = (o) => !!(o.tooltip || n[`${o.key}-label-tooltip`]), a =
|
|
2395
|
+
const t = e, n = Ze(), { i18n: { t: r } } = z.useI18n(), i = (o) => !!(o.tooltip || n[`${o.key}-label-tooltip`]), a = k(() => {
|
|
2402
2396
|
if (!t.record)
|
|
2403
2397
|
return t.record;
|
|
2404
2398
|
const o = JSON.parse(JSON.stringify(t.record));
|
|
@@ -2513,7 +2507,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2513
2507
|
}
|
|
2514
2508
|
},
|
|
2515
2509
|
setup(e) {
|
|
2516
|
-
const t = e, n =
|
|
2510
|
+
const t = e, n = k(() => {
|
|
2517
2511
|
if (typeof t.size == "number" && t.size > 0)
|
|
2518
2512
|
return `${t.size}px`;
|
|
2519
2513
|
if (typeof t.size == "string") {
|
|
@@ -2522,7 +2516,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2522
2516
|
return `${a}px`;
|
|
2523
2517
|
}
|
|
2524
2518
|
return oe;
|
|
2525
|
-
}), r =
|
|
2519
|
+
}), r = k(() => ({
|
|
2526
2520
|
boxSizing: "border-box",
|
|
2527
2521
|
color: t.color,
|
|
2528
2522
|
display: t.display,
|
|
@@ -2612,7 +2606,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2612
2606
|
}
|
|
2613
2607
|
},
|
|
2614
2608
|
setup(e) {
|
|
2615
|
-
const t = e, n =
|
|
2609
|
+
const t = e, n = k(() => {
|
|
2616
2610
|
if (typeof t.size == "number" && t.size > 0)
|
|
2617
2611
|
return `${t.size}px`;
|
|
2618
2612
|
if (typeof t.size == "string") {
|
|
@@ -2621,7 +2615,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2621
2615
|
return `${a}px`;
|
|
2622
2616
|
}
|
|
2623
2617
|
return oe;
|
|
2624
|
-
}), r =
|
|
2618
|
+
}), r = k(() => ({
|
|
2625
2619
|
boxSizing: "border-box",
|
|
2626
2620
|
color: t.color,
|
|
2627
2621
|
display: t.display,
|
|
@@ -2711,7 +2705,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2711
2705
|
}
|
|
2712
2706
|
},
|
|
2713
2707
|
setup(e) {
|
|
2714
|
-
const t = e, n =
|
|
2708
|
+
const t = e, n = k(() => {
|
|
2715
2709
|
if (typeof t.size == "number" && t.size > 0)
|
|
2716
2710
|
return `${t.size}px`;
|
|
2717
2711
|
if (typeof t.size == "string") {
|
|
@@ -2720,7 +2714,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2720
2714
|
return `${a}px`;
|
|
2721
2715
|
}
|
|
2722
2716
|
return oe;
|
|
2723
|
-
}), r =
|
|
2717
|
+
}), r = k(() => ({
|
|
2724
2718
|
boxSizing: "border-box",
|
|
2725
2719
|
color: t.color,
|
|
2726
2720
|
display: t.display,
|
|
@@ -2810,7 +2804,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2810
2804
|
}
|
|
2811
2805
|
},
|
|
2812
2806
|
setup(e) {
|
|
2813
|
-
const t = e, n =
|
|
2807
|
+
const t = e, n = k(() => {
|
|
2814
2808
|
if (typeof t.size == "number" && t.size > 0)
|
|
2815
2809
|
return `${t.size}px`;
|
|
2816
2810
|
if (typeof t.size == "string") {
|
|
@@ -2819,7 +2813,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2819
2813
|
return `${a}px`;
|
|
2820
2814
|
}
|
|
2821
2815
|
return oe;
|
|
2822
|
-
}), r =
|
|
2816
|
+
}), r = k(() => ({
|
|
2823
2817
|
boxSizing: "border-box",
|
|
2824
2818
|
color: t.color,
|
|
2825
2819
|
display: t.display,
|
|
@@ -2909,7 +2903,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2909
2903
|
}
|
|
2910
2904
|
},
|
|
2911
2905
|
setup(e) {
|
|
2912
|
-
const t = e, n =
|
|
2906
|
+
const t = e, n = k(() => {
|
|
2913
2907
|
if (typeof t.size == "number" && t.size > 0)
|
|
2914
2908
|
return `${t.size}px`;
|
|
2915
2909
|
if (typeof t.size == "string") {
|
|
@@ -2918,7 +2912,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
2918
2912
|
return `${a}px`;
|
|
2919
2913
|
}
|
|
2920
2914
|
return oe;
|
|
2921
|
-
}), r =
|
|
2915
|
+
}), r = k(() => ({
|
|
2922
2916
|
boxSizing: "border-box",
|
|
2923
2917
|
color: t.color,
|
|
2924
2918
|
display: t.display,
|
|
@@ -3031,10 +3025,8 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3031
3025
|
},
|
|
3032
3026
|
emits: ["loading", "fetch:success", "fetch:error"],
|
|
3033
3027
|
setup(e, { emit: t }) {
|
|
3034
|
-
var
|
|
3035
|
-
const n = t, r = e, { i18n: { t: i } } = z.useI18n(), { getMessageFromError: a } = z.useErrors(), { convertKeyToTitle: o } = z.useStringHelpers(), { axiosInstance: l } = z.useAxios(
|
|
3036
|
-
headers: (v = r.config) == null ? void 0 : v.requestHeaders
|
|
3037
|
-
}), s = [
|
|
3028
|
+
var y;
|
|
3029
|
+
const n = t, r = e, { i18n: { t: i } } = z.useI18n(), { getMessageFromError: a } = z.useErrors(), { convertKeyToTitle: o } = z.useStringHelpers(), { axiosInstance: l } = z.useAxios((y = r.config) == null ? void 0 : y.axiosRequestConfig), s = [
|
|
3038
3030
|
{
|
|
3039
3031
|
label: i("baseConfigCard.general.structuredFormat"),
|
|
3040
3032
|
value: "structured",
|
|
@@ -3048,8 +3040,8 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3048
3040
|
label: "YAML",
|
|
3049
3041
|
value: "yaml"
|
|
3050
3042
|
}
|
|
3051
|
-
], u = R("structured"), d = (
|
|
3052
|
-
u.value =
|
|
3043
|
+
], u = R("structured"), d = (g) => {
|
|
3044
|
+
u.value = g == null ? void 0 : g.value;
|
|
3053
3045
|
}, c = {
|
|
3054
3046
|
id: {
|
|
3055
3047
|
type: P.ID,
|
|
@@ -3084,21 +3076,21 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3084
3076
|
// the last property displayed
|
|
3085
3077
|
section: ne.Basic
|
|
3086
3078
|
}
|
|
3087
|
-
}, p = R(!1), f = R(!1), b = R(""),
|
|
3088
|
-
var F,
|
|
3089
|
-
if (!
|
|
3079
|
+
}, p = R(!1), f = R(!1), b = R(""), v = R({}), A = k(() => {
|
|
3080
|
+
var F, _, j;
|
|
3081
|
+
if (!v.value)
|
|
3090
3082
|
return [];
|
|
3091
|
-
const
|
|
3092
|
-
for (const T in
|
|
3093
|
-
const w = (
|
|
3083
|
+
const g = [], $ = Object.keys(v.value).length;
|
|
3084
|
+
for (const T in v.value) {
|
|
3085
|
+
const w = (_ = (F = r.configSchema) == null ? void 0 : F[T]) == null ? void 0 : _.order, U = (j = c[T]) == null ? void 0 : j.order;
|
|
3094
3086
|
let q = $;
|
|
3095
|
-
(U || U === 0) && (q = U === -1 ? $ + 1 : U), w && (q = w === -1 ? $ + 1 : w),
|
|
3087
|
+
(U || U === 0) && (q = U === -1 ? $ + 1 : U), w && (q = w === -1 ? $ + 1 : w), g.push([T, q]);
|
|
3096
3088
|
}
|
|
3097
|
-
return
|
|
3089
|
+
return g.sort(function(T, w) {
|
|
3098
3090
|
return T[1] - w[1];
|
|
3099
|
-
}),
|
|
3091
|
+
}), g.map((T) => {
|
|
3100
3092
|
var pe, at;
|
|
3101
|
-
const w = T[0], U = (pe =
|
|
3093
|
+
const w = T[0], U = (pe = v.value) == null ? void 0 : pe[w], q = ((at = r.configSchema) == null ? void 0 : at[w]) || {}, J = c[w];
|
|
3102
3094
|
return {
|
|
3103
3095
|
key: w,
|
|
3104
3096
|
value: U,
|
|
@@ -3109,13 +3101,13 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3109
3101
|
section: q.section ?? ((J == null ? void 0 : J.section) || ne.Advanced)
|
|
3110
3102
|
};
|
|
3111
3103
|
}).filter((T) => !T.hidden && T.key !== r.pluginConfigKey);
|
|
3112
|
-
}), M =
|
|
3113
|
-
var
|
|
3114
|
-
if (!
|
|
3104
|
+
}), M = k(() => {
|
|
3105
|
+
var _, j;
|
|
3106
|
+
if (!v.value || !r.pluginConfigKey)
|
|
3115
3107
|
return [];
|
|
3116
|
-
const
|
|
3117
|
-
for (const T in
|
|
3118
|
-
const w = (j = (
|
|
3108
|
+
const g = v.value[r.pluginConfigKey] || {}, $ = Object.keys(g).length, F = [];
|
|
3109
|
+
for (const T in g) {
|
|
3110
|
+
const w = (j = (_ = r.pluginConfigSchema) == null ? void 0 : _[T]) == null ? void 0 : j.order, U = g[T];
|
|
3119
3111
|
let q = U != null && U !== "" ? $ - 1 : $;
|
|
3120
3112
|
w && (q = w === -1 ? $ + 1 : w), F.push([T, q]);
|
|
3121
3113
|
}
|
|
@@ -3123,7 +3115,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3123
3115
|
return T[1] - w[1];
|
|
3124
3116
|
}), F.map((T) => {
|
|
3125
3117
|
var J;
|
|
3126
|
-
const w = T[0], U =
|
|
3118
|
+
const w = T[0], U = g[w], q = ((J = r.pluginConfigSchema) == null ? void 0 : J[w]) || {};
|
|
3127
3119
|
return {
|
|
3128
3120
|
key: w,
|
|
3129
3121
|
value: U,
|
|
@@ -3134,52 +3126,52 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3134
3126
|
section: ne.Plugin
|
|
3135
3127
|
};
|
|
3136
3128
|
}).filter((T) => !T.hidden);
|
|
3137
|
-
}), E =
|
|
3138
|
-
var
|
|
3129
|
+
}), E = k(() => {
|
|
3130
|
+
var g, $, F, _;
|
|
3139
3131
|
return {
|
|
3140
|
-
basic: (
|
|
3141
|
-
advanced: ($ =
|
|
3142
|
-
plugin: (
|
|
3132
|
+
basic: (g = A.value) == null ? void 0 : g.filter((j) => j.section === ne.Basic),
|
|
3133
|
+
advanced: ($ = A.value) == null ? void 0 : $.filter((j) => j.section === ne.Advanced),
|
|
3134
|
+
plugin: (_ = M.value) == null ? void 0 : _.concat((F = A.value) == null ? void 0 : F.filter((j) => j.section === ne.Plugin))
|
|
3143
3135
|
};
|
|
3144
|
-
}), ee =
|
|
3145
|
-
const
|
|
3146
|
-
return E.value.basic.length &&
|
|
3147
|
-
}), m =
|
|
3136
|
+
}), ee = k(() => {
|
|
3137
|
+
const g = [];
|
|
3138
|
+
return E.value.basic.length && g.push("basic"), E.value.advanced.length && g.push("advanced"), E.value.plugin.length && g.push("plugin"), g;
|
|
3139
|
+
}), m = k(() => {
|
|
3148
3140
|
var $, F;
|
|
3149
|
-
let
|
|
3150
|
-
return r.config.app === "konnect" ?
|
|
3141
|
+
let g = `${r.config.apiBaseUrl}${r.fetchUrl}`;
|
|
3142
|
+
return r.config.app === "konnect" ? g = g.replace(/{controlPlaneId}/gi, (($ = r.config) == null ? void 0 : $.controlPlaneId) || "") : r.config.app === "kongManager" && (g = g.replace(/\/{workspace}/gi, (F = r.config) != null && F.workspace ? `/${r.config.workspace}` : "")), g = g.replace(/{id}/gi, r.config.entityId), g;
|
|
3151
3143
|
});
|
|
3152
|
-
return Ae(p, (
|
|
3153
|
-
n("loading",
|
|
3144
|
+
return Ae(p, (g) => {
|
|
3145
|
+
n("loading", g);
|
|
3154
3146
|
}, { immediate: !0 }), Ft(async () => {
|
|
3155
3147
|
f.value = !1, p.value = !0;
|
|
3156
3148
|
try {
|
|
3157
|
-
const { data:
|
|
3149
|
+
const { data: g } = await l.get(m.value);
|
|
3158
3150
|
if (r.dataKey)
|
|
3159
|
-
if (typeof
|
|
3160
|
-
|
|
3151
|
+
if (typeof g[r.dataKey] < "u")
|
|
3152
|
+
v.value = { ...g[r.dataKey] };
|
|
3161
3153
|
else
|
|
3162
3154
|
throw new Error(i("errors.dataKeyUndefined", { dataKey: r.dataKey }));
|
|
3163
3155
|
else
|
|
3164
|
-
|
|
3156
|
+
v.value = { ...g };
|
|
3165
3157
|
Object.keys(r.configSchema).filter((F) => r.configSchema[F].forceShow).forEach((F) => {
|
|
3166
|
-
|
|
3167
|
-
}), n("fetch:success",
|
|
3168
|
-
} catch (
|
|
3169
|
-
const $ = a(
|
|
3170
|
-
b.value = $.startsWith("code") ? i("baseConfigCard.errors.load") : $, f.value = !0, n("fetch:error",
|
|
3158
|
+
v.value && typeof v.value[F] > "u" && (v.value[F] = null);
|
|
3159
|
+
}), n("fetch:success", g);
|
|
3160
|
+
} catch (g) {
|
|
3161
|
+
const $ = a(g);
|
|
3162
|
+
b.value = $.startsWith("code") ? i("baseConfigCard.errors.load") : $, f.value = !0, n("fetch:error", g);
|
|
3171
3163
|
} finally {
|
|
3172
3164
|
p.value = !1;
|
|
3173
3165
|
}
|
|
3174
|
-
}), (
|
|
3175
|
-
const F = B("KLabel"),
|
|
3166
|
+
}), (g, $) => {
|
|
3167
|
+
const F = B("KLabel"), _ = B("KSelect"), j = B("KButton"), T = B("KSkeleton"), w = B("KEmptyState"), U = B("KCard");
|
|
3176
3168
|
return h(), K(U, {
|
|
3177
3169
|
class: "kong-ui-entity-base-config-card",
|
|
3178
3170
|
"title-tag": e.titleTag
|
|
3179
3171
|
}, _e({
|
|
3180
3172
|
actions: x(() => [
|
|
3181
3173
|
L("div", zo, [
|
|
3182
|
-
Y(
|
|
3174
|
+
Y(g.$slots, "actions", {}, void 0, !0),
|
|
3183
3175
|
N(F, {
|
|
3184
3176
|
class: "config-format-select-label",
|
|
3185
3177
|
"data-testid": "config-format-select-label"
|
|
@@ -3189,7 +3181,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3189
3181
|
]),
|
|
3190
3182
|
_: 1
|
|
3191
3183
|
}),
|
|
3192
|
-
N(
|
|
3184
|
+
N(_, {
|
|
3193
3185
|
"data-testid": "select-config-format",
|
|
3194
3186
|
items: s,
|
|
3195
3187
|
onChange: d
|
|
@@ -3236,12 +3228,12 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3236
3228
|
format: u.value,
|
|
3237
3229
|
"prop-list-types": ee.value,
|
|
3238
3230
|
"property-collections": E.value,
|
|
3239
|
-
record:
|
|
3231
|
+
record: v.value
|
|
3240
3232
|
}, _e({ _: 2 }, [
|
|
3241
|
-
ie(Object.keys(
|
|
3233
|
+
ie(Object.keys(g.$slots), (q) => ({
|
|
3242
3234
|
name: q,
|
|
3243
3235
|
fn: x(({ row: J, rowValue: pe }) => [
|
|
3244
|
-
Y(
|
|
3236
|
+
Y(g.$slots, q, {
|
|
3245
3237
|
row: J,
|
|
3246
3238
|
rowValue: pe
|
|
3247
3239
|
}, void 0, !0)
|
|
@@ -3256,7 +3248,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3256
3248
|
name: "title",
|
|
3257
3249
|
fn: x(() => [
|
|
3258
3250
|
L("span", Yo, [
|
|
3259
|
-
Y(
|
|
3251
|
+
Y(g.$slots, "title", {}, () => [
|
|
3260
3252
|
V(O(I(i)("baseConfigCard.title")), 1)
|
|
3261
3253
|
], !0)
|
|
3262
3254
|
])
|
|
@@ -3266,7 +3258,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3266
3258
|
]), 1032, ["title-tag"]);
|
|
3267
3259
|
};
|
|
3268
3260
|
}
|
|
3269
|
-
}), Dl = /* @__PURE__ */ re(Go, [["__scopeId", "data-v-
|
|
3261
|
+
}), Dl = /* @__PURE__ */ re(Go, [["__scopeId", "data-v-f40a683b"]]), Zo = {
|
|
3270
3262
|
class: "form-actions",
|
|
3271
3263
|
"data-testid": "form-actions"
|
|
3272
3264
|
}, Qo = /* @__PURE__ */ H({
|
|
@@ -3324,17 +3316,15 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3324
3316
|
emits: ["loading", "fetch:success", "fetch:error", "submit", "cancel"],
|
|
3325
3317
|
setup(e, { emit: t }) {
|
|
3326
3318
|
var ee;
|
|
3327
|
-
const n = t, r = e, i = Mn(), { i18n: { t: a } } = z.useI18n(), { getMessageFromError: o } = z.useErrors(), { axiosInstance: l } = z.useAxios({
|
|
3328
|
-
|
|
3329
|
-
}), s = R(!1), u = R(!1), d = R(""), c = A(() => r.canSubmit === !1 || r.isReadonly), p = R(!1), f = A(() => {
|
|
3330
|
-
var v, y;
|
|
3319
|
+
const n = t, r = e, i = Mn(), { i18n: { t: a } } = z.useI18n(), { getMessageFromError: o } = z.useErrors(), { axiosInstance: l } = z.useAxios((ee = r.config) == null ? void 0 : ee.axiosRequestConfig), s = R(!1), u = R(!1), d = R(""), c = k(() => r.canSubmit === !1 || r.isReadonly), p = R(!1), f = k(() => {
|
|
3320
|
+
var y, g;
|
|
3331
3321
|
let m = `${r.config.apiBaseUrl}${r.fetchUrl}`;
|
|
3332
|
-
return r.config.app === "konnect" ? m = m.replace(/{controlPlaneId}/gi, ((
|
|
3322
|
+
return r.config.app === "konnect" ? m = m.replace(/{controlPlaneId}/gi, ((y = r.config) == null ? void 0 : y.controlPlaneId) || "") : r.config.app === "kongManager" && (m = m.replace(/\/{workspace}/gi, (g = r.config) != null && g.workspace ? `/${r.config.workspace}` : "")), r.editId ? (m = m.replace(/{id}/gi, r.editId), m) : (m = m.replace(/\/{id}/gi, ""), m);
|
|
3333
3323
|
}), b = () => {
|
|
3334
3324
|
p.value = !p.value;
|
|
3335
|
-
},
|
|
3336
|
-
r.config.cancelRoute ? i.push(r.config.cancelRoute) :
|
|
3337
|
-
},
|
|
3325
|
+
}, v = () => {
|
|
3326
|
+
r.config.cancelRoute ? i.push(r.config.cancelRoute) : A();
|
|
3327
|
+
}, A = () => {
|
|
3338
3328
|
n("cancel");
|
|
3339
3329
|
}, M = () => {
|
|
3340
3330
|
c.value || n("submit");
|
|
@@ -3357,16 +3347,16 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3357
3347
|
const { data: m } = await l.get(f.value);
|
|
3358
3348
|
n("fetch:success", m);
|
|
3359
3349
|
} catch (m) {
|
|
3360
|
-
const
|
|
3361
|
-
d.value =
|
|
3350
|
+
const y = o(m);
|
|
3351
|
+
d.value = y.startsWith("code") ? a("baseForm.errors.edit") : y, u.value = !0, n("fetch:error", m);
|
|
3362
3352
|
} finally {
|
|
3363
3353
|
s.value = !1;
|
|
3364
3354
|
}
|
|
3365
|
-
}), (m,
|
|
3366
|
-
const
|
|
3355
|
+
}), (m, y) => {
|
|
3356
|
+
const g = B("KSkeleton"), $ = B("KEmptyState"), F = B("KAlert"), _ = B("KButton"), j = B("KTabs"), T = B("KSlideout"), w = B("KCard");
|
|
3367
3357
|
return h(), K(w, { class: "kong-ui-entity-base-form" }, {
|
|
3368
3358
|
default: x(() => [
|
|
3369
|
-
s.value ? (h(), K(
|
|
3359
|
+
s.value ? (h(), K(g, {
|
|
3370
3360
|
key: 0,
|
|
3371
3361
|
type: "form"
|
|
3372
3362
|
})) : u.value ? (h(), K($, {
|
|
@@ -3374,7 +3364,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3374
3364
|
"action-button-text": I(a)("baseForm.actions.back"),
|
|
3375
3365
|
"data-testid": "form-fetch-error",
|
|
3376
3366
|
"icon-variant": "error",
|
|
3377
|
-
onClickAction:
|
|
3367
|
+
onClickAction: v
|
|
3378
3368
|
}, {
|
|
3379
3369
|
default: x(() => [
|
|
3380
3370
|
L("h3", null, O(d.value), 1)
|
|
@@ -3383,7 +3373,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3383
3373
|
}, 8, ["action-button-text"])) : (h(), S("form", {
|
|
3384
3374
|
key: 2,
|
|
3385
3375
|
"data-testid": "form-content",
|
|
3386
|
-
onReset: Ve(
|
|
3376
|
+
onReset: Ve(A, ["prevent"]),
|
|
3387
3377
|
onSubmit: Ve(M, ["prevent"])
|
|
3388
3378
|
}, [
|
|
3389
3379
|
Y(m.$slots, "default", {}, void 0, !0),
|
|
@@ -3395,17 +3385,17 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3395
3385
|
}, null, 8, ["message"])) : D("", !0),
|
|
3396
3386
|
L("div", Zo, [
|
|
3397
3387
|
Y(m.$slots, "form-actions", {}, () => [
|
|
3398
|
-
N(
|
|
3388
|
+
N(_, {
|
|
3399
3389
|
appearance: "tertiary",
|
|
3400
3390
|
"data-testid": "form-view-configuration",
|
|
3401
|
-
onClick:
|
|
3391
|
+
onClick: y[0] || (y[0] = (U) => b())
|
|
3402
3392
|
}, {
|
|
3403
3393
|
default: x(() => [
|
|
3404
3394
|
V(O(I(a)("baseForm.actions.viewConfiguration")), 1)
|
|
3405
3395
|
]),
|
|
3406
3396
|
_: 1
|
|
3407
3397
|
}),
|
|
3408
|
-
N(
|
|
3398
|
+
N(_, {
|
|
3409
3399
|
appearance: "secondary",
|
|
3410
3400
|
"data-testid": "form-cancel",
|
|
3411
3401
|
disabled: e.isReadonly,
|
|
@@ -3416,7 +3406,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3416
3406
|
]),
|
|
3417
3407
|
_: 1
|
|
3418
3408
|
}, 8, ["disabled"]),
|
|
3419
|
-
N(
|
|
3409
|
+
N(_, {
|
|
3420
3410
|
appearance: "primary",
|
|
3421
3411
|
"data-testid": "form-submit",
|
|
3422
3412
|
disabled: c.value,
|
|
@@ -3437,7 +3427,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3437
3427
|
"offset-top": 60,
|
|
3438
3428
|
title: I(a)("baseForm.configuration.title"),
|
|
3439
3429
|
visible: p.value,
|
|
3440
|
-
onClose:
|
|
3430
|
+
onClose: y[1] || (y[1] = (U) => b())
|
|
3441
3431
|
}, {
|
|
3442
3432
|
default: x(() => [
|
|
3443
3433
|
L("div", null, O(I(a)("baseForm.configuration.message")), 1),
|
|
@@ -3468,7 +3458,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3468
3458
|
});
|
|
3469
3459
|
};
|
|
3470
3460
|
}
|
|
3471
|
-
}), jl = /* @__PURE__ */ re(Qo, [["__scopeId", "data-v-
|
|
3461
|
+
}), jl = /* @__PURE__ */ re(Qo, [["__scopeId", "data-v-46e6a6e5"]]), Xo = {
|
|
3472
3462
|
key: 0,
|
|
3473
3463
|
"data-testid": "first-col"
|
|
3474
3464
|
}, el = /* @__PURE__ */ H({
|
|
@@ -3484,43 +3474,43 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3484
3474
|
}
|
|
3485
3475
|
},
|
|
3486
3476
|
setup(e) {
|
|
3487
|
-
const t = e, n =
|
|
3488
|
-
var
|
|
3489
|
-
return ((
|
|
3490
|
-
}), r =
|
|
3491
|
-
var
|
|
3492
|
-
return ((
|
|
3493
|
-
}), i =
|
|
3494
|
-
var
|
|
3495
|
-
const
|
|
3496
|
-
return
|
|
3477
|
+
const t = e, n = k(() => {
|
|
3478
|
+
var v;
|
|
3479
|
+
return ((v = t.rowEl) == null ? void 0 : v.querySelector(`[data-testid="${t.keyName}"]`)) || null;
|
|
3480
|
+
}), r = k(() => {
|
|
3481
|
+
var v;
|
|
3482
|
+
return ((v = n.value) == null ? void 0 : v.querySelector('[data-testid="first-col"]')) || null;
|
|
3483
|
+
}), i = k(() => {
|
|
3484
|
+
var A, M;
|
|
3485
|
+
const v = (A = t.rowEl) == null ? void 0 : A.querySelectorAll("td");
|
|
3486
|
+
return v ? ((M = v[0]) == null ? void 0 : M.getAttribute("data-testid")) === t.keyName : !1;
|
|
3497
3487
|
});
|
|
3498
3488
|
let a;
|
|
3499
3489
|
const o = () => {
|
|
3500
3490
|
a && (a.disconnect(), a = void 0);
|
|
3501
3491
|
}, l = () => {
|
|
3502
|
-
var
|
|
3503
|
-
u.value = ((
|
|
3504
|
-
}, s = R({}), u = R(0), d = R(0), c = R(""), p =
|
|
3492
|
+
var v, A, M;
|
|
3493
|
+
u.value = ((v = r.value) == null ? void 0 : v.getBoundingClientRect().width) || 0, d.value = ((A = n.value) == null ? void 0 : A.clientWidth) || 0, c.value = ((M = s.value) == null ? void 0 : M.innerText) || "";
|
|
3494
|
+
}, s = R({}), u = R(0), d = R(0), c = R(""), p = k(() => [r.value, n.value]), f = Ae(
|
|
3505
3495
|
p,
|
|
3506
|
-
(
|
|
3496
|
+
(v) => {
|
|
3507
3497
|
if (i.value && (o(), "ResizeObserver" in window && window)) {
|
|
3508
|
-
a = new ResizeObserver((
|
|
3498
|
+
a = new ResizeObserver((A) => {
|
|
3509
3499
|
window.requestAnimationFrame(() => {
|
|
3510
|
-
!Array.isArray(
|
|
3500
|
+
!Array.isArray(A) || !A.length || l();
|
|
3511
3501
|
});
|
|
3512
3502
|
});
|
|
3513
|
-
for (const
|
|
3514
|
-
|
|
3503
|
+
for (const A of v)
|
|
3504
|
+
A && a.observe(A);
|
|
3515
3505
|
}
|
|
3516
3506
|
},
|
|
3517
3507
|
{ immediate: !0, flush: "post", deep: !0 }
|
|
3518
|
-
), b =
|
|
3508
|
+
), b = k(() => i.value ? u.value > d.value : !1);
|
|
3519
3509
|
return On(() => {
|
|
3520
3510
|
l();
|
|
3521
3511
|
}), $n(() => {
|
|
3522
3512
|
f();
|
|
3523
|
-
}), (
|
|
3513
|
+
}), (v, A) => {
|
|
3524
3514
|
const M = B("KTooltip");
|
|
3525
3515
|
return h(), S("span", {
|
|
3526
3516
|
ref_key: "contentRef",
|
|
@@ -3534,11 +3524,11 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3534
3524
|
text: b.value ? c.value : ""
|
|
3535
3525
|
}, {
|
|
3536
3526
|
default: x(() => [
|
|
3537
|
-
Y(
|
|
3527
|
+
Y(v.$slots, "default", {}, void 0, !0)
|
|
3538
3528
|
]),
|
|
3539
3529
|
_: 3
|
|
3540
3530
|
}, 8, ["text"])
|
|
3541
|
-
])) : Y(
|
|
3531
|
+
])) : Y(v.$slots, "default", { key: 1 }, void 0, !0)
|
|
3542
3532
|
], 512);
|
|
3543
3533
|
};
|
|
3544
3534
|
}
|
|
@@ -3659,66 +3649,66 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3659
3649
|
},
|
|
3660
3650
|
emits: ["click:row", "sort", "clear-search-input", "empty-state-cta-clicked"],
|
|
3661
3651
|
setup(e, { emit: t }) {
|
|
3662
|
-
const n = e, r = t, { i18n: { t: i } } = z.useI18n(), a =
|
|
3663
|
-
var
|
|
3652
|
+
const n = e, r = t, { i18n: { t: i } } = z.useI18n(), a = k(() => {
|
|
3653
|
+
var y, g;
|
|
3664
3654
|
return typeof n.errorMessage == "string" ? {
|
|
3665
3655
|
hasError: !!n.errorMessage,
|
|
3666
3656
|
title: n.errorMessage,
|
|
3667
3657
|
message: void 0
|
|
3668
3658
|
} : {
|
|
3669
3659
|
hasError: !!n.errorMessage,
|
|
3670
|
-
title: (
|
|
3671
|
-
message: (
|
|
3660
|
+
title: (y = n.errorMessage) == null ? void 0 : y.title,
|
|
3661
|
+
message: (g = n.errorMessage) == null ? void 0 : g.message
|
|
3672
3662
|
};
|
|
3673
|
-
}), o =
|
|
3674
|
-
const
|
|
3663
|
+
}), o = k(() => n.cacheIdentifier || n.preferencesStorageKey), l = (y) => y.hasData || !!n.query, s = k(() => {
|
|
3664
|
+
const y = [];
|
|
3675
3665
|
return Object.keys(n.tableHeaders).forEach(($) => {
|
|
3676
3666
|
const F = n.tableHeaders[$];
|
|
3677
|
-
|
|
3667
|
+
y.push({
|
|
3678
3668
|
label: F.label ?? $,
|
|
3679
3669
|
key: $,
|
|
3680
3670
|
sortable: F.sortable ?? !1
|
|
3681
3671
|
});
|
|
3682
|
-
}), n.enableEntityActions &&
|
|
3672
|
+
}), n.enableEntityActions && y.push({
|
|
3683
3673
|
key: "actions",
|
|
3684
3674
|
hideLabel: !0
|
|
3685
|
-
}),
|
|
3686
|
-
}), u = (
|
|
3687
|
-
"data-rowid":
|
|
3688
|
-
"data-testid":
|
|
3689
|
-
...n.rowAttributes(
|
|
3690
|
-
}), d = R({}), c = (
|
|
3691
|
-
var
|
|
3692
|
-
return (
|
|
3693
|
-
}, p = (
|
|
3694
|
-
const
|
|
3695
|
-
"data-testid":
|
|
3696
|
-
...n.cellAttributes(
|
|
3675
|
+
}), y;
|
|
3676
|
+
}), u = (y) => ({
|
|
3677
|
+
"data-rowid": y.id,
|
|
3678
|
+
"data-testid": y.name,
|
|
3679
|
+
...n.rowAttributes(y)
|
|
3680
|
+
}), d = R({}), c = (y) => {
|
|
3681
|
+
var g;
|
|
3682
|
+
return (g = d.value) == null ? void 0 : g.$el.querySelector(`[data-rowid="${y.id}"]`);
|
|
3683
|
+
}, p = (y) => {
|
|
3684
|
+
const g = {
|
|
3685
|
+
"data-testid": y.headerKey,
|
|
3686
|
+
...n.cellAttributes(y)
|
|
3697
3687
|
};
|
|
3698
|
-
return
|
|
3688
|
+
return y.colIndex === 0 && (g.style = {
|
|
3699
3689
|
maxWidth: "250px",
|
|
3700
3690
|
overflowX: "hidden",
|
|
3701
3691
|
textOverflow: "ellipsis"
|
|
3702
|
-
}),
|
|
3692
|
+
}), g;
|
|
3703
3693
|
}, f = () => {
|
|
3704
3694
|
r("empty-state-cta-clicked"), b();
|
|
3705
3695
|
}, b = () => {
|
|
3706
3696
|
r("clear-search-input");
|
|
3707
|
-
},
|
|
3708
|
-
r("click:row",
|
|
3709
|
-
}),
|
|
3710
|
-
r("sort",
|
|
3711
|
-
}, { setTablePreferences: M, getTablePreferences: E } = Hn(), ee =
|
|
3712
|
-
const
|
|
3697
|
+
}, v = k(() => n.disableRowClick ? void 0 : (y, g) => {
|
|
3698
|
+
r("click:row", g);
|
|
3699
|
+
}), A = (y) => {
|
|
3700
|
+
r("sort", y);
|
|
3701
|
+
}, { setTablePreferences: M, getTablePreferences: E } = Hn(), ee = k(() => {
|
|
3702
|
+
const y = E(n.preferencesStorageKey);
|
|
3713
3703
|
return {
|
|
3714
3704
|
...n.initialFetcherParams,
|
|
3715
|
-
...
|
|
3705
|
+
...y
|
|
3716
3706
|
};
|
|
3717
|
-
}), m = (
|
|
3718
|
-
n.preferencesStorageKey && M(n.preferencesStorageKey,
|
|
3707
|
+
}), m = (y) => {
|
|
3708
|
+
n.preferencesStorageKey && M(n.preferencesStorageKey, y);
|
|
3719
3709
|
};
|
|
3720
|
-
return (
|
|
3721
|
-
const $ = B("KIcon"), F = B("KButton"),
|
|
3710
|
+
return (y, g) => {
|
|
3711
|
+
const $ = B("KIcon"), F = B("KButton"), _ = B("KDropdown"), j = B("KTable"), T = B("KCard");
|
|
3722
3712
|
return h(), K(T, {
|
|
3723
3713
|
class: "kong-ui-entity-base-table",
|
|
3724
3714
|
title: e.title,
|
|
@@ -3751,15 +3741,15 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3751
3741
|
"row-attrs": u,
|
|
3752
3742
|
"search-input": e.query,
|
|
3753
3743
|
onKtableEmptyStateCtaClicked: f,
|
|
3754
|
-
"onRow:click":
|
|
3755
|
-
onSort:
|
|
3744
|
+
"onRow:click": v.value,
|
|
3745
|
+
onSort: g[0] || (g[0] = (w) => A(w)),
|
|
3756
3746
|
"onUpdate:tablePreferences": m
|
|
3757
3747
|
}, _e({
|
|
3758
3748
|
toolbar: x(({ state: w }) => [
|
|
3759
3749
|
he(L("div", nl, [
|
|
3760
|
-
Y(
|
|
3761
|
-
|
|
3762
|
-
Y(
|
|
3750
|
+
Y(y.$slots, "toolbar-filter", {}, void 0, !0),
|
|
3751
|
+
y.$slots["toolbar-button"] ? (h(), S("div", rl, [
|
|
3752
|
+
Y(y.$slots, "toolbar-button", {}, void 0, !0)
|
|
3763
3753
|
])) : D("", !0)
|
|
3764
3754
|
], 512), [
|
|
3765
3755
|
[me, l(w)]
|
|
@@ -3770,12 +3760,12 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3770
3760
|
class: "actions-container",
|
|
3771
3761
|
"data-testid": w.name
|
|
3772
3762
|
}, [
|
|
3773
|
-
N(
|
|
3763
|
+
N(_, {
|
|
3774
3764
|
"kpop-attributes": { placement: "bottomEnd" },
|
|
3775
3765
|
width: e.dropdownMenuWidth
|
|
3776
3766
|
}, {
|
|
3777
3767
|
items: x(() => [
|
|
3778
|
-
Y(
|
|
3768
|
+
Y(y.$slots, "actions", {
|
|
3779
3769
|
row: w,
|
|
3780
3770
|
rowKey: U,
|
|
3781
3771
|
rowValue: q
|
|
@@ -3811,7 +3801,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3811
3801
|
"row-el": c(q)
|
|
3812
3802
|
}, {
|
|
3813
3803
|
default: x(() => [
|
|
3814
|
-
Y(
|
|
3804
|
+
Y(y.$slots, U, {
|
|
3815
3805
|
row: q,
|
|
3816
3806
|
rowKey: J,
|
|
3817
3807
|
rowValue: pe
|
|
@@ -3881,7 +3871,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3881
3871
|
},
|
|
3882
3872
|
emits: ["cancel", "proceed"],
|
|
3883
3873
|
setup(e, { emit: t }) {
|
|
3884
|
-
const { i18nT: n } = z.useI18n(), r = e, i = t, a =
|
|
3874
|
+
const { i18nT: n } = z.useI18n(), r = e, i = t, a = k(() => r.needConfirm ? r.entityName : ""), o = () => {
|
|
3885
3875
|
i("cancel");
|
|
3886
3876
|
}, l = () => {
|
|
3887
3877
|
i("proceed");
|
|
@@ -3998,22 +3988,22 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
3998
3988
|
},
|
|
3999
3989
|
emits: ["update:modelValue"],
|
|
4000
3990
|
setup(e, { emit: t }) {
|
|
4001
|
-
const { i18n: { t: n } } = z.useI18n(), r = e, i = t, a = R(!1), o = R({}), l = R(/* @__PURE__ */ new Set()), s =
|
|
3991
|
+
const { i18n: { t: n } } = z.useI18n(), r = e, i = t, a = R(!1), o = R({}), l = R(/* @__PURE__ */ new Set()), s = k(() => {
|
|
4002
3992
|
const m = [];
|
|
4003
|
-
return new URLSearchParams(r.modelValue).forEach((
|
|
4004
|
-
|
|
3993
|
+
return new URLSearchParams(r.modelValue).forEach((y, g) => {
|
|
3994
|
+
y !== "" && m.push(g);
|
|
4005
3995
|
}), m;
|
|
4006
|
-
}), u =
|
|
3996
|
+
}), u = k(() => {
|
|
4007
3997
|
const m = r.config.fields;
|
|
4008
|
-
return Object.keys(m).filter((
|
|
4009
|
-
label: m[
|
|
4010
|
-
value:
|
|
3998
|
+
return Object.keys(m).filter((y) => m[y].searchable).map((y) => ({
|
|
3999
|
+
label: m[y].label || y,
|
|
4000
|
+
value: y,
|
|
4011
4001
|
expanded: !1
|
|
4012
4002
|
}));
|
|
4013
4003
|
});
|
|
4014
4004
|
Ae(() => r.modelValue, (m) => {
|
|
4015
|
-
o.value = {}, new URLSearchParams(m).forEach((
|
|
4016
|
-
o.value[
|
|
4005
|
+
o.value = {}, new URLSearchParams(m).forEach((y, g) => {
|
|
4006
|
+
o.value[g] = y;
|
|
4017
4007
|
});
|
|
4018
4008
|
});
|
|
4019
4009
|
const d = () => {
|
|
@@ -4024,15 +4014,15 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
4024
4014
|
i("update:modelValue", m);
|
|
4025
4015
|
}, f = () => {
|
|
4026
4016
|
p("");
|
|
4027
|
-
}, b = (m) => `filter-${m}`,
|
|
4028
|
-
var
|
|
4029
|
-
return (((
|
|
4017
|
+
}, b = (m) => `filter-${m}`, v = (m) => {
|
|
4018
|
+
var y, g;
|
|
4019
|
+
return (((g = (y = r.config.schema) == null ? void 0 : y[m]) == null ? void 0 : g.values) ?? []).map(($) => ({
|
|
4030
4020
|
value: $,
|
|
4031
4021
|
label: $
|
|
4032
4022
|
}));
|
|
4033
|
-
},
|
|
4034
|
-
var
|
|
4035
|
-
return ((
|
|
4023
|
+
}, A = (m) => {
|
|
4024
|
+
var y, g;
|
|
4025
|
+
return ((g = (y = r.config.schema) == null ? void 0 : y[m]) == null ? void 0 : g.type) ?? "text";
|
|
4036
4026
|
}, M = (m) => {
|
|
4037
4027
|
o.value = {
|
|
4038
4028
|
...o.value,
|
|
@@ -4041,12 +4031,12 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
4041
4031
|
}, E = () => {
|
|
4042
4032
|
o.value = {}, ee(!0);
|
|
4043
4033
|
}, ee = (m = !1) => {
|
|
4044
|
-
const
|
|
4045
|
-
m && (a.value = !1), i("update:modelValue", new URLSearchParams(
|
|
4034
|
+
const y = Object.keys(o.value).reduce((g, $) => (o.value[$] && (g[$] = `${o.value[$]}`), g), {});
|
|
4035
|
+
m && (a.value = !1), i("update:modelValue", new URLSearchParams(y).toString());
|
|
4046
4036
|
};
|
|
4047
|
-
return (m,
|
|
4048
|
-
const
|
|
4049
|
-
return e.config.isExactMatch ? (h(), K(
|
|
4037
|
+
return (m, y) => {
|
|
4038
|
+
const g = B("KInput"), $ = B("KButton"), F = B("KSelect");
|
|
4039
|
+
return e.config.isExactMatch ? (h(), K(g, {
|
|
4050
4040
|
key: 0,
|
|
4051
4041
|
autocomplete: "off",
|
|
4052
4042
|
class: "kong-ui-entity-filter-input",
|
|
@@ -4086,59 +4076,59 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
4086
4076
|
[me, a.value]
|
|
4087
4077
|
]),
|
|
4088
4078
|
he(L("div", ml, [
|
|
4089
|
-
(h(!0), S(le, null, ie(u.value, (
|
|
4079
|
+
(h(!0), S(le, null, ie(u.value, (_) => {
|
|
4090
4080
|
var j, T;
|
|
4091
4081
|
return h(), S("div", {
|
|
4092
|
-
key:
|
|
4082
|
+
key: _.value,
|
|
4093
4083
|
class: "kong-ui-entity-filter-menu-item",
|
|
4094
|
-
"data-testid":
|
|
4084
|
+
"data-testid": _.value
|
|
4095
4085
|
}, [
|
|
4096
4086
|
L("span", {
|
|
4097
|
-
class: ue(["menu-item-title", { expanded: l.value.has(
|
|
4087
|
+
class: ue(["menu-item-title", { expanded: l.value.has(_.value) }]),
|
|
4098
4088
|
role: "button",
|
|
4099
4089
|
tabindex: "0",
|
|
4100
|
-
onClick: (w) => c(
|
|
4101
|
-
onKeydown: Ln((w) => c(
|
|
4090
|
+
onClick: (w) => c(_.value),
|
|
4091
|
+
onKeydown: Ln((w) => c(_.value), ["enter"])
|
|
4102
4092
|
}, [
|
|
4103
|
-
V(O(
|
|
4093
|
+
V(O(_.label) + " ", 1),
|
|
4104
4094
|
he(L("span", vl, null, 512), [
|
|
4105
|
-
[me, s.value.includes(
|
|
4095
|
+
[me, s.value.includes(_.value)]
|
|
4106
4096
|
]),
|
|
4107
4097
|
N(I(Lo), {
|
|
4108
|
-
class: ue(["menu-item-expand-icon", { expanded: l.value.has(
|
|
4098
|
+
class: ue(["menu-item-expand-icon", { expanded: l.value.has(_.value) }]),
|
|
4109
4099
|
color: I(Ar)
|
|
4110
4100
|
}, null, 8, ["class", "color"])
|
|
4111
4101
|
], 42, yl),
|
|
4112
4102
|
he(L("div", bl, [
|
|
4113
4103
|
L("label", {
|
|
4114
4104
|
class: "menu-item-label",
|
|
4115
|
-
for: b(
|
|
4105
|
+
for: b(_.value)
|
|
4116
4106
|
}, O(I(n)("filter.fieldLabel")), 9, xl),
|
|
4117
|
-
((T = (j = e.config.schema) == null ? void 0 : j[
|
|
4107
|
+
((T = (j = e.config.schema) == null ? void 0 : j[_.value]) == null ? void 0 : T.type) === "select" ? (h(), K(F, {
|
|
4118
4108
|
key: 0,
|
|
4119
|
-
id: b(
|
|
4120
|
-
modelValue: o.value[
|
|
4121
|
-
"onUpdate:modelValue": (w) => o.value[
|
|
4122
|
-
items:
|
|
4109
|
+
id: b(_.value),
|
|
4110
|
+
modelValue: o.value[_.value],
|
|
4111
|
+
"onUpdate:modelValue": (w) => o.value[_.value] = w,
|
|
4112
|
+
items: v(_.value),
|
|
4123
4113
|
placeholder: I(n)("filter.selectPlaceholder")
|
|
4124
|
-
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "items", "placeholder"])) : (h(), K(
|
|
4114
|
+
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "items", "placeholder"])) : (h(), K(g, {
|
|
4125
4115
|
key: 1,
|
|
4126
|
-
id: b(
|
|
4127
|
-
modelValue: o.value[
|
|
4128
|
-
"onUpdate:modelValue": (w) => o.value[
|
|
4116
|
+
id: b(_.value),
|
|
4117
|
+
modelValue: o.value[_.value],
|
|
4118
|
+
"onUpdate:modelValue": (w) => o.value[_.value] = w,
|
|
4129
4119
|
autocomplete: "off",
|
|
4130
4120
|
placeholder: I(n)("filter.inputPlaceholder"),
|
|
4131
|
-
type: _
|
|
4121
|
+
type: A(_.value)
|
|
4132
4122
|
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "placeholder", "type"]))
|
|
4133
4123
|
], 512), [
|
|
4134
|
-
[me, l.value.has(
|
|
4124
|
+
[me, l.value.has(_.value)]
|
|
4135
4125
|
]),
|
|
4136
4126
|
he(L("div", Cl, [
|
|
4137
4127
|
N($, {
|
|
4138
4128
|
appearance: "tertiary",
|
|
4139
4129
|
"data-testid": "apply-filter",
|
|
4140
4130
|
size: "small",
|
|
4141
|
-
onClick:
|
|
4131
|
+
onClick: y[0] || (y[0] = (w) => ee(!0))
|
|
4142
4132
|
}, {
|
|
4143
4133
|
default: x(() => [
|
|
4144
4134
|
V(O(I(n)("filter.applyButtonText")), 1)
|
|
@@ -4149,7 +4139,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
4149
4139
|
appearance: "tertiary",
|
|
4150
4140
|
"data-testid": "clear-filter",
|
|
4151
4141
|
size: "small",
|
|
4152
|
-
onClick: (w) => M(
|
|
4142
|
+
onClick: (w) => M(_.value)
|
|
4153
4143
|
}, {
|
|
4154
4144
|
default: x(() => [
|
|
4155
4145
|
V(O(I(n)("filter.clearButtonText")), 1)
|
|
@@ -4157,7 +4147,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
4157
4147
|
_: 2
|
|
4158
4148
|
}, 1032, ["onClick"])
|
|
4159
4149
|
], 512), [
|
|
4160
|
-
[me, l.value.has(
|
|
4150
|
+
[me, l.value.has(_.value)]
|
|
4161
4151
|
])
|
|
4162
4152
|
], 8, gl);
|
|
4163
4153
|
}), 128)),
|
|
@@ -4211,9 +4201,9 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
4211
4201
|
},
|
|
4212
4202
|
emits: ["cancel", "proceed"],
|
|
4213
4203
|
setup(e, { emit: t }) {
|
|
4214
|
-
const { i18n: { t: n }, i18nT: r } = z.useI18n(), i = e, a = t, o = R(!1), l =
|
|
4204
|
+
const { i18n: { t: n }, i18nT: r } = z.useI18n(), i = e, a = t, o = R(!1), l = k(
|
|
4215
4205
|
() => i.action === "enable" ? n("toggleModal.enable.title", { entityType: i.entityType }) : n("toggleModal.disable.title", { entityType: i.entityType })
|
|
4216
|
-
), s =
|
|
4206
|
+
), s = k(
|
|
4217
4207
|
() => i.action === "enable" ? n("toggleModal.enable.confirmText") : n("toggleModal.disable.confirmText")
|
|
4218
4208
|
), u = () => a("cancel"), d = async () => {
|
|
4219
4209
|
if (i.onConfirm) {
|
|
@@ -4280,7 +4270,7 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
4280
4270
|
}
|
|
4281
4271
|
},
|
|
4282
4272
|
setup(e) {
|
|
4283
|
-
const t = e, n = R(void 0), r =
|
|
4273
|
+
const t = e, n = R(void 0), r = k(() => n.value === !0 || n.value !== void 0 && t.forceShow === !0);
|
|
4284
4274
|
return Ae(() => t.authFunction, async () => {
|
|
4285
4275
|
n.value = await t.authFunction();
|
|
4286
4276
|
}, { immediate: !0 }), (i, a) => r.value ? Y(i.$slots, "default", {
|
|
@@ -4386,13 +4376,13 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
4386
4376
|
}
|
|
4387
4377
|
},
|
|
4388
4378
|
setup(e) {
|
|
4389
|
-
const t = e, n = R(), { isTruncated: r } = z.useTruncationDetector(n), { i18n: { t: i } } = z.useI18n(), a = i("global.actions.copyId"), o = R(a), l =
|
|
4379
|
+
const t = e, n = R(), { isTruncated: r } = z.useTruncationDetector(n), { i18n: { t: i } } = z.useI18n(), a = i("global.actions.copyId"), o = R(a), l = k(() => t.entityLinkData.deleted ?? !1), s = k(() => t.entityLinkData.id.toString().includes(":") ? t.entityLinkData.id.toString().split(":")[1] : t.entityLinkData.id), u = k(() => `${s.value.toString().slice(0, 5)} (deleted)`), d = async (c) => {
|
|
4390
4380
|
await c(s.value || "") && (o.value = i("global.actions.copyToClipboard"), setTimeout(() => {
|
|
4391
4381
|
o.value = a;
|
|
4392
4382
|
}, 1800));
|
|
4393
4383
|
};
|
|
4394
4384
|
return (c, p) => {
|
|
4395
|
-
const f = B("KTooltip"), b = B("KExternalLink"),
|
|
4385
|
+
const f = B("KTooltip"), b = B("KExternalLink"), v = B("KClipboardProvider");
|
|
4396
4386
|
return h(), S("div", Tl, [
|
|
4397
4387
|
l.value ? (h(), S("div", Fl, O(u.value), 1)) : s.value ? s.value ? (h(), K(b, {
|
|
4398
4388
|
key: 2,
|
|
@@ -4425,11 +4415,11 @@ const co = { class: "yaml-config" }, Sn = /* @__PURE__ */ H({
|
|
|
4425
4415
|
text: o.value
|
|
4426
4416
|
}, {
|
|
4427
4417
|
default: x(() => [
|
|
4428
|
-
N(
|
|
4429
|
-
default: x(({ copyToClipboard:
|
|
4418
|
+
N(v, null, {
|
|
4419
|
+
default: x(({ copyToClipboard: A }) => [
|
|
4430
4420
|
L("span", {
|
|
4431
4421
|
class: "entity-link-copy-id",
|
|
4432
|
-
onClick: Ve((M) => d(
|
|
4422
|
+
onClick: Ve((M) => d(A), ["stop"])
|
|
4433
4423
|
}, [
|
|
4434
4424
|
N(I(Vo), {
|
|
4435
4425
|
class: "copy-icon",
|