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