@kong-ui-public/entities-gateway-services 3.11.40 → 3.12.1-pr.2294.6fb0e8d98.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 De, ref as R, computed as b, watch as Be, onBeforeMount as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { BookIcon as
|
|
1
|
+
import { defineComponent as De, ref as R, computed as b, watch as Be, onBeforeMount as ze, resolveComponent as L, createElementBlock as T, openBlock as E, createVNode as c, unref as o, createSlots as Se, withCtx as d, createTextVNode as K, toDisplayString as V, createElementVNode as S, withModifiers as xe, createBlock as Ee, Teleport as He, createCommentVNode as D, reactive as Ke, onMounted as Ze, Transition as Me, Fragment as Je, renderList as Qe, renderSlot as Xe } from "vue";
|
|
2
|
+
import { useRouter as Ge } from "vue-router";
|
|
3
|
+
import { BookIcon as Ye, AddIcon as et, ServicesIcon as tt } from "@kong/icons";
|
|
4
4
|
import { createI18n as ot, i18nTComponent as rt } from "@kong-ui-public/i18n";
|
|
5
|
-
import { useAxios as
|
|
5
|
+
import { useAxios as Ne, useTableState as it, useFetcher as lt, useDeleteUrlBuilder as st, FetcherStatus as at, EntityBaseTable as nt, PermissionsWrapper as de, TableTags as ct, EntityFilter as dt, EntityEmptyState as ut, EntityToggleModal as ft, EntityDeleteModal as pt, EntityTypes as mt, useHelpers as Oe, ConfigurationSchemaType as vt, ConfigurationSchemaSection as ke, EntityBaseConfigCard as gt, SupportedEntityType as We, useErrors as yt, useValidators as _t, EntityBaseFormType as Le, useGatewayFeatureSupported as ht, EntityBaseForm as bt, EntityFormSection as qe } from "@kong-ui-public/entities-shared";
|
|
6
6
|
const wt = {
|
|
7
7
|
create: "New gateway service",
|
|
8
8
|
serverless_create: "Add a Service",
|
|
@@ -252,51 +252,51 @@ function Ft() {
|
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
254
|
function At() {
|
|
255
|
-
const { i18n: { t: s } } =
|
|
255
|
+
const { i18n: { t: s } } = ee.useI18n();
|
|
256
256
|
return {
|
|
257
|
-
validateHost: (
|
|
258
|
-
if (!
|
|
259
|
-
const
|
|
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(
|
|
257
|
+
validateHost: (v) => {
|
|
258
|
+
if (!v || v.trim() === "") return s("gateway_services.form.errors.host.empty");
|
|
259
|
+
const A = /^(?!:\/\/)([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?))*)(\.[a-zA-Z]{1,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(v) || A.test(v) ? "" : s("gateway_services.form.errors.host.invalid");
|
|
261
261
|
},
|
|
262
|
-
validateProtocol: (
|
|
263
|
-
if (l.value ===
|
|
262
|
+
validateProtocol: (v, A) => !v || v.trim() === "" ? s("gateway_services.form.errors.protocol.empty") : (v = v.slice(0, -1), A.find((l) => {
|
|
263
|
+
if (l.value === v) return l;
|
|
264
264
|
}) === void 0 ? s("gateway_services.form.errors.protocol.invalid") : ""),
|
|
265
|
-
validatePath: (
|
|
266
|
-
validatePort: (
|
|
267
|
-
if (
|
|
265
|
+
validatePath: (v) => !v || v === "" ? "" : v.startsWith("/") ? /[^A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]/.test(v) ? s("gateway_services.form.errors.path.invalid") : "" : s("gateway_services.form.errors.path.prefix"),
|
|
266
|
+
validatePort: (v) => {
|
|
267
|
+
if (v == null || v === "")
|
|
268
268
|
return "";
|
|
269
|
-
const
|
|
270
|
-
return isNaN(
|
|
269
|
+
const A = typeof v == "string" ? parseInt(v, 10) : v;
|
|
270
|
+
return isNaN(A) ? s("gateway_services.form.errors.port.type") : A < 0 || A > 65535 ? s("gateway_services.form.errors.port.invalid") : "";
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
|
-
const
|
|
274
|
+
const ee = {
|
|
275
275
|
useI18n: Pt,
|
|
276
276
|
usePortFromProtocol: Ft,
|
|
277
277
|
useUrlValidators: At
|
|
278
|
-
},
|
|
278
|
+
}, Ve = "/v2/control-planes/{controlPlaneId}/core-entities", Ce = "/{workspace}", ue = {
|
|
279
279
|
list: {
|
|
280
280
|
konnect: {
|
|
281
|
-
all: `${
|
|
281
|
+
all: `${Ve}/services`
|
|
282
282
|
},
|
|
283
283
|
kongManager: {
|
|
284
|
-
all: `${
|
|
284
|
+
all: `${Ce}/services`
|
|
285
285
|
}
|
|
286
286
|
},
|
|
287
287
|
form: {
|
|
288
288
|
konnect: {
|
|
289
|
-
create: `${ke}/services`,
|
|
290
|
-
validate: `${ke}/v1/schemas/json/service/validate`,
|
|
291
|
-
edit: `${ke}/services/{id}`
|
|
292
|
-
},
|
|
293
|
-
kongManager: {
|
|
294
289
|
create: `${Ve}/services`,
|
|
295
|
-
validate: `${Ve}/schemas/
|
|
290
|
+
validate: `${Ve}/v1/schemas/json/service/validate`,
|
|
296
291
|
edit: `${Ve}/services/{id}`
|
|
292
|
+
},
|
|
293
|
+
kongManager: {
|
|
294
|
+
create: `${Ce}/services`,
|
|
295
|
+
validate: `${Ce}/schemas/services/validate`,
|
|
296
|
+
edit: `${Ce}/services/{id}`
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
},
|
|
299
|
+
}, Tt = "#00abd2", Ut = "24px", $t = { class: "kong-ui-entities-gateway-services-list" }, Rt = { class: "button-row" }, xt = { class: "empty-state-icon-gateway" }, Mt = { key: 1 }, Bt = /* @__PURE__ */ De({
|
|
300
300
|
__name: "GatewayServiceList",
|
|
301
301
|
props: {
|
|
302
302
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -343,20 +343,12 @@ const Y = {
|
|
|
343
343
|
isServerless: {
|
|
344
344
|
type: Boolean,
|
|
345
345
|
default: !1
|
|
346
|
-
},
|
|
347
|
-
/**
|
|
348
|
-
* Enables the new empty state design, this prop can be removed when
|
|
349
|
-
* the khcp-14756-empty-states-m2 FF is removed.
|
|
350
|
-
*/
|
|
351
|
-
enableV2EmptyStates: {
|
|
352
|
-
type: Boolean,
|
|
353
|
-
default: !1
|
|
354
346
|
}
|
|
355
347
|
},
|
|
356
348
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success"],
|
|
357
349
|
setup(s, { emit: G }) {
|
|
358
|
-
var
|
|
359
|
-
const m = G, n = s, { i18n: { t: a, formatUnixTimeStamp:
|
|
350
|
+
var we;
|
|
351
|
+
const m = G, n = s, { i18n: { t: a, formatUnixTimeStamp: v } } = ee.useI18n(), A = Ge(), { axiosInstance: N } = Ne((we = n.config) == null ? void 0 : we.axiosRequestConfig), { hasRecords: l, handleStateChange: B } = it(() => z.value), I = b(() => l.value && n.config.app === "konnect"), Ie = b(() => n.config.app !== "kongManager" || !!n.config.disableSorting), le = {
|
|
360
352
|
// the Name column is non-hidable
|
|
361
353
|
name: { label: a("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
362
354
|
...n.config.showControlPlaneColumn ? { control_plane: { label: a("gateway_services.list.table_headers.control_plane") } } : {},
|
|
@@ -368,71 +360,71 @@ const Y = {
|
|
|
368
360
|
tags: { label: a("gateway_services.list.table_headers.tags"), sortable: !1 },
|
|
369
361
|
updated_at: { label: a("gateway_services.list.table_headers.updated_at"), sortable: !0 },
|
|
370
362
|
created_at: { label: a("gateway_services.list.table_headers.created_at"), sortable: !0 }
|
|
371
|
-
},
|
|
363
|
+
}, fe = {
|
|
372
364
|
columnVisibility: {
|
|
373
365
|
created_at: !1
|
|
374
366
|
}
|
|
375
|
-
},
|
|
376
|
-
var
|
|
367
|
+
}, pe = le, te = b(() => {
|
|
368
|
+
var g, y;
|
|
377
369
|
let f = `${n.config.apiBaseUrl}${ue.list[n.config.app].all}`;
|
|
378
|
-
return n.config.app === "konnect" ? f = f.replace(/{controlPlaneId}/gi, ((
|
|
379
|
-
}),
|
|
370
|
+
return n.config.app === "konnect" ? f = f.replace(/{controlPlaneId}/gi, ((g = n.config) == null ? void 0 : g.controlPlaneId) || "") : n.config.app === "kongManager" && (f = f.replace(/\/{workspace}/gi, (y = n.config) != null && y.workspace ? `/${n.config.workspace}` : "")), f;
|
|
371
|
+
}), Pe = b(() => n.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${te.value}`) : new URL(te.value)), z = R(""), Z = b(() => {
|
|
380
372
|
const f = n.config.app === "konnect" || n.config.isExactMatch;
|
|
381
373
|
if (f)
|
|
382
374
|
return {
|
|
383
375
|
isExactMatch: f,
|
|
384
376
|
placeholder: a(`search.placeholder.${n.config.app}`)
|
|
385
377
|
};
|
|
386
|
-
const { name:
|
|
378
|
+
const { name: g, enabled: y, protocol: P, host: W, port: M, path: j } = le;
|
|
387
379
|
return {
|
|
388
380
|
isExactMatch: f,
|
|
389
|
-
fields: { name:
|
|
381
|
+
fields: { name: g, enabled: y, protocol: P, host: W, port: M, path: j },
|
|
390
382
|
schema: n.config.filterSchema
|
|
391
383
|
};
|
|
392
384
|
}), {
|
|
393
|
-
fetcher:
|
|
394
|
-
fetcherState:
|
|
395
|
-
fetcherCacheKey:
|
|
396
|
-
} = lt(b(() => ({ ...n.config, cacheIdentifier: n.cacheIdentifier })),
|
|
397
|
-
|
|
398
|
-
},
|
|
399
|
-
|
|
400
|
-
},
|
|
385
|
+
fetcher: Fe,
|
|
386
|
+
fetcherState: J,
|
|
387
|
+
fetcherCacheKey: C
|
|
388
|
+
} = lt(b(() => ({ ...n.config, cacheIdentifier: n.cacheIdentifier })), te), se = () => {
|
|
389
|
+
z.value = "";
|
|
390
|
+
}, ae = () => {
|
|
391
|
+
C.value++;
|
|
392
|
+
}, oe = R(null), e = b(() => ({
|
|
401
393
|
ctaPath: n.config.createRoute,
|
|
402
|
-
ctaText:
|
|
394
|
+
ctaText: ce.value ? n.isServerless ? a("actions.serverless_create") : a("actions.create") : void 0,
|
|
403
395
|
message: `${a("gateway_services.list.empty_state.description")}${n.config.additionMessageForEmptyState ? ` ${n.config.additionMessageForEmptyState}` : ""}`,
|
|
404
|
-
title:
|
|
405
|
-
})),
|
|
396
|
+
title: ce.value ? n.isServerless ? a("gateway_services.list.empty_state.serverless_title") : a("gateway_services.list.empty_state.title") : a("gateway_services.title")
|
|
397
|
+
})), w = R(!1), x = R(null), re = b(() => {
|
|
406
398
|
const f = {
|
|
407
399
|
action: "disable",
|
|
408
400
|
id: "",
|
|
409
401
|
name: ""
|
|
410
402
|
};
|
|
411
|
-
if (
|
|
412
|
-
const { enabled:
|
|
413
|
-
f.action =
|
|
403
|
+
if (x.value) {
|
|
404
|
+
const { enabled: g, id: y, name: P } = x.value;
|
|
405
|
+
f.action = g ? "disable" : "enable", f.id = y, f.name = P || y;
|
|
414
406
|
}
|
|
415
407
|
return f;
|
|
416
|
-
}),
|
|
417
|
-
|
|
418
|
-
},
|
|
419
|
-
|
|
420
|
-
},
|
|
421
|
-
var
|
|
422
|
-
if (!await ((
|
|
408
|
+
}), me = (f) => {
|
|
409
|
+
w.value = !0, x.value = f;
|
|
410
|
+
}, ve = () => {
|
|
411
|
+
w.value = !1, x.value = null;
|
|
412
|
+
}, Q = async () => {
|
|
413
|
+
var P, W;
|
|
414
|
+
if (!await ((P = n.canEdit) == null ? void 0 : P.call(n, x.value)) || !x.value)
|
|
423
415
|
return;
|
|
424
|
-
const
|
|
416
|
+
const g = `${Pe.value.href}/${x.value.id}`, y = !x.value.enabled;
|
|
425
417
|
try {
|
|
426
|
-
const { data:
|
|
427
|
-
m("toggle:success",
|
|
428
|
-
} catch (
|
|
429
|
-
m("error",
|
|
418
|
+
const { data: M } = ((W = n.config) == null ? void 0 : W.app) === "konnect" ? await N.put(g, { ...x.value, enabled: y }) : await N.patch(g, { ...x.value, enabled: y });
|
|
419
|
+
m("toggle:success", M), x.value.enabled = y;
|
|
420
|
+
} catch (M) {
|
|
421
|
+
m("error", M);
|
|
430
422
|
}
|
|
431
|
-
},
|
|
432
|
-
n.config.getControlPlaneRoute &&
|
|
433
|
-
},
|
|
423
|
+
}, ge = (f) => {
|
|
424
|
+
n.config.getControlPlaneRoute && A.push(n.config.getControlPlaneRoute(f));
|
|
425
|
+
}, ye = async (f, g) => {
|
|
434
426
|
const y = f.id;
|
|
435
|
-
if (!await
|
|
427
|
+
if (!await g(y)) {
|
|
436
428
|
m("copy:error", {
|
|
437
429
|
entity: f,
|
|
438
430
|
field: "id",
|
|
@@ -445,9 +437,9 @@ const Y = {
|
|
|
445
437
|
field: "id",
|
|
446
438
|
message: a("copy.success", { val: y })
|
|
447
439
|
});
|
|
448
|
-
},
|
|
440
|
+
}, _e = async (f, g) => {
|
|
449
441
|
const y = JSON.stringify(f);
|
|
450
|
-
if (!await
|
|
442
|
+
if (!await g(y)) {
|
|
451
443
|
m("copy:error", {
|
|
452
444
|
entity: f,
|
|
453
445
|
message: a("errors.copy")
|
|
@@ -458,95 +450,95 @@ const Y = {
|
|
|
458
450
|
entity: f,
|
|
459
451
|
message: a("copy.success_brief")
|
|
460
452
|
});
|
|
461
|
-
},
|
|
453
|
+
}, he = async (f) => {
|
|
462
454
|
var y;
|
|
463
|
-
await ((y = n.canRetrieve) == null ? void 0 : y.call(n, f)) &&
|
|
464
|
-
},
|
|
455
|
+
await ((y = n.canRetrieve) == null ? void 0 : y.call(n, f)) && A.push(n.config.getViewRoute(f.id));
|
|
456
|
+
}, be = (f) => ({
|
|
465
457
|
label: a("actions.view"),
|
|
466
458
|
to: n.config.getViewRoute(f)
|
|
467
|
-
}),
|
|
459
|
+
}), Ae = (f) => ({
|
|
468
460
|
label: a("actions.edit"),
|
|
469
461
|
to: n.config.getEditRoute(f)
|
|
470
|
-
}),
|
|
471
|
-
|
|
472
|
-
},
|
|
473
|
-
|
|
474
|
-
},
|
|
475
|
-
var f,
|
|
476
|
-
if ((f =
|
|
477
|
-
|
|
462
|
+
}), $ = R(void 0), H = R(!1), O = R(!1), X = R(""), Te = st(n.config, te.value), Ue = (f) => {
|
|
463
|
+
$.value = f, H.value = !0, X.value = "";
|
|
464
|
+
}, ne = () => {
|
|
465
|
+
H.value = !1, $.value = void 0;
|
|
466
|
+
}, $e = async () => {
|
|
467
|
+
var f, g, y;
|
|
468
|
+
if ((f = $.value) != null && f.id) {
|
|
469
|
+
O.value = !0;
|
|
478
470
|
try {
|
|
479
|
-
await N.delete(Te(
|
|
480
|
-
} catch (
|
|
481
|
-
|
|
471
|
+
await N.delete(Te($.value.id)), m("delete:success", $.value), ne(), C.value++;
|
|
472
|
+
} catch (P) {
|
|
473
|
+
X.value = ((y = (g = P.response) == null ? void 0 : g.data) == null ? void 0 : y.message) || P.message || a("errors.delete"), m("error", P);
|
|
482
474
|
} finally {
|
|
483
|
-
|
|
475
|
+
O.value = !1;
|
|
484
476
|
}
|
|
485
477
|
}
|
|
486
478
|
}, Re = () => {
|
|
487
|
-
|
|
479
|
+
A.push(n.config.createRoute);
|
|
488
480
|
};
|
|
489
|
-
Be(
|
|
490
|
-
var
|
|
481
|
+
Be(J, (f) => {
|
|
482
|
+
var g, y, P;
|
|
491
483
|
if (f.status === at.Error) {
|
|
492
|
-
|
|
484
|
+
oe.value = {
|
|
493
485
|
title: a("errors.general")
|
|
494
|
-
}, (
|
|
486
|
+
}, (P = (y = (g = f.error) == null ? void 0 : g.response) == null ? void 0 : y.data) != null && P.message && (oe.value.message = f.error.response.data.message), m("error", f.error);
|
|
495
487
|
return;
|
|
496
488
|
}
|
|
497
|
-
|
|
489
|
+
oe.value = null;
|
|
498
490
|
});
|
|
499
|
-
const
|
|
500
|
-
return
|
|
501
|
-
|
|
502
|
-
}), (f,
|
|
503
|
-
const y = L("KButton"),
|
|
504
|
-
return
|
|
491
|
+
const ce = R(!1);
|
|
492
|
+
return ze(async () => {
|
|
493
|
+
ce.value = await n.canCreate();
|
|
494
|
+
}), (f, g) => {
|
|
495
|
+
const y = L("KButton"), P = L("KBadge"), W = L("KInputSwitch"), M = L("KDropdownItem"), j = L("KClipboardProvider");
|
|
496
|
+
return E(), T("div", $t, [
|
|
505
497
|
c(o(nt), {
|
|
506
498
|
"cache-identifier": s.cacheIdentifier,
|
|
507
|
-
"default-table-preferences":
|
|
508
|
-
"disable-sorting":
|
|
509
|
-
"empty-state-options":
|
|
499
|
+
"default-table-preferences": fe,
|
|
500
|
+
"disable-sorting": Ie.value,
|
|
501
|
+
"empty-state-options": e.value,
|
|
510
502
|
"enable-entity-actions": "",
|
|
511
|
-
"error-message":
|
|
512
|
-
fetcher: o(
|
|
513
|
-
"fetcher-cache-key": o(
|
|
503
|
+
"error-message": oe.value,
|
|
504
|
+
fetcher: o(Fe),
|
|
505
|
+
"fetcher-cache-key": o(C),
|
|
514
506
|
"pagination-type": "offset",
|
|
515
507
|
"preferences-storage-key": "kong-ui-entities-gateway-services-list",
|
|
516
|
-
query:
|
|
517
|
-
"table-headers": o(
|
|
518
|
-
onClearSearchInput:
|
|
519
|
-
"onClick:row":
|
|
520
|
-
onSort:
|
|
521
|
-
onState: o(
|
|
522
|
-
},
|
|
508
|
+
query: z.value,
|
|
509
|
+
"table-headers": o(pe),
|
|
510
|
+
onClearSearchInput: se,
|
|
511
|
+
"onClick:row": g[4] || (g[4] = (p) => he(p)),
|
|
512
|
+
onSort: ae,
|
|
513
|
+
onState: o(B)
|
|
514
|
+
}, Se({
|
|
523
515
|
"toolbar-filter": d(() => [
|
|
524
516
|
c(o(dt), {
|
|
525
|
-
modelValue:
|
|
526
|
-
"onUpdate:modelValue":
|
|
527
|
-
config:
|
|
517
|
+
modelValue: z.value,
|
|
518
|
+
"onUpdate:modelValue": g[0] || (g[0] = (p) => z.value = p),
|
|
519
|
+
config: Z.value
|
|
528
520
|
}, null, 8, ["modelValue", "config"])
|
|
529
521
|
]),
|
|
530
522
|
"toolbar-button": d(() => [
|
|
531
|
-
(
|
|
523
|
+
(E(), Ee(He, {
|
|
532
524
|
disabled: !s.useActionOutside,
|
|
533
525
|
to: "#kong-ui-app-page-header-action-button"
|
|
534
526
|
}, [
|
|
535
|
-
|
|
536
|
-
|
|
527
|
+
S("div", Rt, [
|
|
528
|
+
I.value ? (E(), Ee(y, {
|
|
537
529
|
key: 0,
|
|
538
530
|
appearance: "secondary",
|
|
539
531
|
class: "open-learning-hub",
|
|
540
532
|
"data-testid": "gateway-services-learn-more-button",
|
|
541
533
|
icon: "",
|
|
542
|
-
onClick:
|
|
534
|
+
onClick: g[1] || (g[1] = (p) => f.$emit("click:learn-more"))
|
|
543
535
|
}, {
|
|
544
536
|
default: d(() => [
|
|
545
|
-
c(o(
|
|
537
|
+
c(o(Ye), { decorative: "" })
|
|
546
538
|
]),
|
|
547
539
|
_: 1
|
|
548
540
|
})) : D("", !0),
|
|
549
|
-
c(o(
|
|
541
|
+
c(o(de), {
|
|
550
542
|
"auth-function": () => s.canCreate()
|
|
551
543
|
}, {
|
|
552
544
|
default: d(() => [
|
|
@@ -558,7 +550,7 @@ const Y = {
|
|
|
558
550
|
}, {
|
|
559
551
|
default: d(() => [
|
|
560
552
|
c(o(et)),
|
|
561
|
-
K(" " +
|
|
553
|
+
K(" " + V(o(a)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
|
|
562
554
|
]),
|
|
563
555
|
_: 1
|
|
564
556
|
}, 8, ["size", "to"])
|
|
@@ -569,40 +561,40 @@ const Y = {
|
|
|
569
561
|
], 8, ["disabled"]))
|
|
570
562
|
]),
|
|
571
563
|
name: d(({ rowValue: p }) => [
|
|
572
|
-
|
|
564
|
+
S("b", null, V(p ?? "-"), 1)
|
|
573
565
|
]),
|
|
574
566
|
control_plane: d(({ row: p }) => {
|
|
575
|
-
var
|
|
567
|
+
var U;
|
|
576
568
|
return [
|
|
577
|
-
(
|
|
569
|
+
(U = p.x_meta) != null && U.cluster_id ? (E(), Ee(P, {
|
|
578
570
|
key: 0,
|
|
579
571
|
tooltip: p.x_meta.cluster_id,
|
|
580
572
|
"truncation-tooltip": "",
|
|
581
|
-
onClick: xe((
|
|
573
|
+
onClick: xe((t) => ge(p.x_meta.cluster_id), ["stop"])
|
|
582
574
|
}, {
|
|
583
575
|
default: d(() => [
|
|
584
|
-
K(
|
|
576
|
+
K(V(p.x_meta.cluster_id), 1)
|
|
585
577
|
]),
|
|
586
578
|
_: 2
|
|
587
|
-
}, 1032, ["tooltip", "onClick"])) : (
|
|
579
|
+
}, 1032, ["tooltip", "onClick"])) : (E(), T("b", Mt, "-"))
|
|
588
580
|
];
|
|
589
581
|
}),
|
|
590
582
|
enabled: d(({ row: p }) => [
|
|
591
|
-
c(o(
|
|
583
|
+
c(o(de), {
|
|
592
584
|
"auth-function": () => s.canEdit(p),
|
|
593
585
|
"force-show": ""
|
|
594
586
|
}, {
|
|
595
|
-
default: d(({ isAllowed:
|
|
596
|
-
|
|
597
|
-
onClick:
|
|
587
|
+
default: d(({ isAllowed: U }) => [
|
|
588
|
+
S("div", {
|
|
589
|
+
onClick: g[3] || (g[3] = xe(() => {
|
|
598
590
|
}, ["stop"]))
|
|
599
591
|
}, [
|
|
600
|
-
c(
|
|
592
|
+
c(W, {
|
|
601
593
|
modelValue: p.enabled,
|
|
602
|
-
"onUpdate:modelValue": (
|
|
594
|
+
"onUpdate:modelValue": (t) => p.enabled = t,
|
|
603
595
|
"data-testid": `row-${p.id}-toggle-input`,
|
|
604
|
-
disabled: !
|
|
605
|
-
onClick: xe((
|
|
596
|
+
disabled: !U,
|
|
597
|
+
onClick: xe((t) => me(p), ["prevent"])
|
|
606
598
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "disabled", "onClick"])
|
|
607
599
|
])
|
|
608
600
|
]),
|
|
@@ -613,75 +605,75 @@ const Y = {
|
|
|
613
605
|
c(o(ct), { tags: p }, null, 8, ["tags"])
|
|
614
606
|
]),
|
|
615
607
|
created_at: d(({ rowValue: p }) => [
|
|
616
|
-
K(
|
|
608
|
+
K(V(o(v)(p)), 1)
|
|
617
609
|
]),
|
|
618
|
-
updated_at: d(({ row: p, rowValue:
|
|
619
|
-
K(
|
|
610
|
+
updated_at: d(({ row: p, rowValue: U }) => [
|
|
611
|
+
K(V(o(v)(U ?? p.created_at)), 1)
|
|
620
612
|
]),
|
|
621
613
|
actions: d(({ row: p }) => [
|
|
622
|
-
c(
|
|
623
|
-
default: d(({ copyToClipboard:
|
|
624
|
-
c(
|
|
614
|
+
c(j, null, {
|
|
615
|
+
default: d(({ copyToClipboard: U }) => [
|
|
616
|
+
c(M, {
|
|
625
617
|
"data-testid": "action-entity-copy-id",
|
|
626
|
-
onClick: (
|
|
618
|
+
onClick: (t) => ye(p, U)
|
|
627
619
|
}, {
|
|
628
620
|
default: d(() => [
|
|
629
|
-
K(
|
|
621
|
+
K(V(o(a)("actions.copy_id")), 1)
|
|
630
622
|
]),
|
|
631
623
|
_: 2
|
|
632
624
|
}, 1032, ["onClick"])
|
|
633
625
|
]),
|
|
634
626
|
_: 2
|
|
635
627
|
}, 1024),
|
|
636
|
-
c(
|
|
637
|
-
default: d(({ copyToClipboard:
|
|
638
|
-
c(
|
|
628
|
+
c(j, null, {
|
|
629
|
+
default: d(({ copyToClipboard: U }) => [
|
|
630
|
+
c(M, {
|
|
639
631
|
"data-testid": "action-entity-copy-json",
|
|
640
|
-
onClick: (
|
|
632
|
+
onClick: (t) => _e(p, U)
|
|
641
633
|
}, {
|
|
642
634
|
default: d(() => [
|
|
643
|
-
K(
|
|
635
|
+
K(V(o(a)("actions.copy_json")), 1)
|
|
644
636
|
]),
|
|
645
637
|
_: 2
|
|
646
638
|
}, 1032, ["onClick"])
|
|
647
639
|
]),
|
|
648
640
|
_: 2
|
|
649
641
|
}, 1024),
|
|
650
|
-
c(o(
|
|
642
|
+
c(o(de), {
|
|
651
643
|
"auth-function": () => s.canRetrieve(p)
|
|
652
644
|
}, {
|
|
653
645
|
default: d(() => [
|
|
654
|
-
c(
|
|
646
|
+
c(M, {
|
|
655
647
|
"data-testid": "action-entity-view",
|
|
656
648
|
"has-divider": "",
|
|
657
|
-
item:
|
|
649
|
+
item: be(p.id)
|
|
658
650
|
}, null, 8, ["item"])
|
|
659
651
|
]),
|
|
660
652
|
_: 2
|
|
661
653
|
}, 1032, ["auth-function"]),
|
|
662
|
-
c(o(
|
|
654
|
+
c(o(de), {
|
|
663
655
|
"auth-function": () => s.canEdit(p)
|
|
664
656
|
}, {
|
|
665
657
|
default: d(() => [
|
|
666
|
-
c(
|
|
658
|
+
c(M, {
|
|
667
659
|
"data-testid": "action-entity-edit",
|
|
668
|
-
item:
|
|
660
|
+
item: Ae(p.id)
|
|
669
661
|
}, null, 8, ["item"])
|
|
670
662
|
]),
|
|
671
663
|
_: 2
|
|
672
664
|
}, 1032, ["auth-function"]),
|
|
673
|
-
c(o(
|
|
665
|
+
c(o(de), {
|
|
674
666
|
"auth-function": () => s.canDelete(p)
|
|
675
667
|
}, {
|
|
676
668
|
default: d(() => [
|
|
677
|
-
c(
|
|
669
|
+
c(M, {
|
|
678
670
|
danger: "",
|
|
679
671
|
"data-testid": "action-entity-delete",
|
|
680
672
|
"has-divider": "",
|
|
681
|
-
onClick: (
|
|
673
|
+
onClick: (U) => Ue(p)
|
|
682
674
|
}, {
|
|
683
675
|
default: d(() => [
|
|
684
|
-
K(
|
|
676
|
+
K(V(o(a)("actions.delete.menu_label")), 1)
|
|
685
677
|
]),
|
|
686
678
|
_: 2
|
|
687
679
|
}, 1032, ["onClick"])
|
|
@@ -691,30 +683,7 @@ const Y = {
|
|
|
691
683
|
]),
|
|
692
684
|
_: 2
|
|
693
685
|
}, [
|
|
694
|
-
!
|
|
695
|
-
name: "outside-actions",
|
|
696
|
-
fn: d(() => [
|
|
697
|
-
(V(), de(Ke, {
|
|
698
|
-
disabled: !s.useActionOutside,
|
|
699
|
-
to: "#kong-ui-app-page-header-action-button"
|
|
700
|
-
}, [
|
|
701
|
-
c(y, {
|
|
702
|
-
appearance: "secondary",
|
|
703
|
-
class: "open-learning-hub",
|
|
704
|
-
"data-testid": "gateway-services-more-button",
|
|
705
|
-
icon: "",
|
|
706
|
-
onClick: v[2] || (v[2] = (p) => f.$emit("click:learn-more"))
|
|
707
|
-
}, {
|
|
708
|
-
default: d(() => [
|
|
709
|
-
c(o(qe), { decorative: "" })
|
|
710
|
-
]),
|
|
711
|
-
_: 1
|
|
712
|
-
})
|
|
713
|
-
], 8, ["disabled"]))
|
|
714
|
-
]),
|
|
715
|
-
key: "0"
|
|
716
|
-
} : void 0,
|
|
717
|
-
!B.value && s.enableV2EmptyStates && s.config.app === "konnect" ? {
|
|
686
|
+
!z.value && s.config.app === "konnect" ? {
|
|
718
687
|
name: "empty-state",
|
|
719
688
|
fn: d(() => {
|
|
720
689
|
var p;
|
|
@@ -728,13 +697,13 @@ const Y = {
|
|
|
728
697
|
"learn-more": s.config.app === "konnect",
|
|
729
698
|
title: o(a)("gateway_services.empty_state_v2.title"),
|
|
730
699
|
"onClick:create": Re,
|
|
731
|
-
"onClick:learnMore":
|
|
732
|
-
},
|
|
700
|
+
"onClick:learnMore": g[2] || (g[2] = (U) => f.$emit("click:learn-more"))
|
|
701
|
+
}, Se({
|
|
733
702
|
image: d(() => [
|
|
734
|
-
|
|
703
|
+
S("div", xt, [
|
|
735
704
|
c(o(tt), {
|
|
736
|
-
color: o(
|
|
737
|
-
size: o(
|
|
705
|
+
color: o(Tt),
|
|
706
|
+
size: o(Ut)
|
|
738
707
|
}, null, 8, ["color", "size"])
|
|
739
708
|
])
|
|
740
709
|
]),
|
|
@@ -743,46 +712,46 @@ const Y = {
|
|
|
743
712
|
(p = s.config) != null && p.isControlPlaneGroup ? {
|
|
744
713
|
name: "message",
|
|
745
714
|
fn: d(() => [
|
|
746
|
-
K(
|
|
715
|
+
K(V(o(a)("gateway_services.empty_state_v2.group")), 1)
|
|
747
716
|
]),
|
|
748
717
|
key: "0"
|
|
749
718
|
} : void 0
|
|
750
719
|
]), 1032, ["action-button-text", "can-create", "description", "learn-more", "title"])
|
|
751
720
|
];
|
|
752
721
|
}),
|
|
753
|
-
key: "
|
|
722
|
+
key: "0"
|
|
754
723
|
} : void 0
|
|
755
724
|
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
|
|
756
725
|
c(o(ft), {
|
|
757
|
-
action:
|
|
758
|
-
"entity-id":
|
|
759
|
-
"entity-name":
|
|
726
|
+
action: re.value.action,
|
|
727
|
+
"entity-id": re.value.id,
|
|
728
|
+
"entity-name": re.value.name,
|
|
760
729
|
"entity-type": o(a)("glossary.gateway_services"),
|
|
761
|
-
"on-confirm":
|
|
762
|
-
visible:
|
|
763
|
-
onCancel:
|
|
764
|
-
onProceed:
|
|
730
|
+
"on-confirm": Q,
|
|
731
|
+
visible: w.value,
|
|
732
|
+
onCancel: ve,
|
|
733
|
+
onProceed: ve
|
|
765
734
|
}, null, 8, ["action", "entity-id", "entity-name", "entity-type", "visible"]),
|
|
766
735
|
c(o(pt), {
|
|
767
|
-
"action-pending":
|
|
736
|
+
"action-pending": O.value,
|
|
768
737
|
description: o(a)("actions.delete.description"),
|
|
769
|
-
"entity-name":
|
|
738
|
+
"entity-name": $.value && ($.value.name || $.value.id),
|
|
770
739
|
"entity-type": o(mt).GatewayService,
|
|
771
|
-
error:
|
|
740
|
+
error: X.value,
|
|
772
741
|
title: o(a)("actions.delete.title"),
|
|
773
|
-
visible:
|
|
774
|
-
onCancel:
|
|
775
|
-
onProceed:
|
|
742
|
+
visible: H.value,
|
|
743
|
+
onCancel: ne,
|
|
744
|
+
onProceed: $e
|
|
776
745
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
777
746
|
]);
|
|
778
747
|
};
|
|
779
748
|
}
|
|
780
|
-
}),
|
|
749
|
+
}), je = (s, G) => {
|
|
781
750
|
const m = s.__vccOpts || s;
|
|
782
751
|
for (const [n, a] of G)
|
|
783
752
|
m[n] = a;
|
|
784
753
|
return m;
|
|
785
|
-
}, mo = /* @__PURE__ */
|
|
754
|
+
}, mo = /* @__PURE__ */ je(Bt, [["__scopeId", "data-v-5f172c04"]]), Dt = { class: "kong-ui-gateway-service-entity-config-card" }, vo = /* @__PURE__ */ De({
|
|
786
755
|
__name: "GatewayServiceConfigCard",
|
|
787
756
|
props: {
|
|
788
757
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -809,7 +778,7 @@ const Y = {
|
|
|
809
778
|
},
|
|
810
779
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
811
780
|
setup(s) {
|
|
812
|
-
const G = s, { i18n: { t: m }, i18nT: n } =
|
|
781
|
+
const G = s, { i18n: { t: m }, i18nT: n } = ee.useI18n(), a = b(() => ue.form[G.config.app].edit), { getPropValue: v } = Oe(), A = (l, B) => v(l, B) === !0 ? m("gateway_services.form.fields.tls_verify_option.true.display") : m("gateway_services.form.fields.tls_verify_option.false.display"), N = R({
|
|
813
782
|
id: {},
|
|
814
783
|
name: {
|
|
815
784
|
tooltip: m("gateway_services.form.fields.name.tooltip")
|
|
@@ -818,19 +787,19 @@ const Y = {
|
|
|
818
787
|
updated_at: {},
|
|
819
788
|
created_at: {},
|
|
820
789
|
protocol: {
|
|
821
|
-
section:
|
|
790
|
+
section: ke.Basic,
|
|
822
791
|
tooltip: m("gateway_services.form.fields.protocol.tooltip")
|
|
823
792
|
},
|
|
824
793
|
host: {
|
|
825
|
-
section:
|
|
794
|
+
section: ke.Basic,
|
|
826
795
|
tooltip: m("gateway_services.form.fields.host.tooltip")
|
|
827
796
|
},
|
|
828
797
|
path: {
|
|
829
|
-
section:
|
|
798
|
+
section: ke.Basic,
|
|
830
799
|
tooltip: m("gateway_services.form.fields.path.tooltip")
|
|
831
800
|
},
|
|
832
801
|
port: {
|
|
833
|
-
section:
|
|
802
|
+
section: ke.Basic,
|
|
834
803
|
tooltip: m("gateway_services.form.fields.port.tooltip")
|
|
835
804
|
},
|
|
836
805
|
tags: {
|
|
@@ -869,17 +838,17 @@ const Y = {
|
|
|
869
838
|
hidden: !0
|
|
870
839
|
}
|
|
871
840
|
});
|
|
872
|
-
return (l,
|
|
841
|
+
return (l, B) => (E(), T("div", Dt, [
|
|
873
842
|
c(o(gt), {
|
|
874
843
|
config: s.config,
|
|
875
844
|
"config-card-doc": s.configCardDoc,
|
|
876
845
|
"config-schema": N.value,
|
|
877
|
-
"entity-type": o(
|
|
846
|
+
"entity-type": o(We).GatewayService,
|
|
878
847
|
"fetch-url": a.value,
|
|
879
848
|
"hide-title": s.hideTitle,
|
|
880
|
-
"onFetch:error":
|
|
881
|
-
"onFetch:success":
|
|
882
|
-
onLoading:
|
|
849
|
+
"onFetch:error": B[0] || (B[0] = (I) => l.$emit("fetch:error", I)),
|
|
850
|
+
"onFetch:success": B[1] || (B[1] = (I) => l.$emit("fetch:success", I)),
|
|
851
|
+
onLoading: B[2] || (B[2] = (I) => l.$emit("loading", I))
|
|
883
852
|
}, {
|
|
884
853
|
"enabled-label-tooltip": d(() => [
|
|
885
854
|
c(o(n), {
|
|
@@ -887,10 +856,10 @@ const Y = {
|
|
|
887
856
|
scope: "global"
|
|
888
857
|
}, {
|
|
889
858
|
false: d(() => [
|
|
890
|
-
|
|
859
|
+
S("code", null, V(o(m)("gateway_services.form.fields.enabled.false")), 1)
|
|
891
860
|
]),
|
|
892
861
|
true: d(() => [
|
|
893
|
-
|
|
862
|
+
S("code", null, V(o(m)("gateway_services.form.fields.enabled.true")), 1)
|
|
894
863
|
]),
|
|
895
864
|
_: 1
|
|
896
865
|
})
|
|
@@ -901,10 +870,10 @@ const Y = {
|
|
|
901
870
|
scope: "global"
|
|
902
871
|
}, {
|
|
903
872
|
code1: d(() => [
|
|
904
|
-
|
|
873
|
+
S("code", null, V(o(m)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
905
874
|
]),
|
|
906
875
|
code2: d(() => [
|
|
907
|
-
|
|
876
|
+
S("code", null, V(o(m)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
908
877
|
]),
|
|
909
878
|
_: 1
|
|
910
879
|
})
|
|
@@ -915,16 +884,16 @@ const Y = {
|
|
|
915
884
|
scope: "global"
|
|
916
885
|
}, {
|
|
917
886
|
code1: d(() => [
|
|
918
|
-
|
|
887
|
+
S("code", null, V(o(m)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
919
888
|
]),
|
|
920
889
|
_: 1
|
|
921
890
|
})
|
|
922
891
|
]),
|
|
923
|
-
tls_verify: d((
|
|
924
|
-
K(
|
|
892
|
+
tls_verify: d((I) => [
|
|
893
|
+
K(V(typeof o(v)("rowValue", I) == "boolean" ? A("rowValue", I) : o(m)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
|
|
925
894
|
]),
|
|
926
|
-
client_certificate: d((
|
|
927
|
-
K(
|
|
895
|
+
client_certificate: d((I) => [
|
|
896
|
+
K(V(o(v)("rowValue", I) ? o(v)("rowValue", I).id : "–"), 1)
|
|
928
897
|
]),
|
|
929
898
|
_: 1
|
|
930
899
|
}, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
|
|
@@ -993,8 +962,8 @@ const Y = {
|
|
|
993
962
|
},
|
|
994
963
|
emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated", "try-sample-api"],
|
|
995
964
|
setup(s, { expose: G, emit: m }) {
|
|
996
|
-
var
|
|
997
|
-
const n = m, a = s,
|
|
965
|
+
var U;
|
|
966
|
+
const n = m, a = s, v = R(!0), A = Ge(), { i18nT: N, i18n: { t: l } } = ee.useI18n(), { getErrorFieldsFromError: B } = yt(), { axiosInstance: I } = Ne((U = a.config) == null ? void 0 : U.axiosRequestConfig), Ie = _t(), { validateHost: le, validatePath: fe, validatePort: pe, validateProtocol: te } = ee.useUrlValidators(), { objectsAreEqual: Pe } = Oe(), z = b(() => ue.form[a.config.app].edit), Z = b(() => a.gatewayServiceId ? Le.Edit : Le.Create), Fe = R(!1), J = b(() => !!a.gatewayServiceId), C = R(J.value ? "protocol" : "url"), se = ee.usePortFromProtocol(), ae = R(""), oe = b(() => !!ae.value || !!$("name")), e = Ke({
|
|
998
967
|
fields: {
|
|
999
968
|
name: "",
|
|
1000
969
|
protocol: "http",
|
|
@@ -1031,7 +1000,7 @@ const Y = {
|
|
|
1031
1000
|
tls_verify_enabled: "",
|
|
1032
1001
|
tls_verify_value: ""
|
|
1033
1002
|
}
|
|
1034
|
-
}),
|
|
1003
|
+
}), w = Ke({
|
|
1035
1004
|
name: "",
|
|
1036
1005
|
protocol: "http",
|
|
1037
1006
|
host: "",
|
|
@@ -1048,13 +1017,13 @@ const Y = {
|
|
|
1048
1017
|
tls_verify_value: !1,
|
|
1049
1018
|
tags: "",
|
|
1050
1019
|
enabled: !0
|
|
1051
|
-
}),
|
|
1020
|
+
}), x = a.config.app === "konnect" || ht({
|
|
1052
1021
|
gatewayInfo: a.config.gatewayInfo,
|
|
1053
1022
|
// 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
|
|
1054
1023
|
supportedRange: {
|
|
1055
1024
|
enterprise: ["3.0"]
|
|
1056
1025
|
}
|
|
1057
|
-
}),
|
|
1026
|
+
}), re = [
|
|
1058
1027
|
{
|
|
1059
1028
|
label: l("gateway_services.form.fields.protocol.options.http"),
|
|
1060
1029
|
value: "http",
|
|
@@ -1090,7 +1059,7 @@ const Y = {
|
|
|
1090
1059
|
value: "grpcs",
|
|
1091
1060
|
group: "grpc"
|
|
1092
1061
|
},
|
|
1093
|
-
...
|
|
1062
|
+
...x ? [
|
|
1094
1063
|
{
|
|
1095
1064
|
label: l("gateway_services.form.fields.protocol.options.ws"),
|
|
1096
1065
|
value: "ws",
|
|
@@ -1107,14 +1076,14 @@ const Y = {
|
|
|
1107
1076
|
value: "udp",
|
|
1108
1077
|
group: "udp"
|
|
1109
1078
|
}
|
|
1110
|
-
],
|
|
1079
|
+
], me = { url: "url", protocol: "protocol" }, ve = (t, r) => {
|
|
1111
1080
|
r.value;
|
|
1112
|
-
},
|
|
1113
|
-
e.fields.host =
|
|
1114
|
-
},
|
|
1115
|
-
|
|
1116
|
-
},
|
|
1117
|
-
switch (
|
|
1081
|
+
}, Q = (t) => t ? parseFloat(t) : 0, ge = () => {
|
|
1082
|
+
e.fields.host = w.host, e.fields.path = w.path, e.fields.port = w.port, e.fields.protocol = w.protocol, e.fields.url = w.url, e.fields.retries = w.retries, e.fields.connect_timeout = w.connect_timeout, e.fields.write_timeout = w.write_timeout, e.fields.read_timeout = w.read_timeout, e.fields.client_certificate = w.client_certificate, e.fields.ca_certificates = w.ca_certificates, e.fields.tls_verify_enabled = w.tls_verify_enabled, e.fields.tls_verify_value = w.tls_verify_value, e.fields.enabled = w.enabled;
|
|
1083
|
+
}, ye = () => {
|
|
1084
|
+
v.value = !0, O(), e.errorMessages = [], ge();
|
|
1085
|
+
}, _e = () => {
|
|
1086
|
+
switch (ge(), e.fields.name = `${q.name}-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, C.value) {
|
|
1118
1087
|
case "url":
|
|
1119
1088
|
e.fields.url = `${q.protocol}://${q.host}${q.path}`;
|
|
1120
1089
|
break;
|
|
@@ -1124,39 +1093,39 @@ const Y = {
|
|
|
1124
1093
|
default:
|
|
1125
1094
|
e.fields.url = `${q.protocol}://${q.host}${q.path}`;
|
|
1126
1095
|
}
|
|
1127
|
-
},
|
|
1096
|
+
}, he = () => {
|
|
1128
1097
|
if (O(), e.fields.url.length)
|
|
1129
1098
|
try {
|
|
1130
|
-
const t = new URL(e.fields.url), r =
|
|
1099
|
+
const t = new URL(e.fields.url), r = te(t.protocol, re);
|
|
1131
1100
|
if (r) throw new Error(r);
|
|
1132
1101
|
e.fields.protocol = t.protocol.slice(0, -1);
|
|
1133
|
-
const _ =
|
|
1102
|
+
const _ = le(t.hostname);
|
|
1134
1103
|
if (_) throw new Error(_);
|
|
1135
1104
|
e.fields.host = t.hostname;
|
|
1136
|
-
const
|
|
1137
|
-
if (
|
|
1105
|
+
const F = fe(t.pathname);
|
|
1106
|
+
if (F) throw new Error(F);
|
|
1138
1107
|
e.fields.path = t.pathname;
|
|
1139
1108
|
const h = pe(t.port);
|
|
1140
1109
|
if (h) throw new Error(h);
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1110
|
+
const k = Number(t.port);
|
|
1111
|
+
Fe.value = !!k, e.fields.port = k || se.getPortFromProtocol(e.fields.protocol), n("url-valid:success");
|
|
1143
1112
|
} catch {
|
|
1144
1113
|
n("url-valid:error", l("gateway_services.form.errors.url.invalid")), e.formFieldErrors.url = l("gateway_services.form.errors.url.invalid");
|
|
1145
1114
|
}
|
|
1146
|
-
},
|
|
1115
|
+
}, be = (t) => {
|
|
1147
1116
|
O(t);
|
|
1148
|
-
},
|
|
1117
|
+
}, Ae = b(() => !!e.formFieldErrors.url || !!e.formFieldErrors.host || !!e.formFieldErrors.port), $ = (t) => {
|
|
1149
1118
|
if (e.errorMessages.length) return "";
|
|
1150
1119
|
const r = e.formFieldErrors;
|
|
1151
1120
|
return r[t] ? r[t] : "";
|
|
1152
|
-
},
|
|
1121
|
+
}, H = (t) => {
|
|
1153
1122
|
O(t ?? void 0);
|
|
1154
|
-
const r =
|
|
1123
|
+
const r = le(e.fields.host);
|
|
1155
1124
|
r && (e.formFieldErrors.host = r);
|
|
1156
|
-
const _ =
|
|
1125
|
+
const _ = fe(e.fields.path);
|
|
1157
1126
|
_ && (e.formFieldErrors.path = _);
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1127
|
+
const F = pe(e.fields.port);
|
|
1128
|
+
F && (e.formFieldErrors.port = F), X.value ? n("url-valid:success") : n("url-valid:error", e.errorMessages.join(",") || l("gateway_services.form.errors.url.invalid"));
|
|
1160
1129
|
}, O = (t) => {
|
|
1161
1130
|
if (t)
|
|
1162
1131
|
e.formFieldErrors[t] = "";
|
|
@@ -1164,54 +1133,54 @@ const Y = {
|
|
|
1164
1133
|
for (let r in e.formFieldErrors)
|
|
1165
1134
|
e.formFieldErrors[r] = "";
|
|
1166
1135
|
e.errorMessages = [];
|
|
1167
|
-
},
|
|
1136
|
+
}, X = b(() => {
|
|
1168
1137
|
for (let t in e.formFieldErrors)
|
|
1169
1138
|
if (e.formFieldErrors[t].length)
|
|
1170
1139
|
return !1;
|
|
1171
1140
|
return !0;
|
|
1172
|
-
}),
|
|
1173
|
-
e.fields.url &&
|
|
1174
|
-
},
|
|
1175
|
-
if (
|
|
1141
|
+
}), Te = () => {
|
|
1142
|
+
e.fields.url && C.value === "url" ? he() : H();
|
|
1143
|
+
}, Ue = () => `new-service-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, ne = b(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(e.fields.protocol)), $e = b(() => {
|
|
1144
|
+
if (C.value === "url")
|
|
1176
1145
|
return !0;
|
|
1177
1146
|
const t = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
1178
|
-
return
|
|
1179
|
-
}),
|
|
1180
|
-
if (
|
|
1147
|
+
return C.value === "protocol" && t;
|
|
1148
|
+
}), Re = b(() => {
|
|
1149
|
+
if (C.value === "url")
|
|
1181
1150
|
return !0;
|
|
1182
1151
|
const t = ["https", "tls"].includes(e.fields.protocol);
|
|
1183
|
-
return
|
|
1184
|
-
}),
|
|
1185
|
-
if (
|
|
1152
|
+
return C.value === "protocol" && t;
|
|
1153
|
+
}), ce = b(() => {
|
|
1154
|
+
if (C.value === "url")
|
|
1186
1155
|
return !0;
|
|
1187
1156
|
const t = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
1188
|
-
return
|
|
1189
|
-
}),
|
|
1190
|
-
O("name"),
|
|
1191
|
-
},
|
|
1192
|
-
const t = !
|
|
1157
|
+
return C.value === "protocol" && t;
|
|
1158
|
+
}), we = (t) => {
|
|
1159
|
+
O("name"), ae.value = Ie.utf8Name(t);
|
|
1160
|
+
}, f = b(() => {
|
|
1161
|
+
const t = !J.value || !Pe(e.fields, w), r = C.value === "url" && !!e.fields.url && X.value, _ = C.value === "protocol" && !!e.fields.host && X.value;
|
|
1193
1162
|
return t && (r || _);
|
|
1194
|
-
}),
|
|
1195
|
-
var r, _,
|
|
1196
|
-
e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((r = t == null ? void 0 : t.tags) == null ? void 0 : r.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 = ((_ = t == null ? void 0 : t.ca_certificates) == null ? void 0 : _.join(",")) || "", e.fields.client_certificate = ((
|
|
1197
|
-
},
|
|
1198
|
-
|
|
1199
|
-
},
|
|
1163
|
+
}), g = (t) => {
|
|
1164
|
+
var r, _, F;
|
|
1165
|
+
e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((r = t == null ? void 0 : t.tags) == null ? void 0 : r.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 = ((_ = t == null ? void 0 : t.ca_certificates) == null ? void 0 : _.join(",")) || "", e.fields.client_certificate = ((F = t == null ? void 0 : t.client_certificate) == null ? void 0 : F.id) || "", 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(w, e.fields);
|
|
1166
|
+
}, y = () => {
|
|
1167
|
+
A.push(a.config.cancelRoute);
|
|
1168
|
+
}, P = b(() => {
|
|
1200
1169
|
var r, _;
|
|
1201
1170
|
let t = `${a.config.apiBaseUrl}${ue.form[a.config.app].validate}`;
|
|
1202
1171
|
return a.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((r = a.config) == null ? void 0 : r.controlPlaneId) || "") : a.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (_ = a.config) != null && _.workspace ? `/${a.config.workspace}` : "")), t = t.replace(/{id}/gi, a.gatewayServiceId), t;
|
|
1203
|
-
}),
|
|
1172
|
+
}), W = b(() => {
|
|
1204
1173
|
var r, _;
|
|
1205
|
-
let t = `${a.config.apiBaseUrl}${ue.form[a.config.app][
|
|
1174
|
+
let t = `${a.config.apiBaseUrl}${ue.form[a.config.app][Z.value]}`;
|
|
1206
1175
|
return a.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((r = a.config) == null ? void 0 : r.controlPlaneId) || "") : a.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (_ = a.config) != null && _.workspace ? `/${a.config.workspace}` : "")), t = t.replace(/{id}/gi, a.gatewayServiceId), t;
|
|
1207
|
-
}),
|
|
1176
|
+
}), M = (t) => {
|
|
1208
1177
|
let r = "";
|
|
1209
1178
|
t.url && (r = new URL(t.url).protocol), (["https", "wss", "tls"].includes(t.protocol) || ["https", "wss", "tls"].includes(r)) && (t.tls_verify = t.tls_verify_enabled ? t.tls_verify_value : null), delete t.tls_verify_enabled, delete t.tls_verify_value;
|
|
1210
|
-
},
|
|
1211
|
-
var r, _,
|
|
1179
|
+
}, j = b(() => {
|
|
1180
|
+
var r, _, F, h;
|
|
1212
1181
|
const t = {
|
|
1213
1182
|
name: e.fields.name || null,
|
|
1214
|
-
tags: e.fields.tags ? (
|
|
1183
|
+
tags: e.fields.tags ? (F = (_ = (r = e.fields.tags) == null ? void 0 : r.split(",")) == null ? void 0 : _.map((k) => String(k || "").trim())) == null ? void 0 : F.filter((k) => k !== "") : null,
|
|
1215
1184
|
protocol: e.fields.protocol,
|
|
1216
1185
|
path: e.fields.path || null,
|
|
1217
1186
|
read_timeout: e.fields.read_timeout,
|
|
@@ -1220,33 +1189,33 @@ const Y = {
|
|
|
1220
1189
|
connect_timeout: e.fields.connect_timeout,
|
|
1221
1190
|
tls_verify_value: e.fields.tls_verify_value,
|
|
1222
1191
|
tls_verify_enabled: e.fields.tls_verify_enabled,
|
|
1223
|
-
ca_certificates: e.fields.ca_certificates ? (h = e.fields.ca_certificates) == null ? void 0 : h.split(",").filter((
|
|
1192
|
+
ca_certificates: e.fields.ca_certificates ? (h = e.fields.ca_certificates) == null ? void 0 : h.split(",").filter((k) => k !== "") : null,
|
|
1224
1193
|
client_certificate: e.fields.client_certificate ? { id: e.fields.client_certificate } : null,
|
|
1225
1194
|
write_timeout: e.fields.write_timeout,
|
|
1226
1195
|
port: e.fields.port,
|
|
1227
1196
|
url: e.fields.url,
|
|
1228
1197
|
enabled: e.fields.enabled
|
|
1229
1198
|
};
|
|
1230
|
-
return e.fields.client_certificate && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.client_certificate = { id: e.fields.client_certificate }), e.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.tls_verify = e.fields.tls_verify_value),
|
|
1231
|
-
}),
|
|
1232
|
-
var t, r, _,
|
|
1199
|
+
return e.fields.client_certificate && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.client_certificate = { id: e.fields.client_certificate }), e.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.tls_verify = e.fields.tls_verify_value), ne.value || (t.path = null), Z.value === "create" ? C.value === "url" ? (delete t.protocol, delete t.host, delete t.path, a.config.app === "konnect" && delete t.port) : delete t.url : Z.value === "edit" && delete t.url, t;
|
|
1200
|
+
}), p = async () => {
|
|
1201
|
+
var t, r, _, F;
|
|
1233
1202
|
try {
|
|
1234
1203
|
e.isReadonly = !0;
|
|
1235
|
-
const h =
|
|
1236
|
-
|
|
1237
|
-
let
|
|
1238
|
-
if (await
|
|
1239
|
-
const { data: i } =
|
|
1240
|
-
e.fields.name = (i == null ? void 0 : i.name) || "", e.fields.port = i.port ||
|
|
1204
|
+
const h = j.value;
|
|
1205
|
+
M(h);
|
|
1206
|
+
let k;
|
|
1207
|
+
if (await I.post(P.value, h), Z.value === "create" ? k = await I.post(W.value, h) : Z.value === "edit" && (k = ((t = a.config) == null ? void 0 : t.app) === "konnect" ? await I.put(W.value, h) : await I.patch(W.value, h)), k) {
|
|
1208
|
+
const { data: i } = k;
|
|
1209
|
+
e.fields.name = (i == null ? void 0 : i.name) || "", e.fields.port = i.port || se.getPortFromProtocol(i.protocol), e.fields.protocol = (i == null ? void 0 : i.protocol) || "http", e.fields.host = (i == null ? void 0 : i.host) || "", e.fields.path = (i == null ? void 0 : i.path) || "", e.fields.url = (i == null ? void 0 : i.url) || "", e.fields.retries = i != null && i.retries || (i == null ? void 0 : i.retries) === 0 ? i == null ? void 0 : i.retries : 5, e.fields.connect_timeout = i != null && i.connect_timeout || (i == null ? void 0 : i.connect_timeout) === 0 ? i == null ? void 0 : i.connect_timeout : 6e4, e.fields.write_timeout = i != null && i.write_timeout || (i == null ? void 0 : i.write_timeout) === 0 ? i == null ? void 0 : i.write_timeout : 6e4, e.fields.read_timeout = i != null && i.read_timeout || (i == null ? void 0 : i.read_timeout) === 0 ? i == null ? void 0 : i.read_timeout : 6e4, e.fields.client_certificate = ((r = i == null ? void 0 : i.client_certificate) == null ? void 0 : r.id) || "", e.fields.ca_certificates = (_ = i == null ? void 0 : i.ca_certificates) != null && _.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 = (F = i == null ? void 0 : i.tags) != null && F.length ? i.tags.join(", ") : "", e.fields.enabled = (i == null ? void 0 : i.enabled) ?? !0, Object.assign(w, e.fields), n("update", k == null ? void 0 : k.data);
|
|
1241
1210
|
}
|
|
1242
|
-
return
|
|
1211
|
+
return k;
|
|
1243
1212
|
} catch (h) {
|
|
1244
|
-
const { fields:
|
|
1245
|
-
e.errorMessages = i,
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1213
|
+
const { fields: k, messages: i } = B(h);
|
|
1214
|
+
e.errorMessages = i, k.length && k.forEach((Y) => {
|
|
1215
|
+
const ie = Y.field;
|
|
1216
|
+
ie === "client_certificate.id" ? e.formFieldErrors.client_certificate = Y.message : ie.startsWith("ca_certificates") ? e.formFieldErrors.ca_certificates = Y.message : Object.keys(e.formFieldErrors).includes(ie) && (e.formFieldErrors = {
|
|
1248
1217
|
...e.formFieldErrors,
|
|
1249
|
-
[
|
|
1218
|
+
[ie]: Y.message
|
|
1250
1219
|
});
|
|
1251
1220
|
}), n("error", h);
|
|
1252
1221
|
} finally {
|
|
@@ -1254,85 +1223,85 @@ const Y = {
|
|
|
1254
1223
|
}
|
|
1255
1224
|
};
|
|
1256
1225
|
return Be(() => a.gatewayServiceId, () => {
|
|
1257
|
-
Object.assign(e.fields,
|
|
1226
|
+
Object.assign(e.fields, w);
|
|
1258
1227
|
}), Be(e.fields, (t) => {
|
|
1259
|
-
e.fields.port =
|
|
1260
|
-
}),
|
|
1261
|
-
n("model-updated",
|
|
1228
|
+
e.fields.port = se.getPortFromProtocol(t.protocol, String(t.port)), n("model-updated", j.value);
|
|
1229
|
+
}), Ze(() => {
|
|
1230
|
+
n("model-updated", j.value), J.value || (e.fields.name = Ue());
|
|
1262
1231
|
}), G({
|
|
1263
|
-
validateUrl:
|
|
1264
|
-
getPayload:
|
|
1265
|
-
saveFormData:
|
|
1266
|
-
canSubmit:
|
|
1267
|
-
initForm:
|
|
1232
|
+
validateUrl: Te,
|
|
1233
|
+
getPayload: j,
|
|
1234
|
+
saveFormData: p,
|
|
1235
|
+
canSubmit: f,
|
|
1236
|
+
initForm: g
|
|
1268
1237
|
}), (t, r) => {
|
|
1269
|
-
const _ = L("KRadio"),
|
|
1270
|
-
return
|
|
1238
|
+
const _ = L("KRadio"), F = L("KButton"), h = L("KInput"), k = L("KSelect"), i = L("KCheckbox"), Y = L("KCollapse"), ie = L("KAlert");
|
|
1239
|
+
return E(), T("div", Kt, [
|
|
1271
1240
|
c(o(bt), {
|
|
1272
|
-
"can-submit":
|
|
1241
|
+
"can-submit": f.value,
|
|
1273
1242
|
config: s.config,
|
|
1274
1243
|
"edit-id": s.gatewayServiceId,
|
|
1275
|
-
"entity-type": o(
|
|
1276
|
-
"fetch-url":
|
|
1277
|
-
"form-fields":
|
|
1244
|
+
"entity-type": o(We).GatewayService,
|
|
1245
|
+
"fetch-url": z.value,
|
|
1246
|
+
"form-fields": j.value,
|
|
1278
1247
|
"is-readonly": e.isReadonly,
|
|
1279
|
-
onCancel:
|
|
1248
|
+
onCancel: y,
|
|
1280
1249
|
"onFetch:error": r[31] || (r[31] = (u) => t.$emit("error", u)),
|
|
1281
|
-
"onFetch:success":
|
|
1250
|
+
"onFetch:success": g,
|
|
1282
1251
|
onLoading: r[32] || (r[32] = (u) => t.$emit("loading", u)),
|
|
1283
|
-
onSubmit:
|
|
1252
|
+
onSubmit: p
|
|
1284
1253
|
}, {
|
|
1285
1254
|
"form-actions": d(() => [
|
|
1286
|
-
|
|
1287
|
-
canSubmit:
|
|
1288
|
-
cancel:
|
|
1289
|
-
submit:
|
|
1255
|
+
Xe(t.$slots, "form-actions", {
|
|
1256
|
+
canSubmit: f.value,
|
|
1257
|
+
cancel: y,
|
|
1258
|
+
submit: p
|
|
1290
1259
|
}, void 0, !0)
|
|
1291
1260
|
]),
|
|
1292
1261
|
default: d(() => [
|
|
1293
|
-
c(o(
|
|
1262
|
+
c(o(qe), {
|
|
1294
1263
|
description: o(l)("gateway_services.form.sections.keys.description"),
|
|
1295
1264
|
"hide-info-header": s.hideSectionsInfo,
|
|
1296
1265
|
title: o(l)("gateway_services.form.sections.keys.title")
|
|
1297
1266
|
}, {
|
|
1298
1267
|
default: d(() => [
|
|
1299
|
-
|
|
1300
|
-
|
|
1268
|
+
J.value ? D("", !0) : (E(), T("div", Lt, [
|
|
1269
|
+
S("div", qt, [
|
|
1301
1270
|
c(_, {
|
|
1302
|
-
modelValue:
|
|
1303
|
-
"onUpdate:modelValue": r[0] || (r[0] = (u) =>
|
|
1271
|
+
modelValue: C.value,
|
|
1272
|
+
"onUpdate:modelValue": r[0] || (r[0] = (u) => C.value = u),
|
|
1304
1273
|
card: "",
|
|
1305
1274
|
"card-orientation": "horizontal",
|
|
1306
1275
|
"data-testid": "gateway-service-url-radio",
|
|
1307
1276
|
description: o(l)("gateway_services.form.sections.keys.url.description"),
|
|
1308
1277
|
label: o(l)("gateway_services.form.sections.keys.url.label"),
|
|
1309
|
-
"selected-value":
|
|
1310
|
-
onChange:
|
|
1278
|
+
"selected-value": me.url,
|
|
1279
|
+
onChange: ye
|
|
1311
1280
|
}, null, 8, ["modelValue", "description", "label", "selected-value"]),
|
|
1312
1281
|
c(_, {
|
|
1313
|
-
modelValue:
|
|
1314
|
-
"onUpdate:modelValue": r[1] || (r[1] = (u) =>
|
|
1282
|
+
modelValue: C.value,
|
|
1283
|
+
"onUpdate:modelValue": r[1] || (r[1] = (u) => C.value = u),
|
|
1315
1284
|
card: "",
|
|
1316
1285
|
"card-orientation": "horizontal",
|
|
1317
1286
|
"checked-group": "protocol",
|
|
1318
1287
|
"data-testid": "gateway-service-protocol-radio",
|
|
1319
1288
|
description: o(l)("gateway_services.form.sections.keys.protocol.description"),
|
|
1320
1289
|
label: o(l)("gateway_services.form.sections.keys.protocol.label"),
|
|
1321
|
-
"selected-value":
|
|
1322
|
-
onChange:
|
|
1290
|
+
"selected-value": me.protocol,
|
|
1291
|
+
onChange: ye
|
|
1323
1292
|
}, null, 8, ["modelValue", "description", "label", "selected-value"])
|
|
1324
1293
|
]),
|
|
1325
1294
|
c(Me, { name: "slide-fade" }, {
|
|
1326
1295
|
default: d(() => [
|
|
1327
|
-
|
|
1296
|
+
C.value === "url" ? (E(), T("div", Gt, [
|
|
1328
1297
|
c(h, {
|
|
1329
1298
|
modelValue: e.fields.url,
|
|
1330
1299
|
"onUpdate:modelValue": r[2] || (r[2] = (u) => e.fields.url = u),
|
|
1331
1300
|
modelModifiers: { trim: !0 },
|
|
1332
1301
|
class: "gateway-service-url-input gateway-service-form-margin-bottom",
|
|
1333
1302
|
"data-testid": "gateway-service-url-input",
|
|
1334
|
-
error:
|
|
1335
|
-
"error-message":
|
|
1303
|
+
error: Ae.value,
|
|
1304
|
+
"error-message": $("url"),
|
|
1336
1305
|
label: o(l)("gateway_services.form.fields.upstream_url.label"),
|
|
1337
1306
|
"label-attributes": {
|
|
1338
1307
|
info: s.config.app === "konnect" ? o(l)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(l)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
|
|
@@ -1341,19 +1310,19 @@ const Y = {
|
|
|
1341
1310
|
name: "url",
|
|
1342
1311
|
placeholder: o(l)("gateway_services.form.fields.upstream_url.placeholder"),
|
|
1343
1312
|
required: "",
|
|
1344
|
-
onInput:
|
|
1345
|
-
},
|
|
1313
|
+
onInput: he
|
|
1314
|
+
}, Se({ _: 2 }, [
|
|
1346
1315
|
s.hideTrySampleApiButton ? void 0 : {
|
|
1347
1316
|
name: "after",
|
|
1348
1317
|
fn: d(() => [
|
|
1349
|
-
c(
|
|
1318
|
+
c(F, {
|
|
1350
1319
|
appearance: "tertiary",
|
|
1351
1320
|
"data-testid": "try-sample-api",
|
|
1352
1321
|
size: "small",
|
|
1353
|
-
onClick:
|
|
1322
|
+
onClick: _e
|
|
1354
1323
|
}, {
|
|
1355
1324
|
default: d(() => [
|
|
1356
|
-
K(
|
|
1325
|
+
K(V(o(l)("gateway_services.form.buttons.try_sample")), 1)
|
|
1357
1326
|
]),
|
|
1358
1327
|
_: 1
|
|
1359
1328
|
})
|
|
@@ -1368,12 +1337,12 @@ const Y = {
|
|
|
1368
1337
|
])),
|
|
1369
1338
|
c(Me, { name: "slide-fade" }, {
|
|
1370
1339
|
default: d(() => [
|
|
1371
|
-
|
|
1372
|
-
c(
|
|
1340
|
+
C.value === "protocol" || J.value ? (E(), T("div", Nt, [
|
|
1341
|
+
c(k, {
|
|
1373
1342
|
modelValue: e.fields.protocol,
|
|
1374
1343
|
"onUpdate:modelValue": r[3] || (r[3] = (u) => e.fields.protocol = u),
|
|
1375
1344
|
"data-testid": "gateway-service-protocol-select",
|
|
1376
|
-
items:
|
|
1345
|
+
items: re,
|
|
1377
1346
|
label: o(l)("gateway_services.form.fields.protocol.label"),
|
|
1378
1347
|
"label-attributes": {
|
|
1379
1348
|
info: o(l)("gateway_services.form.fields.protocol.tooltip"),
|
|
@@ -1382,7 +1351,7 @@ const Y = {
|
|
|
1382
1351
|
readonly: e.isReadonly,
|
|
1383
1352
|
required: "",
|
|
1384
1353
|
width: "100%",
|
|
1385
|
-
onSelected: r[4] || (r[4] = (u) =>
|
|
1354
|
+
onSelected: r[4] || (r[4] = (u) => ve(e.fields.protocol, u))
|
|
1386
1355
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
|
|
1387
1356
|
c(h, {
|
|
1388
1357
|
modelValue: e.fields.host,
|
|
@@ -1391,7 +1360,7 @@ const Y = {
|
|
|
1391
1360
|
class: "gateway-service-form-margin-top",
|
|
1392
1361
|
"data-testid": "gateway-service-host-input",
|
|
1393
1362
|
error: !!e.formFieldErrors.host,
|
|
1394
|
-
"error-message":
|
|
1363
|
+
"error-message": $("host"),
|
|
1395
1364
|
label: o(l)("gateway_services.form.fields.host.label"),
|
|
1396
1365
|
"label-attributes": {
|
|
1397
1366
|
info: o(l)("gateway_services.form.fields.host.tooltip"),
|
|
@@ -1400,18 +1369,18 @@ const Y = {
|
|
|
1400
1369
|
name: "host",
|
|
1401
1370
|
placeholder: o(l)("gateway_services.form.fields.host.placeholder"),
|
|
1402
1371
|
required: "",
|
|
1403
|
-
onInput: r[6] || (r[6] = (u) =>
|
|
1404
|
-
},
|
|
1372
|
+
onInput: r[6] || (r[6] = (u) => H("host"))
|
|
1373
|
+
}, Se({ _: 2 }, [
|
|
1405
1374
|
s.hideTrySampleApiButton ? void 0 : {
|
|
1406
1375
|
name: "after",
|
|
1407
1376
|
fn: d(() => [
|
|
1408
|
-
c(
|
|
1377
|
+
c(F, {
|
|
1409
1378
|
appearance: "tertiary",
|
|
1410
1379
|
size: "small",
|
|
1411
|
-
onClick:
|
|
1380
|
+
onClick: _e
|
|
1412
1381
|
}, {
|
|
1413
1382
|
default: d(() => [
|
|
1414
|
-
K(
|
|
1383
|
+
K(V(o(l)("gateway_services.form.buttons.try_sample")), 1)
|
|
1415
1384
|
]),
|
|
1416
1385
|
_: 1
|
|
1417
1386
|
})
|
|
@@ -1419,7 +1388,7 @@ const Y = {
|
|
|
1419
1388
|
key: "0"
|
|
1420
1389
|
}
|
|
1421
1390
|
]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"]),
|
|
1422
|
-
|
|
1391
|
+
ne.value ? (E(), T("div", Ot, [
|
|
1423
1392
|
c(h, {
|
|
1424
1393
|
modelValue: e.fields.path,
|
|
1425
1394
|
"onUpdate:modelValue": r[7] || (r[7] = (u) => e.fields.path = u),
|
|
@@ -1427,7 +1396,7 @@ const Y = {
|
|
|
1427
1396
|
class: "gateway-service-form-margin-top",
|
|
1428
1397
|
"data-testid": "gateway-service-path-input",
|
|
1429
1398
|
error: !!e.formFieldErrors.path,
|
|
1430
|
-
"error-message":
|
|
1399
|
+
"error-message": $("path"),
|
|
1431
1400
|
label: o(l)("gateway_services.form.fields.path.label"),
|
|
1432
1401
|
"label-attributes": {
|
|
1433
1402
|
info: o(l)("gateway_services.form.fields.path.tooltip"),
|
|
@@ -1435,7 +1404,7 @@ const Y = {
|
|
|
1435
1404
|
},
|
|
1436
1405
|
name: "path",
|
|
1437
1406
|
placeholder: o(l)("gateway_services.form.fields.path.placeholder"),
|
|
1438
|
-
onInput: r[8] || (r[8] = (u) =>
|
|
1407
|
+
onInput: r[8] || (r[8] = (u) => H("path"))
|
|
1439
1408
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
|
|
1440
1409
|
])) : D("", !0),
|
|
1441
1410
|
c(h, {
|
|
@@ -1443,13 +1412,13 @@ const Y = {
|
|
|
1443
1412
|
"onUpdate:modelValue": [
|
|
1444
1413
|
r[9] || (r[9] = (u) => e.fields.port = u),
|
|
1445
1414
|
r[11] || (r[11] = () => {
|
|
1446
|
-
e.fields.port =
|
|
1415
|
+
e.fields.port = Q(e.fields.port + "");
|
|
1447
1416
|
})
|
|
1448
1417
|
],
|
|
1449
1418
|
class: "gateway-service-form-margin-top",
|
|
1450
1419
|
"data-testid": "gateway-service-port-input",
|
|
1451
1420
|
error: !!e.formFieldErrors.port,
|
|
1452
|
-
"error-message":
|
|
1421
|
+
"error-message": $("port"),
|
|
1453
1422
|
label: o(l)("gateway_services.form.fields.port.label"),
|
|
1454
1423
|
"label-attributes": {
|
|
1455
1424
|
info: o(l)("gateway_services.form.fields.port.tooltip"),
|
|
@@ -1457,15 +1426,15 @@ const Y = {
|
|
|
1457
1426
|
},
|
|
1458
1427
|
name: "port",
|
|
1459
1428
|
type: "number",
|
|
1460
|
-
onInput: r[10] || (r[10] = (u) =>
|
|
1429
|
+
onInput: r[10] || (r[10] = (u) => H("port"))
|
|
1461
1430
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes"])
|
|
1462
1431
|
])) : D("", !0)
|
|
1463
1432
|
]),
|
|
1464
1433
|
_: 1
|
|
1465
1434
|
}),
|
|
1466
|
-
c(
|
|
1467
|
-
modelValue:
|
|
1468
|
-
"onUpdate:modelValue": r[27] || (r[27] = (u) =>
|
|
1435
|
+
c(Y, {
|
|
1436
|
+
modelValue: v.value,
|
|
1437
|
+
"onUpdate:modelValue": r[27] || (r[27] = (u) => v.value = u),
|
|
1469
1438
|
"data-testid": "advanced-fields-collapse",
|
|
1470
1439
|
"trigger-alignment": "leading",
|
|
1471
1440
|
"trigger-label": o(l)("gateway_services.form.sections.keys.viewAdvancedFields")
|
|
@@ -1473,14 +1442,14 @@ const Y = {
|
|
|
1473
1442
|
default: d(() => [
|
|
1474
1443
|
c(Me, { name: "slide-fade" }, {
|
|
1475
1444
|
default: d(() => [
|
|
1476
|
-
|
|
1477
|
-
|
|
1445
|
+
v.value ? D("", !0) : (E(), T("div", Wt, [
|
|
1446
|
+
S("div", jt, [
|
|
1478
1447
|
c(h, {
|
|
1479
1448
|
modelValue: e.fields.retries,
|
|
1480
1449
|
"onUpdate:modelValue": [
|
|
1481
1450
|
r[12] || (r[12] = (u) => e.fields.retries = u),
|
|
1482
1451
|
r[13] || (r[13] = () => {
|
|
1483
|
-
e.fields.retries =
|
|
1452
|
+
e.fields.retries = Q(e.fields.retries + "");
|
|
1484
1453
|
})
|
|
1485
1454
|
],
|
|
1486
1455
|
autocomplete: "off",
|
|
@@ -1495,13 +1464,13 @@ const Y = {
|
|
|
1495
1464
|
type: "number"
|
|
1496
1465
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1497
1466
|
]),
|
|
1498
|
-
|
|
1467
|
+
S("div", zt, [
|
|
1499
1468
|
c(h, {
|
|
1500
1469
|
modelValue: e.fields.connect_timeout,
|
|
1501
1470
|
"onUpdate:modelValue": [
|
|
1502
1471
|
r[14] || (r[14] = (u) => e.fields.connect_timeout = u),
|
|
1503
1472
|
r[15] || (r[15] = () => {
|
|
1504
|
-
e.fields.connect_timeout =
|
|
1473
|
+
e.fields.connect_timeout = Q(e.fields.connect_timeout + "");
|
|
1505
1474
|
})
|
|
1506
1475
|
],
|
|
1507
1476
|
autocomplete: "off",
|
|
@@ -1516,13 +1485,13 @@ const Y = {
|
|
|
1516
1485
|
type: "number"
|
|
1517
1486
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1518
1487
|
]),
|
|
1519
|
-
|
|
1488
|
+
S("div", Ht, [
|
|
1520
1489
|
c(h, {
|
|
1521
1490
|
modelValue: e.fields.write_timeout,
|
|
1522
1491
|
"onUpdate:modelValue": [
|
|
1523
1492
|
r[16] || (r[16] = (u) => e.fields.write_timeout = u),
|
|
1524
1493
|
r[17] || (r[17] = () => {
|
|
1525
|
-
e.fields.write_timeout =
|
|
1494
|
+
e.fields.write_timeout = Q(e.fields.write_timeout + "");
|
|
1526
1495
|
})
|
|
1527
1496
|
],
|
|
1528
1497
|
autocomplete: "off",
|
|
@@ -1537,13 +1506,13 @@ const Y = {
|
|
|
1537
1506
|
type: "number"
|
|
1538
1507
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1539
1508
|
]),
|
|
1540
|
-
|
|
1509
|
+
S("div", Zt, [
|
|
1541
1510
|
c(h, {
|
|
1542
1511
|
modelValue: e.fields.read_timeout,
|
|
1543
1512
|
"onUpdate:modelValue": [
|
|
1544
1513
|
r[18] || (r[18] = (u) => e.fields.read_timeout = u),
|
|
1545
1514
|
r[19] || (r[19] = () => {
|
|
1546
|
-
e.fields.read_timeout =
|
|
1515
|
+
e.fields.read_timeout = Q(e.fields.read_timeout + "");
|
|
1547
1516
|
})
|
|
1548
1517
|
],
|
|
1549
1518
|
autocomplete: "off",
|
|
@@ -1558,7 +1527,7 @@ const Y = {
|
|
|
1558
1527
|
type: "number"
|
|
1559
1528
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1560
1529
|
]),
|
|
1561
|
-
|
|
1530
|
+
$e.value ? (E(), T("div", Jt, [
|
|
1562
1531
|
c(h, {
|
|
1563
1532
|
modelValue: e.fields.client_certificate,
|
|
1564
1533
|
"onUpdate:modelValue": r[20] || (r[20] = (u) => e.fields.client_certificate = u),
|
|
@@ -1575,10 +1544,10 @@ const Y = {
|
|
|
1575
1544
|
placeholder: o(l)("gateway_services.form.fields.client_certificate.placeholder"),
|
|
1576
1545
|
readonly: e.isReadonly,
|
|
1577
1546
|
type: "text",
|
|
1578
|
-
onInput: r[21] || (r[21] = (u) =>
|
|
1547
|
+
onInput: r[21] || (r[21] = (u) => be("client_certificate"))
|
|
1579
1548
|
}, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"])
|
|
1580
1549
|
])) : D("", !0),
|
|
1581
|
-
|
|
1550
|
+
Re.value ? (E(), T("div", Qt, [
|
|
1582
1551
|
c(h, {
|
|
1583
1552
|
modelValue: e.fields.ca_certificates,
|
|
1584
1553
|
"onUpdate:modelValue": r[22] || (r[22] = (u) => e.fields.ca_certificates = u),
|
|
@@ -1591,7 +1560,7 @@ const Y = {
|
|
|
1591
1560
|
placeholder: o(l)("gateway_services.form.fields.ca_certificates.placeholder"),
|
|
1592
1561
|
readonly: e.isReadonly,
|
|
1593
1562
|
type: "text",
|
|
1594
|
-
onInput: r[23] || (r[23] = (u) =>
|
|
1563
|
+
onInput: r[23] || (r[23] = (u) => be("ca_certificates"))
|
|
1595
1564
|
}, {
|
|
1596
1565
|
"label-tooltip": d(() => [
|
|
1597
1566
|
c(o(N), {
|
|
@@ -1599,10 +1568,10 @@ const Y = {
|
|
|
1599
1568
|
scope: "global"
|
|
1600
1569
|
}, {
|
|
1601
1570
|
code1: d(() => [
|
|
1602
|
-
|
|
1571
|
+
S("code", null, V(o(l)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
1603
1572
|
]),
|
|
1604
1573
|
code2: d(() => [
|
|
1605
|
-
|
|
1574
|
+
S("code", null, V(o(l)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
1606
1575
|
]),
|
|
1607
1576
|
_: 1
|
|
1608
1577
|
})
|
|
@@ -1610,7 +1579,7 @@ const Y = {
|
|
|
1610
1579
|
_: 1
|
|
1611
1580
|
}, 8, ["modelValue", "error", "label", "placeholder", "readonly"])
|
|
1612
1581
|
])) : D("", !0),
|
|
1613
|
-
|
|
1582
|
+
ce.value ? (E(), T("div", Xt, [
|
|
1614
1583
|
c(i, {
|
|
1615
1584
|
modelValue: e.fields.tls_verify_enabled,
|
|
1616
1585
|
"onUpdate:modelValue": r[24] || (r[24] = (u) => e.fields.tls_verify_enabled = u),
|
|
@@ -1625,14 +1594,14 @@ const Y = {
|
|
|
1625
1594
|
scope: "global"
|
|
1626
1595
|
}, {
|
|
1627
1596
|
code1: d(() => [
|
|
1628
|
-
|
|
1597
|
+
S("code", null, V(o(l)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
1629
1598
|
]),
|
|
1630
1599
|
_: 1
|
|
1631
1600
|
})
|
|
1632
1601
|
]),
|
|
1633
1602
|
_: 1
|
|
1634
1603
|
}, 8, ["modelValue", "description", "label"]),
|
|
1635
|
-
e.fields.tls_verify_enabled ? (
|
|
1604
|
+
e.fields.tls_verify_enabled ? (E(), T("div", Yt, [
|
|
1636
1605
|
c(_, {
|
|
1637
1606
|
modelValue: e.fields.tls_verify_value,
|
|
1638
1607
|
"onUpdate:modelValue": r[25] || (r[25] = (u) => e.fields.tls_verify_value = u),
|
|
@@ -1641,7 +1610,7 @@ const Y = {
|
|
|
1641
1610
|
"selected-value": !0
|
|
1642
1611
|
}, null, 8, ["modelValue", "label"])
|
|
1643
1612
|
])) : D("", !0),
|
|
1644
|
-
e.fields.tls_verify_enabled ? (
|
|
1613
|
+
e.fields.tls_verify_enabled ? (E(), T("div", eo, [
|
|
1645
1614
|
c(_, {
|
|
1646
1615
|
modelValue: e.fields.tls_verify_value,
|
|
1647
1616
|
"onUpdate:modelValue": r[26] || (r[26] = (u) => e.fields.tls_verify_value = u),
|
|
@@ -1661,7 +1630,7 @@ const Y = {
|
|
|
1661
1630
|
]),
|
|
1662
1631
|
_: 1
|
|
1663
1632
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
1664
|
-
c(o(
|
|
1633
|
+
c(o(qe), {
|
|
1665
1634
|
description: o(l)("gateway_services.form.sections.general.description"),
|
|
1666
1635
|
"hide-info-header": s.hideSectionsInfo,
|
|
1667
1636
|
title: o(l)("gateway_services.form.sections.general.title")
|
|
@@ -1673,8 +1642,8 @@ const Y = {
|
|
|
1673
1642
|
modelModifiers: { trim: !0 },
|
|
1674
1643
|
autocomplete: "off",
|
|
1675
1644
|
"data-testid": "gateway-service-name-input",
|
|
1676
|
-
error:
|
|
1677
|
-
"error-message":
|
|
1645
|
+
error: oe.value,
|
|
1646
|
+
"error-message": ae.value,
|
|
1678
1647
|
label: o(l)("gateway_services.form.fields.name.label"),
|
|
1679
1648
|
"label-attributes": {
|
|
1680
1649
|
info: o(l)("gateway_services.form.fields.name.tooltip"),
|
|
@@ -1684,15 +1653,15 @@ const Y = {
|
|
|
1684
1653
|
placeholder: o(l)("gateway_services.form.fields.name.placeholder"),
|
|
1685
1654
|
readonly: e.isReadonly,
|
|
1686
1655
|
type: "text",
|
|
1687
|
-
onInput:
|
|
1656
|
+
onInput: we
|
|
1688
1657
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1689
|
-
c(
|
|
1658
|
+
c(Y, {
|
|
1690
1659
|
"data-testid": "tags-collapse",
|
|
1691
1660
|
"trigger-alignment": "leading",
|
|
1692
1661
|
"trigger-label": o(l)("gateway_services.form.fields.tags.collapse")
|
|
1693
1662
|
}, {
|
|
1694
1663
|
default: d(() => [
|
|
1695
|
-
|
|
1664
|
+
S("div", to, [
|
|
1696
1665
|
c(h, {
|
|
1697
1666
|
modelValue: e.fields.tags,
|
|
1698
1667
|
"onUpdate:modelValue": r[29] || (r[29] = (u) => e.fields.tags = u),
|
|
@@ -1718,14 +1687,14 @@ const Y = {
|
|
|
1718
1687
|
]),
|
|
1719
1688
|
_: 1
|
|
1720
1689
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
1721
|
-
e.errorMessages.length ? (
|
|
1690
|
+
e.errorMessages.length ? (E(), Ee(ie, {
|
|
1722
1691
|
key: 0,
|
|
1723
1692
|
appearance: "danger",
|
|
1724
1693
|
"data-testid": "form-error"
|
|
1725
1694
|
}, {
|
|
1726
1695
|
default: d(() => [
|
|
1727
|
-
|
|
1728
|
-
(
|
|
1696
|
+
S("ul", oo, [
|
|
1697
|
+
(E(!0), T(Je, null, Qe(e.errorMessages, (u) => (E(), T("li", { key: u }, V(u), 1))), 128))
|
|
1729
1698
|
])
|
|
1730
1699
|
]),
|
|
1731
1700
|
_: 1
|
|
@@ -1736,7 +1705,7 @@ const Y = {
|
|
|
1736
1705
|
]);
|
|
1737
1706
|
};
|
|
1738
1707
|
}
|
|
1739
|
-
}), go = /* @__PURE__ */
|
|
1708
|
+
}), go = /* @__PURE__ */ je(ro, [["__scopeId", "data-v-2ef1cab4"]]), { validateHost: io, validatePort: lo, validateProtocol: so, validatePath: ao } = ee.useUrlValidators(), yo = () => ({
|
|
1740
1709
|
validateHost: io,
|
|
1741
1710
|
validatePort: lo,
|
|
1742
1711
|
validateProtocol: so,
|