@kong-ui-public/entities-gateway-services 3.13.19-pr.2622.53734b6ee.0 → 3.13.19-pr.2629.710b72605.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Be, ref as
|
|
1
|
+
import { defineComponent as Be, ref as x, computed as k, watch as Me, onBeforeMount as He, resolveComponent as D, createElementBlock as T, openBlock as C, createVNode as n, unref as o, createSlots as ke, withCtx as d, createTextVNode as R, toDisplayString as h, createElementVNode as E, withModifiers as Ue, createBlock as de, Teleport as Ze, createCommentVNode as B, reactive as De, onMounted as Je, Transition as $e, Fragment as Qe, renderList as Xe, renderSlot as Ye } from "vue";
|
|
2
2
|
import { useRouter as Ne } from "vue-router";
|
|
3
3
|
import { BookIcon as Ke, AddIcon as Le, ServicesIcon as et } from "@kong/icons";
|
|
4
4
|
import { createI18n as tt, i18nTComponent as ot } from "@kong-ui-public/i18n";
|
|
@@ -232,11 +232,11 @@ function Et() {
|
|
|
232
232
|
}
|
|
233
233
|
function Pt() {
|
|
234
234
|
return {
|
|
235
|
-
getPortFromProtocol: (
|
|
235
|
+
getPortFromProtocol: (G, p) => {
|
|
236
236
|
const c = [80, 443], a = Number(p);
|
|
237
237
|
if ((a || a === 0) && !c.includes(a))
|
|
238
238
|
return a;
|
|
239
|
-
switch (
|
|
239
|
+
switch (G) {
|
|
240
240
|
case "grpcs":
|
|
241
241
|
case "tls":
|
|
242
242
|
case "https":
|
|
@@ -253,7 +253,7 @@ function Pt() {
|
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
255
|
function It() {
|
|
256
|
-
const { i18n: { t: s } } =
|
|
256
|
+
const { i18n: { t: s } } = Y.useI18n();
|
|
257
257
|
return {
|
|
258
258
|
validateHost: (m) => {
|
|
259
259
|
if (!m || m.trim() === "") return s("gateway_services.form.errors.host.empty");
|
|
@@ -272,7 +272,7 @@ function It() {
|
|
|
272
272
|
}
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
|
-
const
|
|
275
|
+
const Y = {
|
|
276
276
|
useI18n: Et,
|
|
277
277
|
usePortFromProtocol: Pt,
|
|
278
278
|
useUrlValidators: It
|
|
@@ -345,9 +345,9 @@ const X = {
|
|
|
345
345
|
}
|
|
346
346
|
},
|
|
347
347
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success"],
|
|
348
|
-
setup(s, { emit:
|
|
348
|
+
setup(s, { emit: G }) {
|
|
349
349
|
var be;
|
|
350
|
-
const p =
|
|
350
|
+
const p = G, c = s, { i18n: { t: a, formatUnixTimeStamp: m } } = Y.useI18n(), F = Ne(), { axiosInstance: L } = We((be = c.config) == null ? void 0 : be.axiosRequestConfig), { hasRecords: l, handleStateChange: K } = rt(() => W.value), P = k(() => l.value && c.config.app === "konnect"), Ce = k(() => c.config.app !== "kongManager" || !!c.config.disableSorting), le = {
|
|
351
351
|
// the Name column is non-hidable
|
|
352
352
|
name: { label: a("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
353
353
|
...c.config.showControlPlaneColumn ? { control_plane: { label: a("gateway_services.list.table_headers.control_plane") } } : {},
|
|
@@ -363,61 +363,64 @@ const X = {
|
|
|
363
363
|
columnVisibility: {
|
|
364
364
|
created_at: !1
|
|
365
365
|
}
|
|
366
|
-
}, fe = le,
|
|
366
|
+
}, fe = le, ee = k(() => {
|
|
367
367
|
var v, g;
|
|
368
368
|
let u = `${c.config.apiBaseUrl}${Ve.list[c.config.app].all}`;
|
|
369
369
|
return c.config.app === "konnect" ? u = u.replace(/{controlPlaneId}/gi, ((v = c.config) == null ? void 0 : v.controlPlaneId) || "") : c.config.app === "kongManager" && (u = u.replace(/\/{workspace}/gi, (g = c.config) != null && g.workspace ? `/${c.config.workspace}` : "")), u;
|
|
370
|
-
}), Se = k(() => c.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${
|
|
370
|
+
}), Se = k(() => c.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${ee.value}`) : new URL(ee.value)), W = x(""), H = k(() => {
|
|
371
371
|
const u = c.config.app === "konnect" || c.config.isExactMatch;
|
|
372
372
|
if (u)
|
|
373
373
|
return {
|
|
374
374
|
isExactMatch: u,
|
|
375
375
|
placeholder: a(`search.placeholder.${c.config.app}`)
|
|
376
376
|
};
|
|
377
|
-
const { name: v, enabled: g, protocol: S, host: j, port:
|
|
377
|
+
const { name: v, enabled: g, protocol: S, host: j, port: $, path: A } = le;
|
|
378
378
|
return {
|
|
379
379
|
isExactMatch: u,
|
|
380
|
-
fields: { name: v, enabled: g, protocol: S, host: j, port:
|
|
380
|
+
fields: { name: v, enabled: g, protocol: S, host: j, port: $, path: A },
|
|
381
381
|
schema: c.config.filterSchema
|
|
382
382
|
};
|
|
383
383
|
}), {
|
|
384
384
|
fetcher: Ee,
|
|
385
|
-
fetcherState:
|
|
385
|
+
fetcherState: Z,
|
|
386
386
|
fetcherCacheKey: V
|
|
387
|
-
} = it(k(() => ({ ...c.config, cacheIdentifier: c.cacheIdentifier })),
|
|
387
|
+
} = it(k(() => ({ ...c.config, cacheIdentifier: c.cacheIdentifier })), ee), se = () => {
|
|
388
388
|
W.value = "";
|
|
389
389
|
}, ae = () => {
|
|
390
390
|
V.value++;
|
|
391
|
-
},
|
|
391
|
+
}, te = x(null), e = k(() => ({
|
|
392
392
|
ctaPath: c.config.createRoute,
|
|
393
|
-
ctaText:
|
|
393
|
+
ctaText: re.value ? c.isServerless ? a("actions.serverless_create") : a("actions.create") : void 0,
|
|
394
394
|
message: `${a("gateway_services.list.empty_state.description")}${c.config.additionMessageForEmptyState ? ` ${c.config.additionMessageForEmptyState}` : ""}`,
|
|
395
|
-
title:
|
|
396
|
-
})), b =
|
|
395
|
+
title: re.value ? c.isServerless ? a("gateway_services.list.empty_state.serverless_title") : a("gateway_services.list.empty_state.title") : a("gateway_services.title")
|
|
396
|
+
})), b = x(!1), M = x(null), oe = k(() => {
|
|
397
397
|
const u = {
|
|
398
398
|
action: "disable",
|
|
399
399
|
id: "",
|
|
400
400
|
name: ""
|
|
401
401
|
};
|
|
402
|
-
if (
|
|
403
|
-
const { enabled: v, id: g, name: S } =
|
|
402
|
+
if (M.value) {
|
|
403
|
+
const { enabled: v, id: g, name: S } = M.value;
|
|
404
404
|
u.action = v ? "disable" : "enable", u.id = g, u.name = S || g;
|
|
405
405
|
}
|
|
406
406
|
return u;
|
|
407
407
|
}), pe = (u) => {
|
|
408
|
-
b.value = !0,
|
|
408
|
+
b.value = !0, M.value = u;
|
|
409
409
|
}, me = () => {
|
|
410
|
-
b.value = !1,
|
|
411
|
-
},
|
|
410
|
+
b.value = !1, M.value = null;
|
|
411
|
+
}, J = async () => {
|
|
412
412
|
var S, j;
|
|
413
|
-
if (!await ((S = c.canEdit) == null ? void 0 : S.call(c,
|
|
413
|
+
if (!await ((S = c.canEdit) == null ? void 0 : S.call(c, M.value)) || !M.value)
|
|
414
414
|
return;
|
|
415
|
-
const v = `${Se.value.href}/${
|
|
415
|
+
const v = `${Se.value.href}/${M.value.id}`, g = !M.value.enabled;
|
|
416
416
|
try {
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
417
|
+
const $ = (j = c.config) == null ? void 0 : j.app;
|
|
418
|
+
let A;
|
|
419
|
+
W.value && $ === "konnect" && (A = await L.get(v));
|
|
420
|
+
const { data: z } = $ === "konnect" ? await L.put(v, { ...(A == null ? void 0 : A.data) || M.value, enabled: g }) : await L.patch(v, { ...M.value, enabled: g });
|
|
421
|
+
p("toggle:success", z), M.value.enabled = g;
|
|
422
|
+
} catch ($) {
|
|
423
|
+
p("error", $);
|
|
421
424
|
}
|
|
422
425
|
}, ve = (u) => {
|
|
423
426
|
c.config.getControlPlaneRoute && F.push(c.config.getControlPlaneRoute(u));
|
|
@@ -458,18 +461,18 @@ const X = {
|
|
|
458
461
|
}), Pe = (u) => ({
|
|
459
462
|
label: a("actions.edit"),
|
|
460
463
|
to: c.config.getEditRoute(u)
|
|
461
|
-
}),
|
|
462
|
-
|
|
464
|
+
}), U = x(void 0), O = x(!1), N = x(!1), Q = x(""), Ie = lt(c.config, ee.value), Fe = (u) => {
|
|
465
|
+
U.value = u, O.value = !0, Q.value = "";
|
|
463
466
|
}, ne = () => {
|
|
464
|
-
O.value = !1,
|
|
467
|
+
O.value = !1, U.value = void 0;
|
|
465
468
|
}, Ae = async () => {
|
|
466
469
|
var u, v, g;
|
|
467
|
-
if ((u =
|
|
470
|
+
if ((u = U.value) != null && u.id) {
|
|
468
471
|
N.value = !0;
|
|
469
472
|
try {
|
|
470
|
-
await
|
|
473
|
+
await L.delete(Ie(U.value.id)), p("delete:success", U.value), ne(), V.value++;
|
|
471
474
|
} catch (S) {
|
|
472
|
-
|
|
475
|
+
Q.value = ((g = (v = S.response) == null ? void 0 : v.data) == null ? void 0 : g.message) || S.message || a("errors.delete"), p("error", S);
|
|
473
476
|
} finally {
|
|
474
477
|
N.value = !1;
|
|
475
478
|
}
|
|
@@ -477,29 +480,29 @@ const X = {
|
|
|
477
480
|
}, Te = () => {
|
|
478
481
|
F.push(c.config.createRoute);
|
|
479
482
|
};
|
|
480
|
-
Me(
|
|
483
|
+
Me(Z, (u) => {
|
|
481
484
|
var v, g, S;
|
|
482
485
|
if (u.status === st.Error) {
|
|
483
|
-
|
|
486
|
+
te.value = {
|
|
484
487
|
title: a("errors.general")
|
|
485
|
-
}, (S = (g = (v = u.error) == null ? void 0 : v.response) == null ? void 0 : g.data) != null && S.message && (
|
|
488
|
+
}, (S = (g = (v = u.error) == null ? void 0 : v.response) == null ? void 0 : g.data) != null && S.message && (te.value.message = u.error.response.data.message), p("error", u.error);
|
|
486
489
|
return;
|
|
487
490
|
}
|
|
488
|
-
|
|
491
|
+
te.value = null;
|
|
489
492
|
});
|
|
490
|
-
const
|
|
493
|
+
const re = x(!1);
|
|
491
494
|
return He(async () => {
|
|
492
|
-
|
|
495
|
+
re.value = await c.canCreate();
|
|
493
496
|
}), (u, v) => {
|
|
494
|
-
const g =
|
|
495
|
-
return C(),
|
|
497
|
+
const g = D("KButton"), S = D("KEmptyState"), j = D("KBadge"), $ = D("KInputSwitch"), A = D("KDropdownItem"), z = D("KClipboardProvider");
|
|
498
|
+
return C(), T("div", Ft, [
|
|
496
499
|
n(o(at), {
|
|
497
500
|
"cache-identifier": s.cacheIdentifier,
|
|
498
501
|
"default-table-preferences": ue,
|
|
499
502
|
"disable-sorting": Ce.value,
|
|
500
503
|
"empty-state-options": e.value,
|
|
501
504
|
"enable-entity-actions": "",
|
|
502
|
-
"error-message":
|
|
505
|
+
"error-message": te.value,
|
|
503
506
|
fetcher: o(Ee),
|
|
504
507
|
"fetcher-cache-key": o(V),
|
|
505
508
|
"pagination-type": "offset",
|
|
@@ -509,13 +512,13 @@ const X = {
|
|
|
509
512
|
onClearSearchInput: se,
|
|
510
513
|
"onClick:row": v[4] || (v[4] = (t) => _e(t)),
|
|
511
514
|
onSort: ae,
|
|
512
|
-
onState: o(
|
|
515
|
+
onState: o(K)
|
|
513
516
|
}, ke({
|
|
514
517
|
"toolbar-filter": d(() => [
|
|
515
518
|
n(o(ct), {
|
|
516
519
|
modelValue: W.value,
|
|
517
520
|
"onUpdate:modelValue": v[0] || (v[0] = (t) => W.value = t),
|
|
518
|
-
config:
|
|
521
|
+
config: H.value
|
|
519
522
|
}, null, 8, ["modelValue", "config"])
|
|
520
523
|
]),
|
|
521
524
|
"toolbar-button": d(() => [
|
|
@@ -536,7 +539,7 @@ const X = {
|
|
|
536
539
|
n(o(Ke), { decorative: "" })
|
|
537
540
|
]),
|
|
538
541
|
_: 1
|
|
539
|
-
})) :
|
|
542
|
+
})) : B("", !0),
|
|
540
543
|
n(o(ce), {
|
|
541
544
|
"auth-function": () => s.canCreate()
|
|
542
545
|
}, {
|
|
@@ -549,7 +552,7 @@ const X = {
|
|
|
549
552
|
}, {
|
|
550
553
|
default: d(() => [
|
|
551
554
|
n(o(Le)),
|
|
552
|
-
|
|
555
|
+
R(" " + h(o(a)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
|
|
553
556
|
]),
|
|
554
557
|
_: 1
|
|
555
558
|
}, 8, ["size", "to"])
|
|
@@ -572,10 +575,10 @@ const X = {
|
|
|
572
575
|
onClick: Ue((y) => ve(t.x_meta.cluster_id), ["stop"])
|
|
573
576
|
}, {
|
|
574
577
|
default: d(() => [
|
|
575
|
-
|
|
578
|
+
R(h(t.x_meta.cluster_id), 1)
|
|
576
579
|
]),
|
|
577
580
|
_: 2
|
|
578
|
-
}, 1032, ["tooltip", "onClick"])) : (C(),
|
|
581
|
+
}, 1032, ["tooltip", "onClick"])) : (C(), T("b", Tt, "-"))
|
|
579
582
|
];
|
|
580
583
|
}),
|
|
581
584
|
enabled: d(({ row: t }) => [
|
|
@@ -588,7 +591,7 @@ const X = {
|
|
|
588
591
|
onClick: v[3] || (v[3] = Ue(() => {
|
|
589
592
|
}, ["stop"]))
|
|
590
593
|
}, [
|
|
591
|
-
n(
|
|
594
|
+
n($, {
|
|
592
595
|
modelValue: t.enabled,
|
|
593
596
|
"onUpdate:modelValue": (y) => t.enabled = y,
|
|
594
597
|
"data-testid": `row-${t.id}-toggle-input`,
|
|
@@ -604,34 +607,34 @@ const X = {
|
|
|
604
607
|
n(o(nt), { tags: t }, null, 8, ["tags"])
|
|
605
608
|
]),
|
|
606
609
|
created_at: d(({ rowValue: t }) => [
|
|
607
|
-
|
|
610
|
+
R(h(o(m)(t)), 1)
|
|
608
611
|
]),
|
|
609
612
|
updated_at: d(({ row: t, rowValue: r }) => [
|
|
610
|
-
|
|
613
|
+
R(h(o(m)(r ?? t.created_at)), 1)
|
|
611
614
|
]),
|
|
612
615
|
actions: d(({ row: t }) => [
|
|
613
|
-
n(
|
|
616
|
+
n(z, null, {
|
|
614
617
|
default: d(({ copyToClipboard: r }) => [
|
|
615
|
-
n(
|
|
618
|
+
n(A, {
|
|
616
619
|
"data-testid": "action-entity-copy-id",
|
|
617
620
|
onClick: (y) => ge(t, r)
|
|
618
621
|
}, {
|
|
619
622
|
default: d(() => [
|
|
620
|
-
|
|
623
|
+
R(h(o(a)("actions.copy_id")), 1)
|
|
621
624
|
]),
|
|
622
625
|
_: 1
|
|
623
626
|
}, 8, ["onClick"])
|
|
624
627
|
]),
|
|
625
628
|
_: 2
|
|
626
629
|
}, 1024),
|
|
627
|
-
n(
|
|
630
|
+
n(z, null, {
|
|
628
631
|
default: d(({ copyToClipboard: r }) => [
|
|
629
|
-
n(
|
|
632
|
+
n(A, {
|
|
630
633
|
"data-testid": "action-entity-copy-json",
|
|
631
634
|
onClick: (y) => ye(t, r)
|
|
632
635
|
}, {
|
|
633
636
|
default: d(() => [
|
|
634
|
-
|
|
637
|
+
R(h(o(a)("actions.copy_json")), 1)
|
|
635
638
|
]),
|
|
636
639
|
_: 1
|
|
637
640
|
}, 8, ["onClick"])
|
|
@@ -642,7 +645,7 @@ const X = {
|
|
|
642
645
|
"auth-function": () => s.canRetrieve(t)
|
|
643
646
|
}, {
|
|
644
647
|
default: d(() => [
|
|
645
|
-
n(
|
|
648
|
+
n(A, {
|
|
646
649
|
"data-testid": "action-entity-view",
|
|
647
650
|
"has-divider": "",
|
|
648
651
|
item: he(t.id)
|
|
@@ -654,7 +657,7 @@ const X = {
|
|
|
654
657
|
"auth-function": () => s.canEdit(t)
|
|
655
658
|
}, {
|
|
656
659
|
default: d(() => [
|
|
657
|
-
n(
|
|
660
|
+
n(A, {
|
|
658
661
|
"data-testid": "action-entity-edit",
|
|
659
662
|
item: Pe(t.id)
|
|
660
663
|
}, null, 8, ["item"])
|
|
@@ -665,14 +668,14 @@ const X = {
|
|
|
665
668
|
"auth-function": () => s.canDelete(t)
|
|
666
669
|
}, {
|
|
667
670
|
default: d(() => [
|
|
668
|
-
n(
|
|
671
|
+
n(A, {
|
|
669
672
|
danger: "",
|
|
670
673
|
"data-testid": "action-entity-delete",
|
|
671
674
|
"has-divider": "",
|
|
672
675
|
onClick: (r) => Fe(t)
|
|
673
676
|
}, {
|
|
674
677
|
default: d(() => [
|
|
675
|
-
|
|
678
|
+
R(h(o(a)("actions.delete.menu_label")), 1)
|
|
676
679
|
]),
|
|
677
680
|
_: 1
|
|
678
681
|
}, 8, ["onClick"])
|
|
@@ -697,17 +700,17 @@ const X = {
|
|
|
697
700
|
n(o(et), { decorative: "" })
|
|
698
701
|
]),
|
|
699
702
|
action: d(() => [
|
|
700
|
-
|
|
703
|
+
re.value ? (C(), de(g, {
|
|
701
704
|
key: 0,
|
|
702
705
|
"data-testid": "entity-create-button",
|
|
703
706
|
onClick: Te
|
|
704
707
|
}, {
|
|
705
708
|
default: d(() => [
|
|
706
709
|
n(o(Le), { decorative: "" }),
|
|
707
|
-
|
|
710
|
+
R(" " + h(o(a)("gateway_services.empty_state_v2.create")), 1)
|
|
708
711
|
]),
|
|
709
712
|
_: 1
|
|
710
|
-
})) :
|
|
713
|
+
})) : B("", !0),
|
|
711
714
|
n(g, {
|
|
712
715
|
appearance: "secondary",
|
|
713
716
|
"data-testid": "entity-learn-more-button",
|
|
@@ -715,7 +718,7 @@ const X = {
|
|
|
715
718
|
}, {
|
|
716
719
|
default: d(() => [
|
|
717
720
|
n(o(Ke), { decorative: "" }),
|
|
718
|
-
|
|
721
|
+
R(" " + h(o(a)("gateway_services.empty_state_v2.learn_more")), 1)
|
|
719
722
|
]),
|
|
720
723
|
_: 1
|
|
721
724
|
})
|
|
@@ -725,7 +728,7 @@ const X = {
|
|
|
725
728
|
(t = s.config) != null && t.isControlPlaneGroup ? {
|
|
726
729
|
name: "default",
|
|
727
730
|
fn: d(() => [
|
|
728
|
-
|
|
731
|
+
R(h(o(a)("gateway_services.empty_state_v2.group")), 1)
|
|
729
732
|
]),
|
|
730
733
|
key: "0"
|
|
731
734
|
} : void 0
|
|
@@ -736,11 +739,11 @@ const X = {
|
|
|
736
739
|
} : void 0
|
|
737
740
|
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
|
|
738
741
|
n(o(dt), {
|
|
739
|
-
action:
|
|
740
|
-
"entity-id":
|
|
741
|
-
"entity-name":
|
|
742
|
+
action: oe.value.action,
|
|
743
|
+
"entity-id": oe.value.id,
|
|
744
|
+
"entity-name": oe.value.name,
|
|
742
745
|
"entity-type": o(a)("glossary.gateway_services"),
|
|
743
|
-
"on-confirm":
|
|
746
|
+
"on-confirm": J,
|
|
744
747
|
visible: b.value,
|
|
745
748
|
onCancel: me,
|
|
746
749
|
onProceed: me
|
|
@@ -748,9 +751,9 @@ const X = {
|
|
|
748
751
|
n(o(ut), {
|
|
749
752
|
"action-pending": N.value,
|
|
750
753
|
description: o(a)("actions.delete.description"),
|
|
751
|
-
"entity-name":
|
|
754
|
+
"entity-name": U.value && (U.value.name || U.value.id),
|
|
752
755
|
"entity-type": o(ft).GatewayService,
|
|
753
|
-
error:
|
|
756
|
+
error: Q.value,
|
|
754
757
|
title: o(a)("actions.delete.title"),
|
|
755
758
|
visible: O.value,
|
|
756
759
|
onCancel: ne,
|
|
@@ -759,12 +762,12 @@ const X = {
|
|
|
759
762
|
]);
|
|
760
763
|
};
|
|
761
764
|
}
|
|
762
|
-
}), ze = (s,
|
|
765
|
+
}), ze = (s, G) => {
|
|
763
766
|
const p = s.__vccOpts || s;
|
|
764
|
-
for (const [c, a] of
|
|
767
|
+
for (const [c, a] of G)
|
|
765
768
|
p[c] = a;
|
|
766
769
|
return p;
|
|
767
|
-
}, no = /* @__PURE__ */ ze(Ut, [["__scopeId", "data-v-
|
|
770
|
+
}, no = /* @__PURE__ */ ze(Ut, [["__scopeId", "data-v-4f19984e"]]), $t = { class: "kong-ui-gateway-service-entity-config-card" }, co = /* @__PURE__ */ Be({
|
|
768
771
|
__name: "GatewayServiceConfigCard",
|
|
769
772
|
props: {
|
|
770
773
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -791,7 +794,7 @@ const X = {
|
|
|
791
794
|
},
|
|
792
795
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
793
796
|
setup(s) {
|
|
794
|
-
const
|
|
797
|
+
const G = s, { i18n: { t: p }, i18nT: c } = Y.useI18n(), a = k(() => Ve.form[G.config.app].edit), { getPropValue: m } = Oe(), F = (l, K) => m(l, K) === !0 ? p("gateway_services.form.fields.tls_verify_option.true.display") : p("gateway_services.form.fields.tls_verify_option.false.display"), L = x({
|
|
795
798
|
id: {},
|
|
796
799
|
name: {
|
|
797
800
|
tooltip: p("gateway_services.form.fields.name.tooltip")
|
|
@@ -851,17 +854,17 @@ const X = {
|
|
|
851
854
|
hidden: !0
|
|
852
855
|
}
|
|
853
856
|
});
|
|
854
|
-
return (l,
|
|
857
|
+
return (l, K) => (C(), T("div", $t, [
|
|
855
858
|
n(o(mt), {
|
|
856
859
|
config: s.config,
|
|
857
860
|
"config-card-doc": s.configCardDoc,
|
|
858
|
-
"config-schema":
|
|
861
|
+
"config-schema": L.value,
|
|
859
862
|
"entity-type": o(je).GatewayService,
|
|
860
863
|
"fetch-url": a.value,
|
|
861
864
|
"hide-title": s.hideTitle,
|
|
862
|
-
"onFetch:error":
|
|
863
|
-
"onFetch:success":
|
|
864
|
-
onLoading:
|
|
865
|
+
"onFetch:error": K[0] || (K[0] = (P) => l.$emit("fetch:error", P)),
|
|
866
|
+
"onFetch:success": K[1] || (K[1] = (P) => l.$emit("fetch:success", P)),
|
|
867
|
+
onLoading: K[2] || (K[2] = (P) => l.$emit("loading", P))
|
|
865
868
|
}, {
|
|
866
869
|
"enabled-label-tooltip": d(() => [
|
|
867
870
|
n(o(c), {
|
|
@@ -903,16 +906,16 @@ const X = {
|
|
|
903
906
|
})
|
|
904
907
|
]),
|
|
905
908
|
tls_verify: d((P) => [
|
|
906
|
-
|
|
909
|
+
R(h(typeof o(m)("rowValue", P) == "boolean" ? F("rowValue", P) : o(p)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
|
|
907
910
|
]),
|
|
908
911
|
client_certificate: d((P) => [
|
|
909
|
-
|
|
912
|
+
R(h(o(m)("rowValue", P) ? o(m)("rowValue", P).id : "–"), 1)
|
|
910
913
|
]),
|
|
911
914
|
_: 1
|
|
912
915
|
}, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
|
|
913
916
|
]));
|
|
914
917
|
}
|
|
915
|
-
}),
|
|
918
|
+
}), q = {
|
|
916
919
|
name: "Kong-Air-Flights-API",
|
|
917
920
|
protocol: "https",
|
|
918
921
|
path: "/flights",
|
|
@@ -974,9 +977,9 @@ const X = {
|
|
|
974
977
|
}
|
|
975
978
|
},
|
|
976
979
|
emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated", "try-sample-api"],
|
|
977
|
-
setup(s, { expose:
|
|
978
|
-
var
|
|
979
|
-
const c = p, a = s, m =
|
|
980
|
+
setup(s, { expose: G, emit: p }) {
|
|
981
|
+
var z;
|
|
982
|
+
const c = p, a = s, m = x(!0), F = Ne(), { i18nT: L, i18n: { t: l } } = Y.useI18n(), { getErrorFieldsFromError: K } = vt(), { axiosInstance: P } = We((z = a.config) == null ? void 0 : z.axiosRequestConfig), Ce = gt(), { validateHost: le, validatePath: ue, validatePort: fe, validateProtocol: ee } = Y.useUrlValidators(), { objectsAreEqual: Se } = Oe(), W = k(() => Ve.form[a.config.app].edit), H = k(() => a.gatewayServiceId ? qe.Edit : qe.Create), Ee = x(!1), Z = k(() => !!a.gatewayServiceId), V = x(Z.value ? "protocol" : "url"), se = Y.usePortFromProtocol(), ae = x(""), te = k(() => !!ae.value || !!U("name")), e = De({
|
|
980
983
|
fields: {
|
|
981
984
|
name: "",
|
|
982
985
|
protocol: "http",
|
|
@@ -1030,13 +1033,13 @@ const X = {
|
|
|
1030
1033
|
tls_verify_value: !1,
|
|
1031
1034
|
tags: "",
|
|
1032
1035
|
enabled: !0
|
|
1033
|
-
}),
|
|
1036
|
+
}), M = a.config.app === "konnect" || yt({
|
|
1034
1037
|
gatewayInfo: a.config.gatewayInfo,
|
|
1035
1038
|
// 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
|
|
1036
1039
|
supportedRange: {
|
|
1037
1040
|
enterprise: ["3.0"]
|
|
1038
1041
|
}
|
|
1039
|
-
}),
|
|
1042
|
+
}), oe = [
|
|
1040
1043
|
{
|
|
1041
1044
|
label: l("gateway_services.form.fields.protocol.options.http"),
|
|
1042
1045
|
value: "http",
|
|
@@ -1072,7 +1075,7 @@ const X = {
|
|
|
1072
1075
|
value: "grpcs",
|
|
1073
1076
|
group: "grpc"
|
|
1074
1077
|
},
|
|
1075
|
-
...
|
|
1078
|
+
...M ? [
|
|
1076
1079
|
{
|
|
1077
1080
|
label: l("gateway_services.form.fields.protocol.options.ws"),
|
|
1078
1081
|
value: "ws",
|
|
@@ -1091,25 +1094,25 @@ const X = {
|
|
|
1091
1094
|
}
|
|
1092
1095
|
], pe = { url: "url", protocol: "protocol" }, me = (t) => {
|
|
1093
1096
|
e.fields.protocol = t.value, e.fields.port = se.getPortFromProtocol(e.fields.protocol, String(e.fields.port));
|
|
1094
|
-
},
|
|
1097
|
+
}, J = (t) => t ? parseFloat(t) : 0, ve = () => {
|
|
1095
1098
|
e.fields.host = b.host, e.fields.path = b.path, e.fields.port = b.port, e.fields.protocol = b.protocol, e.fields.url = b.url, e.fields.retries = b.retries, e.fields.connect_timeout = b.connect_timeout, e.fields.write_timeout = b.write_timeout, e.fields.read_timeout = b.read_timeout, e.fields.client_certificate = b.client_certificate, e.fields.ca_certificates = b.ca_certificates, e.fields.tls_verify_enabled = b.tls_verify_enabled, e.fields.tls_verify_value = b.tls_verify_value, e.fields.enabled = b.enabled;
|
|
1096
1099
|
}, ge = () => {
|
|
1097
1100
|
m.value = !0, N(), e.errorMessages = [], ve();
|
|
1098
1101
|
}, ye = () => {
|
|
1099
|
-
switch (ve(), e.fields.name = `${
|
|
1102
|
+
switch (ve(), e.fields.name = `${q.name}-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, V.value) {
|
|
1100
1103
|
case "url":
|
|
1101
|
-
e.fields.url = `${
|
|
1104
|
+
e.fields.url = `${q.protocol}://${q.host}${q.path}`;
|
|
1102
1105
|
break;
|
|
1103
1106
|
case "protocol":
|
|
1104
|
-
e.fields.host =
|
|
1107
|
+
e.fields.host = q.host, e.fields.path = q.path, e.fields.protocol = q.protocol, e.fields.port = q.port;
|
|
1105
1108
|
break;
|
|
1106
1109
|
default:
|
|
1107
|
-
e.fields.url = `${
|
|
1110
|
+
e.fields.url = `${q.protocol}://${q.host}${q.path}`;
|
|
1108
1111
|
}
|
|
1109
1112
|
}, _e = () => {
|
|
1110
1113
|
if (N(), e.fields.url.length)
|
|
1111
1114
|
try {
|
|
1112
|
-
const t = new URL(e.fields.url), r =
|
|
1115
|
+
const t = new URL(e.fields.url), r = ee(t.protocol, oe);
|
|
1113
1116
|
if (r) throw new Error(r);
|
|
1114
1117
|
e.fields.protocol = t.protocol.slice(0, -1);
|
|
1115
1118
|
const y = le(t.hostname);
|
|
@@ -1127,7 +1130,7 @@ const X = {
|
|
|
1127
1130
|
}
|
|
1128
1131
|
}, he = (t) => {
|
|
1129
1132
|
N(t);
|
|
1130
|
-
}, Pe = k(() => !!e.formFieldErrors.url || !!e.formFieldErrors.host || !!e.formFieldErrors.port),
|
|
1133
|
+
}, Pe = k(() => !!e.formFieldErrors.url || !!e.formFieldErrors.host || !!e.formFieldErrors.port), U = (t) => {
|
|
1131
1134
|
if (e.errorMessages.length) return "";
|
|
1132
1135
|
const r = e.formFieldErrors;
|
|
1133
1136
|
return r[t] ? r[t] : "";
|
|
@@ -1138,7 +1141,7 @@ const X = {
|
|
|
1138
1141
|
const y = ue(e.fields.path);
|
|
1139
1142
|
y && (e.formFieldErrors.path = y);
|
|
1140
1143
|
const I = fe(e.fields.port);
|
|
1141
|
-
I && (e.formFieldErrors.port = I),
|
|
1144
|
+
I && (e.formFieldErrors.port = I), Q.value ? c("url-valid:success") : c("url-valid:error", e.errorMessages.join(",") || l("gateway_services.form.errors.url.invalid"));
|
|
1142
1145
|
}, N = (t) => {
|
|
1143
1146
|
if (t)
|
|
1144
1147
|
e.formFieldErrors[t] = "";
|
|
@@ -1146,7 +1149,7 @@ const X = {
|
|
|
1146
1149
|
for (let r in e.formFieldErrors)
|
|
1147
1150
|
e.formFieldErrors[r] = "";
|
|
1148
1151
|
e.errorMessages = [];
|
|
1149
|
-
},
|
|
1152
|
+
}, Q = k(() => {
|
|
1150
1153
|
for (let t in e.formFieldErrors)
|
|
1151
1154
|
if (e.formFieldErrors[t].length)
|
|
1152
1155
|
return !1;
|
|
@@ -1163,7 +1166,7 @@ const X = {
|
|
|
1163
1166
|
return !0;
|
|
1164
1167
|
const t = ["https", "tls"].includes(e.fields.protocol);
|
|
1165
1168
|
return V.value === "protocol" && t;
|
|
1166
|
-
}),
|
|
1169
|
+
}), re = k(() => {
|
|
1167
1170
|
if (V.value === "url")
|
|
1168
1171
|
return !0;
|
|
1169
1172
|
const t = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
@@ -1171,7 +1174,7 @@ const X = {
|
|
|
1171
1174
|
}), be = (t) => {
|
|
1172
1175
|
N("name"), ae.value = Ce.utf8Name(t);
|
|
1173
1176
|
}, u = k(() => {
|
|
1174
|
-
const t = !
|
|
1177
|
+
const t = !Z.value || !Se(e.fields, b), r = V.value === "url" && !!e.fields.url && Q.value, y = V.value === "protocol" && !!e.fields.host && Q.value;
|
|
1175
1178
|
return t && (r || y);
|
|
1176
1179
|
}), v = (t) => {
|
|
1177
1180
|
var r, y, I;
|
|
@@ -1180,12 +1183,12 @@ const X = {
|
|
|
1180
1183
|
F.push(a.config.cancelRoute);
|
|
1181
1184
|
}, S = k(() => {
|
|
1182
1185
|
var r, y;
|
|
1183
|
-
let t = `${a.config.apiBaseUrl}${Ve.form[a.config.app][
|
|
1186
|
+
let t = `${a.config.apiBaseUrl}${Ve.form[a.config.app][H.value]}`;
|
|
1184
1187
|
return a.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((r = a.config) == null ? void 0 : r.controlPlaneId) || "") : a.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (y = a.config) != null && y.workspace ? `/${a.config.workspace}` : "")), t = t.replace(/{id}/gi, a.gatewayServiceId), t;
|
|
1185
1188
|
}), j = (t) => {
|
|
1186
1189
|
let r = "";
|
|
1187
1190
|
t.url && (r = new URL(t.url).protocol), (["https", "wss", "tls"].includes(t.protocol) || ["https", "wss", "tls"].includes(r)) && (t.tls_verify = t.tls_verify_enabled ? t.tls_verify_value : null), delete t.tls_verify_enabled, delete t.tls_verify_value;
|
|
1188
|
-
},
|
|
1191
|
+
}, $ = k(() => {
|
|
1189
1192
|
var r, y, I, _;
|
|
1190
1193
|
const t = {
|
|
1191
1194
|
name: e.fields.name || null,
|
|
@@ -1205,26 +1208,26 @@ const X = {
|
|
|
1205
1208
|
url: e.fields.url,
|
|
1206
1209
|
enabled: e.fields.enabled
|
|
1207
1210
|
};
|
|
1208
|
-
return e.fields.client_certificate && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.client_certificate = { id: e.fields.client_certificate }), e.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.tls_verify = e.fields.tls_verify_value), ne.value || (t.path = null),
|
|
1209
|
-
}),
|
|
1211
|
+
return e.fields.client_certificate && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.client_certificate = { id: e.fields.client_certificate }), e.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.tls_verify = e.fields.tls_verify_value), ne.value || (t.path = null), H.value === "create" ? V.value === "url" ? (delete t.protocol, delete t.host, delete t.path, a.config.app === "konnect" && delete t.port) : delete t.url : H.value === "edit" && delete t.url, t;
|
|
1212
|
+
}), A = async () => {
|
|
1210
1213
|
var t, r, y, I;
|
|
1211
1214
|
try {
|
|
1212
1215
|
e.isReadonly = !0;
|
|
1213
|
-
const _ =
|
|
1216
|
+
const _ = $.value;
|
|
1214
1217
|
j(_);
|
|
1215
1218
|
let w;
|
|
1216
|
-
if (
|
|
1219
|
+
if (H.value === "create" ? w = await P.post(S.value, _) : H.value === "edit" && (w = ((t = a.config) == null ? void 0 : t.app) === "konnect" ? await P.put(S.value, _) : await P.patch(S.value, _)), w) {
|
|
1217
1220
|
const { data: i } = w;
|
|
1218
1221
|
e.fields.name = (i == null ? void 0 : i.name) || "", e.fields.port = i.port || se.getPortFromProtocol(i.protocol), e.fields.protocol = (i == null ? void 0 : i.protocol) || "http", e.fields.host = (i == null ? void 0 : i.host) || "", e.fields.path = (i == null ? void 0 : i.path) || "", e.fields.url = (i == null ? void 0 : i.url) || "", e.fields.retries = i != null && i.retries || (i == null ? void 0 : i.retries) === 0 ? i == null ? void 0 : i.retries : 5, e.fields.connect_timeout = i != null && i.connect_timeout || (i == null ? void 0 : i.connect_timeout) === 0 ? i == null ? void 0 : i.connect_timeout : 6e4, e.fields.write_timeout = i != null && i.write_timeout || (i == null ? void 0 : i.write_timeout) === 0 ? i == null ? void 0 : i.write_timeout : 6e4, e.fields.read_timeout = i != null && i.read_timeout || (i == null ? void 0 : i.read_timeout) === 0 ? i == null ? void 0 : i.read_timeout : 6e4, e.fields.client_certificate = ((r = i == null ? void 0 : i.client_certificate) == null ? void 0 : r.id) || "", e.fields.ca_certificates = (y = i == null ? void 0 : i.ca_certificates) != null && y.length ? i == null ? void 0 : i.ca_certificates.join(",") : "", e.fields.tls_verify_enabled = (i == null ? void 0 : i.tls_verify) !== "" && (i == null ? void 0 : i.tls_verify) !== null && (i == null ? void 0 : i.tls_verify) !== void 0, e.fields.tls_verify_value = e.fields.tls_verify_enabled && (i == null ? void 0 : i.tls_verify), e.fields.tags = (I = i == null ? void 0 : i.tags) != null && I.length ? i.tags.join(", ") : "", e.fields.enabled = (i == null ? void 0 : i.enabled) ?? !0, Object.assign(b, e.fields), c("update", w == null ? void 0 : w.data);
|
|
1219
1222
|
}
|
|
1220
1223
|
return w;
|
|
1221
1224
|
} catch (_) {
|
|
1222
|
-
const { fields: w, messages: i } =
|
|
1223
|
-
e.errorMessages = i, w.length && w.forEach((
|
|
1224
|
-
const ie =
|
|
1225
|
-
ie === "client_certificate.id" ? e.formFieldErrors.client_certificate =
|
|
1225
|
+
const { fields: w, messages: i } = K(_);
|
|
1226
|
+
e.errorMessages = i, w.length && w.forEach((X) => {
|
|
1227
|
+
const ie = X.field;
|
|
1228
|
+
ie === "client_certificate.id" ? e.formFieldErrors.client_certificate = X.message : ie.startsWith("ca_certificates") ? e.formFieldErrors.ca_certificates = X.message : Object.keys(e.formFieldErrors).includes(ie) && (e.formFieldErrors = {
|
|
1226
1229
|
...e.formFieldErrors,
|
|
1227
|
-
[ie]:
|
|
1230
|
+
[ie]: X.message
|
|
1228
1231
|
});
|
|
1229
1232
|
}), c("error", _);
|
|
1230
1233
|
} finally {
|
|
@@ -1234,37 +1237,37 @@ const X = {
|
|
|
1234
1237
|
return Me(() => a.gatewayServiceId, () => {
|
|
1235
1238
|
Object.assign(e.fields, b);
|
|
1236
1239
|
}), Me(e.fields, () => {
|
|
1237
|
-
c("model-updated",
|
|
1240
|
+
c("model-updated", $.value);
|
|
1238
1241
|
}), Je(() => {
|
|
1239
|
-
c("model-updated",
|
|
1240
|
-
}),
|
|
1242
|
+
c("model-updated", $.value), Z.value || (e.fields.name = Fe());
|
|
1243
|
+
}), G({
|
|
1241
1244
|
validateUrl: Ie,
|
|
1242
|
-
getPayload:
|
|
1243
|
-
saveFormData:
|
|
1245
|
+
getPayload: $,
|
|
1246
|
+
saveFormData: A,
|
|
1244
1247
|
canSubmit: u,
|
|
1245
1248
|
initForm: v
|
|
1246
1249
|
}), (t, r) => {
|
|
1247
|
-
const y =
|
|
1248
|
-
return C(),
|
|
1250
|
+
const y = D("KRadio"), I = D("KButton"), _ = D("KInput"), w = D("KSelect"), i = D("KCheckbox"), X = D("KCollapse"), ie = D("KAlert");
|
|
1251
|
+
return C(), T("div", Rt, [
|
|
1249
1252
|
n(o(_t), {
|
|
1250
1253
|
"can-submit": u.value,
|
|
1251
1254
|
config: s.config,
|
|
1252
1255
|
"edit-id": s.gatewayServiceId,
|
|
1253
1256
|
"entity-type": o(je).GatewayService,
|
|
1254
1257
|
"fetch-url": W.value,
|
|
1255
|
-
"form-fields":
|
|
1258
|
+
"form-fields": $.value,
|
|
1256
1259
|
"is-readonly": e.isReadonly,
|
|
1257
1260
|
onCancel: g,
|
|
1258
1261
|
"onFetch:error": r[30] || (r[30] = (f) => t.$emit("error", f)),
|
|
1259
1262
|
"onFetch:success": v,
|
|
1260
1263
|
onLoading: r[31] || (r[31] = (f) => t.$emit("loading", f)),
|
|
1261
|
-
onSubmit:
|
|
1264
|
+
onSubmit: A
|
|
1262
1265
|
}, {
|
|
1263
1266
|
"form-actions": d(() => [
|
|
1264
1267
|
Ye(t.$slots, "form-actions", {
|
|
1265
1268
|
canSubmit: u.value,
|
|
1266
1269
|
cancel: g,
|
|
1267
|
-
submit:
|
|
1270
|
+
submit: A
|
|
1268
1271
|
}, void 0, !0)
|
|
1269
1272
|
]),
|
|
1270
1273
|
default: d(() => [
|
|
@@ -1274,7 +1277,7 @@ const X = {
|
|
|
1274
1277
|
title: o(l)("gateway_services.form.sections.keys.title")
|
|
1275
1278
|
}, {
|
|
1276
1279
|
default: d(() => [
|
|
1277
|
-
|
|
1280
|
+
Z.value ? B("", !0) : (C(), T("div", xt, [
|
|
1278
1281
|
E("div", Mt, [
|
|
1279
1282
|
n(y, {
|
|
1280
1283
|
modelValue: V.value,
|
|
@@ -1302,7 +1305,7 @@ const X = {
|
|
|
1302
1305
|
]),
|
|
1303
1306
|
n($e, { name: "slide-fade" }, {
|
|
1304
1307
|
default: d(() => [
|
|
1305
|
-
V.value === "url" ? (C(),
|
|
1308
|
+
V.value === "url" ? (C(), T("div", Bt, [
|
|
1306
1309
|
n(_, {
|
|
1307
1310
|
modelValue: e.fields.url,
|
|
1308
1311
|
"onUpdate:modelValue": r[2] || (r[2] = (f) => e.fields.url = f),
|
|
@@ -1310,7 +1313,7 @@ const X = {
|
|
|
1310
1313
|
class: "gateway-service-url-input gateway-service-form-margin-bottom",
|
|
1311
1314
|
"data-testid": "gateway-service-url-input",
|
|
1312
1315
|
error: Pe.value,
|
|
1313
|
-
"error-message":
|
|
1316
|
+
"error-message": U("url"),
|
|
1314
1317
|
label: o(l)("gateway_services.form.fields.upstream_url.label"),
|
|
1315
1318
|
"label-attributes": {
|
|
1316
1319
|
info: s.config.app === "konnect" ? o(l)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(l)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
|
|
@@ -1331,7 +1334,7 @@ const X = {
|
|
|
1331
1334
|
onClick: ye
|
|
1332
1335
|
}, {
|
|
1333
1336
|
default: d(() => [
|
|
1334
|
-
|
|
1337
|
+
R(h(o(l)("gateway_services.form.buttons.try_sample")), 1)
|
|
1335
1338
|
]),
|
|
1336
1339
|
_: 1
|
|
1337
1340
|
})
|
|
@@ -1339,19 +1342,19 @@ const X = {
|
|
|
1339
1342
|
key: "0"
|
|
1340
1343
|
}
|
|
1341
1344
|
]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
|
|
1342
|
-
])) :
|
|
1345
|
+
])) : B("", !0)
|
|
1343
1346
|
]),
|
|
1344
1347
|
_: 1
|
|
1345
1348
|
})
|
|
1346
1349
|
])),
|
|
1347
1350
|
n($e, { name: "slide-fade" }, {
|
|
1348
1351
|
default: d(() => [
|
|
1349
|
-
V.value === "protocol" ||
|
|
1352
|
+
V.value === "protocol" || Z.value ? (C(), T("div", Dt, [
|
|
1350
1353
|
n(w, {
|
|
1351
1354
|
modelValue: e.fields.protocol,
|
|
1352
1355
|
"onUpdate:modelValue": r[3] || (r[3] = (f) => e.fields.protocol = f),
|
|
1353
1356
|
"data-testid": "gateway-service-protocol-select",
|
|
1354
|
-
items:
|
|
1357
|
+
items: oe,
|
|
1355
1358
|
label: o(l)("gateway_services.form.fields.protocol.label"),
|
|
1356
1359
|
"label-attributes": {
|
|
1357
1360
|
info: o(l)("gateway_services.form.fields.protocol.tooltip"),
|
|
@@ -1369,7 +1372,7 @@ const X = {
|
|
|
1369
1372
|
class: "gateway-service-form-margin-top",
|
|
1370
1373
|
"data-testid": "gateway-service-host-input",
|
|
1371
1374
|
error: !!e.formFieldErrors.host,
|
|
1372
|
-
"error-message":
|
|
1375
|
+
"error-message": U("host"),
|
|
1373
1376
|
label: o(l)("gateway_services.form.fields.host.label"),
|
|
1374
1377
|
"label-attributes": {
|
|
1375
1378
|
info: o(l)("gateway_services.form.fields.host.tooltip"),
|
|
@@ -1389,7 +1392,7 @@ const X = {
|
|
|
1389
1392
|
onClick: ye
|
|
1390
1393
|
}, {
|
|
1391
1394
|
default: d(() => [
|
|
1392
|
-
|
|
1395
|
+
R(h(o(l)("gateway_services.form.buttons.try_sample")), 1)
|
|
1393
1396
|
]),
|
|
1394
1397
|
_: 1
|
|
1395
1398
|
})
|
|
@@ -1397,7 +1400,7 @@ const X = {
|
|
|
1397
1400
|
key: "0"
|
|
1398
1401
|
}
|
|
1399
1402
|
]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"]),
|
|
1400
|
-
ne.value ? (C(),
|
|
1403
|
+
ne.value ? (C(), T("div", Kt, [
|
|
1401
1404
|
n(_, {
|
|
1402
1405
|
modelValue: e.fields.path,
|
|
1403
1406
|
"onUpdate:modelValue": r[6] || (r[6] = (f) => e.fields.path = f),
|
|
@@ -1405,7 +1408,7 @@ const X = {
|
|
|
1405
1408
|
class: "gateway-service-form-margin-top",
|
|
1406
1409
|
"data-testid": "gateway-service-path-input",
|
|
1407
1410
|
error: !!e.formFieldErrors.path,
|
|
1408
|
-
"error-message":
|
|
1411
|
+
"error-message": U("path"),
|
|
1409
1412
|
label: o(l)("gateway_services.form.fields.path.label"),
|
|
1410
1413
|
"label-attributes": {
|
|
1411
1414
|
info: o(l)("gateway_services.form.fields.path.tooltip"),
|
|
@@ -1415,19 +1418,19 @@ const X = {
|
|
|
1415
1418
|
placeholder: o(l)("gateway_services.form.fields.path.placeholder"),
|
|
1416
1419
|
onInput: r[7] || (r[7] = (f) => O("path"))
|
|
1417
1420
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
|
|
1418
|
-
])) :
|
|
1421
|
+
])) : B("", !0),
|
|
1419
1422
|
n(_, {
|
|
1420
1423
|
modelValue: e.fields.port,
|
|
1421
1424
|
"onUpdate:modelValue": [
|
|
1422
1425
|
r[8] || (r[8] = (f) => e.fields.port = f),
|
|
1423
1426
|
r[10] || (r[10] = () => {
|
|
1424
|
-
e.fields.port =
|
|
1427
|
+
e.fields.port = J(e.fields.port + "");
|
|
1425
1428
|
})
|
|
1426
1429
|
],
|
|
1427
1430
|
class: "gateway-service-form-margin-top",
|
|
1428
1431
|
"data-testid": "gateway-service-port-input",
|
|
1429
1432
|
error: !!e.formFieldErrors.port,
|
|
1430
|
-
"error-message":
|
|
1433
|
+
"error-message": U("port"),
|
|
1431
1434
|
label: o(l)("gateway_services.form.fields.port.label"),
|
|
1432
1435
|
"label-attributes": {
|
|
1433
1436
|
info: o(l)("gateway_services.form.fields.port.tooltip"),
|
|
@@ -1437,11 +1440,11 @@ const X = {
|
|
|
1437
1440
|
type: "number",
|
|
1438
1441
|
onInput: r[9] || (r[9] = (f) => O("port"))
|
|
1439
1442
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes"])
|
|
1440
|
-
])) :
|
|
1443
|
+
])) : B("", !0)
|
|
1441
1444
|
]),
|
|
1442
1445
|
_: 1
|
|
1443
1446
|
}),
|
|
1444
|
-
n(
|
|
1447
|
+
n(X, {
|
|
1445
1448
|
modelValue: m.value,
|
|
1446
1449
|
"onUpdate:modelValue": r[26] || (r[26] = (f) => m.value = f),
|
|
1447
1450
|
"data-testid": "advanced-fields-collapse",
|
|
@@ -1451,14 +1454,14 @@ const X = {
|
|
|
1451
1454
|
default: d(() => [
|
|
1452
1455
|
n($e, { name: "slide-fade" }, {
|
|
1453
1456
|
default: d(() => [
|
|
1454
|
-
m.value ?
|
|
1457
|
+
m.value ? B("", !0) : (C(), T("div", Lt, [
|
|
1455
1458
|
E("div", qt, [
|
|
1456
1459
|
n(_, {
|
|
1457
1460
|
modelValue: e.fields.retries,
|
|
1458
1461
|
"onUpdate:modelValue": [
|
|
1459
1462
|
r[11] || (r[11] = (f) => e.fields.retries = f),
|
|
1460
1463
|
r[12] || (r[12] = () => {
|
|
1461
|
-
e.fields.retries =
|
|
1464
|
+
e.fields.retries = J(e.fields.retries + "");
|
|
1462
1465
|
})
|
|
1463
1466
|
],
|
|
1464
1467
|
autocomplete: "off",
|
|
@@ -1479,7 +1482,7 @@ const X = {
|
|
|
1479
1482
|
"onUpdate:modelValue": [
|
|
1480
1483
|
r[13] || (r[13] = (f) => e.fields.connect_timeout = f),
|
|
1481
1484
|
r[14] || (r[14] = () => {
|
|
1482
|
-
e.fields.connect_timeout =
|
|
1485
|
+
e.fields.connect_timeout = J(e.fields.connect_timeout + "");
|
|
1483
1486
|
})
|
|
1484
1487
|
],
|
|
1485
1488
|
autocomplete: "off",
|
|
@@ -1500,7 +1503,7 @@ const X = {
|
|
|
1500
1503
|
"onUpdate:modelValue": [
|
|
1501
1504
|
r[15] || (r[15] = (f) => e.fields.write_timeout = f),
|
|
1502
1505
|
r[16] || (r[16] = () => {
|
|
1503
|
-
e.fields.write_timeout =
|
|
1506
|
+
e.fields.write_timeout = J(e.fields.write_timeout + "");
|
|
1504
1507
|
})
|
|
1505
1508
|
],
|
|
1506
1509
|
autocomplete: "off",
|
|
@@ -1521,7 +1524,7 @@ const X = {
|
|
|
1521
1524
|
"onUpdate:modelValue": [
|
|
1522
1525
|
r[17] || (r[17] = (f) => e.fields.read_timeout = f),
|
|
1523
1526
|
r[18] || (r[18] = () => {
|
|
1524
|
-
e.fields.read_timeout =
|
|
1527
|
+
e.fields.read_timeout = J(e.fields.read_timeout + "");
|
|
1525
1528
|
})
|
|
1526
1529
|
],
|
|
1527
1530
|
autocomplete: "off",
|
|
@@ -1536,7 +1539,7 @@ const X = {
|
|
|
1536
1539
|
type: "number"
|
|
1537
1540
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1538
1541
|
]),
|
|
1539
|
-
Ae.value ? (C(),
|
|
1542
|
+
Ae.value ? (C(), T("div", Ot, [
|
|
1540
1543
|
n(_, {
|
|
1541
1544
|
modelValue: e.fields.client_certificate,
|
|
1542
1545
|
"onUpdate:modelValue": r[19] || (r[19] = (f) => e.fields.client_certificate = f),
|
|
@@ -1555,8 +1558,8 @@ const X = {
|
|
|
1555
1558
|
type: "text",
|
|
1556
1559
|
onInput: r[20] || (r[20] = (f) => he("client_certificate"))
|
|
1557
1560
|
}, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"])
|
|
1558
|
-
])) :
|
|
1559
|
-
Te.value ? (C(),
|
|
1561
|
+
])) : B("", !0),
|
|
1562
|
+
Te.value ? (C(), T("div", jt, [
|
|
1560
1563
|
n(_, {
|
|
1561
1564
|
modelValue: e.fields.ca_certificates,
|
|
1562
1565
|
"onUpdate:modelValue": r[21] || (r[21] = (f) => e.fields.ca_certificates = f),
|
|
@@ -1572,7 +1575,7 @@ const X = {
|
|
|
1572
1575
|
onInput: r[22] || (r[22] = (f) => he("ca_certificates"))
|
|
1573
1576
|
}, {
|
|
1574
1577
|
"label-tooltip": d(() => [
|
|
1575
|
-
n(o(
|
|
1578
|
+
n(o(L), {
|
|
1576
1579
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1577
1580
|
scope: "global"
|
|
1578
1581
|
}, {
|
|
@@ -1587,8 +1590,8 @@ const X = {
|
|
|
1587
1590
|
]),
|
|
1588
1591
|
_: 1
|
|
1589
1592
|
}, 8, ["modelValue", "error", "label", "placeholder", "readonly"])
|
|
1590
|
-
])) :
|
|
1591
|
-
|
|
1593
|
+
])) : B("", !0),
|
|
1594
|
+
re.value ? (C(), T("div", zt, [
|
|
1592
1595
|
n(i, {
|
|
1593
1596
|
modelValue: e.fields.tls_verify_enabled,
|
|
1594
1597
|
"onUpdate:modelValue": r[23] || (r[23] = (f) => e.fields.tls_verify_enabled = f),
|
|
@@ -1598,7 +1601,7 @@ const X = {
|
|
|
1598
1601
|
"label-attributes": { tooltipAttributes: { maxWidth: "400" } }
|
|
1599
1602
|
}, {
|
|
1600
1603
|
tooltip: d(() => [
|
|
1601
|
-
n(o(
|
|
1604
|
+
n(o(L), {
|
|
1602
1605
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
1603
1606
|
scope: "global"
|
|
1604
1607
|
}, {
|
|
@@ -1610,7 +1613,7 @@ const X = {
|
|
|
1610
1613
|
]),
|
|
1611
1614
|
_: 1
|
|
1612
1615
|
}, 8, ["modelValue", "description", "label"]),
|
|
1613
|
-
e.fields.tls_verify_enabled ? (C(),
|
|
1616
|
+
e.fields.tls_verify_enabled ? (C(), T("div", Ht, [
|
|
1614
1617
|
n(y, {
|
|
1615
1618
|
modelValue: e.fields.tls_verify_value,
|
|
1616
1619
|
"onUpdate:modelValue": r[24] || (r[24] = (f) => e.fields.tls_verify_value = f),
|
|
@@ -1618,8 +1621,8 @@ const X = {
|
|
|
1618
1621
|
label: o(l)("gateway_services.form.fields.tls_verify_option.true.label"),
|
|
1619
1622
|
"selected-value": !0
|
|
1620
1623
|
}, null, 8, ["modelValue", "label"])
|
|
1621
|
-
])) :
|
|
1622
|
-
e.fields.tls_verify_enabled ? (C(),
|
|
1624
|
+
])) : B("", !0),
|
|
1625
|
+
e.fields.tls_verify_enabled ? (C(), T("div", Zt, [
|
|
1623
1626
|
n(y, {
|
|
1624
1627
|
modelValue: e.fields.tls_verify_value,
|
|
1625
1628
|
"onUpdate:modelValue": r[25] || (r[25] = (f) => e.fields.tls_verify_value = f),
|
|
@@ -1627,8 +1630,8 @@ const X = {
|
|
|
1627
1630
|
label: o(l)("gateway_services.form.fields.tls_verify_option.false.label"),
|
|
1628
1631
|
"selected-value": !1
|
|
1629
1632
|
}, null, 8, ["modelValue", "label"])
|
|
1630
|
-
])) :
|
|
1631
|
-
])) :
|
|
1633
|
+
])) : B("", !0)
|
|
1634
|
+
])) : B("", !0)
|
|
1632
1635
|
]))
|
|
1633
1636
|
]),
|
|
1634
1637
|
_: 1
|
|
@@ -1651,7 +1654,7 @@ const X = {
|
|
|
1651
1654
|
modelModifiers: { trim: !0 },
|
|
1652
1655
|
autocomplete: "off",
|
|
1653
1656
|
"data-testid": "gateway-service-name-input",
|
|
1654
|
-
error:
|
|
1657
|
+
error: te.value,
|
|
1655
1658
|
"error-message": ae.value,
|
|
1656
1659
|
label: o(l)("gateway_services.form.fields.name.label"),
|
|
1657
1660
|
"label-attributes": {
|
|
@@ -1664,7 +1667,7 @@ const X = {
|
|
|
1664
1667
|
type: "text",
|
|
1665
1668
|
onInput: be
|
|
1666
1669
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1667
|
-
n(
|
|
1670
|
+
n(X, {
|
|
1668
1671
|
"data-testid": "tags-collapse",
|
|
1669
1672
|
"trigger-alignment": "leading",
|
|
1670
1673
|
"trigger-label": o(l)("gateway_services.form.fields.tags.collapse")
|
|
@@ -1703,18 +1706,18 @@ const X = {
|
|
|
1703
1706
|
}, {
|
|
1704
1707
|
default: d(() => [
|
|
1705
1708
|
E("ul", Qt, [
|
|
1706
|
-
(C(!0),
|
|
1709
|
+
(C(!0), T(Qe, null, Xe(e.errorMessages, (f) => (C(), T("li", { key: f }, h(f), 1))), 128))
|
|
1707
1710
|
])
|
|
1708
1711
|
]),
|
|
1709
1712
|
_: 1
|
|
1710
|
-
})) :
|
|
1713
|
+
})) : B("", !0)
|
|
1711
1714
|
]),
|
|
1712
1715
|
_: 3
|
|
1713
1716
|
}, 8, ["can-submit", "config", "edit-id", "entity-type", "fetch-url", "form-fields", "is-readonly"])
|
|
1714
1717
|
]);
|
|
1715
1718
|
};
|
|
1716
1719
|
}
|
|
1717
|
-
}), uo = /* @__PURE__ */ ze(Xt, [["__scopeId", "data-v-72fe312f"]]), { validateHost: Yt, validatePort: eo, validateProtocol: to, validatePath: oo } =
|
|
1720
|
+
}), uo = /* @__PURE__ */ ze(Xt, [["__scopeId", "data-v-72fe312f"]]), { validateHost: Yt, validatePort: eo, validateProtocol: to, validatePath: oo } = Y.useUrlValidators(), fo = () => ({
|
|
1718
1721
|
validateHost: Yt,
|
|
1719
1722
|
validatePort: eo,
|
|
1720
1723
|
validateProtocol: to,
|