@kong-ui-public/entities-consumer-groups 2.1.7 → 2.1.8-pr.985.da712cf1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@ import { defineComponent as ae, ref as E, computed as $, watch as Ae, renderSlot
|
|
|
2
2
|
import { useRouter as wt } from "vue-router";
|
|
3
3
|
import { createI18n as It, i18nTComponent as yn } from "@kong-ui-public/i18n";
|
|
4
4
|
import _r from "axios";
|
|
5
|
-
import {
|
|
5
|
+
import { BadgeMethodAppearances as wr } from "@kong/kongponents";
|
|
6
6
|
const Ir = {
|
|
7
7
|
list: {
|
|
8
8
|
table_headers: {
|
|
@@ -355,43 +355,43 @@ function Pr(e, n, t, r = {
|
|
|
355
355
|
t || (t = "100");
|
|
356
356
|
const { axiosInstance: a } = At({
|
|
357
357
|
headers: e.requestHeaders
|
|
358
|
-
}), { i18n: { t: o } } = St(), { debounce: i } = xr(), s = i(async (
|
|
359
|
-
await K(
|
|
358
|
+
}), { i18n: { t: o } } = St(), { debounce: i } = xr(), s = i(async (w) => {
|
|
359
|
+
await K(w);
|
|
360
360
|
}, 200), l = E(!1), c = E(""), d = E(""), u = E([]), g = E([]), f = E(void 0), I = y(n);
|
|
361
361
|
let b = `${e.apiBaseUrl}${I}`;
|
|
362
362
|
e.app === "konnect" ? b = b.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "") : e.app === "kongManager" && (b = b.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : ""));
|
|
363
363
|
const { isValidUuid: p } = vn(), A = async () => {
|
|
364
364
|
try {
|
|
365
365
|
l.value = !0;
|
|
366
|
-
const { data:
|
|
367
|
-
|
|
366
|
+
const { data: w } = await a.get(`${b}?size=${t}`);
|
|
367
|
+
w != null && w.next || (f.value = r.fetchedItemsKey in w ? w[r.fetchedItemsKey] : []), g.value = r.fetchedItemsKey in w ? w[r.fetchedItemsKey] : [], u.value = g.value;
|
|
368
368
|
} catch {
|
|
369
369
|
u.value = [], c.value = o("debouncedFilter.errors.fetch");
|
|
370
370
|
} finally {
|
|
371
371
|
l.value = !1;
|
|
372
372
|
}
|
|
373
|
-
},
|
|
373
|
+
}, h = E(""), K = async (w) => {
|
|
374
374
|
var D, se, Y;
|
|
375
|
-
if (
|
|
376
|
-
if (
|
|
375
|
+
if (h.value !== w)
|
|
376
|
+
if (h.value = w || "", f.value === void 0)
|
|
377
377
|
try {
|
|
378
378
|
if (l.value = !0, c.value = "", d.value = "", e.app === "konnect") {
|
|
379
|
-
let
|
|
380
|
-
|
|
381
|
-
const { data: N } = await a.get(`${
|
|
379
|
+
let _ = b + "";
|
|
380
|
+
w && (_ += `/${w}`);
|
|
381
|
+
const { data: N } = await a.get(`${_}?size=${t}`);
|
|
382
382
|
r.fetchedItemsKey in N ? u.value = N[r.fetchedItemsKey] : N != null && N.id ? u.value = [N] : u.value = [];
|
|
383
|
-
} else if (
|
|
384
|
-
const
|
|
385
|
-
p(
|
|
386
|
-
const { data: C } = await a.get(`${b}/${
|
|
383
|
+
} else if (w) {
|
|
384
|
+
const _ = [];
|
|
385
|
+
p(w) && r.searchKeys.includes("id") ? _.push((async () => {
|
|
386
|
+
const { data: C } = await a.get(`${b}/${w}`);
|
|
387
387
|
return [C[r.fetchedItemsKey] ?? C];
|
|
388
|
-
})()) :
|
|
388
|
+
})()) : _.push(
|
|
389
389
|
...r.searchKeys.filter((C) => C !== "id").map(async (C) => {
|
|
390
|
-
const { data: S } = await a.get(`${b}?${C}=${
|
|
390
|
+
const { data: S } = await a.get(`${b}?${C}=${w}`);
|
|
391
391
|
return S[r.fetchedItemsKey];
|
|
392
392
|
})
|
|
393
393
|
);
|
|
394
|
-
const N = await Promise.all(
|
|
394
|
+
const N = await Promise.all(_), R = /* @__PURE__ */ new Set();
|
|
395
395
|
u.value = [], (D = N == null ? void 0 : N.forEach) == null || D.call(N, (C) => {
|
|
396
396
|
var S;
|
|
397
397
|
(S = C == null ? void 0 : C.forEach) == null || S.call(C, (x) => {
|
|
@@ -400,18 +400,18 @@ function Pr(e, n, t, r = {
|
|
|
400
400
|
});
|
|
401
401
|
} else
|
|
402
402
|
u.value = g.value;
|
|
403
|
-
} catch (
|
|
404
|
-
((se =
|
|
403
|
+
} catch (_) {
|
|
404
|
+
((se = _ == null ? void 0 : _.response) == null ? void 0 : se.status) === 404 ? d.value = o("debouncedFilter.errors.invalid") : (u.value = [], c.value = o("debouncedFilter.errors.fetch"));
|
|
405
405
|
} finally {
|
|
406
406
|
l.value = !1;
|
|
407
407
|
}
|
|
408
408
|
else
|
|
409
|
-
l.value = !0, d.value = "",
|
|
409
|
+
l.value = !0, d.value = "", w ? (u.value = (Y = f.value) == null ? void 0 : Y.filter((_) => {
|
|
410
410
|
var N;
|
|
411
411
|
let R = !1;
|
|
412
412
|
for (const C of r.searchKeys) {
|
|
413
|
-
const S = typeof
|
|
414
|
-
S != null && S.includes(
|
|
413
|
+
const S = typeof _[C] == "string" ? (N = _[C]) == null ? void 0 : N.toLowerCase() : _[C];
|
|
414
|
+
S != null && S.includes(w.toLowerCase()) && (R = !0);
|
|
415
415
|
}
|
|
416
416
|
return R;
|
|
417
417
|
}), (!u.value || !u.value.length) && (d.value = o("debouncedFilter.errors.invalid"))) : u.value = f.value, l.value = !1;
|
|
@@ -977,10 +977,10 @@ const ce = {
|
|
|
977
977
|
setup(e, { emit: n }) {
|
|
978
978
|
const t = e;
|
|
979
979
|
gr((f) => ({
|
|
980
|
-
"
|
|
981
|
-
"
|
|
982
|
-
"
|
|
983
|
-
"
|
|
980
|
+
"0fea14db": c.value ? "none" : `solid ${y(wa)} ${y(ka)}`,
|
|
981
|
+
"1cf0460e": l.value && i.value ? "block" : "flex",
|
|
982
|
+
"328cca12": l.value && i.value ? "100%" : t.slim ? "50%" : "25%",
|
|
983
|
+
"328f0fed": l.value && i.value ? "100%" : t.slim ? "50%" : "75%"
|
|
984
984
|
}));
|
|
985
985
|
const r = lt(), { i18n: { t: a, formatUnixTimeStamp: o } } = ce.useI18n(), i = $(() => t.item.value !== void 0 && t.item.value !== null && t.item.value !== ""), s = $(() => !!(t.item.tooltip || r["label-tooltip"])), l = $(() => t.item.type === ne.Json || t.item.type === ne.JsonArray), c = $(() => t.item.type === ne.JsonArray), d = $(() => {
|
|
986
986
|
switch (t.item.type) {
|
|
@@ -1110,7 +1110,7 @@ const ce = {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
}), u = E(), { isTruncated: g } = ce.useTruncationDetector(u);
|
|
1112
1112
|
return (f, I) => {
|
|
1113
|
-
const b = L("KLabel"), p = L("KBadge"), A = L("
|
|
1113
|
+
const b = L("KLabel"), p = L("KBadge"), A = L("KTooltip");
|
|
1114
1114
|
return m(), M("div", Aa, [
|
|
1115
1115
|
V("div", {
|
|
1116
1116
|
class: "config-card-details-label",
|
|
@@ -1153,58 +1153,57 @@ const ce = {
|
|
|
1153
1153
|
key: 0,
|
|
1154
1154
|
"data-testid": `${e.item.key}-badge-tags`
|
|
1155
1155
|
}, [
|
|
1156
|
-
(m(!0), M(be, null, he(e.item.value, (
|
|
1157
|
-
key: `${e.item.key}-badge-tag-${
|
|
1156
|
+
(m(!0), M(be, null, he(e.item.value, (h, K) => (m(), U(p, {
|
|
1157
|
+
key: `${e.item.key}-badge-tag-${K}`,
|
|
1158
1158
|
class: "config-badge",
|
|
1159
|
-
"data-testid": `${e.item.key}-badge-tag-${
|
|
1160
|
-
|
|
1159
|
+
"data-testid": `${e.item.key}-badge-tag-${K}`,
|
|
1160
|
+
tooltip: h,
|
|
1161
|
+
"truncation-tooltip": ""
|
|
1161
1162
|
}, {
|
|
1162
1163
|
default: v(() => [
|
|
1163
|
-
Q(O(
|
|
1164
|
+
Q(O(h), 1)
|
|
1164
1165
|
]),
|
|
1165
1166
|
_: 2
|
|
1166
|
-
}, 1032, ["data-testid", "
|
|
1167
|
+
}, 1032, ["data-testid", "tooltip"]))), 128))
|
|
1167
1168
|
], 8, ja)) : H("", !0),
|
|
1168
1169
|
d.value.additionalComponent === "CopyUuid" ? (m(), M("div", {
|
|
1169
1170
|
key: 1,
|
|
1170
1171
|
class: "copy-uuid-array",
|
|
1171
1172
|
"data-testid": `${e.item.key}-copy-uuid-array`
|
|
1172
1173
|
}, [
|
|
1173
|
-
(m(!0), M(be, null, he(e.item.value, (
|
|
1174
|
-
key: `${e.item.key}-copy-uuid-${
|
|
1175
|
-
"data-testid": `${e.item.key}-copy-uuid-${
|
|
1176
|
-
uuid:
|
|
1174
|
+
(m(!0), M(be, null, he(e.item.value, (h, K) => (m(), U(y(_n), ht(d.value.childAttrs, {
|
|
1175
|
+
key: `${e.item.key}-copy-uuid-${K}`,
|
|
1176
|
+
"data-testid": `${e.item.key}-copy-uuid-${K}`,
|
|
1177
|
+
uuid: h
|
|
1177
1178
|
}), null, 16, ["data-testid", "uuid"]))), 128))
|
|
1178
1179
|
], 8, Ea)) : d.value.additionalComponent === "KMethodBadge" ? (m(), M("div", {
|
|
1179
1180
|
key: 2,
|
|
1180
1181
|
class: "method-badge-array",
|
|
1181
1182
|
"data-testid": `${e.item.key}-badge-methods`
|
|
1182
1183
|
}, [
|
|
1183
|
-
(m(!0), M(be, null, he(e.item.value, (
|
|
1184
|
-
key: `${e.item.key}-badge-method-${
|
|
1184
|
+
(m(!0), M(be, null, he(e.item.value, (h, K) => (m(), U(p, {
|
|
1185
|
+
key: `${e.item.key}-badge-method-${K}`,
|
|
1186
|
+
appearance: Object.values(y(wr)).includes(h.toLowerCase()) ? h.toLowerCase() : "custom",
|
|
1185
1187
|
class: "config-badge",
|
|
1186
|
-
"data-testid": `${e.item.key}-badge-method-${
|
|
1187
|
-
"is-rounded": "",
|
|
1188
|
-
label: K,
|
|
1189
|
-
method: y(wr).includes(K.toLowerCase()) ? K.toLowerCase() : "custom"
|
|
1188
|
+
"data-testid": `${e.item.key}-badge-method-${K}`
|
|
1190
1189
|
}, {
|
|
1191
1190
|
default: v(() => [
|
|
1192
|
-
Q(O(
|
|
1191
|
+
Q(O(h), 1)
|
|
1193
1192
|
]),
|
|
1194
1193
|
_: 2
|
|
1195
|
-
}, 1032, ["
|
|
1194
|
+
}, 1032, ["appearance", "data-testid"]))), 128))
|
|
1196
1195
|
], 8, Oa)) : H("", !0),
|
|
1197
1196
|
d.value.additionalComponent === "JsonCardItem" ? (m(), M("div", {
|
|
1198
1197
|
key: 3,
|
|
1199
1198
|
"data-testid": `${t.item.key}-json-array-content`
|
|
1200
1199
|
}, [
|
|
1201
|
-
(m(!0), M(be, null, he(e.item.value, (
|
|
1202
|
-
key: `json-array-item-${
|
|
1203
|
-
index:
|
|
1200
|
+
(m(!0), M(be, null, he(e.item.value, (h, K) => (m(), U(wn, {
|
|
1201
|
+
key: `json-array-item-${K}`,
|
|
1202
|
+
index: K,
|
|
1204
1203
|
"is-array-item": "",
|
|
1205
|
-
item:
|
|
1204
|
+
item: h
|
|
1206
1205
|
}, null, 8, ["index", "item"]))), 128))
|
|
1207
|
-
], 8, Ka)) : (m(), U(
|
|
1206
|
+
], 8, Ka)) : (m(), U(A, {
|
|
1208
1207
|
key: 4,
|
|
1209
1208
|
label: y(g) ? e.item.value : ""
|
|
1210
1209
|
}, {
|
|
@@ -1229,7 +1228,7 @@ const ce = {
|
|
|
1229
1228
|
]);
|
|
1230
1229
|
};
|
|
1231
1230
|
}
|
|
1232
|
-
}), xt = /* @__PURE__ */ ke(Na, [["__scopeId", "data-v-
|
|
1231
|
+
}), xt = /* @__PURE__ */ ke(Na, [["__scopeId", "data-v-4c7d8cc3"]]);
|
|
1233
1232
|
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
|
1234
1233
|
function In(e) {
|
|
1235
1234
|
return typeof e > "u" || e === null;
|
|
@@ -2023,17 +2022,17 @@ function Yo(e, n) {
|
|
|
2023
2022
|
j(e, "unexpected end of the stream within a double quoted scalar");
|
|
2024
2023
|
}
|
|
2025
2024
|
function Wo(e, n) {
|
|
2026
|
-
var t = !0, r, a, o, i = e.tag, s, l = e.anchor, c, d, u, g, f, I = /* @__PURE__ */ Object.create(null), b, p, A,
|
|
2027
|
-
if (
|
|
2025
|
+
var t = !0, r, a, o, i = e.tag, s, l = e.anchor, c, d, u, g, f, I = /* @__PURE__ */ Object.create(null), b, p, A, h;
|
|
2026
|
+
if (h = e.input.charCodeAt(e.position), h === 91)
|
|
2028
2027
|
d = 93, f = !1, s = [];
|
|
2029
|
-
else if (
|
|
2028
|
+
else if (h === 123)
|
|
2030
2029
|
d = 125, f = !0, s = {};
|
|
2031
2030
|
else
|
|
2032
2031
|
return !1;
|
|
2033
|
-
for (e.anchor !== null && (e.anchorMap[e.anchor] = s),
|
|
2034
|
-
if (ie(e, !0, n),
|
|
2032
|
+
for (e.anchor !== null && (e.anchorMap[e.anchor] = s), h = e.input.charCodeAt(++e.position); h !== 0; ) {
|
|
2033
|
+
if (ie(e, !0, n), h = e.input.charCodeAt(e.position), h === d)
|
|
2035
2034
|
return e.position++, e.tag = i, e.anchor = l, e.kind = f ? "mapping" : "sequence", e.result = s, !0;
|
|
2036
|
-
t ?
|
|
2035
|
+
t ? h === 44 && j(e, "expected the node content, but found ','") : j(e, "missed comma between flow collection entries"), p = b = A = null, u = g = !1, h === 63 && (c = e.input.charCodeAt(e.position + 1), ve(c) && (u = g = !0, e.position++, ie(e, !0, n))), r = e.line, a = e.lineStart, o = e.position, Re(e, n, rt, !1, !0), p = e.tag, b = e.result, ie(e, !0, n), h = e.input.charCodeAt(e.position), (g || e.line === r) && h === 58 && (u = !0, h = e.input.charCodeAt(++e.position), ie(e, !0, n), Re(e, n, rt, !1, !0), A = e.result), f ? Ve(e, s, I, p, b, A, r, a, o) : u ? s.push(Ve(e, null, I, p, b, A, r, a, o)) : s.push(b), ie(e, !0, n), h = e.input.charCodeAt(e.position), h === 44 ? (t = !0, h = e.input.charCodeAt(++e.position)) : t = !1;
|
|
2037
2036
|
}
|
|
2038
2037
|
j(e, "unexpected end of the stream within a flow collection");
|
|
2039
2038
|
}
|
|
@@ -2101,20 +2100,20 @@ function en(e, n) {
|
|
|
2101
2100
|
return s ? (e.tag = r, e.anchor = a, e.kind = "sequence", e.result = o, !0) : !1;
|
|
2102
2101
|
}
|
|
2103
2102
|
function Qo(e, n, t) {
|
|
2104
|
-
var r, a, o, i, s, l, c = e.tag, d = e.anchor, u = {}, g = /* @__PURE__ */ Object.create(null), f = null, I = null, b = null, p = !1, A = !1,
|
|
2103
|
+
var r, a, o, i, s, l, c = e.tag, d = e.anchor, u = {}, g = /* @__PURE__ */ Object.create(null), f = null, I = null, b = null, p = !1, A = !1, h;
|
|
2105
2104
|
if (e.firstTabInLine !== -1)
|
|
2106
2105
|
return !1;
|
|
2107
|
-
for (e.anchor !== null && (e.anchorMap[e.anchor] = u),
|
|
2108
|
-
if (!p && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, j(e, "tab characters must not be used in indentation")), r = e.input.charCodeAt(e.position + 1), o = e.line, (
|
|
2109
|
-
|
|
2106
|
+
for (e.anchor !== null && (e.anchorMap[e.anchor] = u), h = e.input.charCodeAt(e.position); h !== 0; ) {
|
|
2107
|
+
if (!p && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, j(e, "tab characters must not be used in indentation")), r = e.input.charCodeAt(e.position + 1), o = e.line, (h === 63 || h === 58) && ve(r))
|
|
2108
|
+
h === 63 ? (p && (Ve(e, u, g, f, I, null, i, s, l), f = I = b = null), A = !0, p = !0, a = !0) : p ? (p = !1, a = !0) : j(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, h = r;
|
|
2110
2109
|
else {
|
|
2111
2110
|
if (i = e.line, s = e.lineStart, l = e.position, !Re(e, t, Gn, !1, !0))
|
|
2112
2111
|
break;
|
|
2113
2112
|
if (e.line === o) {
|
|
2114
|
-
for (
|
|
2115
|
-
|
|
2116
|
-
if (
|
|
2117
|
-
|
|
2113
|
+
for (h = e.input.charCodeAt(e.position); Ke(h); )
|
|
2114
|
+
h = e.input.charCodeAt(++e.position);
|
|
2115
|
+
if (h === 58)
|
|
2116
|
+
h = e.input.charCodeAt(++e.position), ve(h) || j(e, "a whitespace character is expected after the key-value separator within a block mapping"), p && (Ve(e, u, g, f, I, null, i, s, l), f = I = b = null), A = !0, p = !1, a = !1, f = e.tag, I = e.result;
|
|
2118
2117
|
else if (A)
|
|
2119
2118
|
j(e, "can not read an implicit mapping pair; a colon is missed");
|
|
2120
2119
|
else
|
|
@@ -2124,7 +2123,7 @@ function Qo(e, n, t) {
|
|
|
2124
2123
|
else
|
|
2125
2124
|
return e.tag = c, e.anchor = d, !0;
|
|
2126
2125
|
}
|
|
2127
|
-
if ((e.line === o || e.lineIndent > n) && (p && (i = e.line, s = e.lineStart, l = e.position), Re(e, n, at, !0, a) && (p ? I = e.result : b = e.result), p || (Ve(e, u, g, f, I, b, i, s, l), f = I = b = null), ie(e, !0, -1),
|
|
2126
|
+
if ((e.line === o || e.lineIndent > n) && (p && (i = e.line, s = e.lineStart, l = e.position), Re(e, n, at, !0, a) && (p ? I = e.result : b = e.result), p || (Ve(e, u, g, f, I, b, i, s, l), f = I = b = null), ie(e, !0, -1), h = e.input.charCodeAt(e.position)), (e.line === o || e.lineIndent > n) && h !== 0)
|
|
2128
2127
|
j(e, "bad indentation of a mapping entry");
|
|
2129
2128
|
else if (e.lineIndent < n)
|
|
2130
2129
|
break;
|
|
@@ -2899,8 +2898,8 @@ const as = {
|
|
|
2899
2898
|
label: "YAML",
|
|
2900
2899
|
value: "yaml"
|
|
2901
2900
|
}
|
|
2902
|
-
], d = E("structured"), u = (
|
|
2903
|
-
d.value =
|
|
2901
|
+
], d = E("structured"), u = (_) => {
|
|
2902
|
+
d.value = _ == null ? void 0 : _.value;
|
|
2904
2903
|
}, g = {
|
|
2905
2904
|
id: {
|
|
2906
2905
|
type: ne.ID,
|
|
@@ -2936,12 +2935,12 @@ const as = {
|
|
|
2936
2935
|
section: Ce.Basic
|
|
2937
2936
|
}
|
|
2938
2937
|
}, f = E(!1), I = E(!1), b = E(""), p = E(), A = $(() => {
|
|
2939
|
-
var
|
|
2938
|
+
var _, N, R;
|
|
2940
2939
|
if (!p.value)
|
|
2941
2940
|
return [];
|
|
2942
2941
|
const C = [], S = Object.keys(p.value).length;
|
|
2943
2942
|
for (const x in p.value) {
|
|
2944
|
-
const q = (N = (
|
|
2943
|
+
const q = (N = (_ = r.configSchema) == null ? void 0 : _[x]) == null ? void 0 : N.order, J = (R = g[x]) == null ? void 0 : R.order;
|
|
2945
2944
|
let X = S;
|
|
2946
2945
|
(J || J === 0) && (X = J === -1 ? S + 1 : J), q && (X = q === -1 ? S + 1 : q), C.push([x, X]);
|
|
2947
2946
|
}
|
|
@@ -2960,13 +2959,13 @@ const as = {
|
|
|
2960
2959
|
section: te.section ?? ((le == null ? void 0 : le.section) || Ce.Advanced)
|
|
2961
2960
|
};
|
|
2962
2961
|
}).filter((x) => !x.hidden && x.key !== r.pluginConfigKey);
|
|
2963
|
-
}),
|
|
2964
|
-
var
|
|
2962
|
+
}), h = $(() => {
|
|
2963
|
+
var _, N;
|
|
2965
2964
|
if (!p.value || !r.pluginConfigKey)
|
|
2966
2965
|
return [];
|
|
2967
2966
|
const R = p.value[r.pluginConfigKey] || {}, C = Object.keys(R).length, S = [];
|
|
2968
2967
|
for (const x in R) {
|
|
2969
|
-
const q = (N = (
|
|
2968
|
+
const q = (N = (_ = r.pluginConfigSchema) == null ? void 0 : _[x]) == null ? void 0 : N.order, J = R[x];
|
|
2970
2969
|
let X = J != null && J !== "" ? C - 1 : C;
|
|
2971
2970
|
q && (X = q === -1 ? C + 1 : q), S.push([x, X]);
|
|
2972
2971
|
}
|
|
@@ -2986,50 +2985,50 @@ const as = {
|
|
|
2986
2985
|
};
|
|
2987
2986
|
}).filter((x) => !x.hidden);
|
|
2988
2987
|
}), K = $(() => {
|
|
2989
|
-
var
|
|
2988
|
+
var _, N, R, C;
|
|
2990
2989
|
return {
|
|
2991
|
-
basic: (
|
|
2990
|
+
basic: (_ = A.value) == null ? void 0 : _.filter((S) => S.section === Ce.Basic),
|
|
2992
2991
|
advanced: (N = A.value) == null ? void 0 : N.filter((S) => S.section === Ce.Advanced),
|
|
2993
|
-
plugin: (C =
|
|
2992
|
+
plugin: (C = h.value) == null ? void 0 : C.concat((R = A.value) == null ? void 0 : R.filter((S) => S.section === Ce.Plugin))
|
|
2994
2993
|
};
|
|
2995
|
-
}),
|
|
2996
|
-
const
|
|
2997
|
-
return K.value.basic.length &&
|
|
2998
|
-
}), D = (
|
|
2999
|
-
var
|
|
2994
|
+
}), w = $(() => {
|
|
2995
|
+
const _ = [];
|
|
2996
|
+
return K.value.basic.length && _.push("basic"), K.value.advanced.length && _.push("advanced"), K.value.plugin.length && _.push("plugin"), _;
|
|
2997
|
+
}), D = (_) => !!(_.tooltip || a[`${_.key}-label-tooltip`]), se = $(() => {
|
|
2998
|
+
var _, N;
|
|
3000
2999
|
let R = `${r.config.apiBaseUrl}${r.fetchUrl}`;
|
|
3001
|
-
return r.config.app === "konnect" ? R = R.replace(/{controlPlaneId}/gi, ((
|
|
3002
|
-
}), Y = (
|
|
3003
|
-
p.value &&
|
|
3000
|
+
return r.config.app === "konnect" ? R = R.replace(/{controlPlaneId}/gi, ((_ = r.config) == null ? void 0 : _.controlPlaneId) || "") : r.config.app === "kongManager" && (R = R.replace(/\/{workspace}/gi, (N = r.config) != null && N.workspace ? `/${r.config.workspace}` : "")), R = R.replace(/{id}/gi, r.config.entityId), R;
|
|
3001
|
+
}), Y = (_) => {
|
|
3002
|
+
p.value && _(JSON.stringify(p.value)) ? n("copy:success", p.value) : n("copy:error");
|
|
3004
3003
|
};
|
|
3005
|
-
return Ae(f, (
|
|
3006
|
-
n("loading",
|
|
3004
|
+
return Ae(f, (_) => {
|
|
3005
|
+
n("loading", _);
|
|
3007
3006
|
}, { immediate: !0 }), ut(async () => {
|
|
3008
3007
|
I.value = !1, f.value = !0;
|
|
3009
3008
|
try {
|
|
3010
|
-
const { data:
|
|
3009
|
+
const { data: _ } = await l.get(se.value);
|
|
3011
3010
|
if (r.dataKey)
|
|
3012
|
-
if (typeof
|
|
3013
|
-
p.value = { ...
|
|
3011
|
+
if (typeof _[r.dataKey] < "u")
|
|
3012
|
+
p.value = { ..._[r.dataKey] };
|
|
3014
3013
|
else
|
|
3015
3014
|
throw new Error(o("errors.dataKeyUndefined", { dataKey: r.dataKey }));
|
|
3016
3015
|
else
|
|
3017
|
-
p.value = { ...
|
|
3016
|
+
p.value = { ..._ };
|
|
3018
3017
|
Object.keys(r.configSchema).filter((N) => r.configSchema[N].forceShow).forEach((N) => {
|
|
3019
3018
|
p.value && typeof p.value[N] > "u" && (p.value[N] = null);
|
|
3020
|
-
}), n("fetch:success",
|
|
3021
|
-
} catch (
|
|
3022
|
-
const N = i(
|
|
3023
|
-
b.value = N.startsWith("code") ? o("baseConfigCard.errors.load") : N, I.value = !0, n("fetch:error",
|
|
3019
|
+
}), n("fetch:success", _);
|
|
3020
|
+
} catch (_) {
|
|
3021
|
+
const N = i(_);
|
|
3022
|
+
b.value = N.startsWith("code") ? o("baseConfigCard.errors.load") : N, I.value = !0, n("fetch:error", _);
|
|
3024
3023
|
} finally {
|
|
3025
3024
|
f.value = !1;
|
|
3026
3025
|
}
|
|
3027
|
-
}), (
|
|
3026
|
+
}), (_, N) => {
|
|
3028
3027
|
const R = L("KLabel"), C = L("KSelect"), S = L("KButton"), x = L("KClipboardProvider"), q = L("KSkeleton"), J = L("KEmptyState"), X = L("KCard");
|
|
3029
3028
|
return m(), U(X, { class: "kong-ui-entity-base-config-card" }, $e({
|
|
3030
3029
|
actions: v(() => [
|
|
3031
3030
|
V("div", bs, [
|
|
3032
|
-
Z(
|
|
3031
|
+
Z(_.$slots, "actions", {}, void 0, !0),
|
|
3033
3032
|
e.config.jsonYamlEnabled ? (m(), U(R, {
|
|
3034
3033
|
key: 0,
|
|
3035
3034
|
class: "config-format-select-label",
|
|
@@ -3101,14 +3100,14 @@ const as = {
|
|
|
3101
3100
|
e.config.jsonYamlEnabled ? (m(), M("div", ks, [
|
|
3102
3101
|
F(cs, {
|
|
3103
3102
|
format: d.value,
|
|
3104
|
-
"prop-list-types":
|
|
3103
|
+
"prop-list-types": w.value,
|
|
3105
3104
|
"property-collections": K.value,
|
|
3106
3105
|
record: p.value
|
|
3107
3106
|
}, $e({ _: 2 }, [
|
|
3108
|
-
he(Object.keys(
|
|
3107
|
+
he(Object.keys(_.$slots), (ee) => ({
|
|
3109
3108
|
name: ee,
|
|
3110
3109
|
fn: v(({ row: te, rowValue: le }) => [
|
|
3111
|
-
Z(
|
|
3110
|
+
Z(_.$slots, ee, {
|
|
3112
3111
|
row: te,
|
|
3113
3112
|
rowValue: le
|
|
3114
3113
|
}, void 0, !0)
|
|
@@ -3116,7 +3115,7 @@ const as = {
|
|
|
3116
3115
|
}))
|
|
3117
3116
|
]), 1032, ["format", "prop-list-types", "property-collections", "record"])
|
|
3118
3117
|
])) : (m(), M("div", _s, [
|
|
3119
|
-
(m(!0), M(be, null, he(
|
|
3118
|
+
(m(!0), M(be, null, he(w.value, (ee) => (m(), M("div", {
|
|
3120
3119
|
key: `config-card-details-${ee}-props`,
|
|
3121
3120
|
class: Fe(`config-card-details-${ee}-props`),
|
|
3122
3121
|
"data-testid": `config-card-details-${ee}-props`
|
|
@@ -3127,10 +3126,10 @@ const as = {
|
|
|
3127
3126
|
item: te
|
|
3128
3127
|
}, $e({
|
|
3129
3128
|
label: v(() => [
|
|
3130
|
-
Z(
|
|
3129
|
+
Z(_.$slots, `${te.key}-label`, { row: te }, void 0, !0)
|
|
3131
3130
|
]),
|
|
3132
3131
|
[te.key]: v(({ rowValue: le }) => [
|
|
3133
|
-
Z(
|
|
3132
|
+
Z(_.$slots, te.key, {
|
|
3134
3133
|
row: te,
|
|
3135
3134
|
rowValue: le
|
|
3136
3135
|
}, void 0, !0)
|
|
@@ -3140,7 +3139,7 @@ const as = {
|
|
|
3140
3139
|
D(te) ? {
|
|
3141
3140
|
name: "label-tooltip",
|
|
3142
3141
|
fn: v(() => [
|
|
3143
|
-
Z(
|
|
3142
|
+
Z(_.$slots, `${te.key}-label-tooltip`, { row: te }, void 0, !0)
|
|
3144
3143
|
]),
|
|
3145
3144
|
key: "0"
|
|
3146
3145
|
} : void 0
|
|
@@ -3154,7 +3153,7 @@ const as = {
|
|
|
3154
3153
|
name: "title",
|
|
3155
3154
|
fn: v(() => [
|
|
3156
3155
|
V("div", vs, [
|
|
3157
|
-
Z(
|
|
3156
|
+
Z(_.$slots, "title", {}, () => [
|
|
3158
3157
|
Q(O(y(o)("baseConfigCard.title")), 1)
|
|
3159
3158
|
], !0)
|
|
3160
3159
|
])
|
|
@@ -3223,8 +3222,8 @@ const as = {
|
|
|
3223
3222
|
var p, A;
|
|
3224
3223
|
if (!r.editId)
|
|
3225
3224
|
return "";
|
|
3226
|
-
let
|
|
3227
|
-
return r.config.app === "konnect" ?
|
|
3225
|
+
let h = `${r.config.apiBaseUrl}${r.fetchUrl}`;
|
|
3226
|
+
return r.config.app === "konnect" ? h = h.replace(/{controlPlaneId}/gi, ((p = r.config) == null ? void 0 : p.controlPlaneId) || "") : r.config.app === "kongManager" && (h = h.replace(/\/{workspace}/gi, (A = r.config) != null && A.workspace ? `/${r.config.workspace}` : "")), h = h.replace(/{id}/gi, r.editId), h;
|
|
3228
3227
|
}), f = () => {
|
|
3229
3228
|
r.config.cancelRoute ? a.push(r.config.cancelRoute) : I();
|
|
3230
3229
|
}, I = () => {
|
|
@@ -3247,10 +3246,10 @@ const as = {
|
|
|
3247
3246
|
l.value = !1;
|
|
3248
3247
|
}
|
|
3249
3248
|
}), (p, A) => {
|
|
3250
|
-
const
|
|
3249
|
+
const h = L("KSkeleton"), K = L("KEmptyState"), w = L("KAlert"), D = L("KButton"), se = L("KCard");
|
|
3251
3250
|
return m(), U(se, { class: "kong-ui-entity-base-form" }, {
|
|
3252
3251
|
default: v(() => [
|
|
3253
|
-
l.value ? (m(), U(
|
|
3252
|
+
l.value ? (m(), U(h, {
|
|
3254
3253
|
key: 0,
|
|
3255
3254
|
type: "form"
|
|
3256
3255
|
})) : c.value ? (m(), U(K, {
|
|
@@ -3271,7 +3270,7 @@ const as = {
|
|
|
3271
3270
|
onSubmit: nt(b, ["prevent"])
|
|
3272
3271
|
}, [
|
|
3273
3272
|
Z(p.$slots, "default", {}, void 0, !0),
|
|
3274
|
-
e.errorMessage ? (m(), U(
|
|
3273
|
+
e.errorMessage ? (m(), U(w, {
|
|
3275
3274
|
key: 0,
|
|
3276
3275
|
"alert-message": e.errorMessage,
|
|
3277
3276
|
appearance: "danger",
|
|
@@ -3497,42 +3496,42 @@ const as = {
|
|
|
3497
3496
|
emits: ["click:row", "sort", "clear-search-input", "empty-state-cta-clicked"],
|
|
3498
3497
|
setup(e, { emit: n }) {
|
|
3499
3498
|
const t = e, { i18n: { t: r } } = ce.useI18n(), a = $(() => {
|
|
3500
|
-
var
|
|
3499
|
+
var w, D;
|
|
3501
3500
|
return typeof t.errorMessage == "string" ? {
|
|
3502
3501
|
hasError: !!t.errorMessage,
|
|
3503
3502
|
title: t.errorMessage,
|
|
3504
3503
|
message: void 0
|
|
3505
3504
|
} : {
|
|
3506
3505
|
hasError: !!t.errorMessage,
|
|
3507
|
-
title: (
|
|
3506
|
+
title: (w = t.errorMessage) == null ? void 0 : w.title,
|
|
3508
3507
|
message: (D = t.errorMessage) == null ? void 0 : D.message
|
|
3509
3508
|
};
|
|
3510
|
-
}), o = $(() => t.cacheIdentifier || t.preferencesStorageKey), i = (
|
|
3511
|
-
const
|
|
3509
|
+
}), o = $(() => t.cacheIdentifier || t.preferencesStorageKey), i = (w) => w.hasData || !!t.query, s = $(() => {
|
|
3510
|
+
const w = [];
|
|
3512
3511
|
return Object.keys(t.tableHeaders).forEach((D) => {
|
|
3513
3512
|
const se = t.tableHeaders[D];
|
|
3514
|
-
|
|
3513
|
+
w.push({
|
|
3515
3514
|
label: se.label ?? D,
|
|
3516
3515
|
key: D,
|
|
3517
3516
|
sortable: se.sortable ?? !1
|
|
3518
3517
|
});
|
|
3519
|
-
}), t.enableEntityActions &&
|
|
3518
|
+
}), t.enableEntityActions && w.push({
|
|
3520
3519
|
key: "actions",
|
|
3521
3520
|
hideLabel: !0
|
|
3522
|
-
}),
|
|
3523
|
-
}), l = (
|
|
3524
|
-
"data-rowid":
|
|
3525
|
-
"data-testid":
|
|
3526
|
-
...t.rowAttributes(
|
|
3527
|
-
}), c = E({}), d = (
|
|
3521
|
+
}), w;
|
|
3522
|
+
}), l = (w) => ({
|
|
3523
|
+
"data-rowid": w.id,
|
|
3524
|
+
"data-testid": w.name,
|
|
3525
|
+
...t.rowAttributes(w)
|
|
3526
|
+
}), c = E({}), d = (w) => {
|
|
3528
3527
|
var D;
|
|
3529
|
-
return (D = c.value) == null ? void 0 : D.$el.querySelector(`[data-rowid="${
|
|
3530
|
-
}, u = (
|
|
3528
|
+
return (D = c.value) == null ? void 0 : D.$el.querySelector(`[data-rowid="${w.id}"]`);
|
|
3529
|
+
}, u = (w) => {
|
|
3531
3530
|
const D = {
|
|
3532
|
-
"data-testid":
|
|
3533
|
-
...t.cellAttributes(
|
|
3531
|
+
"data-testid": w.headerKey,
|
|
3532
|
+
...t.cellAttributes(w)
|
|
3534
3533
|
};
|
|
3535
|
-
return
|
|
3534
|
+
return w.colIndex === 0 && (D.style = {
|
|
3536
3535
|
maxWidth: "250px",
|
|
3537
3536
|
overflowX: "hidden",
|
|
3538
3537
|
textOverflow: "ellipsis"
|
|
@@ -3541,21 +3540,21 @@ const as = {
|
|
|
3541
3540
|
n("empty-state-cta-clicked"), f();
|
|
3542
3541
|
}, f = () => {
|
|
3543
3542
|
n("clear-search-input");
|
|
3544
|
-
}, I = $(() => t.disableRowClick ? void 0 : (
|
|
3543
|
+
}, I = $(() => t.disableRowClick ? void 0 : (w, D) => {
|
|
3545
3544
|
n("click:row", D);
|
|
3546
|
-
}), b = (
|
|
3547
|
-
n("sort",
|
|
3548
|
-
}, { setTablePreferences: p, getTablePreferences: A } = $r(),
|
|
3549
|
-
const
|
|
3545
|
+
}), b = (w) => {
|
|
3546
|
+
n("sort", w);
|
|
3547
|
+
}, { setTablePreferences: p, getTablePreferences: A } = $r(), h = $(() => {
|
|
3548
|
+
const w = A(t.preferencesStorageKey);
|
|
3550
3549
|
return {
|
|
3551
3550
|
...t.initialFetcherParams,
|
|
3552
|
-
...
|
|
3551
|
+
...w
|
|
3553
3552
|
};
|
|
3554
|
-
}), K = (
|
|
3555
|
-
t.preferencesStorageKey && p(t.preferencesStorageKey,
|
|
3553
|
+
}), K = (w) => {
|
|
3554
|
+
t.preferencesStorageKey && p(t.preferencesStorageKey, w);
|
|
3556
3555
|
};
|
|
3557
|
-
return (
|
|
3558
|
-
const se = L("KIcon"), Y = L("KButton"),
|
|
3556
|
+
return (w, D) => {
|
|
3557
|
+
const se = L("KIcon"), Y = L("KButton"), _ = L("KDropdown"), N = L("KTable"), R = L("KCard");
|
|
3559
3558
|
return m(), U(R, {
|
|
3560
3559
|
class: "kong-ui-entity-base-table",
|
|
3561
3560
|
title: e.title
|
|
@@ -3583,7 +3582,7 @@ const as = {
|
|
|
3583
3582
|
"has-error": a.value.hasError,
|
|
3584
3583
|
headers: s.value,
|
|
3585
3584
|
"hide-pagination-when-optional": "",
|
|
3586
|
-
"initial-fetcher-params":
|
|
3585
|
+
"initial-fetcher-params": h.value,
|
|
3587
3586
|
"is-loading": e.isLoading,
|
|
3588
3587
|
"pagination-type": e.paginationType,
|
|
3589
3588
|
"row-attrs": l,
|
|
@@ -3595,9 +3594,9 @@ const as = {
|
|
|
3595
3594
|
}, $e({
|
|
3596
3595
|
toolbar: v(({ state: C }) => [
|
|
3597
3596
|
Je(V("div", Ks, [
|
|
3598
|
-
Z(
|
|
3599
|
-
|
|
3600
|
-
Z(
|
|
3597
|
+
Z(w.$slots, "toolbar-filter", {}, void 0, !0),
|
|
3598
|
+
w.$slots["toolbar-button"] ? (m(), M("div", Fs, [
|
|
3599
|
+
Z(w.$slots, "toolbar-button", {}, void 0, !0)
|
|
3601
3600
|
])) : H("", !0)
|
|
3602
3601
|
], 512), [
|
|
3603
3602
|
[Ye, i(C)]
|
|
@@ -3608,12 +3607,12 @@ const as = {
|
|
|
3608
3607
|
class: "actions-container",
|
|
3609
3608
|
"data-testid": C.name
|
|
3610
3609
|
}, [
|
|
3611
|
-
F(
|
|
3610
|
+
F(_, {
|
|
3612
3611
|
"kpop-attributes": { placement: "bottomEnd" },
|
|
3613
3612
|
width: e.dropdownMenuWidth
|
|
3614
3613
|
}, {
|
|
3615
3614
|
items: v(() => [
|
|
3616
|
-
Z(
|
|
3615
|
+
Z(w.$slots, "actions", {
|
|
3617
3616
|
row: C,
|
|
3618
3617
|
rowKey: S,
|
|
3619
3618
|
rowValue: x
|
|
@@ -3649,7 +3648,7 @@ const as = {
|
|
|
3649
3648
|
"row-el": d(x)
|
|
3650
3649
|
}, {
|
|
3651
3650
|
default: v(() => [
|
|
3652
|
-
Z(
|
|
3651
|
+
Z(w.$slots, S, {
|
|
3653
3652
|
row: x,
|
|
3654
3653
|
rowKey: q,
|
|
3655
3654
|
rowValue: J
|
|
@@ -3831,8 +3830,8 @@ const as = {
|
|
|
3831
3830
|
setup(e, { emit: n }) {
|
|
3832
3831
|
const t = e, { i18n: { t: r } } = ce.useI18n(), a = E(!1), o = E({}), i = $(() => {
|
|
3833
3832
|
const p = [];
|
|
3834
|
-
return new URLSearchParams(t.modelValue).forEach((A,
|
|
3835
|
-
A !== "" && p.push(
|
|
3833
|
+
return new URLSearchParams(t.modelValue).forEach((A, h) => {
|
|
3834
|
+
A !== "" && p.push(h);
|
|
3836
3835
|
}), p;
|
|
3837
3836
|
}), s = $(() => {
|
|
3838
3837
|
const p = t.config.fields;
|
|
@@ -3842,8 +3841,8 @@ const as = {
|
|
|
3842
3841
|
}));
|
|
3843
3842
|
});
|
|
3844
3843
|
Ae(() => t.modelValue, (p) => {
|
|
3845
|
-
o.value = {}, new URLSearchParams(p).forEach((A,
|
|
3846
|
-
o.value[
|
|
3844
|
+
o.value = {}, new URLSearchParams(p).forEach((A, h) => {
|
|
3845
|
+
o.value[h] = A;
|
|
3847
3846
|
});
|
|
3848
3847
|
});
|
|
3849
3848
|
const l = () => {
|
|
@@ -3851,14 +3850,14 @@ const as = {
|
|
|
3851
3850
|
}, c = (p) => {
|
|
3852
3851
|
n("update:modelValue", p);
|
|
3853
3852
|
}, d = (p) => `filter-${p}`, u = (p) => {
|
|
3854
|
-
var A,
|
|
3855
|
-
return (((
|
|
3853
|
+
var A, h;
|
|
3854
|
+
return (((h = (A = t.config.schema) == null ? void 0 : A[p]) == null ? void 0 : h.values) ?? []).map((K) => ({
|
|
3856
3855
|
value: K,
|
|
3857
3856
|
label: K
|
|
3858
3857
|
}));
|
|
3859
3858
|
}, g = (p) => {
|
|
3860
|
-
var A,
|
|
3861
|
-
return ((
|
|
3859
|
+
var A, h;
|
|
3860
|
+
return ((h = (A = t.config.schema) == null ? void 0 : A[p]) == null ? void 0 : h.type) ?? "text";
|
|
3862
3861
|
}, f = (p) => {
|
|
3863
3862
|
o.value = {
|
|
3864
3863
|
...o.value,
|
|
@@ -3867,12 +3866,12 @@ const as = {
|
|
|
3867
3866
|
}, I = () => {
|
|
3868
3867
|
o.value = {}, b(!0);
|
|
3869
3868
|
}, b = (p = !1) => {
|
|
3870
|
-
const A = Object.keys(o.value).reduce((
|
|
3869
|
+
const A = Object.keys(o.value).reduce((h, K) => (o.value[K] && (h[K] = `${o.value[K]}`), h), {});
|
|
3871
3870
|
p && (a.value = !1), n("update:modelValue", new URLSearchParams(A).toString());
|
|
3872
3871
|
};
|
|
3873
3872
|
return (p, A) => {
|
|
3874
|
-
const
|
|
3875
|
-
return e.config.isExactMatch ? (m(), U(
|
|
3873
|
+
const h = L("KInput"), K = L("KButton"), w = L("KSelect"), D = L("KMenuItem"), se = L("KMenu");
|
|
3874
|
+
return e.config.isExactMatch ? (m(), U(h, {
|
|
3876
3875
|
key: 0,
|
|
3877
3876
|
autocomplete: "off",
|
|
3878
3877
|
class: "kong-ui-entity-filter-input",
|
|
@@ -3905,11 +3904,11 @@ const as = {
|
|
|
3905
3904
|
]),
|
|
3906
3905
|
Je(F(se, { class: "kong-ui-entity-filter-menu" }, {
|
|
3907
3906
|
body: v(() => [
|
|
3908
|
-
(m(!0), M(be, null, he(s.value, (Y,
|
|
3907
|
+
(m(!0), M(be, null, he(s.value, (Y, _) => (m(), U(D, {
|
|
3909
3908
|
key: Y.value,
|
|
3910
3909
|
"data-testid": Y.value,
|
|
3911
3910
|
expandable: "",
|
|
3912
|
-
"last-menu-item":
|
|
3911
|
+
"last-menu-item": _ === s.value.length - 1
|
|
3913
3912
|
}, {
|
|
3914
3913
|
itemTitle: v(() => [
|
|
3915
3914
|
V("span", Ys, [
|
|
@@ -3927,7 +3926,7 @@ const as = {
|
|
|
3927
3926
|
class: "menu-item-label",
|
|
3928
3927
|
for: d(Y.value)
|
|
3929
3928
|
}, O(y(r)("filter.fieldLabel")), 9, Qs),
|
|
3930
|
-
((R = (N = e.config.schema) == null ? void 0 : N[Y.value]) == null ? void 0 : R.type) === "select" ? (m(), U(
|
|
3929
|
+
((R = (N = e.config.schema) == null ? void 0 : N[Y.value]) == null ? void 0 : R.type) === "select" ? (m(), U(w, {
|
|
3931
3930
|
key: 0,
|
|
3932
3931
|
id: d(Y.value),
|
|
3933
3932
|
modelValue: o.value[Y.value],
|
|
@@ -3935,7 +3934,7 @@ const as = {
|
|
|
3935
3934
|
appearance: "select",
|
|
3936
3935
|
items: u(Y.value),
|
|
3937
3936
|
placeholder: y(r)("filter.selectPlaceholder")
|
|
3938
|
-
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "items", "placeholder"])) : (m(), U(
|
|
3937
|
+
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "items", "placeholder"])) : (m(), U(h, {
|
|
3939
3938
|
key: 1,
|
|
3940
3939
|
id: d(Y.value),
|
|
3941
3940
|
modelValue: o.value[Y.value],
|
|
@@ -4134,21 +4133,21 @@ const pl = { class: "add-to-group-form-container" }, fl = { class: "add-to-group
|
|
|
4134
4133
|
const S = I.value ? u.value.find((q) => q.id === C) : (x = l.value) == null ? void 0 : x.find((q) => q.id === C);
|
|
4135
4134
|
return S ? S.name : C;
|
|
4136
4135
|
}, A = () => {
|
|
4137
|
-
|
|
4138
|
-
},
|
|
4136
|
+
w.value = "", h.value = [], _.value = [], n("cancel");
|
|
4137
|
+
}, h = E([]), K = E(!1), w = E(""), D = async () => {
|
|
4139
4138
|
if (!o.value.length) {
|
|
4140
|
-
|
|
4139
|
+
w.value = "", _.value = [], n("cancel");
|
|
4141
4140
|
return;
|
|
4142
4141
|
}
|
|
4143
|
-
K.value = !0,
|
|
4142
|
+
K.value = !0, w.value = "", h.value = [], _.value = [];
|
|
4144
4143
|
try {
|
|
4145
4144
|
const C = o.value.map((q) => Y(q)), S = await Promise.allSettled(C);
|
|
4146
4145
|
let x = !0;
|
|
4147
4146
|
S.forEach((q) => {
|
|
4148
4147
|
q.status !== "fulfilled" && (x = !1);
|
|
4149
|
-
}), x ? (
|
|
4148
|
+
}), x ? (h.value = [], _.value = [], n("add:success", o.value), o.value = []) : (h.value.length && n("add:partial-success", h.value), o.value = [], N(S));
|
|
4150
4149
|
} catch {
|
|
4151
|
-
|
|
4150
|
+
w.value = r("consumer_groups.errors.add"), n("error", w.value);
|
|
4152
4151
|
} finally {
|
|
4153
4152
|
K.value = !1;
|
|
4154
4153
|
}
|
|
@@ -4162,13 +4161,13 @@ const pl = { class: "add-to-group-form-container" }, fl = { class: "add-to-group
|
|
|
4162
4161
|
};
|
|
4163
4162
|
try {
|
|
4164
4163
|
const x = await a.post(se.value, S);
|
|
4165
|
-
return
|
|
4164
|
+
return h.value.push(C), x;
|
|
4166
4165
|
} catch (x) {
|
|
4167
4166
|
let q = `${p(C)} - ${x.message}`;
|
|
4168
4167
|
return x.response.status === 409 && (q = `${p(C)} - ${r("consumer_groups.errors.already_added")}`), Promise.reject(Error(q));
|
|
4169
4168
|
}
|
|
4170
|
-
},
|
|
4171
|
-
|
|
4169
|
+
}, _ = E([]), N = (C) => {
|
|
4170
|
+
_.value = C.map((S) => {
|
|
4172
4171
|
var x;
|
|
4173
4172
|
return (x = S.reason) == null ? void 0 : x.message;
|
|
4174
4173
|
}).filter(Boolean);
|
|
@@ -4206,14 +4205,14 @@ const pl = { class: "add-to-group-form-container" }, fl = { class: "add-to-group
|
|
|
4206
4205
|
width: "100%",
|
|
4207
4206
|
onQueryChange: y(i)
|
|
4208
4207
|
}, null, 8, ["modelValue", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly", "onQueryChange"]),
|
|
4209
|
-
|
|
4208
|
+
w.value || g.value || _.value.length ? (m(), M("div", ml, [
|
|
4210
4209
|
F(q, { appearance: "danger" }, {
|
|
4211
4210
|
alertMessage: v(() => [
|
|
4212
4211
|
V("p", null, O(y(r)("consumer_groups.errors.add")), 1),
|
|
4213
|
-
|
|
4214
|
-
(m(!0), M(be, null, he(
|
|
4212
|
+
_.value.length ? (m(), M("ul", gl, [
|
|
4213
|
+
(m(!0), M(be, null, he(_.value, (X, ee) => (m(), M("li", { key: ee }, O(X), 1))), 128))
|
|
4215
4214
|
])) : H("", !0),
|
|
4216
|
-
V("div", null, O(
|
|
4215
|
+
V("div", null, O(w.value || g.value), 1)
|
|
4217
4216
|
]),
|
|
4218
4217
|
_: 1
|
|
4219
4218
|
})
|
|
@@ -4305,9 +4304,9 @@ const Ft = (e, n) => {
|
|
|
4305
4304
|
},
|
|
4306
4305
|
schema: t.config.filterSchema
|
|
4307
4306
|
};
|
|
4308
|
-
}), p = $(() => l.value ? "consumer_groups" : void 0), { fetcher: A, fetcherState:
|
|
4307
|
+
}), p = $(() => l.value ? "consumer_groups" : void 0), { fetcher: A, fetcherState: h } = dl(t.config, f.value, p.value), K = () => {
|
|
4309
4308
|
I.value = "";
|
|
4310
|
-
},
|
|
4309
|
+
}, w = () => {
|
|
4311
4310
|
s.value++;
|
|
4312
4311
|
}, D = E(null), se = (T, z) => {
|
|
4313
4312
|
const re = T.id;
|
|
@@ -4337,7 +4336,7 @@ const Ft = (e, n) => {
|
|
|
4337
4336
|
entity: T,
|
|
4338
4337
|
message: a("consumer_groups.copy.success_brief")
|
|
4339
4338
|
});
|
|
4340
|
-
},
|
|
4339
|
+
}, _ = async (T) => {
|
|
4341
4340
|
var re;
|
|
4342
4341
|
await ((re = t.canRetrieve) == null ? void 0 : re.call(t, T)) && o.push(t.config.getViewRoute(T.id));
|
|
4343
4342
|
}, N = (T) => ({
|
|
@@ -4364,10 +4363,10 @@ const Ft = (e, n) => {
|
|
|
4364
4363
|
}
|
|
4365
4364
|
}, le = E(!1), De = () => {
|
|
4366
4365
|
le.value = !0;
|
|
4367
|
-
},
|
|
4366
|
+
}, k = () => {
|
|
4368
4367
|
le.value = !1;
|
|
4369
4368
|
}, B = (T, z) => {
|
|
4370
|
-
z ||
|
|
4369
|
+
z || k(), s.value++, n("add:success", T);
|
|
4371
4370
|
}, oe = () => {
|
|
4372
4371
|
l.value && De();
|
|
4373
4372
|
}, P = E(void 0), G = E(!1), ge = E(""), _e = (T) => {
|
|
@@ -4391,7 +4390,7 @@ const Ft = (e, n) => {
|
|
|
4391
4390
|
}
|
|
4392
4391
|
}
|
|
4393
4392
|
}, Nt = E(!0);
|
|
4394
|
-
Ae(
|
|
4393
|
+
Ae(h, (T) => {
|
|
4395
4394
|
var z, re, ye, we;
|
|
4396
4395
|
if (Array.isArray((z = T == null ? void 0 : T.response) == null ? void 0 : z.data) && (Nt.value = T.response.data.length > 0), T.status === Oe.Error) {
|
|
4397
4396
|
D.value = {
|
|
@@ -4429,9 +4428,9 @@ const Ft = (e, n) => {
|
|
|
4429
4428
|
"table-headers": y(u),
|
|
4430
4429
|
"use-action-outside": e.useActionOutside,
|
|
4431
4430
|
onClearSearchInput: K,
|
|
4432
|
-
"onClick:row": z[3] || (z[3] = (W) =>
|
|
4431
|
+
"onClick:row": z[3] || (z[3] = (W) => _(W)),
|
|
4433
4432
|
onEmptyStateCtaClicked: oe,
|
|
4434
|
-
onSort:
|
|
4433
|
+
onSort: w
|
|
4435
4434
|
}, {
|
|
4436
4435
|
"toolbar-filter": v(() => [
|
|
4437
4436
|
l.value ? H("", !0) : (m(), U(y(nl), {
|
|
@@ -4584,7 +4583,7 @@ const Ft = (e, n) => {
|
|
|
4584
4583
|
visible: le.value,
|
|
4585
4584
|
"onAdd:partialSuccess": z[4] || (z[4] = (W) => B(W, !0)),
|
|
4586
4585
|
"onAdd:success": z[5] || (z[5] = (W) => B(W)),
|
|
4587
|
-
onCancel:
|
|
4586
|
+
onCancel: k
|
|
4588
4587
|
}, null, 8, ["config", "visible"])) : H("", !0),
|
|
4589
4588
|
e.config.consumerId && P.value ? (m(), U(fr, {
|
|
4590
4589
|
key: 1,
|
|
@@ -4667,32 +4666,32 @@ const Bl = /* @__PURE__ */ Ft(Cl, [["__scopeId", "data-v-12149d54"]]), kl = { cl
|
|
|
4667
4666
|
searchKeys: ["username", "custom_id", "id"]
|
|
4668
4667
|
}), { axiosInstance: g } = Kt({
|
|
4669
4668
|
headers: (De = t.config) == null ? void 0 : De.requestHeaders
|
|
4670
|
-
}), { getMessageFromError: f } = cl(), I = $(() => u.value.map((
|
|
4671
|
-
label:
|
|
4672
|
-
value:
|
|
4673
|
-
selected: o.fields.consumers.includes(
|
|
4674
|
-
data:
|
|
4669
|
+
}), { getMessageFromError: f } = cl(), I = $(() => u.value.map((k) => ({
|
|
4670
|
+
label: k.username || k.custom_id,
|
|
4671
|
+
value: k.id,
|
|
4672
|
+
selected: o.fields.consumers.includes(k.id),
|
|
4673
|
+
data: k
|
|
4675
4674
|
// we need this to determine whether or not to show the description text
|
|
4676
4675
|
}))), b = $(() => {
|
|
4677
|
-
var
|
|
4678
|
-
return (B = Me.form[(
|
|
4679
|
-
}), p = $(() => t.consumerGroupId ? tt.Edit : tt.Create), A = $(() => !!o.fields.name && !
|
|
4676
|
+
var k, B;
|
|
4677
|
+
return (B = Me.form[(k = t.config) == null ? void 0 : k.app]) == null ? void 0 : B.edit;
|
|
4678
|
+
}), p = $(() => t.consumerGroupId ? tt.Edit : tt.Create), A = $(() => !!o.fields.name && !_.value), h = $(() => JSON.stringify(o.fields) !== JSON.stringify(i)), K = (k, B = "", oe = "") => {
|
|
4680
4679
|
var G, ge, _e, de, Ne, Ge;
|
|
4681
|
-
let P = `${(G = t.config) == null ? void 0 : G.apiBaseUrl}${Me.form[(ge = t.config) == null ? void 0 : ge.app][
|
|
4682
|
-
return ((_e = t.config) == null ? void 0 : _e.app) === "konnect" ? P = P.replace(/{controlPlaneId}/gi, ((de = t.config) == null ? void 0 : de.controlPlaneId) || "") : ((Ne = t.config) == null ? void 0 : Ne.app) === "kongManager" && (P = P.replace(/\/{workspace}/gi, (Ge = t.config) != null && Ge.workspace ? `/${t.config.workspace}` : "")), P = P.replace(/{id}/gi, B || t.consumerGroupId), (
|
|
4683
|
-
},
|
|
4684
|
-
var
|
|
4685
|
-
a.push(((
|
|
4686
|
-
}, D = (
|
|
4687
|
-
n("error",
|
|
4688
|
-
}, se = (
|
|
4689
|
-
n("loading",
|
|
4690
|
-
}, Y = async (
|
|
4680
|
+
let P = `${(G = t.config) == null ? void 0 : G.apiBaseUrl}${Me.form[(ge = t.config) == null ? void 0 : ge.app][k]}`;
|
|
4681
|
+
return ((_e = t.config) == null ? void 0 : _e.app) === "konnect" ? P = P.replace(/{controlPlaneId}/gi, ((de = t.config) == null ? void 0 : de.controlPlaneId) || "") : ((Ne = t.config) == null ? void 0 : Ne.app) === "kongManager" && (P = P.replace(/\/{workspace}/gi, (Ge = t.config) != null && Ge.workspace ? `/${t.config.workspace}` : "")), P = P.replace(/{id}/gi, B || t.consumerGroupId), (k === "addConsumer" || k === "removeConsumer") && (P = P.replace(/{consumerId}/gi, oe)), P;
|
|
4682
|
+
}, w = () => {
|
|
4683
|
+
var k;
|
|
4684
|
+
a.push(((k = t.config) == null ? void 0 : k.cancelRoute) || { name: "consumer-group-list" });
|
|
4685
|
+
}, D = (k) => {
|
|
4686
|
+
n("error", k);
|
|
4687
|
+
}, se = (k) => {
|
|
4688
|
+
n("loading", k);
|
|
4689
|
+
}, Y = async (k) => {
|
|
4691
4690
|
var oe, P, G, ge, _e;
|
|
4692
|
-
o.fields.name = ((oe =
|
|
4693
|
-
const B = ((G =
|
|
4694
|
-
if (o.fields.tags = (B == null ? void 0 : B.join(", ")) || "", "consumers" in
|
|
4695
|
-
o.fields.consumers = ((ge =
|
|
4691
|
+
o.fields.name = ((oe = k == null ? void 0 : k.item) == null ? void 0 : oe.name) || ((P = k == null ? void 0 : k.consumer_group) == null ? void 0 : P.name) || (k == null ? void 0 : k.name) || "";
|
|
4692
|
+
const B = ((G = k == null ? void 0 : k.item) == null ? void 0 : G.tags) || (k == null ? void 0 : k.consumer_group.tags) || (k == null ? void 0 : k.tags) || [];
|
|
4693
|
+
if (o.fields.tags = (B == null ? void 0 : B.join(", ")) || "", "consumers" in k)
|
|
4694
|
+
o.fields.consumers = ((ge = k == null ? void 0 : k.consumers) == null ? void 0 : ge.map((de) => de.id)) || [];
|
|
4696
4695
|
else
|
|
4697
4696
|
try {
|
|
4698
4697
|
const { data: de } = await g.get(K("getConsumers"));
|
|
@@ -4701,39 +4700,39 @@ const Bl = /* @__PURE__ */ Ft(Cl, [["__scopeId", "data-v-12149d54"]]), kl = { cl
|
|
|
4701
4700
|
S(de);
|
|
4702
4701
|
}
|
|
4703
4702
|
Object.assign(i, o.fields);
|
|
4704
|
-
},
|
|
4705
|
-
var
|
|
4703
|
+
}, _ = $(() => /^[0-9a-zA-Z.\-_~]*$/.test(o.fields.name) ? "" : r("consumer_groups.form.validation_errors.name")), N = () => {
|
|
4704
|
+
var k, B;
|
|
4706
4705
|
return {
|
|
4707
4706
|
name: o.fields.name,
|
|
4708
|
-
tags: (B = (
|
|
4707
|
+
tags: (B = (k = o.fields.tags.split(",")) == null ? void 0 : k.map((oe) => String(oe || "").trim())) == null ? void 0 : B.filter((oe) => oe !== "")
|
|
4709
4708
|
};
|
|
4710
|
-
}, R = async (
|
|
4711
|
-
o.errorMessage = f(
|
|
4712
|
-
}, x = (
|
|
4713
|
-
Object.assign(i, o.fields), n("update", { ...o.fields, id:
|
|
4714
|
-
}, q = (
|
|
4715
|
-
const P =
|
|
4709
|
+
}, R = async (k, B = "") => await g.post(K("addConsumer", B, k), { consumer: k }), C = async (k, B = "") => await g.delete(K("removeConsumer", B, k)), S = (k) => {
|
|
4710
|
+
o.errorMessage = f(k), n("error", k);
|
|
4711
|
+
}, x = (k = t.consumerGroupId) => {
|
|
4712
|
+
Object.assign(i, o.fields), n("update", { ...o.fields, id: k });
|
|
4713
|
+
}, q = (k, B, oe = t.consumerGroupId) => {
|
|
4714
|
+
const P = k == null ? void 0 : k.find((G) => G.status !== "fulfilled");
|
|
4716
4715
|
P ? S({
|
|
4717
4716
|
code: P.status,
|
|
4718
4717
|
message: B
|
|
4719
4718
|
}) : x(oe);
|
|
4720
4719
|
}, J = async () => {
|
|
4721
|
-
let
|
|
4720
|
+
let k = "";
|
|
4722
4721
|
try {
|
|
4723
4722
|
const { data: B } = await g.post(K("create"), N());
|
|
4724
|
-
|
|
4723
|
+
k = "item" in B ? B.item.id : B.id;
|
|
4725
4724
|
} catch (B) {
|
|
4726
4725
|
S(B);
|
|
4727
4726
|
}
|
|
4728
|
-
if (o.fields.consumers.length > 0 &&
|
|
4727
|
+
if (o.fields.consumers.length > 0 && k)
|
|
4729
4728
|
try {
|
|
4730
|
-
const B = o.fields.consumers.map((P) => R(P,
|
|
4731
|
-
q(oe, r("consumer_groups.errors.add_consumer"),
|
|
4729
|
+
const B = o.fields.consumers.map((P) => R(P, k)), oe = await Promise.allSettled(B);
|
|
4730
|
+
q(oe, r("consumer_groups.errors.add_consumer"), k);
|
|
4732
4731
|
} catch (B) {
|
|
4733
4732
|
S(B);
|
|
4734
4733
|
}
|
|
4735
4734
|
else
|
|
4736
|
-
o.fields.consumers.length === 0 &&
|
|
4735
|
+
o.fields.consumers.length === 0 && k && x(k);
|
|
4737
4736
|
}, X = async () => {
|
|
4738
4737
|
var oe;
|
|
4739
4738
|
try {
|
|
@@ -4741,8 +4740,8 @@ const Bl = /* @__PURE__ */ Ft(Cl, [["__scopeId", "data-v-12149d54"]]), kl = { cl
|
|
|
4741
4740
|
} catch (P) {
|
|
4742
4741
|
S(P);
|
|
4743
4742
|
}
|
|
4744
|
-
const
|
|
4745
|
-
if (B.length === 0 &&
|
|
4743
|
+
const k = o.fields.consumers.filter((P) => !i.consumers.includes(P)), B = i.consumers.filter((P) => !o.fields.consumers.includes(P));
|
|
4744
|
+
if (B.length === 0 && k.length === 0)
|
|
4746
4745
|
x();
|
|
4747
4746
|
else {
|
|
4748
4747
|
if (B.length > 0)
|
|
@@ -4752,9 +4751,9 @@ const Bl = /* @__PURE__ */ Ft(Cl, [["__scopeId", "data-v-12149d54"]]), kl = { cl
|
|
|
4752
4751
|
} catch (P) {
|
|
4753
4752
|
S(P);
|
|
4754
4753
|
}
|
|
4755
|
-
if (
|
|
4754
|
+
if (k.length > 0)
|
|
4756
4755
|
try {
|
|
4757
|
-
const P =
|
|
4756
|
+
const P = k.map((ge) => R(ge)), G = await Promise.allSettled(P);
|
|
4758
4757
|
q(G, r("consumer_groups.errors.add_consumer"));
|
|
4759
4758
|
} catch (P) {
|
|
4760
4759
|
S(P);
|
|
@@ -4769,17 +4768,17 @@ const Bl = /* @__PURE__ */ Ft(Cl, [["__scopeId", "data-v-12149d54"]]), kl = { cl
|
|
|
4769
4768
|
};
|
|
4770
4769
|
return ut(async () => {
|
|
4771
4770
|
await d();
|
|
4772
|
-
}), (
|
|
4771
|
+
}), (k, B) => {
|
|
4773
4772
|
const oe = L("KInput"), P = L("KMultiselect");
|
|
4774
4773
|
return m(), M("div", kl, [
|
|
4775
4774
|
F(y(Ms), {
|
|
4776
|
-
"can-submit": A.value &&
|
|
4775
|
+
"can-submit": A.value && h.value,
|
|
4777
4776
|
config: e.config,
|
|
4778
4777
|
"edit-id": e.consumerGroupId,
|
|
4779
|
-
"error-message": o.errorMessage || y(c) ||
|
|
4778
|
+
"error-message": o.errorMessage || y(c) || _.value,
|
|
4780
4779
|
"fetch-url": b.value,
|
|
4781
4780
|
"is-readonly": o.readonly,
|
|
4782
|
-
onCancel:
|
|
4781
|
+
onCancel: w,
|
|
4783
4782
|
"onFetch:error": B[3] || (B[3] = (G) => D(G)),
|
|
4784
4783
|
"onFetch:success": Y,
|
|
4785
4784
|
onLoading: B[4] || (B[4] = (G) => se(G)),
|