@kong-ui-public/entities-keys 3.12.34 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities-keys.es.js +210 -210
- package/dist/entities-keys.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/KeyConfigCard.vue.d.ts.map +1 -1
- package/dist/types/components/KeyForm.vue.d.ts +10 -10
- package/dist/types/components/KeyForm.vue.d.ts.map +1 -1
- package/dist/types/components/KeyList.vue.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/entities-keys.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ge, computed as h, ref as w, watch as le, onBeforeMount as je, resolveComponent as F, openBlock as b, createElementBlock as W, createVNode as u, unref as l, createSlots as me, withCtx as f, createTextVNode as N, toDisplayString as C, createElementVNode as D, createBlock as V, Teleport as De, createCommentVNode as J, reactive as Se, Fragment as we, renderList as Ie } from "vue";
|
|
2
2
|
import { useRouter as Ee } from "vue-router";
|
|
3
3
|
import { BookIcon as Ce, AddIcon as xe, KeyIcon as Fe } from "@kong/icons";
|
|
4
4
|
import { createI18n as Te, i18nTComponent as Be } from "@kong-ui-public/i18n";
|
|
5
|
-
import { useAxios as
|
|
5
|
+
import { useAxios as ve, useTableState as Ae, useFetcher as Ue, useDeleteUrlBuilder as Pe, FetcherStatus as qe, EntityBaseTable as Oe, PermissionsWrapper as ne, TableTags as Ne, EntityFilter as Je, EntityDeleteModal as We, EntityTypes as Le, useErrors as He, EntityBaseFormType as te, useDebouncedFilter as Qe, EntityBaseForm as Ge, SupportedEntityType as Ve, EntityFormSection as Ke, useStringHelpers as ze, ConfigurationSchemaType as ke, ConfigurationSchemaSection as pe, EntityBaseConfigCard as Xe, InternalLinkItem as Ye, ConfigCardItem as $e } from "@kong-ui-public/entities-shared";
|
|
6
6
|
const Ze = {
|
|
7
7
|
title: "Keys",
|
|
8
8
|
list: {
|
|
@@ -132,16 +132,16 @@ const Ze = {
|
|
|
132
132
|
keys: Ze
|
|
133
133
|
};
|
|
134
134
|
function tt() {
|
|
135
|
-
const
|
|
135
|
+
const o = Te("en-us", et);
|
|
136
136
|
return {
|
|
137
|
-
i18n:
|
|
138
|
-
i18nT: Be(
|
|
137
|
+
i18n: o,
|
|
138
|
+
i18nT: Be(o)
|
|
139
139
|
// Translation component <i18n-t>
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
const
|
|
142
|
+
const he = {
|
|
143
143
|
useI18n: tt
|
|
144
|
-
}, A = "/v2/control-planes/{controlPlaneId}/core-entities", U = "/{workspace}", P = {
|
|
144
|
+
}, A = "/v2/control-planes/{controlPlaneId}/core-entities/{workspace}", U = "/{workspace}", P = {
|
|
145
145
|
list: {
|
|
146
146
|
konnect: {
|
|
147
147
|
all: `${A}/keys`,
|
|
@@ -178,14 +178,14 @@ const be = {
|
|
|
178
178
|
getKeySet: `${U}/key-sets/{keySetId}`
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
}, lt = { class: "kong-ui-entities-keys-list" }, it = { class: "button-row" },
|
|
181
|
+
}, lt = { class: "kong-ui-entities-keys-list" }, it = { class: "button-row" }, ot = /* @__PURE__ */ ge({
|
|
182
182
|
__name: "KeyList",
|
|
183
183
|
props: {
|
|
184
184
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
185
185
|
config: {
|
|
186
186
|
type: Object,
|
|
187
187
|
required: !0,
|
|
188
|
-
validator: (
|
|
188
|
+
validator: (o) => !(!o || !["konnect", "kongManager"].includes(o == null ? void 0 : o.app) || !o.createRoute || !o.getViewRoute || !o.getEditRoute || o.app === "kongManager" && !o.isExactMatch && !o.filterSchema)
|
|
189
189
|
},
|
|
190
190
|
// used to override the default identifier for the cache entry
|
|
191
191
|
cacheIdentifier: {
|
|
@@ -223,19 +223,19 @@ const be = {
|
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
225
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success"],
|
|
226
|
-
setup(
|
|
226
|
+
setup(o, { emit: q }) {
|
|
227
227
|
var I;
|
|
228
|
-
const _ = q, t =
|
|
228
|
+
const _ = q, t = o, { i18n: { t: c } } = he.useI18n(), d = Ee(), { axiosInstance: x } = ve((I = t.config) == null ? void 0 : I.axiosRequestConfig), { hasRecords: O, handleStateChange: z } = Ae(() => R.value), K = h(() => O.value && t.config.app === "konnect"), e = h(() => !!t.config.keySetId), $ = h(() => t.config.app !== "kongManager" || !!t.config.disableSorting), T = {
|
|
229
229
|
// the Name column is non-hidable
|
|
230
230
|
name: { label: c("keys.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
231
231
|
kid: { label: c("keys.list.table_headers.key_id"), sortable: !0 },
|
|
232
232
|
tags: { label: c("keys.list.table_headers.tags") },
|
|
233
233
|
id: { label: c("keys.list.table_headers.id"), sortable: !0 }
|
|
234
234
|
}, B = T, L = h(() => {
|
|
235
|
-
var i, n, E
|
|
235
|
+
var i, n, E;
|
|
236
236
|
let s = `${t.config.apiBaseUrl}${P.list[t.config.app][t.config.keySetId ? "forKeySet" : "all"]}`;
|
|
237
|
-
return t.config.app === "konnect"
|
|
238
|
-
}),
|
|
237
|
+
return t.config.app === "konnect" && (s = s.replace(/{controlPlaneId}/gi, ((i = t.config) == null ? void 0 : i.controlPlaneId) || "")), s.replace(/\/{workspace}/gi, (n = t.config) != null && n.workspace ? `/${t.config.workspace}` : "").replace(/{keySetId}/gi, ((E = t.config) == null ? void 0 : E.keySetId) || "");
|
|
238
|
+
}), R = w(""), X = h(() => {
|
|
239
239
|
const s = t.config.app === "konnect" || t.config.isExactMatch;
|
|
240
240
|
if (s)
|
|
241
241
|
return {
|
|
@@ -253,17 +253,17 @@ const be = {
|
|
|
253
253
|
fetcherState: y,
|
|
254
254
|
fetcherCacheKey: m
|
|
255
255
|
} = Ue(h(() => ({ ...t.config, cacheIdentifier: t.cacheIdentifier })), L), j = () => {
|
|
256
|
-
|
|
256
|
+
R.value = "";
|
|
257
257
|
}, g = () => {
|
|
258
258
|
m.value++;
|
|
259
259
|
}, S = w(null), k = async (s, i) => {
|
|
260
260
|
const n = s.id;
|
|
261
261
|
if (!await i(n)) {
|
|
262
|
-
|
|
262
|
+
de(s, "id");
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
|
-
|
|
266
|
-
},
|
|
265
|
+
re(s, "id");
|
|
266
|
+
}, ie = async (s, i) => {
|
|
267
267
|
const n = JSON.stringify(s);
|
|
268
268
|
if (!await i(n)) {
|
|
269
269
|
_("copy:error", {
|
|
@@ -276,47 +276,47 @@ const be = {
|
|
|
276
276
|
entity: s,
|
|
277
277
|
message: c("keys.copy.success_brief")
|
|
278
278
|
});
|
|
279
|
-
},
|
|
279
|
+
}, re = (s, i) => {
|
|
280
280
|
_("copy:success", {
|
|
281
281
|
entity: s,
|
|
282
282
|
field: i,
|
|
283
283
|
message: c("keys.copy.success", { val: s[i] })
|
|
284
284
|
});
|
|
285
|
-
},
|
|
285
|
+
}, de = (s, i) => {
|
|
286
286
|
_("copy:error", {
|
|
287
287
|
entity: s,
|
|
288
288
|
field: i,
|
|
289
289
|
message: c("keys.errors.copy")
|
|
290
290
|
});
|
|
291
|
-
},
|
|
291
|
+
}, ce = async (s) => {
|
|
292
292
|
var n;
|
|
293
293
|
await ((n = t.canRetrieve) == null ? void 0 : n.call(t, s)) && d.push(t.config.getViewRoute(s.id));
|
|
294
|
-
},
|
|
294
|
+
}, ye = (s) => ({
|
|
295
295
|
label: c("keys.actions.view"),
|
|
296
296
|
to: t.config.getViewRoute(s)
|
|
297
297
|
}), ue = (s) => ({
|
|
298
298
|
label: c("keys.actions.edit"),
|
|
299
299
|
to: t.config.getEditRoute(s)
|
|
300
|
-
}),
|
|
301
|
-
|
|
302
|
-
},
|
|
300
|
+
}), M = w(void 0), Q = w(!1), G = w(!1), oe = w(""), Y = Pe(t.config, L.value), ae = (s) => {
|
|
301
|
+
M.value = s, Q.value = !0;
|
|
302
|
+
}, fe = () => {
|
|
303
303
|
Q.value = !1;
|
|
304
|
-
},
|
|
304
|
+
}, se = async () => {
|
|
305
305
|
var s, i, n;
|
|
306
|
-
if ((s =
|
|
306
|
+
if ((s = M.value) != null && s.id) {
|
|
307
307
|
G.value = !0;
|
|
308
308
|
try {
|
|
309
|
-
await
|
|
309
|
+
await x.delete(Y(M.value.id)), G.value = !1, Q.value = !1, m.value++, _("delete:success", M.value);
|
|
310
310
|
} catch (E) {
|
|
311
311
|
oe.value = ((n = (i = E.response) == null ? void 0 : i.data) == null ? void 0 : n.message) || E.message || c("keys.errors.delete"), _("error", E);
|
|
312
312
|
} finally {
|
|
313
313
|
G.value = !1;
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
},
|
|
316
|
+
}, a = () => {
|
|
317
317
|
d.push(t.config.createRoute);
|
|
318
318
|
};
|
|
319
|
-
|
|
319
|
+
le(y, (s) => {
|
|
320
320
|
var i, n, E;
|
|
321
321
|
if (s.status === qe.Error) {
|
|
322
322
|
S.value = {
|
|
@@ -335,11 +335,11 @@ const be = {
|
|
|
335
335
|
return je(async () => {
|
|
336
336
|
v.value = await t.canCreate(), v.value && (r.value.title = c("keys.list.empty_state.title"), r.value.ctaText = c("keys.actions.create"));
|
|
337
337
|
}), (s, i) => {
|
|
338
|
-
const n = F("KButton"), E = F("KEmptyState"),
|
|
338
|
+
const n = F("KButton"), E = F("KEmptyState"), be = F("KCopy"), Z = F("KDropdownItem"), _e = F("KClipboardProvider");
|
|
339
339
|
return b(), W("div", lt, [
|
|
340
|
-
|
|
341
|
-
"cache-identifier":
|
|
342
|
-
"disable-sorting":
|
|
340
|
+
u(l(Oe), {
|
|
341
|
+
"cache-identifier": o.cacheIdentifier,
|
|
342
|
+
"disable-sorting": $.value,
|
|
343
343
|
"empty-state-options": r.value,
|
|
344
344
|
"enable-entity-actions": "",
|
|
345
345
|
"error-message": S.value,
|
|
@@ -347,27 +347,27 @@ const be = {
|
|
|
347
347
|
"fetcher-cache-key": l(m),
|
|
348
348
|
"pagination-type": "offset",
|
|
349
349
|
"preferences-storage-key": "kong-ui-entities-keys-list",
|
|
350
|
-
query:
|
|
350
|
+
query: R.value,
|
|
351
351
|
"table-headers": l(B),
|
|
352
352
|
onClearSearchInput: j,
|
|
353
|
-
"onClick:row": i[3] || (i[3] = (p) =>
|
|
353
|
+
"onClick:row": i[3] || (i[3] = (p) => ce(p)),
|
|
354
354
|
onSort: g,
|
|
355
355
|
onState: l(z)
|
|
356
|
-
},
|
|
357
|
-
"toolbar-filter":
|
|
358
|
-
|
|
359
|
-
modelValue:
|
|
360
|
-
"onUpdate:modelValue": i[0] || (i[0] = (p) =>
|
|
356
|
+
}, me({
|
|
357
|
+
"toolbar-filter": f(() => [
|
|
358
|
+
u(l(Je), {
|
|
359
|
+
modelValue: R.value,
|
|
360
|
+
"onUpdate:modelValue": i[0] || (i[0] = (p) => R.value = p),
|
|
361
361
|
config: X.value
|
|
362
362
|
}, null, 8, ["modelValue", "config"])
|
|
363
363
|
]),
|
|
364
|
-
"toolbar-button":
|
|
364
|
+
"toolbar-button": f(() => [
|
|
365
365
|
(b(), V(De, {
|
|
366
|
-
disabled: !
|
|
366
|
+
disabled: !o.useActionOutside,
|
|
367
367
|
to: "#kong-ui-app-page-header-action-button"
|
|
368
368
|
}, [
|
|
369
369
|
D("div", it, [
|
|
370
|
-
!e.value &&
|
|
370
|
+
!e.value && K.value ? (b(), V(n, {
|
|
371
371
|
key: 0,
|
|
372
372
|
appearance: "secondary",
|
|
373
373
|
class: "open-learning-hub",
|
|
@@ -375,23 +375,23 @@ const be = {
|
|
|
375
375
|
icon: "",
|
|
376
376
|
onClick: i[1] || (i[1] = (p) => s.$emit("click:learn-more"))
|
|
377
377
|
}, {
|
|
378
|
-
default:
|
|
379
|
-
|
|
378
|
+
default: f(() => [
|
|
379
|
+
u(l(Ce), { decorative: "" })
|
|
380
380
|
]),
|
|
381
381
|
_: 1
|
|
382
382
|
})) : J("", !0),
|
|
383
|
-
|
|
384
|
-
"auth-function": () =>
|
|
383
|
+
u(l(ne), {
|
|
384
|
+
"auth-function": () => o.canCreate()
|
|
385
385
|
}, {
|
|
386
|
-
default:
|
|
387
|
-
|
|
386
|
+
default: f(() => [
|
|
387
|
+
u(n, {
|
|
388
388
|
appearance: "primary",
|
|
389
389
|
"data-testid": "toolbar-add-key",
|
|
390
|
-
size:
|
|
391
|
-
to:
|
|
390
|
+
size: o.useActionOutside ? "medium" : "large",
|
|
391
|
+
to: o.config.createRoute
|
|
392
392
|
}, {
|
|
393
|
-
default:
|
|
394
|
-
|
|
393
|
+
default: f(() => [
|
|
394
|
+
u(l(xe)),
|
|
395
395
|
N(" " + C(l(c)("keys.list.toolbar_actions.new_key")), 1)
|
|
396
396
|
]),
|
|
397
397
|
_: 1
|
|
@@ -402,29 +402,29 @@ const be = {
|
|
|
402
402
|
])
|
|
403
403
|
], 8, ["disabled"]))
|
|
404
404
|
]),
|
|
405
|
-
name:
|
|
405
|
+
name: f(({ rowValue: p }) => [
|
|
406
406
|
D("b", null, C(p ?? "-"), 1)
|
|
407
407
|
]),
|
|
408
|
-
kid:
|
|
409
|
-
|
|
408
|
+
kid: f(({ rowValue: p }) => [
|
|
409
|
+
u(be, { text: p }, null, 8, ["text"])
|
|
410
410
|
]),
|
|
411
|
-
tags:
|
|
412
|
-
|
|
411
|
+
tags: f(({ rowValue: p }) => [
|
|
412
|
+
u(l(Ne), { tags: p }, null, 8, ["tags"])
|
|
413
413
|
]),
|
|
414
|
-
id:
|
|
415
|
-
|
|
414
|
+
id: f(({ rowValue: p }) => [
|
|
415
|
+
u(be, {
|
|
416
416
|
text: p,
|
|
417
417
|
truncate: ""
|
|
418
418
|
}, null, 8, ["text"])
|
|
419
419
|
]),
|
|
420
|
-
actions:
|
|
421
|
-
|
|
422
|
-
default:
|
|
423
|
-
|
|
420
|
+
actions: f(({ row: p }) => [
|
|
421
|
+
u(_e, null, {
|
|
422
|
+
default: f(({ copyToClipboard: ee }) => [
|
|
423
|
+
u(Z, {
|
|
424
424
|
"data-testid": "action-entity-copy-id",
|
|
425
|
-
onClick: (
|
|
425
|
+
onClick: (Me) => k(p, ee)
|
|
426
426
|
}, {
|
|
427
|
-
default:
|
|
427
|
+
default: f(() => [
|
|
428
428
|
N(C(l(c)("keys.actions.copy_id")), 1)
|
|
429
429
|
]),
|
|
430
430
|
_: 1
|
|
@@ -432,13 +432,13 @@ const be = {
|
|
|
432
432
|
]),
|
|
433
433
|
_: 2
|
|
434
434
|
}, 1024),
|
|
435
|
-
|
|
436
|
-
default:
|
|
437
|
-
|
|
435
|
+
u(_e, null, {
|
|
436
|
+
default: f(({ copyToClipboard: ee }) => [
|
|
437
|
+
u(Z, {
|
|
438
438
|
"data-testid": "action-entity-copy-json",
|
|
439
|
-
onClick: (
|
|
439
|
+
onClick: (Me) => ie(p, ee)
|
|
440
440
|
}, {
|
|
441
|
-
default:
|
|
441
|
+
default: f(() => [
|
|
442
442
|
N(C(l(c)("keys.actions.copy_json")), 1)
|
|
443
443
|
]),
|
|
444
444
|
_: 1
|
|
@@ -446,40 +446,40 @@ const be = {
|
|
|
446
446
|
]),
|
|
447
447
|
_: 2
|
|
448
448
|
}, 1024),
|
|
449
|
-
|
|
450
|
-
"auth-function": () =>
|
|
449
|
+
u(l(ne), {
|
|
450
|
+
"auth-function": () => o.canRetrieve(p)
|
|
451
451
|
}, {
|
|
452
|
-
default:
|
|
453
|
-
|
|
452
|
+
default: f(() => [
|
|
453
|
+
u(Z, {
|
|
454
454
|
"data-testid": "action-entity-view",
|
|
455
455
|
"has-divider": "",
|
|
456
|
-
item:
|
|
456
|
+
item: ye(p.id)
|
|
457
457
|
}, null, 8, ["item"])
|
|
458
458
|
]),
|
|
459
459
|
_: 2
|
|
460
460
|
}, 1032, ["auth-function"]),
|
|
461
|
-
|
|
462
|
-
"auth-function": () =>
|
|
461
|
+
u(l(ne), {
|
|
462
|
+
"auth-function": () => o.canEdit(p)
|
|
463
463
|
}, {
|
|
464
|
-
default:
|
|
465
|
-
|
|
464
|
+
default: f(() => [
|
|
465
|
+
u(Z, {
|
|
466
466
|
"data-testid": "action-entity-edit",
|
|
467
467
|
item: ue(p.id)
|
|
468
468
|
}, null, 8, ["item"])
|
|
469
469
|
]),
|
|
470
470
|
_: 2
|
|
471
471
|
}, 1032, ["auth-function"]),
|
|
472
|
-
|
|
473
|
-
"auth-function": () =>
|
|
472
|
+
u(l(ne), {
|
|
473
|
+
"auth-function": () => o.canDelete(p)
|
|
474
474
|
}, {
|
|
475
|
-
default:
|
|
476
|
-
|
|
475
|
+
default: f(() => [
|
|
476
|
+
u(Z, {
|
|
477
477
|
danger: "",
|
|
478
478
|
"data-testid": "action-entity-delete",
|
|
479
479
|
"has-divider": "",
|
|
480
|
-
onClick: (
|
|
480
|
+
onClick: (ee) => ae(p)
|
|
481
481
|
}, {
|
|
482
|
-
default:
|
|
482
|
+
default: f(() => [
|
|
483
483
|
N(C(l(c)("keys.actions.delete")), 1)
|
|
484
484
|
]),
|
|
485
485
|
_: 1
|
|
@@ -490,39 +490,39 @@ const be = {
|
|
|
490
490
|
]),
|
|
491
491
|
_: 2
|
|
492
492
|
}, [
|
|
493
|
-
!
|
|
493
|
+
!R.value && o.config.app === "konnect" ? {
|
|
494
494
|
name: "empty-state",
|
|
495
|
-
fn:
|
|
495
|
+
fn: f(() => {
|
|
496
496
|
var p;
|
|
497
497
|
return [
|
|
498
|
-
|
|
499
|
-
"data-testid":
|
|
498
|
+
u(E, {
|
|
499
|
+
"data-testid": o.config.keySetId ? "nested-keys-entity-empty-state" : "keys-entity-empty-state",
|
|
500
500
|
"icon-background": "",
|
|
501
501
|
message: l(c)("keys.list.empty_state_v2.description"),
|
|
502
502
|
title: l(c)("keys.list.empty_state_v2.title")
|
|
503
|
-
},
|
|
504
|
-
icon:
|
|
505
|
-
|
|
503
|
+
}, me({
|
|
504
|
+
icon: f(() => [
|
|
505
|
+
u(l(Fe), { decorative: "" })
|
|
506
506
|
]),
|
|
507
|
-
action:
|
|
507
|
+
action: f(() => [
|
|
508
508
|
v.value ? (b(), V(n, {
|
|
509
509
|
key: 0,
|
|
510
510
|
"data-testid": "entity-create-button",
|
|
511
|
-
onClick:
|
|
511
|
+
onClick: a
|
|
512
512
|
}, {
|
|
513
|
-
default:
|
|
514
|
-
|
|
513
|
+
default: f(() => [
|
|
514
|
+
u(l(xe), { decorative: "" }),
|
|
515
515
|
N(" " + C(l(c)("keys.list.empty_state_v2.create_cta")), 1)
|
|
516
516
|
]),
|
|
517
517
|
_: 1
|
|
518
518
|
})) : J("", !0),
|
|
519
|
-
|
|
519
|
+
u(n, {
|
|
520
520
|
appearance: "secondary",
|
|
521
521
|
"data-testid": "entity-learn-more-button",
|
|
522
|
-
onClick: i[2] || (i[2] = (
|
|
522
|
+
onClick: i[2] || (i[2] = (ee) => s.$emit("click:learn-more"))
|
|
523
523
|
}, {
|
|
524
|
-
default:
|
|
525
|
-
|
|
524
|
+
default: f(() => [
|
|
525
|
+
u(l(Ce), { decorative: "" }),
|
|
526
526
|
N(" " + C(l(c)("keys.list.empty_state_v2.learn_more")), 1)
|
|
527
527
|
]),
|
|
528
528
|
_: 1
|
|
@@ -530,9 +530,9 @@ const be = {
|
|
|
530
530
|
]),
|
|
531
531
|
_: 2
|
|
532
532
|
}, [
|
|
533
|
-
(p =
|
|
533
|
+
(p = o.config) != null && p.isControlPlaneGroup ? {
|
|
534
534
|
name: "default",
|
|
535
|
-
fn:
|
|
535
|
+
fn: f(() => [
|
|
536
536
|
N(C(l(c)("keys.list.empty_state_v2.group")), 1)
|
|
537
537
|
]),
|
|
538
538
|
key: "0"
|
|
@@ -543,43 +543,43 @@ const be = {
|
|
|
543
543
|
key: "0"
|
|
544
544
|
} : void 0
|
|
545
545
|
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
|
|
546
|
-
|
|
546
|
+
u(l(We), {
|
|
547
547
|
"action-pending": G.value,
|
|
548
548
|
description: l(c)("keys.delete.description"),
|
|
549
|
-
"entity-name":
|
|
549
|
+
"entity-name": M.value && (M.value.name || M.value.id),
|
|
550
550
|
"entity-type": l(Le).Key,
|
|
551
551
|
error: oe.value,
|
|
552
552
|
title: l(c)("keys.delete.title"),
|
|
553
553
|
visible: Q.value,
|
|
554
|
-
onCancel:
|
|
555
|
-
onProceed:
|
|
554
|
+
onCancel: fe,
|
|
555
|
+
onProceed: se
|
|
556
556
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
557
557
|
]);
|
|
558
558
|
};
|
|
559
559
|
}
|
|
560
|
-
}),
|
|
561
|
-
const _ =
|
|
560
|
+
}), Re = (o, q) => {
|
|
561
|
+
const _ = o.__vccOpts || o;
|
|
562
562
|
for (const [t, c] of q)
|
|
563
563
|
_[t] = c;
|
|
564
564
|
return _;
|
|
565
|
-
}, bt = /* @__PURE__ */
|
|
565
|
+
}, bt = /* @__PURE__ */ Re(ot, [["__scopeId", "data-v-8e1e850e"]]), at = { class: "kong-ui-entities-keys-form" }, st = { "data-testid": "no-search-results" }, nt = { class: "select-item-container" }, rt = { class: "select-item-label" }, dt = { class: "select-item-description" }, ct = {
|
|
566
566
|
key: 1,
|
|
567
567
|
class: "invalid-key-set-message",
|
|
568
568
|
"data-testid": "invalid-key-set-message"
|
|
569
|
-
}, yt = { "data-testid": "key-format-container" },
|
|
569
|
+
}, yt = { "data-testid": "key-format-container" }, ut = /* @__PURE__ */ ge({
|
|
570
570
|
__name: "KeyForm",
|
|
571
571
|
props: {
|
|
572
572
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
573
573
|
config: {
|
|
574
574
|
type: Object,
|
|
575
575
|
required: !0,
|
|
576
|
-
validator: (
|
|
576
|
+
validator: (o) => !(!o || !["konnect", "kongManager"].includes(o == null ? void 0 : o.app) || o.app === "konnect" && !o.controlPlaneId || o.app === "kongManager" && typeof o.workspace != "string" || !o.cancelRoute)
|
|
577
577
|
},
|
|
578
578
|
/** If a valid Key ID is provided, it will put the form in Edit mode instead of Create */
|
|
579
579
|
keyId: {
|
|
580
580
|
type: String,
|
|
581
581
|
required: !1,
|
|
582
|
-
default:
|
|
582
|
+
default: null
|
|
583
583
|
},
|
|
584
584
|
/** Specific the keyset Id if the key entity is a scoped entity [both create and edit form] */
|
|
585
585
|
keySetId: {
|
|
@@ -591,7 +591,7 @@ const be = {
|
|
|
591
591
|
fixedKeySetId: {
|
|
592
592
|
type: String,
|
|
593
593
|
required: !1,
|
|
594
|
-
default:
|
|
594
|
+
default: null
|
|
595
595
|
},
|
|
596
596
|
/** Whether to provide x5t field in key form */
|
|
597
597
|
showx5t: {
|
|
@@ -601,9 +601,9 @@ const be = {
|
|
|
601
601
|
}
|
|
602
602
|
},
|
|
603
603
|
emits: ["update", "error", "loading"],
|
|
604
|
-
setup(
|
|
605
|
-
var
|
|
606
|
-
const _ = q, t =
|
|
604
|
+
setup(o, { emit: q }) {
|
|
605
|
+
var se;
|
|
606
|
+
const _ = q, t = o, c = Ee(), { i18n: { t: d } } = he.useI18n(), { getMessageFromError: x } = He(), { axiosInstance: O } = ve((se = t.config) == null ? void 0 : se.axiosRequestConfig), z = h(() => t.keySetId ? P.form[t.config.app].edit.forKeySet.replace(/{keySetId}/gi, t.keySetId) : P.form[t.config.app].edit.all), K = h(() => t.keyId ? te.Edit : te.Create), e = Se({
|
|
607
607
|
fields: {
|
|
608
608
|
/**
|
|
609
609
|
* Generates a unique key name using the current timestamp.
|
|
@@ -611,7 +611,7 @@ const be = {
|
|
|
611
611
|
*
|
|
612
612
|
* Example output: "new-key-20250307123045789"
|
|
613
613
|
*/
|
|
614
|
-
name:
|
|
614
|
+
name: K.value === te.Create ? `new-key-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}` : "",
|
|
615
615
|
tags: "",
|
|
616
616
|
key_id: "",
|
|
617
617
|
key_format: "jwk",
|
|
@@ -623,7 +623,7 @@ const be = {
|
|
|
623
623
|
},
|
|
624
624
|
isReadonly: !1,
|
|
625
625
|
errorMessage: ""
|
|
626
|
-
}),
|
|
626
|
+
}), $ = Se({
|
|
627
627
|
name: "",
|
|
628
628
|
tags: "",
|
|
629
629
|
key_id: "",
|
|
@@ -641,41 +641,41 @@ const be = {
|
|
|
641
641
|
label: d("keys.form.fields.key_format.options.pem"),
|
|
642
642
|
value: "pem"
|
|
643
643
|
}
|
|
644
|
-
], B = h(() => e.isReadonly ||
|
|
645
|
-
|
|
646
|
-
|
|
644
|
+
], B = h(() => e.isReadonly || K.value === te.Create && !!t.fixedKeySetId), L = h(() => !B.value);
|
|
645
|
+
le(() => t.fixedKeySetId, (a) => {
|
|
646
|
+
K.value === te.Create && (e.fields.key_set = a ?? "");
|
|
647
647
|
}, { immediate: !0 });
|
|
648
|
-
const
|
|
648
|
+
const R = h(() => JSON.stringify(e.fields) !== JSON.stringify($) && !!e.fields.key_id && !!e.fields.key_format && (e.fields.key_format === "jwk" && !!e.fields.jwk || e.fields.key_format === "pem" && !!e.fields.private_key && !!e.fields.public_key)), X = (a) => {
|
|
649
649
|
var r, v, I, s;
|
|
650
|
-
e.fields.key_id = (
|
|
650
|
+
e.fields.key_id = (a == null ? void 0 : a.kid) || "", e.fields.name = (a == null ? void 0 : a.name) || "", e.fields.tags = ((r = a == null ? void 0 : a.tags) == null ? void 0 : r.join(", ")) || "", e.fields.key_set = ((v = a == null ? void 0 : a.set) == null ? void 0 : v.id) || "", e.fields.key_format = a != null && a.pem ? "pem" : "jwk", e.fields.jwk = (a == null ? void 0 : a.jwk) || "", e.fields.private_key = ((I = a == null ? void 0 : a.pem) == null ? void 0 : I.private_key) || "", e.fields.public_key = ((s = a == null ? void 0 : a.pem) == null ? void 0 : s.public_key) || "", t.showx5t && (e.fields.x5t = (a == null ? void 0 : a.x5t) || ""), Object.assign($, e.fields);
|
|
651
651
|
}, H = () => {
|
|
652
652
|
c.push(t.config.cancelRoute);
|
|
653
653
|
}, y = h(() => {
|
|
654
654
|
var r, v;
|
|
655
|
-
let
|
|
656
|
-
return t.config.app === "konnect"
|
|
655
|
+
let a = `${t.config.apiBaseUrl}${P.form[t.config.app][K.value][t.keySetId ? "forKeySet" : "all"]}`;
|
|
656
|
+
return t.config.app === "konnect" && (a = a.replace(/{controlPlaneId}/gi, ((r = t.config) == null ? void 0 : r.controlPlaneId) || "")), a.replace(/\/{workspace}/gi, (v = t.config) != null && v.workspace ? `/${t.config.workspace}` : "").replace(/{id}/gi, t.keyId ?? "").replace(/{keySetId}/gi, t.keySetId || "");
|
|
657
657
|
}), m = h(() => {
|
|
658
|
-
var
|
|
658
|
+
var a, r, v;
|
|
659
659
|
return {
|
|
660
660
|
kid: e.fields.key_id,
|
|
661
661
|
...t.showx5t ? { x5t: e.fields.x5t || null } : {},
|
|
662
662
|
name: e.fields.name || null,
|
|
663
|
-
tags: ((v = (r = (
|
|
663
|
+
tags: ((v = (r = (a = e.fields.tags) == null ? void 0 : a.split(",")) == null ? void 0 : r.map((I) => String(I || "").trim())) == null ? void 0 : v.filter((I) => I !== "")) || [],
|
|
664
664
|
set: e.fields.key_set ? { id: e.fields.key_set } : null,
|
|
665
665
|
jwk: e.fields.key_format === "jwk" ? e.fields.jwk : null,
|
|
666
666
|
pem: e.fields.key_format === "pem" ? { private_key: e.fields.private_key, public_key: e.fields.public_key } : null
|
|
667
667
|
};
|
|
668
668
|
}), j = async () => {
|
|
669
|
-
var
|
|
669
|
+
var a, r, v, I, s;
|
|
670
670
|
try {
|
|
671
671
|
e.isReadonly = !0;
|
|
672
672
|
let i;
|
|
673
|
-
if (
|
|
673
|
+
if (K.value === "create" ? i = await O.post(y.value, m.value) : K.value === "edit" && (i = ((a = t.config) == null ? void 0 : a.app) === "konnect" ? await O.put(y.value, m.value) : await O.patch(y.value, m.value)), i) {
|
|
674
674
|
const { data: n } = i;
|
|
675
|
-
e.fields.key_id = (n == null ? void 0 : n.kid) || "", e.fields.name = (n == null ? void 0 : n.name) || "", e.fields.tags = ((r = n == null ? void 0 : n.tags) == null ? void 0 : r.join(", ")) || "", e.fields.key_set = ((v = n == null ? void 0 : n.set) == null ? void 0 : v.id) || "", e.fields.key_format = n != null && n.pem ? "pem" : "jwk", e.fields.jwk = (n == null ? void 0 : n.jwk) || "", e.fields.private_key = ((I = n == null ? void 0 : n.pem) == null ? void 0 : I.private_key) || "", e.fields.public_key = ((s = n == null ? void 0 : n.pem) == null ? void 0 : s.public_key) || "", t.showx5t && (e.fields.x5t = (n == null ? void 0 : n.x5t) || ""), Object.assign(
|
|
675
|
+
e.fields.key_id = (n == null ? void 0 : n.kid) || "", e.fields.name = (n == null ? void 0 : n.name) || "", e.fields.tags = ((r = n == null ? void 0 : n.tags) == null ? void 0 : r.join(", ")) || "", e.fields.key_set = ((v = n == null ? void 0 : n.set) == null ? void 0 : v.id) || "", e.fields.key_format = n != null && n.pem ? "pem" : "jwk", e.fields.jwk = (n == null ? void 0 : n.jwk) || "", e.fields.private_key = ((I = n == null ? void 0 : n.pem) == null ? void 0 : I.private_key) || "", e.fields.public_key = ((s = n == null ? void 0 : n.pem) == null ? void 0 : s.public_key) || "", t.showx5t && (e.fields.x5t = (n == null ? void 0 : n.x5t) || ""), Object.assign($, e.fields), _("update", i == null ? void 0 : i.data);
|
|
676
676
|
}
|
|
677
677
|
} catch (i) {
|
|
678
|
-
e.errorMessage =
|
|
678
|
+
e.errorMessage = x(i), _("error", i);
|
|
679
679
|
} finally {
|
|
680
680
|
e.isReadonly = !1;
|
|
681
681
|
}
|
|
@@ -683,62 +683,62 @@ const be = {
|
|
|
683
683
|
debouncedQueryChange: g,
|
|
684
684
|
loading: S,
|
|
685
685
|
allRecords: k,
|
|
686
|
-
error:
|
|
687
|
-
validationError:
|
|
688
|
-
loadItems:
|
|
689
|
-
results:
|
|
686
|
+
error: ie,
|
|
687
|
+
validationError: re,
|
|
688
|
+
loadItems: de,
|
|
689
|
+
results: ce
|
|
690
690
|
} = Qe(t.config, P.form[t.config.app].keySets, void 0, {
|
|
691
691
|
fetchedItemsKey: "data",
|
|
692
692
|
searchKeys: ["id", "name"]
|
|
693
|
-
}),
|
|
694
|
-
(!
|
|
695
|
-
}, ue = h(() =>
|
|
693
|
+
}), ye = (a) => {
|
|
694
|
+
(!a || a !== e.fields.key_set && a !== $.key_set) && g(a);
|
|
695
|
+
}, ue = h(() => ie.value ? d("keys.errors.key_sets.fetch") : ""), M = h(() => re.value ? d("keys.errors.key_sets.invalid") : ""), Q = w(0), G = h(() => k.value === void 0), oe = h(() => {
|
|
696
696
|
if (G.value)
|
|
697
697
|
return t.config.app === "konnect" ? d("keys.form.fields.key_set.footer") : void 0;
|
|
698
|
-
}), Y = w(/* @__PURE__ */ new Set()),
|
|
698
|
+
}), Y = w(/* @__PURE__ */ new Set()), ae = h(() => Array.from(Y.value).map((r) => ({
|
|
699
699
|
name: r.name || "",
|
|
700
700
|
// can't use name for label or it tries to search => 404
|
|
701
701
|
label: "",
|
|
702
702
|
// leave it blank so no flicker when used with selected-item-template
|
|
703
703
|
value: r.id,
|
|
704
704
|
selected: e.fields.key_set === r.id
|
|
705
|
-
}))),
|
|
705
|
+
}))), fe = (a) => {
|
|
706
706
|
Y.value.clear();
|
|
707
707
|
let r;
|
|
708
|
-
for (r of
|
|
708
|
+
for (r of a)
|
|
709
709
|
Y.value.add(r);
|
|
710
710
|
};
|
|
711
|
-
return
|
|
712
|
-
|
|
713
|
-
}, { immediate: !0, deep: !0 }),
|
|
711
|
+
return le(ce, (a) => {
|
|
712
|
+
fe(a);
|
|
713
|
+
}, { immediate: !0, deep: !0 }), le(ae, () => {
|
|
714
714
|
Q.value++;
|
|
715
715
|
}, { immediate: !0, deep: !0 }), je(async () => {
|
|
716
|
-
await
|
|
717
|
-
}), (
|
|
716
|
+
await de();
|
|
717
|
+
}), (a, r) => {
|
|
718
718
|
const v = F("KInput"), I = F("KSelect"), s = F("KTextArea");
|
|
719
|
-
return b(), W("div",
|
|
720
|
-
|
|
721
|
-
"can-submit":
|
|
722
|
-
config:
|
|
723
|
-
"edit-id":
|
|
719
|
+
return b(), W("div", at, [
|
|
720
|
+
u(l(Ge), {
|
|
721
|
+
"can-submit": R.value,
|
|
722
|
+
config: o.config,
|
|
723
|
+
"edit-id": o.keyId,
|
|
724
724
|
"entity-type": l(Ve).Key,
|
|
725
725
|
"error-message": e.errorMessage || ue.value,
|
|
726
726
|
"fetch-url": z.value,
|
|
727
727
|
"form-fields": m.value,
|
|
728
728
|
"is-readonly": e.isReadonly,
|
|
729
729
|
onCancel: H,
|
|
730
|
-
"onFetch:error": r[9] || (r[9] = (i) =>
|
|
730
|
+
"onFetch:error": r[9] || (r[9] = (i) => a.$emit("error", i)),
|
|
731
731
|
"onFetch:success": X,
|
|
732
|
-
onLoading: r[10] || (r[10] = (i) =>
|
|
732
|
+
onLoading: r[10] || (r[10] = (i) => a.$emit("loading", i)),
|
|
733
733
|
onSubmit: j
|
|
734
734
|
}, {
|
|
735
|
-
default:
|
|
736
|
-
|
|
735
|
+
default: f(() => [
|
|
736
|
+
u(l(Ke), {
|
|
737
737
|
description: l(d)("keys.form.sections.general.description"),
|
|
738
738
|
title: l(d)("keys.form.sections.general.title")
|
|
739
739
|
}, {
|
|
740
|
-
default:
|
|
741
|
-
|
|
740
|
+
default: f(() => [
|
|
741
|
+
u(v, {
|
|
742
742
|
modelValue: e.fields.key_id,
|
|
743
743
|
"onUpdate:modelValue": r[0] || (r[0] = (i) => e.fields.key_id = i),
|
|
744
744
|
modelModifiers: { trim: !0 },
|
|
@@ -755,7 +755,7 @@ const be = {
|
|
|
755
755
|
required: "",
|
|
756
756
|
type: "text"
|
|
757
757
|
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"]),
|
|
758
|
-
|
|
758
|
+
o.showx5t ? (b(), V(v, {
|
|
759
759
|
key: 0,
|
|
760
760
|
modelValue: e.fields.x5t,
|
|
761
761
|
"onUpdate:modelValue": r[1] || (r[1] = (i) => e.fields.x5t = i),
|
|
@@ -772,7 +772,7 @@ const be = {
|
|
|
772
772
|
readonly: e.isReadonly,
|
|
773
773
|
type: "text"
|
|
774
774
|
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])) : J("", !0),
|
|
775
|
-
|
|
775
|
+
u(v, {
|
|
776
776
|
modelValue: e.fields.name,
|
|
777
777
|
"onUpdate:modelValue": r[2] || (r[2] = (i) => e.fields.name = i),
|
|
778
778
|
modelModifiers: { trim: !0 },
|
|
@@ -783,7 +783,7 @@ const be = {
|
|
|
783
783
|
readonly: e.isReadonly,
|
|
784
784
|
type: "text"
|
|
785
785
|
}, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
|
|
786
|
-
|
|
786
|
+
u(I, {
|
|
787
787
|
modelValue: e.fields.key_set,
|
|
788
788
|
"onUpdate:modelValue": r[3] || (r[3] = (i) => e.fields.key_set = i),
|
|
789
789
|
clearable: L.value,
|
|
@@ -791,24 +791,24 @@ const be = {
|
|
|
791
791
|
"dropdown-footer-text": oe.value,
|
|
792
792
|
"enable-filtering": "",
|
|
793
793
|
"filter-function": () => !0,
|
|
794
|
-
items:
|
|
794
|
+
items: ae.value,
|
|
795
795
|
label: l(d)("keys.form.fields.key_set.label"),
|
|
796
796
|
loading: l(S),
|
|
797
797
|
placeholder: l(d)("keys.form.fields.key_set.placeholder"),
|
|
798
798
|
readonly: B.value,
|
|
799
799
|
width: "100%",
|
|
800
|
-
onQueryChange:
|
|
800
|
+
onQueryChange: ye
|
|
801
801
|
}, {
|
|
802
|
-
loading:
|
|
802
|
+
loading: f(() => [
|
|
803
803
|
D("div", null, C(l(d)("keys.actions.loading")), 1)
|
|
804
804
|
]),
|
|
805
|
-
empty:
|
|
805
|
+
empty: f(() => [
|
|
806
806
|
D("div", st, C(l(d)("keys.search.no_results")), 1)
|
|
807
807
|
]),
|
|
808
|
-
"selected-item-template":
|
|
808
|
+
"selected-item-template": f(({ item: i }) => [
|
|
809
809
|
D("div", null, C(i.name), 1)
|
|
810
810
|
]),
|
|
811
|
-
"item-template":
|
|
811
|
+
"item-template": f(({ item: i }) => [
|
|
812
812
|
D("div", nt, [
|
|
813
813
|
D("div", rt, C(i.name), 1),
|
|
814
814
|
D("div", dt, C(i.value), 1)
|
|
@@ -816,8 +816,8 @@ const be = {
|
|
|
816
816
|
]),
|
|
817
817
|
_: 1
|
|
818
818
|
}, 8, ["modelValue", "clearable", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly"]),
|
|
819
|
-
|
|
820
|
-
|
|
819
|
+
M.value ? (b(), W("p", ct, C(M.value), 1)) : J("", !0),
|
|
820
|
+
u(v, {
|
|
821
821
|
modelValue: e.fields.tags,
|
|
822
822
|
"onUpdate:modelValue": r[4] || (r[4] = (i) => e.fields.tags = i),
|
|
823
823
|
modelModifiers: { trim: !0 },
|
|
@@ -836,14 +836,14 @@ const be = {
|
|
|
836
836
|
]),
|
|
837
837
|
_: 1
|
|
838
838
|
}, 8, ["description", "title"]),
|
|
839
|
-
|
|
839
|
+
u(l(Ke), {
|
|
840
840
|
description: l(d)("keys.form.sections.keys.description"),
|
|
841
841
|
"has-divider": "",
|
|
842
842
|
title: l(d)("keys.form.sections.keys.title")
|
|
843
843
|
}, {
|
|
844
|
-
default:
|
|
844
|
+
default: f(() => [
|
|
845
845
|
D("div", yt, [
|
|
846
|
-
|
|
846
|
+
u(I, {
|
|
847
847
|
modelValue: e.fields.key_format,
|
|
848
848
|
"onUpdate:modelValue": r[5] || (r[5] = (i) => e.fields.key_format = i),
|
|
849
849
|
"data-testid": "key-form-key-format",
|
|
@@ -906,14 +906,14 @@ const be = {
|
|
|
906
906
|
]);
|
|
907
907
|
};
|
|
908
908
|
}
|
|
909
|
-
}), _t = /* @__PURE__ */
|
|
909
|
+
}), _t = /* @__PURE__ */ Re(ut, [["__scopeId", "data-v-e35f7792"]]), ft = { class: "kong-ui-entities-keys-entity-config-card" }, kt = { key: 2 }, St = /* @__PURE__ */ ge({
|
|
910
910
|
__name: "KeyConfigCard",
|
|
911
911
|
props: {
|
|
912
912
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
913
913
|
config: {
|
|
914
914
|
type: Object,
|
|
915
915
|
required: !0,
|
|
916
|
-
validator: (
|
|
916
|
+
validator: (o) => !(!o || !["konnect", "kongManager"].includes(o == null ? void 0 : o.app) || o.app === "konnect" && !o.controlPlaneId || o.app === "kongManager" && typeof o.workspace != "string" || !o.entityId)
|
|
917
917
|
},
|
|
918
918
|
/**
|
|
919
919
|
* External link for documentation that determines visibility of Documentation button
|
|
@@ -939,21 +939,21 @@ const be = {
|
|
|
939
939
|
}
|
|
940
940
|
},
|
|
941
941
|
emits: ["loading", "fetch:error", "fetch:success", "navigation-click"],
|
|
942
|
-
setup(
|
|
942
|
+
setup(o, { emit: q }) {
|
|
943
943
|
var H;
|
|
944
|
-
const _ = q, t =
|
|
944
|
+
const _ = q, t = o, { axiosInstance: c } = ve((H = t.config) == null ? void 0 : H.axiosRequestConfig), { convertKeyToTitle: d } = ze(), { i18n: { t: x } } = he.useI18n(), O = h(() => t.keySetId ? `${P.form[t.config.app].edit.forKeySet}`.replace(/{keySetId}/gi, t.keySetId) : P.form[t.config.app].edit.all), z = h(() => {
|
|
945
945
|
var y;
|
|
946
946
|
return (y = P.form[t.config.app]) == null ? void 0 : y.getKeySet;
|
|
947
|
-
}),
|
|
947
|
+
}), K = w(), e = w({}), $ = w(t.keySetId || ""), T = w(""), B = w(!1), L = async (y) => {
|
|
948
948
|
var m;
|
|
949
|
-
|
|
949
|
+
K.value = y, $.value = (m = y == null ? void 0 : y.set) == null ? void 0 : m.id, _("fetch:success", y), R(y);
|
|
950
950
|
};
|
|
951
|
-
|
|
951
|
+
le($, async () => {
|
|
952
952
|
var m, j;
|
|
953
|
-
if (
|
|
953
|
+
if (!$.value)
|
|
954
954
|
return;
|
|
955
955
|
let y = `${t.config.apiBaseUrl}${z.value}`;
|
|
956
|
-
t.config.app === "konnect"
|
|
956
|
+
t.config.app === "konnect" && (y = y.replace(/{controlPlaneId}/gi, ((m = t.config) == null ? void 0 : m.controlPlaneId) || "")), y = y.replace(/\/{workspace}/gi, (j = t.config) != null && j.workspace ? `/${t.config.workspace}` : "").replace(/{keySetId}/gi, $.value || "");
|
|
957
957
|
try {
|
|
958
958
|
B.value = !0;
|
|
959
959
|
const { data: g } = await c.get(y, {
|
|
@@ -967,7 +967,7 @@ const be = {
|
|
|
967
967
|
B.value = !1;
|
|
968
968
|
}
|
|
969
969
|
}, { immediate: !0 });
|
|
970
|
-
const
|
|
970
|
+
const R = (y) => {
|
|
971
971
|
var m, j;
|
|
972
972
|
try {
|
|
973
973
|
if (y.jwk) {
|
|
@@ -990,70 +990,70 @@ const be = {
|
|
|
990
990
|
}, X = w({
|
|
991
991
|
id: {},
|
|
992
992
|
name: {
|
|
993
|
-
tooltip:
|
|
993
|
+
tooltip: x("keys.form.fields.name.tooltip")
|
|
994
994
|
},
|
|
995
995
|
last_updated: {},
|
|
996
996
|
created: {},
|
|
997
997
|
set: {
|
|
998
|
-
label:
|
|
999
|
-
section:
|
|
1000
|
-
tooltip:
|
|
998
|
+
label: x("keys.form.fields.set.label"),
|
|
999
|
+
section: pe.Basic,
|
|
1000
|
+
tooltip: x("keys.form.fields.set.tooltip"),
|
|
1001
1001
|
order: 5
|
|
1002
1002
|
},
|
|
1003
1003
|
kid: {
|
|
1004
|
-
label:
|
|
1005
|
-
section:
|
|
1006
|
-
tooltip:
|
|
1004
|
+
label: x("keys.form.fields.kid.label"),
|
|
1005
|
+
section: pe.Basic,
|
|
1006
|
+
tooltip: x("keys.form.fields.kid.tooltip")
|
|
1007
1007
|
},
|
|
1008
1008
|
tags: {
|
|
1009
|
-
tooltip:
|
|
1009
|
+
tooltip: x("keys.form.fields.tags.tooltip")
|
|
1010
1010
|
},
|
|
1011
1011
|
// advanced fields
|
|
1012
1012
|
jwk: {
|
|
1013
|
-
label:
|
|
1014
|
-
type:
|
|
1013
|
+
label: x("keys.form.fields.jwk.label"),
|
|
1014
|
+
type: ke.Json
|
|
1015
1015
|
},
|
|
1016
1016
|
pem: {
|
|
1017
|
-
section:
|
|
1018
|
-
label:
|
|
1019
|
-
type:
|
|
1017
|
+
section: pe.Advanced,
|
|
1018
|
+
label: x("keys.form.fields.key_format.options.pem"),
|
|
1019
|
+
type: ke.Json
|
|
1020
1020
|
}
|
|
1021
1021
|
});
|
|
1022
1022
|
return (y, m) => {
|
|
1023
1023
|
var g, S;
|
|
1024
1024
|
const j = F("KSkeleton");
|
|
1025
|
-
return b(), W("div",
|
|
1026
|
-
|
|
1027
|
-
config:
|
|
1028
|
-
"config-card-doc":
|
|
1025
|
+
return b(), W("div", ft, [
|
|
1026
|
+
u(l(Xe), {
|
|
1027
|
+
config: o.config,
|
|
1028
|
+
"config-card-doc": o.configCardDoc,
|
|
1029
1029
|
"config-schema": X.value,
|
|
1030
1030
|
"entity-type": l(Ve).Key,
|
|
1031
1031
|
"fetch-url": O.value,
|
|
1032
|
-
"hide-title":
|
|
1032
|
+
"hide-title": o.hideTitle,
|
|
1033
1033
|
"onFetch:error": m[0] || (m[0] = (k) => y.$emit("fetch:error", k)),
|
|
1034
1034
|
"onFetch:success": L,
|
|
1035
1035
|
onLoading: m[1] || (m[1] = (k) => y.$emit("loading", k))
|
|
1036
|
-
},
|
|
1037
|
-
set:
|
|
1036
|
+
}, me({
|
|
1037
|
+
set: f(({ row: k }) => [
|
|
1038
1038
|
B.value ? (b(), V(j, {
|
|
1039
1039
|
key: 0,
|
|
1040
1040
|
"data-testid": "key-set-name-loader",
|
|
1041
1041
|
type: "spinner"
|
|
1042
|
-
})) : k.value && k.value.id ===
|
|
1042
|
+
})) : k.value && k.value.id === $.value && T.value ? (b(), V(l(Ye), {
|
|
1043
1043
|
key: 1,
|
|
1044
1044
|
item: {
|
|
1045
1045
|
key: k.value.id,
|
|
1046
1046
|
value: T.value,
|
|
1047
|
-
type: l(
|
|
1047
|
+
type: l(ke).LinkInternal
|
|
1048
1048
|
},
|
|
1049
|
-
onClick: (
|
|
1049
|
+
onClick: (ie) => y.$emit("navigation-click", k.value.id, "key-sets")
|
|
1050
1050
|
}, null, 8, ["item", "onClick"])) : (b(), W("div", kt, C("–")))
|
|
1051
1051
|
]),
|
|
1052
1052
|
_: 2
|
|
1053
1053
|
}, [
|
|
1054
|
-
(g =
|
|
1054
|
+
(g = K.value) != null && g.jwk ? {
|
|
1055
1055
|
name: "jwk",
|
|
1056
|
-
fn:
|
|
1056
|
+
fn: f(() => [
|
|
1057
1057
|
(b(!0), W(we, null, Ie(Object.keys(e.value), (k) => (b(), V(l($e), {
|
|
1058
1058
|
key: k,
|
|
1059
1059
|
"data-testid": `${k}`,
|
|
@@ -1066,9 +1066,9 @@ const be = {
|
|
|
1066
1066
|
]),
|
|
1067
1067
|
key: "0"
|
|
1068
1068
|
} : void 0,
|
|
1069
|
-
(S =
|
|
1069
|
+
(S = K.value) != null && S.pem ? {
|
|
1070
1070
|
name: "pem",
|
|
1071
|
-
fn:
|
|
1071
|
+
fn: f(() => [
|
|
1072
1072
|
(b(!0), W(we, null, Ie(Object.keys(e.value), (k) => (b(), V(l($e), {
|
|
1073
1073
|
key: k,
|
|
1074
1074
|
"data-testid": `${k}`,
|