@kong-ui-public/entities-gateway-services 3.17.1 → 3.18.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,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as Pe, computed as C, ref as B, watch as Me, onBeforeMount as Qe, resolveComponent as U, openBlock as h, createElementBlock as I, createVNode as n, unref as s, createSlots as Ce, withCtx as c, createTextVNode as $, toDisplayString as k, createBlock as
|
|
1
|
+
import { defineComponent as Pe, computed as C, ref as B, watch as Me, onBeforeMount as Qe, resolveComponent as U, openBlock as h, createElementBlock as I, createVNode as n, unref as s, createSlots as Ce, withCtx as c, createTextVNode as $, toDisplayString as k, createBlock as H, createCommentVNode as F, createElementVNode as T, withModifiers as Re, Teleport as Xe, Fragment as Ke, renderList as je, reactive as Ne, onMounted as Ye, Transition as xe, renderSlot as et } from "vue";
|
|
2
2
|
import { useRouter as ze } from "vue-router";
|
|
3
|
-
import { BookIcon as
|
|
3
|
+
import { BookIcon as qe, AddIcon as Ie, ServicesIcon as tt, TrashIcon as st } from "@kong/icons";
|
|
4
4
|
import { createI18n as ot, i18nTComponent as lt } from "@kong-ui-public/i18n";
|
|
5
|
-
import { useAxios as He, useTableState as rt, useFetcher as it, useDeleteUrlBuilder as at, FetcherStatus as nt, EntityBaseTable as ct, PermissionsWrapper as ue, TableTags as dt, EntityFilter as ut, EntityToggleModal as ft, EntityDeleteModal as pt, EntityTypes as mt, useHelpers as Ze, ConfigurationSchemaType as vt, ConfigurationSchemaSection as
|
|
5
|
+
import { useAxios as He, useTableState as rt, useFetcher as it, useDeleteUrlBuilder as at, FetcherStatus as nt, EntityBaseTable as ct, PermissionsWrapper as ue, TableTags as dt, EntityFilter as ut, EntityToggleModal as ft, EntityDeleteModal as pt, EntityTypes as mt, useHelpers as Ze, ConfigurationSchemaType as vt, ConfigurationSchemaSection as Ve, EntityBaseConfigCard as gt, SupportedEntityType as Je, useErrors as yt, useValidators as _t, EntityBaseFormType as Ge, useGatewayFeatureSupported as bt, EntityBaseForm as ht, EntityFormSection as We } from "@kong-ui-public/entities-shared";
|
|
6
6
|
const wt = {
|
|
7
7
|
create: "New gateway service",
|
|
8
8
|
debugger: "Start debugging",
|
|
@@ -22,7 +22,7 @@ const wt = {
|
|
|
22
22
|
konnect: "Filter by name",
|
|
23
23
|
kongManager: "Filter by exact name or ID"
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, St = {
|
|
26
26
|
title: "Gateway Services",
|
|
27
27
|
list: {
|
|
28
28
|
toolbar_actions: {
|
|
@@ -219,7 +219,7 @@ const wt = {
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
},
|
|
222
|
+
}, Vt = {
|
|
223
223
|
general: "Gateway Services could not be retrieved",
|
|
224
224
|
delete: "The gateway service could not be deleted at this time.",
|
|
225
225
|
copy: "Failed to copy to clipboard",
|
|
@@ -232,8 +232,8 @@ const wt = {
|
|
|
232
232
|
}, Et = {
|
|
233
233
|
actions: wt,
|
|
234
234
|
search: kt,
|
|
235
|
-
gateway_services:
|
|
236
|
-
errors:
|
|
235
|
+
gateway_services: St,
|
|
236
|
+
errors: Vt,
|
|
237
237
|
copy: Ct,
|
|
238
238
|
glossary: It
|
|
239
239
|
};
|
|
@@ -267,16 +267,16 @@ function Ft() {
|
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
|
-
const $t = /^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*(\.)?$/,
|
|
270
|
+
const $t = /^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*(\.)?$/, Tt = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/, At = (l) => /^[0-9A-Fa-f:.]+$/.test(l) && l.includes(":");
|
|
271
271
|
function Ut() {
|
|
272
272
|
const { i18n: { t: l } } = le.useI18n();
|
|
273
273
|
return {
|
|
274
274
|
validateHost: (v) => {
|
|
275
275
|
if (!v || v.trim() === "") return l("gateway_services.form.errors.host.empty");
|
|
276
276
|
try {
|
|
277
|
-
if (
|
|
277
|
+
if (At(v))
|
|
278
278
|
return new URL("/", `https://[${v}]`), "";
|
|
279
|
-
if ($t.test(v) ||
|
|
279
|
+
if ($t.test(v) || Tt.test(v))
|
|
280
280
|
return new URL("/", `https://${v}`), "";
|
|
281
281
|
} catch {
|
|
282
282
|
}
|
|
@@ -379,7 +379,7 @@ const le = {
|
|
|
379
379
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success", "click:import"],
|
|
380
380
|
setup(l, { emit: L }) {
|
|
381
381
|
var ve;
|
|
382
|
-
const m = L, d = l, { i18n: { t: a, formatUnixTimeStamp: v } } = le.useI18n(), R = ze(), { axiosInstance: x } = He((ve = d.config) == null ? void 0 : ve.axiosRequestConfig), { hasRecords: r, handleStateChange:
|
|
382
|
+
const m = L, d = l, { i18n: { t: a, formatUnixTimeStamp: v } } = le.useI18n(), R = ze(), { axiosInstance: x } = He((ve = d.config) == null ? void 0 : ve.axiosRequestConfig), { hasRecords: r, handleStateChange: A } = rt(() => j.value), E = C(() => r.value && d.config.app === "konnect"), Q = C(() => d.config.app !== "kongManager" || !!d.config.disableSorting), re = {
|
|
383
383
|
// the Name column is non-hidable
|
|
384
384
|
name: { label: a("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
385
385
|
...d.config.showControlPlaneColumn ? { control_plane: { label: a("gateway_services.list.table_headers.control_plane") } } : {},
|
|
@@ -406,10 +406,10 @@ const le = {
|
|
|
406
406
|
isExactMatch: p,
|
|
407
407
|
placeholder: a(`search.placeholder.${d.config.app}`)
|
|
408
408
|
};
|
|
409
|
-
const { name: g, enabled: _, protocol: w, host: O, port:
|
|
409
|
+
const { name: g, enabled: _, protocol: w, host: O, port: q, path: t } = re;
|
|
410
410
|
return {
|
|
411
411
|
isExactMatch: p,
|
|
412
|
-
fields: { name: g, enabled: _, protocol: w, host: O, port:
|
|
412
|
+
fields: { name: g, enabled: _, protocol: w, host: O, port: q, path: t },
|
|
413
413
|
schema: d.config.filterSchema
|
|
414
414
|
};
|
|
415
415
|
}), {
|
|
@@ -425,7 +425,7 @@ const le = {
|
|
|
425
425
|
ctaText: Z.value ? d.isServerless ? a("actions.serverless_create") : a("actions.create") : void 0,
|
|
426
426
|
message: `${a("gateway_services.list.empty_state.description")}${d.config.additionMessageForEmptyState ? ` ${d.config.additionMessageForEmptyState}` : ""}`,
|
|
427
427
|
title: Z.value ? d.isServerless ? a("gateway_services.list.empty_state.serverless_title") : a("gateway_services.list.empty_state.title") : a("gateway_services.title")
|
|
428
|
-
})),
|
|
428
|
+
})), S = B(!1), M = B(null), ne = C(() => {
|
|
429
429
|
const p = {
|
|
430
430
|
action: "disable",
|
|
431
431
|
id: "",
|
|
@@ -437,22 +437,22 @@ const le = {
|
|
|
437
437
|
}
|
|
438
438
|
return p;
|
|
439
439
|
}), ge = (p) => {
|
|
440
|
-
|
|
440
|
+
S.value = !0, M.value = p;
|
|
441
441
|
}, ye = () => {
|
|
442
|
-
|
|
442
|
+
S.value = !1, M.value = null;
|
|
443
443
|
}, te = async () => {
|
|
444
444
|
var w, O;
|
|
445
445
|
if (!await ((w = d.canEdit) == null ? void 0 : w.call(d, M.value)) || !M.value)
|
|
446
446
|
return;
|
|
447
447
|
const g = `${Fe.value.href}/${M.value.id}`, _ = !M.value.enabled;
|
|
448
448
|
try {
|
|
449
|
-
const
|
|
449
|
+
const q = (O = d.config) == null ? void 0 : O.app;
|
|
450
450
|
let t;
|
|
451
|
-
j.value &&
|
|
452
|
-
const { data: o } =
|
|
451
|
+
j.value && q === "konnect" && (t = await x.get(g));
|
|
452
|
+
const { data: o } = q === "konnect" ? await x.put(g, { ...(t == null ? void 0 : t.data) || M.value, enabled: _ }) : await x.patch(g, { ...M.value, enabled: _ });
|
|
453
453
|
m("toggle:success", o), M.value.enabled = _;
|
|
454
|
-
} catch (
|
|
455
|
-
m("error",
|
|
454
|
+
} catch (q) {
|
|
455
|
+
m("error", q);
|
|
456
456
|
}
|
|
457
457
|
}, _e = (p) => {
|
|
458
458
|
d.config.getControlPlaneRoute && R.push(d.config.getControlPlaneRoute(p));
|
|
@@ -490,7 +490,7 @@ const le = {
|
|
|
490
490
|
}, ce = (p) => ({
|
|
491
491
|
label: a("actions.view"),
|
|
492
492
|
to: d.config.getViewRoute(p)
|
|
493
|
-
}),
|
|
493
|
+
}), Te = (p) => ({
|
|
494
494
|
label: a("actions.edit"),
|
|
495
495
|
to: d.config.getEditRoute(p)
|
|
496
496
|
}), se = (p) => {
|
|
@@ -499,23 +499,23 @@ const le = {
|
|
|
499
499
|
label: a("actions.debugger"),
|
|
500
500
|
to: d.config.getDebugRoute(p)
|
|
501
501
|
};
|
|
502
|
-
}, K = B(void 0), W = B(!1), oe = B(!1), me = B(""),
|
|
502
|
+
}, K = B(void 0), W = B(!1), oe = B(!1), me = B(""), Ae = at(d.config, ie.value), ke = (p) => {
|
|
503
503
|
K.value = p, W.value = !0, me.value = "";
|
|
504
|
-
},
|
|
504
|
+
}, z = () => {
|
|
505
505
|
W.value = !1, K.value = void 0;
|
|
506
506
|
}, Ue = async () => {
|
|
507
507
|
var p, g, _;
|
|
508
508
|
if ((p = K.value) != null && p.id) {
|
|
509
509
|
oe.value = !0;
|
|
510
510
|
try {
|
|
511
|
-
await x.delete(
|
|
511
|
+
await x.delete(Ae(K.value.id)), m("delete:success", K.value), z(), P.value++;
|
|
512
512
|
} catch (w) {
|
|
513
513
|
me.value = ((_ = (g = w.response) == null ? void 0 : g.data) == null ? void 0 : _.message) || w.message || a("errors.delete"), m("error", w);
|
|
514
514
|
} finally {
|
|
515
515
|
oe.value = !1;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
},
|
|
518
|
+
}, Se = () => {
|
|
519
519
|
R.push(d.config.createRoute);
|
|
520
520
|
};
|
|
521
521
|
Me(ee, (p) => {
|
|
@@ -532,7 +532,7 @@ const le = {
|
|
|
532
532
|
return Qe(async () => {
|
|
533
533
|
Z.value = await d.canCreate();
|
|
534
534
|
}), (p, g) => {
|
|
535
|
-
const _ = U("KButton"), w = U("KDropdownItem"), O = U("KDropdown"),
|
|
535
|
+
const _ = U("KButton"), w = U("KDropdownItem"), O = U("KDropdown"), q = U("KEmptyState"), t = U("KBadge"), o = U("KInputSwitch"), b = U("KClipboardProvider");
|
|
536
536
|
return h(), I("div", Rt, [
|
|
537
537
|
n(s(ct), {
|
|
538
538
|
"cache-identifier": l.cacheIdentifier,
|
|
@@ -550,7 +550,7 @@ const le = {
|
|
|
550
550
|
onClearSearchInput: fe,
|
|
551
551
|
"onClick:row": g[5] || (g[5] = (f) => we(f)),
|
|
552
552
|
onSort: pe,
|
|
553
|
-
onState: s(
|
|
553
|
+
onState: s(A)
|
|
554
554
|
}, Ce({
|
|
555
555
|
"toolbar-filter": c(() => [
|
|
556
556
|
n(s(ut), {
|
|
@@ -560,12 +560,12 @@ const le = {
|
|
|
560
560
|
}, null, 8, ["modelValue", "config"])
|
|
561
561
|
]),
|
|
562
562
|
"toolbar-button": c(() => [
|
|
563
|
-
(h(),
|
|
563
|
+
(h(), H(Xe, {
|
|
564
564
|
disabled: !l.useActionOutside,
|
|
565
565
|
to: "#kong-ui-app-page-header-action-button"
|
|
566
566
|
}, [
|
|
567
|
-
|
|
568
|
-
E.value ? (h(),
|
|
567
|
+
T("div", xt, [
|
|
568
|
+
E.value ? (h(), H(_, {
|
|
569
569
|
key: 0,
|
|
570
570
|
appearance: "secondary",
|
|
571
571
|
class: "open-learning-hub",
|
|
@@ -574,7 +574,7 @@ const le = {
|
|
|
574
574
|
onClick: g[1] || (g[1] = (f) => p.$emit("click:learn-more"))
|
|
575
575
|
}, {
|
|
576
576
|
default: c(() => [
|
|
577
|
-
n(s(
|
|
577
|
+
n(s(qe), { decorative: "" })
|
|
578
578
|
]),
|
|
579
579
|
_: 1
|
|
580
580
|
})) : F("", !0),
|
|
@@ -599,16 +599,16 @@ const le = {
|
|
|
599
599
|
], 8, ["disabled"]))
|
|
600
600
|
]),
|
|
601
601
|
name: c(({ rowValue: f }) => [
|
|
602
|
-
|
|
602
|
+
T("b", null, k(f ?? "-"), 1)
|
|
603
603
|
]),
|
|
604
604
|
control_plane: c(({ row: f }) => {
|
|
605
605
|
var y;
|
|
606
606
|
return [
|
|
607
|
-
(y = f.x_meta) != null && y.cluster_id ? (h(),
|
|
607
|
+
(y = f.x_meta) != null && y.cluster_id ? (h(), H(t, {
|
|
608
608
|
key: 0,
|
|
609
609
|
tooltip: f.x_meta.cluster_id,
|
|
610
610
|
"truncation-tooltip": "",
|
|
611
|
-
onClick: Re((
|
|
611
|
+
onClick: Re((V) => _e(f.x_meta.cluster_id), ["stop"])
|
|
612
612
|
}, {
|
|
613
613
|
default: c(() => [
|
|
614
614
|
$(k(f.x_meta.cluster_id), 1)
|
|
@@ -623,16 +623,16 @@ const le = {
|
|
|
623
623
|
"force-show": ""
|
|
624
624
|
}, {
|
|
625
625
|
default: c(({ isAllowed: y }) => [
|
|
626
|
-
|
|
626
|
+
T("div", {
|
|
627
627
|
onClick: g[4] || (g[4] = Re(() => {
|
|
628
628
|
}, ["stop"]))
|
|
629
629
|
}, [
|
|
630
630
|
n(o, {
|
|
631
631
|
modelValue: f.enabled,
|
|
632
|
-
"onUpdate:modelValue": (
|
|
632
|
+
"onUpdate:modelValue": (V) => f.enabled = V,
|
|
633
633
|
"data-testid": `row-${f.id}-toggle-input`,
|
|
634
634
|
disabled: !y,
|
|
635
|
-
onClick: Re((
|
|
635
|
+
onClick: Re((V) => ge(f), ["prevent"])
|
|
636
636
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "disabled", "onClick"])
|
|
637
637
|
])
|
|
638
638
|
]),
|
|
@@ -653,7 +653,7 @@ const le = {
|
|
|
653
653
|
default: c(({ copyToClipboard: y }) => [
|
|
654
654
|
n(w, {
|
|
655
655
|
"data-testid": "action-entity-copy-id",
|
|
656
|
-
onClick: (
|
|
656
|
+
onClick: (V) => be(f, y)
|
|
657
657
|
}, {
|
|
658
658
|
default: c(() => [
|
|
659
659
|
$(k(s(a)("actions.copy_id")), 1)
|
|
@@ -667,7 +667,7 @@ const le = {
|
|
|
667
667
|
default: c(({ copyToClipboard: y }) => [
|
|
668
668
|
n(w, {
|
|
669
669
|
"data-testid": "action-entity-copy-json",
|
|
670
|
-
onClick: (
|
|
670
|
+
onClick: (V) => he(f, y)
|
|
671
671
|
}, {
|
|
672
672
|
default: c(() => [
|
|
673
673
|
$(k(s(a)("actions.copy_json")), 1)
|
|
@@ -693,7 +693,7 @@ const le = {
|
|
|
693
693
|
"auth-function": () => l.canDebug(f)
|
|
694
694
|
}, {
|
|
695
695
|
default: c(() => [
|
|
696
|
-
l.config.getDebugRoute ? (h(),
|
|
696
|
+
l.config.getDebugRoute ? (h(), H(w, {
|
|
697
697
|
key: 0,
|
|
698
698
|
"data-testid": "action-entity-debug",
|
|
699
699
|
item: se(f.id)
|
|
@@ -707,7 +707,7 @@ const le = {
|
|
|
707
707
|
default: c(() => [
|
|
708
708
|
n(w, {
|
|
709
709
|
"data-testid": "action-entity-edit",
|
|
710
|
-
item:
|
|
710
|
+
item: Te(f.id)
|
|
711
711
|
}, null, 8, ["item"])
|
|
712
712
|
]),
|
|
713
713
|
_: 2
|
|
@@ -738,7 +738,7 @@ const le = {
|
|
|
738
738
|
fn: c(() => {
|
|
739
739
|
var f;
|
|
740
740
|
return [
|
|
741
|
-
n(
|
|
741
|
+
n(q, {
|
|
742
742
|
"data-testid": "gateway-services-entity-empty-state",
|
|
743
743
|
"icon-background": "",
|
|
744
744
|
message: s(a)("gateway_services.empty_state_v2.description"),
|
|
@@ -749,7 +749,7 @@ const le = {
|
|
|
749
749
|
]),
|
|
750
750
|
action: c(() => [
|
|
751
751
|
Z.value ? (h(), I(Ke, { key: 0 }, [
|
|
752
|
-
l.canImportSpecs ? (h(),
|
|
752
|
+
l.canImportSpecs ? (h(), H(O, {
|
|
753
753
|
key: 0,
|
|
754
754
|
"data-testid": "entity-create-dropdown",
|
|
755
755
|
"show-caret": "",
|
|
@@ -759,7 +759,7 @@ const le = {
|
|
|
759
759
|
items: c(() => [
|
|
760
760
|
n(w, {
|
|
761
761
|
"data-testid": "entity-create-dropdown-item",
|
|
762
|
-
onClick:
|
|
762
|
+
onClick: Se
|
|
763
763
|
}, {
|
|
764
764
|
default: c(() => [
|
|
765
765
|
$(k(s(a)("gateway_services.empty_state_v2.create_new")), 1)
|
|
@@ -777,10 +777,10 @@ const le = {
|
|
|
777
777
|
})
|
|
778
778
|
]),
|
|
779
779
|
_: 1
|
|
780
|
-
}, 8, ["trigger-text"])) : (h(),
|
|
780
|
+
}, 8, ["trigger-text"])) : (h(), H(_, {
|
|
781
781
|
key: 1,
|
|
782
782
|
"data-testid": "entity-create-button",
|
|
783
|
-
onClick:
|
|
783
|
+
onClick: Se
|
|
784
784
|
}, {
|
|
785
785
|
default: c(() => [
|
|
786
786
|
n(s(Ie), { decorative: "" }),
|
|
@@ -795,7 +795,7 @@ const le = {
|
|
|
795
795
|
onClick: g[3] || (g[3] = (y) => p.$emit("click:learn-more"))
|
|
796
796
|
}, {
|
|
797
797
|
default: c(() => [
|
|
798
|
-
n(s(
|
|
798
|
+
n(s(qe), { decorative: "" }),
|
|
799
799
|
$(" " + k(s(a)("gateway_services.empty_state_v2.learn_more")), 1)
|
|
800
800
|
]),
|
|
801
801
|
_: 1
|
|
@@ -822,7 +822,7 @@ const le = {
|
|
|
822
822
|
"entity-name": ne.value.name,
|
|
823
823
|
"entity-type": s(a)("glossary.gateway_services"),
|
|
824
824
|
"on-confirm": te,
|
|
825
|
-
visible:
|
|
825
|
+
visible: S.value,
|
|
826
826
|
onCancel: ye,
|
|
827
827
|
onProceed: ye
|
|
828
828
|
}, null, 8, ["action", "entity-id", "entity-name", "entity-type", "visible"]),
|
|
@@ -834,7 +834,7 @@ const le = {
|
|
|
834
834
|
error: me.value,
|
|
835
835
|
title: s(a)("actions.delete.title"),
|
|
836
836
|
visible: W.value,
|
|
837
|
-
onCancel:
|
|
837
|
+
onCancel: z,
|
|
838
838
|
onProceed: Ue
|
|
839
839
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
840
840
|
]);
|
|
@@ -872,7 +872,7 @@ const le = {
|
|
|
872
872
|
},
|
|
873
873
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
874
874
|
setup(l) {
|
|
875
|
-
const L = l, { i18n: { t: m }, i18nT: d } = le.useI18n(), a = C(() => Ee.form[L.config.app].edit), { getPropValue: v } = Ze(), R = (r,
|
|
875
|
+
const L = l, { i18n: { t: m }, i18nT: d } = le.useI18n(), a = C(() => Ee.form[L.config.app].edit), { getPropValue: v } = Ze(), R = (r, A) => v(r, A) === !0 ? m("gateway_services.form.fields.tls_verify_option.true.display") : m("gateway_services.form.fields.tls_verify_option.false.display"), x = B({
|
|
876
876
|
id: {},
|
|
877
877
|
name: {
|
|
878
878
|
tooltip: m("gateway_services.form.fields.name.tooltip")
|
|
@@ -881,19 +881,19 @@ const le = {
|
|
|
881
881
|
updated_at: {},
|
|
882
882
|
created_at: {},
|
|
883
883
|
protocol: {
|
|
884
|
-
section:
|
|
884
|
+
section: Ve.Basic,
|
|
885
885
|
tooltip: m("gateway_services.form.fields.protocol.tooltip")
|
|
886
886
|
},
|
|
887
887
|
host: {
|
|
888
|
-
section:
|
|
888
|
+
section: Ve.Basic,
|
|
889
889
|
tooltip: m("gateway_services.form.fields.host.tooltip")
|
|
890
890
|
},
|
|
891
891
|
path: {
|
|
892
|
-
section:
|
|
892
|
+
section: Ve.Basic,
|
|
893
893
|
tooltip: m("gateway_services.form.fields.path.tooltip")
|
|
894
894
|
},
|
|
895
895
|
port: {
|
|
896
|
-
section:
|
|
896
|
+
section: Ve.Basic,
|
|
897
897
|
tooltip: m("gateway_services.form.fields.port.tooltip")
|
|
898
898
|
},
|
|
899
899
|
tags: {
|
|
@@ -932,7 +932,7 @@ const le = {
|
|
|
932
932
|
hidden: !0
|
|
933
933
|
}
|
|
934
934
|
});
|
|
935
|
-
return (r,
|
|
935
|
+
return (r, A) => (h(), I("div", Mt, [
|
|
936
936
|
n(s(gt), {
|
|
937
937
|
config: l.config,
|
|
938
938
|
"config-card-doc": l.configCardDoc,
|
|
@@ -940,9 +940,9 @@ const le = {
|
|
|
940
940
|
"entity-type": s(Je).GatewayService,
|
|
941
941
|
"fetch-url": a.value,
|
|
942
942
|
"hide-title": l.hideTitle,
|
|
943
|
-
"onFetch:error":
|
|
944
|
-
"onFetch:success":
|
|
945
|
-
onLoading:
|
|
943
|
+
"onFetch:error": A[0] || (A[0] = (E) => r.$emit("fetch:error", E)),
|
|
944
|
+
"onFetch:success": A[1] || (A[1] = (E) => r.$emit("fetch:success", E)),
|
|
945
|
+
onLoading: A[2] || (A[2] = (E) => r.$emit("loading", E))
|
|
946
946
|
}, {
|
|
947
947
|
"enabled-label-tooltip": c(() => [
|
|
948
948
|
n(s(d), {
|
|
@@ -950,10 +950,10 @@ const le = {
|
|
|
950
950
|
scope: "global"
|
|
951
951
|
}, {
|
|
952
952
|
false: c(() => [
|
|
953
|
-
|
|
953
|
+
T("code", null, k(s(m)("gateway_services.form.fields.enabled.false")), 1)
|
|
954
954
|
]),
|
|
955
955
|
true: c(() => [
|
|
956
|
-
|
|
956
|
+
T("code", null, k(s(m)("gateway_services.form.fields.enabled.true")), 1)
|
|
957
957
|
]),
|
|
958
958
|
_: 1
|
|
959
959
|
})
|
|
@@ -964,10 +964,10 @@ const le = {
|
|
|
964
964
|
scope: "global"
|
|
965
965
|
}, {
|
|
966
966
|
code1: c(() => [
|
|
967
|
-
|
|
967
|
+
T("code", null, k(s(m)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
968
968
|
]),
|
|
969
969
|
code2: c(() => [
|
|
970
|
-
|
|
970
|
+
T("code", null, k(s(m)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
971
971
|
]),
|
|
972
972
|
_: 1
|
|
973
973
|
})
|
|
@@ -978,7 +978,7 @@ const le = {
|
|
|
978
978
|
scope: "global"
|
|
979
979
|
}, {
|
|
980
980
|
code1: c(() => [
|
|
981
|
-
|
|
981
|
+
T("code", null, k(s(m)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
982
982
|
]),
|
|
983
983
|
_: 1
|
|
984
984
|
})
|
|
@@ -993,7 +993,7 @@ const le = {
|
|
|
993
993
|
}, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
|
|
994
994
|
]));
|
|
995
995
|
}
|
|
996
|
-
}),
|
|
996
|
+
}), G = {
|
|
997
997
|
name: "Kong-Air-Flights-API",
|
|
998
998
|
protocol: "https",
|
|
999
999
|
path: "/flights",
|
|
@@ -1002,7 +1002,7 @@ const le = {
|
|
|
1002
1002
|
}, Kt = "#d60027", Lt = { class: "tls-sans-field-container" }, Nt = {
|
|
1003
1003
|
key: 0,
|
|
1004
1004
|
class: "tls-sans-field-controls"
|
|
1005
|
-
},
|
|
1005
|
+
}, qt = { key: 0 }, Gt = /* @__PURE__ */ Pe({
|
|
1006
1006
|
__name: "GatewayServiceFormTlsSansField",
|
|
1007
1007
|
props: {
|
|
1008
1008
|
modelValue: {},
|
|
@@ -1022,13 +1022,13 @@ const le = {
|
|
|
1022
1022
|
const r = [...m.modelValue];
|
|
1023
1023
|
r.splice(x, 1), d("update:modelValue", r);
|
|
1024
1024
|
}, R = (x, r) => {
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1025
|
+
const A = [...m.modelValue];
|
|
1026
|
+
A[x] = r, d("update:modelValue", A), d("input");
|
|
1027
1027
|
};
|
|
1028
1028
|
return (x, r) => {
|
|
1029
|
-
const
|
|
1029
|
+
const A = U("KLabel"), E = U("KInput"), Q = U("KButton");
|
|
1030
1030
|
return h(), I("div", Lt, [
|
|
1031
|
-
n(
|
|
1031
|
+
n(A, { info: l.tooltip }, {
|
|
1032
1032
|
default: c(() => [
|
|
1033
1033
|
$(k(l.label), 1)
|
|
1034
1034
|
]),
|
|
@@ -1074,7 +1074,7 @@ const le = {
|
|
|
1074
1074
|
}, 8, ["data-testid", "disabled"])
|
|
1075
1075
|
]))
|
|
1076
1076
|
]))), 128)),
|
|
1077
|
-
l.modelValue.length === 0 && !l.readonly ? (h(), I("div",
|
|
1077
|
+
l.modelValue.length === 0 && !l.readonly ? (h(), I("div", qt, [
|
|
1078
1078
|
n(Q, {
|
|
1079
1079
|
"data-testid": `add-${l.testIdPrefix}`,
|
|
1080
1080
|
onClick: a
|
|
@@ -1089,7 +1089,7 @@ const le = {
|
|
|
1089
1089
|
]);
|
|
1090
1090
|
};
|
|
1091
1091
|
}
|
|
1092
|
-
}), Oe = /* @__PURE__ */ Le(
|
|
1092
|
+
}), Oe = /* @__PURE__ */ Le(Gt, [["__scopeId", "data-v-9b2cc5e4"]]), Wt = { class: "kong-ui-entities-gateway-service-form" }, Ot = {
|
|
1093
1093
|
key: 0,
|
|
1094
1094
|
class: "gateway-service-form-general-info"
|
|
1095
1095
|
}, jt = { class: "gateway-service-form-group-selection-wrapper" }, zt = {
|
|
@@ -1142,12 +1142,18 @@ const le = {
|
|
|
1142
1142
|
type: Boolean,
|
|
1143
1143
|
required: !1,
|
|
1144
1144
|
default: !1
|
|
1145
|
+
},
|
|
1146
|
+
/** Whether tls_sans fields are supported */
|
|
1147
|
+
isTlsSansSupported: {
|
|
1148
|
+
type: Boolean,
|
|
1149
|
+
required: !1,
|
|
1150
|
+
default: !0
|
|
1145
1151
|
}
|
|
1146
1152
|
},
|
|
1147
1153
|
emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated", "try-sample-api"],
|
|
1148
1154
|
setup(l, { expose: L, emit: m }) {
|
|
1149
|
-
var
|
|
1150
|
-
const d = m, a = l, v = B(!0), R = ze(), { i18nT: x, i18n: { t: r } } = le.useI18n(), { getErrorFieldsFromError:
|
|
1155
|
+
var q;
|
|
1156
|
+
const d = m, a = l, v = B(!0), R = ze(), { i18nT: x, i18n: { t: r } } = le.useI18n(), { getErrorFieldsFromError: A } = yt(), { axiosInstance: E } = He((q = a.config) == null ? void 0 : q.axiosRequestConfig), Q = _t(), { validateHost: re, validatePath: N, validatePort: X, validateProtocol: ie } = le.useUrlValidators(), { objectsAreEqual: Fe } = Ze(), j = C(() => Ee.form[a.config.app].edit), Y = C(() => a.gatewayServiceId ? Ge.Edit : Ge.Create), $e = B(!1), ee = C(() => !!a.gatewayServiceId), P = B(ee.value ? "protocol" : "url"), fe = le.usePortFromProtocol(), pe = B(""), ae = C(() => !!pe.value || !!se("name")), e = Ne({
|
|
1151
1157
|
fields: {
|
|
1152
1158
|
name: "",
|
|
1153
1159
|
protocol: "http",
|
|
@@ -1187,7 +1193,7 @@ const le = {
|
|
|
1187
1193
|
tls_verify_enabled: "",
|
|
1188
1194
|
tls_verify_value: ""
|
|
1189
1195
|
}
|
|
1190
|
-
}),
|
|
1196
|
+
}), S = Ne({
|
|
1191
1197
|
name: "",
|
|
1192
1198
|
protocol: "http",
|
|
1193
1199
|
host: "",
|
|
@@ -1267,22 +1273,22 @@ const le = {
|
|
|
1267
1273
|
], ge = { url: "url", protocol: "protocol" }, ye = (t) => {
|
|
1268
1274
|
e.fields.protocol = t.value, e.fields.port = fe.getPortFromProtocol(e.fields.protocol, String(e.fields.port));
|
|
1269
1275
|
}, te = (t) => t ? parseFloat(t) : 0, _e = () => {
|
|
1270
|
-
e.fields.host =
|
|
1271
|
-
dnsnames: [...
|
|
1272
|
-
uris: [...
|
|
1273
|
-
}, e.fields.ca_certificates =
|
|
1276
|
+
e.fields.host = S.host, e.fields.path = S.path, e.fields.port = S.port, e.fields.protocol = S.protocol, e.fields.url = S.url, e.fields.retries = S.retries, e.fields.connect_timeout = S.connect_timeout, e.fields.write_timeout = S.write_timeout, e.fields.read_timeout = S.read_timeout, e.fields.client_certificate = S.client_certificate, e.fields.tls_sans = {
|
|
1277
|
+
dnsnames: [...S.tls_sans.dnsnames],
|
|
1278
|
+
uris: [...S.tls_sans.uris]
|
|
1279
|
+
}, e.fields.ca_certificates = S.ca_certificates, e.fields.tls_verify_enabled = S.tls_verify_enabled, e.fields.tls_verify_value = S.tls_verify_value, e.fields.enabled = S.enabled;
|
|
1274
1280
|
}, be = () => {
|
|
1275
1281
|
v.value = !0, W(), e.errorMessages = [], _e();
|
|
1276
1282
|
}, he = () => {
|
|
1277
|
-
switch (_e(), e.fields.name = `${
|
|
1283
|
+
switch (_e(), e.fields.name = `${G.name}-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, P.value) {
|
|
1278
1284
|
case "url":
|
|
1279
|
-
e.fields.url = `${
|
|
1285
|
+
e.fields.url = `${G.protocol}://${G.host}${G.path}`;
|
|
1280
1286
|
break;
|
|
1281
1287
|
case "protocol":
|
|
1282
|
-
e.fields.host =
|
|
1288
|
+
e.fields.host = G.host, e.fields.path = G.path, e.fields.protocol = G.protocol, e.fields.port = G.port;
|
|
1283
1289
|
break;
|
|
1284
1290
|
default:
|
|
1285
|
-
e.fields.url = `${
|
|
1291
|
+
e.fields.url = `${G.protocol}://${G.host}${G.path}`;
|
|
1286
1292
|
}
|
|
1287
1293
|
}, we = () => {
|
|
1288
1294
|
if (W(), e.fields.url.length)
|
|
@@ -1298,14 +1304,14 @@ const le = {
|
|
|
1298
1304
|
e.fields.path = t.pathname;
|
|
1299
1305
|
const y = X(t.port);
|
|
1300
1306
|
if (y) throw new Error(y);
|
|
1301
|
-
const
|
|
1302
|
-
$e.value = !!
|
|
1307
|
+
const V = Number(t.port);
|
|
1308
|
+
$e.value = !!V, e.fields.port = V || fe.getPortFromProtocol(e.fields.protocol), d("url-valid:success");
|
|
1303
1309
|
} catch {
|
|
1304
1310
|
d("url-valid:error", r("gateway_services.form.errors.url.invalid")), e.formFieldErrors.url = r("gateway_services.form.errors.url.invalid");
|
|
1305
1311
|
}
|
|
1306
1312
|
}, ce = (t) => {
|
|
1307
1313
|
W(t);
|
|
1308
|
-
},
|
|
1314
|
+
}, Te = C(() => !!e.formFieldErrors.url || !!e.formFieldErrors.host || !!e.formFieldErrors.port), se = (t) => {
|
|
1309
1315
|
if (e.errorMessages.length) return "";
|
|
1310
1316
|
const o = e.formFieldErrors;
|
|
1311
1317
|
return o[t] ? o[t] : "";
|
|
@@ -1331,7 +1337,7 @@ const le = {
|
|
|
1331
1337
|
return !0;
|
|
1332
1338
|
}), me = () => {
|
|
1333
1339
|
e.fields.url && P.value === "url" ? we() : K();
|
|
1334
|
-
},
|
|
1340
|
+
}, Ae = () => `new-service-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, ke = C(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(e.fields.protocol)), z = C(() => {
|
|
1335
1341
|
if (P.value === "url")
|
|
1336
1342
|
return !0;
|
|
1337
1343
|
const t = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
@@ -1341,17 +1347,17 @@ const le = {
|
|
|
1341
1347
|
return !0;
|
|
1342
1348
|
const t = ["https", "tls"].includes(e.fields.protocol);
|
|
1343
1349
|
return P.value === "protocol" && t;
|
|
1344
|
-
}),
|
|
1350
|
+
}), Se = (t) => {
|
|
1345
1351
|
W("name"), pe.value = Q.utf8Name(t);
|
|
1346
1352
|
}, Z = C(() => {
|
|
1347
|
-
const t = !ee.value || !Fe(e.fields,
|
|
1353
|
+
const t = !ee.value || !Fe(e.fields, S), o = P.value === "url" && !!e.fields.url && oe.value, b = P.value === "protocol" && !!e.fields.host && oe.value;
|
|
1348
1354
|
return t && (o || b);
|
|
1349
1355
|
}), ve = (t) => {
|
|
1350
|
-
var o, b, f, y,
|
|
1356
|
+
var o, b, f, y, V;
|
|
1351
1357
|
e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((o = t == null ? void 0 : t.tags) == null ? void 0 : o.join(", ")) || "", e.fields.protocol = (t == null ? void 0 : t.protocol) || "http", e.fields.path = (t == null ? void 0 : t.path) || "", e.fields.read_timeout = t != null && t.read_timeout || (t == null ? void 0 : t.read_timeout) === 0 ? t == null ? void 0 : t.read_timeout : 6e4, e.fields.retries = t != null && t.retries || (t == null ? void 0 : t.retries) === 0 ? t == null ? void 0 : t.retries : 5, e.fields.host = (t == null ? void 0 : t.host) || "", e.fields.connect_timeout = t != null && t.connect_timeout || (t == null ? void 0 : t.connect_timeout) === 0 ? t == null ? void 0 : t.connect_timeout : 6e4, e.fields.tls_verify_enabled = (t == null ? void 0 : t.tls_verify) !== "" && (t == null ? void 0 : t.tls_verify) !== null && (t == null ? void 0 : t.tls_verify) !== void 0, e.fields.tls_verify_value = t != null && t.tls_verify ? t == null ? void 0 : t.tls_verify : !1, e.fields.ca_certificates = ((b = t == null ? void 0 : t.ca_certificates) == null ? void 0 : b.join(",")) || "", e.fields.client_certificate = ((f = t == null ? void 0 : t.client_certificate) == null ? void 0 : f.id) || "", e.fields.tls_sans = {
|
|
1352
1358
|
dnsnames: ((y = t == null ? void 0 : t.tls_sans) == null ? void 0 : y.dnsnames) ?? [""],
|
|
1353
|
-
uris: ((
|
|
1354
|
-
}, e.fields.write_timeout = t != null && t.write_timeout || (t == null ? void 0 : t.write_timeout) === 0 ? t == null ? void 0 : t.write_timeout : 6e4, e.fields.port = t != null && t.port || (t == null ? void 0 : t.port) === 0 ? t == null ? void 0 : t.port : 80, e.fields.enabled = (t == null ? void 0 : t.enabled) ?? !0, Object.assign(
|
|
1359
|
+
uris: ((V = t == null ? void 0 : t.tls_sans) == null ? void 0 : V.uris) ?? [""]
|
|
1360
|
+
}, e.fields.write_timeout = t != null && t.write_timeout || (t == null ? void 0 : t.write_timeout) === 0 ? t == null ? void 0 : t.write_timeout : 6e4, e.fields.port = t != null && t.port || (t == null ? void 0 : t.port) === 0 ? t == null ? void 0 : t.port : 80, e.fields.enabled = (t == null ? void 0 : t.enabled) ?? !0, Object.assign(S, e.fields), S.tls_sans = {
|
|
1355
1361
|
dnsnames: [...e.fields.tls_sans.dnsnames],
|
|
1356
1362
|
uris: [...e.fields.tls_sans.uris]
|
|
1357
1363
|
};
|
|
@@ -1362,6 +1368,10 @@ const le = {
|
|
|
1362
1368
|
let t = `${a.config.apiBaseUrl}${Ee.form[a.config.app][Y.value]}`;
|
|
1363
1369
|
return a.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((o = a.config) == null ? void 0 : o.controlPlaneId) || "") : a.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (b = a.config) != null && b.workspace ? `/${a.config.workspace}` : "")), t = t.replace(/{id}/gi, a.gatewayServiceId), t;
|
|
1364
1370
|
}), _ = C(() => {
|
|
1371
|
+
if (!a.isTlsSansSupported)
|
|
1372
|
+
return;
|
|
1373
|
+
if (!z.value)
|
|
1374
|
+
return null;
|
|
1365
1375
|
const t = e.fields.tls_sans.dnsnames.map((b) => b.trim()).filter(Boolean), o = e.fields.tls_sans.uris.map((b) => b.trim()).filter(Boolean);
|
|
1366
1376
|
return t.length || o.length ? {
|
|
1367
1377
|
dnsnames: t.length ? t : null,
|
|
@@ -1371,14 +1381,14 @@ const le = {
|
|
|
1371
1381
|
var o, b, f, y;
|
|
1372
1382
|
const t = {
|
|
1373
1383
|
name: e.fields.name || null,
|
|
1374
|
-
tags: e.fields.tags ? (f = (b = (o = e.fields.tags) == null ? void 0 : o.split(",")) == null ? void 0 : b.map((
|
|
1384
|
+
tags: e.fields.tags ? (f = (b = (o = e.fields.tags) == null ? void 0 : o.split(",")) == null ? void 0 : b.map((V) => String(V || "").trim())) == null ? void 0 : f.filter((V) => V !== "") : null,
|
|
1375
1385
|
protocol: e.fields.protocol,
|
|
1376
1386
|
path: e.fields.path || null,
|
|
1377
1387
|
read_timeout: e.fields.read_timeout,
|
|
1378
1388
|
retries: e.fields.retries,
|
|
1379
1389
|
host: e.fields.host,
|
|
1380
1390
|
connect_timeout: e.fields.connect_timeout,
|
|
1381
|
-
ca_certificates: e.fields.ca_certificates ? (y = e.fields.ca_certificates) == null ? void 0 : y.split(",").filter((
|
|
1391
|
+
ca_certificates: e.fields.ca_certificates ? (y = e.fields.ca_certificates) == null ? void 0 : y.split(",").filter((V) => V !== "") : null,
|
|
1382
1392
|
client_certificate: e.fields.client_certificate ? { id: e.fields.client_certificate } : null,
|
|
1383
1393
|
tls_sans: _.value,
|
|
1384
1394
|
write_timeout: e.fields.write_timeout,
|
|
@@ -1386,9 +1396,9 @@ const le = {
|
|
|
1386
1396
|
url: e.fields.url,
|
|
1387
1397
|
enabled: e.fields.enabled
|
|
1388
1398
|
};
|
|
1389
|
-
return
|
|
1399
|
+
return z.value || (t.client_certificate = null), e.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.tls_verify = e.fields.tls_verify_value), ke.value || (t.path = null), Y.value === "create" ? P.value === "url" ? (delete t.protocol, delete t.host, delete t.path, a.config.app === "konnect" && delete t.port) : delete t.url : Y.value === "edit" && delete t.url, t;
|
|
1390
1400
|
}), O = async () => {
|
|
1391
|
-
var t, o, b, f, y,
|
|
1401
|
+
var t, o, b, f, y, V;
|
|
1392
1402
|
try {
|
|
1393
1403
|
e.isReadonly = !0;
|
|
1394
1404
|
const J = w.value;
|
|
@@ -1398,14 +1408,14 @@ const le = {
|
|
|
1398
1408
|
e.fields.name = (i == null ? void 0 : i.name) || "", e.fields.port = i.port || fe.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 = ((o = i == null ? void 0 : i.client_certificate) == null ? void 0 : o.id) || "", e.fields.tls_sans = {
|
|
1399
1409
|
dnsnames: ((b = i == null ? void 0 : i.tls_sans) == null ? void 0 : b.dnsnames) ?? [],
|
|
1400
1410
|
uris: ((f = i == null ? void 0 : i.tls_sans) == null ? void 0 : f.uris) ?? []
|
|
1401
|
-
}, 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 = (
|
|
1411
|
+
}, 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 = (V = i == null ? void 0 : i.tags) != null && V.length ? i.tags.join(", ") : "", e.fields.enabled = (i == null ? void 0 : i.enabled) ?? !0, Object.assign(S, e.fields), S.tls_sans = {
|
|
1402
1412
|
dnsnames: [...e.fields.tls_sans.dnsnames],
|
|
1403
1413
|
uris: [...e.fields.tls_sans.uris]
|
|
1404
1414
|
}, d("update", D == null ? void 0 : D.data);
|
|
1405
1415
|
}
|
|
1406
1416
|
return D;
|
|
1407
1417
|
} catch (J) {
|
|
1408
|
-
const { fields: D, messages: i } =
|
|
1418
|
+
const { fields: D, messages: i } = A(J);
|
|
1409
1419
|
e.errorMessages = i, D.length && D.forEach((u) => {
|
|
1410
1420
|
const de = u.field;
|
|
1411
1421
|
de === "client_certificate.id" ? e.formFieldErrors.client_certificate = u.message : de.startsWith("tls_sans.dnsnames") ? e.formFieldErrors.tls_sans_dnsnames = u.message : de.startsWith("tls_sans.uris") ? e.formFieldErrors.tls_sans_uris = u.message : de.startsWith("ca_certificates") ? e.formFieldErrors.ca_certificates = u.message : Object.keys(e.formFieldErrors).includes(de) && (e.formFieldErrors = {
|
|
@@ -1418,11 +1428,11 @@ const le = {
|
|
|
1418
1428
|
}
|
|
1419
1429
|
};
|
|
1420
1430
|
return Me(() => a.gatewayServiceId, () => {
|
|
1421
|
-
Object.assign(e.fields,
|
|
1431
|
+
Object.assign(e.fields, S);
|
|
1422
1432
|
}), Me(e.fields, () => {
|
|
1423
1433
|
d("model-updated", w.value);
|
|
1424
1434
|
}), Ye(() => {
|
|
1425
|
-
d("model-updated", w.value), ee.value || (e.fields.name =
|
|
1435
|
+
d("model-updated", w.value), ee.value || (e.fields.name = Ae());
|
|
1426
1436
|
}), L({
|
|
1427
1437
|
validateUrl: me,
|
|
1428
1438
|
getPayload: w,
|
|
@@ -1430,7 +1440,7 @@ const le = {
|
|
|
1430
1440
|
canSubmit: Z,
|
|
1431
1441
|
initForm: ve
|
|
1432
1442
|
}), (t, o) => {
|
|
1433
|
-
const b = U("KRadio"), f = U("KButton"), y = U("KInput"),
|
|
1443
|
+
const b = U("KRadio"), f = U("KButton"), y = U("KInput"), V = U("KSelect"), J = U("KCheckbox"), D = U("KCollapse"), i = U("KAlert");
|
|
1434
1444
|
return h(), I("div", Wt, [
|
|
1435
1445
|
n(s(ht), {
|
|
1436
1446
|
"can-submit": Z.value,
|
|
@@ -1461,7 +1471,7 @@ const le = {
|
|
|
1461
1471
|
}, {
|
|
1462
1472
|
default: c(() => [
|
|
1463
1473
|
ee.value ? F("", !0) : (h(), I("div", Ot, [
|
|
1464
|
-
|
|
1474
|
+
T("div", jt, [
|
|
1465
1475
|
n(b, {
|
|
1466
1476
|
modelValue: P.value,
|
|
1467
1477
|
"onUpdate:modelValue": o[0] || (o[0] = (u) => P.value = u),
|
|
@@ -1495,7 +1505,7 @@ const le = {
|
|
|
1495
1505
|
modelModifiers: { trim: !0 },
|
|
1496
1506
|
class: "gateway-service-url-input gateway-service-form-margin-bottom",
|
|
1497
1507
|
"data-testid": "gateway-service-url-input",
|
|
1498
|
-
error:
|
|
1508
|
+
error: Te.value,
|
|
1499
1509
|
"error-message": se("url"),
|
|
1500
1510
|
label: s(r)("gateway_services.form.fields.upstream_url.label"),
|
|
1501
1511
|
"label-attributes": {
|
|
@@ -1533,7 +1543,7 @@ const le = {
|
|
|
1533
1543
|
n(xe, { name: "slide-fade" }, {
|
|
1534
1544
|
default: c(() => [
|
|
1535
1545
|
P.value === "protocol" || ee.value ? (h(), I("div", Ht, [
|
|
1536
|
-
n(
|
|
1546
|
+
n(V, {
|
|
1537
1547
|
modelValue: e.fields.protocol,
|
|
1538
1548
|
"onUpdate:modelValue": o[3] || (o[3] = (u) => e.fields.protocol = u),
|
|
1539
1549
|
"data-testid": "gateway-service-protocol-select",
|
|
@@ -1638,7 +1648,7 @@ const le = {
|
|
|
1638
1648
|
n(xe, { name: "slide-fade" }, {
|
|
1639
1649
|
default: c(() => [
|
|
1640
1650
|
v.value ? F("", !0) : (h(), I("div", Jt, [
|
|
1641
|
-
|
|
1651
|
+
T("div", Qt, [
|
|
1642
1652
|
n(y, {
|
|
1643
1653
|
modelValue: e.fields.retries,
|
|
1644
1654
|
"onUpdate:modelValue": [
|
|
@@ -1659,7 +1669,7 @@ const le = {
|
|
|
1659
1669
|
type: "number"
|
|
1660
1670
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1661
1671
|
]),
|
|
1662
|
-
|
|
1672
|
+
T("div", Xt, [
|
|
1663
1673
|
n(y, {
|
|
1664
1674
|
modelValue: e.fields.connect_timeout,
|
|
1665
1675
|
"onUpdate:modelValue": [
|
|
@@ -1680,7 +1690,7 @@ const le = {
|
|
|
1680
1690
|
type: "number"
|
|
1681
1691
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1682
1692
|
]),
|
|
1683
|
-
|
|
1693
|
+
T("div", Yt, [
|
|
1684
1694
|
n(y, {
|
|
1685
1695
|
modelValue: e.fields.write_timeout,
|
|
1686
1696
|
"onUpdate:modelValue": [
|
|
@@ -1701,7 +1711,7 @@ const le = {
|
|
|
1701
1711
|
type: "number"
|
|
1702
1712
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1703
1713
|
]),
|
|
1704
|
-
|
|
1714
|
+
T("div", es, [
|
|
1705
1715
|
n(y, {
|
|
1706
1716
|
modelValue: e.fields.read_timeout,
|
|
1707
1717
|
"onUpdate:modelValue": [
|
|
@@ -1722,7 +1732,7 @@ const le = {
|
|
|
1722
1732
|
type: "number"
|
|
1723
1733
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1724
1734
|
]),
|
|
1725
|
-
|
|
1735
|
+
z.value ? (h(), I("div", ts, [
|
|
1726
1736
|
n(y, {
|
|
1727
1737
|
modelValue: e.fields.client_certificate,
|
|
1728
1738
|
"onUpdate:modelValue": o[19] || (o[19] = (u) => e.fields.client_certificate = u),
|
|
@@ -1742,7 +1752,7 @@ const le = {
|
|
|
1742
1752
|
onInput: o[20] || (o[20] = (u) => ce("client_certificate"))
|
|
1743
1753
|
}, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"])
|
|
1744
1754
|
])) : F("", !0),
|
|
1745
|
-
|
|
1755
|
+
z.value && l.isTlsSansSupported ? (h(), H(Oe, {
|
|
1746
1756
|
key: 1,
|
|
1747
1757
|
modelValue: e.fields.tls_sans.dnsnames,
|
|
1748
1758
|
"onUpdate:modelValue": o[21] || (o[21] = (u) => e.fields.tls_sans.dnsnames = u),
|
|
@@ -1757,7 +1767,7 @@ const le = {
|
|
|
1757
1767
|
tooltip: s(r)("gateway_services.form.fields.tls_sans_dnsnames.tooltip"),
|
|
1758
1768
|
onInput: o[22] || (o[22] = (u) => ce("tls_sans_dnsnames"))
|
|
1759
1769
|
}, null, 8, ["modelValue", "add-button-text", "error", "label", "placeholder", "readonly", "tooltip"])) : F("", !0),
|
|
1760
|
-
|
|
1770
|
+
z.value && l.isTlsSansSupported ? (h(), H(Oe, {
|
|
1761
1771
|
key: 2,
|
|
1762
1772
|
modelValue: e.fields.tls_sans.uris,
|
|
1763
1773
|
"onUpdate:modelValue": o[23] || (o[23] = (u) => e.fields.tls_sans.uris = u),
|
|
@@ -1793,10 +1803,10 @@ const le = {
|
|
|
1793
1803
|
scope: "global"
|
|
1794
1804
|
}, {
|
|
1795
1805
|
code1: c(() => [
|
|
1796
|
-
|
|
1806
|
+
T("code", null, k(s(r)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
1797
1807
|
]),
|
|
1798
1808
|
code2: c(() => [
|
|
1799
|
-
|
|
1809
|
+
T("code", null, k(s(r)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
1800
1810
|
]),
|
|
1801
1811
|
_: 1
|
|
1802
1812
|
})
|
|
@@ -1804,7 +1814,7 @@ const le = {
|
|
|
1804
1814
|
_: 1
|
|
1805
1815
|
}, 8, ["modelValue", "error", "label", "placeholder", "readonly"])
|
|
1806
1816
|
])) : F("", !0),
|
|
1807
|
-
|
|
1817
|
+
z.value ? (h(), I("div", os, [
|
|
1808
1818
|
n(J, {
|
|
1809
1819
|
modelValue: e.fields.tls_verify_enabled,
|
|
1810
1820
|
"onUpdate:modelValue": o[27] || (o[27] = (u) => e.fields.tls_verify_enabled = u),
|
|
@@ -1819,7 +1829,7 @@ const le = {
|
|
|
1819
1829
|
scope: "global"
|
|
1820
1830
|
}, {
|
|
1821
1831
|
code1: c(() => [
|
|
1822
|
-
|
|
1832
|
+
T("code", null, k(s(r)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
1823
1833
|
]),
|
|
1824
1834
|
_: 1
|
|
1825
1835
|
})
|
|
@@ -1878,7 +1888,7 @@ const le = {
|
|
|
1878
1888
|
placeholder: s(r)("gateway_services.form.fields.name.placeholder"),
|
|
1879
1889
|
readonly: e.isReadonly,
|
|
1880
1890
|
type: "text",
|
|
1881
|
-
onInput:
|
|
1891
|
+
onInput: Se
|
|
1882
1892
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1883
1893
|
n(D, {
|
|
1884
1894
|
"data-testid": "tags-collapse",
|
|
@@ -1886,7 +1896,7 @@ const le = {
|
|
|
1886
1896
|
"trigger-label": s(r)("gateway_services.form.fields.tags.collapse")
|
|
1887
1897
|
}, {
|
|
1888
1898
|
default: c(() => [
|
|
1889
|
-
|
|
1899
|
+
T("div", is, [
|
|
1890
1900
|
n(y, {
|
|
1891
1901
|
modelValue: e.fields.tags,
|
|
1892
1902
|
"onUpdate:modelValue": o[32] || (o[32] = (u) => e.fields.tags = u),
|
|
@@ -1912,13 +1922,13 @@ const le = {
|
|
|
1912
1922
|
]),
|
|
1913
1923
|
_: 1
|
|
1914
1924
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
1915
|
-
e.errorMessages.length ? (h(),
|
|
1925
|
+
e.errorMessages.length ? (h(), H(i, {
|
|
1916
1926
|
key: 0,
|
|
1917
1927
|
appearance: "danger",
|
|
1918
1928
|
"data-testid": "form-error"
|
|
1919
1929
|
}, {
|
|
1920
1930
|
default: c(() => [
|
|
1921
|
-
|
|
1931
|
+
T("ul", as, [
|
|
1922
1932
|
(h(!0), I(Ke, null, je(e.errorMessages, (u) => (h(), I("li", { key: u }, k(u), 1))), 128))
|
|
1923
1933
|
])
|
|
1924
1934
|
]),
|
|
@@ -1930,7 +1940,7 @@ const le = {
|
|
|
1930
1940
|
]);
|
|
1931
1941
|
};
|
|
1932
1942
|
}
|
|
1933
|
-
}), hs = /* @__PURE__ */ Le(ns, [["__scopeId", "data-v-
|
|
1943
|
+
}), hs = /* @__PURE__ */ Le(ns, [["__scopeId", "data-v-db4867fb"]]), { validateHost: cs, validatePort: ds, validateProtocol: us, validatePath: fs } = le.useUrlValidators(), ws = () => ({
|
|
1934
1944
|
validateHost: cs,
|
|
1935
1945
|
validatePort: ds,
|
|
1936
1946
|
validateProtocol: us,
|