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