@kong-ui-public/entities-gateway-services 3.11.31-pr.2198.831e111e5.0 → 3.11.31-pr.2212.23bf359dc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/entities-gateway-services.es.js +1332 -693
- package/dist/entities-gateway-services.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/GatewayServiceConfigCard.vue.d.ts +2 -2
- package/dist/types/components/GatewayServiceForm.vue.d.ts +2 -2
- package/dist/types/components/GatewayServiceForm.vue.d.ts.map +1 -1
- package/dist/types/components/LegacyGatewayServiceForm.vue.d.ts +86 -0
- package/dist/types/components/LegacyGatewayServiceForm.vue.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/gateway-service-form.d.ts +9 -0
- package/dist/types/types/gateway-service-form.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { BookIcon as
|
|
4
|
-
import { createI18n as
|
|
5
|
-
import { useAxios as
|
|
1
|
+
import { defineComponent as Le, computed as k, ref as D, watch as Fe, onBeforeMount as tt, resolveComponent as W, openBlock as S, createElementBlock as F, createVNode as u, unref as l, createSlots as Te, withCtx as m, createBlock as $e, Teleport as je, createElementVNode as I, createCommentVNode as M, createTextVNode as Z, toDisplayString as P, withModifiers as De, reactive as Me, onMounted as He, renderSlot as Ze, Transition as We, Fragment as lt, renderList as ot } from "vue";
|
|
2
|
+
import { useRouter as qe } from "vue-router";
|
|
3
|
+
import { BookIcon as ze, AddIcon as it, ServicesIcon as rt } from "@kong/icons";
|
|
4
|
+
import { createI18n as st, i18nTComponent as at } from "@kong-ui-public/i18n";
|
|
5
|
+
import { useAxios as Ge, useTableState as nt, useFetcher as ct, useDeleteUrlBuilder as dt, FetcherStatus as ut, EntityBaseTable as ft, EntityFilter as pt, PermissionsWrapper as Ue, TableTags as mt, EntityEmptyState as vt, EntityToggleModal as gt, EntityDeleteModal as yt, EntityTypes as _t, useErrors as Je, useValidators as Qe, EntityBaseFormType as Be, useGatewayFeatureSupported as Xe, EntityBaseForm as Ye, SupportedEntityType as Oe, EntityFormSection as Ke, useHelpers as et, ConfigurationSchemaSection as Ae, ConfigurationSchemaType as bt, EntityBaseConfigCard as ht } from "@kong-ui-public/entities-shared";
|
|
6
6
|
const wt = {
|
|
7
7
|
create: "New gateway service",
|
|
8
8
|
serverless_create: "Add a Service",
|
|
@@ -208,34 +208,34 @@ const wt = {
|
|
|
208
208
|
delete: "The gateway service could not be deleted at this time.",
|
|
209
209
|
copy: "Failed to copy to clipboard",
|
|
210
210
|
urlErrorMessage: "Error: invalid URL"
|
|
211
|
-
},
|
|
211
|
+
}, St = {
|
|
212
212
|
success: "Copied {val} to clipboard",
|
|
213
213
|
success_brief: "Successfully copied to clipboard"
|
|
214
|
-
}, St = {
|
|
215
|
-
gateway_services: "gateway services"
|
|
216
214
|
}, It = {
|
|
215
|
+
gateway_services: "gateway services"
|
|
216
|
+
}, Pt = {
|
|
217
217
|
actions: wt,
|
|
218
218
|
search: kt,
|
|
219
219
|
gateway_services: Vt,
|
|
220
220
|
errors: Ct,
|
|
221
|
-
copy:
|
|
222
|
-
glossary:
|
|
221
|
+
copy: St,
|
|
222
|
+
glossary: It
|
|
223
223
|
};
|
|
224
|
-
function
|
|
225
|
-
const
|
|
224
|
+
function Et() {
|
|
225
|
+
const n = st("en-us", Pt);
|
|
226
226
|
return {
|
|
227
|
-
i18n:
|
|
228
|
-
i18nT:
|
|
227
|
+
i18n: n,
|
|
228
|
+
i18nT: at(n)
|
|
229
229
|
// Translation component <i18n-t>
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function Ut() {
|
|
233
233
|
return {
|
|
234
|
-
getPortFromProtocol: (
|
|
235
|
-
const
|
|
236
|
-
if ((a || a === 0) && !
|
|
234
|
+
getPortFromProtocol: (X, _) => {
|
|
235
|
+
const v = [80, 443], a = Number(_);
|
|
236
|
+
if ((a || a === 0) && !v.includes(a))
|
|
237
237
|
return a;
|
|
238
|
-
switch (
|
|
238
|
+
switch (X) {
|
|
239
239
|
case "grpcs":
|
|
240
240
|
case "tls":
|
|
241
241
|
case "https":
|
|
@@ -251,59 +251,59 @@ function Ft() {
|
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
const { i18n: { t:
|
|
254
|
+
function $t() {
|
|
255
|
+
const { i18n: { t: n } } = se.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: (h) => {
|
|
258
|
+
if (!h || h.trim() === "") return n("gateway_services.form.errors.host.empty");
|
|
259
|
+
const L = /^(?!:\/\/)([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(h) || L.test(h) ? "" : n("gateway_services.form.errors.host.invalid");
|
|
261
261
|
},
|
|
262
|
-
validateProtocol: (
|
|
263
|
-
if (
|
|
264
|
-
}) === void 0 ?
|
|
265
|
-
validatePath: (
|
|
266
|
-
validatePort: (
|
|
267
|
-
if (
|
|
262
|
+
validateProtocol: (h, L) => !h || h.trim() === "" ? n("gateway_services.form.errors.protocol.empty") : (h = h.slice(0, -1), L.find((r) => {
|
|
263
|
+
if (r.value === h) return r;
|
|
264
|
+
}) === void 0 ? n("gateway_services.form.errors.protocol.invalid") : ""),
|
|
265
|
+
validatePath: (h) => !h || h === "" ? "" : h.startsWith("/") ? /[^A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]/.test(h) ? n("gateway_services.form.errors.path.invalid") : "" : n("gateway_services.form.errors.path.prefix"),
|
|
266
|
+
validatePort: (h) => {
|
|
267
|
+
if (h == null || h === "")
|
|
268
268
|
return "";
|
|
269
|
-
const
|
|
270
|
-
return isNaN(
|
|
269
|
+
const L = typeof h == "string" ? parseInt(h, 10) : h;
|
|
270
|
+
return isNaN(L) ? n("gateway_services.form.errors.port.type") : L < 0 || L > 65535 ? n("gateway_services.form.errors.port.invalid") : "";
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
|
-
const
|
|
275
|
-
useI18n:
|
|
276
|
-
usePortFromProtocol:
|
|
277
|
-
useUrlValidators:
|
|
278
|
-
},
|
|
274
|
+
const se = {
|
|
275
|
+
useI18n: Et,
|
|
276
|
+
usePortFromProtocol: Ut,
|
|
277
|
+
useUrlValidators: $t
|
|
278
|
+
}, xe = "/v2/control-planes/{controlPlaneId}/core-entities", Re = "/{workspace}", pe = {
|
|
279
279
|
list: {
|
|
280
280
|
konnect: {
|
|
281
|
-
all: `${
|
|
281
|
+
all: `${xe}/services`
|
|
282
282
|
},
|
|
283
283
|
kongManager: {
|
|
284
|
-
all: `${
|
|
284
|
+
all: `${Re}/services`
|
|
285
285
|
}
|
|
286
286
|
},
|
|
287
287
|
form: {
|
|
288
288
|
konnect: {
|
|
289
|
-
create: `${
|
|
290
|
-
validate: `${
|
|
291
|
-
edit: `${
|
|
289
|
+
create: `${xe}/services`,
|
|
290
|
+
validate: `${xe}/v1/schemas/json/service/validate`,
|
|
291
|
+
edit: `${xe}/services/{id}`
|
|
292
292
|
},
|
|
293
293
|
kongManager: {
|
|
294
|
-
create: `${
|
|
295
|
-
validate: `${
|
|
296
|
-
edit: `${
|
|
294
|
+
create: `${Re}/services`,
|
|
295
|
+
validate: `${Re}/schemas/services/validate`,
|
|
296
|
+
edit: `${Re}/services/{id}`
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
},
|
|
299
|
+
}, Ft = "#00abd2", At = "24px", xt = { class: "kong-ui-entities-gateway-services-list" }, Rt = { class: "button-row" }, Tt = { class: "empty-state-icon-gateway" }, Mt = { key: 1 }, Bt = /* @__PURE__ */ Le({
|
|
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. */
|
|
303
303
|
config: {
|
|
304
304
|
type: Object,
|
|
305
305
|
required: !0,
|
|
306
|
-
validator: (
|
|
306
|
+
validator: (n) => !(!n || !["konnect", "kongManager"].includes(n == null ? void 0 : n.app) || !n.createRoute || !n.getViewRoute || !n.getEditRoute || n.app === "kongManager" && !n.isExactMatch && !n.filterSchema)
|
|
307
307
|
},
|
|
308
308
|
// used to override the default identifier for the cache entry
|
|
309
309
|
cacheIdentifier: {
|
|
@@ -354,12 +354,12 @@ const Y = {
|
|
|
354
354
|
}
|
|
355
355
|
},
|
|
356
356
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success"],
|
|
357
|
-
setup(
|
|
358
|
-
var
|
|
359
|
-
const
|
|
357
|
+
setup(n, { emit: X }) {
|
|
358
|
+
var c;
|
|
359
|
+
const _ = X, v = n, { i18n: { t: a, formatUnixTimeStamp: h } } = se.useI18n(), L = qe(), { axiosInstance: Q } = Ge((c = v.config) == null ? void 0 : c.axiosRequestConfig), { hasRecords: r, handleStateChange: j } = nt(() => N.value), A = k(() => r.value && v.config.app === "konnect"), Se = k(() => !v.enableV2EmptyStates && v.config.app === "konnect"), be = k(() => v.config.app !== "kongManager" || !!v.config.disableSorting), Y = {
|
|
360
360
|
// the Name column is non-hidable
|
|
361
361
|
name: { label: a("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
362
|
-
...
|
|
362
|
+
...v.config.showControlPlaneColumn ? { control_plane: { label: a("gateway_services.list.table_headers.control_plane") } } : {},
|
|
363
363
|
protocol: { label: a("gateway_services.list.table_headers.protocol"), searchable: !0, sortable: !0 },
|
|
364
364
|
host: { label: a("gateway_services.list.table_headers.host"), searchable: !0, sortable: !0 },
|
|
365
365
|
port: { label: a("gateway_services.list.table_headers.port"), searchable: !0, sortable: !0 },
|
|
@@ -368,197 +368,197 @@ const Y = {
|
|
|
368
368
|
tags: { label: a("gateway_services.list.table_headers.tags"), sortable: !1 },
|
|
369
369
|
updated_at: { label: a("gateway_services.list.table_headers.updated_at"), sortable: !0 },
|
|
370
370
|
created_at: { label: a("gateway_services.list.table_headers.created_at"), sortable: !0 }
|
|
371
|
-
},
|
|
371
|
+
}, he = {
|
|
372
372
|
columnVisibility: {
|
|
373
373
|
created_at: !1
|
|
374
374
|
}
|
|
375
|
-
},
|
|
376
|
-
var
|
|
377
|
-
let
|
|
378
|
-
return
|
|
379
|
-
}),
|
|
380
|
-
const
|
|
381
|
-
if (
|
|
375
|
+
}, ae = Y, x = k(() => {
|
|
376
|
+
var p, C;
|
|
377
|
+
let g = `${v.config.apiBaseUrl}${pe.list[v.config.app].all}`;
|
|
378
|
+
return v.config.app === "konnect" ? g = g.replace(/{controlPlaneId}/gi, ((p = v.config) == null ? void 0 : p.controlPlaneId) || "") : v.config.app === "kongManager" && (g = g.replace(/\/{workspace}/gi, (C = v.config) != null && C.workspace ? `/${v.config.workspace}` : "")), g;
|
|
379
|
+
}), me = k(() => v.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${x.value}`) : new URL(x.value)), N = D(""), Ie = k(() => {
|
|
380
|
+
const g = v.config.app === "konnect" || v.config.isExactMatch;
|
|
381
|
+
if (g)
|
|
382
382
|
return {
|
|
383
|
-
isExactMatch:
|
|
384
|
-
placeholder: a(`search.placeholder.${
|
|
383
|
+
isExactMatch: g,
|
|
384
|
+
placeholder: a(`search.placeholder.${v.config.app}`)
|
|
385
385
|
};
|
|
386
|
-
const { name:
|
|
386
|
+
const { name: p, enabled: C, protocol: K, host: ue, port: G, path: fe } = Y;
|
|
387
387
|
return {
|
|
388
|
-
isExactMatch:
|
|
389
|
-
fields: { name:
|
|
390
|
-
schema:
|
|
388
|
+
isExactMatch: g,
|
|
389
|
+
fields: { name: p, enabled: C, protocol: K, host: ue, port: G, path: fe },
|
|
390
|
+
schema: v.config.filterSchema
|
|
391
391
|
};
|
|
392
392
|
}), {
|
|
393
|
-
fetcher:
|
|
394
|
-
fetcherState:
|
|
395
|
-
fetcherCacheKey:
|
|
396
|
-
} =
|
|
397
|
-
|
|
398
|
-
},
|
|
399
|
-
|
|
400
|
-
}, e =
|
|
401
|
-
ctaPath:
|
|
402
|
-
ctaText:
|
|
403
|
-
message: `${a("gateway_services.list.empty_state.description")}${
|
|
404
|
-
title:
|
|
405
|
-
})),
|
|
406
|
-
const
|
|
393
|
+
fetcher: o,
|
|
394
|
+
fetcherState: w,
|
|
395
|
+
fetcherCacheKey: ie
|
|
396
|
+
} = ct(k(() => ({ ...v.config, cacheIdentifier: v.cacheIdentifier })), x), ve = () => {
|
|
397
|
+
N.value = "";
|
|
398
|
+
}, we = () => {
|
|
399
|
+
ie.value++;
|
|
400
|
+
}, e = D(null), $ = k(() => ({
|
|
401
|
+
ctaPath: v.config.createRoute,
|
|
402
|
+
ctaText: R.value ? v.isServerless ? a("actions.serverless_create") : a("actions.create") : void 0,
|
|
403
|
+
message: `${a("gateway_services.list.empty_state.description")}${v.config.additionMessageForEmptyState ? ` ${v.config.additionMessageForEmptyState}` : ""}`,
|
|
404
|
+
title: R.value ? v.isServerless ? a("gateway_services.list.empty_state.serverless_title") : a("gateway_services.list.empty_state.title") : a("gateway_services.title")
|
|
405
|
+
})), ne = D(!1), q = D(null), re = k(() => {
|
|
406
|
+
const g = {
|
|
407
407
|
action: "disable",
|
|
408
408
|
id: "",
|
|
409
409
|
name: ""
|
|
410
410
|
};
|
|
411
|
-
if (
|
|
412
|
-
const { enabled:
|
|
413
|
-
|
|
411
|
+
if (q.value) {
|
|
412
|
+
const { enabled: p, id: C, name: K } = q.value;
|
|
413
|
+
g.action = p ? "disable" : "enable", g.id = C, g.name = K || C;
|
|
414
414
|
}
|
|
415
|
-
return
|
|
416
|
-
}),
|
|
417
|
-
|
|
418
|
-
},
|
|
419
|
-
|
|
420
|
-
},
|
|
421
|
-
var
|
|
422
|
-
if (!await ((
|
|
415
|
+
return g;
|
|
416
|
+
}), Pe = (g) => {
|
|
417
|
+
ne.value = !0, q.value = g;
|
|
418
|
+
}, oe = () => {
|
|
419
|
+
ne.value = !1, q.value = null;
|
|
420
|
+
}, ke = async () => {
|
|
421
|
+
var K, ue;
|
|
422
|
+
if (!await ((K = v.canEdit) == null ? void 0 : K.call(v, q.value)) || !q.value)
|
|
423
423
|
return;
|
|
424
|
-
const
|
|
424
|
+
const p = `${me.value.href}/${q.value.id}`, C = !q.value.enabled;
|
|
425
425
|
try {
|
|
426
|
-
const { data:
|
|
427
|
-
|
|
428
|
-
} catch (
|
|
429
|
-
|
|
426
|
+
const { data: G } = ((ue = v.config) == null ? void 0 : ue.app) === "konnect" ? await Q.put(p, { ...q.value, enabled: C }) : await Q.patch(p, { ...q.value, enabled: C });
|
|
427
|
+
_("toggle:success", G), q.value.enabled = C;
|
|
428
|
+
} catch (G) {
|
|
429
|
+
_("error", G);
|
|
430
430
|
}
|
|
431
|
-
},
|
|
432
|
-
|
|
433
|
-
},
|
|
434
|
-
const
|
|
435
|
-
if (!await
|
|
436
|
-
|
|
437
|
-
entity:
|
|
431
|
+
}, Ve = (g) => {
|
|
432
|
+
v.config.getControlPlaneRoute && L.push(v.config.getControlPlaneRoute(g));
|
|
433
|
+
}, ce = async (g, p) => {
|
|
434
|
+
const C = g.id;
|
|
435
|
+
if (!await p(C)) {
|
|
436
|
+
_("copy:error", {
|
|
437
|
+
entity: g,
|
|
438
438
|
field: "id",
|
|
439
439
|
message: a("errors.copy")
|
|
440
440
|
});
|
|
441
441
|
return;
|
|
442
442
|
}
|
|
443
|
-
|
|
444
|
-
entity:
|
|
443
|
+
_("copy:success", {
|
|
444
|
+
entity: g,
|
|
445
445
|
field: "id",
|
|
446
|
-
message: a("copy.success", { val:
|
|
446
|
+
message: a("copy.success", { val: C })
|
|
447
447
|
});
|
|
448
|
-
},
|
|
449
|
-
const
|
|
450
|
-
if (!await
|
|
451
|
-
|
|
452
|
-
entity:
|
|
448
|
+
}, ge = async (g, p) => {
|
|
449
|
+
const C = JSON.stringify(g);
|
|
450
|
+
if (!await p(C)) {
|
|
451
|
+
_("copy:error", {
|
|
452
|
+
entity: g,
|
|
453
453
|
message: a("errors.copy")
|
|
454
454
|
});
|
|
455
455
|
return;
|
|
456
456
|
}
|
|
457
|
-
|
|
458
|
-
entity:
|
|
457
|
+
_("copy:success", {
|
|
458
|
+
entity: g,
|
|
459
459
|
message: a("copy.success_brief")
|
|
460
460
|
});
|
|
461
|
-
},
|
|
462
|
-
var
|
|
463
|
-
await ((
|
|
464
|
-
},
|
|
461
|
+
}, ye = async (g) => {
|
|
462
|
+
var C;
|
|
463
|
+
await ((C = v.canRetrieve) == null ? void 0 : C.call(v, g)) && L.push(v.config.getViewRoute(g.id));
|
|
464
|
+
}, Ee = (g) => ({
|
|
465
465
|
label: a("actions.view"),
|
|
466
|
-
to:
|
|
467
|
-
}),
|
|
466
|
+
to: v.config.getViewRoute(g)
|
|
467
|
+
}), ee = (g) => ({
|
|
468
468
|
label: a("actions.edit"),
|
|
469
|
-
to:
|
|
470
|
-
}),
|
|
471
|
-
|
|
472
|
-
},
|
|
473
|
-
|
|
474
|
-
},
|
|
475
|
-
var
|
|
476
|
-
if ((
|
|
477
|
-
|
|
469
|
+
to: v.config.getEditRoute(g)
|
|
470
|
+
}), z = D(void 0), H = D(!1), te = D(!1), de = D(""), i = dt(v.config, x.value), f = (g) => {
|
|
471
|
+
z.value = g, H.value = !0, de.value = "";
|
|
472
|
+
}, V = () => {
|
|
473
|
+
H.value = !1, z.value = void 0;
|
|
474
|
+
}, J = async () => {
|
|
475
|
+
var g, p, C;
|
|
476
|
+
if ((g = z.value) != null && g.id) {
|
|
477
|
+
te.value = !0;
|
|
478
478
|
try {
|
|
479
|
-
await
|
|
480
|
-
} catch (
|
|
481
|
-
|
|
479
|
+
await Q.delete(i(z.value.id)), _("delete:success", z.value), V(), ie.value++;
|
|
480
|
+
} catch (K) {
|
|
481
|
+
de.value = ((C = (p = K.response) == null ? void 0 : p.data) == null ? void 0 : C.message) || K.message || a("errors.delete"), _("error", K);
|
|
482
482
|
} finally {
|
|
483
|
-
|
|
483
|
+
te.value = !1;
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
},
|
|
487
|
-
|
|
486
|
+
}, B = () => {
|
|
487
|
+
L.push(v.config.createRoute);
|
|
488
488
|
};
|
|
489
|
-
|
|
490
|
-
var
|
|
491
|
-
if (
|
|
489
|
+
Fe(w, (g) => {
|
|
490
|
+
var p, C, K;
|
|
491
|
+
if (g.status === ut.Error) {
|
|
492
492
|
e.value = {
|
|
493
493
|
title: a("errors.general")
|
|
494
|
-
}, (
|
|
494
|
+
}, (K = (C = (p = g.error) == null ? void 0 : p.response) == null ? void 0 : C.data) != null && K.message && (e.value.message = g.error.response.data.message), _("error", g.error);
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
497
497
|
e.value = null;
|
|
498
498
|
});
|
|
499
|
-
const
|
|
500
|
-
return
|
|
501
|
-
|
|
502
|
-
}), (
|
|
503
|
-
const
|
|
504
|
-
return
|
|
505
|
-
|
|
506
|
-
"cache-identifier":
|
|
507
|
-
"default-table-preferences":
|
|
508
|
-
"disable-sorting":
|
|
509
|
-
"empty-state-options":
|
|
499
|
+
const R = D(!1);
|
|
500
|
+
return tt(async () => {
|
|
501
|
+
R.value = await v.canCreate();
|
|
502
|
+
}), (g, p) => {
|
|
503
|
+
const C = W("KButton"), K = W("KBadge"), ue = W("KInputSwitch"), G = W("KDropdownItem"), fe = W("KClipboardProvider");
|
|
504
|
+
return S(), F("div", xt, [
|
|
505
|
+
u(l(ft), {
|
|
506
|
+
"cache-identifier": n.cacheIdentifier,
|
|
507
|
+
"default-table-preferences": he,
|
|
508
|
+
"disable-sorting": be.value,
|
|
509
|
+
"empty-state-options": $.value,
|
|
510
510
|
"enable-entity-actions": "",
|
|
511
511
|
"error-message": e.value,
|
|
512
|
-
fetcher: o
|
|
513
|
-
"fetcher-cache-key":
|
|
512
|
+
fetcher: l(o),
|
|
513
|
+
"fetcher-cache-key": l(ie),
|
|
514
514
|
"pagination-type": "offset",
|
|
515
515
|
"preferences-storage-key": "kong-ui-entities-gateway-services-list",
|
|
516
|
-
query:
|
|
517
|
-
"table-headers":
|
|
518
|
-
onClearSearchInput:
|
|
519
|
-
"onClick:row":
|
|
520
|
-
onSort:
|
|
521
|
-
onState:
|
|
522
|
-
},
|
|
523
|
-
"toolbar-filter":
|
|
524
|
-
|
|
525
|
-
modelValue:
|
|
526
|
-
"onUpdate:modelValue":
|
|
527
|
-
config:
|
|
516
|
+
query: N.value,
|
|
517
|
+
"table-headers": l(ae),
|
|
518
|
+
onClearSearchInput: ve,
|
|
519
|
+
"onClick:row": p[5] || (p[5] = (b) => ye(b)),
|
|
520
|
+
onSort: we,
|
|
521
|
+
onState: l(j)
|
|
522
|
+
}, Te({
|
|
523
|
+
"toolbar-filter": m(() => [
|
|
524
|
+
u(l(pt), {
|
|
525
|
+
modelValue: N.value,
|
|
526
|
+
"onUpdate:modelValue": p[0] || (p[0] = (b) => N.value = b),
|
|
527
|
+
config: Ie.value
|
|
528
528
|
}, null, 8, ["modelValue", "config"])
|
|
529
529
|
]),
|
|
530
|
-
"toolbar-button":
|
|
531
|
-
(
|
|
532
|
-
disabled: !
|
|
530
|
+
"toolbar-button": m(() => [
|
|
531
|
+
(S(), $e(je, {
|
|
532
|
+
disabled: !n.useActionOutside,
|
|
533
533
|
to: "#kong-ui-app-page-header-action-button"
|
|
534
534
|
}, [
|
|
535
535
|
I("div", Rt, [
|
|
536
|
-
|
|
536
|
+
A.value ? (S(), $e(C, {
|
|
537
537
|
key: 0,
|
|
538
538
|
appearance: "secondary",
|
|
539
539
|
class: "open-learning-hub",
|
|
540
540
|
"data-testid": "gateway-services-learn-more-button",
|
|
541
541
|
icon: "",
|
|
542
|
-
onClick:
|
|
542
|
+
onClick: p[1] || (p[1] = (b) => g.$emit("click:learn-more"))
|
|
543
543
|
}, {
|
|
544
|
-
default:
|
|
545
|
-
|
|
544
|
+
default: m(() => [
|
|
545
|
+
u(l(ze), { decorative: "" })
|
|
546
546
|
]),
|
|
547
547
|
_: 1
|
|
548
|
-
})) :
|
|
549
|
-
|
|
550
|
-
"auth-function": () =>
|
|
548
|
+
})) : M("", !0),
|
|
549
|
+
u(l(Ue), {
|
|
550
|
+
"auth-function": () => n.canCreate()
|
|
551
551
|
}, {
|
|
552
|
-
default:
|
|
553
|
-
|
|
552
|
+
default: m(() => [
|
|
553
|
+
u(C, {
|
|
554
554
|
appearance: "primary",
|
|
555
555
|
"data-testid": "toolbar-add-gateway-service",
|
|
556
|
-
size:
|
|
557
|
-
to:
|
|
556
|
+
size: n.useActionOutside ? "medium" : "large",
|
|
557
|
+
to: n.config.createRoute
|
|
558
558
|
}, {
|
|
559
|
-
default:
|
|
560
|
-
|
|
561
|
-
|
|
559
|
+
default: m(() => [
|
|
560
|
+
u(l(it)),
|
|
561
|
+
Z(" " + P(l(a)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
|
|
562
562
|
]),
|
|
563
563
|
_: 1
|
|
564
564
|
}, 8, ["size", "to"])
|
|
@@ -568,120 +568,120 @@ const Y = {
|
|
|
568
568
|
])
|
|
569
569
|
], 8, ["disabled"]))
|
|
570
570
|
]),
|
|
571
|
-
name:
|
|
572
|
-
I("b", null,
|
|
571
|
+
name: m(({ rowValue: b }) => [
|
|
572
|
+
I("b", null, P(b ?? "-"), 1)
|
|
573
573
|
]),
|
|
574
|
-
control_plane:
|
|
574
|
+
control_plane: m(({ row: b }) => {
|
|
575
575
|
var t;
|
|
576
576
|
return [
|
|
577
|
-
(t =
|
|
577
|
+
(t = b.x_meta) != null && t.cluster_id ? (S(), $e(K, {
|
|
578
578
|
key: 0,
|
|
579
|
-
tooltip:
|
|
579
|
+
tooltip: b.x_meta.cluster_id,
|
|
580
580
|
"truncation-tooltip": "",
|
|
581
|
-
onClick:
|
|
581
|
+
onClick: De((s) => Ve(b.x_meta.cluster_id), ["stop"])
|
|
582
582
|
}, {
|
|
583
|
-
default:
|
|
584
|
-
|
|
583
|
+
default: m(() => [
|
|
584
|
+
Z(P(b.x_meta.cluster_id), 1)
|
|
585
585
|
]),
|
|
586
586
|
_: 2
|
|
587
|
-
}, 1032, ["tooltip", "onClick"])) : (
|
|
587
|
+
}, 1032, ["tooltip", "onClick"])) : (S(), F("b", Mt, "-"))
|
|
588
588
|
];
|
|
589
589
|
}),
|
|
590
|
-
enabled:
|
|
591
|
-
|
|
592
|
-
"auth-function": () =>
|
|
590
|
+
enabled: m(({ row: b }) => [
|
|
591
|
+
u(l(Ue), {
|
|
592
|
+
"auth-function": () => n.canEdit(b),
|
|
593
593
|
"force-show": ""
|
|
594
594
|
}, {
|
|
595
|
-
default:
|
|
595
|
+
default: m(({ isAllowed: t }) => [
|
|
596
596
|
I("div", {
|
|
597
|
-
onClick:
|
|
597
|
+
onClick: p[4] || (p[4] = De(() => {
|
|
598
598
|
}, ["stop"]))
|
|
599
599
|
}, [
|
|
600
|
-
|
|
601
|
-
modelValue:
|
|
602
|
-
"onUpdate:modelValue": (
|
|
603
|
-
"data-testid": `row-${
|
|
600
|
+
u(ue, {
|
|
601
|
+
modelValue: b.enabled,
|
|
602
|
+
"onUpdate:modelValue": (s) => b.enabled = s,
|
|
603
|
+
"data-testid": `row-${b.id}-toggle-input`,
|
|
604
604
|
disabled: !t,
|
|
605
|
-
onClick:
|
|
605
|
+
onClick: De((s) => Pe(b), ["prevent"])
|
|
606
606
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "disabled", "onClick"])
|
|
607
607
|
])
|
|
608
608
|
]),
|
|
609
609
|
_: 2
|
|
610
610
|
}, 1032, ["auth-function"])
|
|
611
611
|
]),
|
|
612
|
-
tags:
|
|
613
|
-
|
|
612
|
+
tags: m(({ rowValue: b }) => [
|
|
613
|
+
u(l(mt), { tags: b }, null, 8, ["tags"])
|
|
614
614
|
]),
|
|
615
|
-
created_at:
|
|
616
|
-
|
|
615
|
+
created_at: m(({ rowValue: b }) => [
|
|
616
|
+
Z(P(l(h)(b)), 1)
|
|
617
617
|
]),
|
|
618
|
-
updated_at:
|
|
619
|
-
|
|
618
|
+
updated_at: m(({ row: b, rowValue: t }) => [
|
|
619
|
+
Z(P(l(h)(t ?? b.created_at)), 1)
|
|
620
620
|
]),
|
|
621
|
-
actions:
|
|
622
|
-
|
|
623
|
-
default:
|
|
624
|
-
|
|
621
|
+
actions: m(({ row: b }) => [
|
|
622
|
+
u(fe, null, {
|
|
623
|
+
default: m(({ copyToClipboard: t }) => [
|
|
624
|
+
u(G, {
|
|
625
625
|
"data-testid": "action-entity-copy-id",
|
|
626
|
-
onClick: (
|
|
626
|
+
onClick: (s) => ce(b, t)
|
|
627
627
|
}, {
|
|
628
|
-
default:
|
|
629
|
-
|
|
628
|
+
default: m(() => [
|
|
629
|
+
Z(P(l(a)("actions.copy_id")), 1)
|
|
630
630
|
]),
|
|
631
631
|
_: 2
|
|
632
632
|
}, 1032, ["onClick"])
|
|
633
633
|
]),
|
|
634
634
|
_: 2
|
|
635
635
|
}, 1024),
|
|
636
|
-
|
|
637
|
-
default:
|
|
638
|
-
|
|
636
|
+
u(fe, null, {
|
|
637
|
+
default: m(({ copyToClipboard: t }) => [
|
|
638
|
+
u(G, {
|
|
639
639
|
"data-testid": "action-entity-copy-json",
|
|
640
|
-
onClick: (
|
|
640
|
+
onClick: (s) => ge(b, t)
|
|
641
641
|
}, {
|
|
642
|
-
default:
|
|
643
|
-
|
|
642
|
+
default: m(() => [
|
|
643
|
+
Z(P(l(a)("actions.copy_json")), 1)
|
|
644
644
|
]),
|
|
645
645
|
_: 2
|
|
646
646
|
}, 1032, ["onClick"])
|
|
647
647
|
]),
|
|
648
648
|
_: 2
|
|
649
649
|
}, 1024),
|
|
650
|
-
|
|
651
|
-
"auth-function": () =>
|
|
650
|
+
u(l(Ue), {
|
|
651
|
+
"auth-function": () => n.canRetrieve(b)
|
|
652
652
|
}, {
|
|
653
|
-
default:
|
|
654
|
-
|
|
653
|
+
default: m(() => [
|
|
654
|
+
u(G, {
|
|
655
655
|
"data-testid": "action-entity-view",
|
|
656
656
|
"has-divider": "",
|
|
657
|
-
item:
|
|
657
|
+
item: Ee(b.id)
|
|
658
658
|
}, null, 8, ["item"])
|
|
659
659
|
]),
|
|
660
660
|
_: 2
|
|
661
661
|
}, 1032, ["auth-function"]),
|
|
662
|
-
|
|
663
|
-
"auth-function": () =>
|
|
662
|
+
u(l(Ue), {
|
|
663
|
+
"auth-function": () => n.canEdit(b)
|
|
664
664
|
}, {
|
|
665
|
-
default:
|
|
666
|
-
|
|
665
|
+
default: m(() => [
|
|
666
|
+
u(G, {
|
|
667
667
|
"data-testid": "action-entity-edit",
|
|
668
|
-
item:
|
|
668
|
+
item: ee(b.id)
|
|
669
669
|
}, null, 8, ["item"])
|
|
670
670
|
]),
|
|
671
671
|
_: 2
|
|
672
672
|
}, 1032, ["auth-function"]),
|
|
673
|
-
|
|
674
|
-
"auth-function": () =>
|
|
673
|
+
u(l(Ue), {
|
|
674
|
+
"auth-function": () => n.canDelete(b)
|
|
675
675
|
}, {
|
|
676
|
-
default:
|
|
677
|
-
|
|
676
|
+
default: m(() => [
|
|
677
|
+
u(G, {
|
|
678
678
|
danger: "",
|
|
679
679
|
"data-testid": "action-entity-delete",
|
|
680
680
|
"has-divider": "",
|
|
681
|
-
onClick: (t) =>
|
|
681
|
+
onClick: (t) => f(b)
|
|
682
682
|
}, {
|
|
683
|
-
default:
|
|
684
|
-
|
|
683
|
+
default: m(() => [
|
|
684
|
+
Z(P(l(a)("actions.delete.menu_label")), 1)
|
|
685
685
|
]),
|
|
686
686
|
_: 2
|
|
687
687
|
}, 1032, ["onClick"])
|
|
@@ -691,22 +691,22 @@ const Y = {
|
|
|
691
691
|
]),
|
|
692
692
|
_: 2
|
|
693
693
|
}, [
|
|
694
|
-
!
|
|
694
|
+
!l(r) && Se.value ? {
|
|
695
695
|
name: "outside-actions",
|
|
696
|
-
fn:
|
|
697
|
-
(
|
|
698
|
-
disabled: !
|
|
696
|
+
fn: m(() => [
|
|
697
|
+
(S(), $e(je, {
|
|
698
|
+
disabled: !n.useActionOutside,
|
|
699
699
|
to: "#kong-ui-app-page-header-action-button"
|
|
700
700
|
}, [
|
|
701
|
-
|
|
701
|
+
u(C, {
|
|
702
702
|
appearance: "secondary",
|
|
703
703
|
class: "open-learning-hub",
|
|
704
704
|
"data-testid": "gateway-services-more-button",
|
|
705
705
|
icon: "",
|
|
706
|
-
onClick:
|
|
706
|
+
onClick: p[2] || (p[2] = (b) => g.$emit("click:learn-more"))
|
|
707
707
|
}, {
|
|
708
|
-
default:
|
|
709
|
-
|
|
708
|
+
default: m(() => [
|
|
709
|
+
u(l(ze), { decorative: "" })
|
|
710
710
|
]),
|
|
711
711
|
_: 1
|
|
712
712
|
})
|
|
@@ -714,36 +714,36 @@ const Y = {
|
|
|
714
714
|
]),
|
|
715
715
|
key: "0"
|
|
716
716
|
} : void 0,
|
|
717
|
-
!
|
|
717
|
+
!N.value && n.enableV2EmptyStates && n.config.app === "konnect" ? {
|
|
718
718
|
name: "empty-state",
|
|
719
|
-
fn:
|
|
720
|
-
var
|
|
719
|
+
fn: m(() => {
|
|
720
|
+
var b;
|
|
721
721
|
return [
|
|
722
|
-
|
|
723
|
-
"action-button-text":
|
|
722
|
+
u(l(vt), {
|
|
723
|
+
"action-button-text": l(a)("gateway_services.empty_state_v2.create"),
|
|
724
724
|
appearance: "secondary",
|
|
725
|
-
"can-create": () =>
|
|
725
|
+
"can-create": () => n.canCreate(),
|
|
726
726
|
"data-testid": "gateway-services-entity-empty-state",
|
|
727
|
-
description:
|
|
728
|
-
"learn-more":
|
|
729
|
-
title:
|
|
730
|
-
"onClick:create":
|
|
731
|
-
"onClick:learnMore":
|
|
732
|
-
},
|
|
733
|
-
image:
|
|
734
|
-
I("div",
|
|
735
|
-
|
|
736
|
-
color:
|
|
737
|
-
size:
|
|
727
|
+
description: l(a)("gateway_services.empty_state_v2.description"),
|
|
728
|
+
"learn-more": n.config.app === "konnect",
|
|
729
|
+
title: l(a)("gateway_services.empty_state_v2.title"),
|
|
730
|
+
"onClick:create": B,
|
|
731
|
+
"onClick:learnMore": p[3] || (p[3] = (t) => g.$emit("click:learn-more"))
|
|
732
|
+
}, Te({
|
|
733
|
+
image: m(() => [
|
|
734
|
+
I("div", Tt, [
|
|
735
|
+
u(l(rt), {
|
|
736
|
+
color: l(Ft),
|
|
737
|
+
size: l(At)
|
|
738
738
|
}, null, 8, ["color", "size"])
|
|
739
739
|
])
|
|
740
740
|
]),
|
|
741
741
|
_: 2
|
|
742
742
|
}, [
|
|
743
|
-
(
|
|
743
|
+
(b = n.config) != null && b.isControlPlaneGroup ? {
|
|
744
744
|
name: "message",
|
|
745
|
-
fn:
|
|
746
|
-
|
|
745
|
+
fn: m(() => [
|
|
746
|
+
Z(P(l(a)("gateway_services.empty_state_v2.group")), 1)
|
|
747
747
|
]),
|
|
748
748
|
key: "0"
|
|
749
749
|
} : void 0
|
|
@@ -753,43 +753,678 @@ const Y = {
|
|
|
753
753
|
key: "1"
|
|
754
754
|
} : void 0
|
|
755
755
|
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
|
|
756
|
-
|
|
757
|
-
action:
|
|
758
|
-
"entity-id":
|
|
759
|
-
"entity-name":
|
|
760
|
-
"entity-type":
|
|
761
|
-
"on-confirm":
|
|
762
|
-
visible:
|
|
763
|
-
onCancel:
|
|
764
|
-
onProceed:
|
|
756
|
+
u(l(gt), {
|
|
757
|
+
action: re.value.action,
|
|
758
|
+
"entity-id": re.value.id,
|
|
759
|
+
"entity-name": re.value.name,
|
|
760
|
+
"entity-type": l(a)("glossary.gateway_services"),
|
|
761
|
+
"on-confirm": ke,
|
|
762
|
+
visible: ne.value,
|
|
763
|
+
onCancel: oe,
|
|
764
|
+
onProceed: oe
|
|
765
765
|
}, null, 8, ["action", "entity-id", "entity-name", "entity-type", "visible"]),
|
|
766
|
-
|
|
767
|
-
"action-pending":
|
|
768
|
-
description:
|
|
769
|
-
"entity-name":
|
|
770
|
-
"entity-type":
|
|
771
|
-
error:
|
|
772
|
-
title:
|
|
773
|
-
visible:
|
|
774
|
-
onCancel:
|
|
775
|
-
onProceed:
|
|
766
|
+
u(l(yt), {
|
|
767
|
+
"action-pending": te.value,
|
|
768
|
+
description: l(a)("actions.delete.description"),
|
|
769
|
+
"entity-name": z.value && (z.value.name || z.value.id),
|
|
770
|
+
"entity-type": l(_t).GatewayService,
|
|
771
|
+
error: de.value,
|
|
772
|
+
title: l(a)("actions.delete.title"),
|
|
773
|
+
visible: H.value,
|
|
774
|
+
onCancel: V,
|
|
775
|
+
onProceed: J
|
|
776
776
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
777
777
|
]);
|
|
778
778
|
};
|
|
779
779
|
}
|
|
780
|
-
}),
|
|
781
|
-
const
|
|
782
|
-
for (const [
|
|
783
|
-
|
|
784
|
-
return
|
|
785
|
-
},
|
|
780
|
+
}), Ne = (n, X) => {
|
|
781
|
+
const _ = n.__vccOpts || n;
|
|
782
|
+
for (const [v, a] of X)
|
|
783
|
+
_[v] = a;
|
|
784
|
+
return _;
|
|
785
|
+
}, Fl = /* @__PURE__ */ Ne(Bt, [["__scopeId", "data-v-210f19c5"]]), Kt = { class: "kong-ui-entities-gateway-service-form" }, Lt = { key: 0 }, Dt = { class: "gateway-service-form-traffic-label" }, Wt = { class: "gateway-service-form-margin-bottom" }, qt = {
|
|
786
|
+
key: 0,
|
|
787
|
+
class: "gateway-service-form-group-fields"
|
|
788
|
+
}, Gt = {
|
|
789
|
+
key: 1,
|
|
790
|
+
class: "gateway-service-form-group-fields"
|
|
791
|
+
}, Ot = { key: 0 }, Nt = { class: "gateway-service-form-margin-top" }, jt = { class: "gateway-service-form-margin-bottom" }, zt = { class: "gateway-service-form-margin-bottom" }, Ht = { class: "gateway-service-form-margin-bottom" }, Zt = { class: "gateway-service-form-margin-bottom" }, Jt = {
|
|
792
|
+
key: 0,
|
|
793
|
+
class: "gateway-service-form-margin-bottom"
|
|
794
|
+
}, Qt = {
|
|
795
|
+
key: 1,
|
|
796
|
+
class: "gateway-service-form-margin-bottom"
|
|
797
|
+
}, Xt = {
|
|
798
|
+
key: 2,
|
|
799
|
+
class: "gateway-service-form-margin-bottom"
|
|
800
|
+
}, Yt = {
|
|
801
|
+
key: 0,
|
|
802
|
+
class: "checkbox-aligned-radio"
|
|
803
|
+
}, el = {
|
|
804
|
+
key: 1,
|
|
805
|
+
class: "checkbox-aligned-radio"
|
|
806
|
+
}, tl = /* @__PURE__ */ Le({
|
|
807
|
+
__name: "LegacyGatewayServiceForm",
|
|
808
|
+
props: {
|
|
809
|
+
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
810
|
+
config: {
|
|
811
|
+
type: Object,
|
|
812
|
+
required: !0,
|
|
813
|
+
validator: (n) => !(!n || !["konnect", "kongManager"].includes(n == null ? void 0 : n.app) || n.app === "konnect" && !n.controlPlaneId || n.app === "kongManager" && typeof n.workspace != "string" || !n.cancelRoute)
|
|
814
|
+
},
|
|
815
|
+
/** If a valid Gateway Service ID is provided, it will put the form in Edit mode instead of Create */
|
|
816
|
+
gatewayServiceId: {
|
|
817
|
+
type: String,
|
|
818
|
+
required: !1,
|
|
819
|
+
default: ""
|
|
820
|
+
},
|
|
821
|
+
/** Whether show or hide EntityFormSection info column */
|
|
822
|
+
hideSectionsInfo: {
|
|
823
|
+
type: Boolean,
|
|
824
|
+
required: !1,
|
|
825
|
+
default: !1
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated"],
|
|
829
|
+
setup(n, { expose: X, emit: _ }) {
|
|
830
|
+
var de;
|
|
831
|
+
const v = _, a = n, h = D(!0), L = qe(), { i18nT: Q, i18n: { t: r } } = se.useI18n(), { getMessageFromError: j } = Je(), { axiosInstance: A } = Ge((de = a.config) == null ? void 0 : de.axiosRequestConfig), Se = Qe(), be = k(() => pe.form[a.config.app].edit), Y = k(() => a.gatewayServiceId ? Be.Edit : Be.Create), he = D(!1), ae = k(() => !!a.gatewayServiceId), x = D(ae.value ? "protocol" : "url"), me = se.usePortFromProtocol(), N = D(""), Ie = k(() => !!N.value), o = Me({
|
|
832
|
+
fields: {
|
|
833
|
+
name: "",
|
|
834
|
+
protocol: "http",
|
|
835
|
+
host: "",
|
|
836
|
+
path: "",
|
|
837
|
+
port: 80,
|
|
838
|
+
url: "",
|
|
839
|
+
retries: 5,
|
|
840
|
+
connect_timeout: 6e4,
|
|
841
|
+
write_timeout: 6e4,
|
|
842
|
+
read_timeout: 6e4,
|
|
843
|
+
client_certificate: "",
|
|
844
|
+
ca_certificates: "",
|
|
845
|
+
tls_verify_enabled: !1,
|
|
846
|
+
tls_verify_value: !1,
|
|
847
|
+
tags: "",
|
|
848
|
+
enabled: !0
|
|
849
|
+
},
|
|
850
|
+
isReadonly: !1,
|
|
851
|
+
errorMessage: ""
|
|
852
|
+
}), w = Me({
|
|
853
|
+
name: "",
|
|
854
|
+
protocol: "http",
|
|
855
|
+
host: "",
|
|
856
|
+
path: "",
|
|
857
|
+
port: 80,
|
|
858
|
+
url: "",
|
|
859
|
+
retries: 5,
|
|
860
|
+
connect_timeout: 6e4,
|
|
861
|
+
write_timeout: 6e4,
|
|
862
|
+
read_timeout: 6e4,
|
|
863
|
+
client_certificate: "",
|
|
864
|
+
ca_certificates: "",
|
|
865
|
+
tls_verify_enabled: !1,
|
|
866
|
+
tls_verify_value: !1,
|
|
867
|
+
tags: "",
|
|
868
|
+
enabled: !0
|
|
869
|
+
}), ie = a.config.app === "konnect" || Xe({
|
|
870
|
+
gatewayInfo: a.config.gatewayInfo,
|
|
871
|
+
// 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
|
|
872
|
+
supportedRange: {
|
|
873
|
+
enterprise: ["3.0"]
|
|
874
|
+
}
|
|
875
|
+
}), ve = [
|
|
876
|
+
{
|
|
877
|
+
label: r("gateway_services.form.fields.protocol.options.http"),
|
|
878
|
+
value: "http",
|
|
879
|
+
group: "http"
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
label: r("gateway_services.form.fields.protocol.options.https"),
|
|
883
|
+
value: "https",
|
|
884
|
+
group: "http"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
label: r("gateway_services.form.fields.protocol.options.tcp"),
|
|
888
|
+
value: "tcp",
|
|
889
|
+
group: "tcp"
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
label: r("gateway_services.form.fields.protocol.options.tls"),
|
|
893
|
+
value: "tls",
|
|
894
|
+
group: "tcp"
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
label: r("gateway_services.form.fields.protocol.options.tls_passthrough"),
|
|
898
|
+
value: "tls_passthrough",
|
|
899
|
+
group: "tcp"
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
label: r("gateway_services.form.fields.protocol.options.grpc"),
|
|
903
|
+
value: "grpc",
|
|
904
|
+
group: "grpc"
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
label: r("gateway_services.form.fields.protocol.options.grpcs"),
|
|
908
|
+
value: "grpcs",
|
|
909
|
+
group: "grpc"
|
|
910
|
+
},
|
|
911
|
+
...ie ? [
|
|
912
|
+
{
|
|
913
|
+
label: r("gateway_services.form.fields.protocol.options.ws"),
|
|
914
|
+
value: "ws",
|
|
915
|
+
group: "websocket"
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
label: r("gateway_services.form.fields.protocol.options.wss"),
|
|
919
|
+
value: "wss",
|
|
920
|
+
group: "websocket"
|
|
921
|
+
}
|
|
922
|
+
] : [],
|
|
923
|
+
{
|
|
924
|
+
label: r("gateway_services.form.fields.protocol.options.udp"),
|
|
925
|
+
value: "udp",
|
|
926
|
+
group: "udp"
|
|
927
|
+
}
|
|
928
|
+
], we = { url: "url", protocol: "protocol" }, e = (i, f) => {
|
|
929
|
+
f.value;
|
|
930
|
+
}, $ = (i) => i ? parseFloat(i) : 0, ne = () => {
|
|
931
|
+
h.value = !0, o.errorMessage = "", o.fields.host = w.host, o.fields.path = w.path, o.fields.port = w.port, o.fields.protocol = w.protocol, o.fields.url = w.url, o.fields.retries = w.retries, o.fields.connect_timeout = w.connect_timeout, o.fields.write_timeout = w.write_timeout, o.fields.read_timeout = w.read_timeout, o.fields.client_certificate = w.client_certificate, o.fields.ca_certificates = w.ca_certificates, o.fields.tls_verify_enabled = w.tls_verify_enabled, o.fields.tls_verify_value = w.tls_verify_value, o.fields.enabled = w.enabled;
|
|
932
|
+
}, q = () => {
|
|
933
|
+
if (o.fields.url && x.value === "url")
|
|
934
|
+
try {
|
|
935
|
+
const i = new URL(o.fields.url);
|
|
936
|
+
o.errorMessage = "", o.fields.protocol = i.protocol.slice(0, -1), o.fields.host = i.hostname, o.fields.path = i.pathname;
|
|
937
|
+
const f = Number(i.port);
|
|
938
|
+
he.value = !!f, o.fields.port = f || me.getPortFromProtocol(o.fields.protocol), o.errorMessage = "", v("url-valid:success");
|
|
939
|
+
} catch (i) {
|
|
940
|
+
o.errorMessage = r("errors.urlErrorMessage"), v("url-valid:error", j(i));
|
|
941
|
+
}
|
|
942
|
+
else
|
|
943
|
+
v("url-valid:success"), o.errorMessage = "";
|
|
944
|
+
}, re = k(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(o.fields.protocol)), Pe = k(() => {
|
|
945
|
+
if (x.value === "url")
|
|
946
|
+
return !0;
|
|
947
|
+
const i = ["https", "wss", "tls"].includes(o.fields.protocol);
|
|
948
|
+
return x.value === "protocol" && i;
|
|
949
|
+
}), oe = k(() => {
|
|
950
|
+
if (x.value === "url")
|
|
951
|
+
return !0;
|
|
952
|
+
const i = ["https", "tls"].includes(o.fields.protocol);
|
|
953
|
+
return x.value === "protocol" && i;
|
|
954
|
+
}), ke = k(() => {
|
|
955
|
+
if (x.value === "url")
|
|
956
|
+
return !0;
|
|
957
|
+
const i = ["https", "wss", "tls"].includes(o.fields.protocol);
|
|
958
|
+
return x.value === "protocol" && i;
|
|
959
|
+
}), Ve = (i) => {
|
|
960
|
+
N.value = Se.utf8Name(i);
|
|
961
|
+
}, ce = k(() => ae.value && JSON.stringify(o.fields) !== JSON.stringify(w) || x.value === "url" && !!o.fields.url || x.value === "protocol" && !!o.fields.host), ge = (i) => {
|
|
962
|
+
var f, V, J;
|
|
963
|
+
o.fields.name = (i == null ? void 0 : i.name) || "", o.fields.tags = ((f = i == null ? void 0 : i.tags) == null ? void 0 : f.join(", ")) || "", o.fields.protocol = (i == null ? void 0 : i.protocol) || "http", o.fields.path = (i == null ? void 0 : i.path) || "", o.fields.read_timeout = i != null && i.read_timeout || (i == null ? void 0 : i.read_timeout) === 0 ? i == null ? void 0 : i.read_timeout : 6e4, o.fields.retries = i != null && i.retries || (i == null ? void 0 : i.retries) === 0 ? i == null ? void 0 : i.retries : 5, o.fields.host = (i == null ? void 0 : i.host) || "", o.fields.connect_timeout = i != null && i.connect_timeout || (i == null ? void 0 : i.connect_timeout) === 0 ? i == null ? void 0 : i.connect_timeout : 6e4, o.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, o.fields.tls_verify_value = i != null && i.tls_verify ? i == null ? void 0 : i.tls_verify : !1, o.fields.ca_certificates = ((V = i == null ? void 0 : i.ca_certificates) == null ? void 0 : V.join(",")) || "", o.fields.client_certificate = ((J = i == null ? void 0 : i.client_certificate) == null ? void 0 : J.id) || "", o.fields.write_timeout = i != null && i.write_timeout || (i == null ? void 0 : i.write_timeout) === 0 ? i == null ? void 0 : i.write_timeout : 6e4, o.fields.port = i != null && i.port || (i == null ? void 0 : i.port) === 0 ? i == null ? void 0 : i.port : 80, o.fields.enabled = (i == null ? void 0 : i.enabled) ?? !0, Object.assign(w, o.fields);
|
|
964
|
+
}, ye = () => {
|
|
965
|
+
L.push(a.config.cancelRoute);
|
|
966
|
+
}, Ee = k(() => {
|
|
967
|
+
var f, V;
|
|
968
|
+
let i = `${a.config.apiBaseUrl}${pe.form[a.config.app].validate}`;
|
|
969
|
+
return a.config.app === "konnect" ? i = i.replace(/{controlPlaneId}/gi, ((f = a.config) == null ? void 0 : f.controlPlaneId) || "") : a.config.app === "kongManager" && (i = i.replace(/\/{workspace}/gi, (V = a.config) != null && V.workspace ? `/${a.config.workspace}` : "")), i = i.replace(/{id}/gi, a.gatewayServiceId), i;
|
|
970
|
+
}), ee = k(() => {
|
|
971
|
+
var f, V;
|
|
972
|
+
let i = `${a.config.apiBaseUrl}${pe.form[a.config.app][Y.value]}`;
|
|
973
|
+
return a.config.app === "konnect" ? i = i.replace(/{controlPlaneId}/gi, ((f = a.config) == null ? void 0 : f.controlPlaneId) || "") : a.config.app === "kongManager" && (i = i.replace(/\/{workspace}/gi, (V = a.config) != null && V.workspace ? `/${a.config.workspace}` : "")), i = i.replace(/{id}/gi, a.gatewayServiceId), i;
|
|
974
|
+
}), z = (i) => {
|
|
975
|
+
let f = "";
|
|
976
|
+
i.url && (f = new URL(i.url).protocol), (["https", "wss", "tls"].includes(i.protocol) || ["https", "wss", "tls"].includes(f)) && (i.tls_verify = i.tls_verify_enabled ? i.tls_verify_value : null), delete i.tls_verify_enabled, delete i.tls_verify_value;
|
|
977
|
+
}, H = k(() => {
|
|
978
|
+
var f, V, J, B;
|
|
979
|
+
const i = {
|
|
980
|
+
name: o.fields.name || null,
|
|
981
|
+
tags: o.fields.tags ? (J = (V = (f = o.fields.tags) == null ? void 0 : f.split(",")) == null ? void 0 : V.map((R) => String(R || "").trim())) == null ? void 0 : J.filter((R) => R !== "") : null,
|
|
982
|
+
protocol: o.fields.protocol,
|
|
983
|
+
path: o.fields.path || null,
|
|
984
|
+
read_timeout: o.fields.read_timeout,
|
|
985
|
+
retries: o.fields.retries,
|
|
986
|
+
host: o.fields.host,
|
|
987
|
+
connect_timeout: o.fields.connect_timeout,
|
|
988
|
+
tls_verify_value: o.fields.tls_verify_value,
|
|
989
|
+
tls_verify_enabled: o.fields.tls_verify_enabled,
|
|
990
|
+
ca_certificates: o.fields.ca_certificates ? (B = o.fields.ca_certificates) == null ? void 0 : B.split(",").filter((R) => R !== "") : null,
|
|
991
|
+
client_certificate: o.fields.client_certificate ? { id: o.fields.client_certificate } : null,
|
|
992
|
+
write_timeout: o.fields.write_timeout,
|
|
993
|
+
port: o.fields.port,
|
|
994
|
+
url: o.fields.url,
|
|
995
|
+
enabled: o.fields.enabled
|
|
996
|
+
};
|
|
997
|
+
return o.fields.client_certificate && ["https", "wss", "tls"].includes(o.fields.protocol) && (i.client_certificate = { id: o.fields.client_certificate }), o.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(o.fields.protocol) && (i.tls_verify = o.fields.tls_verify_value), re.value || (i.path = null), Y.value === "create" ? x.value === "url" ? (delete i.protocol, delete i.host, delete i.path, a.config.app === "konnect" && delete i.port) : delete i.url : Y.value === "edit" && delete i.url, i;
|
|
998
|
+
}), te = async () => {
|
|
999
|
+
var i, f, V, J;
|
|
1000
|
+
try {
|
|
1001
|
+
o.isReadonly = !0, q();
|
|
1002
|
+
const B = H.value;
|
|
1003
|
+
z(B);
|
|
1004
|
+
let R;
|
|
1005
|
+
if (await A.post(Ee.value, B), Y.value === "create" ? R = await A.post(ee.value, B) : Y.value === "edit" && (R = ((i = a.config) == null ? void 0 : i.app) === "konnect" ? await A.put(ee.value, B) : await A.patch(ee.value, B)), R) {
|
|
1006
|
+
const { data: c } = R;
|
|
1007
|
+
o.fields.name = (c == null ? void 0 : c.name) || "", o.fields.port = c.port || me.getPortFromProtocol(c.protocol), o.fields.protocol = (c == null ? void 0 : c.protocol) || "http", o.fields.host = (c == null ? void 0 : c.host) || "", o.fields.path = (c == null ? void 0 : c.path) || "", o.fields.url = (c == null ? void 0 : c.url) || "", o.fields.retries = c != null && c.retries || (c == null ? void 0 : c.retries) === 0 ? c == null ? void 0 : c.retries : 5, o.fields.connect_timeout = c != null && c.connect_timeout || (c == null ? void 0 : c.connect_timeout) === 0 ? c == null ? void 0 : c.connect_timeout : 6e4, o.fields.write_timeout = c != null && c.write_timeout || (c == null ? void 0 : c.write_timeout) === 0 ? c == null ? void 0 : c.write_timeout : 6e4, o.fields.read_timeout = c != null && c.read_timeout || (c == null ? void 0 : c.read_timeout) === 0 ? c == null ? void 0 : c.read_timeout : 6e4, o.fields.client_certificate = ((f = c == null ? void 0 : c.client_certificate) == null ? void 0 : f.id) || "", o.fields.ca_certificates = (V = c == null ? void 0 : c.ca_certificates) != null && V.length ? c == null ? void 0 : c.ca_certificates.join(",") : "", o.fields.tls_verify_enabled = (c == null ? void 0 : c.tls_verify) !== "" && (c == null ? void 0 : c.tls_verify) !== null && (c == null ? void 0 : c.tls_verify) !== void 0, o.fields.tls_verify_value = o.fields.tls_verify_enabled && (c == null ? void 0 : c.tls_verify), o.fields.tags = (J = c == null ? void 0 : c.tags) != null && J.length ? c.tags.join(", ") : "", o.fields.enabled = (c == null ? void 0 : c.enabled) ?? !0, Object.assign(w, o.fields), v("update", R == null ? void 0 : R.data);
|
|
1008
|
+
}
|
|
1009
|
+
return R;
|
|
1010
|
+
} catch (B) {
|
|
1011
|
+
o.errorMessage = j(B), v("error", B);
|
|
1012
|
+
} finally {
|
|
1013
|
+
o.isReadonly = !1;
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
return Fe(() => a.gatewayServiceId, () => {
|
|
1017
|
+
Object.assign(o.fields, w);
|
|
1018
|
+
}), Fe(o.fields, (i) => {
|
|
1019
|
+
o.fields.port = me.getPortFromProtocol(i.protocol, String(i.port)), v("model-updated", H.value);
|
|
1020
|
+
}), He(() => {
|
|
1021
|
+
v("model-updated", H.value);
|
|
1022
|
+
}), X({
|
|
1023
|
+
validateUrl: q,
|
|
1024
|
+
getPayload: H,
|
|
1025
|
+
saveFormData: te,
|
|
1026
|
+
canSubmit: ce,
|
|
1027
|
+
initForm: ge
|
|
1028
|
+
}), (i, f) => {
|
|
1029
|
+
const V = W("KInput"), J = W("KLabel"), B = W("KRadio"), R = W("KSelect"), c = W("KCheckbox"), g = W("KCollapse");
|
|
1030
|
+
return S(), F("div", Kt, [
|
|
1031
|
+
u(l(Ye), {
|
|
1032
|
+
"can-submit": ce.value,
|
|
1033
|
+
config: n.config,
|
|
1034
|
+
"edit-id": n.gatewayServiceId,
|
|
1035
|
+
"entity-type": l(Oe).GatewayService,
|
|
1036
|
+
"error-message": o.errorMessage,
|
|
1037
|
+
"fetch-url": be.value,
|
|
1038
|
+
"form-fields": H.value,
|
|
1039
|
+
"is-readonly": o.isReadonly,
|
|
1040
|
+
onCancel: ye,
|
|
1041
|
+
"onFetch:error": f[25] || (f[25] = (p) => i.$emit("error", p)),
|
|
1042
|
+
"onFetch:success": ge,
|
|
1043
|
+
onLoading: f[26] || (f[26] = (p) => i.$emit("loading", p)),
|
|
1044
|
+
onSubmit: te
|
|
1045
|
+
}, {
|
|
1046
|
+
"form-actions": m(() => [
|
|
1047
|
+
Ze(i.$slots, "form-actions", {
|
|
1048
|
+
canSubmit: ce.value,
|
|
1049
|
+
cancel: ye,
|
|
1050
|
+
submit: te
|
|
1051
|
+
}, void 0, !0)
|
|
1052
|
+
]),
|
|
1053
|
+
default: m(() => [
|
|
1054
|
+
u(l(Ke), {
|
|
1055
|
+
description: l(r)("gateway_services.form.sections.general.description"),
|
|
1056
|
+
"hide-info-header": n.hideSectionsInfo,
|
|
1057
|
+
title: l(r)("gateway_services.form.sections.general.title")
|
|
1058
|
+
}, {
|
|
1059
|
+
default: m(() => [
|
|
1060
|
+
u(V, {
|
|
1061
|
+
modelValue: o.fields.name,
|
|
1062
|
+
"onUpdate:modelValue": f[0] || (f[0] = (p) => o.fields.name = p),
|
|
1063
|
+
modelModifiers: { trim: !0 },
|
|
1064
|
+
autocomplete: "off",
|
|
1065
|
+
"data-testid": "gateway-service-name-input",
|
|
1066
|
+
error: Ie.value,
|
|
1067
|
+
"error-message": N.value,
|
|
1068
|
+
label: l(r)("gateway_services.form.fields.name.label"),
|
|
1069
|
+
"label-attributes": {
|
|
1070
|
+
info: l(r)("gateway_services.form.fields.name.tooltip"),
|
|
1071
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1072
|
+
},
|
|
1073
|
+
name: "name",
|
|
1074
|
+
placeholder: l(r)("gateway_services.form.fields.name.placeholder"),
|
|
1075
|
+
readonly: o.isReadonly,
|
|
1076
|
+
type: "text",
|
|
1077
|
+
onInput: Ve
|
|
1078
|
+
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1079
|
+
u(V, {
|
|
1080
|
+
modelValue: o.fields.tags,
|
|
1081
|
+
"onUpdate:modelValue": f[1] || (f[1] = (p) => o.fields.tags = p),
|
|
1082
|
+
modelModifiers: { trim: !0 },
|
|
1083
|
+
autocomplete: "off",
|
|
1084
|
+
"data-testid": "gateway-service-tags-input",
|
|
1085
|
+
help: l(r)("gateway_services.form.fields.tags.help"),
|
|
1086
|
+
label: l(r)("gateway_services.form.fields.tags.label"),
|
|
1087
|
+
"label-attributes": {
|
|
1088
|
+
info: l(r)("gateway_services.form.fields.tags.tooltip"),
|
|
1089
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1090
|
+
},
|
|
1091
|
+
name: "tags",
|
|
1092
|
+
placeholder: l(r)("gateway_services.form.fields.tags.placeholder"),
|
|
1093
|
+
readonly: o.isReadonly,
|
|
1094
|
+
type: "text"
|
|
1095
|
+
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
|
|
1096
|
+
]),
|
|
1097
|
+
_: 1
|
|
1098
|
+
}, 8, ["description", "hide-info-header", "title"]),
|
|
1099
|
+
u(l(Ke), {
|
|
1100
|
+
description: l(r)("gateway_services.form.sections.keys.description"),
|
|
1101
|
+
"hide-info-header": n.hideSectionsInfo,
|
|
1102
|
+
title: l(r)("gateway_services.form.sections.keys.title")
|
|
1103
|
+
}, {
|
|
1104
|
+
default: m(() => [
|
|
1105
|
+
ae.value ? M("", !0) : (S(), F("div", Lt, [
|
|
1106
|
+
I("div", Dt, [
|
|
1107
|
+
u(J, { required: "" }, {
|
|
1108
|
+
default: m(() => [
|
|
1109
|
+
Z(P(l(r)("gateway_services.form.sections.keys.checkedGroupLabel")), 1)
|
|
1110
|
+
]),
|
|
1111
|
+
_: 1
|
|
1112
|
+
})
|
|
1113
|
+
]),
|
|
1114
|
+
I("div", Wt, [
|
|
1115
|
+
u(B, {
|
|
1116
|
+
modelValue: x.value,
|
|
1117
|
+
"onUpdate:modelValue": f[2] || (f[2] = (p) => x.value = p),
|
|
1118
|
+
"data-testid": "gateway-service-url-radio",
|
|
1119
|
+
"selected-value": we.url,
|
|
1120
|
+
onChange: ne
|
|
1121
|
+
}, {
|
|
1122
|
+
default: m(() => [
|
|
1123
|
+
Z(P(l(r)("gateway_services.form.sections.keys.urlLabel")), 1)
|
|
1124
|
+
]),
|
|
1125
|
+
_: 1
|
|
1126
|
+
}, 8, ["modelValue", "selected-value"])
|
|
1127
|
+
]),
|
|
1128
|
+
x.value === "url" ? (S(), F("div", qt, [
|
|
1129
|
+
u(V, {
|
|
1130
|
+
modelValue: o.fields.url,
|
|
1131
|
+
"onUpdate:modelValue": f[3] || (f[3] = (p) => o.fields.url = p),
|
|
1132
|
+
modelModifiers: { trim: !0 },
|
|
1133
|
+
class: "gateway-service-url-input gateway-service-form-margin-bottom",
|
|
1134
|
+
"data-testid": "gateway-service-url-input",
|
|
1135
|
+
label: l(r)("gateway_services.form.fields.upstream_url.label"),
|
|
1136
|
+
"label-attributes": {
|
|
1137
|
+
info: n.config.app === "konnect" ? l(r)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : l(r)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
|
|
1138
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1139
|
+
},
|
|
1140
|
+
name: "url",
|
|
1141
|
+
placeholder: l(r)("gateway_services.form.fields.upstream_url.placeholder"),
|
|
1142
|
+
required: ""
|
|
1143
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
|
|
1144
|
+
])) : M("", !0),
|
|
1145
|
+
u(B, {
|
|
1146
|
+
modelValue: x.value,
|
|
1147
|
+
"onUpdate:modelValue": f[4] || (f[4] = (p) => x.value = p),
|
|
1148
|
+
"checked-group": "protocol",
|
|
1149
|
+
"data-testid": "gateway-service-protocol-radio",
|
|
1150
|
+
"selected-value": we.protocol,
|
|
1151
|
+
onChange: ne
|
|
1152
|
+
}, {
|
|
1153
|
+
default: m(() => [
|
|
1154
|
+
Z(P(l(r)("gateway_services.form.sections.keys.checkedGroupAltLabel")), 1)
|
|
1155
|
+
]),
|
|
1156
|
+
_: 1
|
|
1157
|
+
}, 8, ["modelValue", "selected-value"])
|
|
1158
|
+
])),
|
|
1159
|
+
x.value === "protocol" || ae.value ? (S(), F("div", Gt, [
|
|
1160
|
+
u(R, {
|
|
1161
|
+
modelValue: o.fields.protocol,
|
|
1162
|
+
"onUpdate:modelValue": f[5] || (f[5] = (p) => o.fields.protocol = p),
|
|
1163
|
+
"data-testid": "gateway-service-protocol-select",
|
|
1164
|
+
items: ve,
|
|
1165
|
+
label: l(r)("gateway_services.form.fields.protocol.label"),
|
|
1166
|
+
"label-attributes": {
|
|
1167
|
+
info: l(r)("gateway_services.form.fields.protocol.tooltip"),
|
|
1168
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1169
|
+
},
|
|
1170
|
+
readonly: o.isReadonly,
|
|
1171
|
+
required: "",
|
|
1172
|
+
width: "100%",
|
|
1173
|
+
onSelected: f[6] || (f[6] = (p) => e(o.fields.protocol, p))
|
|
1174
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
|
|
1175
|
+
u(V, {
|
|
1176
|
+
modelValue: o.fields.host,
|
|
1177
|
+
"onUpdate:modelValue": f[7] || (f[7] = (p) => o.fields.host = p),
|
|
1178
|
+
modelModifiers: { trim: !0 },
|
|
1179
|
+
class: "gateway-service-form-margin-top",
|
|
1180
|
+
"data-testid": "gateway-service-host-input",
|
|
1181
|
+
label: l(r)("gateway_services.form.fields.host.label"),
|
|
1182
|
+
"label-attributes": {
|
|
1183
|
+
info: l(r)("gateway_services.form.fields.host.tooltip"),
|
|
1184
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1185
|
+
},
|
|
1186
|
+
name: "host",
|
|
1187
|
+
placeholder: l(r)("gateway_services.form.fields.host.placeholder"),
|
|
1188
|
+
required: ""
|
|
1189
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"]),
|
|
1190
|
+
re.value ? (S(), F("div", Ot, [
|
|
1191
|
+
u(V, {
|
|
1192
|
+
modelValue: o.fields.path,
|
|
1193
|
+
"onUpdate:modelValue": f[8] || (f[8] = (p) => o.fields.path = p),
|
|
1194
|
+
modelModifiers: { trim: !0 },
|
|
1195
|
+
class: "gateway-service-form-margin-top",
|
|
1196
|
+
"data-testid": "gateway-service-path-input",
|
|
1197
|
+
label: l(r)("gateway_services.form.fields.path.label"),
|
|
1198
|
+
"label-attributes": {
|
|
1199
|
+
info: l(r)("gateway_services.form.fields.path.tooltip"),
|
|
1200
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1201
|
+
},
|
|
1202
|
+
name: "path",
|
|
1203
|
+
placeholder: l(r)("gateway_services.form.fields.path.placeholder")
|
|
1204
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
|
|
1205
|
+
])) : M("", !0),
|
|
1206
|
+
u(V, {
|
|
1207
|
+
modelValue: o.fields.port,
|
|
1208
|
+
"onUpdate:modelValue": [
|
|
1209
|
+
f[9] || (f[9] = (p) => o.fields.port = p),
|
|
1210
|
+
f[10] || (f[10] = () => {
|
|
1211
|
+
o.fields.port = $(o.fields.port + "");
|
|
1212
|
+
})
|
|
1213
|
+
],
|
|
1214
|
+
class: "gateway-service-form-margin-top",
|
|
1215
|
+
"data-testid": "gateway-service-port-input",
|
|
1216
|
+
label: l(r)("gateway_services.form.fields.port.label"),
|
|
1217
|
+
"label-attributes": {
|
|
1218
|
+
info: l(r)("gateway_services.form.fields.port.tooltip"),
|
|
1219
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1220
|
+
},
|
|
1221
|
+
name: "port",
|
|
1222
|
+
type: "number"
|
|
1223
|
+
}, null, 8, ["modelValue", "label", "label-attributes"])
|
|
1224
|
+
])) : M("", !0),
|
|
1225
|
+
u(g, {
|
|
1226
|
+
modelValue: h.value,
|
|
1227
|
+
"onUpdate:modelValue": f[24] || (f[24] = (p) => h.value = p),
|
|
1228
|
+
"data-testid": "advanced-fields-collapse",
|
|
1229
|
+
"trigger-alignment": "leading",
|
|
1230
|
+
"trigger-label": l(r)("gateway_services.form.sections.keys.viewAdvancedFields")
|
|
1231
|
+
}, {
|
|
1232
|
+
default: m(() => [
|
|
1233
|
+
I("div", Nt, [
|
|
1234
|
+
I("div", jt, [
|
|
1235
|
+
u(V, {
|
|
1236
|
+
modelValue: o.fields.retries,
|
|
1237
|
+
"onUpdate:modelValue": [
|
|
1238
|
+
f[11] || (f[11] = (p) => o.fields.retries = p),
|
|
1239
|
+
f[12] || (f[12] = () => {
|
|
1240
|
+
o.fields.retries = $(o.fields.retries + "");
|
|
1241
|
+
})
|
|
1242
|
+
],
|
|
1243
|
+
autocomplete: "off",
|
|
1244
|
+
"data-testid": "gateway-service-retries-input",
|
|
1245
|
+
label: l(r)("gateway_services.form.fields.retries.label"),
|
|
1246
|
+
"label-attributes": {
|
|
1247
|
+
info: l(r)("gateway_services.form.fields.retries.tooltip"),
|
|
1248
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1249
|
+
},
|
|
1250
|
+
name: "retries",
|
|
1251
|
+
readonly: o.isReadonly,
|
|
1252
|
+
type: "number"
|
|
1253
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1254
|
+
]),
|
|
1255
|
+
I("div", zt, [
|
|
1256
|
+
u(V, {
|
|
1257
|
+
modelValue: o.fields.connect_timeout,
|
|
1258
|
+
"onUpdate:modelValue": [
|
|
1259
|
+
f[13] || (f[13] = (p) => o.fields.connect_timeout = p),
|
|
1260
|
+
f[14] || (f[14] = () => {
|
|
1261
|
+
o.fields.connect_timeout = $(o.fields.connect_timeout + "");
|
|
1262
|
+
})
|
|
1263
|
+
],
|
|
1264
|
+
autocomplete: "off",
|
|
1265
|
+
"data-testid": "gateway-service-connTimeout-input",
|
|
1266
|
+
label: l(r)("gateway_services.form.fields.connect_timeout.label"),
|
|
1267
|
+
"label-attributes": {
|
|
1268
|
+
info: l(r)("gateway_services.form.fields.connect_timeout.tooltip"),
|
|
1269
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1270
|
+
},
|
|
1271
|
+
name: "connTimeout",
|
|
1272
|
+
readonly: o.isReadonly,
|
|
1273
|
+
type: "number"
|
|
1274
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1275
|
+
]),
|
|
1276
|
+
I("div", Ht, [
|
|
1277
|
+
u(V, {
|
|
1278
|
+
modelValue: o.fields.write_timeout,
|
|
1279
|
+
"onUpdate:modelValue": [
|
|
1280
|
+
f[15] || (f[15] = (p) => o.fields.write_timeout = p),
|
|
1281
|
+
f[16] || (f[16] = () => {
|
|
1282
|
+
o.fields.write_timeout = $(o.fields.write_timeout + "");
|
|
1283
|
+
})
|
|
1284
|
+
],
|
|
1285
|
+
autocomplete: "off",
|
|
1286
|
+
"data-testid": "gateway-service-writeTimeout-input",
|
|
1287
|
+
label: l(r)("gateway_services.form.fields.write_timeout.label"),
|
|
1288
|
+
"label-attributes": {
|
|
1289
|
+
info: l(r)("gateway_services.form.fields.write_timeout.tooltip"),
|
|
1290
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1291
|
+
},
|
|
1292
|
+
name: "writeTimeout",
|
|
1293
|
+
readonly: o.isReadonly,
|
|
1294
|
+
type: "number"
|
|
1295
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1296
|
+
]),
|
|
1297
|
+
I("div", Zt, [
|
|
1298
|
+
u(V, {
|
|
1299
|
+
modelValue: o.fields.read_timeout,
|
|
1300
|
+
"onUpdate:modelValue": [
|
|
1301
|
+
f[17] || (f[17] = (p) => o.fields.read_timeout = p),
|
|
1302
|
+
f[18] || (f[18] = () => {
|
|
1303
|
+
o.fields.read_timeout = $(o.fields.read_timeout + "");
|
|
1304
|
+
})
|
|
1305
|
+
],
|
|
1306
|
+
autocomplete: "off",
|
|
1307
|
+
"data-testid": "gateway-service-readTimeout-input",
|
|
1308
|
+
label: l(r)("gateway_services.form.fields.read_timeout.label"),
|
|
1309
|
+
"label-attributes": {
|
|
1310
|
+
info: l(r)("gateway_services.form.fields.read_timeout.tooltip"),
|
|
1311
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1312
|
+
},
|
|
1313
|
+
name: "readTimeout",
|
|
1314
|
+
readonly: o.isReadonly,
|
|
1315
|
+
type: "number"
|
|
1316
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1317
|
+
]),
|
|
1318
|
+
Pe.value ? (S(), F("div", Jt, [
|
|
1319
|
+
u(V, {
|
|
1320
|
+
modelValue: o.fields.client_certificate,
|
|
1321
|
+
"onUpdate:modelValue": f[19] || (f[19] = (p) => o.fields.client_certificate = p),
|
|
1322
|
+
modelModifiers: { trim: !0 },
|
|
1323
|
+
autocomplete: "off",
|
|
1324
|
+
"data-testid": "gateway-service-clientCert-input",
|
|
1325
|
+
label: l(r)("gateway_services.form.fields.client_certificate.label"),
|
|
1326
|
+
"label-attributes": {
|
|
1327
|
+
info: l(r)("gateway_services.form.fields.client_certificate.tooltip"),
|
|
1328
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1329
|
+
},
|
|
1330
|
+
name: "clientCert",
|
|
1331
|
+
placeholder: l(r)("gateway_services.form.fields.client_certificate.placeholder"),
|
|
1332
|
+
readonly: o.isReadonly,
|
|
1333
|
+
type: "text"
|
|
1334
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])
|
|
1335
|
+
])) : M("", !0),
|
|
1336
|
+
oe.value ? (S(), F("div", Qt, [
|
|
1337
|
+
u(V, {
|
|
1338
|
+
modelValue: o.fields.ca_certificates,
|
|
1339
|
+
"onUpdate:modelValue": f[20] || (f[20] = (p) => o.fields.ca_certificates = p),
|
|
1340
|
+
modelModifiers: { trim: !0 },
|
|
1341
|
+
autocomplete: "off",
|
|
1342
|
+
"data-testid": "gateway-service-ca-certs-input",
|
|
1343
|
+
label: l(r)("gateway_services.form.fields.ca_certificates.label"),
|
|
1344
|
+
"label-attributes": { tooltipAttributes: { maxWidth: "400" } },
|
|
1345
|
+
placeholder: l(r)("gateway_services.form.fields.ca_certificates.placeholder"),
|
|
1346
|
+
readonly: o.isReadonly,
|
|
1347
|
+
type: "text"
|
|
1348
|
+
}, {
|
|
1349
|
+
"label-tooltip": m(() => [
|
|
1350
|
+
u(l(Q), {
|
|
1351
|
+
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1352
|
+
scope: "global"
|
|
1353
|
+
}, {
|
|
1354
|
+
code1: m(() => [
|
|
1355
|
+
I("code", null, P(l(r)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
1356
|
+
]),
|
|
1357
|
+
code2: m(() => [
|
|
1358
|
+
I("code", null, P(l(r)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
1359
|
+
]),
|
|
1360
|
+
_: 1
|
|
1361
|
+
})
|
|
1362
|
+
]),
|
|
1363
|
+
_: 1
|
|
1364
|
+
}, 8, ["modelValue", "label", "placeholder", "readonly"])
|
|
1365
|
+
])) : M("", !0),
|
|
1366
|
+
ke.value ? (S(), F("div", Xt, [
|
|
1367
|
+
u(c, {
|
|
1368
|
+
modelValue: o.fields.tls_verify_enabled,
|
|
1369
|
+
"onUpdate:modelValue": f[21] || (f[21] = (p) => o.fields.tls_verify_enabled = p),
|
|
1370
|
+
"data-testid": "gateway-service-tls-verify-checkbox",
|
|
1371
|
+
description: l(r)("gateway_services.form.fields.tls_verify_enabled.help"),
|
|
1372
|
+
label: l(r)("gateway_services.form.fields.tls_verify_enabled.label"),
|
|
1373
|
+
"label-attributes": { tooltipAttributes: { maxWidth: "400" } }
|
|
1374
|
+
}, {
|
|
1375
|
+
tooltip: m(() => [
|
|
1376
|
+
u(l(Q), {
|
|
1377
|
+
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
1378
|
+
scope: "global"
|
|
1379
|
+
}, {
|
|
1380
|
+
code1: m(() => [
|
|
1381
|
+
I("code", null, P(l(r)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
1382
|
+
]),
|
|
1383
|
+
_: 1
|
|
1384
|
+
})
|
|
1385
|
+
]),
|
|
1386
|
+
_: 1
|
|
1387
|
+
}, 8, ["modelValue", "description", "label"]),
|
|
1388
|
+
o.fields.tls_verify_enabled ? (S(), F("div", Yt, [
|
|
1389
|
+
u(B, {
|
|
1390
|
+
modelValue: o.fields.tls_verify_value,
|
|
1391
|
+
"onUpdate:modelValue": f[22] || (f[22] = (p) => o.fields.tls_verify_value = p),
|
|
1392
|
+
"data-testid": "gateway-service-tls-verify-true-option",
|
|
1393
|
+
label: l(r)("gateway_services.form.fields.tls_verify_option.true.label"),
|
|
1394
|
+
"selected-value": !0
|
|
1395
|
+
}, null, 8, ["modelValue", "label"])
|
|
1396
|
+
])) : M("", !0),
|
|
1397
|
+
o.fields.tls_verify_enabled ? (S(), F("div", el, [
|
|
1398
|
+
u(B, {
|
|
1399
|
+
modelValue: o.fields.tls_verify_value,
|
|
1400
|
+
"onUpdate:modelValue": f[23] || (f[23] = (p) => o.fields.tls_verify_value = p),
|
|
1401
|
+
"data-testid": "gateway-service-tls-verify-false-option",
|
|
1402
|
+
label: l(r)("gateway_services.form.fields.tls_verify_option.false.label"),
|
|
1403
|
+
"selected-value": !1
|
|
1404
|
+
}, null, 8, ["modelValue", "label"])
|
|
1405
|
+
])) : M("", !0)
|
|
1406
|
+
])) : M("", !0)
|
|
1407
|
+
])
|
|
1408
|
+
]),
|
|
1409
|
+
_: 1
|
|
1410
|
+
}, 8, ["modelValue", "trigger-label"])
|
|
1411
|
+
]),
|
|
1412
|
+
_: 1
|
|
1413
|
+
}, 8, ["description", "hide-info-header", "title"])
|
|
1414
|
+
]),
|
|
1415
|
+
_: 3
|
|
1416
|
+
}, 8, ["can-submit", "config", "edit-id", "entity-type", "error-message", "fetch-url", "form-fields", "is-readonly"])
|
|
1417
|
+
]);
|
|
1418
|
+
};
|
|
1419
|
+
}
|
|
1420
|
+
}), Al = /* @__PURE__ */ Ne(tl, [["__scopeId", "data-v-e874c296"]]), ll = { class: "kong-ui-gateway-service-entity-config-card" }, xl = /* @__PURE__ */ Le({
|
|
786
1421
|
__name: "GatewayServiceConfigCard",
|
|
787
1422
|
props: {
|
|
788
1423
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
789
1424
|
config: {
|
|
790
1425
|
type: Object,
|
|
791
1426
|
required: !0,
|
|
792
|
-
validator: (
|
|
1427
|
+
validator: (n) => !(!n || !["konnect", "kongManager"].includes(n == null ? void 0 : n.app) || n.app === "konnect" && !n.controlPlaneId || n.app === "kongManager" && typeof n.workspace != "string" || !n.entityId)
|
|
793
1428
|
},
|
|
794
1429
|
/**
|
|
795
1430
|
* External link for documentation that determines visibility of Documentation button
|
|
@@ -808,129 +1443,129 @@ const Y = {
|
|
|
808
1443
|
}
|
|
809
1444
|
},
|
|
810
1445
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
811
|
-
setup(
|
|
812
|
-
const
|
|
1446
|
+
setup(n) {
|
|
1447
|
+
const X = n, { i18n: { t: _ }, i18nT: v } = se.useI18n(), a = k(() => pe.form[X.config.app].edit), { getPropValue: h } = et(), L = (r, j) => h(r, j) === !0 ? _("gateway_services.form.fields.tls_verify_option.true.display") : _("gateway_services.form.fields.tls_verify_option.false.display"), Q = D({
|
|
813
1448
|
id: {},
|
|
814
1449
|
name: {
|
|
815
|
-
tooltip:
|
|
1450
|
+
tooltip: _("gateway_services.form.fields.name.tooltip")
|
|
816
1451
|
},
|
|
817
1452
|
enabled: {},
|
|
818
1453
|
updated_at: {},
|
|
819
1454
|
created_at: {},
|
|
820
1455
|
protocol: {
|
|
821
|
-
section:
|
|
822
|
-
tooltip:
|
|
1456
|
+
section: Ae.Basic,
|
|
1457
|
+
tooltip: _("gateway_services.form.fields.protocol.tooltip")
|
|
823
1458
|
},
|
|
824
1459
|
host: {
|
|
825
|
-
section:
|
|
826
|
-
tooltip:
|
|
1460
|
+
section: Ae.Basic,
|
|
1461
|
+
tooltip: _("gateway_services.form.fields.host.tooltip")
|
|
827
1462
|
},
|
|
828
1463
|
path: {
|
|
829
|
-
section:
|
|
830
|
-
tooltip:
|
|
1464
|
+
section: Ae.Basic,
|
|
1465
|
+
tooltip: _("gateway_services.form.fields.path.tooltip")
|
|
831
1466
|
},
|
|
832
1467
|
port: {
|
|
833
|
-
section:
|
|
834
|
-
tooltip:
|
|
1468
|
+
section: Ae.Basic,
|
|
1469
|
+
tooltip: _("gateway_services.form.fields.port.tooltip")
|
|
835
1470
|
},
|
|
836
1471
|
tags: {
|
|
837
|
-
tooltip:
|
|
1472
|
+
tooltip: _("gateway_services.form.fields.tags.tooltip")
|
|
838
1473
|
},
|
|
839
1474
|
// advanced fields
|
|
840
1475
|
retries: {
|
|
841
1476
|
order: 1,
|
|
842
|
-
tooltip:
|
|
1477
|
+
tooltip: _("gateway_services.form.fields.retries.tooltip")
|
|
843
1478
|
},
|
|
844
1479
|
connect_timeout: {
|
|
845
1480
|
order: 2,
|
|
846
|
-
tooltip:
|
|
1481
|
+
tooltip: _("gateway_services.form.fields.connect_timeout.tooltip")
|
|
847
1482
|
},
|
|
848
1483
|
write_timeout: {
|
|
849
1484
|
order: 3,
|
|
850
|
-
tooltip:
|
|
1485
|
+
tooltip: _("gateway_services.form.fields.write_timeout.tooltip")
|
|
851
1486
|
},
|
|
852
1487
|
read_timeout: {
|
|
853
1488
|
order: 4,
|
|
854
|
-
tooltip:
|
|
1489
|
+
tooltip: _("gateway_services.form.fields.read_timeout.tooltip")
|
|
855
1490
|
},
|
|
856
1491
|
client_certificate: {
|
|
857
1492
|
order: 5,
|
|
858
|
-
tooltip:
|
|
1493
|
+
tooltip: _("gateway_services.form.fields.client_certificate.tooltip")
|
|
859
1494
|
},
|
|
860
1495
|
ca_certificates: {
|
|
861
|
-
type:
|
|
862
|
-
label:
|
|
1496
|
+
type: bt.BadgeTag,
|
|
1497
|
+
label: _("gateway_services.form.fields.ca_certificates.label"),
|
|
863
1498
|
order: 6
|
|
864
1499
|
},
|
|
865
1500
|
tls_verify: {
|
|
866
|
-
label:
|
|
1501
|
+
label: _("gateway_services.form.fields.tls_verify_enabled.label")
|
|
867
1502
|
},
|
|
868
1503
|
tls_verify_depth: {
|
|
869
1504
|
hidden: !0
|
|
870
1505
|
}
|
|
871
1506
|
});
|
|
872
|
-
return (
|
|
873
|
-
|
|
874
|
-
config:
|
|
875
|
-
"config-card-doc":
|
|
876
|
-
"config-schema":
|
|
877
|
-
"entity-type":
|
|
1507
|
+
return (r, j) => (S(), F("div", ll, [
|
|
1508
|
+
u(l(ht), {
|
|
1509
|
+
config: n.config,
|
|
1510
|
+
"config-card-doc": n.configCardDoc,
|
|
1511
|
+
"config-schema": Q.value,
|
|
1512
|
+
"entity-type": l(Oe).GatewayService,
|
|
878
1513
|
"fetch-url": a.value,
|
|
879
|
-
"hide-title":
|
|
880
|
-
"onFetch:error":
|
|
881
|
-
"onFetch:success":
|
|
882
|
-
onLoading:
|
|
1514
|
+
"hide-title": n.hideTitle,
|
|
1515
|
+
"onFetch:error": j[0] || (j[0] = (A) => r.$emit("fetch:error", A)),
|
|
1516
|
+
"onFetch:success": j[1] || (j[1] = (A) => r.$emit("fetch:success", A)),
|
|
1517
|
+
onLoading: j[2] || (j[2] = (A) => r.$emit("loading", A))
|
|
883
1518
|
}, {
|
|
884
|
-
"enabled-label-tooltip":
|
|
885
|
-
|
|
1519
|
+
"enabled-label-tooltip": m(() => [
|
|
1520
|
+
u(l(v), {
|
|
886
1521
|
keypath: "gateway_services.form.fields.enabled.tooltip",
|
|
887
1522
|
scope: "global"
|
|
888
1523
|
}, {
|
|
889
|
-
false:
|
|
890
|
-
I("code", null,
|
|
1524
|
+
false: m(() => [
|
|
1525
|
+
I("code", null, P(l(_)("gateway_services.form.fields.enabled.false")), 1)
|
|
891
1526
|
]),
|
|
892
|
-
true:
|
|
893
|
-
I("code", null,
|
|
1527
|
+
true: m(() => [
|
|
1528
|
+
I("code", null, P(l(_)("gateway_services.form.fields.enabled.true")), 1)
|
|
894
1529
|
]),
|
|
895
1530
|
_: 1
|
|
896
1531
|
})
|
|
897
1532
|
]),
|
|
898
|
-
"ca_certificates-label-tooltip":
|
|
899
|
-
|
|
1533
|
+
"ca_certificates-label-tooltip": m(() => [
|
|
1534
|
+
u(l(v), {
|
|
900
1535
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
901
1536
|
scope: "global"
|
|
902
1537
|
}, {
|
|
903
|
-
code1:
|
|
904
|
-
I("code", null,
|
|
1538
|
+
code1: m(() => [
|
|
1539
|
+
I("code", null, P(l(_)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
905
1540
|
]),
|
|
906
|
-
code2:
|
|
907
|
-
I("code", null,
|
|
1541
|
+
code2: m(() => [
|
|
1542
|
+
I("code", null, P(l(_)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
908
1543
|
]),
|
|
909
1544
|
_: 1
|
|
910
1545
|
})
|
|
911
1546
|
]),
|
|
912
|
-
"tls_verify-label-tooltip":
|
|
913
|
-
|
|
1547
|
+
"tls_verify-label-tooltip": m(() => [
|
|
1548
|
+
u(l(v), {
|
|
914
1549
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
915
1550
|
scope: "global"
|
|
916
1551
|
}, {
|
|
917
|
-
code1:
|
|
918
|
-
I("code", null,
|
|
1552
|
+
code1: m(() => [
|
|
1553
|
+
I("code", null, P(l(_)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
919
1554
|
]),
|
|
920
1555
|
_: 1
|
|
921
1556
|
})
|
|
922
1557
|
]),
|
|
923
|
-
tls_verify:
|
|
924
|
-
|
|
1558
|
+
tls_verify: m((A) => [
|
|
1559
|
+
Z(P(typeof l(h)("rowValue", A) == "boolean" ? L("rowValue", A) : l(_)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
|
|
925
1560
|
]),
|
|
926
|
-
client_certificate:
|
|
927
|
-
|
|
1561
|
+
client_certificate: m((A) => [
|
|
1562
|
+
Z(P(l(h)("rowValue", A) ? l(h)("rowValue", A).id : "–"), 1)
|
|
928
1563
|
]),
|
|
929
1564
|
_: 1
|
|
930
1565
|
}, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
|
|
931
1566
|
]));
|
|
932
1567
|
}
|
|
933
|
-
}),
|
|
1568
|
+
}), le = {
|
|
934
1569
|
name: "Kong-Air-Flights-API",
|
|
935
1570
|
tags: [],
|
|
936
1571
|
protocol: "https",
|
|
@@ -943,41 +1578,41 @@ const Y = {
|
|
|
943
1578
|
client_certificate: null,
|
|
944
1579
|
write_timeout: 6e4,
|
|
945
1580
|
port: 443
|
|
946
|
-
},
|
|
1581
|
+
}, ol = { class: "kong-ui-entities-gateway-service-form" }, il = {
|
|
947
1582
|
key: 0,
|
|
948
1583
|
class: "gateway-service-form-general-info"
|
|
949
|
-
},
|
|
1584
|
+
}, rl = { class: "gateway-service-form-group-selection-wrapper" }, sl = {
|
|
950
1585
|
key: 0,
|
|
951
1586
|
class: "gateway-service-form-group-fields"
|
|
952
|
-
},
|
|
1587
|
+
}, al = {
|
|
953
1588
|
key: 0,
|
|
954
1589
|
class: "gateway-service-form-group-fields"
|
|
955
|
-
},
|
|
1590
|
+
}, nl = { key: 0 }, cl = {
|
|
956
1591
|
key: 0,
|
|
957
1592
|
class: "gateway-service-form-advanced-fields"
|
|
958
|
-
},
|
|
1593
|
+
}, dl = { class: "gateway-service-form-margin-bottom" }, ul = { class: "gateway-service-form-margin-bottom" }, fl = { class: "gateway-service-form-margin-bottom" }, pl = { class: "gateway-service-form-margin-bottom" }, ml = {
|
|
959
1594
|
key: 0,
|
|
960
1595
|
class: "gateway-service-form-margin-bottom"
|
|
961
|
-
},
|
|
1596
|
+
}, vl = {
|
|
962
1597
|
key: 1,
|
|
963
1598
|
class: "gateway-service-form-margin-bottom"
|
|
964
|
-
},
|
|
1599
|
+
}, gl = {
|
|
965
1600
|
key: 2,
|
|
966
1601
|
class: "gateway-service-form-margin-bottom"
|
|
967
|
-
},
|
|
1602
|
+
}, yl = {
|
|
968
1603
|
key: 0,
|
|
969
1604
|
class: "checkbox-aligned-radio"
|
|
970
|
-
},
|
|
1605
|
+
}, _l = {
|
|
971
1606
|
key: 1,
|
|
972
1607
|
class: "checkbox-aligned-radio"
|
|
973
|
-
},
|
|
1608
|
+
}, bl = { class: "gateway-service-form-tags" }, hl = { class: "form-error-list" }, wl = /* @__PURE__ */ Le({
|
|
974
1609
|
__name: "GatewayServiceForm",
|
|
975
1610
|
props: {
|
|
976
1611
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
977
1612
|
config: {
|
|
978
1613
|
type: Object,
|
|
979
1614
|
required: !0,
|
|
980
|
-
validator: (
|
|
1615
|
+
validator: (n) => !(!n || !["konnect", "kongManager"].includes(n == null ? void 0 : n.app) || n.app === "konnect" && !n.controlPlaneId || n.app === "kongManager" && typeof n.workspace != "string" || !n.cancelRoute)
|
|
981
1616
|
},
|
|
982
1617
|
/** If a valid Gateway Service ID is provided, it will put the form in Edit mode instead of Create */
|
|
983
1618
|
gatewayServiceId: {
|
|
@@ -999,9 +1634,9 @@ const Y = {
|
|
|
999
1634
|
}
|
|
1000
1635
|
},
|
|
1001
1636
|
emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated", "try-sample-api"],
|
|
1002
|
-
setup(
|
|
1003
|
-
var
|
|
1004
|
-
const
|
|
1637
|
+
setup(n, { expose: X, emit: _ }) {
|
|
1638
|
+
var b;
|
|
1639
|
+
const v = _, a = n, h = D(!0), L = qe(), { i18nT: Q, i18n: { t: r } } = se.useI18n(), { getErrorFieldsFromError: j } = Je(), { axiosInstance: A } = Ge((b = a.config) == null ? void 0 : b.axiosRequestConfig), Se = Qe(), { validateHost: be, validatePath: Y, validatePort: he, validateProtocol: ae } = se.useUrlValidators(), { objectsAreEqual: x } = et(), me = k(() => pe.form[a.config.app].edit), N = k(() => a.gatewayServiceId ? Be.Edit : Be.Create), Ie = D(!1), o = k(() => !!a.gatewayServiceId), w = D(o.value ? "protocol" : "url"), ie = se.usePortFromProtocol(), ve = D(""), we = k(() => !!ve.value || !!ee("name")), e = Me({
|
|
1005
1640
|
fields: {
|
|
1006
1641
|
name: "",
|
|
1007
1642
|
protocol: "http",
|
|
@@ -1017,7 +1652,8 @@ const Y = {
|
|
|
1017
1652
|
ca_certificates: "",
|
|
1018
1653
|
tls_verify_enabled: !1,
|
|
1019
1654
|
tls_verify_value: !1,
|
|
1020
|
-
tags: ""
|
|
1655
|
+
tags: "",
|
|
1656
|
+
enabled: !0
|
|
1021
1657
|
},
|
|
1022
1658
|
isReadonly: !1,
|
|
1023
1659
|
errorMessages: [],
|
|
@@ -1037,7 +1673,7 @@ const Y = {
|
|
|
1037
1673
|
tls_verify_enabled: "",
|
|
1038
1674
|
tls_verify_value: ""
|
|
1039
1675
|
}
|
|
1040
|
-
}),
|
|
1676
|
+
}), $ = Me({
|
|
1041
1677
|
name: "",
|
|
1042
1678
|
protocol: "http",
|
|
1043
1679
|
host: "",
|
|
@@ -1052,171 +1688,172 @@ const Y = {
|
|
|
1052
1688
|
ca_certificates: "",
|
|
1053
1689
|
tls_verify_enabled: !1,
|
|
1054
1690
|
tls_verify_value: !1,
|
|
1055
|
-
tags: ""
|
|
1056
|
-
|
|
1691
|
+
tags: "",
|
|
1692
|
+
enabled: !0
|
|
1693
|
+
}), ne = a.config.app === "konnect" || Xe({
|
|
1057
1694
|
gatewayInfo: a.config.gatewayInfo,
|
|
1058
1695
|
// 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
|
|
1059
1696
|
supportedRange: {
|
|
1060
1697
|
enterprise: ["3.0"]
|
|
1061
1698
|
}
|
|
1062
|
-
}),
|
|
1699
|
+
}), q = [
|
|
1063
1700
|
{
|
|
1064
|
-
label:
|
|
1701
|
+
label: r("gateway_services.form.fields.protocol.options.http"),
|
|
1065
1702
|
value: "http",
|
|
1066
1703
|
group: "http"
|
|
1067
1704
|
},
|
|
1068
1705
|
{
|
|
1069
|
-
label:
|
|
1706
|
+
label: r("gateway_services.form.fields.protocol.options.https"),
|
|
1070
1707
|
value: "https",
|
|
1071
1708
|
group: "http"
|
|
1072
1709
|
},
|
|
1073
1710
|
{
|
|
1074
|
-
label:
|
|
1711
|
+
label: r("gateway_services.form.fields.protocol.options.tcp"),
|
|
1075
1712
|
value: "tcp",
|
|
1076
1713
|
group: "tcp"
|
|
1077
1714
|
},
|
|
1078
1715
|
{
|
|
1079
|
-
label:
|
|
1716
|
+
label: r("gateway_services.form.fields.protocol.options.tls"),
|
|
1080
1717
|
value: "tls",
|
|
1081
1718
|
group: "tcp"
|
|
1082
1719
|
},
|
|
1083
1720
|
{
|
|
1084
|
-
label:
|
|
1721
|
+
label: r("gateway_services.form.fields.protocol.options.tls_passthrough"),
|
|
1085
1722
|
value: "tls_passthrough",
|
|
1086
1723
|
group: "tcp"
|
|
1087
1724
|
},
|
|
1088
1725
|
{
|
|
1089
|
-
label:
|
|
1726
|
+
label: r("gateway_services.form.fields.protocol.options.grpc"),
|
|
1090
1727
|
value: "grpc",
|
|
1091
1728
|
group: "grpc"
|
|
1092
1729
|
},
|
|
1093
1730
|
{
|
|
1094
|
-
label:
|
|
1731
|
+
label: r("gateway_services.form.fields.protocol.options.grpcs"),
|
|
1095
1732
|
value: "grpcs",
|
|
1096
1733
|
group: "grpc"
|
|
1097
1734
|
},
|
|
1098
|
-
...
|
|
1735
|
+
...ne ? [
|
|
1099
1736
|
{
|
|
1100
|
-
label:
|
|
1737
|
+
label: r("gateway_services.form.fields.protocol.options.ws"),
|
|
1101
1738
|
value: "ws",
|
|
1102
1739
|
group: "websocket"
|
|
1103
1740
|
},
|
|
1104
1741
|
{
|
|
1105
|
-
label:
|
|
1742
|
+
label: r("gateway_services.form.fields.protocol.options.wss"),
|
|
1106
1743
|
value: "wss",
|
|
1107
1744
|
group: "websocket"
|
|
1108
1745
|
}
|
|
1109
1746
|
] : [],
|
|
1110
1747
|
{
|
|
1111
|
-
label:
|
|
1748
|
+
label: r("gateway_services.form.fields.protocol.options.udp"),
|
|
1112
1749
|
value: "udp",
|
|
1113
1750
|
group: "udp"
|
|
1114
1751
|
}
|
|
1115
|
-
],
|
|
1116
|
-
|
|
1117
|
-
},
|
|
1118
|
-
e.fields.host =
|
|
1119
|
-
},
|
|
1120
|
-
|
|
1121
|
-
},
|
|
1122
|
-
switch (
|
|
1752
|
+
], re = { url: "url", protocol: "protocol" }, Pe = (t, s) => {
|
|
1753
|
+
s.value;
|
|
1754
|
+
}, oe = (t) => t ? parseFloat(t) : 0, ke = () => {
|
|
1755
|
+
e.fields.host = $.host, e.fields.path = $.path, e.fields.port = $.port, e.fields.protocol = $.protocol, e.fields.url = $.url, e.fields.retries = $.retries, e.fields.connect_timeout = $.connect_timeout, e.fields.write_timeout = $.write_timeout, e.fields.read_timeout = $.read_timeout, e.fields.client_certificate = $.client_certificate, e.fields.ca_certificates = $.ca_certificates, e.fields.tls_verify_enabled = $.tls_verify_enabled, e.fields.tls_verify_value = $.tls_verify_value, e.fields.enabled = $.enabled;
|
|
1756
|
+
}, Ve = () => {
|
|
1757
|
+
h.value = !0, H(), e.errorMessages = [], ke();
|
|
1758
|
+
}, ce = () => {
|
|
1759
|
+
switch (ke(), e.fields.name = `${le.name}-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, w.value) {
|
|
1123
1760
|
case "url":
|
|
1124
|
-
e.fields.url = `${
|
|
1761
|
+
e.fields.url = `${le.protocol}://${le.host}${le.path}`;
|
|
1125
1762
|
break;
|
|
1126
1763
|
case "protocol":
|
|
1127
|
-
e.fields.host =
|
|
1764
|
+
e.fields.host = le.host, e.fields.path = le.path, e.fields.protocol = le.protocol, e.fields.port = le.port;
|
|
1128
1765
|
break;
|
|
1129
1766
|
default:
|
|
1130
|
-
e.fields.url = `${
|
|
1767
|
+
e.fields.url = `${le.protocol}://${le.host}${le.path}`;
|
|
1131
1768
|
}
|
|
1132
|
-
},
|
|
1133
|
-
if (
|
|
1769
|
+
}, ge = () => {
|
|
1770
|
+
if (H(), e.fields.url.length)
|
|
1134
1771
|
try {
|
|
1135
|
-
const t = new URL(e.fields.url),
|
|
1136
|
-
if (
|
|
1772
|
+
const t = new URL(e.fields.url), s = ae(t.protocol, q);
|
|
1773
|
+
if (s) throw new Error(s);
|
|
1137
1774
|
e.fields.protocol = t.protocol.slice(0, -1);
|
|
1138
|
-
const
|
|
1139
|
-
if (
|
|
1775
|
+
const E = be(t.hostname);
|
|
1776
|
+
if (E) throw new Error(E);
|
|
1140
1777
|
e.fields.host = t.hostname;
|
|
1141
|
-
const
|
|
1142
|
-
if (
|
|
1778
|
+
const O = Y(t.pathname);
|
|
1779
|
+
if (O) throw new Error(O);
|
|
1143
1780
|
e.fields.path = t.pathname;
|
|
1144
|
-
const
|
|
1145
|
-
if (
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1781
|
+
const U = he(t.port);
|
|
1782
|
+
if (U) throw new Error(U);
|
|
1783
|
+
const T = Number(t.port);
|
|
1784
|
+
Ie.value = !!T, e.fields.port = T || ie.getPortFromProtocol(e.fields.protocol), v("url-valid:success");
|
|
1148
1785
|
} catch {
|
|
1149
|
-
|
|
1786
|
+
v("url-valid:error", r("gateway_services.form.errors.url.invalid")), e.formFieldErrors.url = r("gateway_services.form.errors.url.invalid");
|
|
1150
1787
|
}
|
|
1151
|
-
},
|
|
1152
|
-
|
|
1153
|
-
},
|
|
1788
|
+
}, ye = (t) => {
|
|
1789
|
+
H(t);
|
|
1790
|
+
}, Ee = k(() => !!e.formFieldErrors.url || !!e.formFieldErrors.host || !!e.formFieldErrors.port), ee = (t) => {
|
|
1154
1791
|
if (e.errorMessages.length) return "";
|
|
1155
|
-
const
|
|
1156
|
-
return
|
|
1157
|
-
},
|
|
1158
|
-
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
const
|
|
1164
|
-
|
|
1165
|
-
},
|
|
1792
|
+
const s = e.formFieldErrors;
|
|
1793
|
+
return s[t] ? s[t] : "";
|
|
1794
|
+
}, z = (t) => {
|
|
1795
|
+
H(t ?? void 0);
|
|
1796
|
+
const s = be(e.fields.host);
|
|
1797
|
+
s && (e.formFieldErrors.host = s);
|
|
1798
|
+
const E = Y(e.fields.path);
|
|
1799
|
+
E && (e.formFieldErrors.path = E);
|
|
1800
|
+
const O = he(e.fields.port);
|
|
1801
|
+
O && (e.formFieldErrors.port = O), te.value ? v("url-valid:success") : v("url-valid:error", e.errorMessages.join(",") || r("gateway_services.form.errors.url.invalid"));
|
|
1802
|
+
}, H = (t) => {
|
|
1166
1803
|
if (t)
|
|
1167
1804
|
e.formFieldErrors[t] = "";
|
|
1168
1805
|
else
|
|
1169
|
-
for (let
|
|
1170
|
-
e.formFieldErrors[
|
|
1806
|
+
for (let s in e.formFieldErrors)
|
|
1807
|
+
e.formFieldErrors[s] = "";
|
|
1171
1808
|
e.errorMessages = [];
|
|
1172
|
-
},
|
|
1809
|
+
}, te = k(() => {
|
|
1173
1810
|
for (let t in e.formFieldErrors)
|
|
1174
1811
|
if (e.formFieldErrors[t].length)
|
|
1175
1812
|
return !1;
|
|
1176
1813
|
return !0;
|
|
1177
|
-
}),
|
|
1178
|
-
e.fields.url &&
|
|
1179
|
-
},
|
|
1180
|
-
if (
|
|
1814
|
+
}), de = () => {
|
|
1815
|
+
e.fields.url && w.value === "url" ? ge() : z();
|
|
1816
|
+
}, i = () => `new-service-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, f = k(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(e.fields.protocol)), V = k(() => {
|
|
1817
|
+
if (w.value === "url")
|
|
1181
1818
|
return !0;
|
|
1182
1819
|
const t = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
1183
|
-
return
|
|
1184
|
-
}),
|
|
1185
|
-
if (
|
|
1820
|
+
return w.value === "protocol" && t;
|
|
1821
|
+
}), J = k(() => {
|
|
1822
|
+
if (w.value === "url")
|
|
1186
1823
|
return !0;
|
|
1187
1824
|
const t = ["https", "tls"].includes(e.fields.protocol);
|
|
1188
|
-
return
|
|
1189
|
-
}),
|
|
1190
|
-
if (
|
|
1825
|
+
return w.value === "protocol" && t;
|
|
1826
|
+
}), B = k(() => {
|
|
1827
|
+
if (w.value === "url")
|
|
1191
1828
|
return !0;
|
|
1192
1829
|
const t = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
1193
|
-
return
|
|
1194
|
-
}),
|
|
1195
|
-
|
|
1196
|
-
},
|
|
1197
|
-
const t = !
|
|
1198
|
-
return t && (
|
|
1199
|
-
}),
|
|
1200
|
-
var
|
|
1201
|
-
e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((
|
|
1202
|
-
},
|
|
1203
|
-
|
|
1204
|
-
},
|
|
1205
|
-
var
|
|
1206
|
-
let t = `${a.config.apiBaseUrl}${
|
|
1207
|
-
return a.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((
|
|
1208
|
-
}),
|
|
1209
|
-
var
|
|
1210
|
-
let t = `${a.config.apiBaseUrl}${
|
|
1211
|
-
return a.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((
|
|
1212
|
-
}),
|
|
1213
|
-
let
|
|
1214
|
-
t.url && (
|
|
1215
|
-
},
|
|
1216
|
-
var
|
|
1830
|
+
return w.value === "protocol" && t;
|
|
1831
|
+
}), R = (t) => {
|
|
1832
|
+
H("name"), ve.value = Se.utf8Name(t);
|
|
1833
|
+
}, c = k(() => {
|
|
1834
|
+
const t = !o.value || !x(e.fields, $), s = w.value === "url" && !!e.fields.url && te.value, E = w.value === "protocol" && !!e.fields.host && te.value;
|
|
1835
|
+
return t && (s || E);
|
|
1836
|
+
}), g = (t) => {
|
|
1837
|
+
var s, E, O;
|
|
1838
|
+
e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((s = t == null ? void 0 : t.tags) == null ? void 0 : s.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 = ((E = t == null ? void 0 : t.ca_certificates) == null ? void 0 : E.join(",")) || "", e.fields.client_certificate = ((O = t == null ? void 0 : t.client_certificate) == null ? void 0 : O.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($, e.fields);
|
|
1839
|
+
}, p = () => {
|
|
1840
|
+
L.push(a.config.cancelRoute);
|
|
1841
|
+
}, C = k(() => {
|
|
1842
|
+
var s, E;
|
|
1843
|
+
let t = `${a.config.apiBaseUrl}${pe.form[a.config.app].validate}`;
|
|
1844
|
+
return a.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((s = a.config) == null ? void 0 : s.controlPlaneId) || "") : a.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (E = a.config) != null && E.workspace ? `/${a.config.workspace}` : "")), t = t.replace(/{id}/gi, a.gatewayServiceId), t;
|
|
1845
|
+
}), K = k(() => {
|
|
1846
|
+
var s, E;
|
|
1847
|
+
let t = `${a.config.apiBaseUrl}${pe.form[a.config.app][N.value]}`;
|
|
1848
|
+
return a.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((s = a.config) == null ? void 0 : s.controlPlaneId) || "") : a.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (E = a.config) != null && E.workspace ? `/${a.config.workspace}` : "")), t = t.replace(/{id}/gi, a.gatewayServiceId), t;
|
|
1849
|
+
}), ue = (t) => {
|
|
1850
|
+
let s = "";
|
|
1851
|
+
t.url && (s = new URL(t.url).protocol), (["https", "wss", "tls"].includes(t.protocol) || ["https", "wss", "tls"].includes(s)) && (t.tls_verify = t.tls_verify_enabled ? t.tls_verify_value : null), delete t.tls_verify_enabled, delete t.tls_verify_value;
|
|
1852
|
+
}, G = k(() => {
|
|
1853
|
+
var s, E, O, U;
|
|
1217
1854
|
const t = {
|
|
1218
1855
|
name: e.fields.name || null,
|
|
1219
|
-
tags: e.fields.tags ? (
|
|
1856
|
+
tags: e.fields.tags ? (O = (E = (s = e.fields.tags) == null ? void 0 : s.split(",")) == null ? void 0 : E.map((T) => String(T || "").trim())) == null ? void 0 : O.filter((T) => T !== "") : null,
|
|
1220
1857
|
protocol: e.fields.protocol,
|
|
1221
1858
|
path: e.fields.path || null,
|
|
1222
1859
|
read_timeout: e.fields.read_timeout,
|
|
@@ -1225,139 +1862,140 @@ const Y = {
|
|
|
1225
1862
|
connect_timeout: e.fields.connect_timeout,
|
|
1226
1863
|
tls_verify_value: e.fields.tls_verify_value,
|
|
1227
1864
|
tls_verify_enabled: e.fields.tls_verify_enabled,
|
|
1228
|
-
ca_certificates: e.fields.ca_certificates ? (
|
|
1865
|
+
ca_certificates: e.fields.ca_certificates ? (U = e.fields.ca_certificates) == null ? void 0 : U.split(",").filter((T) => T !== "") : null,
|
|
1229
1866
|
client_certificate: e.fields.client_certificate ? { id: e.fields.client_certificate } : null,
|
|
1230
1867
|
write_timeout: e.fields.write_timeout,
|
|
1231
1868
|
port: e.fields.port,
|
|
1232
|
-
url: e.fields.url
|
|
1869
|
+
url: e.fields.url,
|
|
1870
|
+
enabled: e.fields.enabled
|
|
1233
1871
|
};
|
|
1234
|
-
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),
|
|
1235
|
-
}),
|
|
1236
|
-
var t,
|
|
1872
|
+
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), f.value || (t.path = null), N.value === "create" ? w.value === "url" ? (delete t.protocol, delete t.host, delete t.path, a.config.app === "konnect" && delete t.port) : delete t.url : N.value === "edit" && delete t.url, t;
|
|
1873
|
+
}), fe = async () => {
|
|
1874
|
+
var t, s, E, O;
|
|
1237
1875
|
try {
|
|
1238
1876
|
e.isReadonly = !0;
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1241
|
-
let
|
|
1242
|
-
if (await
|
|
1243
|
-
const { data:
|
|
1244
|
-
e.fields.name = (
|
|
1877
|
+
const U = G.value;
|
|
1878
|
+
ue(U);
|
|
1879
|
+
let T;
|
|
1880
|
+
if (await A.post(C.value, U), N.value === "create" ? T = await A.post(K.value, U) : N.value === "edit" && (T = ((t = a.config) == null ? void 0 : t.app) === "konnect" ? await A.put(K.value, U) : await A.patch(K.value, U)), T) {
|
|
1881
|
+
const { data: d } = T;
|
|
1882
|
+
e.fields.name = (d == null ? void 0 : d.name) || "", e.fields.port = d.port || ie.getPortFromProtocol(d.protocol), e.fields.protocol = (d == null ? void 0 : d.protocol) || "http", e.fields.host = (d == null ? void 0 : d.host) || "", e.fields.path = (d == null ? void 0 : d.path) || "", e.fields.url = (d == null ? void 0 : d.url) || "", e.fields.retries = d != null && d.retries || (d == null ? void 0 : d.retries) === 0 ? d == null ? void 0 : d.retries : 5, e.fields.connect_timeout = d != null && d.connect_timeout || (d == null ? void 0 : d.connect_timeout) === 0 ? d == null ? void 0 : d.connect_timeout : 6e4, e.fields.write_timeout = d != null && d.write_timeout || (d == null ? void 0 : d.write_timeout) === 0 ? d == null ? void 0 : d.write_timeout : 6e4, e.fields.read_timeout = d != null && d.read_timeout || (d == null ? void 0 : d.read_timeout) === 0 ? d == null ? void 0 : d.read_timeout : 6e4, e.fields.client_certificate = ((s = d == null ? void 0 : d.client_certificate) == null ? void 0 : s.id) || "", e.fields.ca_certificates = (E = d == null ? void 0 : d.ca_certificates) != null && E.length ? d == null ? void 0 : d.ca_certificates.join(",") : "", e.fields.tls_verify_enabled = (d == null ? void 0 : d.tls_verify) !== "" && (d == null ? void 0 : d.tls_verify) !== null && (d == null ? void 0 : d.tls_verify) !== void 0, e.fields.tls_verify_value = e.fields.tls_verify_enabled && (d == null ? void 0 : d.tls_verify), e.fields.tags = (O = d == null ? void 0 : d.tags) != null && O.length ? d.tags.join(", ") : "", e.fields.enabled = (d == null ? void 0 : d.enabled) ?? !0, Object.assign($, e.fields), v("update", T == null ? void 0 : T.data);
|
|
1245
1883
|
}
|
|
1246
|
-
return
|
|
1247
|
-
} catch (
|
|
1248
|
-
const { fields:
|
|
1249
|
-
e.errorMessages =
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1884
|
+
return T;
|
|
1885
|
+
} catch (U) {
|
|
1886
|
+
const { fields: T, messages: d } = j(U);
|
|
1887
|
+
e.errorMessages = d, T.length && T.forEach((_e) => {
|
|
1888
|
+
const Ce = _e.field;
|
|
1889
|
+
Ce === "client_certificate.id" ? e.formFieldErrors.client_certificate = _e.message : Ce.startsWith("ca_certificates") ? e.formFieldErrors.ca_certificates = _e.message : Object.keys(e.formFieldErrors).includes(Ce) && (e.formFieldErrors = {
|
|
1252
1890
|
...e.formFieldErrors,
|
|
1253
|
-
[
|
|
1891
|
+
[Ce]: _e.message
|
|
1254
1892
|
});
|
|
1255
|
-
}),
|
|
1893
|
+
}), v("error", U);
|
|
1256
1894
|
} finally {
|
|
1257
1895
|
e.isReadonly = !1;
|
|
1258
1896
|
}
|
|
1259
1897
|
};
|
|
1260
|
-
return
|
|
1261
|
-
Object.assign(e.fields,
|
|
1262
|
-
}),
|
|
1263
|
-
e.fields.port =
|
|
1264
|
-
}),
|
|
1265
|
-
|
|
1266
|
-
}),
|
|
1267
|
-
validateUrl:
|
|
1268
|
-
getPayload:
|
|
1269
|
-
saveFormData:
|
|
1270
|
-
canSubmit:
|
|
1271
|
-
initForm:
|
|
1272
|
-
}), (t,
|
|
1273
|
-
const
|
|
1274
|
-
return
|
|
1275
|
-
|
|
1276
|
-
"can-submit":
|
|
1277
|
-
config:
|
|
1278
|
-
"edit-id":
|
|
1279
|
-
"entity-type":
|
|
1280
|
-
"fetch-url":
|
|
1281
|
-
"form-fields":
|
|
1898
|
+
return Fe(() => a.gatewayServiceId, () => {
|
|
1899
|
+
Object.assign(e.fields, $);
|
|
1900
|
+
}), Fe(e.fields, (t) => {
|
|
1901
|
+
e.fields.port = ie.getPortFromProtocol(t.protocol, String(t.port)), v("model-updated", G.value);
|
|
1902
|
+
}), He(() => {
|
|
1903
|
+
v("model-updated", G.value), o.value || (e.fields.name = i());
|
|
1904
|
+
}), X({
|
|
1905
|
+
validateUrl: de,
|
|
1906
|
+
getPayload: G,
|
|
1907
|
+
saveFormData: fe,
|
|
1908
|
+
canSubmit: c,
|
|
1909
|
+
initForm: g
|
|
1910
|
+
}), (t, s) => {
|
|
1911
|
+
const E = W("KRadio"), O = W("KButton"), U = W("KInput"), T = W("KSelect"), d = W("KCheckbox"), _e = W("KCollapse"), Ce = W("KAlert");
|
|
1912
|
+
return S(), F("div", ol, [
|
|
1913
|
+
u(l(Ye), {
|
|
1914
|
+
"can-submit": c.value,
|
|
1915
|
+
config: n.config,
|
|
1916
|
+
"edit-id": n.gatewayServiceId,
|
|
1917
|
+
"entity-type": l(Oe).GatewayService,
|
|
1918
|
+
"fetch-url": me.value,
|
|
1919
|
+
"form-fields": G.value,
|
|
1282
1920
|
"is-readonly": e.isReadonly,
|
|
1283
|
-
onCancel:
|
|
1284
|
-
"onFetch:error":
|
|
1285
|
-
"onFetch:success":
|
|
1286
|
-
onLoading:
|
|
1287
|
-
onSubmit:
|
|
1921
|
+
onCancel: p,
|
|
1922
|
+
"onFetch:error": s[30] || (s[30] = (y) => t.$emit("error", y)),
|
|
1923
|
+
"onFetch:success": g,
|
|
1924
|
+
onLoading: s[31] || (s[31] = (y) => t.$emit("loading", y)),
|
|
1925
|
+
onSubmit: fe
|
|
1288
1926
|
}, {
|
|
1289
|
-
"form-actions":
|
|
1290
|
-
|
|
1291
|
-
canSubmit:
|
|
1292
|
-
cancel:
|
|
1293
|
-
submit:
|
|
1927
|
+
"form-actions": m(() => [
|
|
1928
|
+
Ze(t.$slots, "form-actions", {
|
|
1929
|
+
canSubmit: c.value,
|
|
1930
|
+
cancel: p,
|
|
1931
|
+
submit: fe
|
|
1294
1932
|
}, void 0, !0)
|
|
1295
1933
|
]),
|
|
1296
|
-
default:
|
|
1297
|
-
|
|
1298
|
-
description:
|
|
1299
|
-
"hide-info-header":
|
|
1300
|
-
title:
|
|
1934
|
+
default: m(() => [
|
|
1935
|
+
u(l(Ke), {
|
|
1936
|
+
description: l(r)("gateway_services.form.sections.keys.description"),
|
|
1937
|
+
"hide-info-header": n.hideSectionsInfo,
|
|
1938
|
+
title: l(r)("gateway_services.form.sections.keys.title")
|
|
1301
1939
|
}, {
|
|
1302
|
-
default:
|
|
1303
|
-
|
|
1304
|
-
I("div",
|
|
1305
|
-
|
|
1306
|
-
modelValue:
|
|
1307
|
-
"onUpdate:modelValue":
|
|
1940
|
+
default: m(() => [
|
|
1941
|
+
o.value ? M("", !0) : (S(), F("div", il, [
|
|
1942
|
+
I("div", rl, [
|
|
1943
|
+
u(E, {
|
|
1944
|
+
modelValue: w.value,
|
|
1945
|
+
"onUpdate:modelValue": s[0] || (s[0] = (y) => w.value = y),
|
|
1308
1946
|
card: "",
|
|
1309
1947
|
"card-orientation": "horizontal",
|
|
1310
1948
|
"data-testid": "gateway-service-url-radio",
|
|
1311
|
-
description:
|
|
1312
|
-
label:
|
|
1313
|
-
"selected-value":
|
|
1314
|
-
onChange:
|
|
1949
|
+
description: l(r)("gateway_services.form.sections.keys.url.description"),
|
|
1950
|
+
label: l(r)("gateway_services.form.sections.keys.url.label"),
|
|
1951
|
+
"selected-value": re.url,
|
|
1952
|
+
onChange: Ve
|
|
1315
1953
|
}, null, 8, ["modelValue", "description", "label", "selected-value"]),
|
|
1316
|
-
|
|
1317
|
-
modelValue:
|
|
1318
|
-
"onUpdate:modelValue":
|
|
1954
|
+
u(E, {
|
|
1955
|
+
modelValue: w.value,
|
|
1956
|
+
"onUpdate:modelValue": s[1] || (s[1] = (y) => w.value = y),
|
|
1319
1957
|
card: "",
|
|
1320
1958
|
"card-orientation": "horizontal",
|
|
1321
1959
|
"checked-group": "protocol",
|
|
1322
1960
|
"data-testid": "gateway-service-protocol-radio",
|
|
1323
|
-
description:
|
|
1324
|
-
label:
|
|
1325
|
-
"selected-value":
|
|
1326
|
-
onChange:
|
|
1961
|
+
description: l(r)("gateway_services.form.sections.keys.protocol.description"),
|
|
1962
|
+
label: l(r)("gateway_services.form.sections.keys.protocol.label"),
|
|
1963
|
+
"selected-value": re.protocol,
|
|
1964
|
+
onChange: Ve
|
|
1327
1965
|
}, null, 8, ["modelValue", "description", "label", "selected-value"])
|
|
1328
1966
|
]),
|
|
1329
|
-
|
|
1330
|
-
default:
|
|
1331
|
-
|
|
1332
|
-
|
|
1967
|
+
u(We, { name: "slide-fade" }, {
|
|
1968
|
+
default: m(() => [
|
|
1969
|
+
w.value === "url" ? (S(), F("div", sl, [
|
|
1970
|
+
u(U, {
|
|
1333
1971
|
modelValue: e.fields.url,
|
|
1334
|
-
"onUpdate:modelValue":
|
|
1972
|
+
"onUpdate:modelValue": s[2] || (s[2] = (y) => e.fields.url = y),
|
|
1335
1973
|
modelModifiers: { trim: !0 },
|
|
1336
1974
|
class: "gateway-service-url-input gateway-service-form-margin-bottom",
|
|
1337
1975
|
"data-testid": "gateway-service-url-input",
|
|
1338
|
-
error:
|
|
1339
|
-
"error-message":
|
|
1340
|
-
label:
|
|
1976
|
+
error: Ee.value,
|
|
1977
|
+
"error-message": ee("url"),
|
|
1978
|
+
label: l(r)("gateway_services.form.fields.upstream_url.label"),
|
|
1341
1979
|
"label-attributes": {
|
|
1342
|
-
info:
|
|
1980
|
+
info: n.config.app === "konnect" ? l(r)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : l(r)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
|
|
1343
1981
|
tooltipAttributes: { maxWidth: "400" }
|
|
1344
1982
|
},
|
|
1345
1983
|
name: "url",
|
|
1346
|
-
placeholder:
|
|
1984
|
+
placeholder: l(r)("gateway_services.form.fields.upstream_url.placeholder"),
|
|
1347
1985
|
required: "",
|
|
1348
|
-
onInput:
|
|
1349
|
-
},
|
|
1350
|
-
|
|
1986
|
+
onInput: ge
|
|
1987
|
+
}, Te({ _: 2 }, [
|
|
1988
|
+
n.hideTrySampleApiButton ? void 0 : {
|
|
1351
1989
|
name: "after",
|
|
1352
|
-
fn:
|
|
1353
|
-
|
|
1990
|
+
fn: m(() => [
|
|
1991
|
+
u(O, {
|
|
1354
1992
|
appearance: "tertiary",
|
|
1355
1993
|
"data-testid": "try-sample-api",
|
|
1356
1994
|
size: "small",
|
|
1357
|
-
onClick:
|
|
1995
|
+
onClick: ce
|
|
1358
1996
|
}, {
|
|
1359
|
-
default:
|
|
1360
|
-
|
|
1997
|
+
default: m(() => [
|
|
1998
|
+
Z(P(l(r)("gateway_services.form.buttons.try_sample")), 1)
|
|
1361
1999
|
]),
|
|
1362
2000
|
_: 1
|
|
1363
2001
|
})
|
|
@@ -1365,57 +2003,57 @@ const Y = {
|
|
|
1365
2003
|
key: "0"
|
|
1366
2004
|
}
|
|
1367
2005
|
]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
|
|
1368
|
-
])) :
|
|
2006
|
+
])) : M("", !0)
|
|
1369
2007
|
]),
|
|
1370
2008
|
_: 1
|
|
1371
2009
|
})
|
|
1372
2010
|
])),
|
|
1373
|
-
|
|
1374
|
-
default:
|
|
1375
|
-
|
|
1376
|
-
|
|
2011
|
+
u(We, { name: "slide-fade" }, {
|
|
2012
|
+
default: m(() => [
|
|
2013
|
+
w.value === "protocol" || o.value ? (S(), F("div", al, [
|
|
2014
|
+
u(T, {
|
|
1377
2015
|
modelValue: e.fields.protocol,
|
|
1378
|
-
"onUpdate:modelValue":
|
|
2016
|
+
"onUpdate:modelValue": s[3] || (s[3] = (y) => e.fields.protocol = y),
|
|
1379
2017
|
"data-testid": "gateway-service-protocol-select",
|
|
1380
|
-
items:
|
|
1381
|
-
label:
|
|
2018
|
+
items: q,
|
|
2019
|
+
label: l(r)("gateway_services.form.fields.protocol.label"),
|
|
1382
2020
|
"label-attributes": {
|
|
1383
|
-
info:
|
|
2021
|
+
info: l(r)("gateway_services.form.fields.protocol.tooltip"),
|
|
1384
2022
|
tooltipAttributes: { maxWidth: "400" }
|
|
1385
2023
|
},
|
|
1386
2024
|
readonly: e.isReadonly,
|
|
1387
2025
|
required: "",
|
|
1388
2026
|
width: "100%",
|
|
1389
|
-
onSelected:
|
|
2027
|
+
onSelected: s[4] || (s[4] = (y) => Pe(e.fields.protocol, y))
|
|
1390
2028
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
|
|
1391
|
-
|
|
2029
|
+
u(U, {
|
|
1392
2030
|
modelValue: e.fields.host,
|
|
1393
|
-
"onUpdate:modelValue":
|
|
2031
|
+
"onUpdate:modelValue": s[5] || (s[5] = (y) => e.fields.host = y),
|
|
1394
2032
|
modelModifiers: { trim: !0 },
|
|
1395
2033
|
class: "gateway-service-form-margin-top",
|
|
1396
2034
|
"data-testid": "gateway-service-host-input",
|
|
1397
2035
|
error: !!e.formFieldErrors.host,
|
|
1398
|
-
"error-message":
|
|
1399
|
-
label:
|
|
2036
|
+
"error-message": ee("host"),
|
|
2037
|
+
label: l(r)("gateway_services.form.fields.host.label"),
|
|
1400
2038
|
"label-attributes": {
|
|
1401
|
-
info:
|
|
2039
|
+
info: l(r)("gateway_services.form.fields.host.tooltip"),
|
|
1402
2040
|
tooltipAttributes: { maxWidth: "400" }
|
|
1403
2041
|
},
|
|
1404
2042
|
name: "host",
|
|
1405
|
-
placeholder:
|
|
2043
|
+
placeholder: l(r)("gateway_services.form.fields.host.placeholder"),
|
|
1406
2044
|
required: "",
|
|
1407
|
-
onInput:
|
|
1408
|
-
},
|
|
1409
|
-
|
|
2045
|
+
onInput: s[6] || (s[6] = (y) => z("host"))
|
|
2046
|
+
}, Te({ _: 2 }, [
|
|
2047
|
+
n.hideTrySampleApiButton ? void 0 : {
|
|
1410
2048
|
name: "after",
|
|
1411
|
-
fn:
|
|
1412
|
-
|
|
2049
|
+
fn: m(() => [
|
|
2050
|
+
u(O, {
|
|
1413
2051
|
appearance: "tertiary",
|
|
1414
2052
|
size: "small",
|
|
1415
|
-
onClick:
|
|
2053
|
+
onClick: ce
|
|
1416
2054
|
}, {
|
|
1417
|
-
default:
|
|
1418
|
-
|
|
2055
|
+
default: m(() => [
|
|
2056
|
+
Z(P(l(r)("gateway_services.form.buttons.try_sample")), 1)
|
|
1419
2057
|
]),
|
|
1420
2058
|
_: 1
|
|
1421
2059
|
})
|
|
@@ -1423,75 +2061,75 @@ const Y = {
|
|
|
1423
2061
|
key: "0"
|
|
1424
2062
|
}
|
|
1425
2063
|
]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"]),
|
|
1426
|
-
|
|
1427
|
-
|
|
2064
|
+
f.value ? (S(), F("div", nl, [
|
|
2065
|
+
u(U, {
|
|
1428
2066
|
modelValue: e.fields.path,
|
|
1429
|
-
"onUpdate:modelValue":
|
|
2067
|
+
"onUpdate:modelValue": s[7] || (s[7] = (y) => e.fields.path = y),
|
|
1430
2068
|
modelModifiers: { trim: !0 },
|
|
1431
2069
|
class: "gateway-service-form-margin-top",
|
|
1432
2070
|
"data-testid": "gateway-service-path-input",
|
|
1433
2071
|
error: !!e.formFieldErrors.path,
|
|
1434
|
-
"error-message":
|
|
1435
|
-
label:
|
|
2072
|
+
"error-message": ee("path"),
|
|
2073
|
+
label: l(r)("gateway_services.form.fields.path.label"),
|
|
1436
2074
|
"label-attributes": {
|
|
1437
|
-
info:
|
|
2075
|
+
info: l(r)("gateway_services.form.fields.path.tooltip"),
|
|
1438
2076
|
tooltipAttributes: { maxWidth: "400" }
|
|
1439
2077
|
},
|
|
1440
2078
|
name: "path",
|
|
1441
|
-
placeholder:
|
|
1442
|
-
onInput:
|
|
2079
|
+
placeholder: l(r)("gateway_services.form.fields.path.placeholder"),
|
|
2080
|
+
onInput: s[8] || (s[8] = (y) => z("path"))
|
|
1443
2081
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
|
|
1444
|
-
])) :
|
|
1445
|
-
|
|
2082
|
+
])) : M("", !0),
|
|
2083
|
+
u(U, {
|
|
1446
2084
|
modelValue: e.fields.port,
|
|
1447
2085
|
"onUpdate:modelValue": [
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
e.fields.port =
|
|
2086
|
+
s[9] || (s[9] = (y) => e.fields.port = y),
|
|
2087
|
+
s[11] || (s[11] = () => {
|
|
2088
|
+
e.fields.port = oe(e.fields.port + "");
|
|
1451
2089
|
})
|
|
1452
2090
|
],
|
|
1453
2091
|
class: "gateway-service-form-margin-top",
|
|
1454
2092
|
"data-testid": "gateway-service-port-input",
|
|
1455
2093
|
error: !!e.formFieldErrors.port,
|
|
1456
|
-
"error-message":
|
|
1457
|
-
label:
|
|
2094
|
+
"error-message": ee("port"),
|
|
2095
|
+
label: l(r)("gateway_services.form.fields.port.label"),
|
|
1458
2096
|
"label-attributes": {
|
|
1459
|
-
info:
|
|
2097
|
+
info: l(r)("gateway_services.form.fields.port.tooltip"),
|
|
1460
2098
|
tooltipAttributes: { maxWidth: "400" }
|
|
1461
2099
|
},
|
|
1462
2100
|
name: "port",
|
|
1463
2101
|
type: "number",
|
|
1464
|
-
onInput:
|
|
2102
|
+
onInput: s[10] || (s[10] = (y) => z("port"))
|
|
1465
2103
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes"])
|
|
1466
|
-
])) :
|
|
2104
|
+
])) : M("", !0)
|
|
1467
2105
|
]),
|
|
1468
2106
|
_: 1
|
|
1469
2107
|
}),
|
|
1470
|
-
|
|
1471
|
-
modelValue:
|
|
1472
|
-
"onUpdate:modelValue":
|
|
2108
|
+
u(_e, {
|
|
2109
|
+
modelValue: h.value,
|
|
2110
|
+
"onUpdate:modelValue": s[27] || (s[27] = (y) => h.value = y),
|
|
1473
2111
|
"data-testid": "advanced-fields-collapse",
|
|
1474
2112
|
"trigger-alignment": "leading",
|
|
1475
|
-
"trigger-label":
|
|
2113
|
+
"trigger-label": l(r)("gateway_services.form.sections.keys.viewAdvancedFields")
|
|
1476
2114
|
}, {
|
|
1477
|
-
default:
|
|
1478
|
-
|
|
1479
|
-
default:
|
|
1480
|
-
|
|
1481
|
-
I("div",
|
|
1482
|
-
|
|
2115
|
+
default: m(() => [
|
|
2116
|
+
u(We, { name: "slide-fade" }, {
|
|
2117
|
+
default: m(() => [
|
|
2118
|
+
h.value ? M("", !0) : (S(), F("div", cl, [
|
|
2119
|
+
I("div", dl, [
|
|
2120
|
+
u(U, {
|
|
1483
2121
|
modelValue: e.fields.retries,
|
|
1484
2122
|
"onUpdate:modelValue": [
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
e.fields.retries =
|
|
2123
|
+
s[12] || (s[12] = (y) => e.fields.retries = y),
|
|
2124
|
+
s[13] || (s[13] = () => {
|
|
2125
|
+
e.fields.retries = oe(e.fields.retries + "");
|
|
1488
2126
|
})
|
|
1489
2127
|
],
|
|
1490
2128
|
autocomplete: "off",
|
|
1491
2129
|
"data-testid": "gateway-service-retries-input",
|
|
1492
|
-
label:
|
|
2130
|
+
label: l(r)("gateway_services.form.fields.retries.label"),
|
|
1493
2131
|
"label-attributes": {
|
|
1494
|
-
info:
|
|
2132
|
+
info: l(r)("gateway_services.form.fields.retries.tooltip"),
|
|
1495
2133
|
tooltipAttributes: { maxWidth: "400" }
|
|
1496
2134
|
},
|
|
1497
2135
|
name: "retries",
|
|
@@ -1499,20 +2137,20 @@ const Y = {
|
|
|
1499
2137
|
type: "number"
|
|
1500
2138
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1501
2139
|
]),
|
|
1502
|
-
I("div",
|
|
1503
|
-
|
|
2140
|
+
I("div", ul, [
|
|
2141
|
+
u(U, {
|
|
1504
2142
|
modelValue: e.fields.connect_timeout,
|
|
1505
2143
|
"onUpdate:modelValue": [
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
e.fields.connect_timeout =
|
|
2144
|
+
s[14] || (s[14] = (y) => e.fields.connect_timeout = y),
|
|
2145
|
+
s[15] || (s[15] = () => {
|
|
2146
|
+
e.fields.connect_timeout = oe(e.fields.connect_timeout + "");
|
|
1509
2147
|
})
|
|
1510
2148
|
],
|
|
1511
2149
|
autocomplete: "off",
|
|
1512
2150
|
"data-testid": "gateway-service-connTimeout-input",
|
|
1513
|
-
label:
|
|
2151
|
+
label: l(r)("gateway_services.form.fields.connect_timeout.label"),
|
|
1514
2152
|
"label-attributes": {
|
|
1515
|
-
info:
|
|
2153
|
+
info: l(r)("gateway_services.form.fields.connect_timeout.tooltip"),
|
|
1516
2154
|
tooltipAttributes: { maxWidth: "400" }
|
|
1517
2155
|
},
|
|
1518
2156
|
name: "connTimeout",
|
|
@@ -1520,20 +2158,20 @@ const Y = {
|
|
|
1520
2158
|
type: "number"
|
|
1521
2159
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1522
2160
|
]),
|
|
1523
|
-
I("div",
|
|
1524
|
-
|
|
2161
|
+
I("div", fl, [
|
|
2162
|
+
u(U, {
|
|
1525
2163
|
modelValue: e.fields.write_timeout,
|
|
1526
2164
|
"onUpdate:modelValue": [
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
e.fields.write_timeout =
|
|
2165
|
+
s[16] || (s[16] = (y) => e.fields.write_timeout = y),
|
|
2166
|
+
s[17] || (s[17] = () => {
|
|
2167
|
+
e.fields.write_timeout = oe(e.fields.write_timeout + "");
|
|
1530
2168
|
})
|
|
1531
2169
|
],
|
|
1532
2170
|
autocomplete: "off",
|
|
1533
2171
|
"data-testid": "gateway-service-writeTimeout-input",
|
|
1534
|
-
label:
|
|
2172
|
+
label: l(r)("gateway_services.form.fields.write_timeout.label"),
|
|
1535
2173
|
"label-attributes": {
|
|
1536
|
-
info:
|
|
2174
|
+
info: l(r)("gateway_services.form.fields.write_timeout.tooltip"),
|
|
1537
2175
|
tooltipAttributes: { maxWidth: "400" }
|
|
1538
2176
|
},
|
|
1539
2177
|
name: "writeTimeout",
|
|
@@ -1541,20 +2179,20 @@ const Y = {
|
|
|
1541
2179
|
type: "number"
|
|
1542
2180
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1543
2181
|
]),
|
|
1544
|
-
I("div",
|
|
1545
|
-
|
|
2182
|
+
I("div", pl, [
|
|
2183
|
+
u(U, {
|
|
1546
2184
|
modelValue: e.fields.read_timeout,
|
|
1547
2185
|
"onUpdate:modelValue": [
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
e.fields.read_timeout =
|
|
2186
|
+
s[18] || (s[18] = (y) => e.fields.read_timeout = y),
|
|
2187
|
+
s[19] || (s[19] = () => {
|
|
2188
|
+
e.fields.read_timeout = oe(e.fields.read_timeout + "");
|
|
1551
2189
|
})
|
|
1552
2190
|
],
|
|
1553
2191
|
autocomplete: "off",
|
|
1554
2192
|
"data-testid": "gateway-service-readTimeout-input",
|
|
1555
|
-
label:
|
|
2193
|
+
label: l(r)("gateway_services.form.fields.read_timeout.label"),
|
|
1556
2194
|
"label-attributes": {
|
|
1557
|
-
info:
|
|
2195
|
+
info: l(r)("gateway_services.form.fields.read_timeout.tooltip"),
|
|
1558
2196
|
tooltipAttributes: { maxWidth: "400" }
|
|
1559
2197
|
},
|
|
1560
2198
|
name: "readTimeout",
|
|
@@ -1562,99 +2200,99 @@ const Y = {
|
|
|
1562
2200
|
type: "number"
|
|
1563
2201
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1564
2202
|
]),
|
|
1565
|
-
|
|
1566
|
-
|
|
2203
|
+
V.value ? (S(), F("div", ml, [
|
|
2204
|
+
u(U, {
|
|
1567
2205
|
modelValue: e.fields.client_certificate,
|
|
1568
|
-
"onUpdate:modelValue":
|
|
2206
|
+
"onUpdate:modelValue": s[20] || (s[20] = (y) => e.fields.client_certificate = y),
|
|
1569
2207
|
modelModifiers: { trim: !0 },
|
|
1570
2208
|
autocomplete: "off",
|
|
1571
2209
|
"data-testid": "gateway-service-clientCert-input",
|
|
1572
2210
|
error: !!e.formFieldErrors.client_certificate,
|
|
1573
|
-
label:
|
|
2211
|
+
label: l(r)("gateway_services.form.fields.client_certificate.label"),
|
|
1574
2212
|
"label-attributes": {
|
|
1575
|
-
info:
|
|
2213
|
+
info: l(r)("gateway_services.form.fields.client_certificate.tooltip"),
|
|
1576
2214
|
tooltipAttributes: { maxWidth: "400" }
|
|
1577
2215
|
},
|
|
1578
2216
|
name: "clientCert",
|
|
1579
|
-
placeholder:
|
|
2217
|
+
placeholder: l(r)("gateway_services.form.fields.client_certificate.placeholder"),
|
|
1580
2218
|
readonly: e.isReadonly,
|
|
1581
2219
|
type: "text",
|
|
1582
|
-
onInput:
|
|
2220
|
+
onInput: s[21] || (s[21] = (y) => ye("client_certificate"))
|
|
1583
2221
|
}, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"])
|
|
1584
|
-
])) :
|
|
1585
|
-
|
|
1586
|
-
|
|
2222
|
+
])) : M("", !0),
|
|
2223
|
+
J.value ? (S(), F("div", vl, [
|
|
2224
|
+
u(U, {
|
|
1587
2225
|
modelValue: e.fields.ca_certificates,
|
|
1588
|
-
"onUpdate:modelValue":
|
|
2226
|
+
"onUpdate:modelValue": s[22] || (s[22] = (y) => e.fields.ca_certificates = y),
|
|
1589
2227
|
modelModifiers: { trim: !0 },
|
|
1590
2228
|
autocomplete: "off",
|
|
1591
2229
|
"data-testid": "gateway-service-ca-certs-input",
|
|
1592
2230
|
error: !!e.formFieldErrors.ca_certificates,
|
|
1593
|
-
label:
|
|
2231
|
+
label: l(r)("gateway_services.form.fields.ca_certificates.label"),
|
|
1594
2232
|
"label-attributes": { tooltipAttributes: { maxWidth: "400" } },
|
|
1595
|
-
placeholder:
|
|
2233
|
+
placeholder: l(r)("gateway_services.form.fields.ca_certificates.placeholder"),
|
|
1596
2234
|
readonly: e.isReadonly,
|
|
1597
2235
|
type: "text",
|
|
1598
|
-
onInput:
|
|
2236
|
+
onInput: s[23] || (s[23] = (y) => ye("ca_certificates"))
|
|
1599
2237
|
}, {
|
|
1600
|
-
"label-tooltip":
|
|
1601
|
-
|
|
2238
|
+
"label-tooltip": m(() => [
|
|
2239
|
+
u(l(Q), {
|
|
1602
2240
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1603
2241
|
scope: "global"
|
|
1604
2242
|
}, {
|
|
1605
|
-
code1:
|
|
1606
|
-
I("code", null,
|
|
2243
|
+
code1: m(() => [
|
|
2244
|
+
I("code", null, P(l(r)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
1607
2245
|
]),
|
|
1608
|
-
code2:
|
|
1609
|
-
I("code", null,
|
|
2246
|
+
code2: m(() => [
|
|
2247
|
+
I("code", null, P(l(r)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
1610
2248
|
]),
|
|
1611
2249
|
_: 1
|
|
1612
2250
|
})
|
|
1613
2251
|
]),
|
|
1614
2252
|
_: 1
|
|
1615
2253
|
}, 8, ["modelValue", "error", "label", "placeholder", "readonly"])
|
|
1616
|
-
])) :
|
|
1617
|
-
|
|
1618
|
-
|
|
2254
|
+
])) : M("", !0),
|
|
2255
|
+
B.value ? (S(), F("div", gl, [
|
|
2256
|
+
u(d, {
|
|
1619
2257
|
modelValue: e.fields.tls_verify_enabled,
|
|
1620
|
-
"onUpdate:modelValue":
|
|
2258
|
+
"onUpdate:modelValue": s[24] || (s[24] = (y) => e.fields.tls_verify_enabled = y),
|
|
1621
2259
|
"data-testid": "gateway-service-tls-verify-checkbox",
|
|
1622
|
-
description:
|
|
1623
|
-
label:
|
|
2260
|
+
description: l(r)("gateway_services.form.fields.tls_verify_enabled.help"),
|
|
2261
|
+
label: l(r)("gateway_services.form.fields.tls_verify_enabled.label"),
|
|
1624
2262
|
"label-attributes": { tooltipAttributes: { maxWidth: "400" } }
|
|
1625
2263
|
}, {
|
|
1626
|
-
tooltip:
|
|
1627
|
-
|
|
2264
|
+
tooltip: m(() => [
|
|
2265
|
+
u(l(Q), {
|
|
1628
2266
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
1629
2267
|
scope: "global"
|
|
1630
2268
|
}, {
|
|
1631
|
-
code1:
|
|
1632
|
-
I("code", null,
|
|
2269
|
+
code1: m(() => [
|
|
2270
|
+
I("code", null, P(l(r)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
1633
2271
|
]),
|
|
1634
2272
|
_: 1
|
|
1635
2273
|
})
|
|
1636
2274
|
]),
|
|
1637
2275
|
_: 1
|
|
1638
2276
|
}, 8, ["modelValue", "description", "label"]),
|
|
1639
|
-
e.fields.tls_verify_enabled ? (
|
|
1640
|
-
|
|
2277
|
+
e.fields.tls_verify_enabled ? (S(), F("div", yl, [
|
|
2278
|
+
u(E, {
|
|
1641
2279
|
modelValue: e.fields.tls_verify_value,
|
|
1642
|
-
"onUpdate:modelValue":
|
|
2280
|
+
"onUpdate:modelValue": s[25] || (s[25] = (y) => e.fields.tls_verify_value = y),
|
|
1643
2281
|
"data-testid": "gateway-service-tls-verify-true-option",
|
|
1644
|
-
label:
|
|
2282
|
+
label: l(r)("gateway_services.form.fields.tls_verify_option.true.label"),
|
|
1645
2283
|
"selected-value": !0
|
|
1646
2284
|
}, null, 8, ["modelValue", "label"])
|
|
1647
|
-
])) :
|
|
1648
|
-
e.fields.tls_verify_enabled ? (
|
|
1649
|
-
|
|
2285
|
+
])) : M("", !0),
|
|
2286
|
+
e.fields.tls_verify_enabled ? (S(), F("div", _l, [
|
|
2287
|
+
u(E, {
|
|
1650
2288
|
modelValue: e.fields.tls_verify_value,
|
|
1651
|
-
"onUpdate:modelValue":
|
|
2289
|
+
"onUpdate:modelValue": s[26] || (s[26] = (y) => e.fields.tls_verify_value = y),
|
|
1652
2290
|
"data-testid": "gateway-service-tls-verify-false-option",
|
|
1653
|
-
label:
|
|
2291
|
+
label: l(r)("gateway_services.form.fields.tls_verify_option.false.label"),
|
|
1654
2292
|
"selected-value": !1
|
|
1655
2293
|
}, null, 8, ["modelValue", "label"])
|
|
1656
|
-
])) :
|
|
1657
|
-
])) :
|
|
2294
|
+
])) : M("", !0)
|
|
2295
|
+
])) : M("", !0)
|
|
1658
2296
|
]))
|
|
1659
2297
|
]),
|
|
1660
2298
|
_: 1
|
|
@@ -1665,52 +2303,52 @@ const Y = {
|
|
|
1665
2303
|
]),
|
|
1666
2304
|
_: 1
|
|
1667
2305
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
1668
|
-
|
|
1669
|
-
description:
|
|
1670
|
-
"hide-info-header":
|
|
1671
|
-
title:
|
|
2306
|
+
u(l(Ke), {
|
|
2307
|
+
description: l(r)("gateway_services.form.sections.general.description"),
|
|
2308
|
+
"hide-info-header": n.hideSectionsInfo,
|
|
2309
|
+
title: l(r)("gateway_services.form.sections.general.title")
|
|
1672
2310
|
}, {
|
|
1673
|
-
default:
|
|
1674
|
-
|
|
2311
|
+
default: m(() => [
|
|
2312
|
+
u(U, {
|
|
1675
2313
|
modelValue: e.fields.name,
|
|
1676
|
-
"onUpdate:modelValue":
|
|
2314
|
+
"onUpdate:modelValue": s[28] || (s[28] = (y) => e.fields.name = y),
|
|
1677
2315
|
modelModifiers: { trim: !0 },
|
|
1678
2316
|
autocomplete: "off",
|
|
1679
2317
|
"data-testid": "gateway-service-name-input",
|
|
1680
|
-
error:
|
|
1681
|
-
"error-message":
|
|
1682
|
-
label:
|
|
2318
|
+
error: we.value,
|
|
2319
|
+
"error-message": ve.value,
|
|
2320
|
+
label: l(r)("gateway_services.form.fields.name.label"),
|
|
1683
2321
|
"label-attributes": {
|
|
1684
|
-
info:
|
|
2322
|
+
info: l(r)("gateway_services.form.fields.name.tooltip"),
|
|
1685
2323
|
tooltipAttributes: { maxWidth: "400" }
|
|
1686
2324
|
},
|
|
1687
2325
|
name: "name",
|
|
1688
|
-
placeholder:
|
|
2326
|
+
placeholder: l(r)("gateway_services.form.fields.name.placeholder"),
|
|
1689
2327
|
readonly: e.isReadonly,
|
|
1690
2328
|
type: "text",
|
|
1691
|
-
onInput:
|
|
2329
|
+
onInput: R
|
|
1692
2330
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1693
|
-
|
|
2331
|
+
u(_e, {
|
|
1694
2332
|
"data-testid": "tags-collapse",
|
|
1695
2333
|
"trigger-alignment": "leading",
|
|
1696
|
-
"trigger-label":
|
|
2334
|
+
"trigger-label": l(r)("gateway_services.form.fields.tags.collapse")
|
|
1697
2335
|
}, {
|
|
1698
|
-
default:
|
|
1699
|
-
I("div",
|
|
1700
|
-
|
|
2336
|
+
default: m(() => [
|
|
2337
|
+
I("div", bl, [
|
|
2338
|
+
u(U, {
|
|
1701
2339
|
modelValue: e.fields.tags,
|
|
1702
|
-
"onUpdate:modelValue":
|
|
2340
|
+
"onUpdate:modelValue": s[29] || (s[29] = (y) => e.fields.tags = y),
|
|
1703
2341
|
modelModifiers: { trim: !0 },
|
|
1704
2342
|
autocomplete: "off",
|
|
1705
2343
|
"data-testid": "gateway-service-tags-input",
|
|
1706
|
-
help:
|
|
1707
|
-
label:
|
|
2344
|
+
help: l(r)("gateway_services.form.fields.tags.help"),
|
|
2345
|
+
label: l(r)("gateway_services.form.fields.tags.label"),
|
|
1708
2346
|
"label-attributes": {
|
|
1709
|
-
info:
|
|
2347
|
+
info: l(r)("gateway_services.form.fields.tags.tooltip"),
|
|
1710
2348
|
tooltipAttributes: { maxWidth: "400" }
|
|
1711
2349
|
},
|
|
1712
2350
|
name: "tags",
|
|
1713
|
-
placeholder:
|
|
2351
|
+
placeholder: l(r)("gateway_services.form.fields.tags.placeholder"),
|
|
1714
2352
|
readonly: e.isReadonly,
|
|
1715
2353
|
type: "text"
|
|
1716
2354
|
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
|
|
@@ -1721,33 +2359,34 @@ const Y = {
|
|
|
1721
2359
|
]),
|
|
1722
2360
|
_: 1
|
|
1723
2361
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
1724
|
-
e.errorMessages.length ? (
|
|
2362
|
+
e.errorMessages.length ? (S(), $e(Ce, {
|
|
1725
2363
|
key: 0,
|
|
1726
2364
|
appearance: "danger",
|
|
1727
2365
|
"data-testid": "form-error"
|
|
1728
2366
|
}, {
|
|
1729
|
-
default:
|
|
1730
|
-
I("ul",
|
|
1731
|
-
(
|
|
2367
|
+
default: m(() => [
|
|
2368
|
+
I("ul", hl, [
|
|
2369
|
+
(S(!0), F(lt, null, ot(e.errorMessages, (y) => (S(), F("li", { key: y }, P(y), 1))), 128))
|
|
1732
2370
|
])
|
|
1733
2371
|
]),
|
|
1734
2372
|
_: 1
|
|
1735
|
-
})) :
|
|
2373
|
+
})) : M("", !0)
|
|
1736
2374
|
]),
|
|
1737
2375
|
_: 3
|
|
1738
2376
|
}, 8, ["can-submit", "config", "edit-id", "entity-type", "fetch-url", "form-fields", "is-readonly"])
|
|
1739
2377
|
]);
|
|
1740
2378
|
};
|
|
1741
2379
|
}
|
|
1742
|
-
}),
|
|
1743
|
-
validateHost:
|
|
1744
|
-
validatePort:
|
|
1745
|
-
validateProtocol:
|
|
1746
|
-
validatePath:
|
|
2380
|
+
}), Rl = /* @__PURE__ */ Ne(wl, [["__scopeId", "data-v-ce7f08af"]]), { validateHost: kl, validatePort: Vl, validateProtocol: Cl, validatePath: Sl } = se.useUrlValidators(), Tl = () => ({
|
|
2381
|
+
validateHost: kl,
|
|
2382
|
+
validatePort: Vl,
|
|
2383
|
+
validateProtocol: Cl,
|
|
2384
|
+
validatePath: Sl
|
|
1747
2385
|
});
|
|
1748
2386
|
export {
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
2387
|
+
xl as GatewayServiceConfigCard,
|
|
2388
|
+
Rl as GatewayServiceForm,
|
|
2389
|
+
Fl as GatewayServiceList,
|
|
2390
|
+
Al as LegacyGatewayServiceForm,
|
|
2391
|
+
Tl as useUrlValidator
|
|
1753
2392
|
};
|