@kong-ui-public/entities-snis 2.0.4 → 2.0.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.
package/dist/entities-snis.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ee, ref as C, computed as w, watch as re, renderSlot as G, createCommentVNode as X, unref as s, onBeforeMount as Ie, resolveComponent as F, openBlock as b, createBlock as D, withCtx as d, createElementVNode as M, toDisplayString as O, createElementBlock as q, withModifiers as ve, createVNode as I, createTextVNode as J, createSlots as ze, withDirectives as ye, vShow as me, renderList as Ce, Fragment as We, useSlots as st, normalizeClass as he, onMounted as ct, onUnmounted as ut, inject as dt, resolveDynamicComponent as Se, mergeProps as Oe, normalizeStyle as pt, pushScopeId as ft, popScopeId as yt, reactive as Me } from "vue";
|
|
2
2
|
import { createI18n as xe, i18nTComponent as Je } from "@kong-ui-public/i18n";
|
|
3
3
|
import mt from "axios";
|
|
4
4
|
import "@kong/kongponents";
|
|
5
|
-
import { useRouter as
|
|
5
|
+
import { useRouter as Ye } from "vue-router";
|
|
6
6
|
const gt = {
|
|
7
7
|
create: "New SNI",
|
|
8
8
|
copy_id: "Copy ID",
|
|
@@ -90,7 +90,7 @@ function _t() {
|
|
|
90
90
|
// Translation component <i18n-t>
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
const
|
|
93
|
+
const Ze = {
|
|
94
94
|
useI18n: _t
|
|
95
95
|
}, de = {
|
|
96
96
|
list: {
|
|
@@ -116,7 +116,7 @@ const Ye = {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
var Ge = /* @__PURE__ */ ((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))(Ge || {}), ge = /* @__PURE__ */ ((e) => (e.Edit = "edit", e.Create = "create", e))(ge || {}),
|
|
119
|
+
var Ge = /* @__PURE__ */ ((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))(Ge || {}), ge = /* @__PURE__ */ ((e) => (e.Edit = "edit", e.Create = "create", e))(ge || {}), ie = /* @__PURE__ */ ((e) => (e[e.Loading = 0] = "Loading", e[e.Idle = 1] = "Idle", e[e.NoResults = 2] = "NoResults", e[e.Error = 3] = "Error", e))(ie || {});
|
|
120
120
|
function Te(e = {}) {
|
|
121
121
|
return {
|
|
122
122
|
axiosInstance: mt.create({
|
|
@@ -242,7 +242,7 @@ const Tt = {
|
|
|
242
242
|
applyButtonText: "Apply",
|
|
243
243
|
clearButtonText: "Clear",
|
|
244
244
|
clearAllButtonText: "Clear all filters"
|
|
245
|
-
},
|
|
245
|
+
}, Mt = {
|
|
246
246
|
errors: {
|
|
247
247
|
fetch: "Could not fetch available items",
|
|
248
248
|
invalid: "Please select a valid value"
|
|
@@ -250,7 +250,7 @@ const Tt = {
|
|
|
250
250
|
}, Ft = {
|
|
251
251
|
unexpected: "An unexpected error has occurred",
|
|
252
252
|
dataKeyUndefined: 'The data key "{dataKey}" does not exist in the response.'
|
|
253
|
-
},
|
|
253
|
+
}, Kt = {
|
|
254
254
|
enable: {
|
|
255
255
|
title: "Enable {entityType}",
|
|
256
256
|
message: "Are you sure you want to enable the {entityType} {entityName}?",
|
|
@@ -261,19 +261,19 @@ const Tt = {
|
|
|
261
261
|
message: "Are you sure you want to disable the {entityType} {entityName}?",
|
|
262
262
|
confirmText: "Yes, disable"
|
|
263
263
|
}
|
|
264
|
-
},
|
|
264
|
+
}, jt = {
|
|
265
265
|
global: Tt,
|
|
266
266
|
deleteModal: Nt,
|
|
267
267
|
baseForm: Et,
|
|
268
268
|
baseTable: At,
|
|
269
269
|
baseConfigCard: $t,
|
|
270
270
|
filter: Ot,
|
|
271
|
-
debouncedFilter:
|
|
271
|
+
debouncedFilter: Mt,
|
|
272
272
|
errors: Ft,
|
|
273
|
-
toggleModal:
|
|
273
|
+
toggleModal: Kt
|
|
274
274
|
};
|
|
275
275
|
function Ne() {
|
|
276
|
-
const e = xe("en-us",
|
|
276
|
+
const e = xe("en-us", jt);
|
|
277
277
|
return {
|
|
278
278
|
i18n: e,
|
|
279
279
|
i18nT: Je(e)
|
|
@@ -286,7 +286,7 @@ function Qe() {
|
|
|
286
286
|
return !1;
|
|
287
287
|
const n = /* @__PURE__ */ new Set([...t, ...a]);
|
|
288
288
|
for (const i of n) {
|
|
289
|
-
const o = t.filter((
|
|
289
|
+
const o = t.filter((p) => p === i).length, f = a.filter((p) => p === i).length;
|
|
290
290
|
if (o !== f)
|
|
291
291
|
return !1;
|
|
292
292
|
}
|
|
@@ -331,84 +331,84 @@ function Pt(e, r, t, a = {
|
|
|
331
331
|
t || (t = "100");
|
|
332
332
|
const { axiosInstance: n } = Te({
|
|
333
333
|
headers: e.requestHeaders
|
|
334
|
-
}), { i18n: { t: i } } = Ne(), { debounce: o } = It(), f = o(async (
|
|
335
|
-
await
|
|
336
|
-
}, 200),
|
|
337
|
-
let v = `${e.apiBaseUrl}${
|
|
334
|
+
}), { i18n: { t: i } } = Ne(), { debounce: o } = It(), f = o(async (u) => {
|
|
335
|
+
await P(u);
|
|
336
|
+
}, 200), p = C(!1), y = C(""), l = C(""), g = C([]), S = C([]), x = C(void 0), V = s(r);
|
|
337
|
+
let v = `${e.apiBaseUrl}${V}`;
|
|
338
338
|
e.app === "konnect" ? v = v.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "") : e.app === "kongManager" && (v = v.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : ""));
|
|
339
339
|
const { isValidUuid: c } = Qe(), h = async () => {
|
|
340
340
|
try {
|
|
341
|
-
|
|
342
|
-
const { data:
|
|
343
|
-
|
|
341
|
+
p.value = !0;
|
|
342
|
+
const { data: u } = await n.get(`${v}?size=${t}`);
|
|
343
|
+
u != null && u.next || (x.value = a.fetchedItemsKey in u ? u[a.fetchedItemsKey] : []), S.value = a.fetchedItemsKey in u ? u[a.fetchedItemsKey] : [], g.value = S.value;
|
|
344
344
|
} catch {
|
|
345
345
|
g.value = [], y.value = i("debouncedFilter.errors.fetch");
|
|
346
346
|
} finally {
|
|
347
|
-
|
|
347
|
+
p.value = !1;
|
|
348
348
|
}
|
|
349
|
-
},
|
|
350
|
-
var
|
|
351
|
-
if (
|
|
352
|
-
if (
|
|
349
|
+
}, _ = C(""), P = async (u) => {
|
|
350
|
+
var $, z, E;
|
|
351
|
+
if (_.value !== u)
|
|
352
|
+
if (_.value = u || "", x.value === void 0)
|
|
353
353
|
try {
|
|
354
|
-
if (
|
|
355
|
-
let
|
|
356
|
-
|
|
357
|
-
const { data:
|
|
358
|
-
a.fetchedItemsKey in
|
|
359
|
-
} else if (
|
|
360
|
-
const
|
|
361
|
-
c(
|
|
362
|
-
const { data:
|
|
363
|
-
return [
|
|
364
|
-
})()) :
|
|
365
|
-
...a.searchKeys.filter((
|
|
366
|
-
const { data:
|
|
367
|
-
return
|
|
354
|
+
if (p.value = !0, y.value = "", l.value = "", e.app === "konnect") {
|
|
355
|
+
let R = v + "";
|
|
356
|
+
u && (R += `/${u}`);
|
|
357
|
+
const { data: K } = await n.get(`${R}?size=${t}`);
|
|
358
|
+
a.fetchedItemsKey in K ? g.value = K[a.fetchedItemsKey] : K != null && K.id ? g.value = [K] : g.value = [];
|
|
359
|
+
} else if (u) {
|
|
360
|
+
const R = [];
|
|
361
|
+
c(u) && a.searchKeys.includes("id") ? R.push((async () => {
|
|
362
|
+
const { data: N } = await n.get(`${v}/${u}`);
|
|
363
|
+
return [N[a.fetchedItemsKey] ?? N];
|
|
364
|
+
})()) : R.push(
|
|
365
|
+
...a.searchKeys.filter((N) => N !== "id").map(async (N) => {
|
|
366
|
+
const { data: L } = await n.get(`${v}?${N}=${u}`);
|
|
367
|
+
return L[a.fetchedItemsKey];
|
|
368
368
|
})
|
|
369
369
|
);
|
|
370
|
-
const
|
|
371
|
-
g.value = [], (
|
|
372
|
-
var
|
|
373
|
-
(
|
|
374
|
-
|
|
370
|
+
const K = await Promise.all(R), W = /* @__PURE__ */ new Set();
|
|
371
|
+
g.value = [], ($ = K == null ? void 0 : K.forEach) == null || $.call(K, (N) => {
|
|
372
|
+
var L;
|
|
373
|
+
(L = N == null ? void 0 : N.forEach) == null || L.call(N, (Z) => {
|
|
374
|
+
W.has(Z.id) || (W.add(Z.id), g.value.push(Z));
|
|
375
375
|
});
|
|
376
376
|
});
|
|
377
377
|
} else
|
|
378
|
-
g.value =
|
|
379
|
-
} catch (
|
|
380
|
-
((
|
|
378
|
+
g.value = S.value;
|
|
379
|
+
} catch (R) {
|
|
380
|
+
((z = R == null ? void 0 : R.response) == null ? void 0 : z.status) === 404 ? l.value = i("debouncedFilter.errors.invalid") : (g.value = [], y.value = i("debouncedFilter.errors.fetch"));
|
|
381
381
|
} finally {
|
|
382
|
-
|
|
382
|
+
p.value = !1;
|
|
383
383
|
}
|
|
384
384
|
else
|
|
385
|
-
|
|
386
|
-
var
|
|
387
|
-
let
|
|
388
|
-
for (const
|
|
389
|
-
const
|
|
390
|
-
|
|
385
|
+
p.value = !0, l.value = "", u ? (g.value = (E = x.value) == null ? void 0 : E.filter((R) => {
|
|
386
|
+
var K;
|
|
387
|
+
let W = !1;
|
|
388
|
+
for (const N of a.searchKeys) {
|
|
389
|
+
const L = typeof R[N] == "string" ? (K = R[N]) == null ? void 0 : K.toLowerCase() : R[N];
|
|
390
|
+
L != null && L.includes(u.toLowerCase()) && (W = !0);
|
|
391
391
|
}
|
|
392
|
-
return
|
|
393
|
-
}), (!g.value || !g.value.length) && (l.value = i("debouncedFilter.errors.invalid"))) : g.value =
|
|
392
|
+
return W;
|
|
393
|
+
}), (!g.value || !g.value.length) && (l.value = i("debouncedFilter.errors.invalid"))) : g.value = x.value, p.value = !1;
|
|
394
394
|
};
|
|
395
395
|
return {
|
|
396
|
-
loading:
|
|
396
|
+
loading: p,
|
|
397
397
|
error: y,
|
|
398
398
|
validationError: l,
|
|
399
399
|
results: g,
|
|
400
|
-
allRecords:
|
|
400
|
+
allRecords: x,
|
|
401
401
|
loadItems: h,
|
|
402
402
|
debouncedQueryChange: f
|
|
403
403
|
};
|
|
404
404
|
}
|
|
405
405
|
function Rt(e, r) {
|
|
406
|
-
const t = s(r), a =
|
|
406
|
+
const t = s(r), a = w(
|
|
407
407
|
() => e.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${t}`) : new URL(t)
|
|
408
408
|
);
|
|
409
409
|
return a.value.search = "", (n) => `${a.value.href}/${n}`;
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function qt() {
|
|
412
412
|
const { i18n: { t: e } } = Ne();
|
|
413
413
|
return {
|
|
414
414
|
getMessageFromError: (r) => {
|
|
@@ -448,36 +448,36 @@ function Bt(e) {
|
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
function Xe(e, r) {
|
|
451
|
-
const t =
|
|
451
|
+
const t = C(s(e)), a = C(s(r)), n = w(
|
|
452
452
|
() => !!(t.value.app === "konnect" || t.value.isExactMatch)
|
|
453
|
-
), i =
|
|
453
|
+
), i = w(
|
|
454
454
|
() => a.value.startsWith("/") ? new URL(`${window.location.origin}${a.value}`) : new URL(a.value)
|
|
455
455
|
);
|
|
456
456
|
return (o) => {
|
|
457
|
-
const { page: f, pageSize:
|
|
457
|
+
const { page: f, pageSize: p, offset: y, sortColumnKey: l, sortColumnOrder: g, query: S } = o;
|
|
458
458
|
try {
|
|
459
|
-
let
|
|
460
|
-
return n.value &&
|
|
461
|
-
|
|
462
|
-
}), l &&
|
|
463
|
-
} catch (
|
|
464
|
-
return console.error("RouteList(fetcher)",
|
|
459
|
+
let x = new URL(i.value.href);
|
|
460
|
+
return n.value && S ? (x.search = "", x = new URL(`${x.href}/${S}/`)) : (n.value || new URLSearchParams(S).forEach((V, v) => {
|
|
461
|
+
x.searchParams.append(v, V);
|
|
462
|
+
}), l && x.searchParams.append("sort_by", l), g === "desc" && x.searchParams.append("sort_desc", "1"), x.searchParams.append("size", String(p))), y && f !== 1 && x.searchParams.append("offset", String(y)), x.href;
|
|
463
|
+
} catch (x) {
|
|
464
|
+
return console.error("RouteList(fetcher)", x), a.value;
|
|
465
465
|
}
|
|
466
466
|
};
|
|
467
467
|
}
|
|
468
468
|
function Vt(e, r, t = "data") {
|
|
469
469
|
const a = s(r), { axiosInstance: n } = Te({
|
|
470
470
|
headers: e.requestHeaders
|
|
471
|
-
}), i = Xe(e, a), o =
|
|
472
|
-
status:
|
|
471
|
+
}), i = Xe(e, a), o = C({
|
|
472
|
+
status: ie.Idle
|
|
473
473
|
});
|
|
474
474
|
return { fetcher: async (f) => {
|
|
475
475
|
try {
|
|
476
|
-
o.value = { status:
|
|
477
|
-
const
|
|
476
|
+
o.value = { status: ie.Loading };
|
|
477
|
+
const p = i(f), { data: y } = await n.get(p), l = t && t.replace(/[^\w-_]/gi, "");
|
|
478
478
|
let g;
|
|
479
479
|
y[l] && Array.isArray(y[l]) ? g = y[l] : g = Object.keys(y).length ? [y] : [];
|
|
480
|
-
const
|
|
480
|
+
const S = {
|
|
481
481
|
data: g,
|
|
482
482
|
total: g.length,
|
|
483
483
|
...y.offset ? {
|
|
@@ -487,27 +487,27 @@ function Vt(e, r, t = "data") {
|
|
|
487
487
|
} : null
|
|
488
488
|
};
|
|
489
489
|
return o.value = {
|
|
490
|
-
status:
|
|
491
|
-
response:
|
|
492
|
-
},
|
|
493
|
-
} catch (
|
|
490
|
+
status: ie.Idle,
|
|
491
|
+
response: S
|
|
492
|
+
}, S;
|
|
493
|
+
} catch (p) {
|
|
494
494
|
const y = {
|
|
495
495
|
data: [],
|
|
496
496
|
total: 0
|
|
497
497
|
};
|
|
498
|
-
return f.query &&
|
|
499
|
-
status:
|
|
498
|
+
return f.query && p.response.status === 404 ? (o.value = {
|
|
499
|
+
status: ie.NoResults,
|
|
500
500
|
response: y,
|
|
501
|
-
error:
|
|
501
|
+
error: p
|
|
502
502
|
}, y) : (o.value = {
|
|
503
|
-
status:
|
|
503
|
+
status: ie.Error,
|
|
504
504
|
response: y,
|
|
505
|
-
error:
|
|
505
|
+
error: p
|
|
506
506
|
}, y);
|
|
507
507
|
}
|
|
508
508
|
}, fetcherState: o };
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Ut() {
|
|
511
511
|
const e = (t, a = "_") => t ? t.split(a).map((n) => n.toLowerCase() === "id" ? n.toUpperCase() : n.charAt(0).toUpperCase() + n.substring(1)).join(" ") : "", r = /(?:^|[\s-:'"])\w/g;
|
|
512
512
|
return {
|
|
513
513
|
capitalize: (t) => t ? t.replace(r, (a) => a.toUpperCase()) : "",
|
|
@@ -521,13 +521,13 @@ const et = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-(
|
|
|
521
521
|
if (!r)
|
|
522
522
|
throw new Error(`Invalid argument not valid semver ('${e}' received)`);
|
|
523
523
|
return r.shift(), r;
|
|
524
|
-
},
|
|
524
|
+
}, Ke = (e) => e === "*" || e === "x" || e === "X", je = (e) => {
|
|
525
525
|
const r = parseInt(e, 10);
|
|
526
526
|
return isNaN(r) ? e : r;
|
|
527
527
|
}, Lt = (e, r) => typeof e != typeof r ? [String(e), String(r)] : [e, r], Dt = (e, r) => {
|
|
528
|
-
if (
|
|
528
|
+
if (Ke(e) || Ke(r))
|
|
529
529
|
return 0;
|
|
530
|
-
const [t, a] = Lt(
|
|
530
|
+
const [t, a] = Lt(je(e), je(r));
|
|
531
531
|
return t > a ? 1 : t < a ? -1 : 0;
|
|
532
532
|
}, Pe = (e, r) => {
|
|
533
533
|
for (let t = 0; t < Math.max(e.length, r.length); t++) {
|
|
@@ -550,11 +550,11 @@ const et = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-(
|
|
|
550
550
|
"<=": [-1, 0],
|
|
551
551
|
"<": [-1],
|
|
552
552
|
"!=": [-1, 1]
|
|
553
|
-
},
|
|
553
|
+
}, qe = Object.keys(tt), zt = (e) => {
|
|
554
554
|
if (typeof e != "string")
|
|
555
555
|
throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);
|
|
556
|
-
if (
|
|
557
|
-
throw new Error(`Invalid operator, expected one of ${
|
|
556
|
+
if (qe.indexOf(e) === -1)
|
|
557
|
+
throw new Error(`Invalid operator, expected one of ${qe.join("|")}`);
|
|
558
558
|
}, Wt = (e) => typeof e == "string" && /^[v\d]/.test(e) && et.test(e);
|
|
559
559
|
function Jt(e) {
|
|
560
560
|
const { gatewayInfo: r, supportedRange: t } = e;
|
|
@@ -569,33 +569,33 @@ function Jt(e) {
|
|
|
569
569
|
const [o, f] = i;
|
|
570
570
|
return !(o && Re(n, o, "<") || f && Re(n, f, ">"));
|
|
571
571
|
}
|
|
572
|
-
function
|
|
573
|
-
const r =
|
|
574
|
-
return
|
|
572
|
+
function Yt(e) {
|
|
573
|
+
const r = C(0), t = C(0), a = C(!1);
|
|
574
|
+
return re(e, (n) => {
|
|
575
575
|
n && !a.value && (r.value = n.offsetWidth, t.value = n.scrollWidth, a.value = !0);
|
|
576
576
|
}), {
|
|
577
|
-
isTruncated:
|
|
577
|
+
isTruncated: w(() => r.value < t.value)
|
|
578
578
|
};
|
|
579
579
|
}
|
|
580
|
-
const
|
|
580
|
+
const le = {
|
|
581
581
|
useAxios: Te,
|
|
582
582
|
useDebouncedFilter: Pt,
|
|
583
583
|
useDeleteUrlBuilder: Rt,
|
|
584
|
-
useErrors:
|
|
584
|
+
useErrors: qt,
|
|
585
585
|
useExternalLinkCreator: Bt,
|
|
586
586
|
useFetcher: Vt,
|
|
587
587
|
useFetchUrlBuilder: Xe,
|
|
588
588
|
useHelpers: Qe,
|
|
589
|
-
useStringHelpers:
|
|
589
|
+
useStringHelpers: Ut,
|
|
590
590
|
useI18n: Ne,
|
|
591
591
|
useGatewayFeatureSupported: Jt,
|
|
592
|
-
useTruncationDetector:
|
|
593
|
-
},
|
|
592
|
+
useTruncationDetector: Yt
|
|
593
|
+
}, ce = (e, r) => {
|
|
594
594
|
const t = e.__vccOpts || e;
|
|
595
595
|
for (const [a, n] of r)
|
|
596
596
|
t[a] = n;
|
|
597
597
|
return t;
|
|
598
|
-
},
|
|
598
|
+
}, Zt = "#0044f4", Gt = "#3a3f51";
|
|
599
599
|
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
|
600
600
|
function rt(e) {
|
|
601
601
|
return typeof e > "u" || e === null;
|
|
@@ -644,7 +644,7 @@ pe.prototype.constructor = pe;
|
|
|
644
644
|
pe.prototype.toString = function(e) {
|
|
645
645
|
return this.name + ": " + at(this, e);
|
|
646
646
|
};
|
|
647
|
-
var
|
|
647
|
+
var oe = pe, cr = [
|
|
648
648
|
"kind",
|
|
649
649
|
"multi",
|
|
650
650
|
"resolve",
|
|
@@ -671,15 +671,15 @@ function dr(e) {
|
|
|
671
671
|
function pr(e, r) {
|
|
672
672
|
if (r = r || {}, Object.keys(r).forEach(function(t) {
|
|
673
673
|
if (cr.indexOf(t) === -1)
|
|
674
|
-
throw new
|
|
674
|
+
throw new oe('Unknown option "' + t + '" is met in definition of "' + e + '" YAML type.');
|
|
675
675
|
}), this.options = r, this.tag = e, this.kind = r.kind || null, this.resolve = r.resolve || function() {
|
|
676
676
|
return !0;
|
|
677
677
|
}, this.construct = r.construct || function(t) {
|
|
678
678
|
return t;
|
|
679
679
|
}, this.instanceOf = r.instanceOf || null, this.predicate = r.predicate || null, this.represent = r.represent || null, this.representName = r.representName || null, this.defaultStyle = r.defaultStyle || null, this.multi = r.multi || !1, this.styleAliases = dr(r.styleAliases || null), ur.indexOf(this.kind) === -1)
|
|
680
|
-
throw new
|
|
680
|
+
throw new oe('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
|
|
681
681
|
}
|
|
682
|
-
var
|
|
682
|
+
var H = pr;
|
|
683
683
|
function Be(e, r) {
|
|
684
684
|
var t = [];
|
|
685
685
|
return e[r].forEach(function(a) {
|
|
@@ -714,39 +714,39 @@ function _e(e) {
|
|
|
714
714
|
}
|
|
715
715
|
_e.prototype.extend = function(e) {
|
|
716
716
|
var r = [], t = [];
|
|
717
|
-
if (e instanceof
|
|
717
|
+
if (e instanceof H)
|
|
718
718
|
t.push(e);
|
|
719
719
|
else if (Array.isArray(e))
|
|
720
720
|
t = t.concat(e);
|
|
721
721
|
else if (e && (Array.isArray(e.implicit) || Array.isArray(e.explicit)))
|
|
722
722
|
e.implicit && (r = r.concat(e.implicit)), e.explicit && (t = t.concat(e.explicit));
|
|
723
723
|
else
|
|
724
|
-
throw new
|
|
724
|
+
throw new oe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
725
725
|
r.forEach(function(n) {
|
|
726
|
-
if (!(n instanceof
|
|
727
|
-
throw new
|
|
726
|
+
if (!(n instanceof H))
|
|
727
|
+
throw new oe("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
728
728
|
if (n.loadKind && n.loadKind !== "scalar")
|
|
729
|
-
throw new
|
|
729
|
+
throw new oe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
730
730
|
if (n.multi)
|
|
731
|
-
throw new
|
|
731
|
+
throw new oe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
732
732
|
}), t.forEach(function(n) {
|
|
733
|
-
if (!(n instanceof
|
|
734
|
-
throw new
|
|
733
|
+
if (!(n instanceof H))
|
|
734
|
+
throw new oe("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
735
735
|
});
|
|
736
736
|
var a = Object.create(_e.prototype);
|
|
737
737
|
return a.implicit = (this.implicit || []).concat(r), a.explicit = (this.explicit || []).concat(t), a.compiledImplicit = Be(a, "implicit"), a.compiledExplicit = Be(a, "explicit"), a.compiledTypeMap = fr(a.compiledImplicit, a.compiledExplicit), a;
|
|
738
738
|
};
|
|
739
|
-
var yr = _e, mr = new
|
|
739
|
+
var yr = _e, mr = new H("tag:yaml.org,2002:str", {
|
|
740
740
|
kind: "scalar",
|
|
741
741
|
construct: function(e) {
|
|
742
742
|
return e !== null ? e : "";
|
|
743
743
|
}
|
|
744
|
-
}), gr = new
|
|
744
|
+
}), gr = new H("tag:yaml.org,2002:seq", {
|
|
745
745
|
kind: "sequence",
|
|
746
746
|
construct: function(e) {
|
|
747
747
|
return e !== null ? e : [];
|
|
748
748
|
}
|
|
749
|
-
}), vr = new
|
|
749
|
+
}), vr = new H("tag:yaml.org,2002:map", {
|
|
750
750
|
kind: "mapping",
|
|
751
751
|
construct: function(e) {
|
|
752
752
|
return e !== null ? e : {};
|
|
@@ -770,7 +770,7 @@ function kr() {
|
|
|
770
770
|
function wr(e) {
|
|
771
771
|
return e === null;
|
|
772
772
|
}
|
|
773
|
-
var Sr = new
|
|
773
|
+
var Sr = new H("tag:yaml.org,2002:null", {
|
|
774
774
|
kind: "scalar",
|
|
775
775
|
resolve: br,
|
|
776
776
|
construct: kr,
|
|
@@ -806,7 +806,7 @@ function Ir(e) {
|
|
|
806
806
|
function Cr(e) {
|
|
807
807
|
return Object.prototype.toString.call(e) === "[object Boolean]";
|
|
808
808
|
}
|
|
809
|
-
var xr = new
|
|
809
|
+
var xr = new H("tag:yaml.org,2002:bool", {
|
|
810
810
|
kind: "scalar",
|
|
811
811
|
resolve: _r,
|
|
812
812
|
construct: Ir,
|
|
@@ -897,7 +897,7 @@ function $r(e) {
|
|
|
897
897
|
function Or(e) {
|
|
898
898
|
return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !Ee.isNegativeZero(e);
|
|
899
899
|
}
|
|
900
|
-
var
|
|
900
|
+
var Mr = new H("tag:yaml.org,2002:int", {
|
|
901
901
|
kind: "scalar",
|
|
902
902
|
resolve: Ar,
|
|
903
903
|
construct: $r,
|
|
@@ -928,12 +928,12 @@ var Kr = new z("tag:yaml.org,2002:int", {
|
|
|
928
928
|
// 2.5e4, 2.5 and integers
|
|
929
929
|
"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
|
930
930
|
);
|
|
931
|
-
function
|
|
931
|
+
function Kr(e) {
|
|
932
932
|
return !(e === null || !Fr.test(e) || // Quick hack to not allow integers end with `_`
|
|
933
933
|
// Probably should update regexp & check speed
|
|
934
934
|
e[e.length - 1] === "_");
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function jr(e) {
|
|
937
937
|
var r, t;
|
|
938
938
|
return r = e.replace(/_/g, "").toLowerCase(), t = r[0] === "-" ? -1 : 1, "+-".indexOf(r[0]) >= 0 && (r = r.slice(1)), r === ".inf" ? t === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : r === ".nan" ? NaN : t * parseFloat(r, 10);
|
|
939
939
|
}
|
|
@@ -971,24 +971,24 @@ function Rr(e, r) {
|
|
|
971
971
|
return "-0.0";
|
|
972
972
|
return t = e.toString(10), Pr.test(t) ? t.replace("e", ".e") : t;
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function qr(e) {
|
|
975
975
|
return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || Ee.isNegativeZero(e));
|
|
976
976
|
}
|
|
977
|
-
var Br = new
|
|
977
|
+
var Br = new H("tag:yaml.org,2002:float", {
|
|
978
978
|
kind: "scalar",
|
|
979
|
-
resolve:
|
|
980
|
-
construct:
|
|
981
|
-
predicate:
|
|
979
|
+
resolve: Kr,
|
|
980
|
+
construct: jr,
|
|
981
|
+
predicate: qr,
|
|
982
982
|
represent: Rr,
|
|
983
983
|
defaultStyle: "lowercase"
|
|
984
984
|
}), Vr = hr.extend({
|
|
985
985
|
implicit: [
|
|
986
986
|
Sr,
|
|
987
987
|
xr,
|
|
988
|
-
|
|
988
|
+
Mr,
|
|
989
989
|
Br
|
|
990
990
|
]
|
|
991
|
-
}),
|
|
991
|
+
}), Ur = Vr, nt = new RegExp(
|
|
992
992
|
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
993
993
|
), it = new RegExp(
|
|
994
994
|
"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
|
|
@@ -997,22 +997,22 @@ function Lr(e) {
|
|
|
997
997
|
return e === null ? !1 : nt.exec(e) !== null || it.exec(e) !== null;
|
|
998
998
|
}
|
|
999
999
|
function Dr(e) {
|
|
1000
|
-
var r, t, a, n, i, o, f,
|
|
1000
|
+
var r, t, a, n, i, o, f, p = 0, y = null, l, g, S;
|
|
1001
1001
|
if (r = nt.exec(e), r === null && (r = it.exec(e)), r === null)
|
|
1002
1002
|
throw new Error("Date resolve error");
|
|
1003
1003
|
if (t = +r[1], a = +r[2] - 1, n = +r[3], !r[4])
|
|
1004
1004
|
return new Date(Date.UTC(t, a, n));
|
|
1005
1005
|
if (i = +r[4], o = +r[5], f = +r[6], r[7]) {
|
|
1006
|
-
for (
|
|
1007
|
-
|
|
1008
|
-
|
|
1006
|
+
for (p = r[7].slice(0, 3); p.length < 3; )
|
|
1007
|
+
p += "0";
|
|
1008
|
+
p = +p;
|
|
1009
1009
|
}
|
|
1010
|
-
return r[9] && (l = +r[10], g = +(r[11] || 0), y = (l * 60 + g) * 6e4, r[9] === "-" && (y = -y)),
|
|
1010
|
+
return r[9] && (l = +r[10], g = +(r[11] || 0), y = (l * 60 + g) * 6e4, r[9] === "-" && (y = -y)), S = new Date(Date.UTC(t, a, n, i, o, f, p)), y && S.setTime(S.getTime() - y), S;
|
|
1011
1011
|
}
|
|
1012
1012
|
function Hr(e) {
|
|
1013
1013
|
return e.toISOString();
|
|
1014
1014
|
}
|
|
1015
|
-
var zr = new
|
|
1015
|
+
var zr = new H("tag:yaml.org,2002:timestamp", {
|
|
1016
1016
|
kind: "scalar",
|
|
1017
1017
|
resolve: Lr,
|
|
1018
1018
|
construct: Dr,
|
|
@@ -1022,12 +1022,12 @@ var zr = new z("tag:yaml.org,2002:timestamp", {
|
|
|
1022
1022
|
function Wr(e) {
|
|
1023
1023
|
return e === "<<" || e === null;
|
|
1024
1024
|
}
|
|
1025
|
-
var Jr = new
|
|
1025
|
+
var Jr = new H("tag:yaml.org,2002:merge", {
|
|
1026
1026
|
kind: "scalar",
|
|
1027
1027
|
resolve: Wr
|
|
1028
1028
|
}), Ae = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
1029
1029
|
\r`;
|
|
1030
|
-
function
|
|
1030
|
+
function Yr(e) {
|
|
1031
1031
|
if (e === null)
|
|
1032
1032
|
return !1;
|
|
1033
1033
|
var r, t, a = 0, n = e.length, i = Ae;
|
|
@@ -1039,7 +1039,7 @@ function Zr(e) {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
return a % 8 === 0;
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1042
|
+
function Zr(e) {
|
|
1043
1043
|
var r, t, a = e.replace(/[\r\n=]/g, ""), n = a.length, i = Ae, o = 0, f = [];
|
|
1044
1044
|
for (r = 0; r < n; r++)
|
|
1045
1045
|
r % 4 === 0 && r && (f.push(o >> 16 & 255), f.push(o >> 8 & 255), f.push(o & 255)), o = o << 6 | i.indexOf(a.charAt(r));
|
|
@@ -1054,10 +1054,10 @@ function Gr(e) {
|
|
|
1054
1054
|
function Qr(e) {
|
|
1055
1055
|
return Object.prototype.toString.call(e) === "[object Uint8Array]";
|
|
1056
1056
|
}
|
|
1057
|
-
var Xr = new
|
|
1057
|
+
var Xr = new H("tag:yaml.org,2002:binary", {
|
|
1058
1058
|
kind: "scalar",
|
|
1059
|
-
resolve:
|
|
1060
|
-
construct:
|
|
1059
|
+
resolve: Yr,
|
|
1060
|
+
construct: Zr,
|
|
1061
1061
|
predicate: Qr,
|
|
1062
1062
|
represent: Gr
|
|
1063
1063
|
}), ea = Object.prototype.hasOwnProperty, ta = Object.prototype.toString;
|
|
@@ -1086,7 +1086,7 @@ function ra(e) {
|
|
|
1086
1086
|
function aa(e) {
|
|
1087
1087
|
return e !== null ? e : [];
|
|
1088
1088
|
}
|
|
1089
|
-
var na = new
|
|
1089
|
+
var na = new H("tag:yaml.org,2002:omap", {
|
|
1090
1090
|
kind: "sequence",
|
|
1091
1091
|
resolve: ra,
|
|
1092
1092
|
construct: aa
|
|
@@ -1110,7 +1110,7 @@ function la(e) {
|
|
|
1110
1110
|
a = o[r], n = Object.keys(a), i[r] = [n[0], a[n[0]]];
|
|
1111
1111
|
return i;
|
|
1112
1112
|
}
|
|
1113
|
-
var sa = new
|
|
1113
|
+
var sa = new H("tag:yaml.org,2002:pairs", {
|
|
1114
1114
|
kind: "sequence",
|
|
1115
1115
|
resolve: oa,
|
|
1116
1116
|
construct: la
|
|
@@ -1127,12 +1127,12 @@ function ua(e) {
|
|
|
1127
1127
|
function da(e) {
|
|
1128
1128
|
return e !== null ? e : {};
|
|
1129
1129
|
}
|
|
1130
|
-
var pa = new
|
|
1130
|
+
var pa = new H("tag:yaml.org,2002:set", {
|
|
1131
1131
|
kind: "mapping",
|
|
1132
1132
|
resolve: ua,
|
|
1133
1133
|
construct: da
|
|
1134
1134
|
});
|
|
1135
|
-
|
|
1135
|
+
Ur.extend({
|
|
1136
1136
|
implicit: [
|
|
1137
1137
|
zr,
|
|
1138
1138
|
Jr
|
|
@@ -1149,12 +1149,12 @@ function Ve(e) {
|
|
|
1149
1149
|
` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "
" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
|
|
1150
1150
|
}
|
|
1151
1151
|
var fa = new Array(256), ya = new Array(256);
|
|
1152
|
-
for (var
|
|
1153
|
-
fa[
|
|
1152
|
+
for (var se = 0; se < 256; se++)
|
|
1153
|
+
fa[se] = Ve(se) ? 1 : 0, ya[se] = Ve(se);
|
|
1154
1154
|
const ma = ["onReset", "onSubmit"], ga = {
|
|
1155
1155
|
class: "form-actions",
|
|
1156
1156
|
"data-testid": "form-actions"
|
|
1157
|
-
}, va = /* @__PURE__ */
|
|
1157
|
+
}, va = /* @__PURE__ */ ee({
|
|
1158
1158
|
__name: "EntityBaseForm",
|
|
1159
1159
|
props: {
|
|
1160
1160
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -1204,87 +1204,87 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1204
1204
|
emits: ["loading", "fetch:success", "fetch:error", "submit", "cancel"],
|
|
1205
1205
|
setup(e, { emit: r }) {
|
|
1206
1206
|
var t;
|
|
1207
|
-
const a = e, n =
|
|
1207
|
+
const a = e, n = Ye(), { i18n: { t: i } } = le.useI18n(), { getMessageFromError: o } = le.useErrors(), { axiosInstance: f } = le.useAxios({
|
|
1208
1208
|
headers: (t = a.config) == null ? void 0 : t.requestHeaders
|
|
1209
|
-
}),
|
|
1209
|
+
}), p = C(!1), y = C(!1), l = C(""), g = w(() => a.canSubmit === !1 || a.isReadonly), S = w(() => {
|
|
1210
1210
|
var c, h;
|
|
1211
1211
|
if (!a.editId)
|
|
1212
1212
|
return "";
|
|
1213
|
-
let
|
|
1214
|
-
return a.config.app === "konnect" ?
|
|
1215
|
-
}),
|
|
1216
|
-
a.config.cancelRoute ? n.push(a.config.cancelRoute) :
|
|
1217
|
-
},
|
|
1213
|
+
let _ = `${a.config.apiBaseUrl}${a.fetchUrl}`;
|
|
1214
|
+
return a.config.app === "konnect" ? _ = _.replace(/{controlPlaneId}/gi, ((c = a.config) == null ? void 0 : c.controlPlaneId) || "") : a.config.app === "kongManager" && (_ = _.replace(/\/{workspace}/gi, (h = a.config) != null && h.workspace ? `/${a.config.workspace}` : "")), _ = _.replace(/{id}/gi, a.editId), _;
|
|
1215
|
+
}), x = () => {
|
|
1216
|
+
a.config.cancelRoute ? n.push(a.config.cancelRoute) : V();
|
|
1217
|
+
}, V = () => {
|
|
1218
1218
|
r("cancel");
|
|
1219
1219
|
}, v = () => {
|
|
1220
1220
|
g.value || r("submit");
|
|
1221
1221
|
};
|
|
1222
|
-
return
|
|
1222
|
+
return re(() => p.value, (c) => {
|
|
1223
1223
|
r("loading", c);
|
|
1224
1224
|
}, { immediate: !0 }), Ie(async () => {
|
|
1225
1225
|
if (a.editId)
|
|
1226
1226
|
try {
|
|
1227
|
-
y.value = !1,
|
|
1228
|
-
const { data: c } = await f.get(
|
|
1227
|
+
y.value = !1, p.value = !0;
|
|
1228
|
+
const { data: c } = await f.get(S.value);
|
|
1229
1229
|
r("fetch:success", c);
|
|
1230
1230
|
} catch (c) {
|
|
1231
1231
|
const h = o(c);
|
|
1232
1232
|
l.value = h.startsWith("code") ? i("baseForm.errors.edit") : h, y.value = !0, r("fetch:error", c);
|
|
1233
1233
|
} finally {
|
|
1234
|
-
|
|
1234
|
+
p.value = !1;
|
|
1235
1235
|
}
|
|
1236
1236
|
}), (c, h) => {
|
|
1237
|
-
const
|
|
1238
|
-
return
|
|
1239
|
-
body:
|
|
1240
|
-
|
|
1237
|
+
const _ = F("KSkeleton"), P = F("KEmptyState"), u = F("KAlert"), $ = F("KButton"), z = F("KCard");
|
|
1238
|
+
return b(), D(z, { class: "kong-ui-entity-base-form" }, {
|
|
1239
|
+
body: d(() => [
|
|
1240
|
+
p.value ? (b(), D(_, {
|
|
1241
1241
|
key: 0,
|
|
1242
1242
|
type: "form"
|
|
1243
|
-
})) : y.value ? (
|
|
1243
|
+
})) : y.value ? (b(), D(P, {
|
|
1244
1244
|
key: 1,
|
|
1245
1245
|
"cta-text": s(i)("baseForm.actions.back"),
|
|
1246
1246
|
"data-testid": "form-fetch-error",
|
|
1247
|
-
"handle-click":
|
|
1247
|
+
"handle-click": x,
|
|
1248
1248
|
"is-error": !0
|
|
1249
1249
|
}, {
|
|
1250
|
-
message:
|
|
1251
|
-
|
|
1250
|
+
message: d(() => [
|
|
1251
|
+
M("h3", null, O(l.value), 1)
|
|
1252
1252
|
]),
|
|
1253
1253
|
_: 1
|
|
1254
|
-
}, 8, ["cta-text"])) : (
|
|
1254
|
+
}, 8, ["cta-text"])) : (b(), q("form", {
|
|
1255
1255
|
key: 2,
|
|
1256
1256
|
"data-testid": "form-content",
|
|
1257
|
-
onReset: ve(
|
|
1257
|
+
onReset: ve(V, ["prevent"]),
|
|
1258
1258
|
onSubmit: ve(v, ["prevent"])
|
|
1259
1259
|
}, [
|
|
1260
|
-
|
|
1261
|
-
e.errorMessage ? (
|
|
1260
|
+
G(c.$slots, "default", {}, void 0, !0),
|
|
1261
|
+
e.errorMessage ? (b(), D(u, {
|
|
1262
1262
|
key: 0,
|
|
1263
1263
|
"alert-message": e.errorMessage,
|
|
1264
1264
|
appearance: "danger",
|
|
1265
1265
|
"data-testid": "form-error"
|
|
1266
|
-
}, null, 8, ["alert-message"])) :
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
I(
|
|
1266
|
+
}, null, 8, ["alert-message"])) : X("", !0),
|
|
1267
|
+
M("div", ga, [
|
|
1268
|
+
G(c.$slots, "form-actions", {}, () => [
|
|
1269
|
+
I($, {
|
|
1270
1270
|
appearance: "secondary",
|
|
1271
1271
|
"data-testid": "form-cancel",
|
|
1272
1272
|
disabled: e.isReadonly,
|
|
1273
1273
|
type: "reset"
|
|
1274
1274
|
}, {
|
|
1275
|
-
default:
|
|
1276
|
-
|
|
1275
|
+
default: d(() => [
|
|
1276
|
+
J(O(s(i)("baseForm.actions.cancel")), 1)
|
|
1277
1277
|
]),
|
|
1278
1278
|
_: 1
|
|
1279
1279
|
}, 8, ["disabled"]),
|
|
1280
|
-
I(
|
|
1280
|
+
I($, {
|
|
1281
1281
|
appearance: "primary",
|
|
1282
1282
|
"data-testid": "form-submit",
|
|
1283
1283
|
disabled: g.value,
|
|
1284
1284
|
type: "submit"
|
|
1285
1285
|
}, {
|
|
1286
|
-
default:
|
|
1287
|
-
|
|
1286
|
+
default: d(() => [
|
|
1287
|
+
J(O(s(i)("baseForm.actions.save")), 1)
|
|
1288
1288
|
]),
|
|
1289
1289
|
_: 1
|
|
1290
1290
|
}, 8, ["disabled"])
|
|
@@ -1296,10 +1296,10 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1296
1296
|
});
|
|
1297
1297
|
};
|
|
1298
1298
|
}
|
|
1299
|
-
}), ha = /* @__PURE__ */
|
|
1299
|
+
}), ha = /* @__PURE__ */ ce(va, [["__scopeId", "data-v-81612aef"]]), ba = {
|
|
1300
1300
|
key: 0,
|
|
1301
1301
|
"data-testid": "first-col"
|
|
1302
|
-
}, ka = /* @__PURE__ */
|
|
1302
|
+
}, ka = /* @__PURE__ */ ee({
|
|
1303
1303
|
__name: "EntityBaseTableCell",
|
|
1304
1304
|
props: {
|
|
1305
1305
|
keyName: {
|
|
@@ -1312,13 +1312,13 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
},
|
|
1314
1314
|
setup(e) {
|
|
1315
|
-
const r = e, t =
|
|
1315
|
+
const r = e, t = w(() => {
|
|
1316
1316
|
var v;
|
|
1317
1317
|
return ((v = r.rowEl) == null ? void 0 : v.querySelector(`[data-testid="${r.keyName}"]`)) || null;
|
|
1318
|
-
}), a =
|
|
1318
|
+
}), a = w(() => {
|
|
1319
1319
|
var v;
|
|
1320
1320
|
return ((v = t.value) == null ? void 0 : v.querySelector('[data-testid="first-col"]')) || null;
|
|
1321
|
-
}), n =
|
|
1321
|
+
}), n = w(() => {
|
|
1322
1322
|
var v, c;
|
|
1323
1323
|
const h = (v = r.rowEl) == null ? void 0 : v.querySelectorAll("td");
|
|
1324
1324
|
return h ? ((c = h[0]) == null ? void 0 : c.getAttribute("data-testid")) === r.keyName : !1;
|
|
@@ -1328,9 +1328,9 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1328
1328
|
i && (i.disconnect(), i = void 0);
|
|
1329
1329
|
}, f = () => {
|
|
1330
1330
|
var v, c, h;
|
|
1331
|
-
y.value = ((v = a.value) == null ? void 0 : v.getBoundingClientRect().width) || 0, l.value = ((c = t.value) == null ? void 0 : c.clientWidth) || 0, g.value = ((h =
|
|
1332
|
-
},
|
|
1333
|
-
|
|
1331
|
+
y.value = ((v = a.value) == null ? void 0 : v.getBoundingClientRect().width) || 0, l.value = ((c = t.value) == null ? void 0 : c.clientWidth) || 0, g.value = ((h = p.value) == null ? void 0 : h.innerText) || "";
|
|
1332
|
+
}, p = C({}), y = C(0), l = C(0), g = C(""), S = w(() => [a.value, t.value]), x = re(
|
|
1333
|
+
S,
|
|
1334
1334
|
(v) => {
|
|
1335
1335
|
if (n.value && (o(), "ResizeObserver" in window && window)) {
|
|
1336
1336
|
i = new ResizeObserver((c) => {
|
|
@@ -1343,37 +1343,37 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1343
1343
|
}
|
|
1344
1344
|
},
|
|
1345
1345
|
{ immediate: !0, flush: "post", deep: !0 }
|
|
1346
|
-
),
|
|
1346
|
+
), V = w(() => n.value ? y.value > l.value : !1);
|
|
1347
1347
|
return ct(() => {
|
|
1348
1348
|
f();
|
|
1349
1349
|
}), ut(() => {
|
|
1350
|
-
|
|
1350
|
+
x();
|
|
1351
1351
|
}), (v, c) => {
|
|
1352
1352
|
const h = F("KTooltip");
|
|
1353
|
-
return
|
|
1353
|
+
return b(), q("span", {
|
|
1354
1354
|
ref_key: "contentRef",
|
|
1355
|
-
ref:
|
|
1355
|
+
ref: p,
|
|
1356
1356
|
class: "content-wrapper"
|
|
1357
1357
|
}, [
|
|
1358
|
-
n.value ? (
|
|
1358
|
+
n.value ? (b(), q("span", ba, [
|
|
1359
1359
|
I(h, {
|
|
1360
|
-
label:
|
|
1360
|
+
label: V.value ? g.value : "",
|
|
1361
1361
|
"max-width": "300",
|
|
1362
1362
|
placement: "bottomStart"
|
|
1363
1363
|
}, {
|
|
1364
|
-
default:
|
|
1365
|
-
|
|
1364
|
+
default: d(() => [
|
|
1365
|
+
G(v.$slots, "default", {}, void 0, !0)
|
|
1366
1366
|
]),
|
|
1367
1367
|
_: 3
|
|
1368
1368
|
}, 8, ["label"])
|
|
1369
|
-
])) :
|
|
1369
|
+
])) : G(v.$slots, "default", { key: 1 }, void 0, !0)
|
|
1370
1370
|
], 512);
|
|
1371
1371
|
};
|
|
1372
1372
|
}
|
|
1373
|
-
}), wa = /* @__PURE__ */
|
|
1373
|
+
}), wa = /* @__PURE__ */ ce(ka, [["__scopeId", "data-v-e42a20c9"]]), Sa = { class: "toolbar-container" }, _a = {
|
|
1374
1374
|
key: 0,
|
|
1375
1375
|
class: "toolbar-button-container"
|
|
1376
|
-
}, Ia = ["data-testid"], Ca = /* @__PURE__ */
|
|
1376
|
+
}, Ia = ["data-testid"], Ca = /* @__PURE__ */ ee({
|
|
1377
1377
|
__name: "EntityBaseTable",
|
|
1378
1378
|
props: {
|
|
1379
1379
|
// table header configuration
|
|
@@ -1432,9 +1432,10 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1432
1432
|
},
|
|
1433
1433
|
// error message to show in the error state
|
|
1434
1434
|
// this prop being set (or empty) determines if the KTable is in an error state
|
|
1435
|
+
// please use `TableErrorMessage` since `string` is only for backwards compatibility
|
|
1435
1436
|
errorMessage: {
|
|
1436
|
-
type: String,
|
|
1437
|
-
default:
|
|
1437
|
+
type: [String, Object],
|
|
1438
|
+
default: null
|
|
1438
1439
|
},
|
|
1439
1440
|
disablePaginationPageJump: {
|
|
1440
1441
|
type: Boolean,
|
|
@@ -1482,65 +1483,76 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1482
1483
|
},
|
|
1483
1484
|
emits: ["click:row", "sort", "clear-search-input", "empty-state-cta-clicked"],
|
|
1484
1485
|
setup(e, { emit: r }) {
|
|
1485
|
-
const t = e, { i18n: { t: a } } =
|
|
1486
|
-
|
|
1487
|
-
return
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1486
|
+
const t = e, { i18n: { t: a } } = le.useI18n(), n = w(() => {
|
|
1487
|
+
var u, $;
|
|
1488
|
+
return typeof t.errorMessage == "string" ? {
|
|
1489
|
+
hasError: !!t.errorMessage,
|
|
1490
|
+
title: t.errorMessage,
|
|
1491
|
+
message: void 0
|
|
1492
|
+
} : {
|
|
1493
|
+
hasError: !!t.errorMessage,
|
|
1494
|
+
title: (u = t.errorMessage) == null ? void 0 : u.title,
|
|
1495
|
+
message: ($ = t.errorMessage) == null ? void 0 : $.message
|
|
1496
|
+
};
|
|
1497
|
+
}), i = w(() => t.cacheIdentifier || t.preferencesStorageKey), o = (u) => u.hasData || !!t.query, f = w(() => {
|
|
1498
|
+
const u = [];
|
|
1499
|
+
return Object.keys(t.tableHeaders).forEach(($) => {
|
|
1500
|
+
const z = t.tableHeaders[$];
|
|
1501
|
+
u.push({
|
|
1502
|
+
label: z.label ?? $,
|
|
1503
|
+
key: $,
|
|
1504
|
+
sortable: z.sortable ?? !1
|
|
1493
1505
|
});
|
|
1494
|
-
}), t.enableEntityActions &&
|
|
1506
|
+
}), t.enableEntityActions && u.push({
|
|
1495
1507
|
key: "actions",
|
|
1496
1508
|
hideLabel: !0
|
|
1497
|
-
}),
|
|
1498
|
-
}),
|
|
1499
|
-
"data-rowid":
|
|
1500
|
-
"data-testid":
|
|
1501
|
-
...t.rowAttributes(
|
|
1502
|
-
}),
|
|
1503
|
-
var
|
|
1504
|
-
return (
|
|
1505
|
-
},
|
|
1506
|
-
const
|
|
1507
|
-
"data-testid":
|
|
1508
|
-
...t.cellAttributes(
|
|
1509
|
+
}), u;
|
|
1510
|
+
}), p = (u) => ({
|
|
1511
|
+
"data-rowid": u.id,
|
|
1512
|
+
"data-testid": u.name,
|
|
1513
|
+
...t.rowAttributes(u)
|
|
1514
|
+
}), y = C({}), l = (u) => {
|
|
1515
|
+
var $;
|
|
1516
|
+
return ($ = y.value) == null ? void 0 : $.$el.querySelector(`[data-rowid="${u.id}"]`);
|
|
1517
|
+
}, g = (u) => {
|
|
1518
|
+
const $ = {
|
|
1519
|
+
"data-testid": u.headerKey,
|
|
1520
|
+
...t.cellAttributes(u)
|
|
1509
1521
|
};
|
|
1510
|
-
return
|
|
1522
|
+
return u.colIndex === 0 && ($.style = {
|
|
1511
1523
|
maxWidth: "250px",
|
|
1512
1524
|
overflowX: "hidden",
|
|
1513
1525
|
textOverflow: "ellipsis"
|
|
1514
|
-
}),
|
|
1515
|
-
},
|
|
1516
|
-
r("empty-state-cta-clicked"),
|
|
1517
|
-
},
|
|
1526
|
+
}), $;
|
|
1527
|
+
}, S = () => {
|
|
1528
|
+
r("empty-state-cta-clicked"), x();
|
|
1529
|
+
}, x = () => {
|
|
1518
1530
|
r("clear-search-input");
|
|
1519
|
-
},
|
|
1520
|
-
r("click:row",
|
|
1521
|
-
}),
|
|
1522
|
-
r("sort",
|
|
1523
|
-
}, { setTablePreferences:
|
|
1524
|
-
const
|
|
1531
|
+
}, V = w(() => t.disableRowClick ? void 0 : (u, $) => {
|
|
1532
|
+
r("click:row", $);
|
|
1533
|
+
}), v = (u) => {
|
|
1534
|
+
r("sort", u);
|
|
1535
|
+
}, { setTablePreferences: c, getTablePreferences: h } = xt(), _ = w(() => {
|
|
1536
|
+
const u = h(t.preferencesStorageKey);
|
|
1525
1537
|
return {
|
|
1526
1538
|
...t.initialFetcherParams,
|
|
1527
|
-
...
|
|
1539
|
+
...u
|
|
1528
1540
|
};
|
|
1529
|
-
}),
|
|
1530
|
-
t.preferencesStorageKey &&
|
|
1541
|
+
}), P = (u) => {
|
|
1542
|
+
t.preferencesStorageKey && c(t.preferencesStorageKey, u);
|
|
1531
1543
|
};
|
|
1532
|
-
return (
|
|
1533
|
-
const
|
|
1534
|
-
return
|
|
1544
|
+
return (u, $) => {
|
|
1545
|
+
const z = F("KIcon"), E = F("KButton"), R = F("KDropdown"), K = F("KTable"), W = F("KCard");
|
|
1546
|
+
return b(), D(W, {
|
|
1535
1547
|
class: "kong-ui-entity-base-table",
|
|
1536
1548
|
title: e.title
|
|
1537
1549
|
}, {
|
|
1538
|
-
body:
|
|
1539
|
-
I(
|
|
1550
|
+
body: d(() => [
|
|
1551
|
+
I(K, {
|
|
1540
1552
|
ref_key: "tableRefs",
|
|
1541
|
-
ref:
|
|
1542
|
-
"cache-identifier":
|
|
1543
|
-
"cell-attrs":
|
|
1553
|
+
ref: y,
|
|
1554
|
+
"cache-identifier": i.value,
|
|
1555
|
+
"cell-attrs": g,
|
|
1544
1556
|
"disable-pagination-page-jump": e.disablePaginationPageJump,
|
|
1545
1557
|
"disable-sorting": e.disableSorting,
|
|
1546
1558
|
"empty-state-action-button-icon": e.query ? "" : "plus",
|
|
@@ -1551,56 +1563,57 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1551
1563
|
"empty-state-message": e.query ? s(a)("baseTable.emptyState.noSearchResultsMessage") : e.emptyStateOptions.message,
|
|
1552
1564
|
"empty-state-title": e.query ? s(a)("baseTable.emptyState.noSearchResultsTitle") : e.emptyStateOptions.title,
|
|
1553
1565
|
"enable-client-sort": e.enableClientSort,
|
|
1554
|
-
"error-state-
|
|
1566
|
+
"error-state-message": n.value.message,
|
|
1567
|
+
"error-state-title": n.value.title,
|
|
1555
1568
|
fetcher: e.fetcher,
|
|
1556
1569
|
"fetcher-cache-key": String(e.fetcherCacheKey),
|
|
1557
|
-
"has-error":
|
|
1558
|
-
headers:
|
|
1570
|
+
"has-error": n.value.hasError,
|
|
1571
|
+
headers: f.value,
|
|
1559
1572
|
"hide-pagination-when-optional": "",
|
|
1560
|
-
"initial-fetcher-params":
|
|
1573
|
+
"initial-fetcher-params": _.value,
|
|
1561
1574
|
"is-loading": e.isLoading,
|
|
1562
1575
|
"pagination-type": e.paginationType,
|
|
1563
|
-
"row-attrs":
|
|
1576
|
+
"row-attrs": p,
|
|
1564
1577
|
"search-input": e.query,
|
|
1565
|
-
onKtableEmptyStateCtaClicked:
|
|
1566
|
-
"onRow:click":
|
|
1567
|
-
onSort:
|
|
1568
|
-
"onUpdate:tablePreferences":
|
|
1578
|
+
onKtableEmptyStateCtaClicked: S,
|
|
1579
|
+
"onRow:click": V.value,
|
|
1580
|
+
onSort: $[0] || ($[0] = (N) => v(N)),
|
|
1581
|
+
"onUpdate:tablePreferences": P
|
|
1569
1582
|
}, ze({
|
|
1570
|
-
toolbar:
|
|
1571
|
-
ye(
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
])) :
|
|
1583
|
+
toolbar: d(({ state: N }) => [
|
|
1584
|
+
ye(M("div", Sa, [
|
|
1585
|
+
G(u.$slots, "toolbar-filter", {}, void 0, !0),
|
|
1586
|
+
u.$slots["toolbar-button"] ? (b(), q("div", _a, [
|
|
1587
|
+
G(u.$slots, "toolbar-button", {}, void 0, !0)
|
|
1588
|
+
])) : X("", !0)
|
|
1576
1589
|
], 512), [
|
|
1577
|
-
[me,
|
|
1590
|
+
[me, o(N)]
|
|
1578
1591
|
])
|
|
1579
1592
|
]),
|
|
1580
|
-
actions:
|
|
1581
|
-
|
|
1593
|
+
actions: d(({ row: N, rowKey: L, rowValue: Z }) => [
|
|
1594
|
+
M("div", {
|
|
1582
1595
|
class: "actions-container",
|
|
1583
|
-
"data-testid":
|
|
1596
|
+
"data-testid": N.name
|
|
1584
1597
|
}, [
|
|
1585
|
-
I(
|
|
1598
|
+
I(R, {
|
|
1586
1599
|
"kpop-attributes": { placement: "bottomEnd" },
|
|
1587
1600
|
width: e.dropdownMenuWidth
|
|
1588
1601
|
}, {
|
|
1589
|
-
items:
|
|
1590
|
-
|
|
1591
|
-
row:
|
|
1592
|
-
rowKey:
|
|
1593
|
-
rowValue:
|
|
1602
|
+
items: d(() => [
|
|
1603
|
+
G(u.$slots, "actions", {
|
|
1604
|
+
row: N,
|
|
1605
|
+
rowKey: L,
|
|
1606
|
+
rowValue: Z
|
|
1594
1607
|
}, void 0, !0)
|
|
1595
1608
|
]),
|
|
1596
|
-
default:
|
|
1597
|
-
I(
|
|
1609
|
+
default: d(() => [
|
|
1610
|
+
I(E, {
|
|
1598
1611
|
class: "actions-trigger",
|
|
1599
1612
|
"data-testid": "overflow-actions-button",
|
|
1600
1613
|
size: "small"
|
|
1601
1614
|
}, {
|
|
1602
|
-
icon:
|
|
1603
|
-
I(
|
|
1615
|
+
icon: d(() => [
|
|
1616
|
+
I(z, {
|
|
1604
1617
|
color: s(Gt),
|
|
1605
1618
|
icon: "more",
|
|
1606
1619
|
size: "16"
|
|
@@ -1615,39 +1628,39 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1615
1628
|
]),
|
|
1616
1629
|
_: 2
|
|
1617
1630
|
}, [
|
|
1618
|
-
Ce(e.tableHeaders, (
|
|
1619
|
-
name:
|
|
1620
|
-
fn:
|
|
1631
|
+
Ce(e.tableHeaders, (N, L) => ({
|
|
1632
|
+
name: L,
|
|
1633
|
+
fn: d(({ row: Z, rowKey: ue, rowValue: te }) => [
|
|
1621
1634
|
I(wa, {
|
|
1622
|
-
"key-name": String(
|
|
1623
|
-
"row-el":
|
|
1635
|
+
"key-name": String(L),
|
|
1636
|
+
"row-el": l(Z)
|
|
1624
1637
|
}, {
|
|
1625
|
-
default:
|
|
1626
|
-
|
|
1627
|
-
row:
|
|
1628
|
-
rowKey:
|
|
1629
|
-
rowValue:
|
|
1638
|
+
default: d(() => [
|
|
1639
|
+
G(u.$slots, L, {
|
|
1640
|
+
row: Z,
|
|
1641
|
+
rowKey: ue,
|
|
1642
|
+
rowValue: te
|
|
1630
1643
|
}, () => [
|
|
1631
|
-
|
|
1644
|
+
J(O(te), 1)
|
|
1632
1645
|
], !0)
|
|
1633
1646
|
]),
|
|
1634
1647
|
_: 2
|
|
1635
1648
|
}, 1032, ["key-name", "row-el"])
|
|
1636
1649
|
])
|
|
1637
1650
|
}))
|
|
1638
|
-
]), 1032, ["cache-identifier", "disable-pagination-page-jump", "disable-sorting", "empty-state-action-button-icon", "empty-state-action-message", "empty-state-action-route", "empty-state-icon", "empty-state-message", "empty-state-title", "enable-client-sort", "error-state-title", "fetcher", "fetcher-cache-key", "has-error", "headers", "initial-fetcher-params", "is-loading", "pagination-type", "search-input", "onRow:click"])
|
|
1651
|
+
]), 1032, ["cache-identifier", "disable-pagination-page-jump", "disable-sorting", "empty-state-action-button-icon", "empty-state-action-message", "empty-state-action-route", "empty-state-icon", "empty-state-message", "empty-state-title", "enable-client-sort", "error-state-message", "error-state-title", "fetcher", "fetcher-cache-key", "has-error", "headers", "initial-fetcher-params", "is-loading", "pagination-type", "search-input", "onRow:click"])
|
|
1639
1652
|
]),
|
|
1640
1653
|
_: 3
|
|
1641
1654
|
}, 8, ["title"]);
|
|
1642
1655
|
};
|
|
1643
1656
|
}
|
|
1644
|
-
}), xa = /* @__PURE__ */
|
|
1657
|
+
}), xa = /* @__PURE__ */ ce(Ca, [["__scopeId", "data-v-499a771c"]]), Ta = {
|
|
1645
1658
|
key: 0,
|
|
1646
1659
|
class: "kong-ui-entity-delete-error"
|
|
1647
1660
|
}, Na = {
|
|
1648
1661
|
key: 1,
|
|
1649
1662
|
class: "description"
|
|
1650
|
-
}, Ea = /* @__PURE__ */
|
|
1663
|
+
}, Ea = /* @__PURE__ */ ee({
|
|
1651
1664
|
__name: "EntityDeleteModal",
|
|
1652
1665
|
props: {
|
|
1653
1666
|
visible: {
|
|
@@ -1686,14 +1699,14 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1686
1699
|
},
|
|
1687
1700
|
emits: ["cancel", "proceed"],
|
|
1688
1701
|
setup(e, { emit: r }) {
|
|
1689
|
-
const t = e, { i18nT: a } =
|
|
1702
|
+
const t = e, { i18nT: a } = le.useI18n(), n = w(() => t.needConfirm ? t.entityName : ""), i = () => {
|
|
1690
1703
|
r("cancel");
|
|
1691
1704
|
}, o = () => {
|
|
1692
1705
|
r("proceed");
|
|
1693
1706
|
};
|
|
1694
|
-
return (f,
|
|
1707
|
+
return (f, p) => {
|
|
1695
1708
|
const y = F("KAlert"), l = F("KPrompt");
|
|
1696
|
-
return
|
|
1709
|
+
return b(), D(l, {
|
|
1697
1710
|
"action-button-text": "Yes, delete",
|
|
1698
1711
|
"action-pending": e.actionPending,
|
|
1699
1712
|
class: "kong-ui-entity-delete-modal",
|
|
@@ -1704,44 +1717,44 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1704
1717
|
onCanceled: i,
|
|
1705
1718
|
onProceed: o
|
|
1706
1719
|
}, {
|
|
1707
|
-
"body-content":
|
|
1708
|
-
e.error ? (
|
|
1720
|
+
"body-content": d(() => [
|
|
1721
|
+
e.error ? (b(), q("div", Ta, [
|
|
1709
1722
|
I(y, { appearance: "danger" }, {
|
|
1710
|
-
alertMessage:
|
|
1711
|
-
|
|
1723
|
+
alertMessage: d(() => [
|
|
1724
|
+
J(O(e.error), 1)
|
|
1712
1725
|
]),
|
|
1713
1726
|
_: 1
|
|
1714
1727
|
})
|
|
1715
|
-
])) :
|
|
1728
|
+
])) : X("", !0),
|
|
1716
1729
|
I(s(a), {
|
|
1717
1730
|
class: "message",
|
|
1718
1731
|
keypath: t.entityName ? "deleteModal.messageWithName" : "deleteModal.message",
|
|
1719
1732
|
tag: "p"
|
|
1720
1733
|
}, ze({
|
|
1721
|
-
entityType:
|
|
1722
|
-
|
|
1734
|
+
entityType: d(() => [
|
|
1735
|
+
J(O(t.entityType), 1)
|
|
1723
1736
|
]),
|
|
1724
1737
|
_: 2
|
|
1725
1738
|
}, [
|
|
1726
1739
|
t.entityName ? {
|
|
1727
1740
|
name: "entityName",
|
|
1728
|
-
fn:
|
|
1729
|
-
|
|
1741
|
+
fn: d(() => [
|
|
1742
|
+
M("strong", null, O(t.entityName), 1)
|
|
1730
1743
|
]),
|
|
1731
1744
|
key: "0"
|
|
1732
1745
|
} : void 0
|
|
1733
1746
|
]), 1032, ["keypath"]),
|
|
1734
|
-
t.description || f.$slots.description ? (
|
|
1735
|
-
|
|
1736
|
-
|
|
1747
|
+
t.description || f.$slots.description ? (b(), q("div", Na, [
|
|
1748
|
+
G(f.$slots, "description", {}, () => [
|
|
1749
|
+
M("p", null, O(t.description), 1)
|
|
1737
1750
|
], !0)
|
|
1738
|
-
])) :
|
|
1751
|
+
])) : X("", !0)
|
|
1739
1752
|
]),
|
|
1740
1753
|
_: 3
|
|
1741
1754
|
}, 8, ["action-pending", "confirmation-text", "is-visible", "title"]);
|
|
1742
1755
|
};
|
|
1743
1756
|
}
|
|
1744
|
-
}), Aa = /* @__PURE__ */
|
|
1757
|
+
}), Aa = /* @__PURE__ */ ce(Ea, [["__scopeId", "data-v-1c9a2a07"]]), $a = {
|
|
1745
1758
|
fill: "none",
|
|
1746
1759
|
height: "20",
|
|
1747
1760
|
viewBox: "0 0 20 20",
|
|
@@ -1755,35 +1768,35 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1755
1768
|
width: "20",
|
|
1756
1769
|
x: "0",
|
|
1757
1770
|
y: "0"
|
|
1758
|
-
},
|
|
1771
|
+
}, Ma = ["fill"], Fa = { mask: "url(#mask0_180_20349)" }, Ka = ["fill"], Ue = /* @__PURE__ */ ee({
|
|
1759
1772
|
__name: "IconFilter",
|
|
1760
1773
|
props: {
|
|
1761
1774
|
color: {
|
|
1762
1775
|
type: String,
|
|
1763
|
-
default: `var(--kong-ui-entity-filter-color, ${
|
|
1776
|
+
default: `var(--kong-ui-entity-filter-color, ${Zt})`
|
|
1764
1777
|
}
|
|
1765
1778
|
},
|
|
1766
1779
|
setup(e) {
|
|
1767
|
-
return (r, t) => (
|
|
1768
|
-
|
|
1769
|
-
|
|
1780
|
+
return (r, t) => (b(), q("svg", $a, [
|
|
1781
|
+
M("mask", Oa, [
|
|
1782
|
+
M("rect", {
|
|
1770
1783
|
fill: e.color,
|
|
1771
1784
|
height: "20",
|
|
1772
1785
|
width: "20"
|
|
1773
|
-
}, null, 8,
|
|
1786
|
+
}, null, 8, Ma)
|
|
1774
1787
|
]),
|
|
1775
|
-
|
|
1776
|
-
|
|
1788
|
+
M("g", Fa, [
|
|
1789
|
+
M("path", {
|
|
1777
1790
|
d: "M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",
|
|
1778
1791
|
fill: e.color
|
|
1779
|
-
}, null, 8,
|
|
1792
|
+
}, null, 8, Ka)
|
|
1780
1793
|
])
|
|
1781
1794
|
]));
|
|
1782
1795
|
}
|
|
1783
|
-
}),
|
|
1796
|
+
}), ja = {
|
|
1784
1797
|
key: 1,
|
|
1785
1798
|
class: "kong-ui-entity-filter"
|
|
1786
|
-
}, Pa = { class: "menu-item-title" }, Ra = { class: "menu-item-indicator" },
|
|
1799
|
+
}, Pa = { class: "menu-item-title" }, Ra = { class: "menu-item-indicator" }, qa = { class: "menu-item-body" }, Ba = ["for"], Va = { class: "menu-item-buttons" }, Ua = { class: "filter-clear-button-container" }, La = /* @__PURE__ */ ee({
|
|
1787
1800
|
__name: "EntityFilter",
|
|
1788
1801
|
props: {
|
|
1789
1802
|
// filter config, either exact match or fuzzy match
|
|
@@ -1803,50 +1816,50 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1803
1816
|
},
|
|
1804
1817
|
emits: ["update:modelValue"],
|
|
1805
1818
|
setup(e, { emit: r }) {
|
|
1806
|
-
const t = e, { i18n: { t: a } } =
|
|
1819
|
+
const t = e, { i18n: { t: a } } = le.useI18n(), n = C(!1), i = C({}), o = w(() => {
|
|
1807
1820
|
const c = [];
|
|
1808
|
-
return new URLSearchParams(t.modelValue).forEach((h,
|
|
1809
|
-
h !== "" && c.push(
|
|
1821
|
+
return new URLSearchParams(t.modelValue).forEach((h, _) => {
|
|
1822
|
+
h !== "" && c.push(_);
|
|
1810
1823
|
}), c;
|
|
1811
|
-
}), f =
|
|
1824
|
+
}), f = w(() => {
|
|
1812
1825
|
const c = t.config.fields;
|
|
1813
1826
|
return Object.keys(c).filter((h) => c[h].searchable).map((h) => ({
|
|
1814
1827
|
label: c[h].label || h,
|
|
1815
1828
|
value: h
|
|
1816
1829
|
}));
|
|
1817
1830
|
});
|
|
1818
|
-
|
|
1819
|
-
i.value = {}, new URLSearchParams(c).forEach((h,
|
|
1820
|
-
i.value[
|
|
1831
|
+
re(() => t.modelValue, (c) => {
|
|
1832
|
+
i.value = {}, new URLSearchParams(c).forEach((h, _) => {
|
|
1833
|
+
i.value[_] = h;
|
|
1821
1834
|
});
|
|
1822
1835
|
});
|
|
1823
|
-
const
|
|
1836
|
+
const p = () => {
|
|
1824
1837
|
n.value = !n.value;
|
|
1825
1838
|
}, y = (c) => {
|
|
1826
1839
|
r("update:modelValue", c);
|
|
1827
1840
|
}, l = (c) => `filter-${c}`, g = (c) => {
|
|
1828
|
-
var h,
|
|
1829
|
-
return (((
|
|
1830
|
-
value:
|
|
1831
|
-
label:
|
|
1841
|
+
var h, _;
|
|
1842
|
+
return (((_ = (h = t.config.schema) == null ? void 0 : h[c]) == null ? void 0 : _.values) ?? []).map((P) => ({
|
|
1843
|
+
value: P,
|
|
1844
|
+
label: P
|
|
1832
1845
|
}));
|
|
1833
|
-
},
|
|
1834
|
-
var h,
|
|
1835
|
-
return ((
|
|
1836
|
-
},
|
|
1846
|
+
}, S = (c) => {
|
|
1847
|
+
var h, _;
|
|
1848
|
+
return ((_ = (h = t.config.schema) == null ? void 0 : h[c]) == null ? void 0 : _.type) ?? "text";
|
|
1849
|
+
}, x = (c) => {
|
|
1837
1850
|
i.value = {
|
|
1838
1851
|
...i.value,
|
|
1839
1852
|
[c]: ""
|
|
1840
1853
|
}, v();
|
|
1841
|
-
},
|
|
1854
|
+
}, V = () => {
|
|
1842
1855
|
i.value = {}, v(!0);
|
|
1843
1856
|
}, v = (c = !1) => {
|
|
1844
|
-
const h = Object.keys(i.value).reduce((
|
|
1857
|
+
const h = Object.keys(i.value).reduce((_, P) => (i.value[P] && (_[P] = `${i.value[P]}`), _), {});
|
|
1845
1858
|
c && (n.value = !1), r("update:modelValue", new URLSearchParams(h).toString());
|
|
1846
1859
|
};
|
|
1847
1860
|
return (c, h) => {
|
|
1848
|
-
const
|
|
1849
|
-
return e.config.isExactMatch ? (
|
|
1861
|
+
const _ = F("KInput"), P = F("KButton"), u = F("KSelect"), $ = F("KMenuItem"), z = F("KMenu");
|
|
1862
|
+
return e.config.isExactMatch ? (b(), D(_, {
|
|
1850
1863
|
key: 0,
|
|
1851
1864
|
autocomplete: "off",
|
|
1852
1865
|
class: "kong-ui-entity-filter-input",
|
|
@@ -1855,90 +1868,90 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1855
1868
|
placeholder: e.config.placeholder,
|
|
1856
1869
|
"onUpdate:modelValue": y
|
|
1857
1870
|
}, {
|
|
1858
|
-
before:
|
|
1859
|
-
I(
|
|
1871
|
+
before: d(() => [
|
|
1872
|
+
I(Ue)
|
|
1860
1873
|
]),
|
|
1861
1874
|
_: 1
|
|
1862
|
-
}, 8, ["model-value", "placeholder"])) : (
|
|
1863
|
-
I(
|
|
1875
|
+
}, 8, ["model-value", "placeholder"])) : (b(), q("div", ja, [
|
|
1876
|
+
I(P, {
|
|
1864
1877
|
appearance: "tertiary",
|
|
1865
1878
|
"data-testid": "filter-button",
|
|
1866
|
-
onClick:
|
|
1879
|
+
onClick: p
|
|
1867
1880
|
}, {
|
|
1868
|
-
default:
|
|
1869
|
-
I(
|
|
1870
|
-
|
|
1881
|
+
default: d(() => [
|
|
1882
|
+
I(Ue),
|
|
1883
|
+
J(" " + O(s(a)("filter.filterButtonText")) + " " + O(o.value.length > 0 ? `(${o.value.length})` : ""), 1)
|
|
1871
1884
|
]),
|
|
1872
1885
|
_: 1
|
|
1873
1886
|
}),
|
|
1874
|
-
ye(
|
|
1887
|
+
ye(M("div", {
|
|
1875
1888
|
class: "kong-ui-entity-filter-backdrop",
|
|
1876
|
-
onClick:
|
|
1889
|
+
onClick: p
|
|
1877
1890
|
}, null, 512), [
|
|
1878
1891
|
[me, n.value]
|
|
1879
1892
|
]),
|
|
1880
|
-
ye(I(
|
|
1881
|
-
body:
|
|
1882
|
-
(
|
|
1893
|
+
ye(I(z, { class: "kong-ui-entity-filter-menu" }, {
|
|
1894
|
+
body: d(() => [
|
|
1895
|
+
(b(!0), q(We, null, Ce(f.value, (E, R) => (b(), D($, {
|
|
1883
1896
|
key: E.value,
|
|
1884
1897
|
"data-testid": E.value,
|
|
1885
1898
|
expandable: "",
|
|
1886
|
-
"last-menu-item":
|
|
1899
|
+
"last-menu-item": R === f.value.length - 1
|
|
1887
1900
|
}, {
|
|
1888
|
-
itemTitle:
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
ye(
|
|
1901
|
+
itemTitle: d(() => [
|
|
1902
|
+
M("span", Pa, [
|
|
1903
|
+
J(O(E.label) + " ", 1),
|
|
1904
|
+
ye(M("span", Ra, null, 512), [
|
|
1892
1905
|
[me, o.value.includes(E.value)]
|
|
1893
1906
|
])
|
|
1894
1907
|
])
|
|
1895
1908
|
]),
|
|
1896
|
-
itemBody:
|
|
1897
|
-
var
|
|
1909
|
+
itemBody: d(() => {
|
|
1910
|
+
var K, W;
|
|
1898
1911
|
return [
|
|
1899
|
-
|
|
1900
|
-
|
|
1912
|
+
M("div", qa, [
|
|
1913
|
+
M("label", {
|
|
1901
1914
|
class: "menu-item-label",
|
|
1902
1915
|
for: l(E.value)
|
|
1903
1916
|
}, O(s(a)("filter.fieldLabel")), 9, Ba),
|
|
1904
|
-
((
|
|
1917
|
+
((W = (K = e.config.schema) == null ? void 0 : K[E.value]) == null ? void 0 : W.type) === "select" ? (b(), D(u, {
|
|
1905
1918
|
key: 0,
|
|
1906
1919
|
id: l(E.value),
|
|
1907
1920
|
modelValue: i.value[E.value],
|
|
1908
|
-
"onUpdate:modelValue": (
|
|
1921
|
+
"onUpdate:modelValue": (N) => i.value[E.value] = N,
|
|
1909
1922
|
appearance: "select",
|
|
1910
1923
|
items: g(E.value),
|
|
1911
1924
|
placeholder: s(a)("filter.selectPlaceholder")
|
|
1912
|
-
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "items", "placeholder"])) : (
|
|
1925
|
+
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "items", "placeholder"])) : (b(), D(_, {
|
|
1913
1926
|
key: 1,
|
|
1914
1927
|
id: l(E.value),
|
|
1915
1928
|
modelValue: i.value[E.value],
|
|
1916
|
-
"onUpdate:modelValue": (
|
|
1929
|
+
"onUpdate:modelValue": (N) => i.value[E.value] = N,
|
|
1917
1930
|
autocomplete: "off",
|
|
1918
1931
|
placeholder: s(a)("filter.inputPlaceholder"),
|
|
1919
|
-
type:
|
|
1932
|
+
type: S(E.value)
|
|
1920
1933
|
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "placeholder", "type"]))
|
|
1921
1934
|
]),
|
|
1922
|
-
|
|
1923
|
-
I(
|
|
1935
|
+
M("div", Va, [
|
|
1936
|
+
I(P, {
|
|
1924
1937
|
appearance: "tertiary",
|
|
1925
1938
|
"data-testid": "apply-filter",
|
|
1926
1939
|
size: "small",
|
|
1927
|
-
onClick: h[0] || (h[0] = (
|
|
1940
|
+
onClick: h[0] || (h[0] = (N) => v(!0))
|
|
1928
1941
|
}, {
|
|
1929
|
-
default:
|
|
1930
|
-
|
|
1942
|
+
default: d(() => [
|
|
1943
|
+
J(O(s(a)("filter.applyButtonText")), 1)
|
|
1931
1944
|
]),
|
|
1932
1945
|
_: 1
|
|
1933
1946
|
}),
|
|
1934
|
-
I(
|
|
1947
|
+
I(P, {
|
|
1935
1948
|
appearance: "tertiary",
|
|
1936
1949
|
"data-testid": "clear-filter",
|
|
1937
1950
|
size: "small",
|
|
1938
|
-
onClick: (
|
|
1951
|
+
onClick: (N) => x(E.value)
|
|
1939
1952
|
}, {
|
|
1940
|
-
default:
|
|
1941
|
-
|
|
1953
|
+
default: d(() => [
|
|
1954
|
+
J(O(s(a)("filter.clearButtonText")), 1)
|
|
1942
1955
|
]),
|
|
1943
1956
|
_: 2
|
|
1944
1957
|
}, 1032, ["onClick"])
|
|
@@ -1948,14 +1961,14 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1948
1961
|
_: 2
|
|
1949
1962
|
}, 1032, ["data-testid", "last-menu-item"]))), 128))
|
|
1950
1963
|
]),
|
|
1951
|
-
actionButton:
|
|
1952
|
-
|
|
1953
|
-
I(
|
|
1964
|
+
actionButton: d(() => [
|
|
1965
|
+
M("div", Ua, [
|
|
1966
|
+
I(P, {
|
|
1954
1967
|
size: "small",
|
|
1955
|
-
onClick:
|
|
1968
|
+
onClick: V
|
|
1956
1969
|
}, {
|
|
1957
|
-
default:
|
|
1958
|
-
|
|
1970
|
+
default: d(() => [
|
|
1971
|
+
J(O(s(a)("filter.clearAllButtonText")), 1)
|
|
1959
1972
|
]),
|
|
1960
1973
|
_: 1
|
|
1961
1974
|
})
|
|
@@ -1968,7 +1981,7 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1968
1981
|
]));
|
|
1969
1982
|
};
|
|
1970
1983
|
}
|
|
1971
|
-
}), Da = /* @__PURE__ */
|
|
1984
|
+
}), Da = /* @__PURE__ */ ce(La, [["__scopeId", "data-v-4ea260f0"]]), we = /* @__PURE__ */ ee({
|
|
1972
1985
|
__name: "PermissionsWrapper",
|
|
1973
1986
|
props: {
|
|
1974
1987
|
/**
|
|
@@ -1990,13 +2003,13 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
1990
2003
|
}
|
|
1991
2004
|
},
|
|
1992
2005
|
setup(e) {
|
|
1993
|
-
const r = e, t =
|
|
1994
|
-
return
|
|
2006
|
+
const r = e, t = C(void 0), a = w(() => t.value === !0 || t.value !== void 0 && r.forceShow === !0);
|
|
2007
|
+
return re(() => r.authFunction, async () => {
|
|
1995
2008
|
t.value = await r.authFunction();
|
|
1996
|
-
}, { immediate: !0 }), (n, i) => a.value ?
|
|
2009
|
+
}, { immediate: !0 }), (n, i) => a.value ? G(n.$slots, "default", {
|
|
1997
2010
|
key: 0,
|
|
1998
2011
|
isAllowed: t.value
|
|
1999
|
-
}) :
|
|
2012
|
+
}) : X("", !0);
|
|
2000
2013
|
}
|
|
2001
2014
|
}), Ha = { class: "form-section-wrapper" }, za = {
|
|
2002
2015
|
key: 0,
|
|
@@ -2007,7 +2020,7 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
2007
2020
|
}, Ja = {
|
|
2008
2021
|
key: 2,
|
|
2009
2022
|
class: "form-section-footer"
|
|
2010
|
-
},
|
|
2023
|
+
}, Ya = { class: "form-section-content" }, Za = /* @__PURE__ */ ee({
|
|
2011
2024
|
__name: "EntityFormSection",
|
|
2012
2025
|
props: {
|
|
2013
2026
|
title: {
|
|
@@ -2033,31 +2046,31 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
2033
2046
|
},
|
|
2034
2047
|
setup(e) {
|
|
2035
2048
|
const r = st();
|
|
2036
|
-
return (t, a) => (
|
|
2049
|
+
return (t, a) => (b(), q("fieldset", {
|
|
2037
2050
|
class: he(["kong-ui-entity-form-section", { "has-divider": e.hasDivider }])
|
|
2038
2051
|
}, [
|
|
2039
|
-
|
|
2040
|
-
e.hideInfoHeader ?
|
|
2052
|
+
M("div", Ha, [
|
|
2053
|
+
e.hideInfoHeader ? X("", !0) : (b(), q("div", {
|
|
2041
2054
|
key: 0,
|
|
2042
2055
|
class: he(["form-section-info", { sticky: e.stickyInfoHeader }])
|
|
2043
2056
|
}, [
|
|
2044
|
-
e.title ? (
|
|
2045
|
-
e.description || s(r).description ? (
|
|
2046
|
-
|
|
2047
|
-
|
|
2057
|
+
e.title ? (b(), q("h4", za, O(e.title), 1)) : X("", !0),
|
|
2058
|
+
e.description || s(r).description ? (b(), q("div", Wa, [
|
|
2059
|
+
G(t.$slots, "description", {}, () => [
|
|
2060
|
+
M("p", null, O(e.description), 1)
|
|
2048
2061
|
], !0)
|
|
2049
|
-
])) :
|
|
2050
|
-
s(r).footer ? (
|
|
2051
|
-
|
|
2052
|
-
])) :
|
|
2062
|
+
])) : X("", !0),
|
|
2063
|
+
s(r).footer ? (b(), q("div", Ja, [
|
|
2064
|
+
G(t.$slots, "footer", {}, void 0, !0)
|
|
2065
|
+
])) : X("", !0)
|
|
2053
2066
|
], 2)),
|
|
2054
|
-
|
|
2055
|
-
|
|
2067
|
+
M("div", Ya, [
|
|
2068
|
+
G(t.$slots, "default", {}, void 0, !0)
|
|
2056
2069
|
])
|
|
2057
2070
|
])
|
|
2058
2071
|
], 2));
|
|
2059
2072
|
}
|
|
2060
|
-
}), Le = /* @__PURE__ */
|
|
2073
|
+
}), Le = /* @__PURE__ */ ce(Za, [["__scopeId", "data-v-8b6dc312"]]), { useAxios: ot, useDeleteUrlBuilder: Ga, useErrors: Qa, useExternalLinkCreator: On, useFetchUrlBuilder: Mn, useFetcher: Xa, useDebouncedFilter: en, useStringHelpers: Fn, useHelpers: Kn, useGatewayFeatureSupported: jn, useTruncationDetector: Pn } = le, tn = {
|
|
2061
2074
|
fail: "Failed to copy id to clipboard",
|
|
2062
2075
|
success: {
|
|
2063
2076
|
prefix: "Successfully",
|
|
@@ -2074,10 +2087,10 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
2074
2087
|
}, ln = (e) => (ft("data-v-9971cc79"), e = e(), yt(), e), sn = ["aria-hidden"], cn = {
|
|
2075
2088
|
key: 0,
|
|
2076
2089
|
"data-testid": "kui-icon-svg-title"
|
|
2077
|
-
}, un = /* @__PURE__ */ ln(() => /* @__PURE__ */
|
|
2090
|
+
}, un = /* @__PURE__ */ ln(() => /* @__PURE__ */ M("path", {
|
|
2078
2091
|
d: "M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",
|
|
2079
2092
|
fill: "currentColor"
|
|
2080
|
-
}, null, -1)), dn = /* @__PURE__ */
|
|
2093
|
+
}, null, -1)), dn = /* @__PURE__ */ ee({
|
|
2081
2094
|
__name: "CopyIcon",
|
|
2082
2095
|
props: {
|
|
2083
2096
|
/** The accessibility text provided to screen readers */
|
|
@@ -2129,7 +2142,7 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
2129
2142
|
}
|
|
2130
2143
|
},
|
|
2131
2144
|
setup(e) {
|
|
2132
|
-
const r = e, t =
|
|
2145
|
+
const r = e, t = w(() => {
|
|
2133
2146
|
if (typeof r.size == "number" && r.size > 0)
|
|
2134
2147
|
return `${r.size}px`;
|
|
2135
2148
|
if (typeof r.size == "string") {
|
|
@@ -2138,7 +2151,7 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
2138
2151
|
return `${i}px`;
|
|
2139
2152
|
}
|
|
2140
2153
|
return De;
|
|
2141
|
-
}), a =
|
|
2154
|
+
}), a = w(() => ({
|
|
2142
2155
|
boxSizing: "border-box",
|
|
2143
2156
|
color: r.color,
|
|
2144
2157
|
display: r.display,
|
|
@@ -2146,14 +2159,14 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
2146
2159
|
lineHeight: "0",
|
|
2147
2160
|
width: t.value
|
|
2148
2161
|
}));
|
|
2149
|
-
return (n, i) => (
|
|
2162
|
+
return (n, i) => (b(), D(Se(e.as), {
|
|
2150
2163
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
2151
2164
|
class: "kui-icon copy-icon",
|
|
2152
2165
|
"data-testid": "kui-icon-wrapper-copy-icon",
|
|
2153
2166
|
style: pt(a.value)
|
|
2154
2167
|
}, {
|
|
2155
|
-
default:
|
|
2156
|
-
(
|
|
2168
|
+
default: d(() => [
|
|
2169
|
+
(b(), q("svg", {
|
|
2157
2170
|
"aria-hidden": e.decorative ? "true" : void 0,
|
|
2158
2171
|
"data-testid": "kui-icon-svg-copy-icon",
|
|
2159
2172
|
fill: "none",
|
|
@@ -2163,14 +2176,14 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
2163
2176
|
width: "100%",
|
|
2164
2177
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2165
2178
|
}, [
|
|
2166
|
-
e.title ? (
|
|
2179
|
+
e.title ? (b(), q("title", cn, O(e.title), 1)) : X("", !0),
|
|
2167
2180
|
un
|
|
2168
2181
|
], 8, sn))
|
|
2169
2182
|
]),
|
|
2170
2183
|
_: 1
|
|
2171
2184
|
}, 8, ["aria-hidden", "style"]));
|
|
2172
2185
|
}
|
|
2173
|
-
}), pn = /* @__PURE__ */ on(dn, [["__scopeId", "data-v-9971cc79"]]), fn = "16px", yn = { class: "kong-ui-copy-uuid" }, mn = ["onClick"], He = 15, gn = /* @__PURE__ */
|
|
2186
|
+
}), pn = /* @__PURE__ */ on(dn, [["__scopeId", "data-v-9971cc79"]]), fn = "16px", yn = { class: "kong-ui-copy-uuid" }, mn = ["onClick"], He = 15, gn = /* @__PURE__ */ ee({
|
|
2174
2187
|
__name: "CopyUuid",
|
|
2175
2188
|
props: {
|
|
2176
2189
|
uuid: {
|
|
@@ -2215,45 +2228,45 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
2215
2228
|
emits: ["success", "error"],
|
|
2216
2229
|
setup(e, { emit: r }) {
|
|
2217
2230
|
const t = e, { t: a } = xe("en-us", an), n = t.notify || dt(nn, () => {
|
|
2218
|
-
}), i =
|
|
2231
|
+
}), i = w(() => t.idTooltip ? {
|
|
2219
2232
|
label: t.idTooltip,
|
|
2220
2233
|
positionFixed: !0,
|
|
2221
2234
|
placement: "bottomStart"
|
|
2222
2235
|
} : {
|
|
2223
2236
|
title: t.uuid
|
|
2224
|
-
}), o =
|
|
2237
|
+
}), o = w(() => !!(t.tooltip && t.successTooltip)), f = C(t.tooltip), p = w(() => t.tooltip ? {
|
|
2225
2238
|
label: f.value,
|
|
2226
2239
|
positionFixed: !0,
|
|
2227
2240
|
maxWidth: "500px",
|
|
2228
2241
|
placement: "bottomStart"
|
|
2229
|
-
} : {}), y =
|
|
2230
|
-
var
|
|
2231
|
-
return t.format === "redacted" ? "*****" : t.format === "deleted" ? `*${(
|
|
2232
|
-
}), l = (
|
|
2233
|
-
f.value =
|
|
2242
|
+
} : {}), y = w(() => {
|
|
2243
|
+
var S;
|
|
2244
|
+
return t.format === "redacted" ? "*****" : t.format === "deleted" ? `*${(S = t.uuid) == null ? void 0 : S.substring(0, 5)}` : t.uuid;
|
|
2245
|
+
}), l = (S) => {
|
|
2246
|
+
f.value = S, setTimeout(() => {
|
|
2234
2247
|
f.value = t.tooltip;
|
|
2235
2248
|
}, 1800);
|
|
2236
|
-
}, g = (
|
|
2237
|
-
var
|
|
2238
|
-
if (!
|
|
2249
|
+
}, g = (S) => {
|
|
2250
|
+
var x, V;
|
|
2251
|
+
if (!S(t.uuid)) {
|
|
2239
2252
|
typeof n == "function" && n({
|
|
2240
2253
|
type: "error",
|
|
2241
2254
|
message: a("message.fail")
|
|
2242
2255
|
}), o.value ? l(a("message.fail")) : r("error", t.uuid);
|
|
2243
2256
|
return;
|
|
2244
2257
|
}
|
|
2245
|
-
const v = ((
|
|
2258
|
+
const v = ((x = t.uuid) == null ? void 0 : x.length) > He, c = t.format === "hidden" || t.format === "redacted" ? a("message.success.prefix") : `"${((V = t.uuid) == null ? void 0 : V.substring(0, He)) + (v ? "..." : "")}"`;
|
|
2246
2259
|
typeof n == "function" && n({
|
|
2247
2260
|
type: "success",
|
|
2248
2261
|
message: `${c}${a("message.success.content")}`
|
|
2249
2262
|
}), o.value ? l(t.successTooltip) : r("success", t.uuid);
|
|
2250
2263
|
};
|
|
2251
|
-
return (
|
|
2252
|
-
const
|
|
2253
|
-
return
|
|
2254
|
-
e.format !== "hidden" ? (
|
|
2255
|
-
default:
|
|
2256
|
-
|
|
2264
|
+
return (S, x) => {
|
|
2265
|
+
const V = F("KClipboardProvider");
|
|
2266
|
+
return b(), q("div", yn, [
|
|
2267
|
+
e.format !== "hidden" ? (b(), D(Se(e.idTooltip ? "KTooltip" : "div"), Oe({ key: 0 }, i.value, { "data-testid": "copy-id" }), {
|
|
2268
|
+
default: d(() => [
|
|
2269
|
+
M("div", {
|
|
2257
2270
|
class: he([
|
|
2258
2271
|
"uuid-container",
|
|
2259
2272
|
e.truncated ? "truncated-uuid" : null,
|
|
@@ -2262,12 +2275,12 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
2262
2275
|
}, O(y.value), 3)
|
|
2263
2276
|
]),
|
|
2264
2277
|
_: 1
|
|
2265
|
-
}, 16)) :
|
|
2266
|
-
(
|
|
2267
|
-
default:
|
|
2268
|
-
I(
|
|
2269
|
-
default:
|
|
2270
|
-
|
|
2278
|
+
}, 16)) : X("", !0),
|
|
2279
|
+
(b(), D(Se(e.tooltip ? "KTooltip" : "div"), Oe(p.value, { class: "uuid-icon-wrapper" }), {
|
|
2280
|
+
default: d(() => [
|
|
2281
|
+
I(V, null, {
|
|
2282
|
+
default: d(({ copyToClipboard: v }) => [
|
|
2283
|
+
M("span", {
|
|
2271
2284
|
"data-testid": "copy-to-clipboard",
|
|
2272
2285
|
role: "button",
|
|
2273
2286
|
tabindex: "0",
|
|
@@ -2296,7 +2309,7 @@ const ma = ["onReset", "onSubmit"], ga = {
|
|
|
2296
2309
|
t[a] = n;
|
|
2297
2310
|
return t;
|
|
2298
2311
|
}, hn = /* @__PURE__ */ vn(gn, [["__scopeId", "data-v-0c07874b"]]);
|
|
2299
|
-
const bn = { class: "kong-ui-entities-snis-list" }, kn = { key: 1 }, wn = { key: 1 }, Sn = /* @__PURE__ */
|
|
2312
|
+
const bn = { class: "kong-ui-entities-snis-list" }, kn = { key: 1 }, wn = { key: 1 }, Sn = /* @__PURE__ */ ee({
|
|
2300
2313
|
__name: "SniList",
|
|
2301
2314
|
props: {
|
|
2302
2315
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -2337,151 +2350,154 @@ const bn = { class: "kong-ui-entities-snis-list" }, kn = { key: 1 }, wn = { key:
|
|
|
2337
2350
|
},
|
|
2338
2351
|
emits: ["error", "copy:success", "copy:error", "delete:success"],
|
|
2339
2352
|
setup(e, { emit: r }) {
|
|
2340
|
-
var
|
|
2341
|
-
const t = e, { i18n: { t: a } } =
|
|
2342
|
-
var
|
|
2343
|
-
|
|
2344
|
-
entity:
|
|
2353
|
+
var te;
|
|
2354
|
+
const t = e, { i18n: { t: a } } = Ze.useI18n(), n = (k, j) => {
|
|
2355
|
+
var B;
|
|
2356
|
+
k.type === "error" ? r("copy:error", {
|
|
2357
|
+
entity: j,
|
|
2345
2358
|
field: "certificate.id",
|
|
2346
2359
|
message: a("errors.copy")
|
|
2347
2360
|
}) : r("copy:success", {
|
|
2348
|
-
entity:
|
|
2361
|
+
entity: j,
|
|
2349
2362
|
field: "certificate.id",
|
|
2350
|
-
message: a("copy.success", { val: (
|
|
2363
|
+
message: a("copy.success", { val: (B = j.certificate) == null ? void 0 : B.id })
|
|
2351
2364
|
});
|
|
2352
2365
|
}, { axiosInstance: i } = ot({
|
|
2353
|
-
headers: (
|
|
2354
|
-
}), o =
|
|
2366
|
+
headers: (te = t.config) == null ? void 0 : te.requestHeaders
|
|
2367
|
+
}), o = C(1), f = w(() => t.config.app !== "kongManager" || !!t.config.disableSorting), p = {
|
|
2355
2368
|
name: { label: a("snis.list.table_headers.name"), searchable: !0, sortable: !0 },
|
|
2356
2369
|
certificate: { label: a("snis.list.table_headers.certificate_id"), sortable: !1 },
|
|
2357
2370
|
tags: { label: a("snis.list.table_headers.tags"), sortable: !1 }
|
|
2358
|
-
}, y =
|
|
2371
|
+
}, y = p, l = (k) => ({
|
|
2359
2372
|
style: {
|
|
2360
|
-
maxWidth:
|
|
2373
|
+
maxWidth: k.headerKey === "name" ? "250px" : k.headerKey === "certificate" ? "350px" : null
|
|
2361
2374
|
}
|
|
2362
|
-
}), g =
|
|
2363
|
-
var
|
|
2364
|
-
let
|
|
2365
|
-
return t.config.app === "konnect" ?
|
|
2366
|
-
}),
|
|
2367
|
-
const
|
|
2368
|
-
if (
|
|
2375
|
+
}), g = w(() => {
|
|
2376
|
+
var j, B;
|
|
2377
|
+
let k = `${t.config.apiBaseUrl}${de.list[t.config.app].all}`;
|
|
2378
|
+
return t.config.app === "konnect" ? k = k.replace(/{controlPlaneId}/gi, ((j = t.config) == null ? void 0 : j.controlPlaneId) || "") : t.config.app === "kongManager" && (k = k.replace(/\/{workspace}/gi, (B = t.config) != null && B.workspace ? `/${t.config.workspace}` : "")), k;
|
|
2379
|
+
}), S = C(""), x = w(() => {
|
|
2380
|
+
const k = t.config.app === "konnect" || t.config.isExactMatch;
|
|
2381
|
+
if (k)
|
|
2369
2382
|
return {
|
|
2370
|
-
isExactMatch:
|
|
2383
|
+
isExactMatch: k,
|
|
2371
2384
|
placeholder: a("search.placeholder")
|
|
2372
2385
|
};
|
|
2373
|
-
const { name:
|
|
2386
|
+
const { name: j } = p;
|
|
2374
2387
|
return {
|
|
2375
|
-
isExactMatch:
|
|
2376
|
-
fields: { name:
|
|
2388
|
+
isExactMatch: k,
|
|
2389
|
+
fields: { name: j },
|
|
2377
2390
|
schema: t.config.filterSchema
|
|
2378
2391
|
};
|
|
2379
|
-
}), { fetcher:
|
|
2380
|
-
|
|
2392
|
+
}), { fetcher: V, fetcherState: v } = Xa(t.config, g.value), c = () => {
|
|
2393
|
+
S.value = "";
|
|
2381
2394
|
}, h = () => {
|
|
2382
2395
|
o.value++;
|
|
2383
|
-
},
|
|
2396
|
+
}, _ = C(null), P = C({
|
|
2384
2397
|
ctaPath: t.config.createRoute,
|
|
2385
2398
|
ctaText: void 0,
|
|
2386
2399
|
message: a("snis.list.empty_state.description"),
|
|
2387
2400
|
title: a("snis.title")
|
|
2388
|
-
}),
|
|
2389
|
-
const
|
|
2390
|
-
if (!
|
|
2401
|
+
}), u = (k, j) => {
|
|
2402
|
+
const B = k.id;
|
|
2403
|
+
if (!j(B)) {
|
|
2391
2404
|
r("copy:error", {
|
|
2392
|
-
entity:
|
|
2405
|
+
entity: k,
|
|
2393
2406
|
field: "id",
|
|
2394
2407
|
message: a("errors.copy")
|
|
2395
2408
|
});
|
|
2396
2409
|
return;
|
|
2397
2410
|
}
|
|
2398
2411
|
r("copy:success", {
|
|
2399
|
-
entity:
|
|
2412
|
+
entity: k,
|
|
2400
2413
|
field: "id",
|
|
2401
|
-
message: a("copy.success", { val:
|
|
2414
|
+
message: a("copy.success", { val: B })
|
|
2402
2415
|
});
|
|
2403
|
-
},
|
|
2404
|
-
const
|
|
2405
|
-
if (!
|
|
2416
|
+
}, $ = (k, j) => {
|
|
2417
|
+
const B = JSON.stringify(k);
|
|
2418
|
+
if (!j(B)) {
|
|
2406
2419
|
r("copy:error", {
|
|
2407
|
-
entity:
|
|
2420
|
+
entity: k,
|
|
2408
2421
|
message: a("errors.copy")
|
|
2409
2422
|
});
|
|
2410
2423
|
return;
|
|
2411
2424
|
}
|
|
2412
2425
|
r("copy:success", {
|
|
2413
|
-
entity:
|
|
2426
|
+
entity: k,
|
|
2414
2427
|
message: a("copy.success_brief")
|
|
2415
2428
|
});
|
|
2416
|
-
},
|
|
2429
|
+
}, z = (k) => ({
|
|
2417
2430
|
label: a("actions.edit"),
|
|
2418
|
-
to: t.config.getEditRoute(
|
|
2419
|
-
}), E =
|
|
2420
|
-
E.value =
|
|
2421
|
-
},
|
|
2422
|
-
|
|
2423
|
-
},
|
|
2424
|
-
var
|
|
2425
|
-
if ((
|
|
2426
|
-
|
|
2431
|
+
to: t.config.getEditRoute(k)
|
|
2432
|
+
}), E = C(void 0), R = C(!1), K = C(!1), W = C(""), N = Ga(t.config, g.value), L = (k) => {
|
|
2433
|
+
E.value = k, R.value = !0;
|
|
2434
|
+
}, Z = () => {
|
|
2435
|
+
R.value = !1, E.value = void 0;
|
|
2436
|
+
}, ue = async () => {
|
|
2437
|
+
var k, j, B;
|
|
2438
|
+
if ((k = E.value) != null && k.id) {
|
|
2439
|
+
K.value = !0;
|
|
2427
2440
|
try {
|
|
2428
|
-
await i.delete(
|
|
2441
|
+
await i.delete(N(E.value.id)), r("delete:success", E.value), K.value = !1, Z(), o.value++;
|
|
2429
2442
|
} catch (m) {
|
|
2430
|
-
|
|
2443
|
+
W.value = ((B = (j = m.response) == null ? void 0 : j.data) == null ? void 0 : B.message) || m.message || a("errors.delete"), r("error", m);
|
|
2431
2444
|
} finally {
|
|
2432
|
-
|
|
2445
|
+
K.value = !1;
|
|
2433
2446
|
}
|
|
2434
2447
|
}
|
|
2435
2448
|
};
|
|
2436
|
-
return
|
|
2437
|
-
|
|
2438
|
-
|
|
2449
|
+
return re(v, (k) => {
|
|
2450
|
+
var j, B, m;
|
|
2451
|
+
if (k.status === ie.Error) {
|
|
2452
|
+
_.value = {
|
|
2453
|
+
title: a("errors.general")
|
|
2454
|
+
}, (m = (B = (j = k.error) == null ? void 0 : j.response) == null ? void 0 : B.data) != null && m.message && (_.value.message = k.error.response.data.message), r("error", k.error);
|
|
2439
2455
|
return;
|
|
2440
2456
|
}
|
|
2441
|
-
|
|
2457
|
+
_.value = null;
|
|
2442
2458
|
}), Ie(async () => {
|
|
2443
|
-
await t.canCreate() && (
|
|
2444
|
-
}), (
|
|
2445
|
-
const
|
|
2446
|
-
return
|
|
2459
|
+
await t.canCreate() && (P.value.title = a("snis.list.empty_state.title"), P.value.ctaText = a("actions.create"));
|
|
2460
|
+
}), (k, j) => {
|
|
2461
|
+
const B = F("KButton"), m = F("KBadge"), A = F("KTruncate"), U = F("KDropdownItem"), ae = F("KClipboardProvider");
|
|
2462
|
+
return b(), q("div", bn, [
|
|
2447
2463
|
I(s(xa), {
|
|
2448
2464
|
"cache-identifier": e.cacheIdentifier,
|
|
2449
2465
|
"cell-attributes": l,
|
|
2450
2466
|
"disable-pagination-page-jump": "",
|
|
2451
2467
|
"disable-row-click": !0,
|
|
2452
2468
|
"disable-sorting": f.value,
|
|
2453
|
-
"empty-state-options":
|
|
2469
|
+
"empty-state-options": P.value,
|
|
2454
2470
|
"enable-entity-actions": "",
|
|
2455
|
-
"error-message":
|
|
2456
|
-
fetcher: s(
|
|
2471
|
+
"error-message": _.value,
|
|
2472
|
+
fetcher: s(V),
|
|
2457
2473
|
"fetcher-cache-key": o.value,
|
|
2458
2474
|
"pagination-type": "offset",
|
|
2459
2475
|
"preferences-storage-key": "kong-ui-entities-snis-list",
|
|
2460
|
-
query:
|
|
2476
|
+
query: S.value,
|
|
2461
2477
|
"table-headers": s(y),
|
|
2462
2478
|
onClearSearchInput: c,
|
|
2463
2479
|
onSort: h
|
|
2464
2480
|
}, {
|
|
2465
|
-
"toolbar-filter":
|
|
2481
|
+
"toolbar-filter": d(() => [
|
|
2466
2482
|
I(s(Da), {
|
|
2467
|
-
modelValue:
|
|
2468
|
-
"onUpdate:modelValue":
|
|
2469
|
-
config:
|
|
2483
|
+
modelValue: S.value,
|
|
2484
|
+
"onUpdate:modelValue": j[0] || (j[0] = (T) => S.value = T),
|
|
2485
|
+
config: x.value
|
|
2470
2486
|
}, null, 8, ["modelValue", "config"])
|
|
2471
2487
|
]),
|
|
2472
|
-
"toolbar-button":
|
|
2488
|
+
"toolbar-button": d(() => [
|
|
2473
2489
|
I(s(we), {
|
|
2474
2490
|
"auth-function": () => e.canCreate()
|
|
2475
2491
|
}, {
|
|
2476
|
-
default:
|
|
2477
|
-
I(
|
|
2492
|
+
default: d(() => [
|
|
2493
|
+
I(B, {
|
|
2478
2494
|
appearance: "primary",
|
|
2479
2495
|
"data-testid": "toolbar-add-sni",
|
|
2480
2496
|
icon: "plus",
|
|
2481
2497
|
to: e.config.createRoute
|
|
2482
2498
|
}, {
|
|
2483
|
-
default:
|
|
2484
|
-
|
|
2499
|
+
default: d(() => [
|
|
2500
|
+
J(O(s(a)("snis.list.toolbar_actions.new")), 1)
|
|
2485
2501
|
]),
|
|
2486
2502
|
_: 1
|
|
2487
2503
|
}, 8, ["to"])
|
|
@@ -2489,59 +2505,59 @@ const bn = { class: "kong-ui-entities-snis-list" }, kn = { key: 1 }, wn = { key:
|
|
|
2489
2505
|
_: 1
|
|
2490
2506
|
}, 8, ["auth-function"])
|
|
2491
2507
|
]),
|
|
2492
|
-
name:
|
|
2493
|
-
|
|
2508
|
+
name: d(({ rowValue: T }) => [
|
|
2509
|
+
M("b", null, O(T ?? "-"), 1)
|
|
2494
2510
|
]),
|
|
2495
|
-
certificate:
|
|
2496
|
-
|
|
2511
|
+
certificate: d(({ row: T }) => [
|
|
2512
|
+
T.certificate && T.certificate.id ? (b(), D(s(hn), {
|
|
2497
2513
|
key: 0,
|
|
2498
2514
|
class: "copy-certificate-uuid",
|
|
2499
2515
|
"data-testid": "copy-certificate-uuid",
|
|
2500
|
-
notify: (
|
|
2516
|
+
notify: (Q) => n(Q, T),
|
|
2501
2517
|
truncated: !1,
|
|
2502
|
-
uuid:
|
|
2503
|
-
}, null, 8, ["notify", "uuid"])) : (
|
|
2518
|
+
uuid: T.certificate.id
|
|
2519
|
+
}, null, 8, ["notify", "uuid"])) : (b(), q("span", kn, "-"))
|
|
2504
2520
|
]),
|
|
2505
|
-
tags:
|
|
2506
|
-
|
|
2507
|
-
default:
|
|
2508
|
-
(
|
|
2509
|
-
key:
|
|
2510
|
-
onClick:
|
|
2521
|
+
tags: d(({ rowValue: T }) => [
|
|
2522
|
+
T != null && T.length ? (b(), D(A, { key: 0 }, {
|
|
2523
|
+
default: d(() => [
|
|
2524
|
+
(b(!0), q(We, null, Ce(T, (Q) => (b(), D(m, {
|
|
2525
|
+
key: Q,
|
|
2526
|
+
onClick: j[1] || (j[1] = ve(() => {
|
|
2511
2527
|
}, ["stop"]))
|
|
2512
2528
|
}, {
|
|
2513
|
-
default:
|
|
2514
|
-
|
|
2529
|
+
default: d(() => [
|
|
2530
|
+
J(O(Q), 1)
|
|
2515
2531
|
]),
|
|
2516
2532
|
_: 2
|
|
2517
2533
|
}, 1024))), 128))
|
|
2518
2534
|
]),
|
|
2519
2535
|
_: 2
|
|
2520
|
-
}, 1024)) : (
|
|
2536
|
+
}, 1024)) : (b(), q("span", wn, "-"))
|
|
2521
2537
|
]),
|
|
2522
|
-
actions:
|
|
2523
|
-
I(
|
|
2524
|
-
default:
|
|
2525
|
-
I(
|
|
2538
|
+
actions: d(({ row: T }) => [
|
|
2539
|
+
I(ae, null, {
|
|
2540
|
+
default: d(({ copyToClipboard: Q }) => [
|
|
2541
|
+
I(U, {
|
|
2526
2542
|
"data-testid": "action-entity-copy-id",
|
|
2527
|
-
onClick: (fe) =>
|
|
2543
|
+
onClick: (fe) => u(T, Q)
|
|
2528
2544
|
}, {
|
|
2529
|
-
default:
|
|
2530
|
-
|
|
2545
|
+
default: d(() => [
|
|
2546
|
+
J(O(s(a)("actions.copy_id")), 1)
|
|
2531
2547
|
]),
|
|
2532
2548
|
_: 2
|
|
2533
2549
|
}, 1032, ["onClick"])
|
|
2534
2550
|
]),
|
|
2535
2551
|
_: 2
|
|
2536
2552
|
}, 1024),
|
|
2537
|
-
I(
|
|
2538
|
-
default:
|
|
2539
|
-
I(
|
|
2553
|
+
I(ae, null, {
|
|
2554
|
+
default: d(({ copyToClipboard: Q }) => [
|
|
2555
|
+
I(U, {
|
|
2540
2556
|
"data-testid": "action-entity-copy-json",
|
|
2541
|
-
onClick: (fe) =>
|
|
2557
|
+
onClick: (fe) => $(T, Q)
|
|
2542
2558
|
}, {
|
|
2543
|
-
default:
|
|
2544
|
-
|
|
2559
|
+
default: d(() => [
|
|
2560
|
+
J(O(s(a)("actions.copy_json")), 1)
|
|
2545
2561
|
]),
|
|
2546
2562
|
_: 2
|
|
2547
2563
|
}, 1032, ["onClick"])
|
|
@@ -2549,28 +2565,28 @@ const bn = { class: "kong-ui-entities-snis-list" }, kn = { key: 1 }, wn = { key:
|
|
|
2549
2565
|
_: 2
|
|
2550
2566
|
}, 1024),
|
|
2551
2567
|
I(s(we), {
|
|
2552
|
-
"auth-function": () => e.canEdit(
|
|
2568
|
+
"auth-function": () => e.canEdit(T)
|
|
2553
2569
|
}, {
|
|
2554
|
-
default:
|
|
2555
|
-
I(
|
|
2570
|
+
default: d(() => [
|
|
2571
|
+
I(U, {
|
|
2556
2572
|
"data-testid": "action-entity-edit",
|
|
2557
|
-
item:
|
|
2573
|
+
item: z(T.id)
|
|
2558
2574
|
}, null, 8, ["item"])
|
|
2559
2575
|
]),
|
|
2560
2576
|
_: 2
|
|
2561
2577
|
}, 1032, ["auth-function"]),
|
|
2562
2578
|
I(s(we), {
|
|
2563
|
-
"auth-function": () => e.canDelete(
|
|
2579
|
+
"auth-function": () => e.canDelete(T)
|
|
2564
2580
|
}, {
|
|
2565
|
-
default:
|
|
2566
|
-
I(
|
|
2581
|
+
default: d(() => [
|
|
2582
|
+
I(U, {
|
|
2567
2583
|
danger: "",
|
|
2568
2584
|
"data-testid": "action-entity-delete",
|
|
2569
2585
|
"has-divider": "",
|
|
2570
|
-
onClick: (
|
|
2586
|
+
onClick: (Q) => L(T)
|
|
2571
2587
|
}, {
|
|
2572
|
-
default:
|
|
2573
|
-
|
|
2588
|
+
default: d(() => [
|
|
2589
|
+
J(O(s(a)("actions.delete")), 1)
|
|
2574
2590
|
]),
|
|
2575
2591
|
_: 2
|
|
2576
2592
|
}, 1032, ["onClick"])
|
|
@@ -2581,16 +2597,16 @@ const bn = { class: "kong-ui-entities-snis-list" }, kn = { key: 1 }, wn = { key:
|
|
|
2581
2597
|
_: 1
|
|
2582
2598
|
}, 8, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers"]),
|
|
2583
2599
|
I(s(Aa), {
|
|
2584
|
-
"action-pending":
|
|
2600
|
+
"action-pending": K.value,
|
|
2585
2601
|
description: s(a)("delete.description"),
|
|
2586
2602
|
"entity-name": E.value && (E.value.name || E.value.id),
|
|
2587
2603
|
"entity-type": s(Ge).SNI,
|
|
2588
|
-
error:
|
|
2604
|
+
error: W.value,
|
|
2589
2605
|
"need-confirm": !1,
|
|
2590
2606
|
title: s(a)("delete.title"),
|
|
2591
|
-
visible:
|
|
2592
|
-
onCancel:
|
|
2593
|
-
onProceed:
|
|
2607
|
+
visible: R.value,
|
|
2608
|
+
onCancel: Z,
|
|
2609
|
+
onProceed: ue
|
|
2594
2610
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
2595
2611
|
]);
|
|
2596
2612
|
};
|
|
@@ -2601,11 +2617,11 @@ const lt = (e, r) => {
|
|
|
2601
2617
|
for (const [a, n] of r)
|
|
2602
2618
|
t[a] = n;
|
|
2603
2619
|
return t;
|
|
2604
|
-
}, Rn = /* @__PURE__ */ lt(Sn, [["__scopeId", "data-v-
|
|
2620
|
+
}, Rn = /* @__PURE__ */ lt(Sn, [["__scopeId", "data-v-531bd4b8"]]), _n = { class: "kong-ui-entities-snis-form" }, In = { "data-testid": "no-search-results" }, Cn = {
|
|
2605
2621
|
key: 2,
|
|
2606
2622
|
class: "invalid-certificate-message",
|
|
2607
2623
|
"data-testid": "invalid-certificate-message"
|
|
2608
|
-
}, xn = /* @__PURE__ */
|
|
2624
|
+
}, xn = /* @__PURE__ */ ee({
|
|
2609
2625
|
__name: "SniForm",
|
|
2610
2626
|
props: {
|
|
2611
2627
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -2623,10 +2639,10 @@ const lt = (e, r) => {
|
|
|
2623
2639
|
},
|
|
2624
2640
|
emits: ["update", "error", "loading"],
|
|
2625
2641
|
setup(e, { emit: r }) {
|
|
2626
|
-
var
|
|
2627
|
-
const t = e, a =
|
|
2628
|
-
headers: (
|
|
2629
|
-
}), f =
|
|
2642
|
+
var B;
|
|
2643
|
+
const t = e, a = Ye(), { i18n: { t: n } } = Ze.useI18n(), { getMessageFromError: i } = Qa(), { axiosInstance: o } = ot({
|
|
2644
|
+
headers: (B = t.config) == null ? void 0 : B.requestHeaders
|
|
2645
|
+
}), f = w(() => de.form[t.config.app].edit), p = w(() => t.sniId ? ge.Edit : ge.Create), y = w(() => t.config.certificateId && p.value === ge.Create ? t.config.certificateId : ""), l = Me({
|
|
2630
2646
|
fields: {
|
|
2631
2647
|
name: "",
|
|
2632
2648
|
tags: "",
|
|
@@ -2634,90 +2650,90 @@ const lt = (e, r) => {
|
|
|
2634
2650
|
},
|
|
2635
2651
|
isReadonly: !1,
|
|
2636
2652
|
errorMessage: ""
|
|
2637
|
-
}), g =
|
|
2653
|
+
}), g = Me({
|
|
2638
2654
|
name: "",
|
|
2639
2655
|
tags: "",
|
|
2640
2656
|
certificate_id: ""
|
|
2641
|
-
}),
|
|
2642
|
-
var A,
|
|
2643
|
-
l.fields.name = (m == null ? void 0 : m.name) || "", l.fields.tags = ((A = m == null ? void 0 : m.tags) == null ? void 0 : A.join(", ")) || "", l.fields.certificate_id = ((
|
|
2644
|
-
},
|
|
2657
|
+
}), S = w(() => JSON.stringify(l.fields) !== JSON.stringify(g) && !!l.fields.name && !!(l.fields.certificate_id || y.value)), x = (m) => {
|
|
2658
|
+
var A, U;
|
|
2659
|
+
l.fields.name = (m == null ? void 0 : m.name) || "", l.fields.tags = ((A = m == null ? void 0 : m.tags) == null ? void 0 : A.join(", ")) || "", l.fields.certificate_id = ((U = m == null ? void 0 : m.certificate) == null ? void 0 : U.id) || "", Object.assign(g, l.fields);
|
|
2660
|
+
}, V = () => {
|
|
2645
2661
|
a.push(t.config.cancelRoute);
|
|
2646
|
-
}, v =
|
|
2647
|
-
var A,
|
|
2662
|
+
}, v = w(() => {
|
|
2663
|
+
var A, U;
|
|
2648
2664
|
let m = `${t.config.apiBaseUrl}${de.form[t.config.app].validate}`;
|
|
2649
|
-
return t.config.app === "konnect" ? m = m.replace(/{controlPlaneId}/gi, ((A = t.config) == null ? void 0 : A.controlPlaneId) || "") : t.config.app === "kongManager" && (m = m.replace(/\/{workspace}/gi, (
|
|
2650
|
-
}), c =
|
|
2651
|
-
var A,
|
|
2652
|
-
let m = `${t.config.apiBaseUrl}${de.form[t.config.app][
|
|
2653
|
-
return t.config.app === "konnect" ? m = m.replace(/{controlPlaneId}/gi, ((A = t.config) == null ? void 0 : A.controlPlaneId) || "") : t.config.app === "kongManager" && (m = m.replace(/\/{workspace}/gi, (
|
|
2665
|
+
return t.config.app === "konnect" ? m = m.replace(/{controlPlaneId}/gi, ((A = t.config) == null ? void 0 : A.controlPlaneId) || "") : t.config.app === "kongManager" && (m = m.replace(/\/{workspace}/gi, (U = t.config) != null && U.workspace ? `/${t.config.workspace}` : "")), m = m.replace(/{id}/gi, t.sniId), m;
|
|
2666
|
+
}), c = w(() => {
|
|
2667
|
+
var A, U;
|
|
2668
|
+
let m = `${t.config.apiBaseUrl}${de.form[t.config.app][p.value]}`;
|
|
2669
|
+
return t.config.app === "konnect" ? m = m.replace(/{controlPlaneId}/gi, ((A = t.config) == null ? void 0 : A.controlPlaneId) || "") : t.config.app === "kongManager" && (m = m.replace(/\/{workspace}/gi, (U = t.config) != null && U.workspace ? `/${t.config.workspace}` : "")), m = m.replace(/{id}/gi, t.sniId), m;
|
|
2654
2670
|
}), h = async () => {
|
|
2655
|
-
var m, A,
|
|
2671
|
+
var m, A, U, ae, T, Q, fe, $e;
|
|
2656
2672
|
try {
|
|
2657
2673
|
l.isReadonly = !0;
|
|
2658
|
-
const
|
|
2674
|
+
const ne = {
|
|
2659
2675
|
name: l.fields.name,
|
|
2660
2676
|
tags: (A = (m = l.fields.tags.split(",")) == null ? void 0 : m.map((be) => String(be || "").trim())) == null ? void 0 : A.filter((be) => be !== ""),
|
|
2661
2677
|
certificate: { id: y.value || l.fields.certificate_id }
|
|
2662
2678
|
};
|
|
2663
|
-
let
|
|
2664
|
-
await o.post(v.value,
|
|
2665
|
-
} catch (
|
|
2666
|
-
l.errorMessage = i(
|
|
2679
|
+
let Y;
|
|
2680
|
+
await o.post(v.value, ne), p.value === "create" ? Y = await o.post(c.value, ne) : p.value === "edit" && (Y = ((U = t.config) == null ? void 0 : U.app) === "konnect" ? await o.put(c.value, ne) : await o.patch(c.value, ne)), l.fields.name = ((ae = Y == null ? void 0 : Y.data) == null ? void 0 : ae.name) || "", l.fields.tags = ((Q = (T = Y == null ? void 0 : Y.data) == null ? void 0 : T.tags) == null ? void 0 : Q.join(", ")) || "", l.fields.certificate_id = (($e = (fe = Y == null ? void 0 : Y.data) == null ? void 0 : fe.certificate) == null ? void 0 : $e.id) || "", Object.assign(g, l.fields), r("update", Y == null ? void 0 : Y.data);
|
|
2681
|
+
} catch (ne) {
|
|
2682
|
+
l.errorMessage = i(ne), r("error", ne);
|
|
2667
2683
|
} finally {
|
|
2668
2684
|
l.isReadonly = !1;
|
|
2669
2685
|
}
|
|
2670
2686
|
}, {
|
|
2671
|
-
debouncedQueryChange:
|
|
2672
|
-
loading:
|
|
2673
|
-
allRecords:
|
|
2674
|
-
error:
|
|
2675
|
-
validationError:
|
|
2687
|
+
debouncedQueryChange: _,
|
|
2688
|
+
loading: P,
|
|
2689
|
+
allRecords: u,
|
|
2690
|
+
error: $,
|
|
2691
|
+
validationError: z,
|
|
2676
2692
|
loadItems: E,
|
|
2677
|
-
results:
|
|
2678
|
-
} = en(t.config, de.form[t.config.app].certificates),
|
|
2679
|
-
|
|
2680
|
-
},
|
|
2693
|
+
results: R
|
|
2694
|
+
} = en(t.config, de.form[t.config.app].certificates), K = C(!0), W = (m) => {
|
|
2695
|
+
K.value = !m, _(m);
|
|
2696
|
+
}, N = w(() => $.value ? n("errors.certificates.fetch") : ""), L = w(() => z.value ? n("errors.certificates.invalid") : ""), Z = C(0), ue = w(() => u.value === void 0), te = C(/* @__PURE__ */ new Set()), k = w(() => Array.from(te.value).map((A) => ({
|
|
2681
2697
|
label: A,
|
|
2682
2698
|
value: A,
|
|
2683
2699
|
selected: l.fields.certificate_id === A
|
|
2684
|
-
}))),
|
|
2685
|
-
|
|
2700
|
+
}))), j = (m) => {
|
|
2701
|
+
te.value.clear();
|
|
2686
2702
|
let A;
|
|
2687
2703
|
for (A of m)
|
|
2688
|
-
|
|
2704
|
+
te.value.add(A.id);
|
|
2689
2705
|
};
|
|
2690
|
-
return
|
|
2691
|
-
|
|
2692
|
-
}, { immediate: !0, deep: !0 }),
|
|
2693
|
-
|
|
2706
|
+
return re(R, (m) => {
|
|
2707
|
+
j(m);
|
|
2708
|
+
}, { immediate: !0, deep: !0 }), re(k, () => {
|
|
2709
|
+
Z.value++;
|
|
2694
2710
|
}, { immediate: !0, deep: !0 }), Ie(async () => {
|
|
2695
2711
|
await E();
|
|
2696
2712
|
}), (m, A) => {
|
|
2697
|
-
const
|
|
2698
|
-
return
|
|
2713
|
+
const U = F("KInput"), ae = F("KSelect");
|
|
2714
|
+
return b(), q("div", _n, [
|
|
2699
2715
|
I(s(ha), {
|
|
2700
|
-
"can-submit":
|
|
2716
|
+
"can-submit": S.value,
|
|
2701
2717
|
config: e.config,
|
|
2702
2718
|
"edit-id": e.sniId,
|
|
2703
|
-
"error-message": l.errorMessage ||
|
|
2719
|
+
"error-message": l.errorMessage || N.value,
|
|
2704
2720
|
"fetch-url": f.value,
|
|
2705
2721
|
"is-readonly": l.isReadonly,
|
|
2706
|
-
onCancel:
|
|
2707
|
-
"onFetch:error": A[3] || (A[3] = (
|
|
2708
|
-
"onFetch:success":
|
|
2709
|
-
onLoading: A[4] || (A[4] = (
|
|
2722
|
+
onCancel: V,
|
|
2723
|
+
"onFetch:error": A[3] || (A[3] = (T) => m.$emit("error", T)),
|
|
2724
|
+
"onFetch:success": x,
|
|
2725
|
+
onLoading: A[4] || (A[4] = (T) => m.$emit("loading", T)),
|
|
2710
2726
|
onSubmit: h
|
|
2711
2727
|
}, {
|
|
2712
|
-
default:
|
|
2728
|
+
default: d(() => [
|
|
2713
2729
|
I(s(Le), {
|
|
2714
2730
|
description: s(n)("form.sections.general.description"),
|
|
2715
2731
|
title: s(n)("form.sections.general.title")
|
|
2716
2732
|
}, {
|
|
2717
|
-
default:
|
|
2718
|
-
I(
|
|
2733
|
+
default: d(() => [
|
|
2734
|
+
I(U, {
|
|
2719
2735
|
modelValue: l.fields.name,
|
|
2720
|
-
"onUpdate:modelValue": A[0] || (A[0] = (
|
|
2736
|
+
"onUpdate:modelValue": A[0] || (A[0] = (T) => l.fields.name = T),
|
|
2721
2737
|
modelModifiers: { trim: !0 },
|
|
2722
2738
|
autocomplete: "off",
|
|
2723
2739
|
"data-testid": "sni-form-name",
|
|
@@ -2727,9 +2743,9 @@ const lt = (e, r) => {
|
|
|
2727
2743
|
required: "",
|
|
2728
2744
|
type: "text"
|
|
2729
2745
|
}, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
|
|
2730
|
-
I(
|
|
2746
|
+
I(U, {
|
|
2731
2747
|
modelValue: l.fields.tags,
|
|
2732
|
-
"onUpdate:modelValue": A[1] || (A[1] = (
|
|
2748
|
+
"onUpdate:modelValue": A[1] || (A[1] = (T) => l.fields.tags = T),
|
|
2733
2749
|
modelModifiers: { trim: !0 },
|
|
2734
2750
|
autocomplete: "off",
|
|
2735
2751
|
"data-testid": "sni-form-tags",
|
|
@@ -2748,8 +2764,8 @@ const lt = (e, r) => {
|
|
|
2748
2764
|
"has-divider": "",
|
|
2749
2765
|
title: s(n)("form.sections.certificate.title")
|
|
2750
2766
|
}, {
|
|
2751
|
-
default:
|
|
2752
|
-
y.value ? (
|
|
2767
|
+
default: d(() => [
|
|
2768
|
+
y.value ? (b(), D(U, {
|
|
2753
2769
|
key: 0,
|
|
2754
2770
|
"data-testid": "sni-form-certificate-id",
|
|
2755
2771
|
label: s(n)("form.fields.certificate_id.label"),
|
|
@@ -2757,35 +2773,35 @@ const lt = (e, r) => {
|
|
|
2757
2773
|
readonly: "",
|
|
2758
2774
|
required: "",
|
|
2759
2775
|
width: "100%"
|
|
2760
|
-
}, null, 8, ["label", "model-value"])) : (
|
|
2776
|
+
}, null, 8, ["label", "model-value"])) : (b(), D(ae, {
|
|
2761
2777
|
key: 1,
|
|
2762
2778
|
modelValue: l.fields.certificate_id,
|
|
2763
|
-
"onUpdate:modelValue": A[2] || (A[2] = (
|
|
2779
|
+
"onUpdate:modelValue": A[2] || (A[2] = (T) => l.fields.certificate_id = T),
|
|
2764
2780
|
appearance: "select",
|
|
2765
2781
|
autosuggest: "",
|
|
2766
|
-
class: he({ "k-select-placeholder":
|
|
2782
|
+
class: he({ "k-select-placeholder": K.value }),
|
|
2767
2783
|
clearable: "",
|
|
2768
2784
|
"data-testid": "sni-form-certificate-id",
|
|
2769
|
-
"dropdown-footer-text":
|
|
2785
|
+
"dropdown-footer-text": ue.value ? s(n)("form.fields.certificate_id.footer") : void 0,
|
|
2770
2786
|
"enable-filtering": "",
|
|
2771
|
-
items:
|
|
2787
|
+
items: k.value,
|
|
2772
2788
|
label: s(n)("form.fields.certificate_id.label"),
|
|
2773
|
-
loading: s(
|
|
2789
|
+
loading: s(P),
|
|
2774
2790
|
placeholder: s(n)("form.fields.certificate_id.placeholder"),
|
|
2775
2791
|
readonly: l.isReadonly,
|
|
2776
2792
|
required: "",
|
|
2777
2793
|
width: "100%",
|
|
2778
|
-
onQueryChange:
|
|
2794
|
+
onQueryChange: W
|
|
2779
2795
|
}, {
|
|
2780
|
-
loading:
|
|
2781
|
-
|
|
2796
|
+
loading: d(() => [
|
|
2797
|
+
M("div", null, O(s(n)("actions.loading")), 1)
|
|
2782
2798
|
]),
|
|
2783
|
-
empty:
|
|
2784
|
-
|
|
2799
|
+
empty: d(() => [
|
|
2800
|
+
M("div", In, O(s(n)("search.no_results")), 1)
|
|
2785
2801
|
]),
|
|
2786
2802
|
_: 1
|
|
2787
2803
|
}, 8, ["modelValue", "class", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly"])),
|
|
2788
|
-
|
|
2804
|
+
L.value ? (b(), q("p", Cn, O(L.value), 1)) : X("", !0)
|
|
2789
2805
|
]),
|
|
2790
2806
|
_: 1
|
|
2791
2807
|
}, 8, ["description", "title"])
|
|
@@ -2796,8 +2812,8 @@ const lt = (e, r) => {
|
|
|
2796
2812
|
};
|
|
2797
2813
|
}
|
|
2798
2814
|
});
|
|
2799
|
-
const
|
|
2815
|
+
const qn = /* @__PURE__ */ lt(xn, [["__scopeId", "data-v-576c2dac"]]);
|
|
2800
2816
|
export {
|
|
2801
|
-
|
|
2817
|
+
qn as SniForm,
|
|
2802
2818
|
Rn as SniList
|
|
2803
2819
|
};
|