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