@kong-ui-public/entities-consumer-groups 2.5.4 → 2.5.5
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,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as X, ref as E, computed as
|
|
1
|
+
import { defineComponent as X, ref as E, computed as S, watch as Se, renderSlot as te, createCommentVNode as J, unref as h, onBeforeMount as ut, resolveComponent as U, openBlock as f, createBlock as D, createSlots as Ke, withCtx as b, createElementVNode as B, createVNode as j, createTextVNode as Q, toDisplayString as N, renderList as ye, createElementBlock as T, withModifiers as Ct, withDirectives as Ae, vShow as $e, Fragment as ve, normalizeClass as Me, withKeys as vr, useSlots as At, useCssVars as gn, inject as br, onMounted as kr, onUnmounted as Cr, resolveDynamicComponent as Le, normalizeStyle as ct, normalizeProps as wr, guardReactiveProps as _r, mergeProps as xr, pushScopeId as dt, popScopeId as pt, reactive as Rt } from "vue";
|
|
2
2
|
import { useRouter as $t } from "vue-router";
|
|
3
3
|
import { createI18n as hn, i18nTComponent as yn } from "@kong-ui-public/i18n";
|
|
4
4
|
import Dt from "axios";
|
|
5
|
-
import { BadgeMethodAppearances as
|
|
5
|
+
import { BadgeMethodAppearances as Sr } from "@kong/kongponents";
|
|
6
6
|
const Ir = {
|
|
7
7
|
list: {
|
|
8
8
|
table_headers: {
|
|
@@ -108,7 +108,7 @@ function $r() {
|
|
|
108
108
|
}
|
|
109
109
|
const ft = {
|
|
110
110
|
useI18n: $r
|
|
111
|
-
}, _e = "/api/runtime_groups/{controlPlaneId}",
|
|
111
|
+
}, _e = "/api/runtime_groups/{controlPlaneId}", xe = "/{workspace}", Te = {
|
|
112
112
|
list: {
|
|
113
113
|
konnect: {
|
|
114
114
|
all: `${_e}/consumer_groups`,
|
|
@@ -116,9 +116,9 @@ const ft = {
|
|
|
116
116
|
oneForConsumer: `${_e}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`
|
|
117
117
|
},
|
|
118
118
|
kongManager: {
|
|
119
|
-
all: `${
|
|
120
|
-
forConsumer: `${
|
|
121
|
-
oneForConsumer: `${
|
|
119
|
+
all: `${xe}/consumer_groups?counter=true`,
|
|
120
|
+
forConsumer: `${xe}/consumers/{consumerId}/consumer_groups`,
|
|
121
|
+
oneForConsumer: `${xe}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
form: {
|
|
@@ -131,12 +131,12 @@ const ft = {
|
|
|
131
131
|
getConsumers: `${_e}/consumer_groups/{id}/consumers`
|
|
132
132
|
},
|
|
133
133
|
kongManager: {
|
|
134
|
-
consumersList: `${
|
|
135
|
-
create: `${
|
|
136
|
-
edit: `${
|
|
137
|
-
addConsumer: `${
|
|
138
|
-
removeConsumer: `${
|
|
139
|
-
getConsumers: `${
|
|
134
|
+
consumersList: `${xe}/consumers`,
|
|
135
|
+
create: `${xe}/consumer_groups`,
|
|
136
|
+
edit: `${xe}/consumer_groups/{id}`,
|
|
137
|
+
addConsumer: `${xe}/consumer_groups/{id}/consumers`,
|
|
138
|
+
removeConsumer: `${xe}/consumer_groups/{id}/consumers/{consumerId}`,
|
|
139
|
+
getConsumers: `${xe}/consumer_groups/{id}/consumers`
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
};
|
|
@@ -406,8 +406,8 @@ function Rr(e, n, t, r = {
|
|
|
406
406
|
if (l.value = !0, u.value = "", d.value = "", e.app === "konnect") {
|
|
407
407
|
let L = w + "";
|
|
408
408
|
y && (L += `/${y}`);
|
|
409
|
-
const { data:
|
|
410
|
-
r.fetchedItemsKey in
|
|
409
|
+
const { data: x } = await a.get(`${L}?size=${t}`);
|
|
410
|
+
r.fetchedItemsKey in x ? c.value = x[r.fetchedItemsKey] : x != null && x.id ? c.value = [x] : c.value = [];
|
|
411
411
|
} else if (y) {
|
|
412
412
|
const L = [];
|
|
413
413
|
_(y) && r.searchKeys.includes("id") ? L.push((async () => {
|
|
@@ -419,8 +419,8 @@ function Rr(e, n, t, r = {
|
|
|
419
419
|
return k[r.fetchedItemsKey];
|
|
420
420
|
})
|
|
421
421
|
);
|
|
422
|
-
const
|
|
423
|
-
c.value = [], (m =
|
|
422
|
+
const x = await Promise.all(L), z = /* @__PURE__ */ new Set();
|
|
423
|
+
c.value = [], (m = x == null ? void 0 : x.forEach) == null || m.call(x, (O) => {
|
|
424
424
|
var k;
|
|
425
425
|
(k = O == null ? void 0 : O.forEach) == null || k.call(O, (A) => {
|
|
426
426
|
z.has(A.id) || (z.add(A.id), c.value.push(A));
|
|
@@ -435,10 +435,10 @@ function Rr(e, n, t, r = {
|
|
|
435
435
|
}
|
|
436
436
|
else
|
|
437
437
|
l.value = !0, d.value = "", y ? (c.value = (F = p.value) == null ? void 0 : F.filter((L) => {
|
|
438
|
-
var
|
|
438
|
+
var x;
|
|
439
439
|
let z = !1;
|
|
440
440
|
for (const O of r.searchKeys) {
|
|
441
|
-
const k = typeof L[O] == "string" ? (
|
|
441
|
+
const k = typeof L[O] == "string" ? (x = L[O]) == null ? void 0 : x.toLowerCase() : L[O];
|
|
442
442
|
k != null && k.includes(y.toLowerCase()) && (z = !0);
|
|
443
443
|
}
|
|
444
444
|
return z;
|
|
@@ -455,7 +455,7 @@ function Rr(e, n, t, r = {
|
|
|
455
455
|
};
|
|
456
456
|
}
|
|
457
457
|
function Dr(e, n) {
|
|
458
|
-
const t = h(n), r =
|
|
458
|
+
const t = h(n), r = S(
|
|
459
459
|
() => e.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${t}`) : new URL(t)
|
|
460
460
|
);
|
|
461
461
|
return r.value.search = "", (a) => `${r.value.href}/${a}`;
|
|
@@ -502,16 +502,16 @@ function Gr(e) {
|
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
504
|
function kn(e, n) {
|
|
505
|
-
const t = E(h(e)), r = E(h(n)), a =
|
|
505
|
+
const t = E(h(e)), r = E(h(n)), a = S(
|
|
506
506
|
() => !!(t.value.app === "konnect" || t.value.isExactMatch)
|
|
507
|
-
), i =
|
|
507
|
+
), i = S(
|
|
508
508
|
() => r.value.startsWith("/") ? new URL(`${window.location.origin}${r.value}`) : new URL(r.value)
|
|
509
509
|
);
|
|
510
510
|
return (o) => {
|
|
511
511
|
const { page: s, pageSize: l, offset: u, sortColumnKey: d, sortColumnOrder: c, query: v } = o;
|
|
512
512
|
try {
|
|
513
513
|
let p = new URL(i.value.href);
|
|
514
|
-
return a.value && v ? (p.search = "", p = t.value.
|
|
514
|
+
return a.value && v ? (p.search = "", p = t.value.isExactMatch ? new URL(`${p.href}/${v}/`) : new URL(`${p.href}?filter[name][contains]=${v}`)) : (a.value || new URLSearchParams(v).forEach((I, w) => {
|
|
515
515
|
p.searchParams.append(w, I);
|
|
516
516
|
}), d && p.searchParams.append("sort_by", d), c === "desc" && p.searchParams.append("sort_desc", "1"), p.searchParams.append("size", String(l))), u && s !== 1 && p.searchParams.append("offset", String(u)), p.href;
|
|
517
517
|
} catch (p) {
|
|
@@ -627,10 +627,10 @@ function ea(e) {
|
|
|
627
627
|
}
|
|
628
628
|
function ta(e) {
|
|
629
629
|
const n = E(0), t = E(0), r = E(!1);
|
|
630
|
-
return
|
|
630
|
+
return Se(e, (a) => {
|
|
631
631
|
a && !r.value && (n.value = a.offsetWidth, t.value = a.scrollWidth, r.value = !0);
|
|
632
632
|
}), {
|
|
633
|
-
isTruncated:
|
|
633
|
+
isTruncated: S(() => n.value < t.value)
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
636
|
const se = {
|
|
@@ -666,10 +666,10 @@ const se = {
|
|
|
666
666
|
}
|
|
667
667
|
},
|
|
668
668
|
setup(e) {
|
|
669
|
-
const n = e, { i18n: { t } } = se.useI18n(), { convertKeyToTitle: r } = se.useStringHelpers(), a =
|
|
669
|
+
const n = e, { i18n: { t } } = se.useI18n(), { convertKeyToTitle: r } = se.useStringHelpers(), a = S(() => n.item.key ?? "json-array-item"), i = S(() => n.item.value ?? n.item), o = S(() => {
|
|
670
670
|
const l = JSON.parse(JSON.stringify(i.value));
|
|
671
671
|
return n.isArrayItem && delete l.name, l;
|
|
672
|
-
}), s =
|
|
672
|
+
}), s = S(() => {
|
|
673
673
|
var l;
|
|
674
674
|
return n.isArrayItem ? (l = i.value) != null && l.name ? r(i.value.name, "_") : t("baseConfigCard.general.entryTitle", { index: n.index }) : "";
|
|
675
675
|
});
|
|
@@ -680,7 +680,7 @@ const se = {
|
|
|
680
680
|
e.isArrayItem ? (f(), T("legend", na, [
|
|
681
681
|
B("b", null, N(s.value), 1)
|
|
682
682
|
])) : J("", !0),
|
|
683
|
-
(f(!0), T(ve, null, ye(Object.keys(o.value), (d, c) => (f(), D(
|
|
683
|
+
(f(!0), T(ve, null, ye(Object.keys(o.value), (d, c) => (f(), D(xn, {
|
|
684
684
|
key: `${a.value}-property-${c}`,
|
|
685
685
|
item: {
|
|
686
686
|
key: d,
|
|
@@ -749,7 +749,7 @@ const se = {
|
|
|
749
749
|
}), sa = "#0044f4", la = "#e0e4ea", ua = "#3a3f51", ca = "#afb7c5", da = "1px", pa = "20px", fa = { class: "config-card-details-row" }, ma = ["data-testid"], ga = ["data-testid"], ha = ["data-testid"], ya = ["data-testid"], va = { key: 1 }, ba = ["data-testid"], ka = ["data-testid"], Ca = ["data-testid"], wa = ["data-testid"], _a = {
|
|
750
750
|
name: "ConfigCardItem",
|
|
751
751
|
components: { JsonCardItem: _n, StatusBadge: ia, InternalLinkItem: oa }
|
|
752
|
-
},
|
|
752
|
+
}, xa = /* @__PURE__ */ X({
|
|
753
753
|
..._a,
|
|
754
754
|
props: {
|
|
755
755
|
item: {
|
|
@@ -775,7 +775,7 @@ const se = {
|
|
|
775
775
|
"5036b738": u.value && s.value ? "100%" : t.slim ? "50%" : "25%",
|
|
776
776
|
"5038fd13": u.value && s.value ? "100%" : t.slim ? "50%" : "75%"
|
|
777
777
|
}));
|
|
778
|
-
const t = e, r = n, a = At(), { i18n: { t: i, formatUnixTimeStamp: o } } = se.useI18n(), s =
|
|
778
|
+
const t = e, r = n, a = At(), { i18n: { t: i, formatUnixTimeStamp: o } } = se.useI18n(), s = S(() => t.item.value !== void 0 && t.item.value !== null && t.item.value !== ""), l = S(() => !!(t.item.tooltip || a["label-tooltip"])), u = S(() => t.item.type === ee.Json || t.item.type === ee.JsonArray), d = S(() => t.item.type === ee.JsonArray), c = S(() => {
|
|
779
779
|
switch (t.item.type) {
|
|
780
780
|
case ee.ID:
|
|
781
781
|
return {
|
|
@@ -948,7 +948,7 @@ const se = {
|
|
|
948
948
|
class: "copy-uuid-array",
|
|
949
949
|
"data-testid": `${e.item.key}-copy-uuid-array`
|
|
950
950
|
}, [
|
|
951
|
-
(f(!0), T(ve, null, ye(e.item.value, (y, m) => (f(), D(K,
|
|
951
|
+
(f(!0), T(ve, null, ye(e.item.value, (y, m) => (f(), D(K, xr(c.value.childAttrs, {
|
|
952
952
|
key: `${e.item.key}-copy-uuid-${m}`,
|
|
953
953
|
"data-testid": `${e.item.key}-copy-uuid-${m}`,
|
|
954
954
|
text: y
|
|
@@ -960,7 +960,7 @@ const se = {
|
|
|
960
960
|
}, [
|
|
961
961
|
(f(!0), T(ve, null, ye(e.item.value, (y, m) => (f(), D(V, {
|
|
962
962
|
key: `${e.item.key}-badge-method-${m}`,
|
|
963
|
-
appearance: Object.values(h(
|
|
963
|
+
appearance: Object.values(h(Sr)).includes(y.toLowerCase()) ? y.toLowerCase() : "custom",
|
|
964
964
|
class: "config-badge",
|
|
965
965
|
"data-testid": `${e.item.key}-badge-method-${m}`
|
|
966
966
|
}, {
|
|
@@ -1005,10 +1005,10 @@ const se = {
|
|
|
1005
1005
|
]);
|
|
1006
1006
|
};
|
|
1007
1007
|
}
|
|
1008
|
-
}),
|
|
1008
|
+
}), xn = /* @__PURE__ */ be(xa, [["__scopeId", "data-v-d056663c"]]), Sa = { class: "json-config" }, Ia = {
|
|
1009
1009
|
key: 0,
|
|
1010
1010
|
class: "json-endpoint"
|
|
1011
|
-
},
|
|
1011
|
+
}, Sn = /* @__PURE__ */ X({
|
|
1012
1012
|
__name: "JsonCodeBlock",
|
|
1013
1013
|
props: {
|
|
1014
1014
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -1039,7 +1039,7 @@ const se = {
|
|
|
1039
1039
|
gn((a) => ({
|
|
1040
1040
|
"2d178975": `${r.value}ch`
|
|
1041
1041
|
}));
|
|
1042
|
-
const n = e, t =
|
|
1042
|
+
const n = e, t = S(() => n.jsonRecord), r = S(() => {
|
|
1043
1043
|
var a;
|
|
1044
1044
|
if (!n.fetcherUrl)
|
|
1045
1045
|
return 0;
|
|
@@ -1049,7 +1049,7 @@ const se = {
|
|
|
1049
1049
|
return (a, i) => {
|
|
1050
1050
|
var o;
|
|
1051
1051
|
const s = U("KBadge"), l = U("KCodeBlock");
|
|
1052
|
-
return f(), T("div",
|
|
1052
|
+
return f(), T("div", Sa, [
|
|
1053
1053
|
n.fetcherUrl && (o = n.config) != null && o.jsonYamlFormsEnabled ? (f(), T("div", Ia, [
|
|
1054
1054
|
j(s, {
|
|
1055
1055
|
appearance: n.requestMethod
|
|
@@ -1627,7 +1627,7 @@ function _o(e) {
|
|
|
1627
1627
|
}
|
|
1628
1628
|
return !0;
|
|
1629
1629
|
}
|
|
1630
|
-
function
|
|
1630
|
+
function xo(e) {
|
|
1631
1631
|
if (e === null)
|
|
1632
1632
|
return [];
|
|
1633
1633
|
var n, t, r, a, i, o = e;
|
|
@@ -1638,14 +1638,14 @@ function So(e) {
|
|
|
1638
1638
|
var zn = new le("tag:yaml.org,2002:pairs", {
|
|
1639
1639
|
kind: "sequence",
|
|
1640
1640
|
resolve: _o,
|
|
1641
|
-
construct:
|
|
1642
|
-
}),
|
|
1641
|
+
construct: xo
|
|
1642
|
+
}), So = Object.prototype.hasOwnProperty;
|
|
1643
1643
|
function Io(e) {
|
|
1644
1644
|
if (e === null)
|
|
1645
1645
|
return !0;
|
|
1646
1646
|
var n, t = e;
|
|
1647
1647
|
for (n in t)
|
|
1648
|
-
if (
|
|
1648
|
+
if (So.call(t, n) && t[n] !== null)
|
|
1649
1649
|
return !1;
|
|
1650
1650
|
return !0;
|
|
1651
1651
|
}
|
|
@@ -2169,7 +2169,7 @@ function an(e, n) {
|
|
|
2169
2169
|
` && (i += t), i += o;
|
|
2170
2170
|
return i;
|
|
2171
2171
|
}
|
|
2172
|
-
function
|
|
2172
|
+
function xt(e, n) {
|
|
2173
2173
|
return `
|
|
2174
2174
|
` + ie.repeat(" ", e.indent * n);
|
|
2175
2175
|
}
|
|
@@ -2213,7 +2213,7 @@ function ur(e) {
|
|
|
2213
2213
|
var n = /^\n* /;
|
|
2214
2214
|
return n.test(e);
|
|
2215
2215
|
}
|
|
2216
|
-
var cr = 1,
|
|
2216
|
+
var cr = 1, St = 2, dr = 3, pr = 4, Ve = 5;
|
|
2217
2217
|
function wi(e, n, t, r, a, i, o, s) {
|
|
2218
2218
|
var l, u = 0, d = null, c = !1, v = !1, p = r !== -1, I = -1, w = ki(Je(e, 0)) && Ci(Je(e, e.length - 1));
|
|
2219
2219
|
if (n || o)
|
|
@@ -2233,7 +2233,7 @@ function wi(e, n, t, r, a, i, o, s) {
|
|
|
2233
2233
|
}
|
|
2234
2234
|
v = v || p && l - I - 1 > r && e[I + 1] !== " ";
|
|
2235
2235
|
}
|
|
2236
|
-
return !c && !v ? w && !o && !a(e) ? cr : i === Ze ? Ve :
|
|
2236
|
+
return !c && !v ? w && !o && !a(e) ? cr : i === Ze ? Ve : St : t > 9 && ur(e) ? Ve : o ? i === Ze ? Ve : St : v ? pr : dr;
|
|
2237
2237
|
}
|
|
2238
2238
|
function _i(e, n, t, r, a) {
|
|
2239
2239
|
e.dump = function() {
|
|
@@ -2257,14 +2257,14 @@ function _i(e, n, t, r, a) {
|
|
|
2257
2257
|
)) {
|
|
2258
2258
|
case cr:
|
|
2259
2259
|
return n;
|
|
2260
|
-
case
|
|
2260
|
+
case St:
|
|
2261
2261
|
return "'" + n.replace(/'/g, "''") + "'";
|
|
2262
2262
|
case dr:
|
|
2263
2263
|
return "|" + ln(n, e.indent) + un(an(n, i));
|
|
2264
2264
|
case pr:
|
|
2265
|
-
return ">" + ln(n, e.indent) + un(an(
|
|
2265
|
+
return ">" + ln(n, e.indent) + un(an(xi(n, o), i));
|
|
2266
2266
|
case Ve:
|
|
2267
|
-
return '"' +
|
|
2267
|
+
return '"' + Si(n) + '"';
|
|
2268
2268
|
default:
|
|
2269
2269
|
throw new fe("impossible error: invalid scalar style");
|
|
2270
2270
|
}
|
|
@@ -2282,7 +2282,7 @@ function un(e) {
|
|
|
2282
2282
|
return e[e.length - 1] === `
|
|
2283
2283
|
` ? e.slice(0, -1) : e;
|
|
2284
2284
|
}
|
|
2285
|
-
function
|
|
2285
|
+
function xi(e, n) {
|
|
2286
2286
|
for (var t = /(\n+)([^\n]*)/g, r = function() {
|
|
2287
2287
|
var u = e.indexOf(`
|
|
2288
2288
|
`);
|
|
@@ -2305,7 +2305,7 @@ function cn(e, n) {
|
|
|
2305
2305
|
`, e.length - a > n && o > a ? l += e.slice(a, o) + `
|
|
2306
2306
|
` + e.slice(o + 1) : l += e.slice(a), l.slice(1);
|
|
2307
2307
|
}
|
|
2308
|
-
function
|
|
2308
|
+
function Si(e) {
|
|
2309
2309
|
for (var n = "", t = 0, r, a = 0; a < e.length; t >= 65536 ? a += 2 : a++)
|
|
2310
2310
|
t = Je(e, a), r = pe[t], !r && Qe(t) ? (n += e[a], t >= 65536 && (n += e[a + 1])) : n += r || hi(t);
|
|
2311
2311
|
return n;
|
|
@@ -2319,7 +2319,7 @@ function Ii(e, n, t) {
|
|
|
2319
2319
|
function dn(e, n, t, r) {
|
|
2320
2320
|
var a = "", i = e.tag, o, s, l;
|
|
2321
2321
|
for (o = 0, s = t.length; o < s; o += 1)
|
|
2322
|
-
l = t[o], e.replacer && (l = e.replacer.call(t, String(o), l)), (Ie(e, n + 1, l, !0, !0, !1, !0) || typeof l > "u" && Ie(e, n + 1, null, !0, !0, !1, !0)) && ((!r || a !== "") && (a +=
|
|
2322
|
+
l = t[o], e.replacer && (l = e.replacer.call(t, String(o), l)), (Ie(e, n + 1, l, !0, !0, !1, !0) || typeof l > "u" && Ie(e, n + 1, null, !0, !0, !1, !0)) && ((!r || a !== "") && (a += xt(e, n)), e.dump && We === e.dump.charCodeAt(0) ? a += "-" : a += "- ", a += e.dump);
|
|
2323
2323
|
e.tag = i, e.dump = a || "[]";
|
|
2324
2324
|
}
|
|
2325
2325
|
function Ai(e, n, t) {
|
|
@@ -2337,7 +2337,7 @@ function $i(e, n, t, r) {
|
|
|
2337
2337
|
else if (e.sortKeys)
|
|
2338
2338
|
throw new fe("sortKeys must be a boolean or a function");
|
|
2339
2339
|
for (s = 0, l = o.length; s < l; s += 1)
|
|
2340
|
-
v = "", (!r || a !== "") && (v +=
|
|
2340
|
+
v = "", (!r || a !== "") && (v += xt(e, n)), u = o[s], d = t[u], e.replacer && (d = e.replacer.call(t, u, d)), Ie(e, n + 1, u, !0, !0, !0) && (c = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, c && (e.dump && We === e.dump.charCodeAt(0) ? v += "?" : v += "? "), v += e.dump, c && (v += xt(e, n)), Ie(e, n + 1, d, !0, c) && (e.dump && We === e.dump.charCodeAt(0) ? v += ":" : v += ": ", v += e.dump, a += v));
|
|
2341
2341
|
e.tag = i, e.dump = a || "{}";
|
|
2342
2342
|
}
|
|
2343
2343
|
function pn(e, n, t) {
|
|
@@ -2456,7 +2456,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2456
2456
|
}
|
|
2457
2457
|
},
|
|
2458
2458
|
setup(e) {
|
|
2459
|
-
const n = e, t =
|
|
2459
|
+
const n = e, t = S(() => {
|
|
2460
2460
|
const r = Object.fromEntries(Object.entries(n.yamlRecord).filter(([, a]) => a && (Array.isArray(a) ? a.length !== 0 : !0)));
|
|
2461
2461
|
return Object.keys(r).length === 0 && r.constructor === Object ? "" : Hi.dump(r).trim();
|
|
2462
2462
|
});
|
|
@@ -2518,7 +2518,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2518
2518
|
}
|
|
2519
2519
|
},
|
|
2520
2520
|
setup(e) {
|
|
2521
|
-
const n = e, t = At(), { i18n: { t: r } } = se.useI18n(), a = (o) => !!(o.tooltip || t[`${o.key}-label-tooltip`]), i =
|
|
2521
|
+
const n = e, t = At(), { i18n: { t: r } } = se.useI18n(), a = (o) => !!(o.tooltip || t[`${o.key}-label-tooltip`]), i = S(() => {
|
|
2522
2522
|
if (!n.record)
|
|
2523
2523
|
return n.record;
|
|
2524
2524
|
const o = JSON.parse(JSON.stringify(n.record));
|
|
@@ -2532,7 +2532,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2532
2532
|
"data-testid": `config-card-details-${l}-props`
|
|
2533
2533
|
}, [
|
|
2534
2534
|
l !== "basic" ? (f(), T("div", Zi, N(l === "advanced" ? h(r)("baseConfigCard.sections.advanced") : h(r)("baseConfigCard.sections.plugin")), 1)) : J("", !0),
|
|
2535
|
-
(f(!0), T(ve, null, ye(e.propertyCollections[l], (u) => (f(), D(
|
|
2535
|
+
(f(!0), T(ve, null, ye(e.propertyCollections[l], (u) => (f(), D(xn, {
|
|
2536
2536
|
key: u.key,
|
|
2537
2537
|
item: u
|
|
2538
2538
|
}, Ke({
|
|
@@ -2557,7 +2557,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2557
2557
|
]), 1032, ["item"]))), 128))
|
|
2558
2558
|
], 10, Wi))), 128))
|
|
2559
2559
|
])) : J("", !0),
|
|
2560
|
-
e.format === "json" && n.record ? (f(), D(
|
|
2560
|
+
e.format === "json" && n.record ? (f(), D(Sn, {
|
|
2561
2561
|
key: 1,
|
|
2562
2562
|
config: n.config,
|
|
2563
2563
|
"fetcher-url": n.fetcherUrl,
|
|
@@ -2633,7 +2633,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2633
2633
|
}
|
|
2634
2634
|
},
|
|
2635
2635
|
setup(e) {
|
|
2636
|
-
const n = e, t =
|
|
2636
|
+
const n = e, t = S(() => {
|
|
2637
2637
|
if (typeof n.size == "number" && n.size > 0)
|
|
2638
2638
|
return `${n.size}px`;
|
|
2639
2639
|
if (typeof n.size == "string") {
|
|
@@ -2642,7 +2642,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2642
2642
|
return `${i}px`;
|
|
2643
2643
|
}
|
|
2644
2644
|
return Oe;
|
|
2645
|
-
}), r =
|
|
2645
|
+
}), r = S(() => ({
|
|
2646
2646
|
boxSizing: "border-box",
|
|
2647
2647
|
color: n.color,
|
|
2648
2648
|
display: n.display,
|
|
@@ -2732,7 +2732,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2732
2732
|
}
|
|
2733
2733
|
},
|
|
2734
2734
|
setup(e) {
|
|
2735
|
-
const n = e, t =
|
|
2735
|
+
const n = e, t = S(() => {
|
|
2736
2736
|
if (typeof n.size == "number" && n.size > 0)
|
|
2737
2737
|
return `${n.size}px`;
|
|
2738
2738
|
if (typeof n.size == "string") {
|
|
@@ -2741,7 +2741,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2741
2741
|
return `${i}px`;
|
|
2742
2742
|
}
|
|
2743
2743
|
return Oe;
|
|
2744
|
-
}), r =
|
|
2744
|
+
}), r = S(() => ({
|
|
2745
2745
|
boxSizing: "border-box",
|
|
2746
2746
|
color: n.color,
|
|
2747
2747
|
display: n.display,
|
|
@@ -2831,7 +2831,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2831
2831
|
}
|
|
2832
2832
|
},
|
|
2833
2833
|
setup(e) {
|
|
2834
|
-
const n = e, t =
|
|
2834
|
+
const n = e, t = S(() => {
|
|
2835
2835
|
if (typeof n.size == "number" && n.size > 0)
|
|
2836
2836
|
return `${n.size}px`;
|
|
2837
2837
|
if (typeof n.size == "string") {
|
|
@@ -2840,7 +2840,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2840
2840
|
return `${i}px`;
|
|
2841
2841
|
}
|
|
2842
2842
|
return Oe;
|
|
2843
|
-
}), r =
|
|
2843
|
+
}), r = S(() => ({
|
|
2844
2844
|
boxSizing: "border-box",
|
|
2845
2845
|
color: n.color,
|
|
2846
2846
|
display: n.display,
|
|
@@ -2930,7 +2930,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2930
2930
|
}
|
|
2931
2931
|
},
|
|
2932
2932
|
setup(e) {
|
|
2933
|
-
const n = e, t =
|
|
2933
|
+
const n = e, t = S(() => {
|
|
2934
2934
|
if (typeof n.size == "number" && n.size > 0)
|
|
2935
2935
|
return `${n.size}px`;
|
|
2936
2936
|
if (typeof n.size == "string") {
|
|
@@ -2939,7 +2939,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2939
2939
|
return `${i}px`;
|
|
2940
2940
|
}
|
|
2941
2941
|
return Oe;
|
|
2942
|
-
}), r =
|
|
2942
|
+
}), r = S(() => ({
|
|
2943
2943
|
boxSizing: "border-box",
|
|
2944
2944
|
color: n.color,
|
|
2945
2945
|
display: n.display,
|
|
@@ -2971,7 +2971,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
2971
2971
|
_: 1
|
|
2972
2972
|
}, 8, ["aria-hidden", "style"]));
|
|
2973
2973
|
}
|
|
2974
|
-
}), _s = /* @__PURE__ */ gt(ws, [["__scopeId", "data-v-19f4cbbe"]]),
|
|
2974
|
+
}), _s = /* @__PURE__ */ gt(ws, [["__scopeId", "data-v-19f4cbbe"]]), xs = { "data-testid": "config-card-title" }, Ss = { class: "config-card-actions" }, Is = ["href"], As = { class: "config-card-details-section" }, $s = /* @__PURE__ */ X({
|
|
2975
2975
|
__name: "EntityBaseConfigCard",
|
|
2976
2976
|
props: {
|
|
2977
2977
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -3098,19 +3098,19 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3098
3098
|
// the last property displayed
|
|
3099
3099
|
section: he.Basic
|
|
3100
3100
|
}
|
|
3101
|
-
}, p = E(!1), I = E(!1), w = E(""), _ = E({}), V =
|
|
3101
|
+
}, p = E(!1), I = E(!1), w = E(""), _ = E({}), V = S(() => {
|
|
3102
3102
|
var g, F, L;
|
|
3103
3103
|
if (!_.value)
|
|
3104
3104
|
return [];
|
|
3105
|
-
const
|
|
3105
|
+
const x = [], z = Object.keys(_.value).length;
|
|
3106
3106
|
for (const O in _.value) {
|
|
3107
3107
|
const k = (F = (g = a.configSchema) == null ? void 0 : g[O]) == null ? void 0 : F.order, A = (L = v[O]) == null ? void 0 : L.order;
|
|
3108
3108
|
let q = z;
|
|
3109
|
-
(A || A === 0) && (q = A === -1 ? z + 1 : A), k && (q = k === -1 ? z + 1 : k),
|
|
3109
|
+
(A || A === 0) && (q = A === -1 ? z + 1 : A), k && (q = k === -1 ? z + 1 : k), x.push([O, q]);
|
|
3110
3110
|
}
|
|
3111
|
-
return
|
|
3111
|
+
return x.sort(function(O, k) {
|
|
3112
3112
|
return O[1] - k[1];
|
|
3113
|
-
}),
|
|
3113
|
+
}), x.map((O) => {
|
|
3114
3114
|
var k, A;
|
|
3115
3115
|
const q = O[0], G = (k = _.value) == null ? void 0 : k[q], ae = ((A = a.configSchema) == null ? void 0 : A[q]) || {}, ue = v[q];
|
|
3116
3116
|
return {
|
|
@@ -3123,15 +3123,15 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3123
3123
|
section: ae.section ?? ((ue == null ? void 0 : ue.section) || he.Advanced)
|
|
3124
3124
|
};
|
|
3125
3125
|
}).filter((O) => !O.hidden && O.key !== a.pluginConfigKey);
|
|
3126
|
-
}), K =
|
|
3126
|
+
}), K = S(() => {
|
|
3127
3127
|
var g, F;
|
|
3128
3128
|
if (!_.value || !a.pluginConfigKey)
|
|
3129
3129
|
return [];
|
|
3130
|
-
const L = _.value[a.pluginConfigKey] || {},
|
|
3130
|
+
const L = _.value[a.pluginConfigKey] || {}, x = Object.keys(L).length, z = [];
|
|
3131
3131
|
for (const O in L) {
|
|
3132
3132
|
const k = (F = (g = a.pluginConfigSchema) == null ? void 0 : g[O]) == null ? void 0 : F.order, A = L[O];
|
|
3133
|
-
let q = A != null && A !== "" ?
|
|
3134
|
-
k && (q = k === -1 ?
|
|
3133
|
+
let q = A != null && A !== "" ? x - 1 : x;
|
|
3134
|
+
k && (q = k === -1 ? x + 1 : k), z.push([O, q]);
|
|
3135
3135
|
}
|
|
3136
3136
|
return z.sort(function(O, k) {
|
|
3137
3137
|
return O[1] - k[1];
|
|
@@ -3148,22 +3148,22 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3148
3148
|
section: he.Plugin
|
|
3149
3149
|
};
|
|
3150
3150
|
}).filter((O) => !O.hidden);
|
|
3151
|
-
}), W =
|
|
3152
|
-
var g, F, L,
|
|
3151
|
+
}), W = S(() => {
|
|
3152
|
+
var g, F, L, x;
|
|
3153
3153
|
return {
|
|
3154
3154
|
basic: (g = V.value) == null ? void 0 : g.filter((z) => z.section === he.Basic),
|
|
3155
3155
|
advanced: (F = V.value) == null ? void 0 : F.filter((z) => z.section === he.Advanced),
|
|
3156
|
-
plugin: (
|
|
3156
|
+
plugin: (x = K.value) == null ? void 0 : x.concat((L = V.value) == null ? void 0 : L.filter((z) => z.section === he.Plugin))
|
|
3157
3157
|
};
|
|
3158
|
-
}), y =
|
|
3158
|
+
}), y = S(() => {
|
|
3159
3159
|
const g = [];
|
|
3160
3160
|
return W.value.basic.length && g.push("basic"), W.value.advanced.length && g.push("advanced"), W.value.plugin.length && g.push("plugin"), g;
|
|
3161
|
-
}), m =
|
|
3161
|
+
}), m = S(() => {
|
|
3162
3162
|
var g, F;
|
|
3163
3163
|
let L = `${a.config.apiBaseUrl}${a.fetchUrl}`;
|
|
3164
3164
|
return a.config.app === "konnect" ? L = L.replace(/{controlPlaneId}/gi, ((g = a.config) == null ? void 0 : g.controlPlaneId) || "") : a.config.app === "kongManager" && (L = L.replace(/\/{workspace}/gi, (F = a.config) != null && F.workspace ? `/${a.config.workspace}` : "")), L = L.replace(/{id}/gi, a.config.entityId), L;
|
|
3165
3165
|
});
|
|
3166
|
-
return
|
|
3166
|
+
return Se(p, (g) => {
|
|
3167
3167
|
r("loading", g);
|
|
3168
3168
|
}, { immediate: !0 }), ut(async () => {
|
|
3169
3169
|
I.value = !1, p.value = !0;
|
|
@@ -3186,10 +3186,10 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3186
3186
|
p.value = !1;
|
|
3187
3187
|
}
|
|
3188
3188
|
}), (g, F) => {
|
|
3189
|
-
const L = U("KLabel"),
|
|
3189
|
+
const L = U("KLabel"), x = U("KSelect"), z = U("KButton"), O = U("KSkeleton"), k = U("KEmptyState"), A = U("KCard");
|
|
3190
3190
|
return f(), D(A, { class: "kong-ui-entity-base-config-card" }, Ke({
|
|
3191
3191
|
actions: b(() => [
|
|
3192
|
-
B("div",
|
|
3192
|
+
B("div", Ss, [
|
|
3193
3193
|
te(g.$slots, "actions", {}, void 0, !0),
|
|
3194
3194
|
j(L, {
|
|
3195
3195
|
class: "config-format-select-label",
|
|
@@ -3200,7 +3200,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3200
3200
|
]),
|
|
3201
3201
|
_: 1
|
|
3202
3202
|
}),
|
|
3203
|
-
j(
|
|
3203
|
+
j(x, {
|
|
3204
3204
|
"data-testid": "select-config-format",
|
|
3205
3205
|
items: u,
|
|
3206
3206
|
onChange: c
|
|
@@ -3266,7 +3266,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3266
3266
|
e.hideTitle ? void 0 : {
|
|
3267
3267
|
name: "title",
|
|
3268
3268
|
fn: b(() => [
|
|
3269
|
-
B("div",
|
|
3269
|
+
B("div", xs, [
|
|
3270
3270
|
te(g.$slots, "title", {}, () => [
|
|
3271
3271
|
Q(N(h(i)("baseConfigCard.title")), 1)
|
|
3272
3272
|
], !0)
|
|
@@ -3337,7 +3337,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3337
3337
|
var t;
|
|
3338
3338
|
const r = n, a = e, i = $t(), { i18n: { t: o } } = se.useI18n(), { getMessageFromError: s } = se.useErrors(), { axiosInstance: l } = se.useAxios({
|
|
3339
3339
|
headers: (t = a.config) == null ? void 0 : t.requestHeaders
|
|
3340
|
-
}), u = E(!1), d = E(!1), c = E(""), v =
|
|
3340
|
+
}), u = E(!1), d = E(!1), c = E(""), v = S(() => a.canSubmit === !1 || a.isReadonly), p = E(!1), I = S(() => {
|
|
3341
3341
|
var y, m;
|
|
3342
3342
|
let g = `${a.config.apiBaseUrl}${a.fetchUrl}`;
|
|
3343
3343
|
return a.config.app === "konnect" ? g = g.replace(/{controlPlaneId}/gi, ((y = a.config) == null ? void 0 : y.controlPlaneId) || "") : a.config.app === "kongManager" && (g = g.replace(/\/{workspace}/gi, (m = a.config) != null && m.workspace ? `/${a.config.workspace}` : "")), a.editId ? (g = g.replace(/{id}/gi, a.editId), g) : (g = g.replace(/\/{id}/gi, ""), g);
|
|
@@ -3359,7 +3359,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3359
3359
|
hash: "#json"
|
|
3360
3360
|
}
|
|
3361
3361
|
]);
|
|
3362
|
-
return
|
|
3362
|
+
return Se(() => u.value, (y) => {
|
|
3363
3363
|
r("loading", y);
|
|
3364
3364
|
}, { immediate: !0 }), ut(async () => {
|
|
3365
3365
|
if (a.editId)
|
|
@@ -3374,7 +3374,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3374
3374
|
u.value = !1;
|
|
3375
3375
|
}
|
|
3376
3376
|
}), (y, m) => {
|
|
3377
|
-
const g = U("KSkeleton"), F = U("KEmptyState"), L = U("KAlert"),
|
|
3377
|
+
const g = U("KSkeleton"), F = U("KEmptyState"), L = U("KAlert"), x = U("KButton"), z = U("KTabs"), O = U("KSlideout"), k = U("KCard");
|
|
3378
3378
|
return f(), D(k, { class: "kong-ui-entity-base-form" }, {
|
|
3379
3379
|
default: b(() => [
|
|
3380
3380
|
u.value ? (f(), D(g, {
|
|
@@ -3407,7 +3407,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3407
3407
|
B("div", js, [
|
|
3408
3408
|
te(y.$slots, "form-actions", {}, () => [
|
|
3409
3409
|
e.config.jsonYamlFormsEnabled ? (f(), T("div", Ms, [
|
|
3410
|
-
j(
|
|
3410
|
+
j(x, {
|
|
3411
3411
|
appearance: "tertiary",
|
|
3412
3412
|
"data-testid": "form-view-configuration",
|
|
3413
3413
|
onClick: m[0] || (m[0] = (A) => w())
|
|
@@ -3418,7 +3418,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3418
3418
|
_: 1
|
|
3419
3419
|
})
|
|
3420
3420
|
])) : J("", !0),
|
|
3421
|
-
j(
|
|
3421
|
+
j(x, {
|
|
3422
3422
|
appearance: "secondary",
|
|
3423
3423
|
"data-testid": "form-cancel",
|
|
3424
3424
|
disabled: e.isReadonly,
|
|
@@ -3429,7 +3429,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3429
3429
|
]),
|
|
3430
3430
|
_: 1
|
|
3431
3431
|
}, 8, ["disabled"]),
|
|
3432
|
-
j(
|
|
3432
|
+
j(x, {
|
|
3433
3433
|
appearance: "primary",
|
|
3434
3434
|
"data-testid": "form-submit",
|
|
3435
3435
|
disabled: v.value,
|
|
@@ -3459,7 +3459,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3459
3459
|
tabs: W.value
|
|
3460
3460
|
}, {
|
|
3461
3461
|
json: b(() => [
|
|
3462
|
-
j(
|
|
3462
|
+
j(Sn, {
|
|
3463
3463
|
config: e.config,
|
|
3464
3464
|
"fetcher-url": I.value,
|
|
3465
3465
|
"json-record": a.formFields,
|
|
@@ -3497,13 +3497,13 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3497
3497
|
}
|
|
3498
3498
|
},
|
|
3499
3499
|
setup(e) {
|
|
3500
|
-
const n = e, t =
|
|
3500
|
+
const n = e, t = S(() => {
|
|
3501
3501
|
var w;
|
|
3502
3502
|
return ((w = n.rowEl) == null ? void 0 : w.querySelector(`[data-testid="${n.keyName}"]`)) || null;
|
|
3503
|
-
}), r =
|
|
3503
|
+
}), r = S(() => {
|
|
3504
3504
|
var w;
|
|
3505
3505
|
return ((w = t.value) == null ? void 0 : w.querySelector('[data-testid="first-col"]')) || null;
|
|
3506
|
-
}), a =
|
|
3506
|
+
}), a = S(() => {
|
|
3507
3507
|
var w, _;
|
|
3508
3508
|
const V = (w = n.rowEl) == null ? void 0 : w.querySelectorAll("td");
|
|
3509
3509
|
return V ? ((_ = V[0]) == null ? void 0 : _.getAttribute("data-testid")) === n.keyName : !1;
|
|
@@ -3514,7 +3514,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3514
3514
|
}, s = () => {
|
|
3515
3515
|
var w, _, V;
|
|
3516
3516
|
u.value = ((w = r.value) == null ? void 0 : w.getBoundingClientRect().width) || 0, d.value = ((_ = t.value) == null ? void 0 : _.clientWidth) || 0, c.value = ((V = l.value) == null ? void 0 : V.innerText) || "";
|
|
3517
|
-
}, l = E({}), u = E(0), d = E(0), c = E(""), v =
|
|
3517
|
+
}, l = E({}), u = E(0), d = E(0), c = E(""), v = S(() => [r.value, t.value]), p = Se(
|
|
3518
3518
|
v,
|
|
3519
3519
|
(w) => {
|
|
3520
3520
|
if (a.value && (o(), "ResizeObserver" in window && window)) {
|
|
@@ -3528,7 +3528,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3528
3528
|
}
|
|
3529
3529
|
},
|
|
3530
3530
|
{ immediate: !0, flush: "post", deep: !0 }
|
|
3531
|
-
), I =
|
|
3531
|
+
), I = S(() => a.value ? u.value > d.value : !1);
|
|
3532
3532
|
return kr(() => {
|
|
3533
3533
|
s();
|
|
3534
3534
|
}), Cr(() => {
|
|
@@ -3668,7 +3668,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3668
3668
|
},
|
|
3669
3669
|
emits: ["click:row", "sort", "clear-search-input", "empty-state-cta-clicked"],
|
|
3670
3670
|
setup(e, { emit: n }) {
|
|
3671
|
-
const t = e, r = n, { i18n: { t: a } } = se.useI18n(), i =
|
|
3671
|
+
const t = e, r = n, { i18n: { t: a } } = se.useI18n(), i = S(() => {
|
|
3672
3672
|
var m, g;
|
|
3673
3673
|
return typeof t.errorMessage == "string" ? {
|
|
3674
3674
|
hasError: !!t.errorMessage,
|
|
@@ -3679,7 +3679,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3679
3679
|
title: (m = t.errorMessage) == null ? void 0 : m.title,
|
|
3680
3680
|
message: (g = t.errorMessage) == null ? void 0 : g.message
|
|
3681
3681
|
};
|
|
3682
|
-
}), o =
|
|
3682
|
+
}), o = S(() => t.cacheIdentifier || t.preferencesStorageKey), s = (m) => m.hasData || !!t.query, l = S(() => {
|
|
3683
3683
|
const m = [];
|
|
3684
3684
|
return Object.keys(t.tableHeaders).forEach((g) => {
|
|
3685
3685
|
const F = t.tableHeaders[g];
|
|
@@ -3713,11 +3713,11 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3713
3713
|
r("empty-state-cta-clicked"), I();
|
|
3714
3714
|
}, I = () => {
|
|
3715
3715
|
r("clear-search-input");
|
|
3716
|
-
}, w =
|
|
3716
|
+
}, w = S(() => t.disableRowClick ? void 0 : (m, g) => {
|
|
3717
3717
|
r("click:row", g);
|
|
3718
3718
|
}), _ = (m) => {
|
|
3719
3719
|
r("sort", m);
|
|
3720
|
-
}, { setTablePreferences: V, getTablePreferences: K } = Er(), W =
|
|
3720
|
+
}, { setTablePreferences: V, getTablePreferences: K } = Er(), W = S(() => {
|
|
3721
3721
|
const m = K(t.preferencesStorageKey);
|
|
3722
3722
|
return {
|
|
3723
3723
|
...t.initialFetcherParams,
|
|
@@ -3727,7 +3727,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3727
3727
|
t.preferencesStorageKey && V(t.preferencesStorageKey, m);
|
|
3728
3728
|
};
|
|
3729
3729
|
return (m, g) => {
|
|
3730
|
-
const F = U("KIcon"), L = U("KButton"),
|
|
3730
|
+
const F = U("KIcon"), L = U("KButton"), x = U("KDropdown"), z = U("KTable"), O = U("KCard");
|
|
3731
3731
|
return f(), D(O, {
|
|
3732
3732
|
class: "kong-ui-entity-base-table",
|
|
3733
3733
|
title: e.title
|
|
@@ -3778,7 +3778,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3778
3778
|
class: "actions-container",
|
|
3779
3779
|
"data-testid": k.name
|
|
3780
3780
|
}, [
|
|
3781
|
-
j(
|
|
3781
|
+
j(x, {
|
|
3782
3782
|
"kpop-attributes": { placement: "bottomEnd" },
|
|
3783
3783
|
width: e.dropdownMenuWidth
|
|
3784
3784
|
}, {
|
|
@@ -3889,7 +3889,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
3889
3889
|
},
|
|
3890
3890
|
emits: ["cancel", "proceed"],
|
|
3891
3891
|
setup(e, { emit: n }) {
|
|
3892
|
-
const { i18nT: t } = se.useI18n(), r = e, a = n, i =
|
|
3892
|
+
const { i18nT: t } = se.useI18n(), r = e, a = n, i = S(() => r.needConfirm ? r.entityName : ""), o = () => {
|
|
3893
3893
|
a("cancel");
|
|
3894
3894
|
}, s = () => {
|
|
3895
3895
|
a("proceed");
|
|
@@ -4006,12 +4006,12 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4006
4006
|
},
|
|
4007
4007
|
emits: ["update:modelValue"],
|
|
4008
4008
|
setup(e, { emit: n }) {
|
|
4009
|
-
const { i18n: { t } } = se.useI18n(), r = e, a = n, i = E(!1), o = E({}), s = E(/* @__PURE__ */ new Set()), l =
|
|
4009
|
+
const { i18n: { t } } = se.useI18n(), r = e, a = n, i = E(!1), o = E({}), s = E(/* @__PURE__ */ new Set()), l = S(() => {
|
|
4010
4010
|
const y = [];
|
|
4011
4011
|
return new URLSearchParams(r.modelValue).forEach((m, g) => {
|
|
4012
4012
|
m !== "" && y.push(g);
|
|
4013
4013
|
}), y;
|
|
4014
|
-
}), u =
|
|
4014
|
+
}), u = S(() => {
|
|
4015
4015
|
const y = r.config.fields;
|
|
4016
4016
|
return Object.keys(y).filter((m) => y[m].searchable).map((m) => ({
|
|
4017
4017
|
label: y[m].label || m,
|
|
@@ -4019,7 +4019,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4019
4019
|
expanded: !1
|
|
4020
4020
|
}));
|
|
4021
4021
|
});
|
|
4022
|
-
|
|
4022
|
+
Se(() => r.modelValue, (y) => {
|
|
4023
4023
|
o.value = {}, new URLSearchParams(y).forEach((m, g) => {
|
|
4024
4024
|
o.value[g] = m;
|
|
4025
4025
|
});
|
|
@@ -4094,52 +4094,52 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4094
4094
|
[$e, i.value]
|
|
4095
4095
|
]),
|
|
4096
4096
|
Ae(B("div", Qs, [
|
|
4097
|
-
(f(!0), T(ve, null, ye(u.value, (
|
|
4097
|
+
(f(!0), T(ve, null, ye(u.value, (x) => {
|
|
4098
4098
|
var z, O;
|
|
4099
4099
|
return f(), T("div", {
|
|
4100
|
-
key:
|
|
4100
|
+
key: x.value,
|
|
4101
4101
|
class: "kong-ui-entity-filter-menu-item",
|
|
4102
|
-
"data-testid":
|
|
4102
|
+
"data-testid": x.value
|
|
4103
4103
|
}, [
|
|
4104
4104
|
B("span", {
|
|
4105
|
-
class: Me(["menu-item-title", { expanded: s.value.has(
|
|
4105
|
+
class: Me(["menu-item-title", { expanded: s.value.has(x.value) }]),
|
|
4106
4106
|
role: "button",
|
|
4107
4107
|
tabindex: "0",
|
|
4108
|
-
onClick: (k) => c(
|
|
4109
|
-
onKeydown: vr((k) => c(
|
|
4108
|
+
onClick: (k) => c(x.value),
|
|
4109
|
+
onKeydown: vr((k) => c(x.value), ["enter"])
|
|
4110
4110
|
}, [
|
|
4111
|
-
Q(N(
|
|
4111
|
+
Q(N(x.label) + " ", 1),
|
|
4112
4112
|
Ae(B("span", tl, null, 512), [
|
|
4113
|
-
[$e, l.value.includes(
|
|
4113
|
+
[$e, l.value.includes(x.value)]
|
|
4114
4114
|
]),
|
|
4115
4115
|
j(h(ys), {
|
|
4116
|
-
class: Me(["menu-item-expand-icon", { expanded: s.value.has(
|
|
4116
|
+
class: Me(["menu-item-expand-icon", { expanded: s.value.has(x.value) }]),
|
|
4117
4117
|
color: h(ca)
|
|
4118
4118
|
}, null, 8, ["class", "color"])
|
|
4119
4119
|
], 42, el),
|
|
4120
4120
|
Ae(B("div", nl, [
|
|
4121
4121
|
B("label", {
|
|
4122
4122
|
class: "menu-item-label",
|
|
4123
|
-
for: I(
|
|
4123
|
+
for: I(x.value)
|
|
4124
4124
|
}, N(h(t)("filter.fieldLabel")), 9, rl),
|
|
4125
|
-
((O = (z = e.config.schema) == null ? void 0 : z[
|
|
4125
|
+
((O = (z = e.config.schema) == null ? void 0 : z[x.value]) == null ? void 0 : O.type) === "select" ? (f(), D(L, {
|
|
4126
4126
|
key: 0,
|
|
4127
|
-
id: I(
|
|
4128
|
-
modelValue: o.value[
|
|
4129
|
-
"onUpdate:modelValue": (k) => o.value[
|
|
4130
|
-
items: w(
|
|
4127
|
+
id: I(x.value),
|
|
4128
|
+
modelValue: o.value[x.value],
|
|
4129
|
+
"onUpdate:modelValue": (k) => o.value[x.value] = k,
|
|
4130
|
+
items: w(x.value),
|
|
4131
4131
|
placeholder: h(t)("filter.selectPlaceholder")
|
|
4132
4132
|
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "items", "placeholder"])) : (f(), D(g, {
|
|
4133
4133
|
key: 1,
|
|
4134
|
-
id: I(
|
|
4135
|
-
modelValue: o.value[
|
|
4136
|
-
"onUpdate:modelValue": (k) => o.value[
|
|
4134
|
+
id: I(x.value),
|
|
4135
|
+
modelValue: o.value[x.value],
|
|
4136
|
+
"onUpdate:modelValue": (k) => o.value[x.value] = k,
|
|
4137
4137
|
autocomplete: "off",
|
|
4138
4138
|
placeholder: h(t)("filter.inputPlaceholder"),
|
|
4139
|
-
type: _(
|
|
4139
|
+
type: _(x.value)
|
|
4140
4140
|
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "placeholder", "type"]))
|
|
4141
4141
|
], 512), [
|
|
4142
|
-
[$e, s.value.has(
|
|
4142
|
+
[$e, s.value.has(x.value)]
|
|
4143
4143
|
]),
|
|
4144
4144
|
Ae(B("div", al, [
|
|
4145
4145
|
j(F, {
|
|
@@ -4157,7 +4157,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4157
4157
|
appearance: "tertiary",
|
|
4158
4158
|
"data-testid": "clear-filter",
|
|
4159
4159
|
size: "small",
|
|
4160
|
-
onClick: (k) => V(
|
|
4160
|
+
onClick: (k) => V(x.value)
|
|
4161
4161
|
}, {
|
|
4162
4162
|
default: b(() => [
|
|
4163
4163
|
Q(N(h(t)("filter.clearButtonText")), 1)
|
|
@@ -4165,7 +4165,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4165
4165
|
_: 2
|
|
4166
4166
|
}, 1032, ["onClick"])
|
|
4167
4167
|
], 512), [
|
|
4168
|
-
[$e, s.value.has(
|
|
4168
|
+
[$e, s.value.has(x.value)]
|
|
4169
4169
|
])
|
|
4170
4170
|
], 8, Xs);
|
|
4171
4171
|
}), 128)),
|
|
@@ -4209,8 +4209,8 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4209
4209
|
}
|
|
4210
4210
|
},
|
|
4211
4211
|
setup(e) {
|
|
4212
|
-
const n = e, t = E(void 0), r =
|
|
4213
|
-
return
|
|
4212
|
+
const n = e, t = E(void 0), r = S(() => t.value === !0 || t.value !== void 0 && n.forceShow === !0);
|
|
4213
|
+
return Se(() => n.authFunction, async () => {
|
|
4214
4214
|
t.value = await n.authFunction();
|
|
4215
4215
|
}, { immediate: !0 }), (a, i) => r.value ? te(a.$slots, "default", {
|
|
4216
4216
|
key: 0,
|
|
@@ -4314,7 +4314,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4314
4314
|
fetchedItemsKey: "data",
|
|
4315
4315
|
searchKeys: ["name", "id"]
|
|
4316
4316
|
}
|
|
4317
|
-
), p =
|
|
4317
|
+
), p = S(() => d.value ? t("consumer_groups.errors.general") : ""), I = E(0), w = S(() => u.value === void 0), _ = S(() => v.value.map((k) => ({
|
|
4318
4318
|
label: k.name,
|
|
4319
4319
|
value: k.id,
|
|
4320
4320
|
selected: o.value.includes(k.id),
|
|
@@ -4325,25 +4325,25 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4325
4325
|
const A = w.value ? v.value.find((G) => G.id === k) : (q = u.value) == null ? void 0 : q.find((G) => G.id === k);
|
|
4326
4326
|
return A ? A.name : k;
|
|
4327
4327
|
}, K = () => {
|
|
4328
|
-
m.value = "", W.value = [],
|
|
4328
|
+
m.value = "", W.value = [], x.value = [], a("cancel");
|
|
4329
4329
|
}, W = E([]), y = E(!1), m = E(""), g = async () => {
|
|
4330
4330
|
if (!o.value.length) {
|
|
4331
|
-
m.value = "",
|
|
4331
|
+
m.value = "", x.value = [], a("cancel");
|
|
4332
4332
|
return;
|
|
4333
4333
|
}
|
|
4334
|
-
y.value = !0, m.value = "", W.value = [],
|
|
4334
|
+
y.value = !0, m.value = "", W.value = [], x.value = [];
|
|
4335
4335
|
try {
|
|
4336
4336
|
const k = o.value.map((G) => L(G)), A = await Promise.allSettled(k);
|
|
4337
4337
|
let q = !0;
|
|
4338
4338
|
A.forEach((G) => {
|
|
4339
4339
|
G.status !== "fulfilled" && (q = !1);
|
|
4340
|
-
}), q ? (W.value = [],
|
|
4340
|
+
}), q ? (W.value = [], x.value = [], a("add:success", o.value), o.value = []) : (W.value.length && a("add:partial-success", W.value), o.value = [], z(A));
|
|
4341
4341
|
} catch {
|
|
4342
4342
|
m.value = t("consumer_groups.errors.add"), a("error", m.value);
|
|
4343
4343
|
} finally {
|
|
4344
4344
|
y.value = !1;
|
|
4345
4345
|
}
|
|
4346
|
-
}, F =
|
|
4346
|
+
}, F = S(() => {
|
|
4347
4347
|
var A, q, G, ae;
|
|
4348
4348
|
let k = `${r.config.apiBaseUrl}${Te.list[r.config.app].forConsumer}`;
|
|
4349
4349
|
return r.config.app === "konnect" ? k = k.replace(/{controlPlaneId}/gi, ((A = r.config) == null ? void 0 : A.controlPlaneId) || "").replace(/{consumerId}/gi, ((q = r.config) == null ? void 0 : q.consumerId) || "") : r.config.app === "kongManager" && (k = k.replace(/\/{workspace}/gi, (G = r.config) != null && G.workspace ? `/${r.config.workspace}` : "").replace(/{consumerId}/gi, ((ae = r.config) == null ? void 0 : ae.consumerId) || "")), k;
|
|
@@ -4358,15 +4358,15 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4358
4358
|
let G = `${V(k)} - ${q.message}`;
|
|
4359
4359
|
return q.response.status === 409 && (G = `${V(k)} - ${t("consumer_groups.errors.already_added")}`), Promise.reject(Error(G));
|
|
4360
4360
|
}
|
|
4361
|
-
},
|
|
4362
|
-
|
|
4361
|
+
}, x = E([]), z = (k) => {
|
|
4362
|
+
x.value = k.map((A) => {
|
|
4363
4363
|
var q;
|
|
4364
4364
|
return (q = A.reason) == null ? void 0 : q.message;
|
|
4365
4365
|
}).filter(Boolean);
|
|
4366
4366
|
};
|
|
4367
|
-
return
|
|
4367
|
+
return Se(_, () => {
|
|
4368
4368
|
I.value++;
|
|
4369
|
-
}, { immediate: !0, deep: !0 }),
|
|
4369
|
+
}, { immediate: !0, deep: !0 }), Se(() => r.visible, () => {
|
|
4370
4370
|
r.visible && c();
|
|
4371
4371
|
}, { immediate: !0 }), (k, A) => {
|
|
4372
4372
|
const q = U("KMultiselect"), G = U("KAlert"), ae = U("KPrompt");
|
|
@@ -4397,12 +4397,12 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4397
4397
|
width: "100%",
|
|
4398
4398
|
onQueryChange: h(s)
|
|
4399
4399
|
}, null, 8, ["modelValue", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly", "onQueryChange"]),
|
|
4400
|
-
m.value || p.value ||
|
|
4400
|
+
m.value || p.value || x.value.length ? (f(), T("div", bl, [
|
|
4401
4401
|
j(G, { appearance: "danger" }, {
|
|
4402
4402
|
default: b(() => [
|
|
4403
4403
|
B("p", null, N(h(t)("consumer_groups.errors.add")), 1),
|
|
4404
|
-
|
|
4405
|
-
(f(!0), T(ve, null, ye(
|
|
4404
|
+
x.value.length ? (f(), T("ul", kl, [
|
|
4405
|
+
(f(!0), T(ve, null, ye(x.value, (ue, Ge) => (f(), T("li", { key: Ge }, N(ue), 1))), 128))
|
|
4406
4406
|
])) : J("", !0),
|
|
4407
4407
|
B("div", null, N(m.value || p.value), 1)
|
|
4408
4408
|
]),
|
|
@@ -4420,7 +4420,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4420
4420
|
for (const [r, a] of n)
|
|
4421
4421
|
t[r] = a;
|
|
4422
4422
|
return t;
|
|
4423
|
-
}, wl = /* @__PURE__ */ Lt(Cl, [["__scopeId", "data-v-303b382c"]]), _l = { class: "kong-ui-entities-consumer-groups-list" },
|
|
4423
|
+
}, wl = /* @__PURE__ */ Lt(Cl, [["__scopeId", "data-v-303b382c"]]), _l = { class: "kong-ui-entities-consumer-groups-list" }, xl = { key: 1 }, Sl = /* @__PURE__ */ X({
|
|
4424
4424
|
__name: "ConsumerGroupList",
|
|
4425
4425
|
props: {
|
|
4426
4426
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -4469,19 +4469,19 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4469
4469
|
var Ut;
|
|
4470
4470
|
const t = n, r = e, { i18nT: a, i18n: { t: i } } = ft.useI18n(), o = $t(), { axiosInstance: s } = Kt({
|
|
4471
4471
|
headers: (Ut = r.config) == null ? void 0 : Ut.requestHeaders
|
|
4472
|
-
}), l = E(1), u =
|
|
4472
|
+
}), l = E(1), u = S(() => !!r.config.consumerId), d = S(
|
|
4473
4473
|
() => u.value ? "kong-ui-entities-consumer-groups-list-in-consumer-page" : "kong-ui-entities-consumer-groups-list"
|
|
4474
|
-
), c =
|
|
4474
|
+
), c = S(() => r.config.app !== "kongManager" || !!r.config.disableSorting), v = {
|
|
4475
4475
|
name: { label: i("consumer_groups.list.table_headers.name"), searchable: !0, sortable: !0 }
|
|
4476
4476
|
};
|
|
4477
4477
|
r.config.app === "kongManager" && (v.consumers_count = { label: i("consumer_groups.list.table_headers.consumers_count"), searchable: !1, sortable: !1 }), v.tags = { label: i("consumer_groups.list.table_headers.tags"), sortable: !1 };
|
|
4478
4478
|
const p = v, I = ($) => ({
|
|
4479
4479
|
"data-testid": $.username ?? $.custom_id ?? $.id
|
|
4480
|
-
}), w =
|
|
4480
|
+
}), w = S(() => {
|
|
4481
4481
|
var Y, re, me, Ce;
|
|
4482
4482
|
let $ = `${r.config.apiBaseUrl}${Te.list[r.config.app][u.value ? "forConsumer" : "all"]}`;
|
|
4483
4483
|
return r.config.app === "konnect" ? $ = $.replace(/{controlPlaneId}/gi, ((Y = r.config) == null ? void 0 : Y.controlPlaneId) || "").replace(/{consumerId}/gi, ((re = r.config) == null ? void 0 : re.consumerId) || "") : r.config.app === "kongManager" && ($ = $.replace(/\/{workspace}/gi, (me = r.config) != null && me.workspace ? `/${r.config.workspace}` : "").replace(/{consumerId}/gi, ((Ce = r.config) == null ? void 0 : Ce.consumerId) || "")), $;
|
|
4484
|
-
}), _ = E(""), V =
|
|
4484
|
+
}), _ = E(""), V = S(() => {
|
|
4485
4485
|
const $ = r.config.app === "konnect" || r.config.isExactMatch;
|
|
4486
4486
|
return $ ? {
|
|
4487
4487
|
isExactMatch: $,
|
|
@@ -4497,7 +4497,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4497
4497
|
},
|
|
4498
4498
|
schema: r.config.filterSchema
|
|
4499
4499
|
};
|
|
4500
|
-
}), K =
|
|
4500
|
+
}), K = S(() => u.value && !r.config.paginatedEndpoint ? "consumer_groups" : void 0), { fetcher: W, fetcherState: y } = hl(r.config, w.value, K.value), m = () => {
|
|
4501
4501
|
_.value = "";
|
|
4502
4502
|
}, g = () => {
|
|
4503
4503
|
l.value++;
|
|
@@ -4516,7 +4516,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4516
4516
|
field: "id",
|
|
4517
4517
|
message: i("consumer_groups.copy.success", { val: re })
|
|
4518
4518
|
});
|
|
4519
|
-
},
|
|
4519
|
+
}, x = ($, Y) => {
|
|
4520
4520
|
const re = JSON.stringify($);
|
|
4521
4521
|
if (!Y(re)) {
|
|
4522
4522
|
t("copy:error", {
|
|
@@ -4566,7 +4566,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4566
4566
|
R.value = $, ce.value = !0;
|
|
4567
4567
|
}, Ne = () => {
|
|
4568
4568
|
ce.value = !1, R.value = void 0;
|
|
4569
|
-
}, tt =
|
|
4569
|
+
}, tt = S(() => {
|
|
4570
4570
|
var Y, re, me, Ce;
|
|
4571
4571
|
let $ = `${r.config.apiBaseUrl}${Te.list[r.config.app].oneForConsumer}`;
|
|
4572
4572
|
return r.config.app === "konnect" ? $ = $.replace(/{controlPlaneId}/gi, ((Y = r.config) == null ? void 0 : Y.controlPlaneId) || "").replace(/{consumerId}/gi, ((re = r.config) == null ? void 0 : re.consumerId) || "") : r.config.app === "kongManager" && ($ = $.replace(/\/{workspace}/gi, (me = r.config) != null && me.workspace ? `/${r.config.workspace}` : "").replace(/{consumerId}/gi, ((Ce = r.config) == null ? void 0 : Ce.consumerId) || "")), $;
|
|
@@ -4583,7 +4583,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4583
4583
|
}
|
|
4584
4584
|
}
|
|
4585
4585
|
}, Pt = E(!0);
|
|
4586
|
-
|
|
4586
|
+
Se(y, ($) => {
|
|
4587
4587
|
var Y, re, me, Ce;
|
|
4588
4588
|
if (Array.isArray((Y = $ == null ? void 0 : $.response) == null ? void 0 : Y.data) && (Pt.value = $.response.data.length > 0), $.status === Fe.Error) {
|
|
4589
4589
|
F.value = {
|
|
@@ -4685,7 +4685,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4685
4685
|
}, 1024))), 128))
|
|
4686
4686
|
]),
|
|
4687
4687
|
_: 2
|
|
4688
|
-
}, 1024)) : (f(), T("span",
|
|
4688
|
+
}, 1024)) : (f(), T("span", xl, "-"))
|
|
4689
4689
|
]),
|
|
4690
4690
|
actions: b(({ row: Z }) => [
|
|
4691
4691
|
j(Vt, null, {
|
|
@@ -4706,7 +4706,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4706
4706
|
default: b(({ copyToClipboard: Pe }) => [
|
|
4707
4707
|
j(He, {
|
|
4708
4708
|
"data-testid": "action-entity-copy-json",
|
|
4709
|
-
onClick: (yr) =>
|
|
4709
|
+
onClick: (yr) => x(Z, Pe)
|
|
4710
4710
|
}, {
|
|
4711
4711
|
default: b(() => [
|
|
4712
4712
|
Q(N(h(i)("consumer_groups.actions.copy_json")), 1)
|
|
@@ -4816,7 +4816,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4816
4816
|
]);
|
|
4817
4817
|
};
|
|
4818
4818
|
}
|
|
4819
|
-
}), Rl = /* @__PURE__ */ Lt(
|
|
4819
|
+
}), Rl = /* @__PURE__ */ Lt(Sl, [["__scopeId", "data-v-31674321"]]), Il = { class: "kong-ui-entities-consumer-group-form" }, Al = { class: "select-item-container" }, $l = { class: "select-item-label" }, Tl = {
|
|
4820
4820
|
key: 0,
|
|
4821
4821
|
class: "select-item-description"
|
|
4822
4822
|
}, jl = /* @__PURE__ */ X({
|
|
@@ -4861,16 +4861,16 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4861
4861
|
searchKeys: ["username", "custom_id", "id"]
|
|
4862
4862
|
}), { axiosInstance: p } = Kt({
|
|
4863
4863
|
headers: (Be = t.config) == null ? void 0 : Be.requestHeaders
|
|
4864
|
-
}), { getMessageFromError: I } = gl(), w =
|
|
4864
|
+
}), { getMessageFromError: I } = gl(), w = S(() => v.value.map((C) => ({
|
|
4865
4865
|
label: C.username || C.custom_id,
|
|
4866
4866
|
value: C.id,
|
|
4867
4867
|
selected: o.fields.consumers.includes(C.id),
|
|
4868
4868
|
data: C
|
|
4869
4869
|
// we need this to determine whether or not to show the description text
|
|
4870
|
-
}))), _ =
|
|
4870
|
+
}))), _ = S(() => {
|
|
4871
4871
|
var C, P;
|
|
4872
4872
|
return (P = Te.form[(C = t.config) == null ? void 0 : C.app]) == null ? void 0 : P.edit;
|
|
4873
|
-
}), V =
|
|
4873
|
+
}), V = S(() => t.consumerGroupId ? rt.Edit : rt.Create), K = S(() => !!o.fields.name && !x.value), W = S(() => JSON.stringify(o.fields) !== JSON.stringify(s)), y = (C, P = "", ne = "") => {
|
|
4874
4874
|
var R, ce, ke, de, Ne, tt;
|
|
4875
4875
|
let H = `${(R = t.config) == null ? void 0 : R.apiBaseUrl}${Te.form[(ce = t.config) == null ? void 0 : ce.app][C]}`;
|
|
4876
4876
|
return ((ke = t.config) == null ? void 0 : ke.app) === "konnect" ? H = H.replace(/{controlPlaneId}/gi, ((de = t.config) == null ? void 0 : de.controlPlaneId) || "") : ((Ne = t.config) == null ? void 0 : Ne.app) === "kongManager" && (H = H.replace(/\/{workspace}/gi, (tt = t.config) != null && tt.workspace ? `/${t.config.workspace}` : "")), H = H.replace(/{id}/gi, P || t.consumerGroupId), (C === "addConsumer" || C === "removeConsumer") && (H = H.replace(/{consumerId}/gi, ne)), H;
|
|
@@ -4895,7 +4895,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4895
4895
|
A(de);
|
|
4896
4896
|
}
|
|
4897
4897
|
Object.assign(s, o.fields);
|
|
4898
|
-
},
|
|
4898
|
+
}, x = S(() => /^[0-9a-zA-Z.\-_~]*$/.test(o.fields.name) ? "" : a("consumer_groups.form.validation_errors.name")), z = S(() => {
|
|
4899
4899
|
var C, P;
|
|
4900
4900
|
return {
|
|
4901
4901
|
name: o.fields.name,
|
|
@@ -4970,7 +4970,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
4970
4970
|
"can-submit": K.value && W.value,
|
|
4971
4971
|
config: e.config,
|
|
4972
4972
|
"edit-id": e.consumerGroupId,
|
|
4973
|
-
"error-message": o.errorMessage || h(d) ||
|
|
4973
|
+
"error-message": o.errorMessage || h(d) || x.value,
|
|
4974
4974
|
"fetch-url": _.value,
|
|
4975
4975
|
"form-fields": z.value,
|
|
4976
4976
|
"is-readonly": o.readonly,
|
|
@@ -5080,7 +5080,7 @@ const Ji = { class: "yaml-config" }, fr = /* @__PURE__ */ X({
|
|
|
5080
5080
|
},
|
|
5081
5081
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
5082
5082
|
setup(e) {
|
|
5083
|
-
const n = e, { i18n: { t } } = ft.useI18n(), r =
|
|
5083
|
+
const n = e, { i18n: { t } } = ft.useI18n(), r = S(() => Te.form[n.config.app].edit), a = E({
|
|
5084
5084
|
id: {},
|
|
5085
5085
|
name: {},
|
|
5086
5086
|
created_at: {},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ne,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],t):(ne=typeof globalThis<"u"?globalThis:ne||self,t(ne["kong-ui-public-entities-consumer-groups"]={},ne.Vue,ne.VueRouter,ne["kong-ui-public-i18n"],ne.axios,ne.Kongponents))})(this,function(ne,t,Ge,$e,ft,qn){"use strict";const Ln={consumer_groups:{list:{table_headers:{name:"Name",consumers_count:"Consumers",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer Group",description:"Use consumer groups to manage custom rate limiting configuration for subsets of consumers.",title_for_consumer:"Add to a Consumer Group"},toolbar_actions:{new_consumer_group:"New Consumer Group"}},title:"Consumer Groups",search:{placeholder:"Filter by exact name or ID"},actions:{add_to_group:"Add to Consumer Group",create:"New Consumer Group",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",exit:"Exit",view:"View Details"},delete:{title:"Delete a Consumer Group",description:"Deleting this group will remove this group from all plugins and its rate limit configuration. This action cannot be reversed."},consumers:{add:{title:"Add To Consumer Groups",ctaText:"Add this consumer to consumer groups",consumer_groups_label:"Consumer Groups",consumer_group_placeholder:"Add to consumer groups",footer:"Search by exact name or ID to find consumer groups not included in the list"},exit:{title:"Exit from a Consumer Group",confirmation:"Are you sure you want to remove consumer {consumer} from consumer group {consumerGroup}?",confirmationNoUsername:"Are you sure you want this consumer to exit from consumer group {consumerGroup}?",description:"Exiting from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumer Groups could not be retrieved",delete:"The consumer group could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"The consumer could not be added to some groups at this time.",already_added:"The consumer is already in this consumer group",add_consumer:"An unexpected error occurred while adding consumers. Please try again.",remove_consumer:"An unexpected error occurred while removing consumers. Please try again."},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{general_info:{title:"General Information",description:"General information will help identify and manage this consumer group."},consumers:{title:"Consumers",description:"Add or remove consumers from this group"},fields:{name:{label:"Name",placeholder:"Enter a unique name for this consumer group "},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},consumers:{label:"Consumers",placeholder:"Select one or more consumers"}},validation_errors:{name:"The name can be any string containing letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."}}}};function Kn(){const e=$e.createI18n("en-us",Ln);return{i18n:e,i18nT:$e.i18nTComponent(e)}}const je={useI18n:Kn},se="/api/runtime_groups/{controlPlaneId}",ce="/{workspace}",ue={list:{konnect:{all:`${se}/consumer_groups`,forConsumer:`${se}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${se}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`},kongManager:{all:`${ce}/consumer_groups?counter=true`,forConsumer:`${ce}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${ce}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`}},form:{konnect:{consumersList:`${se}/consumers`,create:`${se}/consumer_groups`,edit:`${se}/consumer_groups/{id}`,addConsumer:`${se}/consumer_groups/{id}/consumers`,removeConsumer:`${se}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${se}/consumer_groups/{id}/consumers`},kongManager:{consumersList:`${ce}/consumers`,create:`${ce}/consumer_groups`,edit:`${ce}/consumer_groups/{id}`,addConsumer:`${ce}/consumer_groups/{id}/consumers`,removeConsumer:`${ce}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${ce}/consumer_groups/{id}/consumers`}}};var mt=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(mt||{}),Me=(e=>(e.Edit="edit",e.Create="create",e))(Me||{}),ge=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(ge||{}),K=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(K||{}),re=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(re||{});function Pn(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance",void 0);return typeof r=="function"?r(e):ft.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),ft.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var r;return((r=e==null?void 0:e.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}function Un(){return{debounce:(e,r)=>{let n;return(...o)=>{clearTimeout(n),n=window==null?void 0:window.setTimeout(()=>{e(...o)},r)}}}}const He="khcp-user-table-preferences",Rn={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function zn(){const e=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(o){console.error("useTablePreferences(tryParseJson)",o);return}},r=()=>{const n=e(localStorage.getItem(He));return!n||!Object.keys(n).length?new Map:new Map(Object.entries(n))};return{setTablePreferences:(n,o)=>{try{const a=r();a.set(n,o),localStorage.setItem(He,JSON.stringify(Object.fromEntries(a.entries())))}catch(a){console.error("useTablePreferences(setTablePreferences)",a)}},getTablePreferences:n=>{const o=r();return(o==null?void 0:o.get(n))||void 0||Rn},deleteAllTablePreferences:()=>{localStorage.removeItem(He)}}}function Je(e={}){const{getAxiosInstance:r}=Pn();return{axiosInstance:r(e)}}const Gn={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Hn={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Jn={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},Yn={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Wn={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},Zn={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Qn={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Xn={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},er={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},tr={global:Gn,deleteModal:Hn,baseForm:Jn,baseTable:Yn,baseConfigCard:Wn,filter:Zn,debouncedFilter:Qn,errors:Xn,toggleModal:er};function Ye(){const e=$e.createI18n("en-us",tr);return{i18n:e,i18nT:$e.i18nTComponent(e)}}function gt(){const e=(n,o)=>(o==null?void 0:o[n])??void 0,r=(n,o)=>{if(n.length!==o.length)return!1;const a=new Set([...n,...o]);for(const l of a){const i=n.filter(c=>c===l).length,s=o.filter(c=>c===l).length;if(i!==s)return!1}return!0};return{getPropValue:e,objectsAreEqual:(n,o,a)=>{if(a){if(Object.keys(n).length===Object.keys(o).length)for(const l in n)if(Array.isArray(n[l])&&Array.isArray(o[l])){if(r(n[l],o[l]))continue;return!1}else{if(n[l]===o[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(n)===JSON.stringify(o)}catch{return!1}},sortAlpha:n=>(o,a)=>{let l=o[n]===void 0||o[n]===null?"":o[n],i=a[n]===void 0||a[n]===null?"":a[n];return Array.isArray(o[n])&&(l=o[n][0]),Array.isArray(a[n])&&(i=a[n][0]),l.localeCompare(i)},isValidUuid:n=>n?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(n):!1}}function nr(e,r,n,o={fetchedItemsKey:"data",searchKeys:["id"]}){n||(n="100");const{axiosInstance:a}=Je({headers:e.requestHeaders}),{i18n:{t:l}}=Ye(),{debounce:i}=Un(),s=i(async h=>{await q(h)},200),c=t.ref(!1),d=t.ref(""),p=t.ref(""),u=t.ref([]),y=t.ref([]),f=t.ref(void 0),S=t.unref(r);let C=`${e.apiBaseUrl}${S}`;e.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:w}=gt(),j=async()=>{try{c.value=!0;const{data:h}=await a.get(`${C}?size=${n}`);h!=null&&h.next||(f.value=o.fetchedItemsKey in h?h[o.fetchedItemsKey]:[]),y.value=o.fetchedItemsKey in h?h[o.fetchedItemsKey]:[],u.value=y.value}catch{u.value=[],d.value=l("debouncedFilter.errors.fetch")}finally{c.value=!1}},V=t.ref(""),q=async h=>{var m,g,A;if(V.value!==h)if(V.value=h||"",f.value===void 0)try{if(c.value=!0,d.value="",p.value="",e.app==="konnect"){let T=C+"";h&&(T+=`/${h}`);const{data:x}=await a.get(`${T}?size=${n}`);o.fetchedItemsKey in x?u.value=x[o.fetchedItemsKey]:x!=null&&x.id?u.value=[x]:u.value=[]}else if(h){const T=[];w(h)&&o.searchKeys.includes("id")?T.push((async()=>{const{data:N}=await a.get(`${C}/${h}`);return[N[o.fetchedItemsKey]??N]})()):T.push(...o.searchKeys.filter(N=>N!=="id").map(async N=>{const{data:b}=await a.get(`${C}?${N}=${h}`);return b[o.fetchedItemsKey]}));const x=await Promise.all(T),O=new Set;u.value=[],(m=x==null?void 0:x.forEach)==null||m.call(x,N=>{var b;(b=N==null?void 0:N.forEach)==null||b.call(N,_=>{O.has(_.id)||(O.add(_.id),u.value.push(_))})})}else u.value=y.value}catch(T){((g=T==null?void 0:T.response)==null?void 0:g.status)===404?p.value=l("debouncedFilter.errors.invalid"):(u.value=[],d.value=l("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",h?(u.value=(A=f.value)==null?void 0:A.filter(T=>{var x;let O=!1;for(const N of o.searchKeys){const b=typeof T[N]=="string"?(x=T[N])==null?void 0:x.toLowerCase():T[N];b!=null&&b.includes(h.toLowerCase())&&(O=!0)}return O}),(!u.value||!u.value.length)&&(p.value=l("debouncedFilter.errors.invalid"))):u.value=f.value,c.value=!1};return{loading:c,error:d,validationError:p,results:u,allRecords:f,loadItems:j,debouncedQueryChange:s}}function rr(e,r){const n=t.unref(r),o=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${n}`):new URL(n));return o.value.search="",a=>`${o.value.href}/${a}`}function or(){const{i18n:{t:e}}=Ye();return{getMessageFromError:r=>{var n,o,a,l;if(!r)return e("errors.unexpected");if(((n=r==null?void 0:r.response)==null?void 0:n.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((o=r==null?void 0:r.response)!=null&&o.data){if(r.response.data.detail)return r.response.data.detail;if((a=r.response.data.details)!=null&&a.length)return r.response.data.details.map(i=>{let s=e("errors.unexpected");return i.messages&&typeof i.messages=="object"&&i.messages.length&&(s=i.messages.join(", ")),i.field?`${i.field} - ${s}`:s}).join("; ");if(r.response.data.message){const{message:i}=r.response.data;return Array.isArray(i)?(l=i[0])!=null&&l.constraints?Object.values(i[0].constraints)[0]:i[0]:i}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(i=>`${i} ${r.response.data[i]}`).join(", ")}return r.message||e("errors.unexpected")}}}function ar(e){const r=window.location.origin,n=r.endsWith("/")?r:`${r}/`;try{const o=e.join("/"),a=`${n}${o}`,l=e.some(i=>i.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(a)&&!l&&new URL(a))return`${n}${o}`;throw new Error("Invalid url")}catch(o){return console.warn("Failed to build valid URL:",o),""}}function ht(e,r){const n=t.ref(t.unref(e)),o=t.ref(t.unref(r)),a=t.computed(()=>!!(n.value.app==="konnect"||n.value.isExactMatch)),l=t.computed(()=>o.value.startsWith("/")?new URL(`${window.location.origin}${o.value}`):new URL(o.value));return i=>{const{page:s,pageSize:c,offset:d,sortColumnKey:p,sortColumnOrder:u,query:y}=i;try{let f=new URL(l.value.href);return a.value&&y?(f.search="",f=n.value.app==="konnect"?new URL(`${f.href}?filter[name][contains]=${y}`):new URL(`${f.href}/${y}/`)):(a.value||new URLSearchParams(y).forEach((S,C)=>{f.searchParams.append(C,S)}),p&&f.searchParams.append("sort_by",p),u==="desc"&&f.searchParams.append("sort_desc","1"),f.searchParams.append("size",String(c))),d&&s!==1&&f.searchParams.append("offset",String(d)),f.href}catch(f){return console.error("RouteList(fetcher)",f),o.value}}}function ir(e,r,n="data"){const o=t.unref(r),{axiosInstance:a}=Je({headers:e.requestHeaders}),l=ht(e,o),i=t.ref({status:ge.Idle});return{fetcher:async s=>{try{i.value={status:ge.Loading};let c=l(s);c.includes("filter[name]")&&(c=`${c}&page[size]=${s.pageSize}&page[number]=${s.page}`);const{data:d}=await a.get(c),p=n&&n.replace(/[^\w-_]/gi,"");let u;d[p]&&Array.isArray(d[p])?u=d[p]:Array.isArray(d)?u=d:u=Object.keys(d).length?[d]:[];const y={data:u,total:u.length,...d.offset?{pagination:{offset:d.offset}}:null};return i.value={status:ge.Idle,response:y},y}catch(c){const d={data:[],total:0};return s.query&&c.response.status===404?(i.value={status:ge.NoResults,response:d,error:c},d):(i.value={status:ge.Error,response:d,error:c},d)}},fetcherState:i}}function lr(){const e=(n,o="_")=>n?n.split(o).map(a=>a.toLowerCase()==="id"?a.toUpperCase():a.charAt(0).toUpperCase()+a.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:n=>n?n.replace(r,o=>o.toUpperCase()):"",convertKeyToTitle:e}}const yt=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,bt=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(yt);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},kt=e=>e==="*"||e==="x"||e==="X",Ct=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},sr=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],cr=(e,r)=>{if(kt(e)||kt(r))return 0;const[n,o]=sr(Ct(e),Ct(r));return n>o?1:n<o?-1:0},wt=(e,r)=>{for(let n=0;n<Math.max(e.length,r.length);n++){const o=cr(e[n]||"0",r[n]||"0");if(o!==0)return o}return 0},dr=(e,r)=>{const n=bt(e),o=bt(r),a=n.pop(),l=o.pop(),i=wt(n,o);return i!==0?i:a&&l?wt(a.split("."),l.split(".")):a||l?a?-1:1:0},xt=(e,r,n)=>{ur(n);const o=dr(e,r);return St[n].includes(o)},St={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},_t=Object.keys(St),ur=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(_t.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${_t.join("|")}`)},pr=e=>typeof e=="string"&&/^[v\d]/.test(e)&&yt.test(e);function fr(e){const{gatewayInfo:r,supportedRange:n}=e;if(!r)return!0;const{edition:o,version:a}=r;if(!pr(a))return console.error("Invalid version"),!1;const l=n[o];if(!l)return!1;const[i,s]=l;return!(i&&xt(a,i,"<")||s&&xt(a,s,">"))}function mr(e){const r=t.ref(0),n=t.ref(0),o=t.ref(!1);return t.watch(e,a=>{a&&!o.value&&(r.value=a.offsetWidth,n.value=a.scrollWidth,o.value=!0)}),{isTruncated:t.computed(()=>r.value<n.value)}}const H={useAxios:Je,useDebouncedFilter:nr,useDeleteUrlBuilder:rr,useErrors:or,useExternalLinkCreator:ar,useFetcher:ir,useFetchUrlBuilder:ht,useHelpers:gt,useStringHelpers:lr,useI18n:Ye,useGatewayFeatureSupported:fr,useTruncationDetector:mr},gr={key:0,class:"config-card-fieldset-title"},hr=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:n}}=H.useI18n(),{convertKeyToTitle:o}=H.useStringHelpers(),a=t.computed(()=>r.item.key??"json-array-item"),l=t.computed(()=>r.item.value??r.item),i=t.computed(()=>{const c=JSON.parse(JSON.stringify(l.value));return r.isArrayItem&&delete c.name,c}),s=t.computed(()=>{var c;return r.isArrayItem?(c=l.value)!=null&&c.name?o(l.value.name,"_"):n("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",gr,[t.createElementVNode("b",null,t.toDisplayString(s.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(i.value),(p,u)=>(t.openBlock(),t.createBlock(It,{key:`${a.value}-property-${u}`,item:{key:p,label:t.unref(o)(p),value:i.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),oe=(e,r)=>{const n=e.__vccOpts||e;for(const[o,a]of r)n[o]=a;return n},Bt=oe(hr,[["__scopeId","data-v-68ca83ec"]]),yr=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=H.useI18n();return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(a,{appearance:"tertiary",class:"navigation-button",onClick:o[0]||(o[0]=l=>n.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),br=oe(yr,[["__scopeId","data-v-c96811e5"]]),kr=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=H.useI18n();return(n,o)=>{const a=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(a,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Cr="#0044f4",wr="#e0e4ea",xr="#3a3f51",Sr="#afb7c5",_r="1px",Br="20px",Ir={class:"config-card-details-row"},Nr=["data-testid"],Ar=["data-testid"],Er=["data-testid"],Vr=["data-testid"],Tr={key:1},$r=["data-testid"],jr=["data-testid"],Mr=["data-testid"],Or=["data-testid"],vr={name:"ConfigCardItem",components:{JsonCardItem:Bt,StatusBadge:kr,InternalLinkItem:br}},Fr=t.defineComponent({...vr,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:r}){t.useCssVars(S=>({"07753575":p.value?"none":`solid ${t.unref(_r)} ${t.unref(wr)}`,"32d44ea8":d.value&&s.value?"block":"flex","5036b738":d.value&&s.value?"100%":n.slim?"50%":"25%","5038fd13":d.value&&s.value?"100%":n.slim?"50%":"75%"}));const n=e,o=r,a=t.useSlots(),{i18n:{t:l,formatUnixTimeStamp:i}}=H.useI18n(),s=t.computed(()=>n.item.value!==void 0&&n.item.value!==null&&n.item.value!==""),c=t.computed(()=>!!(n.item.tooltip||a["label-tooltip"])),d=t.computed(()=>n.item.type===K.Json||n.item.type===K.JsonArray),p=t.computed(()=>n.item.type===K.JsonArray),u=t.computed(()=>{switch(n.item.type){case K.ID:return{tag:"KCopy",attrs:{"data-testid":`${n.item.key}-copy-uuid`,"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:n.item.label}),text:n.item.value}};case K.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:n.item.label})}};case K.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${n.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":l("baseConfigCard.copy.tooltip",{label:n.item.label}),text:n.item.value}};case K.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":l("baseConfigCard.copy.tooltip",{label:n.item.label})}};case K.Date:return{tag:"div",attrs:{"data-testid":`${n.item.key}-date`},text:i(n.item.value)};case K.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${n.item.key}-badge-status`,status:n.item.value}};case K.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case K.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case K.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${n.item.key}-internal-link`,item:n.item,onNavigationClick:S=>{o("navigation-click",S)}}};case K.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${n.item.key}-external-link`,href:n.item.value},text:n.item.value};case K.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-content`,item:n.item}};case K.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-array-content`,item:n.item}};default:return{tag:"div",attrs:{"data-testid":`${n.item.key}-plain-text`},text:n.item.value}}}),y=t.ref(),{isTruncated:f}=H.useTruncationDetector(y);return(S,C)=>{const w=t.resolveComponent("KLabel"),j=t.resolveComponent("KBadge"),V=t.resolveComponent("KCopy"),q=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",Ir,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(S.$slots,"label",{item:e.item},()=>[t.createVNode(w,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(S.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,Ar)]),key:"0"}:void 0]),1024)],!0)],8,Nr),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(S.$slots,e.item.key,{rowValue:e.item.value},()=>[s.value?(t.openBlock(),t.createElementBlock("div",Tr,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(h,m)=>(t.openBlock(),t.createBlock(j,{key:`${e.item.key}-badge-tag-${m}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${m}`,tooltip:h,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(h),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,$r)):t.createCommentVNode("",!0),u.value.additionalComponent==="KCopy"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(h,m)=>(t.openBlock(),t.createBlock(V,t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${m}`,"data-testid":`${e.item.key}-copy-uuid-${m}`,text:h}),null,16,["data-testid","text"]))),128))],8,jr)):u.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(h,m)=>(t.openBlock(),t.createBlock(j,{key:`${e.item.key}-badge-method-${m}`,appearance:Object.values(t.unref(qn.BadgeMethodAppearances)).includes(h.toLowerCase())?h.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${m}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(h),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Mr)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${n.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(h,m)=>(t.openBlock(),t.createBlock(Bt,{key:`json-array-item-${m}`,index:m,"is-array-item":"",item:h},null,8,["index","item"]))),128))],8,Or)):(t.openBlock(),t.createBlock(q,{key:4,text:t.unref(f)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:y,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Vr))],!0)],8,Er)])}}}),It=oe(Fr,[["__scopeId","data-v-d056663c"]]),Dr={class:"json-config"},qr={key:0,class:"json-endpoint"},Nt=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(a=>({"2d178975":`${o.value}ch`}));const r=e,n=t.computed(()=>r.jsonRecord),o=t.computed(()=>{var a;if(!r.fetcherUrl)return 0;const l=(a=r.fetcherUrl)==null?void 0:a.split("/");return l.length<2?0:41+(r.requestMethod==="post"?l[l.length-1]:l[l.length-2]).length});return(a,l)=>{var i;const s=t.resolveComponent("KBadge"),c=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Dr,[r.fetcherUrl&&(i=r.config)!=null&&i.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",qr,[t.createVNode(s,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(c,{id:"json-endpoint-codeblock",code:r.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.jsonRecord?(t.openBlock(),t.createBlock(c,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(n.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function At(e){return typeof e>"u"||e===null}function Lr(e){return typeof e=="object"&&e!==null}function Kr(e){return Array.isArray(e)?e:At(e)?[]:[e]}function Pr(e,r){var n,o,a,l;if(r)for(l=Object.keys(r),n=0,o=l.length;n<o;n+=1)a=l[n],e[a]=r[a];return e}function Ur(e,r){var n="",o;for(o=0;o<r;o+=1)n+=e;return n}function Rr(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var zr=At,Gr=Lr,Hr=Kr,Jr=Ur,Yr=Rr,Wr=Pr,G={isNothing:zr,isObject:Gr,toArray:Hr,repeat:Jr,isNegativeZero:Yr,extend:Wr};function Et(e,r){var n="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(n+=`
|
|
1
|
+
(function(ne,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],t):(ne=typeof globalThis<"u"?globalThis:ne||self,t(ne["kong-ui-public-entities-consumer-groups"]={},ne.Vue,ne.VueRouter,ne["kong-ui-public-i18n"],ne.axios,ne.Kongponents))})(this,function(ne,t,Ge,$e,ft,qn){"use strict";const Ln={consumer_groups:{list:{table_headers:{name:"Name",consumers_count:"Consumers",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer Group",description:"Use consumer groups to manage custom rate limiting configuration for subsets of consumers.",title_for_consumer:"Add to a Consumer Group"},toolbar_actions:{new_consumer_group:"New Consumer Group"}},title:"Consumer Groups",search:{placeholder:"Filter by exact name or ID"},actions:{add_to_group:"Add to Consumer Group",create:"New Consumer Group",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",exit:"Exit",view:"View Details"},delete:{title:"Delete a Consumer Group",description:"Deleting this group will remove this group from all plugins and its rate limit configuration. This action cannot be reversed."},consumers:{add:{title:"Add To Consumer Groups",ctaText:"Add this consumer to consumer groups",consumer_groups_label:"Consumer Groups",consumer_group_placeholder:"Add to consumer groups",footer:"Search by exact name or ID to find consumer groups not included in the list"},exit:{title:"Exit from a Consumer Group",confirmation:"Are you sure you want to remove consumer {consumer} from consumer group {consumerGroup}?",confirmationNoUsername:"Are you sure you want this consumer to exit from consumer group {consumerGroup}?",description:"Exiting from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumer Groups could not be retrieved",delete:"The consumer group could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"The consumer could not be added to some groups at this time.",already_added:"The consumer is already in this consumer group",add_consumer:"An unexpected error occurred while adding consumers. Please try again.",remove_consumer:"An unexpected error occurred while removing consumers. Please try again."},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{general_info:{title:"General Information",description:"General information will help identify and manage this consumer group."},consumers:{title:"Consumers",description:"Add or remove consumers from this group"},fields:{name:{label:"Name",placeholder:"Enter a unique name for this consumer group "},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},consumers:{label:"Consumers",placeholder:"Select one or more consumers"}},validation_errors:{name:"The name can be any string containing letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."}}}};function Kn(){const e=$e.createI18n("en-us",Ln);return{i18n:e,i18nT:$e.i18nTComponent(e)}}const je={useI18n:Kn},se="/api/runtime_groups/{controlPlaneId}",ce="/{workspace}",ue={list:{konnect:{all:`${se}/consumer_groups`,forConsumer:`${se}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${se}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`},kongManager:{all:`${ce}/consumer_groups?counter=true`,forConsumer:`${ce}/consumers/{consumerId}/consumer_groups`,oneForConsumer:`${ce}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`}},form:{konnect:{consumersList:`${se}/consumers`,create:`${se}/consumer_groups`,edit:`${se}/consumer_groups/{id}`,addConsumer:`${se}/consumer_groups/{id}/consumers`,removeConsumer:`${se}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${se}/consumer_groups/{id}/consumers`},kongManager:{consumersList:`${ce}/consumers`,create:`${ce}/consumer_groups`,edit:`${ce}/consumer_groups/{id}`,addConsumer:`${ce}/consumer_groups/{id}/consumers`,removeConsumer:`${ce}/consumer_groups/{id}/consumers/{consumerId}`,getConsumers:`${ce}/consumer_groups/{id}/consumers`}}};var mt=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(mt||{}),Me=(e=>(e.Edit="edit",e.Create="create",e))(Me||{}),ge=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(ge||{}),K=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(K||{}),re=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(re||{});function Pn(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance",void 0);return typeof r=="function"?r(e):ft.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),ft.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var r;return((r=e==null?void 0:e.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}function Un(){return{debounce:(e,r)=>{let n;return(...o)=>{clearTimeout(n),n=window==null?void 0:window.setTimeout(()=>{e(...o)},r)}}}}const He="khcp-user-table-preferences",Rn={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function zn(){const e=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(o){console.error("useTablePreferences(tryParseJson)",o);return}},r=()=>{const n=e(localStorage.getItem(He));return!n||!Object.keys(n).length?new Map:new Map(Object.entries(n))};return{setTablePreferences:(n,o)=>{try{const a=r();a.set(n,o),localStorage.setItem(He,JSON.stringify(Object.fromEntries(a.entries())))}catch(a){console.error("useTablePreferences(setTablePreferences)",a)}},getTablePreferences:n=>{const o=r();return(o==null?void 0:o.get(n))||void 0||Rn},deleteAllTablePreferences:()=>{localStorage.removeItem(He)}}}function Je(e={}){const{getAxiosInstance:r}=Pn();return{axiosInstance:r(e)}}const Gn={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Hn={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Jn={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},Yn={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Wn={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},Zn={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Qn={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Xn={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},er={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},tr={global:Gn,deleteModal:Hn,baseForm:Jn,baseTable:Yn,baseConfigCard:Wn,filter:Zn,debouncedFilter:Qn,errors:Xn,toggleModal:er};function Ye(){const e=$e.createI18n("en-us",tr);return{i18n:e,i18nT:$e.i18nTComponent(e)}}function gt(){const e=(n,o)=>(o==null?void 0:o[n])??void 0,r=(n,o)=>{if(n.length!==o.length)return!1;const a=new Set([...n,...o]);for(const l of a){const i=n.filter(c=>c===l).length,s=o.filter(c=>c===l).length;if(i!==s)return!1}return!0};return{getPropValue:e,objectsAreEqual:(n,o,a)=>{if(a){if(Object.keys(n).length===Object.keys(o).length)for(const l in n)if(Array.isArray(n[l])&&Array.isArray(o[l])){if(r(n[l],o[l]))continue;return!1}else{if(n[l]===o[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(n)===JSON.stringify(o)}catch{return!1}},sortAlpha:n=>(o,a)=>{let l=o[n]===void 0||o[n]===null?"":o[n],i=a[n]===void 0||a[n]===null?"":a[n];return Array.isArray(o[n])&&(l=o[n][0]),Array.isArray(a[n])&&(i=a[n][0]),l.localeCompare(i)},isValidUuid:n=>n?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(n):!1}}function nr(e,r,n,o={fetchedItemsKey:"data",searchKeys:["id"]}){n||(n="100");const{axiosInstance:a}=Je({headers:e.requestHeaders}),{i18n:{t:l}}=Ye(),{debounce:i}=Un(),s=i(async h=>{await q(h)},200),c=t.ref(!1),d=t.ref(""),p=t.ref(""),u=t.ref([]),y=t.ref([]),f=t.ref(void 0),S=t.unref(r);let C=`${e.apiBaseUrl}${S}`;e.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:w}=gt(),j=async()=>{try{c.value=!0;const{data:h}=await a.get(`${C}?size=${n}`);h!=null&&h.next||(f.value=o.fetchedItemsKey in h?h[o.fetchedItemsKey]:[]),y.value=o.fetchedItemsKey in h?h[o.fetchedItemsKey]:[],u.value=y.value}catch{u.value=[],d.value=l("debouncedFilter.errors.fetch")}finally{c.value=!1}},V=t.ref(""),q=async h=>{var m,g,A;if(V.value!==h)if(V.value=h||"",f.value===void 0)try{if(c.value=!0,d.value="",p.value="",e.app==="konnect"){let T=C+"";h&&(T+=`/${h}`);const{data:x}=await a.get(`${T}?size=${n}`);o.fetchedItemsKey in x?u.value=x[o.fetchedItemsKey]:x!=null&&x.id?u.value=[x]:u.value=[]}else if(h){const T=[];w(h)&&o.searchKeys.includes("id")?T.push((async()=>{const{data:N}=await a.get(`${C}/${h}`);return[N[o.fetchedItemsKey]??N]})()):T.push(...o.searchKeys.filter(N=>N!=="id").map(async N=>{const{data:b}=await a.get(`${C}?${N}=${h}`);return b[o.fetchedItemsKey]}));const x=await Promise.all(T),O=new Set;u.value=[],(m=x==null?void 0:x.forEach)==null||m.call(x,N=>{var b;(b=N==null?void 0:N.forEach)==null||b.call(N,_=>{O.has(_.id)||(O.add(_.id),u.value.push(_))})})}else u.value=y.value}catch(T){((g=T==null?void 0:T.response)==null?void 0:g.status)===404?p.value=l("debouncedFilter.errors.invalid"):(u.value=[],d.value=l("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",h?(u.value=(A=f.value)==null?void 0:A.filter(T=>{var x;let O=!1;for(const N of o.searchKeys){const b=typeof T[N]=="string"?(x=T[N])==null?void 0:x.toLowerCase():T[N];b!=null&&b.includes(h.toLowerCase())&&(O=!0)}return O}),(!u.value||!u.value.length)&&(p.value=l("debouncedFilter.errors.invalid"))):u.value=f.value,c.value=!1};return{loading:c,error:d,validationError:p,results:u,allRecords:f,loadItems:j,debouncedQueryChange:s}}function rr(e,r){const n=t.unref(r),o=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${n}`):new URL(n));return o.value.search="",a=>`${o.value.href}/${a}`}function or(){const{i18n:{t:e}}=Ye();return{getMessageFromError:r=>{var n,o,a,l;if(!r)return e("errors.unexpected");if(((n=r==null?void 0:r.response)==null?void 0:n.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((o=r==null?void 0:r.response)!=null&&o.data){if(r.response.data.detail)return r.response.data.detail;if((a=r.response.data.details)!=null&&a.length)return r.response.data.details.map(i=>{let s=e("errors.unexpected");return i.messages&&typeof i.messages=="object"&&i.messages.length&&(s=i.messages.join(", ")),i.field?`${i.field} - ${s}`:s}).join("; ");if(r.response.data.message){const{message:i}=r.response.data;return Array.isArray(i)?(l=i[0])!=null&&l.constraints?Object.values(i[0].constraints)[0]:i[0]:i}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(i=>`${i} ${r.response.data[i]}`).join(", ")}return r.message||e("errors.unexpected")}}}function ar(e){const r=window.location.origin,n=r.endsWith("/")?r:`${r}/`;try{const o=e.join("/"),a=`${n}${o}`,l=e.some(i=>i.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(a)&&!l&&new URL(a))return`${n}${o}`;throw new Error("Invalid url")}catch(o){return console.warn("Failed to build valid URL:",o),""}}function ht(e,r){const n=t.ref(t.unref(e)),o=t.ref(t.unref(r)),a=t.computed(()=>!!(n.value.app==="konnect"||n.value.isExactMatch)),l=t.computed(()=>o.value.startsWith("/")?new URL(`${window.location.origin}${o.value}`):new URL(o.value));return i=>{const{page:s,pageSize:c,offset:d,sortColumnKey:p,sortColumnOrder:u,query:y}=i;try{let f=new URL(l.value.href);return a.value&&y?(f.search="",f=n.value.isExactMatch?new URL(`${f.href}/${y}/`):new URL(`${f.href}?filter[name][contains]=${y}`)):(a.value||new URLSearchParams(y).forEach((S,C)=>{f.searchParams.append(C,S)}),p&&f.searchParams.append("sort_by",p),u==="desc"&&f.searchParams.append("sort_desc","1"),f.searchParams.append("size",String(c))),d&&s!==1&&f.searchParams.append("offset",String(d)),f.href}catch(f){return console.error("RouteList(fetcher)",f),o.value}}}function ir(e,r,n="data"){const o=t.unref(r),{axiosInstance:a}=Je({headers:e.requestHeaders}),l=ht(e,o),i=t.ref({status:ge.Idle});return{fetcher:async s=>{try{i.value={status:ge.Loading};let c=l(s);c.includes("filter[name]")&&(c=`${c}&page[size]=${s.pageSize}&page[number]=${s.page}`);const{data:d}=await a.get(c),p=n&&n.replace(/[^\w-_]/gi,"");let u;d[p]&&Array.isArray(d[p])?u=d[p]:Array.isArray(d)?u=d:u=Object.keys(d).length?[d]:[];const y={data:u,total:u.length,...d.offset?{pagination:{offset:d.offset}}:null};return i.value={status:ge.Idle,response:y},y}catch(c){const d={data:[],total:0};return s.query&&c.response.status===404?(i.value={status:ge.NoResults,response:d,error:c},d):(i.value={status:ge.Error,response:d,error:c},d)}},fetcherState:i}}function lr(){const e=(n,o="_")=>n?n.split(o).map(a=>a.toLowerCase()==="id"?a.toUpperCase():a.charAt(0).toUpperCase()+a.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:n=>n?n.replace(r,o=>o.toUpperCase()):"",convertKeyToTitle:e}}const yt=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,bt=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(yt);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},kt=e=>e==="*"||e==="x"||e==="X",Ct=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},sr=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],cr=(e,r)=>{if(kt(e)||kt(r))return 0;const[n,o]=sr(Ct(e),Ct(r));return n>o?1:n<o?-1:0},wt=(e,r)=>{for(let n=0;n<Math.max(e.length,r.length);n++){const o=cr(e[n]||"0",r[n]||"0");if(o!==0)return o}return 0},dr=(e,r)=>{const n=bt(e),o=bt(r),a=n.pop(),l=o.pop(),i=wt(n,o);return i!==0?i:a&&l?wt(a.split("."),l.split(".")):a||l?a?-1:1:0},xt=(e,r,n)=>{ur(n);const o=dr(e,r);return St[n].includes(o)},St={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},_t=Object.keys(St),ur=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(_t.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${_t.join("|")}`)},pr=e=>typeof e=="string"&&/^[v\d]/.test(e)&&yt.test(e);function fr(e){const{gatewayInfo:r,supportedRange:n}=e;if(!r)return!0;const{edition:o,version:a}=r;if(!pr(a))return console.error("Invalid version"),!1;const l=n[o];if(!l)return!1;const[i,s]=l;return!(i&&xt(a,i,"<")||s&&xt(a,s,">"))}function mr(e){const r=t.ref(0),n=t.ref(0),o=t.ref(!1);return t.watch(e,a=>{a&&!o.value&&(r.value=a.offsetWidth,n.value=a.scrollWidth,o.value=!0)}),{isTruncated:t.computed(()=>r.value<n.value)}}const H={useAxios:Je,useDebouncedFilter:nr,useDeleteUrlBuilder:rr,useErrors:or,useExternalLinkCreator:ar,useFetcher:ir,useFetchUrlBuilder:ht,useHelpers:gt,useStringHelpers:lr,useI18n:Ye,useGatewayFeatureSupported:fr,useTruncationDetector:mr},gr={key:0,class:"config-card-fieldset-title"},hr=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:n}}=H.useI18n(),{convertKeyToTitle:o}=H.useStringHelpers(),a=t.computed(()=>r.item.key??"json-array-item"),l=t.computed(()=>r.item.value??r.item),i=t.computed(()=>{const c=JSON.parse(JSON.stringify(l.value));return r.isArrayItem&&delete c.name,c}),s=t.computed(()=>{var c;return r.isArrayItem?(c=l.value)!=null&&c.name?o(l.value.name,"_"):n("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",gr,[t.createElementVNode("b",null,t.toDisplayString(s.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(i.value),(p,u)=>(t.openBlock(),t.createBlock(It,{key:`${a.value}-property-${u}`,item:{key:p,label:t.unref(o)(p),value:i.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),oe=(e,r)=>{const n=e.__vccOpts||e;for(const[o,a]of r)n[o]=a;return n},Bt=oe(hr,[["__scopeId","data-v-68ca83ec"]]),yr=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=H.useI18n();return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(a,{appearance:"tertiary",class:"navigation-button",onClick:o[0]||(o[0]=l=>n.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),br=oe(yr,[["__scopeId","data-v-c96811e5"]]),kr=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=H.useI18n();return(n,o)=>{const a=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(a,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Cr="#0044f4",wr="#e0e4ea",xr="#3a3f51",Sr="#afb7c5",_r="1px",Br="20px",Ir={class:"config-card-details-row"},Nr=["data-testid"],Ar=["data-testid"],Er=["data-testid"],Vr=["data-testid"],Tr={key:1},$r=["data-testid"],jr=["data-testid"],Mr=["data-testid"],Or=["data-testid"],vr={name:"ConfigCardItem",components:{JsonCardItem:Bt,StatusBadge:kr,InternalLinkItem:br}},Fr=t.defineComponent({...vr,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:r}){t.useCssVars(S=>({"07753575":p.value?"none":`solid ${t.unref(_r)} ${t.unref(wr)}`,"32d44ea8":d.value&&s.value?"block":"flex","5036b738":d.value&&s.value?"100%":n.slim?"50%":"25%","5038fd13":d.value&&s.value?"100%":n.slim?"50%":"75%"}));const n=e,o=r,a=t.useSlots(),{i18n:{t:l,formatUnixTimeStamp:i}}=H.useI18n(),s=t.computed(()=>n.item.value!==void 0&&n.item.value!==null&&n.item.value!==""),c=t.computed(()=>!!(n.item.tooltip||a["label-tooltip"])),d=t.computed(()=>n.item.type===K.Json||n.item.type===K.JsonArray),p=t.computed(()=>n.item.type===K.JsonArray),u=t.computed(()=>{switch(n.item.type){case K.ID:return{tag:"KCopy",attrs:{"data-testid":`${n.item.key}-copy-uuid`,"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:n.item.label}),text:n.item.value}};case K.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":l("baseConfigCard.copy.tooltip",{label:n.item.label})}};case K.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${n.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":l("baseConfigCard.copy.tooltip",{label:n.item.label}),text:n.item.value}};case K.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":l("baseConfigCard.copy.tooltip",{label:n.item.label})}};case K.Date:return{tag:"div",attrs:{"data-testid":`${n.item.key}-date`},text:i(n.item.value)};case K.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${n.item.key}-badge-status`,status:n.item.value}};case K.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case K.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case K.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${n.item.key}-internal-link`,item:n.item,onNavigationClick:S=>{o("navigation-click",S)}}};case K.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${n.item.key}-external-link`,href:n.item.value},text:n.item.value};case K.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-content`,item:n.item}};case K.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-array-content`,item:n.item}};default:return{tag:"div",attrs:{"data-testid":`${n.item.key}-plain-text`},text:n.item.value}}}),y=t.ref(),{isTruncated:f}=H.useTruncationDetector(y);return(S,C)=>{const w=t.resolveComponent("KLabel"),j=t.resolveComponent("KBadge"),V=t.resolveComponent("KCopy"),q=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",Ir,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(S.$slots,"label",{item:e.item},()=>[t.createVNode(w,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(S.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,Ar)]),key:"0"}:void 0]),1024)],!0)],8,Nr),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(S.$slots,e.item.key,{rowValue:e.item.value},()=>[s.value?(t.openBlock(),t.createElementBlock("div",Tr,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(h,m)=>(t.openBlock(),t.createBlock(j,{key:`${e.item.key}-badge-tag-${m}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${m}`,tooltip:h,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(h),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,$r)):t.createCommentVNode("",!0),u.value.additionalComponent==="KCopy"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(h,m)=>(t.openBlock(),t.createBlock(V,t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${m}`,"data-testid":`${e.item.key}-copy-uuid-${m}`,text:h}),null,16,["data-testid","text"]))),128))],8,jr)):u.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(h,m)=>(t.openBlock(),t.createBlock(j,{key:`${e.item.key}-badge-method-${m}`,appearance:Object.values(t.unref(qn.BadgeMethodAppearances)).includes(h.toLowerCase())?h.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${m}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(h),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Mr)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${n.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(h,m)=>(t.openBlock(),t.createBlock(Bt,{key:`json-array-item-${m}`,index:m,"is-array-item":"",item:h},null,8,["index","item"]))),128))],8,Or)):(t.openBlock(),t.createBlock(q,{key:4,text:t.unref(f)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:y,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Vr))],!0)],8,Er)])}}}),It=oe(Fr,[["__scopeId","data-v-d056663c"]]),Dr={class:"json-config"},qr={key:0,class:"json-endpoint"},Nt=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(a=>({"2d178975":`${o.value}ch`}));const r=e,n=t.computed(()=>r.jsonRecord),o=t.computed(()=>{var a;if(!r.fetcherUrl)return 0;const l=(a=r.fetcherUrl)==null?void 0:a.split("/");return l.length<2?0:41+(r.requestMethod==="post"?l[l.length-1]:l[l.length-2]).length});return(a,l)=>{var i;const s=t.resolveComponent("KBadge"),c=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Dr,[r.fetcherUrl&&(i=r.config)!=null&&i.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",qr,[t.createVNode(s,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(c,{id:"json-endpoint-codeblock",code:r.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.jsonRecord?(t.openBlock(),t.createBlock(c,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(n.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function At(e){return typeof e>"u"||e===null}function Lr(e){return typeof e=="object"&&e!==null}function Kr(e){return Array.isArray(e)?e:At(e)?[]:[e]}function Pr(e,r){var n,o,a,l;if(r)for(l=Object.keys(r),n=0,o=l.length;n<o;n+=1)a=l[n],e[a]=r[a];return e}function Ur(e,r){var n="",o;for(o=0;o<r;o+=1)n+=e;return n}function Rr(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var zr=At,Gr=Lr,Hr=Kr,Jr=Ur,Yr=Rr,Wr=Pr,G={isNothing:zr,isObject:Gr,toArray:Hr,repeat:Jr,isNegativeZero:Yr,extend:Wr};function Et(e,r){var n="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(n+=`
|
|
2
2
|
|
|
3
3
|
`+e.mark.snippet),o+" "+n):o}function Be(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=Et(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Be.prototype=Object.create(Error.prototype),Be.prototype.constructor=Be,Be.prototype.toString=function(e){return this.name+": "+Et(this,e)};var X=Be;function We(e,r,n,o,a){var l="",i="",s=Math.floor(a/2)-1;return o-r>s&&(l=" ... ",r=o-s+l.length),n-o>s&&(i=" ...",n=o+s-i.length),{str:l+e.slice(r,n).replace(/\t/g,"→")+i,pos:o-r+l.length}}function Ze(e,r){return G.repeat(" ",r-e.length)+e}function Zr(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var n=/\r?\n|\r|\0/g,o=[0],a=[],l,i=-1;l=n.exec(e.buffer);)a.push(l.index),o.push(l.index+l[0].length),e.position<=l.index&&i<0&&(i=o.length-2);i<0&&(i=o.length-1);var s="",c,d,p=Math.min(e.line+r.linesAfter,a.length).toString().length,u=r.maxLength-(r.indent+p+3);for(c=1;c<=r.linesBefore&&!(i-c<0);c++)d=We(e.buffer,o[i-c],a[i-c],e.position-(o[i]-o[i-c]),u),s=G.repeat(" ",r.indent)+Ze((e.line-c+1).toString(),p)+" | "+d.str+`
|
|
4
4
|
`+s;for(d=We(e.buffer,o[i],a[i],e.position,u),s+=G.repeat(" ",r.indent)+Ze((e.line+1).toString(),p)+" | "+d.str+`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-consumer-groups",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-consumer-groups.umd.js",
|
|
6
6
|
"module": "./dist/entities-consumer-groups.es.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"errorLimit": "500KB"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@kong-ui-public/entities-shared": "^2.10.
|
|
53
|
+
"@kong-ui-public/entities-shared": "^2.10.5"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"dev": "cross-env USE_SANDBOX=true vite",
|