@kong-ui-public/entities-gateway-services 3.10.6-pr.2001.e73b22c4d.0 → 3.10.6-pr.2001.fda319139.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-gateway-services.es.js +329 -325
- package/dist/entities-gateway-services.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/GatewayServiceForm.vue.d.ts.map +1 -1
- package/dist/types/composables/useUrlValidators.d.ts +3 -3
- package/dist/types/composables/useUrlValidators.d.ts.map +1 -1
- package/dist/types/types/gateway-service-form.d.ts +0 -5
- package/dist/types/types/gateway-service-form.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Ke, computed as h, ref as W, watch as $e, onBeforeMount as lt, resolveComponent as D, openBlock as C, createElementBlock as F, createVNode as u, unref as o, createSlots as Re, withCtx as v, createBlock as Fe, Teleport as je, createElementVNode as S, createCommentVNode as M, createTextVNode as z, toDisplayString as P, withModifiers as Le, reactive as Te, onMounted as Ze, renderSlot as Qe, toValue as ze, Transition as We, Fragment as ot, renderList as it } from "vue";
|
|
2
2
|
import { useRouter as qe } from "vue-router";
|
|
3
3
|
import { BookIcon as He, AddIcon as rt, ServicesIcon as st } from "@kong/icons";
|
|
4
4
|
import { createI18n as at, i18nTComponent as nt } from "@kong-ui-public/i18n";
|
|
5
|
-
import { useAxios as Oe, useTableState as ct, useFetcher as
|
|
5
|
+
import { useAxios as Oe, useTableState as ct, useFetcher as ut, useDeleteUrlBuilder as dt, FetcherStatus as ft, EntityBaseTable as pt, EntityFilter as mt, PermissionsWrapper as Ee, TableTags as vt, EntityEmptyState as gt, EntityToggleModal as yt, EntityDeleteModal as _t, EntityTypes as bt, useErrors as Xe, useValidators as Ye, EntityBaseFormType as Me, useGatewayFeatureSupported as et, EntityBaseForm as tt, SupportedEntityType as Ge, EntityFormSection as Be, useHelpers as ht, ConfigurationSchemaSection as Ue, ConfigurationSchemaType as wt, EntityBaseConfigCard as kt } from "@kong-ui-public/entities-shared";
|
|
6
6
|
const Vt = {
|
|
7
7
|
create: "New gateway service",
|
|
8
8
|
serverless_create: "Add a Service",
|
|
@@ -58,8 +58,8 @@ const Vt = {
|
|
|
58
58
|
},
|
|
59
59
|
errors: {
|
|
60
60
|
host: {
|
|
61
|
-
empty: "
|
|
62
|
-
invalid: "
|
|
61
|
+
empty: "Host cannot be empty",
|
|
62
|
+
invalid: "Invalid host"
|
|
63
63
|
},
|
|
64
64
|
port: {
|
|
65
65
|
type: "Port must be a number",
|
|
@@ -70,8 +70,11 @@ const Vt = {
|
|
|
70
70
|
invalid: "Path should not include characters outside of the reserved list of RFC 3986"
|
|
71
71
|
},
|
|
72
72
|
protocol: {
|
|
73
|
-
empty: "
|
|
74
|
-
invalid: "
|
|
73
|
+
empty: "Protocol cannot be empty",
|
|
74
|
+
invalid: "Protocol - value must be one of http, https, grpc, grpcs, tcp, udp, tls, tls_passthrough, ws, wss"
|
|
75
|
+
},
|
|
76
|
+
url: {
|
|
77
|
+
invalid: "URL validation failed"
|
|
75
78
|
}
|
|
76
79
|
},
|
|
77
80
|
sections: {
|
|
@@ -84,7 +87,7 @@ const Vt = {
|
|
|
84
87
|
description: "Define where this service should send requests.",
|
|
85
88
|
checkedGroupLabel: "Choose how and where to send traffic",
|
|
86
89
|
urlLabel: "Full URL",
|
|
87
|
-
checkedGroupAltLabel: "Protocol,
|
|
90
|
+
checkedGroupAltLabel: "Protocol, host, port and path",
|
|
88
91
|
url: {
|
|
89
92
|
label: "Full URL",
|
|
90
93
|
description: "Define the service using a single, complete API URL for simple setup."
|
|
@@ -218,7 +221,7 @@ const Vt = {
|
|
|
218
221
|
copy: Pt,
|
|
219
222
|
glossary: Et
|
|
220
223
|
};
|
|
221
|
-
function
|
|
224
|
+
function $t() {
|
|
222
225
|
const n = at("en-us", Ft);
|
|
223
226
|
return {
|
|
224
227
|
i18n: n,
|
|
@@ -226,13 +229,13 @@ function Ut() {
|
|
|
226
229
|
// Translation component <i18n-t>
|
|
227
230
|
};
|
|
228
231
|
}
|
|
229
|
-
function
|
|
232
|
+
function Ut() {
|
|
230
233
|
return {
|
|
231
|
-
getPortFromProtocol: (
|
|
234
|
+
getPortFromProtocol: (B, y) => {
|
|
232
235
|
const p = [80, 443], a = Number(y);
|
|
233
236
|
if ((a || a === 0) && !p.includes(a))
|
|
234
237
|
return a;
|
|
235
|
-
switch (
|
|
238
|
+
switch (B) {
|
|
236
239
|
case "grpcs":
|
|
237
240
|
case "tls":
|
|
238
241
|
case "https":
|
|
@@ -248,48 +251,52 @@ function $t() {
|
|
|
248
251
|
}
|
|
249
252
|
};
|
|
250
253
|
}
|
|
251
|
-
function
|
|
254
|
+
function xt() {
|
|
252
255
|
const { i18n: { t: n } } = ge.useI18n();
|
|
253
256
|
return {
|
|
254
|
-
validateHost: (b) =>
|
|
255
|
-
|
|
257
|
+
validateHost: (b) => {
|
|
258
|
+
if (!b || b.trim() === "") return n("gateway_services.form.errors.host.empty");
|
|
259
|
+
const T = /^(?!:\/\/)([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
|
|
260
|
+
return /^((25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])$/.test(b) || T.test(b) ? "" : n("gateway_services.form.errors.host.invalid");
|
|
261
|
+
},
|
|
262
|
+
validateProtocol: (b, T) => !b || b.trim() === "" ? n("gateway_services.form.errors.protocol.empty") : (b = b.slice(0, -1), T.find((r) => {
|
|
256
263
|
if (r.value === b) return r;
|
|
257
264
|
}) === void 0 ? n("gateway_services.form.errors.protocol.invalid") : ""),
|
|
258
265
|
validatePath: (b) => !b || b === "" ? "" : b.startsWith("/") ? /[^A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]/.test(b) ? n("gateway_services.form.errors.path.invalid") : "" : n("gateway_services.form.errors.path.prefix"),
|
|
259
266
|
validatePort: (b) => {
|
|
260
267
|
if (b == null || b === "")
|
|
261
268
|
return "";
|
|
262
|
-
const
|
|
263
|
-
return isNaN(
|
|
269
|
+
const T = typeof b == "string" ? parseInt(b, 10) : b;
|
|
270
|
+
return isNaN(T) ? n("gateway_services.form.errors.port.type") : T < 0 || T > 65535 ? n("gateway_services.form.errors.port.invalid") : "";
|
|
264
271
|
}
|
|
265
272
|
};
|
|
266
273
|
}
|
|
267
274
|
const ge = {
|
|
268
|
-
useI18n:
|
|
269
|
-
usePortFromProtocol:
|
|
270
|
-
useUrlValidators:
|
|
271
|
-
},
|
|
275
|
+
useI18n: $t,
|
|
276
|
+
usePortFromProtocol: Ut,
|
|
277
|
+
useUrlValidators: xt
|
|
278
|
+
}, xe = "/v2/control-planes/{controlPlaneId}/core-entities", Ae = "/{workspace}", ye = {
|
|
272
279
|
list: {
|
|
273
280
|
konnect: {
|
|
274
|
-
all: `${
|
|
281
|
+
all: `${xe}/services`
|
|
275
282
|
},
|
|
276
283
|
kongManager: {
|
|
277
|
-
all: `${
|
|
284
|
+
all: `${Ae}/services`
|
|
278
285
|
}
|
|
279
286
|
},
|
|
280
287
|
form: {
|
|
281
288
|
konnect: {
|
|
282
|
-
create: `${
|
|
283
|
-
validate: `${
|
|
284
|
-
edit: `${
|
|
289
|
+
create: `${xe}/services`,
|
|
290
|
+
validate: `${xe}/v1/schemas/json/service/validate`,
|
|
291
|
+
edit: `${xe}/services/{id}`
|
|
285
292
|
},
|
|
286
293
|
kongManager: {
|
|
287
|
-
create: `${
|
|
288
|
-
validate: `${
|
|
289
|
-
edit: `${
|
|
294
|
+
create: `${Ae}/services`,
|
|
295
|
+
validate: `${Ae}/schemas/services/validate`,
|
|
296
|
+
edit: `${Ae}/services/{id}`
|
|
290
297
|
}
|
|
291
298
|
}
|
|
292
|
-
},
|
|
299
|
+
}, At = "#00abd2", Rt = "24px", Tt = { class: "kong-ui-entities-gateway-services-list" }, Mt = { class: "button-row" }, Bt = { class: "empty-state-icon-gateway" }, Kt = { key: 1 }, Lt = /* @__PURE__ */ Ke({
|
|
293
300
|
__name: "GatewayServiceList",
|
|
294
301
|
props: {
|
|
295
302
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -347,9 +354,9 @@ const ge = {
|
|
|
347
354
|
}
|
|
348
355
|
},
|
|
349
356
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success"],
|
|
350
|
-
setup(n, { emit:
|
|
357
|
+
setup(n, { emit: B }) {
|
|
351
358
|
var c;
|
|
352
|
-
const y =
|
|
359
|
+
const y = B, p = n, { i18n: { t: a, formatUnixTimeStamp: b } } = ge.useI18n(), T = qe(), { axiosInstance: H } = Oe((c = p.config) == null ? void 0 : c.axiosRequestConfig), { hasRecords: r, handleStateChange: L } = ct(() => ee.value), I = h(() => r.value && p.config.app === "konnect"), ie = h(() => !p.enableV2EmptyStates && p.config.app === "konnect"), de = h(() => p.config.app !== "kongManager" || !!p.config.disableSorting), X = {
|
|
353
360
|
// the Name column is non-hidable
|
|
354
361
|
name: { label: a("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
355
362
|
...p.config.showControlPlaneColumn ? { control_plane: { label: a("gateway_services.list.table_headers.control_plane") } } : {},
|
|
@@ -365,11 +372,11 @@ const ge = {
|
|
|
365
372
|
columnVisibility: {
|
|
366
373
|
created_at: !1
|
|
367
374
|
}
|
|
368
|
-
}, fe = X,
|
|
375
|
+
}, fe = X, x = h(() => {
|
|
369
376
|
var m, w;
|
|
370
377
|
let g = `${p.config.apiBaseUrl}${ye.list[p.config.app].all}`;
|
|
371
378
|
return p.config.app === "konnect" ? g = g.replace(/{controlPlaneId}/gi, ((m = p.config) == null ? void 0 : m.controlPlaneId) || "") : p.config.app === "kongManager" && (g = g.replace(/\/{workspace}/gi, (w = p.config) != null && w.workspace ? `/${p.config.workspace}` : "")), g;
|
|
372
|
-
}), Y = h(() => p.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${
|
|
379
|
+
}), Y = h(() => p.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${x.value}`) : new URL(x.value)), ee = W(""), re = h(() => {
|
|
373
380
|
const g = p.config.app === "konnect" || p.config.isExactMatch;
|
|
374
381
|
if (g)
|
|
375
382
|
return {
|
|
@@ -384,17 +391,17 @@ const ge = {
|
|
|
384
391
|
};
|
|
385
392
|
}), {
|
|
386
393
|
fetcher: l,
|
|
387
|
-
fetcherState:
|
|
394
|
+
fetcherState: A,
|
|
388
395
|
fetcherCacheKey: se
|
|
389
|
-
} =
|
|
396
|
+
} = ut({ ...p.config, cacheIdentifier: p.cacheIdentifier }, x.value), Pe = () => {
|
|
390
397
|
ee.value = "";
|
|
391
398
|
}, t = () => {
|
|
392
399
|
se.value++;
|
|
393
|
-
},
|
|
400
|
+
}, $ = W(null), ae = h(() => ({
|
|
394
401
|
ctaPath: p.config.createRoute,
|
|
395
|
-
ctaText:
|
|
402
|
+
ctaText: U.value ? p.isServerless ? a("actions.serverless_create") : a("actions.create") : void 0,
|
|
396
403
|
message: `${a("gateway_services.list.empty_state.description")}${p.config.additionMessageForEmptyState ? ` ${p.config.additionMessageForEmptyState}` : ""}`,
|
|
397
|
-
title:
|
|
404
|
+
title: U.value ? p.isServerless ? a("gateway_services.list.empty_state.serverless_title") : a("gateway_services.list.empty_state.title") : a("gateway_services.title")
|
|
398
405
|
})), ne = W(!1), q = W(null), pe = h(() => {
|
|
399
406
|
const g = {
|
|
400
407
|
action: "disable",
|
|
@@ -416,13 +423,13 @@ const ge = {
|
|
|
416
423
|
return;
|
|
417
424
|
const m = `${Y.value.href}/${q.value.id}`, w = !q.value.enabled;
|
|
418
425
|
try {
|
|
419
|
-
const { data: j } = ((Q = p.config) == null ? void 0 : Q.app) === "konnect" ? await
|
|
426
|
+
const { data: j } = ((Q = p.config) == null ? void 0 : Q.app) === "konnect" ? await H.put(m, { ...q.value, enabled: w }) : await H.patch(m, { ...q.value, enabled: w });
|
|
420
427
|
y("toggle:success", j), q.value.enabled = w;
|
|
421
428
|
} catch (j) {
|
|
422
429
|
y("error", j);
|
|
423
430
|
}
|
|
424
431
|
}, Ce = (g) => {
|
|
425
|
-
p.config.getControlPlaneRoute &&
|
|
432
|
+
p.config.getControlPlaneRoute && T.push(p.config.getControlPlaneRoute(g));
|
|
426
433
|
}, me = (g, m) => {
|
|
427
434
|
const w = g.id;
|
|
428
435
|
if (!m(w)) {
|
|
@@ -453,55 +460,55 @@ const ge = {
|
|
|
453
460
|
});
|
|
454
461
|
}, Se = async (g) => {
|
|
455
462
|
var w;
|
|
456
|
-
await ((w = p.canRetrieve) == null ? void 0 : w.call(p, g)) &&
|
|
457
|
-
},
|
|
463
|
+
await ((w = p.canRetrieve) == null ? void 0 : w.call(p, g)) && T.push(p.config.getViewRoute(g.id));
|
|
464
|
+
}, ue = (g) => ({
|
|
458
465
|
label: a("actions.view"),
|
|
459
466
|
to: p.config.getViewRoute(g)
|
|
460
467
|
}), le = (g) => ({
|
|
461
468
|
label: a("actions.edit"),
|
|
462
469
|
to: p.config.getEditRoute(g)
|
|
463
|
-
}), N = W(void 0),
|
|
464
|
-
N.value = g,
|
|
470
|
+
}), N = W(void 0), Z = W(!1), oe = W(!1), ve = W(""), i = dt(p.config, x.value), f = (g) => {
|
|
471
|
+
N.value = g, Z.value = !0, ve.value = "";
|
|
465
472
|
}, k = () => {
|
|
466
|
-
|
|
467
|
-
},
|
|
473
|
+
Z.value = !1, N.value = void 0;
|
|
474
|
+
}, J = async () => {
|
|
468
475
|
var g, m, w;
|
|
469
476
|
if ((g = N.value) != null && g.id) {
|
|
470
477
|
oe.value = !0;
|
|
471
478
|
try {
|
|
472
|
-
await
|
|
479
|
+
await H.delete(i(N.value.id)), y("delete:success", N.value), k(), se.value++;
|
|
473
480
|
} catch (O) {
|
|
474
481
|
ve.value = ((w = (m = O.response) == null ? void 0 : m.data) == null ? void 0 : w.message) || O.message || a("errors.delete"), y("error", O);
|
|
475
482
|
} finally {
|
|
476
483
|
oe.value = !1;
|
|
477
484
|
}
|
|
478
485
|
}
|
|
479
|
-
},
|
|
480
|
-
|
|
486
|
+
}, K = () => {
|
|
487
|
+
T.push(p.config.createRoute);
|
|
481
488
|
};
|
|
482
|
-
|
|
489
|
+
$e(A, (g) => {
|
|
483
490
|
var m, w, O;
|
|
484
491
|
if (g.status === ft.Error) {
|
|
485
|
-
|
|
492
|
+
$.value = {
|
|
486
493
|
title: a("errors.general")
|
|
487
|
-
}, (O = (w = (m = g.error) == null ? void 0 : m.response) == null ? void 0 : w.data) != null && O.message && (
|
|
494
|
+
}, (O = (w = (m = g.error) == null ? void 0 : m.response) == null ? void 0 : w.data) != null && O.message && ($.value.message = g.error.response.data.message), y("error", g.error);
|
|
488
495
|
return;
|
|
489
496
|
}
|
|
490
|
-
|
|
497
|
+
$.value = null;
|
|
491
498
|
});
|
|
492
|
-
const
|
|
499
|
+
const U = W(!1);
|
|
493
500
|
return lt(async () => {
|
|
494
|
-
|
|
501
|
+
U.value = await p.canCreate();
|
|
495
502
|
}), (g, m) => {
|
|
496
503
|
const w = D("KButton"), O = D("KBadge"), Q = D("KInputSwitch"), j = D("KDropdownItem"), he = D("KClipboardProvider");
|
|
497
504
|
return C(), F("div", Tt, [
|
|
498
|
-
|
|
505
|
+
u(o(pt), {
|
|
499
506
|
"cache-identifier": n.cacheIdentifier,
|
|
500
507
|
"default-table-preferences": ke,
|
|
501
|
-
"disable-sorting":
|
|
508
|
+
"disable-sorting": de.value,
|
|
502
509
|
"empty-state-options": ae.value,
|
|
503
510
|
"enable-entity-actions": "",
|
|
504
|
-
"error-message":
|
|
511
|
+
"error-message": $.value,
|
|
505
512
|
fetcher: o(l),
|
|
506
513
|
"fetcher-cache-key": o(se),
|
|
507
514
|
"pagination-type": "offset",
|
|
@@ -511,10 +518,10 @@ const ge = {
|
|
|
511
518
|
onClearSearchInput: Pe,
|
|
512
519
|
"onClick:row": m[5] || (m[5] = (e) => Se(e)),
|
|
513
520
|
onSort: t,
|
|
514
|
-
onState: o(
|
|
515
|
-
},
|
|
521
|
+
onState: o(L)
|
|
522
|
+
}, Re({
|
|
516
523
|
"toolbar-filter": v(() => [
|
|
517
|
-
|
|
524
|
+
u(o(mt), {
|
|
518
525
|
modelValue: ee.value,
|
|
519
526
|
"onUpdate:modelValue": m[0] || (m[0] = (e) => ee.value = e),
|
|
520
527
|
config: re.value
|
|
@@ -535,22 +542,22 @@ const ge = {
|
|
|
535
542
|
onClick: m[1] || (m[1] = (e) => g.$emit("click:learn-more"))
|
|
536
543
|
}, {
|
|
537
544
|
default: v(() => [
|
|
538
|
-
|
|
545
|
+
u(o(He), { decorative: "" })
|
|
539
546
|
]),
|
|
540
547
|
_: 1
|
|
541
|
-
})) :
|
|
542
|
-
|
|
548
|
+
})) : M("", !0),
|
|
549
|
+
u(o(Ee), {
|
|
543
550
|
"auth-function": () => n.canCreate()
|
|
544
551
|
}, {
|
|
545
552
|
default: v(() => [
|
|
546
|
-
|
|
553
|
+
u(w, {
|
|
547
554
|
appearance: "primary",
|
|
548
555
|
"data-testid": "toolbar-add-gateway-service",
|
|
549
556
|
size: n.useActionOutside ? "medium" : "large",
|
|
550
557
|
to: n.config.createRoute
|
|
551
558
|
}, {
|
|
552
559
|
default: v(() => [
|
|
553
|
-
|
|
560
|
+
u(o(rt)),
|
|
554
561
|
z(" " + P(o(a)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
|
|
555
562
|
]),
|
|
556
563
|
_: 1
|
|
@@ -571,31 +578,31 @@ const ge = {
|
|
|
571
578
|
key: 0,
|
|
572
579
|
tooltip: e.x_meta.cluster_id,
|
|
573
580
|
"truncation-tooltip": "",
|
|
574
|
-
onClick:
|
|
581
|
+
onClick: Le((V) => Ce(e.x_meta.cluster_id), ["stop"])
|
|
575
582
|
}, {
|
|
576
583
|
default: v(() => [
|
|
577
584
|
z(P(e.x_meta.cluster_id), 1)
|
|
578
585
|
]),
|
|
579
586
|
_: 2
|
|
580
|
-
}, 1032, ["tooltip", "onClick"])) : (C(), F("b",
|
|
587
|
+
}, 1032, ["tooltip", "onClick"])) : (C(), F("b", Kt, "-"))
|
|
581
588
|
];
|
|
582
589
|
}),
|
|
583
590
|
enabled: v(({ row: e }) => [
|
|
584
|
-
|
|
591
|
+
u(o(Ee), {
|
|
585
592
|
"auth-function": () => n.canEdit(e),
|
|
586
593
|
"force-show": ""
|
|
587
594
|
}, {
|
|
588
595
|
default: v(({ isAllowed: s }) => [
|
|
589
596
|
S("div", {
|
|
590
|
-
onClick: m[4] || (m[4] =
|
|
597
|
+
onClick: m[4] || (m[4] = Le(() => {
|
|
591
598
|
}, ["stop"]))
|
|
592
599
|
}, [
|
|
593
|
-
|
|
600
|
+
u(Q, {
|
|
594
601
|
modelValue: e.enabled,
|
|
595
602
|
"onUpdate:modelValue": (V) => e.enabled = V,
|
|
596
603
|
"data-testid": `row-${e.id}-toggle-input`,
|
|
597
604
|
disabled: !s,
|
|
598
|
-
onClick:
|
|
605
|
+
onClick: Le((V) => ce(e), ["prevent"])
|
|
599
606
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "disabled", "onClick"])
|
|
600
607
|
])
|
|
601
608
|
]),
|
|
@@ -603,7 +610,7 @@ const ge = {
|
|
|
603
610
|
}, 1032, ["auth-function"])
|
|
604
611
|
]),
|
|
605
612
|
tags: v(({ rowValue: e }) => [
|
|
606
|
-
|
|
613
|
+
u(o(vt), { tags: e }, null, 8, ["tags"])
|
|
607
614
|
]),
|
|
608
615
|
created_at: v(({ rowValue: e }) => [
|
|
609
616
|
z(P(o(b)(e)), 1)
|
|
@@ -612,9 +619,9 @@ const ge = {
|
|
|
612
619
|
z(P(o(b)(s ?? e.created_at)), 1)
|
|
613
620
|
]),
|
|
614
621
|
actions: v(({ row: e }) => [
|
|
615
|
-
|
|
622
|
+
u(he, null, {
|
|
616
623
|
default: v(({ copyToClipboard: s }) => [
|
|
617
|
-
|
|
624
|
+
u(j, {
|
|
618
625
|
"data-testid": "action-entity-copy-id",
|
|
619
626
|
onClick: (V) => me(e, s)
|
|
620
627
|
}, {
|
|
@@ -626,9 +633,9 @@ const ge = {
|
|
|
626
633
|
]),
|
|
627
634
|
_: 2
|
|
628
635
|
}, 1024),
|
|
629
|
-
|
|
636
|
+
u(he, null, {
|
|
630
637
|
default: v(({ copyToClipboard: s }) => [
|
|
631
|
-
|
|
638
|
+
u(j, {
|
|
632
639
|
"data-testid": "action-entity-copy-json",
|
|
633
640
|
onClick: (V) => be(e, s)
|
|
634
641
|
}, {
|
|
@@ -640,34 +647,34 @@ const ge = {
|
|
|
640
647
|
]),
|
|
641
648
|
_: 2
|
|
642
649
|
}, 1024),
|
|
643
|
-
|
|
650
|
+
u(o(Ee), {
|
|
644
651
|
"auth-function": () => n.canRetrieve(e)
|
|
645
652
|
}, {
|
|
646
653
|
default: v(() => [
|
|
647
|
-
|
|
654
|
+
u(j, {
|
|
648
655
|
"data-testid": "action-entity-view",
|
|
649
656
|
"has-divider": "",
|
|
650
|
-
item:
|
|
657
|
+
item: ue(e.id)
|
|
651
658
|
}, null, 8, ["item"])
|
|
652
659
|
]),
|
|
653
660
|
_: 2
|
|
654
661
|
}, 1032, ["auth-function"]),
|
|
655
|
-
|
|
662
|
+
u(o(Ee), {
|
|
656
663
|
"auth-function": () => n.canEdit(e)
|
|
657
664
|
}, {
|
|
658
665
|
default: v(() => [
|
|
659
|
-
|
|
666
|
+
u(j, {
|
|
660
667
|
"data-testid": "action-entity-edit",
|
|
661
668
|
item: le(e.id)
|
|
662
669
|
}, null, 8, ["item"])
|
|
663
670
|
]),
|
|
664
671
|
_: 2
|
|
665
672
|
}, 1032, ["auth-function"]),
|
|
666
|
-
|
|
673
|
+
u(o(Ee), {
|
|
667
674
|
"auth-function": () => n.canDelete(e)
|
|
668
675
|
}, {
|
|
669
676
|
default: v(() => [
|
|
670
|
-
|
|
677
|
+
u(j, {
|
|
671
678
|
danger: "",
|
|
672
679
|
"data-testid": "action-entity-delete",
|
|
673
680
|
"has-divider": "",
|
|
@@ -691,7 +698,7 @@ const ge = {
|
|
|
691
698
|
disabled: !n.useActionOutside,
|
|
692
699
|
to: "#kong-ui-app-page-header-action-button"
|
|
693
700
|
}, [
|
|
694
|
-
|
|
701
|
+
u(w, {
|
|
695
702
|
appearance: "secondary",
|
|
696
703
|
class: "open-learning-hub",
|
|
697
704
|
"data-testid": "gateway-services-more-button",
|
|
@@ -699,7 +706,7 @@ const ge = {
|
|
|
699
706
|
onClick: m[2] || (m[2] = (e) => g.$emit("click:learn-more"))
|
|
700
707
|
}, {
|
|
701
708
|
default: v(() => [
|
|
702
|
-
|
|
709
|
+
u(o(He), { decorative: "" })
|
|
703
710
|
]),
|
|
704
711
|
_: 1
|
|
705
712
|
})
|
|
@@ -712,7 +719,7 @@ const ge = {
|
|
|
712
719
|
fn: v(() => {
|
|
713
720
|
var e;
|
|
714
721
|
return [
|
|
715
|
-
|
|
722
|
+
u(o(gt), {
|
|
716
723
|
"action-button-text": o(a)("gateway_services.empty_state_v2.create"),
|
|
717
724
|
appearance: "secondary",
|
|
718
725
|
"can-create": () => n.canCreate(),
|
|
@@ -720,14 +727,14 @@ const ge = {
|
|
|
720
727
|
description: o(a)("gateway_services.empty_state_v2.description"),
|
|
721
728
|
"learn-more": n.config.app === "konnect",
|
|
722
729
|
title: o(a)("gateway_services.empty_state_v2.title"),
|
|
723
|
-
"onClick:create":
|
|
730
|
+
"onClick:create": K,
|
|
724
731
|
"onClick:learnMore": m[3] || (m[3] = (s) => g.$emit("click:learn-more"))
|
|
725
|
-
},
|
|
732
|
+
}, Re({
|
|
726
733
|
image: v(() => [
|
|
727
734
|
S("div", Bt, [
|
|
728
|
-
|
|
729
|
-
color: o(
|
|
730
|
-
size: o(
|
|
735
|
+
u(o(st), {
|
|
736
|
+
color: o(At),
|
|
737
|
+
size: o(Rt)
|
|
731
738
|
}, null, 8, ["color", "size"])
|
|
732
739
|
])
|
|
733
740
|
]),
|
|
@@ -746,7 +753,7 @@ const ge = {
|
|
|
746
753
|
key: "1"
|
|
747
754
|
} : void 0
|
|
748
755
|
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
|
|
749
|
-
|
|
756
|
+
u(o(yt), {
|
|
750
757
|
action: pe.value.action,
|
|
751
758
|
"entity-id": pe.value.id,
|
|
752
759
|
"entity-name": pe.value.name,
|
|
@@ -756,32 +763,32 @@ const ge = {
|
|
|
756
763
|
onCancel: _e,
|
|
757
764
|
onProceed: _e
|
|
758
765
|
}, null, 8, ["action", "entity-id", "entity-name", "entity-type", "visible"]),
|
|
759
|
-
|
|
766
|
+
u(o(_t), {
|
|
760
767
|
"action-pending": oe.value,
|
|
761
768
|
description: o(a)("actions.delete.description"),
|
|
762
769
|
"entity-name": N.value && (N.value.name || N.value.id),
|
|
763
770
|
"entity-type": o(bt).GatewayService,
|
|
764
771
|
error: ve.value,
|
|
765
772
|
title: o(a)("actions.delete.title"),
|
|
766
|
-
visible:
|
|
773
|
+
visible: Z.value,
|
|
767
774
|
onCancel: k,
|
|
768
|
-
onProceed:
|
|
775
|
+
onProceed: J
|
|
769
776
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
770
777
|
]);
|
|
771
778
|
};
|
|
772
779
|
}
|
|
773
|
-
}), Ne = (n,
|
|
780
|
+
}), Ne = (n, B) => {
|
|
774
781
|
const y = n.__vccOpts || n;
|
|
775
|
-
for (const [p, a] of
|
|
782
|
+
for (const [p, a] of B)
|
|
776
783
|
y[p] = a;
|
|
777
784
|
return y;
|
|
778
|
-
},
|
|
785
|
+
}, Ul = /* @__PURE__ */ Ne(Lt, [["__scopeId", "data-v-ee4f8a6d"]]), Wt = { class: "kong-ui-entities-gateway-service-form" }, Dt = { key: 0 }, qt = { class: "gateway-service-form-traffic-label" }, Ot = { class: "gateway-service-form-margin-bottom" }, Gt = {
|
|
779
786
|
key: 0,
|
|
780
787
|
class: "gateway-service-form-group-fields"
|
|
781
788
|
}, Nt = {
|
|
782
789
|
key: 1,
|
|
783
790
|
class: "gateway-service-form-group-fields"
|
|
784
|
-
}, jt = { key: 0 }, zt = { class: "gateway-service-form-margin-top" }, Ht = { class: "gateway-service-form-margin-bottom" },
|
|
791
|
+
}, jt = { key: 0 }, zt = { class: "gateway-service-form-margin-top" }, Ht = { class: "gateway-service-form-margin-bottom" }, Jt = { class: "gateway-service-form-margin-bottom" }, Zt = { class: "gateway-service-form-margin-bottom" }, Qt = { class: "gateway-service-form-margin-bottom" }, Xt = {
|
|
785
792
|
key: 0,
|
|
786
793
|
class: "gateway-service-form-margin-bottom"
|
|
787
794
|
}, Yt = {
|
|
@@ -796,7 +803,7 @@ const ge = {
|
|
|
796
803
|
}, ll = {
|
|
797
804
|
key: 1,
|
|
798
805
|
class: "checkbox-aligned-radio"
|
|
799
|
-
}, ol = /* @__PURE__ */
|
|
806
|
+
}, ol = /* @__PURE__ */ Ke({
|
|
800
807
|
__name: "LegacyGatewayServiceForm",
|
|
801
808
|
props: {
|
|
802
809
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -819,9 +826,9 @@ const ge = {
|
|
|
819
826
|
}
|
|
820
827
|
},
|
|
821
828
|
emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated"],
|
|
822
|
-
setup(n, { expose:
|
|
829
|
+
setup(n, { expose: B, emit: y }) {
|
|
823
830
|
var ve;
|
|
824
|
-
const p = y, a = n, b = W(!0),
|
|
831
|
+
const p = y, a = n, b = W(!0), T = qe(), { i18nT: H, i18n: { t: r } } = ge.useI18n(), { getMessageFromError: L } = Xe(), { axiosInstance: I } = Oe((ve = a.config) == null ? void 0 : ve.axiosRequestConfig), ie = Ye(), de = h(() => ye.form[a.config.app].edit), X = h(() => a.gatewayServiceId ? Me.Edit : Me.Create), ke = W(!1), fe = h(() => !!a.gatewayServiceId), x = W(fe.value ? "protocol" : "url"), Y = ge.usePortFromProtocol(), ee = W(""), re = h(() => !!ee.value), l = Te({
|
|
825
832
|
fields: {
|
|
826
833
|
name: "",
|
|
827
834
|
protocol: "http",
|
|
@@ -841,7 +848,7 @@ const ge = {
|
|
|
841
848
|
},
|
|
842
849
|
isReadonly: !1,
|
|
843
850
|
errorMessage: ""
|
|
844
|
-
}),
|
|
851
|
+
}), A = Te({
|
|
845
852
|
name: "",
|
|
846
853
|
protocol: "http",
|
|
847
854
|
host: "",
|
|
@@ -916,45 +923,45 @@ const ge = {
|
|
|
916
923
|
value: "udp",
|
|
917
924
|
group: "udp"
|
|
918
925
|
}
|
|
919
|
-
], t = { url: "url", protocol: "protocol" },
|
|
926
|
+
], t = { url: "url", protocol: "protocol" }, $ = (i, f) => {
|
|
920
927
|
f.value;
|
|
921
928
|
}, ae = (i) => i ? parseFloat(i) : 0, ne = () => {
|
|
922
|
-
b.value = !0, l.errorMessage = "", l.fields.host =
|
|
929
|
+
b.value = !0, l.errorMessage = "", l.fields.host = A.host, l.fields.path = A.path, l.fields.port = A.port, l.fields.protocol = A.protocol, l.fields.url = A.url, l.fields.retries = A.retries, l.fields.connect_timeout = A.connect_timeout, l.fields.write_timeout = A.write_timeout, l.fields.read_timeout = A.read_timeout, l.fields.client_certificate = A.client_certificate, l.fields.ca_certificates = A.ca_certificates, l.fields.tls_verify_enabled = A.tls_verify_enabled, l.fields.tls_verify_value = A.tls_verify_value;
|
|
923
930
|
}, q = () => {
|
|
924
|
-
if (l.fields.url &&
|
|
931
|
+
if (l.fields.url && x.value === "url")
|
|
925
932
|
try {
|
|
926
933
|
const i = new URL(l.fields.url);
|
|
927
934
|
l.errorMessage = "", l.fields.protocol = i.protocol.slice(0, -1), l.fields.host = i.hostname, l.fields.path = i.pathname;
|
|
928
935
|
const f = Number(i.port);
|
|
929
936
|
ke.value = !!f, l.fields.port = f || Y.getPortFromProtocol(l.fields.protocol), l.errorMessage = "", p("url-valid:success");
|
|
930
937
|
} catch (i) {
|
|
931
|
-
l.errorMessage = r("errors.urlErrorMessage"), p("url-valid:error",
|
|
938
|
+
l.errorMessage = r("errors.urlErrorMessage"), p("url-valid:error", L(i));
|
|
932
939
|
}
|
|
933
940
|
else
|
|
934
941
|
p("url-valid:success"), l.errorMessage = "";
|
|
935
942
|
}, pe = h(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(l.fields.protocol)), ce = h(() => {
|
|
936
|
-
if (
|
|
943
|
+
if (x.value === "url")
|
|
937
944
|
return !0;
|
|
938
945
|
const i = ["https", "wss", "tls"].includes(l.fields.protocol);
|
|
939
|
-
return
|
|
946
|
+
return x.value === "protocol" && i;
|
|
940
947
|
}), _e = h(() => {
|
|
941
|
-
if (
|
|
948
|
+
if (x.value === "url")
|
|
942
949
|
return !0;
|
|
943
950
|
const i = ["https", "tls"].includes(l.fields.protocol);
|
|
944
|
-
return
|
|
951
|
+
return x.value === "protocol" && i;
|
|
945
952
|
}), Ve = h(() => {
|
|
946
|
-
if (
|
|
953
|
+
if (x.value === "url")
|
|
947
954
|
return !0;
|
|
948
955
|
const i = ["https", "wss", "tls"].includes(l.fields.protocol);
|
|
949
|
-
return
|
|
956
|
+
return x.value === "protocol" && i;
|
|
950
957
|
}), Ce = (i) => {
|
|
951
958
|
ee.value = ie.utf8Name(i);
|
|
952
|
-
}, me = h(() => fe.value && JSON.stringify(l.fields) !== JSON.stringify(
|
|
953
|
-
var f, k,
|
|
954
|
-
l.fields.name = (i == null ? void 0 : i.name) || "", l.fields.tags = ((f = i == null ? void 0 : i.tags) == null ? void 0 : f.join(", ")) || "", l.fields.protocol = (i == null ? void 0 : i.protocol) || "http", l.fields.path = (i == null ? void 0 : i.path) || "", l.fields.read_timeout = i != null && i.read_timeout || (i == null ? void 0 : i.read_timeout) === 0 ? i == null ? void 0 : i.read_timeout : 6e4, l.fields.retries = i != null && i.retries || (i == null ? void 0 : i.retries) === 0 ? i == null ? void 0 : i.retries : 5, l.fields.host = (i == null ? void 0 : i.host) || "", l.fields.connect_timeout = i != null && i.connect_timeout || (i == null ? void 0 : i.connect_timeout) === 0 ? i == null ? void 0 : i.connect_timeout : 6e4, l.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, l.fields.tls_verify_value = i != null && i.tls_verify ? i == null ? void 0 : i.tls_verify : !1, l.fields.ca_certificates = ((k = i == null ? void 0 : i.ca_certificates) == null ? void 0 : k.join(",")) || "", l.fields.client_certificate = ((
|
|
959
|
+
}, me = h(() => fe.value && JSON.stringify(l.fields) !== JSON.stringify(A) || x.value === "url" && !!l.fields.url || x.value === "protocol" && !!l.fields.host), be = (i) => {
|
|
960
|
+
var f, k, J;
|
|
961
|
+
l.fields.name = (i == null ? void 0 : i.name) || "", l.fields.tags = ((f = i == null ? void 0 : i.tags) == null ? void 0 : f.join(", ")) || "", l.fields.protocol = (i == null ? void 0 : i.protocol) || "http", l.fields.path = (i == null ? void 0 : i.path) || "", l.fields.read_timeout = i != null && i.read_timeout || (i == null ? void 0 : i.read_timeout) === 0 ? i == null ? void 0 : i.read_timeout : 6e4, l.fields.retries = i != null && i.retries || (i == null ? void 0 : i.retries) === 0 ? i == null ? void 0 : i.retries : 5, l.fields.host = (i == null ? void 0 : i.host) || "", l.fields.connect_timeout = i != null && i.connect_timeout || (i == null ? void 0 : i.connect_timeout) === 0 ? i == null ? void 0 : i.connect_timeout : 6e4, l.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, l.fields.tls_verify_value = i != null && i.tls_verify ? i == null ? void 0 : i.tls_verify : !1, l.fields.ca_certificates = ((k = i == null ? void 0 : i.ca_certificates) == null ? void 0 : k.join(",")) || "", l.fields.client_certificate = ((J = i == null ? void 0 : i.client_certificate) == null ? void 0 : J.id) || "", l.fields.write_timeout = i != null && i.write_timeout || (i == null ? void 0 : i.write_timeout) === 0 ? i == null ? void 0 : i.write_timeout : 6e4, l.fields.port = i != null && i.port || (i == null ? void 0 : i.port) === 0 ? i == null ? void 0 : i.port : 80, Object.assign(A, l.fields);
|
|
955
962
|
}, Se = () => {
|
|
956
|
-
|
|
957
|
-
},
|
|
963
|
+
T.push(a.config.cancelRoute);
|
|
964
|
+
}, ue = h(() => {
|
|
958
965
|
var f, k;
|
|
959
966
|
let i = `${a.config.apiBaseUrl}${ye.form[a.config.app].validate}`;
|
|
960
967
|
return a.config.app === "konnect" ? i = i.replace(/{controlPlaneId}/gi, ((f = a.config) == null ? void 0 : f.controlPlaneId) || "") : a.config.app === "kongManager" && (i = i.replace(/\/{workspace}/gi, (k = a.config) != null && k.workspace ? `/${a.config.workspace}` : "")), i = i.replace(/{id}/gi, a.gatewayServiceId), i;
|
|
@@ -965,11 +972,11 @@ const ge = {
|
|
|
965
972
|
}), N = (i) => {
|
|
966
973
|
let f = "";
|
|
967
974
|
i.url && (f = new URL(i.url).protocol), (["https", "wss", "tls"].includes(i.protocol) || ["https", "wss", "tls"].includes(f)) && (i.tls_verify = i.tls_verify_enabled ? i.tls_verify_value : null), delete i.tls_verify_enabled, delete i.tls_verify_value;
|
|
968
|
-
},
|
|
969
|
-
var f, k,
|
|
975
|
+
}, Z = h(() => {
|
|
976
|
+
var f, k, J, K;
|
|
970
977
|
const i = {
|
|
971
978
|
name: l.fields.name || null,
|
|
972
|
-
tags: l.fields.tags ? (
|
|
979
|
+
tags: l.fields.tags ? (J = (k = (f = l.fields.tags) == null ? void 0 : f.split(",")) == null ? void 0 : k.map((U) => String(U || "").trim())) == null ? void 0 : J.filter((U) => U !== "") : null,
|
|
973
980
|
protocol: l.fields.protocol,
|
|
974
981
|
path: l.fields.path || null,
|
|
975
982
|
read_timeout: l.fields.read_timeout,
|
|
@@ -978,54 +985,54 @@ const ge = {
|
|
|
978
985
|
connect_timeout: l.fields.connect_timeout,
|
|
979
986
|
tls_verify_value: l.fields.tls_verify_value,
|
|
980
987
|
tls_verify_enabled: l.fields.tls_verify_enabled,
|
|
981
|
-
ca_certificates: l.fields.ca_certificates ? (
|
|
988
|
+
ca_certificates: l.fields.ca_certificates ? (K = l.fields.ca_certificates) == null ? void 0 : K.split(",").filter((U) => U !== "") : null,
|
|
982
989
|
client_certificate: l.fields.client_certificate ? { id: l.fields.client_certificate } : null,
|
|
983
990
|
write_timeout: l.fields.write_timeout,
|
|
984
991
|
port: l.fields.port,
|
|
985
992
|
url: l.fields.url
|
|
986
993
|
};
|
|
987
|
-
return l.fields.client_certificate && ["https", "wss", "tls"].includes(l.fields.protocol) && (i.client_certificate = { id: l.fields.client_certificate }), l.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(l.fields.protocol) && (i.tls_verify = l.fields.tls_verify_value), pe.value || (i.path = null), X.value === "create" ?
|
|
994
|
+
return l.fields.client_certificate && ["https", "wss", "tls"].includes(l.fields.protocol) && (i.client_certificate = { id: l.fields.client_certificate }), l.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(l.fields.protocol) && (i.tls_verify = l.fields.tls_verify_value), pe.value || (i.path = null), X.value === "create" ? x.value === "url" ? (delete i.protocol, delete i.host, delete i.path, a.config.app === "konnect" && delete i.port) : delete i.url : X.value === "edit" && delete i.url, i;
|
|
988
995
|
}), oe = async () => {
|
|
989
|
-
var i, f, k,
|
|
996
|
+
var i, f, k, J;
|
|
990
997
|
try {
|
|
991
998
|
l.isReadonly = !0, q();
|
|
992
|
-
const
|
|
993
|
-
N(
|
|
994
|
-
let
|
|
995
|
-
if (await I.post(
|
|
996
|
-
const { data: c } =
|
|
997
|
-
l.fields.name = (c == null ? void 0 : c.name) || "", l.fields.port = c.port || Y.getPortFromProtocol(c.protocol), l.fields.protocol = (c == null ? void 0 : c.protocol) || "http", l.fields.host = (c == null ? void 0 : c.host) || "", l.fields.path = (c == null ? void 0 : c.path) || "", l.fields.url = (c == null ? void 0 : c.url) || "", l.fields.retries = c != null && c.retries || (c == null ? void 0 : c.retries) === 0 ? c == null ? void 0 : c.retries : 5, l.fields.connect_timeout = c != null && c.connect_timeout || (c == null ? void 0 : c.connect_timeout) === 0 ? c == null ? void 0 : c.connect_timeout : 6e4, l.fields.write_timeout = c != null && c.write_timeout || (c == null ? void 0 : c.write_timeout) === 0 ? c == null ? void 0 : c.write_timeout : 6e4, l.fields.read_timeout = c != null && c.read_timeout || (c == null ? void 0 : c.read_timeout) === 0 ? c == null ? void 0 : c.read_timeout : 6e4, l.fields.client_certificate = ((f = c == null ? void 0 : c.client_certificate) == null ? void 0 : f.id) || "", l.fields.ca_certificates = (k = c == null ? void 0 : c.ca_certificates) != null && k.length ? c == null ? void 0 : c.ca_certificates.join(",") : "", l.fields.tls_verify_enabled = (c == null ? void 0 : c.tls_verify) !== "" && (c == null ? void 0 : c.tls_verify) !== null && (c == null ? void 0 : c.tls_verify) !== void 0, l.fields.tls_verify_value = l.fields.tls_verify_enabled && (c == null ? void 0 : c.tls_verify), l.fields.tags = (
|
|
999
|
+
const K = Z.value;
|
|
1000
|
+
N(K);
|
|
1001
|
+
let U;
|
|
1002
|
+
if (await I.post(ue.value, K), X.value === "create" ? U = await I.post(le.value, K) : X.value === "edit" && (U = ((i = a.config) == null ? void 0 : i.app) === "konnect" ? await I.put(le.value, K) : await I.patch(le.value, K)), U) {
|
|
1003
|
+
const { data: c } = U;
|
|
1004
|
+
l.fields.name = (c == null ? void 0 : c.name) || "", l.fields.port = c.port || Y.getPortFromProtocol(c.protocol), l.fields.protocol = (c == null ? void 0 : c.protocol) || "http", l.fields.host = (c == null ? void 0 : c.host) || "", l.fields.path = (c == null ? void 0 : c.path) || "", l.fields.url = (c == null ? void 0 : c.url) || "", l.fields.retries = c != null && c.retries || (c == null ? void 0 : c.retries) === 0 ? c == null ? void 0 : c.retries : 5, l.fields.connect_timeout = c != null && c.connect_timeout || (c == null ? void 0 : c.connect_timeout) === 0 ? c == null ? void 0 : c.connect_timeout : 6e4, l.fields.write_timeout = c != null && c.write_timeout || (c == null ? void 0 : c.write_timeout) === 0 ? c == null ? void 0 : c.write_timeout : 6e4, l.fields.read_timeout = c != null && c.read_timeout || (c == null ? void 0 : c.read_timeout) === 0 ? c == null ? void 0 : c.read_timeout : 6e4, l.fields.client_certificate = ((f = c == null ? void 0 : c.client_certificate) == null ? void 0 : f.id) || "", l.fields.ca_certificates = (k = c == null ? void 0 : c.ca_certificates) != null && k.length ? c == null ? void 0 : c.ca_certificates.join(",") : "", l.fields.tls_verify_enabled = (c == null ? void 0 : c.tls_verify) !== "" && (c == null ? void 0 : c.tls_verify) !== null && (c == null ? void 0 : c.tls_verify) !== void 0, l.fields.tls_verify_value = l.fields.tls_verify_enabled && (c == null ? void 0 : c.tls_verify), l.fields.tags = (J = c == null ? void 0 : c.tags) != null && J.length ? c.tags.join(", ") : "", Object.assign(A, l.fields), p("update", U == null ? void 0 : U.data);
|
|
998
1005
|
}
|
|
999
|
-
return
|
|
1000
|
-
} catch (
|
|
1001
|
-
l.errorMessage = K
|
|
1006
|
+
return U;
|
|
1007
|
+
} catch (K) {
|
|
1008
|
+
l.errorMessage = L(K), p("error", K);
|
|
1002
1009
|
} finally {
|
|
1003
1010
|
l.isReadonly = !1;
|
|
1004
1011
|
}
|
|
1005
1012
|
};
|
|
1006
|
-
return
|
|
1007
|
-
Object.assign(l.fields,
|
|
1008
|
-
}),
|
|
1009
|
-
l.fields.port = Y.getPortFromProtocol(i.protocol, String(i.port)), p("model-updated",
|
|
1010
|
-
}),
|
|
1011
|
-
p("model-updated",
|
|
1012
|
-
}),
|
|
1013
|
+
return $e(() => a.gatewayServiceId, () => {
|
|
1014
|
+
Object.assign(l.fields, A);
|
|
1015
|
+
}), $e(l.fields, (i) => {
|
|
1016
|
+
l.fields.port = Y.getPortFromProtocol(i.protocol, String(i.port)), p("model-updated", Z.value);
|
|
1017
|
+
}), Ze(() => {
|
|
1018
|
+
p("model-updated", Z.value);
|
|
1019
|
+
}), B({
|
|
1013
1020
|
validateUrl: q,
|
|
1014
|
-
getPayload:
|
|
1021
|
+
getPayload: Z,
|
|
1015
1022
|
saveFormData: oe,
|
|
1016
1023
|
canSubmit: me,
|
|
1017
1024
|
initForm: be
|
|
1018
1025
|
}), (i, f) => {
|
|
1019
|
-
const k = D("KInput"),
|
|
1026
|
+
const k = D("KInput"), J = D("KLabel"), K = D("KRadio"), U = D("KSelect"), c = D("KCheckbox"), g = D("KCollapse");
|
|
1020
1027
|
return C(), F("div", Wt, [
|
|
1021
|
-
|
|
1028
|
+
u(o(tt), {
|
|
1022
1029
|
"can-submit": me.value,
|
|
1023
1030
|
config: n.config,
|
|
1024
1031
|
"edit-id": n.gatewayServiceId,
|
|
1025
1032
|
"entity-type": o(Ge).GatewayService,
|
|
1026
1033
|
"error-message": l.errorMessage,
|
|
1027
|
-
"fetch-url":
|
|
1028
|
-
"form-fields":
|
|
1034
|
+
"fetch-url": de.value,
|
|
1035
|
+
"form-fields": Z.value,
|
|
1029
1036
|
"is-readonly": l.isReadonly,
|
|
1030
1037
|
onCancel: Se,
|
|
1031
1038
|
"onFetch:error": f[25] || (f[25] = (m) => i.$emit("error", m)),
|
|
@@ -1041,13 +1048,13 @@ const ge = {
|
|
|
1041
1048
|
}, void 0, !0)
|
|
1042
1049
|
]),
|
|
1043
1050
|
default: v(() => [
|
|
1044
|
-
|
|
1051
|
+
u(o(Be), {
|
|
1045
1052
|
description: o(r)("gateway_services.form.sections.general.description"),
|
|
1046
1053
|
"hide-info-header": n.hideSectionsInfo,
|
|
1047
1054
|
title: o(r)("gateway_services.form.sections.general.title")
|
|
1048
1055
|
}, {
|
|
1049
1056
|
default: v(() => [
|
|
1050
|
-
|
|
1057
|
+
u(k, {
|
|
1051
1058
|
modelValue: l.fields.name,
|
|
1052
1059
|
"onUpdate:modelValue": f[0] || (f[0] = (m) => l.fields.name = m),
|
|
1053
1060
|
modelModifiers: { trim: !0 },
|
|
@@ -1066,7 +1073,7 @@ const ge = {
|
|
|
1066
1073
|
type: "text",
|
|
1067
1074
|
onInput: Ce
|
|
1068
1075
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1069
|
-
|
|
1076
|
+
u(k, {
|
|
1070
1077
|
modelValue: l.fields.tags,
|
|
1071
1078
|
"onUpdate:modelValue": f[1] || (f[1] = (m) => l.fields.tags = m),
|
|
1072
1079
|
modelModifiers: { trim: !0 },
|
|
@@ -1086,15 +1093,15 @@ const ge = {
|
|
|
1086
1093
|
]),
|
|
1087
1094
|
_: 1
|
|
1088
1095
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
1089
|
-
|
|
1096
|
+
u(o(Be), {
|
|
1090
1097
|
description: o(r)("gateway_services.form.sections.keys.description"),
|
|
1091
1098
|
"hide-info-header": n.hideSectionsInfo,
|
|
1092
1099
|
title: o(r)("gateway_services.form.sections.keys.title")
|
|
1093
1100
|
}, {
|
|
1094
1101
|
default: v(() => [
|
|
1095
|
-
fe.value ?
|
|
1102
|
+
fe.value ? M("", !0) : (C(), F("div", Dt, [
|
|
1096
1103
|
S("div", qt, [
|
|
1097
|
-
|
|
1104
|
+
u(J, { required: "" }, {
|
|
1098
1105
|
default: v(() => [
|
|
1099
1106
|
z(P(o(r)("gateway_services.form.sections.keys.checkedGroupLabel")), 1)
|
|
1100
1107
|
]),
|
|
@@ -1102,9 +1109,9 @@ const ge = {
|
|
|
1102
1109
|
})
|
|
1103
1110
|
]),
|
|
1104
1111
|
S("div", Ot, [
|
|
1105
|
-
|
|
1106
|
-
modelValue:
|
|
1107
|
-
"onUpdate:modelValue": f[2] || (f[2] = (m) =>
|
|
1112
|
+
u(K, {
|
|
1113
|
+
modelValue: x.value,
|
|
1114
|
+
"onUpdate:modelValue": f[2] || (f[2] = (m) => x.value = m),
|
|
1108
1115
|
"data-testid": "gateway-service-url-radio",
|
|
1109
1116
|
"selected-value": t.url,
|
|
1110
1117
|
onChange: ne
|
|
@@ -1115,8 +1122,8 @@ const ge = {
|
|
|
1115
1122
|
_: 1
|
|
1116
1123
|
}, 8, ["modelValue", "selected-value"])
|
|
1117
1124
|
]),
|
|
1118
|
-
|
|
1119
|
-
|
|
1125
|
+
x.value === "url" ? (C(), F("div", Gt, [
|
|
1126
|
+
u(k, {
|
|
1120
1127
|
modelValue: l.fields.url,
|
|
1121
1128
|
"onUpdate:modelValue": f[3] || (f[3] = (m) => l.fields.url = m),
|
|
1122
1129
|
modelModifiers: { trim: !0 },
|
|
@@ -1131,10 +1138,10 @@ const ge = {
|
|
|
1131
1138
|
placeholder: o(r)("gateway_services.form.fields.upstream_url.placeholder"),
|
|
1132
1139
|
required: ""
|
|
1133
1140
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
|
|
1134
|
-
])) :
|
|
1135
|
-
|
|
1136
|
-
modelValue:
|
|
1137
|
-
"onUpdate:modelValue": f[4] || (f[4] = (m) =>
|
|
1141
|
+
])) : M("", !0),
|
|
1142
|
+
u(K, {
|
|
1143
|
+
modelValue: x.value,
|
|
1144
|
+
"onUpdate:modelValue": f[4] || (f[4] = (m) => x.value = m),
|
|
1138
1145
|
"checked-group": "protocol",
|
|
1139
1146
|
"data-testid": "gateway-service-protocol-radio",
|
|
1140
1147
|
"selected-value": t.protocol,
|
|
@@ -1146,8 +1153,8 @@ const ge = {
|
|
|
1146
1153
|
_: 1
|
|
1147
1154
|
}, 8, ["modelValue", "selected-value"])
|
|
1148
1155
|
])),
|
|
1149
|
-
|
|
1150
|
-
|
|
1156
|
+
x.value === "protocol" || fe.value ? (C(), F("div", Nt, [
|
|
1157
|
+
u(U, {
|
|
1151
1158
|
modelValue: l.fields.protocol,
|
|
1152
1159
|
"onUpdate:modelValue": f[5] || (f[5] = (m) => l.fields.protocol = m),
|
|
1153
1160
|
"data-testid": "gateway-service-protocol-select",
|
|
@@ -1160,9 +1167,9 @@ const ge = {
|
|
|
1160
1167
|
readonly: l.isReadonly,
|
|
1161
1168
|
required: "",
|
|
1162
1169
|
width: "100%",
|
|
1163
|
-
onSelected: f[6] || (f[6] = (m) =>
|
|
1170
|
+
onSelected: f[6] || (f[6] = (m) => $(l.fields.protocol, m))
|
|
1164
1171
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
|
|
1165
|
-
|
|
1172
|
+
u(k, {
|
|
1166
1173
|
modelValue: l.fields.host,
|
|
1167
1174
|
"onUpdate:modelValue": f[7] || (f[7] = (m) => l.fields.host = m),
|
|
1168
1175
|
modelModifiers: { trim: !0 },
|
|
@@ -1178,7 +1185,7 @@ const ge = {
|
|
|
1178
1185
|
required: ""
|
|
1179
1186
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"]),
|
|
1180
1187
|
pe.value ? (C(), F("div", jt, [
|
|
1181
|
-
|
|
1188
|
+
u(k, {
|
|
1182
1189
|
modelValue: l.fields.path,
|
|
1183
1190
|
"onUpdate:modelValue": f[8] || (f[8] = (m) => l.fields.path = m),
|
|
1184
1191
|
modelModifiers: { trim: !0 },
|
|
@@ -1192,8 +1199,8 @@ const ge = {
|
|
|
1192
1199
|
name: "path",
|
|
1193
1200
|
placeholder: o(r)("gateway_services.form.fields.path.placeholder")
|
|
1194
1201
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
|
|
1195
|
-
])) :
|
|
1196
|
-
|
|
1202
|
+
])) : M("", !0),
|
|
1203
|
+
u(k, {
|
|
1197
1204
|
modelValue: l.fields.port,
|
|
1198
1205
|
"onUpdate:modelValue": [
|
|
1199
1206
|
f[9] || (f[9] = (m) => l.fields.port = m),
|
|
@@ -1211,8 +1218,8 @@ const ge = {
|
|
|
1211
1218
|
name: "port",
|
|
1212
1219
|
type: "number"
|
|
1213
1220
|
}, null, 8, ["modelValue", "label", "label-attributes"])
|
|
1214
|
-
])) :
|
|
1215
|
-
|
|
1221
|
+
])) : M("", !0),
|
|
1222
|
+
u(g, {
|
|
1216
1223
|
modelValue: b.value,
|
|
1217
1224
|
"onUpdate:modelValue": f[24] || (f[24] = (m) => b.value = m),
|
|
1218
1225
|
"data-testid": "advanced-fields-collapse",
|
|
@@ -1222,7 +1229,7 @@ const ge = {
|
|
|
1222
1229
|
default: v(() => [
|
|
1223
1230
|
S("div", zt, [
|
|
1224
1231
|
S("div", Ht, [
|
|
1225
|
-
|
|
1232
|
+
u(k, {
|
|
1226
1233
|
modelValue: l.fields.retries,
|
|
1227
1234
|
"onUpdate:modelValue": [
|
|
1228
1235
|
f[11] || (f[11] = (m) => l.fields.retries = m),
|
|
@@ -1242,8 +1249,8 @@ const ge = {
|
|
|
1242
1249
|
type: "number"
|
|
1243
1250
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1244
1251
|
]),
|
|
1245
|
-
S("div",
|
|
1246
|
-
|
|
1252
|
+
S("div", Jt, [
|
|
1253
|
+
u(k, {
|
|
1247
1254
|
modelValue: l.fields.connect_timeout,
|
|
1248
1255
|
"onUpdate:modelValue": [
|
|
1249
1256
|
f[13] || (f[13] = (m) => l.fields.connect_timeout = m),
|
|
@@ -1263,8 +1270,8 @@ const ge = {
|
|
|
1263
1270
|
type: "number"
|
|
1264
1271
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1265
1272
|
]),
|
|
1266
|
-
S("div",
|
|
1267
|
-
|
|
1273
|
+
S("div", Zt, [
|
|
1274
|
+
u(k, {
|
|
1268
1275
|
modelValue: l.fields.write_timeout,
|
|
1269
1276
|
"onUpdate:modelValue": [
|
|
1270
1277
|
f[15] || (f[15] = (m) => l.fields.write_timeout = m),
|
|
@@ -1285,7 +1292,7 @@ const ge = {
|
|
|
1285
1292
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1286
1293
|
]),
|
|
1287
1294
|
S("div", Qt, [
|
|
1288
|
-
|
|
1295
|
+
u(k, {
|
|
1289
1296
|
modelValue: l.fields.read_timeout,
|
|
1290
1297
|
"onUpdate:modelValue": [
|
|
1291
1298
|
f[17] || (f[17] = (m) => l.fields.read_timeout = m),
|
|
@@ -1306,7 +1313,7 @@ const ge = {
|
|
|
1306
1313
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1307
1314
|
]),
|
|
1308
1315
|
ce.value ? (C(), F("div", Xt, [
|
|
1309
|
-
|
|
1316
|
+
u(k, {
|
|
1310
1317
|
modelValue: l.fields.client_certificate,
|
|
1311
1318
|
"onUpdate:modelValue": f[19] || (f[19] = (m) => l.fields.client_certificate = m),
|
|
1312
1319
|
modelModifiers: { trim: !0 },
|
|
@@ -1322,9 +1329,9 @@ const ge = {
|
|
|
1322
1329
|
readonly: l.isReadonly,
|
|
1323
1330
|
type: "text"
|
|
1324
1331
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])
|
|
1325
|
-
])) :
|
|
1332
|
+
])) : M("", !0),
|
|
1326
1333
|
_e.value ? (C(), F("div", Yt, [
|
|
1327
|
-
|
|
1334
|
+
u(k, {
|
|
1328
1335
|
modelValue: l.fields.ca_certificates,
|
|
1329
1336
|
"onUpdate:modelValue": f[20] || (f[20] = (m) => l.fields.ca_certificates = m),
|
|
1330
1337
|
modelModifiers: { trim: !0 },
|
|
@@ -1337,7 +1344,7 @@ const ge = {
|
|
|
1337
1344
|
type: "text"
|
|
1338
1345
|
}, {
|
|
1339
1346
|
"label-tooltip": v(() => [
|
|
1340
|
-
|
|
1347
|
+
u(o(H), {
|
|
1341
1348
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1342
1349
|
scope: "global"
|
|
1343
1350
|
}, {
|
|
@@ -1352,9 +1359,9 @@ const ge = {
|
|
|
1352
1359
|
]),
|
|
1353
1360
|
_: 1
|
|
1354
1361
|
}, 8, ["modelValue", "label", "placeholder", "readonly"])
|
|
1355
|
-
])) :
|
|
1362
|
+
])) : M("", !0),
|
|
1356
1363
|
Ve.value ? (C(), F("div", el, [
|
|
1357
|
-
|
|
1364
|
+
u(c, {
|
|
1358
1365
|
modelValue: l.fields.tls_verify_enabled,
|
|
1359
1366
|
"onUpdate:modelValue": f[21] || (f[21] = (m) => l.fields.tls_verify_enabled = m),
|
|
1360
1367
|
"data-testid": "gateway-service-tls-verify-checkbox",
|
|
@@ -1363,7 +1370,7 @@ const ge = {
|
|
|
1363
1370
|
"label-attributes": { tooltipAttributes: { maxWidth: "400" } }
|
|
1364
1371
|
}, {
|
|
1365
1372
|
tooltip: v(() => [
|
|
1366
|
-
|
|
1373
|
+
u(o(H), {
|
|
1367
1374
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
1368
1375
|
scope: "global"
|
|
1369
1376
|
}, {
|
|
@@ -1376,24 +1383,24 @@ const ge = {
|
|
|
1376
1383
|
_: 1
|
|
1377
1384
|
}, 8, ["modelValue", "description", "label"]),
|
|
1378
1385
|
l.fields.tls_verify_enabled ? (C(), F("div", tl, [
|
|
1379
|
-
|
|
1386
|
+
u(K, {
|
|
1380
1387
|
modelValue: l.fields.tls_verify_value,
|
|
1381
1388
|
"onUpdate:modelValue": f[22] || (f[22] = (m) => l.fields.tls_verify_value = m),
|
|
1382
1389
|
"data-testid": "gateway-service-tls-verify-true-option",
|
|
1383
1390
|
label: o(r)("gateway_services.form.fields.tls_verify_option.true.label"),
|
|
1384
1391
|
"selected-value": !0
|
|
1385
1392
|
}, null, 8, ["modelValue", "label"])
|
|
1386
|
-
])) :
|
|
1393
|
+
])) : M("", !0),
|
|
1387
1394
|
l.fields.tls_verify_enabled ? (C(), F("div", ll, [
|
|
1388
|
-
|
|
1395
|
+
u(K, {
|
|
1389
1396
|
modelValue: l.fields.tls_verify_value,
|
|
1390
1397
|
"onUpdate:modelValue": f[23] || (f[23] = (m) => l.fields.tls_verify_value = m),
|
|
1391
1398
|
"data-testid": "gateway-service-tls-verify-false-option",
|
|
1392
1399
|
label: o(r)("gateway_services.form.fields.tls_verify_option.false.label"),
|
|
1393
1400
|
"selected-value": !1
|
|
1394
1401
|
}, null, 8, ["modelValue", "label"])
|
|
1395
|
-
])) :
|
|
1396
|
-
])) :
|
|
1402
|
+
])) : M("", !0)
|
|
1403
|
+
])) : M("", !0)
|
|
1397
1404
|
])
|
|
1398
1405
|
]),
|
|
1399
1406
|
_: 1
|
|
@@ -1407,7 +1414,7 @@ const ge = {
|
|
|
1407
1414
|
]);
|
|
1408
1415
|
};
|
|
1409
1416
|
}
|
|
1410
|
-
}),
|
|
1417
|
+
}), xl = /* @__PURE__ */ Ne(ol, [["__scopeId", "data-v-c2c5e1f0"]]), il = { class: "kong-ui-gateway-service-entity-config-card" }, Al = /* @__PURE__ */ Ke({
|
|
1411
1418
|
__name: "GatewayServiceConfigCard",
|
|
1412
1419
|
props: {
|
|
1413
1420
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -1434,7 +1441,7 @@ const ge = {
|
|
|
1434
1441
|
},
|
|
1435
1442
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
1436
1443
|
setup(n) {
|
|
1437
|
-
const
|
|
1444
|
+
const B = n, { i18n: { t: y }, i18nT: p } = ge.useI18n(), a = h(() => ye.form[B.config.app].edit), { getPropValue: b } = ht(), T = (r, L) => b(r, L) === !0 ? y("gateway_services.form.fields.tls_verify_option.true.display") : y("gateway_services.form.fields.tls_verify_option.false.display"), H = W({
|
|
1438
1445
|
id: {},
|
|
1439
1446
|
name: {
|
|
1440
1447
|
tooltip: y("gateway_services.form.fields.name.tooltip")
|
|
@@ -1443,19 +1450,19 @@ const ge = {
|
|
|
1443
1450
|
updated_at: {},
|
|
1444
1451
|
created_at: {},
|
|
1445
1452
|
protocol: {
|
|
1446
|
-
section:
|
|
1453
|
+
section: Ue.Basic,
|
|
1447
1454
|
tooltip: y("gateway_services.form.fields.protocol.tooltip")
|
|
1448
1455
|
},
|
|
1449
1456
|
host: {
|
|
1450
|
-
section:
|
|
1457
|
+
section: Ue.Basic,
|
|
1451
1458
|
tooltip: y("gateway_services.form.fields.host.tooltip")
|
|
1452
1459
|
},
|
|
1453
1460
|
path: {
|
|
1454
|
-
section:
|
|
1461
|
+
section: Ue.Basic,
|
|
1455
1462
|
tooltip: y("gateway_services.form.fields.path.tooltip")
|
|
1456
1463
|
},
|
|
1457
1464
|
port: {
|
|
1458
|
-
section:
|
|
1465
|
+
section: Ue.Basic,
|
|
1459
1466
|
tooltip: y("gateway_services.form.fields.port.tooltip")
|
|
1460
1467
|
},
|
|
1461
1468
|
tags: {
|
|
@@ -1494,20 +1501,20 @@ const ge = {
|
|
|
1494
1501
|
hidden: !0
|
|
1495
1502
|
}
|
|
1496
1503
|
});
|
|
1497
|
-
return (r,
|
|
1498
|
-
|
|
1504
|
+
return (r, L) => (C(), F("div", il, [
|
|
1505
|
+
u(o(kt), {
|
|
1499
1506
|
config: n.config,
|
|
1500
1507
|
"config-card-doc": n.configCardDoc,
|
|
1501
|
-
"config-schema":
|
|
1508
|
+
"config-schema": H.value,
|
|
1502
1509
|
"entity-type": o(Ge).GatewayService,
|
|
1503
1510
|
"fetch-url": a.value,
|
|
1504
1511
|
"hide-title": n.hideTitle,
|
|
1505
|
-
"onFetch:error":
|
|
1506
|
-
"onFetch:success":
|
|
1507
|
-
onLoading:
|
|
1512
|
+
"onFetch:error": L[0] || (L[0] = (I) => r.$emit("fetch:error", I)),
|
|
1513
|
+
"onFetch:success": L[1] || (L[1] = (I) => r.$emit("fetch:success", I)),
|
|
1514
|
+
onLoading: L[2] || (L[2] = (I) => r.$emit("loading", I))
|
|
1508
1515
|
}, {
|
|
1509
1516
|
"enabled-label-tooltip": v(() => [
|
|
1510
|
-
|
|
1517
|
+
u(o(p), {
|
|
1511
1518
|
keypath: "gateway_services.form.fields.enabled.tooltip",
|
|
1512
1519
|
scope: "global"
|
|
1513
1520
|
}, {
|
|
@@ -1521,7 +1528,7 @@ const ge = {
|
|
|
1521
1528
|
})
|
|
1522
1529
|
]),
|
|
1523
1530
|
"ca_certificates-label-tooltip": v(() => [
|
|
1524
|
-
|
|
1531
|
+
u(o(p), {
|
|
1525
1532
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1526
1533
|
scope: "global"
|
|
1527
1534
|
}, {
|
|
@@ -1535,7 +1542,7 @@ const ge = {
|
|
|
1535
1542
|
})
|
|
1536
1543
|
]),
|
|
1537
1544
|
"tls_verify-label-tooltip": v(() => [
|
|
1538
|
-
|
|
1545
|
+
u(o(p), {
|
|
1539
1546
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
1540
1547
|
scope: "global"
|
|
1541
1548
|
}, {
|
|
@@ -1546,7 +1553,7 @@ const ge = {
|
|
|
1546
1553
|
})
|
|
1547
1554
|
]),
|
|
1548
1555
|
tls_verify: v((I) => [
|
|
1549
|
-
z(P(typeof o(b)("rowValue", I) == "boolean" ?
|
|
1556
|
+
z(P(typeof o(b)("rowValue", I) == "boolean" ? T("rowValue", I) : o(y)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
|
|
1550
1557
|
]),
|
|
1551
1558
|
client_certificate: v((I) => [
|
|
1552
1559
|
z(P(o(b)("rowValue", I) ? o(b)("rowValue", I).id : "–"), 1)
|
|
@@ -1557,41 +1564,41 @@ const ge = {
|
|
|
1557
1564
|
}
|
|
1558
1565
|
});
|
|
1559
1566
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
1560
|
-
const
|
|
1567
|
+
const Je = () => {
|
|
1561
1568
|
};
|
|
1562
|
-
function rl(n,
|
|
1569
|
+
function rl(n, B) {
|
|
1563
1570
|
function y(...p) {
|
|
1564
1571
|
return new Promise((a, b) => {
|
|
1565
|
-
Promise.resolve(n(() =>
|
|
1572
|
+
Promise.resolve(n(() => B.apply(this, p), { fn: B, thisArg: this, args: p })).then(a).catch(b);
|
|
1566
1573
|
});
|
|
1567
1574
|
}
|
|
1568
1575
|
return y;
|
|
1569
1576
|
}
|
|
1570
|
-
function sl(n,
|
|
1571
|
-
let y, p, a =
|
|
1577
|
+
function sl(n, B = {}) {
|
|
1578
|
+
let y, p, a = Je;
|
|
1572
1579
|
const b = (r) => {
|
|
1573
|
-
clearTimeout(r), a(), a =
|
|
1580
|
+
clearTimeout(r), a(), a = Je;
|
|
1574
1581
|
};
|
|
1575
|
-
let
|
|
1582
|
+
let T;
|
|
1576
1583
|
return (r) => {
|
|
1577
|
-
const
|
|
1578
|
-
return y && b(y),
|
|
1579
|
-
a =
|
|
1580
|
-
y && b(y), p = null, ie(
|
|
1584
|
+
const L = ze(n), I = ze(B.maxWait);
|
|
1585
|
+
return y && b(y), L <= 0 || I !== void 0 && I <= 0 ? (p && (b(p), p = null), Promise.resolve(r())) : new Promise((ie, de) => {
|
|
1586
|
+
a = B.rejectOnCancel ? de : ie, T = r, I && !p && (p = setTimeout(() => {
|
|
1587
|
+
y && b(y), p = null, ie(T());
|
|
1581
1588
|
}, I)), y = setTimeout(() => {
|
|
1582
1589
|
p && b(p), p = null, ie(r());
|
|
1583
|
-
},
|
|
1590
|
+
}, L);
|
|
1584
1591
|
});
|
|
1585
1592
|
};
|
|
1586
1593
|
}
|
|
1587
|
-
function De(n,
|
|
1594
|
+
function De(n, B = 200, y = {}) {
|
|
1588
1595
|
return rl(
|
|
1589
|
-
sl(
|
|
1596
|
+
sl(B, y),
|
|
1590
1597
|
n
|
|
1591
1598
|
);
|
|
1592
1599
|
}
|
|
1593
1600
|
const te = {
|
|
1594
|
-
name: "
|
|
1601
|
+
name: "Kong-Air-Flights-API",
|
|
1595
1602
|
tags: [],
|
|
1596
1603
|
protocol: "https",
|
|
1597
1604
|
path: "/flights",
|
|
@@ -1606,10 +1613,10 @@ const te = {
|
|
|
1606
1613
|
}, al = { class: "kong-ui-entities-gateway-service-form" }, nl = {
|
|
1607
1614
|
key: 0,
|
|
1608
1615
|
class: "gateway-service-form-general-info"
|
|
1609
|
-
}, cl = { class: "gateway-service-form-group-selection-wrapper" },
|
|
1616
|
+
}, cl = { class: "gateway-service-form-group-selection-wrapper" }, ul = {
|
|
1610
1617
|
key: 0,
|
|
1611
1618
|
class: "gateway-service-form-group-fields"
|
|
1612
|
-
},
|
|
1619
|
+
}, dl = {
|
|
1613
1620
|
key: 0,
|
|
1614
1621
|
class: "gateway-service-form-group-fields"
|
|
1615
1622
|
}, fl = { key: 0 }, pl = {
|
|
@@ -1630,7 +1637,7 @@ const te = {
|
|
|
1630
1637
|
}, kl = {
|
|
1631
1638
|
key: 1,
|
|
1632
1639
|
class: "checkbox-aligned-radio"
|
|
1633
|
-
}, Vl = { class: "gateway-service-form-tags" }, Cl = { class: "form-error-list" }, Sl = /* @__PURE__ */
|
|
1640
|
+
}, Vl = { class: "gateway-service-form-tags" }, Cl = { class: "form-error-list" }, Sl = /* @__PURE__ */ Ke({
|
|
1634
1641
|
__name: "GatewayServiceForm",
|
|
1635
1642
|
props: {
|
|
1636
1643
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -1664,9 +1671,9 @@ const te = {
|
|
|
1664
1671
|
}
|
|
1665
1672
|
},
|
|
1666
1673
|
emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated", "try-sample-api"],
|
|
1667
|
-
setup(n, { expose:
|
|
1674
|
+
setup(n, { expose: B, emit: y }) {
|
|
1668
1675
|
var he;
|
|
1669
|
-
const p = y, a = n, b = W(!0),
|
|
1676
|
+
const p = y, a = n, b = W(!0), T = qe(), { i18nT: H, i18n: { t: r } } = ge.useI18n(), { getErrorFieldsFromError: L } = Xe(), { axiosInstance: I } = Oe((he = a.config) == null ? void 0 : he.axiosRequestConfig), ie = Ye(), { validateHost: de, validatePath: X, validatePort: ke, validateProtocol: fe } = ge.useUrlValidators(), x = h(() => ye.form[a.config.app].edit), Y = h(() => a.gatewayServiceId ? Me.Edit : Me.Create), ee = W(!1), re = h(() => !!a.gatewayServiceId), l = W(re.value ? "protocol" : "url"), A = ge.usePortFromProtocol(), se = W(""), Pe = h(() => !!se.value || !!ue("name")), t = Te({
|
|
1670
1677
|
fields: {
|
|
1671
1678
|
name: "",
|
|
1672
1679
|
protocol: "http",
|
|
@@ -1702,7 +1709,7 @@ const te = {
|
|
|
1702
1709
|
tls_verify_enabled: "",
|
|
1703
1710
|
tls_verify_value: ""
|
|
1704
1711
|
}
|
|
1705
|
-
}),
|
|
1712
|
+
}), $ = Te({
|
|
1706
1713
|
name: "",
|
|
1707
1714
|
protocol: "http",
|
|
1708
1715
|
host: "",
|
|
@@ -1780,7 +1787,7 @@ const te = {
|
|
|
1780
1787
|
], q = { url: "url", protocol: "protocol" }, pe = (e, s) => {
|
|
1781
1788
|
s.value;
|
|
1782
1789
|
}, ce = (e) => e ? parseFloat(e) : 0, _e = () => {
|
|
1783
|
-
t.fields.host =
|
|
1790
|
+
t.fields.host = $.host, t.fields.path = $.path, t.fields.port = $.port, t.fields.protocol = $.protocol, t.fields.url = $.url, t.fields.retries = $.retries, t.fields.connect_timeout = $.connect_timeout, t.fields.write_timeout = $.write_timeout, t.fields.read_timeout = $.read_timeout, t.fields.client_certificate = $.client_certificate, t.fields.ca_certificates = $.ca_certificates, t.fields.tls_verify_enabled = $.tls_verify_enabled, t.fields.tls_verify_value = $.tls_verify_value;
|
|
1784
1791
|
}, Ve = () => {
|
|
1785
1792
|
b.value = !0, N(), t.errorMessages = [], _e();
|
|
1786
1793
|
}, Ce = () => {
|
|
@@ -1800,7 +1807,7 @@ const te = {
|
|
|
1800
1807
|
const e = new URL(t.fields.url), s = fe(e.protocol, ne);
|
|
1801
1808
|
if (s) throw new Error(s);
|
|
1802
1809
|
t.fields.protocol = e.protocol.slice(0, -1);
|
|
1803
|
-
const V =
|
|
1810
|
+
const V = de(e.hostname);
|
|
1804
1811
|
if (V) throw new Error(V);
|
|
1805
1812
|
t.fields.host = e.hostname;
|
|
1806
1813
|
const G = X(e.pathname);
|
|
@@ -1808,25 +1815,25 @@ const te = {
|
|
|
1808
1815
|
t.fields.path = e.pathname;
|
|
1809
1816
|
const E = ke(e.port);
|
|
1810
1817
|
if (E) throw new Error(E);
|
|
1811
|
-
const
|
|
1812
|
-
ee.value = !!
|
|
1818
|
+
const R = Number(e.port);
|
|
1819
|
+
ee.value = !!R, t.fields.port = R || A.getPortFromProtocol(t.fields.protocol), p("url-valid:success");
|
|
1813
1820
|
} catch (e) {
|
|
1814
|
-
p("url-valid:error", e.message || "
|
|
1821
|
+
p("url-valid:error", e.message || r("gateway_services.form.errors.url.invalid")), t.formFieldErrors.url = e.message || r("gateway_services.form.errors.url.invalid");
|
|
1815
1822
|
}
|
|
1816
1823
|
}, 300), be = De((e) => {
|
|
1817
|
-
N(e
|
|
1818
|
-
}, 300), Se = h(() => !!t.formFieldErrors.url || !!t.formFieldErrors.host || !!t.formFieldErrors.port),
|
|
1824
|
+
N(e);
|
|
1825
|
+
}, 300), Se = h(() => !!t.formFieldErrors.url || !!t.formFieldErrors.host || !!t.formFieldErrors.port), ue = (e) => {
|
|
1819
1826
|
if (t.errorMessages.length) return "";
|
|
1820
1827
|
const s = t.formFieldErrors;
|
|
1821
1828
|
return s[e] ? s[e] : "";
|
|
1822
1829
|
}, le = De((e) => {
|
|
1823
1830
|
N(e ?? void 0);
|
|
1824
|
-
const s =
|
|
1831
|
+
const s = de(t.fields.host);
|
|
1825
1832
|
s && (t.formFieldErrors.host = s);
|
|
1826
1833
|
const V = X(t.fields.path);
|
|
1827
1834
|
V && (t.formFieldErrors.path = V);
|
|
1828
1835
|
const G = ke(t.fields.port);
|
|
1829
|
-
G && (t.formFieldErrors.port = G),
|
|
1836
|
+
G && (t.formFieldErrors.port = G), Z.value ? p("url-valid:success") : p("url-valid:error", t.errorMessages.join(",") || r("gateway_services.form.errors.url.invalid"));
|
|
1830
1837
|
}, 300), N = (e) => {
|
|
1831
1838
|
if (e)
|
|
1832
1839
|
t.formFieldErrors[e] = "";
|
|
@@ -1834,14 +1841,11 @@ const te = {
|
|
|
1834
1841
|
for (let s in t.formFieldErrors)
|
|
1835
1842
|
t.formFieldErrors[s] = "";
|
|
1836
1843
|
t.errorMessages = [];
|
|
1837
|
-
},
|
|
1838
|
-
let e
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
break;
|
|
1843
|
-
}
|
|
1844
|
-
return e;
|
|
1844
|
+
}, Z = h(() => {
|
|
1845
|
+
for (let e in t.formFieldErrors)
|
|
1846
|
+
if (t.formFieldErrors[e].length)
|
|
1847
|
+
return !1;
|
|
1848
|
+
return !0;
|
|
1845
1849
|
}), oe = () => {
|
|
1846
1850
|
t.fields.url && l.value === "url" ? me() : le();
|
|
1847
1851
|
}, ve = () => `new-service-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, i = h(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(t.fields.protocol)), f = h(() => {
|
|
@@ -1854,23 +1858,23 @@ const te = {
|
|
|
1854
1858
|
return !0;
|
|
1855
1859
|
const e = ["https", "tls"].includes(t.fields.protocol);
|
|
1856
1860
|
return l.value === "protocol" && e;
|
|
1857
|
-
}),
|
|
1861
|
+
}), J = h(() => {
|
|
1858
1862
|
if (l.value === "url")
|
|
1859
1863
|
return !0;
|
|
1860
1864
|
const e = ["https", "wss", "tls"].includes(t.fields.protocol);
|
|
1861
1865
|
return l.value === "protocol" && e;
|
|
1862
|
-
}),
|
|
1866
|
+
}), K = (e) => {
|
|
1863
1867
|
se.value = ie.utf8Name(e);
|
|
1864
|
-
},
|
|
1868
|
+
}, U = h(() => {
|
|
1865
1869
|
if (re.value)
|
|
1866
|
-
return JSON.stringify(t.fields) !== JSON.stringify(
|
|
1867
|
-
const e = l.value === "url" && !!t.fields.url &&
|
|
1870
|
+
return JSON.stringify(t.fields) !== JSON.stringify($);
|
|
1871
|
+
const e = l.value === "url" && !!t.fields.url && Z.value, s = l.value === "protocol" && !!t.fields.host && Z.value;
|
|
1868
1872
|
return e || s;
|
|
1869
1873
|
}), c = (e) => {
|
|
1870
1874
|
var s, V, G;
|
|
1871
|
-
t.fields.name = (e == null ? void 0 : e.name) || "", t.fields.tags = ((s = e == null ? void 0 : e.tags) == null ? void 0 : s.join(", ")) || "", t.fields.protocol = (e == null ? void 0 : e.protocol) || "http", t.fields.path = (e == null ? void 0 : e.path) || "", t.fields.read_timeout = e != null && e.read_timeout || (e == null ? void 0 : e.read_timeout) === 0 ? e == null ? void 0 : e.read_timeout : 6e4, t.fields.retries = e != null && e.retries || (e == null ? void 0 : e.retries) === 0 ? e == null ? void 0 : e.retries : 5, t.fields.host = (e == null ? void 0 : e.host) || "", t.fields.connect_timeout = e != null && e.connect_timeout || (e == null ? void 0 : e.connect_timeout) === 0 ? e == null ? void 0 : e.connect_timeout : 6e4, t.fields.tls_verify_enabled = (e == null ? void 0 : e.tls_verify) !== "" && (e == null ? void 0 : e.tls_verify) !== null && (e == null ? void 0 : e.tls_verify) !== void 0, t.fields.tls_verify_value = e != null && e.tls_verify ? e == null ? void 0 : e.tls_verify : !1, t.fields.ca_certificates = ((V = e == null ? void 0 : e.ca_certificates) == null ? void 0 : V.join(",")) || "", t.fields.client_certificate = ((G = e == null ? void 0 : e.client_certificate) == null ? void 0 : G.id) || "", t.fields.write_timeout = e != null && e.write_timeout || (e == null ? void 0 : e.write_timeout) === 0 ? e == null ? void 0 : e.write_timeout : 6e4, t.fields.port = e != null && e.port || (e == null ? void 0 : e.port) === 0 ? e == null ? void 0 : e.port : 80, Object.assign(
|
|
1875
|
+
t.fields.name = (e == null ? void 0 : e.name) || "", t.fields.tags = ((s = e == null ? void 0 : e.tags) == null ? void 0 : s.join(", ")) || "", t.fields.protocol = (e == null ? void 0 : e.protocol) || "http", t.fields.path = (e == null ? void 0 : e.path) || "", t.fields.read_timeout = e != null && e.read_timeout || (e == null ? void 0 : e.read_timeout) === 0 ? e == null ? void 0 : e.read_timeout : 6e4, t.fields.retries = e != null && e.retries || (e == null ? void 0 : e.retries) === 0 ? e == null ? void 0 : e.retries : 5, t.fields.host = (e == null ? void 0 : e.host) || "", t.fields.connect_timeout = e != null && e.connect_timeout || (e == null ? void 0 : e.connect_timeout) === 0 ? e == null ? void 0 : e.connect_timeout : 6e4, t.fields.tls_verify_enabled = (e == null ? void 0 : e.tls_verify) !== "" && (e == null ? void 0 : e.tls_verify) !== null && (e == null ? void 0 : e.tls_verify) !== void 0, t.fields.tls_verify_value = e != null && e.tls_verify ? e == null ? void 0 : e.tls_verify : !1, t.fields.ca_certificates = ((V = e == null ? void 0 : e.ca_certificates) == null ? void 0 : V.join(",")) || "", t.fields.client_certificate = ((G = e == null ? void 0 : e.client_certificate) == null ? void 0 : G.id) || "", t.fields.write_timeout = e != null && e.write_timeout || (e == null ? void 0 : e.write_timeout) === 0 ? e == null ? void 0 : e.write_timeout : 6e4, t.fields.port = e != null && e.port || (e == null ? void 0 : e.port) === 0 ? e == null ? void 0 : e.port : 80, Object.assign($, t.fields);
|
|
1872
1876
|
}, g = () => {
|
|
1873
|
-
|
|
1877
|
+
T.push(a.config.cancelRoute);
|
|
1874
1878
|
}, m = h(() => {
|
|
1875
1879
|
var s, V;
|
|
1876
1880
|
let e = `${a.config.apiBaseUrl}${ye.form[a.config.app].validate}`;
|
|
@@ -1886,7 +1890,7 @@ const te = {
|
|
|
1886
1890
|
var s, V, G, E;
|
|
1887
1891
|
const e = {
|
|
1888
1892
|
name: t.fields.name || null,
|
|
1889
|
-
tags: t.fields.tags ? (G = (V = (s = t.fields.tags) == null ? void 0 : s.split(",")) == null ? void 0 : V.map((
|
|
1893
|
+
tags: t.fields.tags ? (G = (V = (s = t.fields.tags) == null ? void 0 : s.split(",")) == null ? void 0 : V.map((R) => String(R || "").trim())) == null ? void 0 : G.filter((R) => R !== "") : null,
|
|
1890
1894
|
protocol: t.fields.protocol,
|
|
1891
1895
|
path: t.fields.path || null,
|
|
1892
1896
|
read_timeout: t.fields.read_timeout,
|
|
@@ -1895,7 +1899,7 @@ const te = {
|
|
|
1895
1899
|
connect_timeout: t.fields.connect_timeout,
|
|
1896
1900
|
tls_verify_value: t.fields.tls_verify_value,
|
|
1897
1901
|
tls_verify_enabled: t.fields.tls_verify_enabled,
|
|
1898
|
-
ca_certificates: t.fields.ca_certificates ? (E = t.fields.ca_certificates) == null ? void 0 : E.split(",").filter((
|
|
1902
|
+
ca_certificates: t.fields.ca_certificates ? (E = t.fields.ca_certificates) == null ? void 0 : E.split(",").filter((R) => R !== "") : null,
|
|
1899
1903
|
client_certificate: t.fields.client_certificate ? { id: t.fields.client_certificate } : null,
|
|
1900
1904
|
write_timeout: t.fields.write_timeout,
|
|
1901
1905
|
port: t.fields.port,
|
|
@@ -1908,15 +1912,15 @@ const te = {
|
|
|
1908
1912
|
t.isReadonly = !0, oe();
|
|
1909
1913
|
const E = Q.value;
|
|
1910
1914
|
O(E);
|
|
1911
|
-
let
|
|
1912
|
-
if (await I.post(m.value, E), Y.value === "create" ?
|
|
1913
|
-
const { data:
|
|
1914
|
-
t.fields.name = (
|
|
1915
|
+
let R;
|
|
1916
|
+
if (await I.post(m.value, E), Y.value === "create" ? R = await I.post(w.value, E) : Y.value === "edit" && (R = ((e = a.config) == null ? void 0 : e.app) === "konnect" ? await I.put(w.value, E) : await I.patch(w.value, E)), R) {
|
|
1917
|
+
const { data: d } = R;
|
|
1918
|
+
t.fields.name = (d == null ? void 0 : d.name) || "", t.fields.port = d.port || A.getPortFromProtocol(d.protocol), t.fields.protocol = (d == null ? void 0 : d.protocol) || "http", t.fields.host = (d == null ? void 0 : d.host) || "", t.fields.path = (d == null ? void 0 : d.path) || "", t.fields.url = (d == null ? void 0 : d.url) || "", t.fields.retries = d != null && d.retries || (d == null ? void 0 : d.retries) === 0 ? d == null ? void 0 : d.retries : 5, t.fields.connect_timeout = d != null && d.connect_timeout || (d == null ? void 0 : d.connect_timeout) === 0 ? d == null ? void 0 : d.connect_timeout : 6e4, t.fields.write_timeout = d != null && d.write_timeout || (d == null ? void 0 : d.write_timeout) === 0 ? d == null ? void 0 : d.write_timeout : 6e4, t.fields.read_timeout = d != null && d.read_timeout || (d == null ? void 0 : d.read_timeout) === 0 ? d == null ? void 0 : d.read_timeout : 6e4, t.fields.client_certificate = ((s = d == null ? void 0 : d.client_certificate) == null ? void 0 : s.id) || "", t.fields.ca_certificates = (V = d == null ? void 0 : d.ca_certificates) != null && V.length ? d == null ? void 0 : d.ca_certificates.join(",") : "", t.fields.tls_verify_enabled = (d == null ? void 0 : d.tls_verify) !== "" && (d == null ? void 0 : d.tls_verify) !== null && (d == null ? void 0 : d.tls_verify) !== void 0, t.fields.tls_verify_value = t.fields.tls_verify_enabled && (d == null ? void 0 : d.tls_verify), t.fields.tags = (G = d == null ? void 0 : d.tags) != null && G.length ? d.tags.join(", ") : "", Object.assign($, t.fields), p("update", R == null ? void 0 : R.data);
|
|
1915
1919
|
}
|
|
1916
|
-
return
|
|
1920
|
+
return R;
|
|
1917
1921
|
} catch (E) {
|
|
1918
|
-
const { fields:
|
|
1919
|
-
t.errorMessages =
|
|
1922
|
+
const { fields: R, messages: d } = L(E);
|
|
1923
|
+
t.errorMessages = d, R.length && R.forEach((we) => {
|
|
1920
1924
|
const Ie = we.field;
|
|
1921
1925
|
Ie === "client_certificate.id" ? t.formFieldErrors.client_certificate = we.message : Ie.startsWith("ca_certificates") ? t.formFieldErrors.ca_certificates = we.message : Object.keys(t.formFieldErrors).includes(Ie) && (t.formFieldErrors = {
|
|
1922
1926
|
...t.formFieldErrors,
|
|
@@ -1927,27 +1931,27 @@ const te = {
|
|
|
1927
1931
|
t.isReadonly = !1;
|
|
1928
1932
|
}
|
|
1929
1933
|
};
|
|
1930
|
-
return
|
|
1931
|
-
Object.assign(t.fields,
|
|
1932
|
-
}),
|
|
1933
|
-
t.fields.port =
|
|
1934
|
-
}),
|
|
1934
|
+
return $e(() => a.gatewayServiceId, () => {
|
|
1935
|
+
Object.assign(t.fields, $);
|
|
1936
|
+
}), $e(t.fields, (e) => {
|
|
1937
|
+
t.fields.port = A.getPortFromProtocol(e.protocol, String(e.port)), p("model-updated", Q.value);
|
|
1938
|
+
}), Ze(() => {
|
|
1935
1939
|
p("model-updated", Q.value), re.value || (t.fields.name = ve());
|
|
1936
|
-
}),
|
|
1940
|
+
}), B({
|
|
1937
1941
|
validateUrl: oe,
|
|
1938
1942
|
getPayload: Q,
|
|
1939
1943
|
saveFormData: j,
|
|
1940
|
-
canSubmit:
|
|
1944
|
+
canSubmit: U,
|
|
1941
1945
|
initForm: c
|
|
1942
1946
|
}), (e, s) => {
|
|
1943
|
-
const V = D("KRadio"), G = D("KButton"), E = D("KInput"),
|
|
1947
|
+
const V = D("KRadio"), G = D("KButton"), E = D("KInput"), R = D("KSelect"), d = D("KCheckbox"), we = D("KCollapse"), Ie = D("KAlert");
|
|
1944
1948
|
return C(), F("div", al, [
|
|
1945
|
-
|
|
1946
|
-
"can-submit":
|
|
1949
|
+
u(o(tt), {
|
|
1950
|
+
"can-submit": U.value,
|
|
1947
1951
|
config: n.config,
|
|
1948
1952
|
"edit-id": n.gatewayServiceId,
|
|
1949
1953
|
"entity-type": o(Ge).GatewayService,
|
|
1950
|
-
"fetch-url":
|
|
1954
|
+
"fetch-url": x.value,
|
|
1951
1955
|
"form-fields": Q.value,
|
|
1952
1956
|
"is-readonly": t.isReadonly,
|
|
1953
1957
|
onCancel: g,
|
|
@@ -1958,21 +1962,21 @@ const te = {
|
|
|
1958
1962
|
}, {
|
|
1959
1963
|
"form-actions": v(() => [
|
|
1960
1964
|
Qe(e.$slots, "form-actions", {
|
|
1961
|
-
canSubmit:
|
|
1965
|
+
canSubmit: U.value,
|
|
1962
1966
|
cancel: g,
|
|
1963
1967
|
submit: j
|
|
1964
1968
|
}, void 0, !0)
|
|
1965
1969
|
]),
|
|
1966
1970
|
default: v(() => [
|
|
1967
|
-
|
|
1971
|
+
u(o(Be), {
|
|
1968
1972
|
description: o(r)("gateway_services.form.sections.keys.description"),
|
|
1969
1973
|
"hide-info-header": n.hideSectionsInfo,
|
|
1970
1974
|
title: o(r)("gateway_services.form.sections.keys.title")
|
|
1971
1975
|
}, {
|
|
1972
1976
|
default: v(() => [
|
|
1973
|
-
re.value ?
|
|
1977
|
+
re.value ? M("", !0) : (C(), F("div", nl, [
|
|
1974
1978
|
S("div", cl, [
|
|
1975
|
-
|
|
1979
|
+
u(V, {
|
|
1976
1980
|
modelValue: l.value,
|
|
1977
1981
|
"onUpdate:modelValue": s[0] || (s[0] = (_) => l.value = _),
|
|
1978
1982
|
card: "",
|
|
@@ -1983,7 +1987,7 @@ const te = {
|
|
|
1983
1987
|
"selected-value": q.url,
|
|
1984
1988
|
onChange: Ve
|
|
1985
1989
|
}, null, 8, ["modelValue", "description", "label", "selected-value"]),
|
|
1986
|
-
|
|
1990
|
+
u(V, {
|
|
1987
1991
|
modelValue: l.value,
|
|
1988
1992
|
"onUpdate:modelValue": s[1] || (s[1] = (_) => l.value = _),
|
|
1989
1993
|
card: "",
|
|
@@ -1996,17 +2000,17 @@ const te = {
|
|
|
1996
2000
|
onChange: Ve
|
|
1997
2001
|
}, null, 8, ["modelValue", "description", "label", "selected-value"])
|
|
1998
2002
|
]),
|
|
1999
|
-
|
|
2003
|
+
u(We, { name: "slide-fade" }, {
|
|
2000
2004
|
default: v(() => [
|
|
2001
|
-
l.value === "url" ? (C(), F("div",
|
|
2002
|
-
|
|
2005
|
+
l.value === "url" ? (C(), F("div", ul, [
|
|
2006
|
+
u(E, {
|
|
2003
2007
|
modelValue: t.fields.url,
|
|
2004
2008
|
"onUpdate:modelValue": s[2] || (s[2] = (_) => t.fields.url = _),
|
|
2005
2009
|
modelModifiers: { trim: !0 },
|
|
2006
2010
|
class: "gateway-service-url-input gateway-service-form-margin-bottom",
|
|
2007
2011
|
"data-testid": "gateway-service-url-input",
|
|
2008
2012
|
error: Se.value,
|
|
2009
|
-
"error-message":
|
|
2013
|
+
"error-message": ue("url"),
|
|
2010
2014
|
label: o(r)("gateway_services.form.fields.upstream_url.label"),
|
|
2011
2015
|
"label-attributes": {
|
|
2012
2016
|
info: n.config.app === "konnect" ? o(r)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(r)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
|
|
@@ -2016,11 +2020,11 @@ const te = {
|
|
|
2016
2020
|
placeholder: o(r)("gateway_services.form.fields.upstream_url.placeholder"),
|
|
2017
2021
|
required: "",
|
|
2018
2022
|
onInput: o(me)
|
|
2019
|
-
},
|
|
2023
|
+
}, Re({ _: 2 }, [
|
|
2020
2024
|
n.hideTrySampleApiButton ? void 0 : {
|
|
2021
2025
|
name: "after",
|
|
2022
2026
|
fn: v(() => [
|
|
2023
|
-
|
|
2027
|
+
u(G, {
|
|
2024
2028
|
appearance: "tertiary",
|
|
2025
2029
|
size: "small",
|
|
2026
2030
|
onClick: Ce
|
|
@@ -2034,15 +2038,15 @@ const te = {
|
|
|
2034
2038
|
key: "0"
|
|
2035
2039
|
}
|
|
2036
2040
|
]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "onInput"])
|
|
2037
|
-
])) :
|
|
2041
|
+
])) : M("", !0)
|
|
2038
2042
|
]),
|
|
2039
2043
|
_: 1
|
|
2040
2044
|
})
|
|
2041
2045
|
])),
|
|
2042
|
-
|
|
2046
|
+
u(We, { name: "slide-fade" }, {
|
|
2043
2047
|
default: v(() => [
|
|
2044
|
-
l.value === "protocol" || re.value ? (C(), F("div",
|
|
2045
|
-
|
|
2048
|
+
l.value === "protocol" || re.value ? (C(), F("div", dl, [
|
|
2049
|
+
u(R, {
|
|
2046
2050
|
modelValue: t.fields.protocol,
|
|
2047
2051
|
"onUpdate:modelValue": s[3] || (s[3] = (_) => t.fields.protocol = _),
|
|
2048
2052
|
"data-testid": "gateway-service-protocol-select",
|
|
@@ -2057,14 +2061,14 @@ const te = {
|
|
|
2057
2061
|
width: "100%",
|
|
2058
2062
|
onSelected: s[4] || (s[4] = (_) => pe(t.fields.protocol, _))
|
|
2059
2063
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
|
|
2060
|
-
|
|
2064
|
+
u(E, {
|
|
2061
2065
|
modelValue: t.fields.host,
|
|
2062
2066
|
"onUpdate:modelValue": s[5] || (s[5] = (_) => t.fields.host = _),
|
|
2063
2067
|
modelModifiers: { trim: !0 },
|
|
2064
2068
|
class: "gateway-service-form-margin-top",
|
|
2065
2069
|
"data-testid": "gateway-service-host-input",
|
|
2066
2070
|
error: !!t.formFieldErrors.host,
|
|
2067
|
-
"error-message":
|
|
2071
|
+
"error-message": ue("host"),
|
|
2068
2072
|
label: o(r)("gateway_services.form.fields.host.label"),
|
|
2069
2073
|
"label-attributes": {
|
|
2070
2074
|
info: o(r)("gateway_services.form.fields.host.tooltip"),
|
|
@@ -2074,11 +2078,11 @@ const te = {
|
|
|
2074
2078
|
placeholder: o(r)("gateway_services.form.fields.host.placeholder"),
|
|
2075
2079
|
required: "",
|
|
2076
2080
|
onInput: s[6] || (s[6] = (_) => o(le)("host"))
|
|
2077
|
-
},
|
|
2081
|
+
}, Re({ _: 2 }, [
|
|
2078
2082
|
n.hideTrySampleApiButton ? void 0 : {
|
|
2079
2083
|
name: "after",
|
|
2080
2084
|
fn: v(() => [
|
|
2081
|
-
|
|
2085
|
+
u(G, {
|
|
2082
2086
|
appearance: "tertiary",
|
|
2083
2087
|
size: "small",
|
|
2084
2088
|
onClick: Ce
|
|
@@ -2093,14 +2097,14 @@ const te = {
|
|
|
2093
2097
|
}
|
|
2094
2098
|
]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"]),
|
|
2095
2099
|
i.value ? (C(), F("div", fl, [
|
|
2096
|
-
|
|
2100
|
+
u(E, {
|
|
2097
2101
|
modelValue: t.fields.path,
|
|
2098
2102
|
"onUpdate:modelValue": s[7] || (s[7] = (_) => t.fields.path = _),
|
|
2099
2103
|
modelModifiers: { trim: !0 },
|
|
2100
2104
|
class: "gateway-service-form-margin-top",
|
|
2101
2105
|
"data-testid": "gateway-service-path-input",
|
|
2102
2106
|
error: !!t.formFieldErrors.path,
|
|
2103
|
-
"error-message":
|
|
2107
|
+
"error-message": ue("path"),
|
|
2104
2108
|
label: o(r)("gateway_services.form.fields.path.label"),
|
|
2105
2109
|
"label-attributes": {
|
|
2106
2110
|
info: o(r)("gateway_services.form.fields.path.tooltip"),
|
|
@@ -2110,8 +2114,8 @@ const te = {
|
|
|
2110
2114
|
placeholder: o(r)("gateway_services.form.fields.path.placeholder"),
|
|
2111
2115
|
onInput: s[8] || (s[8] = (_) => o(le)("path"))
|
|
2112
2116
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
|
|
2113
|
-
])) :
|
|
2114
|
-
|
|
2117
|
+
])) : M("", !0),
|
|
2118
|
+
u(E, {
|
|
2115
2119
|
modelValue: t.fields.port,
|
|
2116
2120
|
"onUpdate:modelValue": [
|
|
2117
2121
|
s[9] || (s[9] = (_) => t.fields.port = _),
|
|
@@ -2122,7 +2126,7 @@ const te = {
|
|
|
2122
2126
|
class: "gateway-service-form-margin-top",
|
|
2123
2127
|
"data-testid": "gateway-service-port-input",
|
|
2124
2128
|
error: !!t.formFieldErrors.port,
|
|
2125
|
-
"error-message":
|
|
2129
|
+
"error-message": ue("port"),
|
|
2126
2130
|
label: o(r)("gateway_services.form.fields.port.label"),
|
|
2127
2131
|
"label-attributes": {
|
|
2128
2132
|
info: o(r)("gateway_services.form.fields.port.tooltip"),
|
|
@@ -2132,11 +2136,11 @@ const te = {
|
|
|
2132
2136
|
type: "number",
|
|
2133
2137
|
onInput: s[10] || (s[10] = (_) => o(le)("port"))
|
|
2134
2138
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes"])
|
|
2135
|
-
])) :
|
|
2139
|
+
])) : M("", !0)
|
|
2136
2140
|
]),
|
|
2137
2141
|
_: 1
|
|
2138
2142
|
}),
|
|
2139
|
-
|
|
2143
|
+
u(we, {
|
|
2140
2144
|
modelValue: b.value,
|
|
2141
2145
|
"onUpdate:modelValue": s[27] || (s[27] = (_) => b.value = _),
|
|
2142
2146
|
"data-testid": "advanced-fields-collapse",
|
|
@@ -2144,11 +2148,11 @@ const te = {
|
|
|
2144
2148
|
"trigger-label": o(r)("gateway_services.form.sections.keys.viewAdvancedFields")
|
|
2145
2149
|
}, {
|
|
2146
2150
|
default: v(() => [
|
|
2147
|
-
|
|
2151
|
+
u(We, { name: "slide-fade" }, {
|
|
2148
2152
|
default: v(() => [
|
|
2149
|
-
b.value ?
|
|
2153
|
+
b.value ? M("", !0) : (C(), F("div", pl, [
|
|
2150
2154
|
S("div", ml, [
|
|
2151
|
-
|
|
2155
|
+
u(E, {
|
|
2152
2156
|
modelValue: t.fields.retries,
|
|
2153
2157
|
"onUpdate:modelValue": [
|
|
2154
2158
|
s[12] || (s[12] = (_) => t.fields.retries = _),
|
|
@@ -2169,7 +2173,7 @@ const te = {
|
|
|
2169
2173
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
2170
2174
|
]),
|
|
2171
2175
|
S("div", vl, [
|
|
2172
|
-
|
|
2176
|
+
u(E, {
|
|
2173
2177
|
modelValue: t.fields.connect_timeout,
|
|
2174
2178
|
"onUpdate:modelValue": [
|
|
2175
2179
|
s[14] || (s[14] = (_) => t.fields.connect_timeout = _),
|
|
@@ -2190,7 +2194,7 @@ const te = {
|
|
|
2190
2194
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
2191
2195
|
]),
|
|
2192
2196
|
S("div", gl, [
|
|
2193
|
-
|
|
2197
|
+
u(E, {
|
|
2194
2198
|
modelValue: t.fields.write_timeout,
|
|
2195
2199
|
"onUpdate:modelValue": [
|
|
2196
2200
|
s[16] || (s[16] = (_) => t.fields.write_timeout = _),
|
|
@@ -2211,7 +2215,7 @@ const te = {
|
|
|
2211
2215
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
2212
2216
|
]),
|
|
2213
2217
|
S("div", yl, [
|
|
2214
|
-
|
|
2218
|
+
u(E, {
|
|
2215
2219
|
modelValue: t.fields.read_timeout,
|
|
2216
2220
|
"onUpdate:modelValue": [
|
|
2217
2221
|
s[18] || (s[18] = (_) => t.fields.read_timeout = _),
|
|
@@ -2232,7 +2236,7 @@ const te = {
|
|
|
2232
2236
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
2233
2237
|
]),
|
|
2234
2238
|
f.value ? (C(), F("div", _l, [
|
|
2235
|
-
|
|
2239
|
+
u(E, {
|
|
2236
2240
|
modelValue: t.fields.client_certificate,
|
|
2237
2241
|
"onUpdate:modelValue": s[20] || (s[20] = (_) => t.fields.client_certificate = _),
|
|
2238
2242
|
modelModifiers: { trim: !0 },
|
|
@@ -2250,9 +2254,9 @@ const te = {
|
|
|
2250
2254
|
type: "text",
|
|
2251
2255
|
onInput: s[21] || (s[21] = (_) => o(be)("client_certificate"))
|
|
2252
2256
|
}, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"])
|
|
2253
|
-
])) :
|
|
2257
|
+
])) : M("", !0),
|
|
2254
2258
|
k.value ? (C(), F("div", bl, [
|
|
2255
|
-
|
|
2259
|
+
u(E, {
|
|
2256
2260
|
modelValue: t.fields.ca_certificates,
|
|
2257
2261
|
"onUpdate:modelValue": s[22] || (s[22] = (_) => t.fields.ca_certificates = _),
|
|
2258
2262
|
modelModifiers: { trim: !0 },
|
|
@@ -2267,7 +2271,7 @@ const te = {
|
|
|
2267
2271
|
onInput: s[23] || (s[23] = (_) => o(be)("ca_certificates"))
|
|
2268
2272
|
}, {
|
|
2269
2273
|
"label-tooltip": v(() => [
|
|
2270
|
-
|
|
2274
|
+
u(o(H), {
|
|
2271
2275
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
2272
2276
|
scope: "global"
|
|
2273
2277
|
}, {
|
|
@@ -2282,9 +2286,9 @@ const te = {
|
|
|
2282
2286
|
]),
|
|
2283
2287
|
_: 1
|
|
2284
2288
|
}, 8, ["modelValue", "error", "label", "placeholder", "readonly"])
|
|
2285
|
-
])) :
|
|
2286
|
-
|
|
2287
|
-
d
|
|
2289
|
+
])) : M("", !0),
|
|
2290
|
+
J.value ? (C(), F("div", hl, [
|
|
2291
|
+
u(d, {
|
|
2288
2292
|
modelValue: t.fields.tls_verify_enabled,
|
|
2289
2293
|
"onUpdate:modelValue": s[24] || (s[24] = (_) => t.fields.tls_verify_enabled = _),
|
|
2290
2294
|
"data-testid": "gateway-service-tls-verify-checkbox",
|
|
@@ -2293,7 +2297,7 @@ const te = {
|
|
|
2293
2297
|
"label-attributes": { tooltipAttributes: { maxWidth: "400" } }
|
|
2294
2298
|
}, {
|
|
2295
2299
|
tooltip: v(() => [
|
|
2296
|
-
|
|
2300
|
+
u(o(H), {
|
|
2297
2301
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
2298
2302
|
scope: "global"
|
|
2299
2303
|
}, {
|
|
@@ -2306,24 +2310,24 @@ const te = {
|
|
|
2306
2310
|
_: 1
|
|
2307
2311
|
}, 8, ["modelValue", "description", "label"]),
|
|
2308
2312
|
t.fields.tls_verify_enabled ? (C(), F("div", wl, [
|
|
2309
|
-
|
|
2313
|
+
u(V, {
|
|
2310
2314
|
modelValue: t.fields.tls_verify_value,
|
|
2311
2315
|
"onUpdate:modelValue": s[25] || (s[25] = (_) => t.fields.tls_verify_value = _),
|
|
2312
2316
|
"data-testid": "gateway-service-tls-verify-true-option",
|
|
2313
2317
|
label: o(r)("gateway_services.form.fields.tls_verify_option.true.label"),
|
|
2314
2318
|
"selected-value": !0
|
|
2315
2319
|
}, null, 8, ["modelValue", "label"])
|
|
2316
|
-
])) :
|
|
2320
|
+
])) : M("", !0),
|
|
2317
2321
|
t.fields.tls_verify_enabled ? (C(), F("div", kl, [
|
|
2318
|
-
|
|
2322
|
+
u(V, {
|
|
2319
2323
|
modelValue: t.fields.tls_verify_value,
|
|
2320
2324
|
"onUpdate:modelValue": s[26] || (s[26] = (_) => t.fields.tls_verify_value = _),
|
|
2321
2325
|
"data-testid": "gateway-service-tls-verify-false-option",
|
|
2322
2326
|
label: o(r)("gateway_services.form.fields.tls_verify_option.false.label"),
|
|
2323
2327
|
"selected-value": !1
|
|
2324
2328
|
}, null, 8, ["modelValue", "label"])
|
|
2325
|
-
])) :
|
|
2326
|
-
])) :
|
|
2329
|
+
])) : M("", !0)
|
|
2330
|
+
])) : M("", !0)
|
|
2327
2331
|
]))
|
|
2328
2332
|
]),
|
|
2329
2333
|
_: 1
|
|
@@ -2334,13 +2338,13 @@ const te = {
|
|
|
2334
2338
|
]),
|
|
2335
2339
|
_: 1
|
|
2336
2340
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
2337
|
-
|
|
2341
|
+
u(o(Be), {
|
|
2338
2342
|
description: o(r)("gateway_services.form.sections.general.description"),
|
|
2339
2343
|
"hide-info-header": n.hideSectionsInfo,
|
|
2340
2344
|
title: o(r)("gateway_services.form.sections.general.title")
|
|
2341
2345
|
}, {
|
|
2342
2346
|
default: v(() => [
|
|
2343
|
-
|
|
2347
|
+
u(E, {
|
|
2344
2348
|
modelValue: t.fields.name,
|
|
2345
2349
|
"onUpdate:modelValue": s[28] || (s[28] = (_) => t.fields.name = _),
|
|
2346
2350
|
modelModifiers: { trim: !0 },
|
|
@@ -2357,16 +2361,16 @@ const te = {
|
|
|
2357
2361
|
placeholder: o(r)("gateway_services.form.fields.name.placeholder"),
|
|
2358
2362
|
readonly: t.isReadonly,
|
|
2359
2363
|
type: "text",
|
|
2360
|
-
onInput:
|
|
2364
|
+
onInput: K
|
|
2361
2365
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
|
|
2362
|
-
|
|
2366
|
+
u(we, {
|
|
2363
2367
|
"data-testid": "tags-collapse",
|
|
2364
2368
|
"trigger-alignment": "leading",
|
|
2365
2369
|
"trigger-label": o(r)("gateway_services.form.fields.tags.collapse")
|
|
2366
2370
|
}, {
|
|
2367
2371
|
default: v(() => [
|
|
2368
2372
|
S("div", Vl, [
|
|
2369
|
-
|
|
2373
|
+
u(E, {
|
|
2370
2374
|
modelValue: t.fields.tags,
|
|
2371
2375
|
"onUpdate:modelValue": s[29] || (s[29] = (_) => t.fields.tags = _),
|
|
2372
2376
|
modelModifiers: { trim: !0 },
|
|
@@ -2400,17 +2404,17 @@ const te = {
|
|
|
2400
2404
|
])
|
|
2401
2405
|
]),
|
|
2402
2406
|
_: 1
|
|
2403
|
-
})) :
|
|
2407
|
+
})) : M("", !0)
|
|
2404
2408
|
]),
|
|
2405
2409
|
_: 3
|
|
2406
2410
|
}, 8, ["can-submit", "config", "edit-id", "entity-type", "fetch-url", "form-fields", "is-readonly"])
|
|
2407
2411
|
]);
|
|
2408
2412
|
};
|
|
2409
2413
|
}
|
|
2410
|
-
}),
|
|
2414
|
+
}), Rl = /* @__PURE__ */ Ne(Sl, [["__scopeId", "data-v-a378ebc2"]]);
|
|
2411
2415
|
export {
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
+
Al as GatewayServiceConfigCard,
|
|
2417
|
+
Rl as GatewayServiceForm,
|
|
2418
|
+
Ul as GatewayServiceList,
|
|
2419
|
+
xl as LegacyGatewayServiceForm
|
|
2416
2420
|
};
|