@kong-ui-public/entities-gateway-services 3.8.2-pr.1660.b82a48cc.0 → 3.8.2-pr.1660.eb344441.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
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { AddIcon as
|
|
4
|
-
import { createI18n as
|
|
5
|
-
import { useAxios as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as Ve, ref as S, computed as w, watch as Ce, onBeforeMount as xe, resolveComponent as M, openBlock as k, createElementBlock as T, createVNode as u, unref as o, withCtx as p, createBlock as re, Teleport as Re, withDirectives as Ae, createTextVNode as U, toDisplayString as b, vShow as Fe, createElementVNode as V, withModifiers as ae, Fragment as $e, renderList as Be, reactive as Se, onMounted as De, renderSlot as Le, createCommentVNode as D } from "vue";
|
|
2
|
+
import { useRouter as Pe } from "vue-router";
|
|
3
|
+
import { AddIcon as Ge } from "@kong/icons";
|
|
4
|
+
import { createI18n as Ke, i18nTComponent as qe } from "@kong-ui-public/i18n";
|
|
5
|
+
import { useAxios as Ue, useFetcher as Ne, useDeleteUrlBuilder as We, FetcherStatus as Oe, EntityBaseTable as je, EntityFilter as He, PermissionsWrapper as te, EntityToggleModal as Je, EntityDeleteModal as ze, EntityTypes as Qe, useErrors as Xe, useValidators as Ye, EntityBaseFormType as Te, useGatewayFeatureSupported as Ze, EntityBaseForm as et, SupportedEntityType as Ee, EntityFormSection as Ie, useHelpers as tt, ConfigurationSchemaSection as ne, ConfigurationSchemaType as lt, EntityBaseConfigCard as ot } from "@kong-ui-public/entities-shared";
|
|
6
|
+
const it = {
|
|
7
7
|
create: "New Gateway Service",
|
|
8
8
|
serverless_create: "Add a Service",
|
|
9
9
|
copy_id: "Copy ID",
|
|
@@ -16,12 +16,12 @@ const st = {
|
|
|
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
|
+
}, st = {
|
|
20
20
|
placeholder: {
|
|
21
21
|
konnect: "Filter by name",
|
|
22
22
|
kongManager: "Filter by exact name or ID"
|
|
23
23
|
}
|
|
24
|
-
},
|
|
24
|
+
}, rt = {
|
|
25
25
|
title: "Gateway Services",
|
|
26
26
|
list: {
|
|
27
27
|
toolbar_actions: {
|
|
@@ -164,37 +164,37 @@ const st = {
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
},
|
|
167
|
+
}, at = {
|
|
168
168
|
general: "Gateway Services could not be retrieved",
|
|
169
169
|
delete: "The gateway service could not be deleted at this time.",
|
|
170
170
|
copy: "Failed to copy to clipboard",
|
|
171
171
|
urlErrorMessage: "Error: invalid URL"
|
|
172
|
-
},
|
|
172
|
+
}, nt = {
|
|
173
173
|
success: "Copied {val} to clipboard",
|
|
174
174
|
success_brief: "Successfully copied to clipboard"
|
|
175
|
-
},
|
|
175
|
+
}, ct = {
|
|
176
176
|
gateway_services: "gateway services"
|
|
177
|
-
},
|
|
178
|
-
actions:
|
|
179
|
-
search:
|
|
180
|
-
gateway_services:
|
|
181
|
-
errors:
|
|
182
|
-
copy:
|
|
183
|
-
glossary:
|
|
177
|
+
}, dt = {
|
|
178
|
+
actions: it,
|
|
179
|
+
search: st,
|
|
180
|
+
gateway_services: rt,
|
|
181
|
+
errors: at,
|
|
182
|
+
copy: nt,
|
|
183
|
+
glossary: ct
|
|
184
184
|
};
|
|
185
|
-
function
|
|
186
|
-
const
|
|
185
|
+
function ut() {
|
|
186
|
+
const a = Ke("en-us", dt);
|
|
187
187
|
return {
|
|
188
|
-
i18n:
|
|
189
|
-
i18nT:
|
|
188
|
+
i18n: a,
|
|
189
|
+
i18nT: qe(a)
|
|
190
190
|
// Translation component <i18n-t>
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function ft() {
|
|
194
194
|
return {
|
|
195
|
-
getPortFromProtocol: ($,
|
|
196
|
-
const
|
|
197
|
-
if ((r || r === 0) && !
|
|
195
|
+
getPortFromProtocol: ($, v) => {
|
|
196
|
+
const c = [80, 443], r = Number(v);
|
|
197
|
+
if ((r || r === 0) && !c.includes(r))
|
|
198
198
|
return r;
|
|
199
199
|
switch ($) {
|
|
200
200
|
case "grpcs":
|
|
@@ -212,38 +212,38 @@ function pt() {
|
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
-
const
|
|
216
|
-
useI18n:
|
|
217
|
-
usePortFromProtocol:
|
|
218
|
-
},
|
|
215
|
+
const ue = {
|
|
216
|
+
useI18n: ut,
|
|
217
|
+
usePortFromProtocol: ft
|
|
218
|
+
}, ce = "/v2/control-planes/{controlPlaneId}/core-entities", de = "/{workspace}", le = {
|
|
219
219
|
list: {
|
|
220
220
|
konnect: {
|
|
221
|
-
all: `${
|
|
221
|
+
all: `${ce}/services`
|
|
222
222
|
},
|
|
223
223
|
kongManager: {
|
|
224
|
-
all: `${
|
|
224
|
+
all: `${de}/services`
|
|
225
225
|
}
|
|
226
226
|
},
|
|
227
227
|
form: {
|
|
228
228
|
konnect: {
|
|
229
|
-
create: `${
|
|
230
|
-
validate: `${
|
|
231
|
-
edit: `${
|
|
229
|
+
create: `${ce}/services`,
|
|
230
|
+
validate: `${ce}/v1/schemas/json/service/validate`,
|
|
231
|
+
edit: `${ce}/services/{id}`
|
|
232
232
|
},
|
|
233
233
|
kongManager: {
|
|
234
|
-
create: `${
|
|
235
|
-
validate: `${
|
|
236
|
-
edit: `${
|
|
234
|
+
create: `${de}/services`,
|
|
235
|
+
validate: `${de}/schemas/services/validate`,
|
|
236
|
+
edit: `${de}/services/{id}`
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
},
|
|
239
|
+
}, pt = { class: "kong-ui-entities-gateway-services-list" }, mt = { key: 1 }, vt = { key: 1 }, yt = /* @__PURE__ */ Ve({
|
|
240
240
|
__name: "GatewayServiceList",
|
|
241
241
|
props: {
|
|
242
242
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
243
243
|
config: {
|
|
244
244
|
type: Object,
|
|
245
245
|
required: !0,
|
|
246
|
-
validator: (
|
|
246
|
+
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)
|
|
247
247
|
},
|
|
248
248
|
// used to override the default identifier for the cache entry
|
|
249
249
|
cacheIdentifier: {
|
|
@@ -286,12 +286,12 @@ const pe = {
|
|
|
286
286
|
}
|
|
287
287
|
},
|
|
288
288
|
emits: ["error", "copy:success", "copy:error", "delete:success", "toggle:success"],
|
|
289
|
-
setup(
|
|
290
|
-
var
|
|
291
|
-
const
|
|
289
|
+
setup(a, { emit: $ }) {
|
|
290
|
+
var g;
|
|
291
|
+
const v = $, c = a, { i18n: { t: r, formatUnixTimeStamp: x } } = ue.useI18n(), W = Pe(), { axiosInstance: L } = Ue((g = c.config) == null ? void 0 : g.axiosRequestConfig), s = S(1), P = w(() => c.config.app !== "kongManager" || !!c.config.disableSorting), h = {
|
|
292
292
|
// the Name column is non-hidable
|
|
293
293
|
name: { label: r("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
294
|
-
...
|
|
294
|
+
...c.config.showControlPlaneColumn ? { control_plane: { label: r("gateway_services.list.table_headers.control_plane") } } : {},
|
|
295
295
|
protocol: { label: r("gateway_services.list.table_headers.protocol"), searchable: !0, sortable: !0 },
|
|
296
296
|
host: { label: r("gateway_services.list.table_headers.host"), searchable: !0, sortable: !0 },
|
|
297
297
|
port: { label: r("gateway_services.list.table_headers.port"), searchable: !0, sortable: !0 },
|
|
@@ -300,316 +300,315 @@ const pe = {
|
|
|
300
300
|
tags: { label: r("gateway_services.list.table_headers.tags"), sortable: !1 },
|
|
301
301
|
updated_at: { label: r("gateway_services.list.table_headers.updated_at"), sortable: !0 },
|
|
302
302
|
created_at: { label: r("gateway_services.list.table_headers.created_at"), sortable: !0 }
|
|
303
|
-
},
|
|
303
|
+
}, fe = {
|
|
304
304
|
columnVisibility: {
|
|
305
305
|
created_at: !1
|
|
306
306
|
}
|
|
307
|
-
},
|
|
308
|
-
var f,
|
|
309
|
-
let
|
|
310
|
-
return
|
|
311
|
-
}),
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
307
|
+
}, pe = h, F = w(() => {
|
|
308
|
+
var f, m;
|
|
309
|
+
let n = `${c.config.apiBaseUrl}${le.list[c.config.app].all}`;
|
|
310
|
+
return c.config.app === "konnect" ? n = n.replace(/{controlPlaneId}/gi, ((f = c.config) == null ? void 0 : f.controlPlaneId) || "") : c.config.app === "kongManager" && (n = n.replace(/\/{workspace}/gi, (m = c.config) != null && m.workspace ? `/${c.config.workspace}` : "")), n;
|
|
311
|
+
}), me = w(() => c.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${F.value}`) : new URL(F.value)), B = S(""), C = w(() => {
|
|
312
|
+
const n = c.config.app === "konnect" || c.config.isExactMatch;
|
|
313
|
+
if (n)
|
|
314
314
|
return {
|
|
315
|
-
isExactMatch:
|
|
316
|
-
placeholder: r(`search.placeholder.${
|
|
315
|
+
isExactMatch: n,
|
|
316
|
+
placeholder: r(`search.placeholder.${c.config.app}`)
|
|
317
317
|
};
|
|
318
|
-
const { name: f, enabled:
|
|
318
|
+
const { name: f, enabled: m, protocol: l, host: A, port: d, path: N } = h;
|
|
319
319
|
return {
|
|
320
|
-
isExactMatch:
|
|
321
|
-
fields: { name: f, enabled:
|
|
322
|
-
schema:
|
|
320
|
+
isExactMatch: n,
|
|
321
|
+
fields: { name: f, enabled: m, protocol: l, host: A, port: d, path: N },
|
|
322
|
+
schema: c.config.filterSchema
|
|
323
323
|
};
|
|
324
|
-
}), { fetcher: H, fetcherState: J } =
|
|
324
|
+
}), { fetcher: H, fetcherState: J } = Ne(c.config, F.value), ve = () => {
|
|
325
325
|
B.value = "";
|
|
326
326
|
}, e = () => {
|
|
327
327
|
s.value++;
|
|
328
|
-
},
|
|
329
|
-
ctaPath:
|
|
330
|
-
ctaText:
|
|
331
|
-
message: `${r("gateway_services.list.empty_state.description")}${
|
|
332
|
-
title:
|
|
333
|
-
})),
|
|
334
|
-
const
|
|
328
|
+
}, _ = S(null), ye = w(() => ({
|
|
329
|
+
ctaPath: c.config.createRoute,
|
|
330
|
+
ctaText: i.value ? c.isServerless ? r("actions.serverless_create") : r("actions.create") : void 0,
|
|
331
|
+
message: `${r("gateway_services.list.empty_state.description")}${c.config.additionMessageForEmptyState ? ` ${c.config.additionMessageForEmptyState}` : ""}`,
|
|
332
|
+
title: i.value ? c.isServerless ? r("gateway_services.list.empty_state.serverless_title") : r("gateway_services.list.empty_state.title") : r("gateway_services.title")
|
|
333
|
+
})), z = S(!1), I = S(null), Q = w(() => {
|
|
334
|
+
const n = {
|
|
335
335
|
action: "disable",
|
|
336
336
|
id: "",
|
|
337
337
|
name: ""
|
|
338
338
|
};
|
|
339
|
-
if (
|
|
340
|
-
const { enabled: f, id:
|
|
341
|
-
|
|
339
|
+
if (I.value) {
|
|
340
|
+
const { enabled: f, id: m, name: l } = I.value;
|
|
341
|
+
n.action = f ? "disable" : "enable", n.id = m, n.name = l || m;
|
|
342
342
|
}
|
|
343
|
-
return
|
|
344
|
-
}),
|
|
345
|
-
|
|
346
|
-
},
|
|
347
|
-
|
|
348
|
-
},
|
|
349
|
-
var
|
|
350
|
-
if (!await ((
|
|
343
|
+
return n;
|
|
344
|
+
}), G = (n) => {
|
|
345
|
+
z.value = !0, I.value = n;
|
|
346
|
+
}, X = () => {
|
|
347
|
+
z.value = !1, I.value = null;
|
|
348
|
+
}, oe = async () => {
|
|
349
|
+
var l, A;
|
|
350
|
+
if (!await ((l = c.canEdit) == null ? void 0 : l.call(c, I.value)) || !I.value)
|
|
351
351
|
return;
|
|
352
|
-
const f = `${
|
|
352
|
+
const f = `${me.value.href}/${I.value.id}`, m = !I.value.enabled;
|
|
353
353
|
try {
|
|
354
|
-
const { data:
|
|
355
|
-
|
|
356
|
-
} catch (
|
|
357
|
-
|
|
354
|
+
const { data: d } = ((A = c.config) == null ? void 0 : A.app) === "konnect" ? await L.put(f, { ...I.value, enabled: m }) : await L.patch(f, { ...I.value, enabled: m });
|
|
355
|
+
v("toggle:success", d);
|
|
356
|
+
} catch (d) {
|
|
357
|
+
v("error", d);
|
|
358
358
|
}
|
|
359
|
-
|
|
360
|
-
},
|
|
361
|
-
|
|
362
|
-
},
|
|
363
|
-
const
|
|
364
|
-
if (!f(
|
|
365
|
-
|
|
366
|
-
entity:
|
|
359
|
+
I.value.enabled = m;
|
|
360
|
+
}, ie = (n) => {
|
|
361
|
+
c.config.getControlPlaneRoute && W.push(c.config.getControlPlaneRoute(n));
|
|
362
|
+
}, ge = (n, f) => {
|
|
363
|
+
const m = n.id;
|
|
364
|
+
if (!f(m)) {
|
|
365
|
+
v("copy:error", {
|
|
366
|
+
entity: n,
|
|
367
367
|
field: "id",
|
|
368
368
|
message: r("errors.copy")
|
|
369
369
|
});
|
|
370
370
|
return;
|
|
371
371
|
}
|
|
372
|
-
|
|
373
|
-
entity:
|
|
372
|
+
v("copy:success", {
|
|
373
|
+
entity: n,
|
|
374
374
|
field: "id",
|
|
375
|
-
message: r("copy.success", { val:
|
|
375
|
+
message: r("copy.success", { val: m })
|
|
376
376
|
});
|
|
377
|
-
},
|
|
378
|
-
const
|
|
379
|
-
if (!f(
|
|
380
|
-
|
|
381
|
-
entity:
|
|
377
|
+
}, _e = (n, f) => {
|
|
378
|
+
const m = JSON.stringify(n);
|
|
379
|
+
if (!f(m)) {
|
|
380
|
+
v("copy:error", {
|
|
381
|
+
entity: n,
|
|
382
382
|
message: r("errors.copy")
|
|
383
383
|
});
|
|
384
384
|
return;
|
|
385
385
|
}
|
|
386
|
-
|
|
387
|
-
entity:
|
|
386
|
+
v("copy:success", {
|
|
387
|
+
entity: n,
|
|
388
388
|
message: r("copy.success_brief")
|
|
389
389
|
});
|
|
390
|
-
},
|
|
391
|
-
var
|
|
392
|
-
await ((
|
|
393
|
-
},
|
|
390
|
+
}, be = async (n) => {
|
|
391
|
+
var m;
|
|
392
|
+
await ((m = c.canRetrieve) == null ? void 0 : m.call(c, n)) && W.push(c.config.getViewRoute(n.id));
|
|
393
|
+
}, he = (n) => ({
|
|
394
394
|
label: r("actions.view"),
|
|
395
|
-
to:
|
|
396
|
-
}),
|
|
395
|
+
to: c.config.getViewRoute(n)
|
|
396
|
+
}), Y = (n) => ({
|
|
397
397
|
label: r("actions.edit"),
|
|
398
|
-
to:
|
|
399
|
-
}),
|
|
400
|
-
|
|
401
|
-
},
|
|
402
|
-
|
|
403
|
-
},
|
|
404
|
-
var
|
|
405
|
-
if ((
|
|
406
|
-
|
|
398
|
+
to: c.config.getEditRoute(n)
|
|
399
|
+
}), R = S(void 0), O = S(!1), Z = S(!1), K = S(""), we = We(c.config, F.value), q = (n) => {
|
|
400
|
+
R.value = n, O.value = !0, K.value = "";
|
|
401
|
+
}, j = () => {
|
|
402
|
+
O.value = !1, R.value = void 0;
|
|
403
|
+
}, se = async () => {
|
|
404
|
+
var n, f, m;
|
|
405
|
+
if ((n = R.value) != null && n.id) {
|
|
406
|
+
Z.value = !0;
|
|
407
407
|
try {
|
|
408
|
-
await
|
|
409
|
-
} catch (
|
|
410
|
-
|
|
408
|
+
await L.delete(we(R.value.id)), v("delete:success", R.value), j(), s.value++;
|
|
409
|
+
} catch (l) {
|
|
410
|
+
K.value = ((m = (f = l.response) == null ? void 0 : f.data) == null ? void 0 : m.message) || l.message || r("errors.delete"), v("error", l);
|
|
411
411
|
} finally {
|
|
412
|
-
|
|
412
|
+
Z.value = !1;
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
},
|
|
416
|
-
|
|
417
|
-
var f,
|
|
418
|
-
if (Array.isArray((f =
|
|
419
|
-
|
|
415
|
+
}, t = S(!1);
|
|
416
|
+
Ce(J, (n) => {
|
|
417
|
+
var f, m, l, A;
|
|
418
|
+
if (Array.isArray((f = n == null ? void 0 : n.response) == null ? void 0 : f.data) && (t.value = n.response.data.length > 0), n.status === Oe.Error) {
|
|
419
|
+
_.value = {
|
|
420
420
|
title: r("errors.general")
|
|
421
|
-
}, (
|
|
421
|
+
}, (A = (l = (m = n.error) == null ? void 0 : m.response) == null ? void 0 : l.data) != null && A.message && (_.value.message = n.error.response.data.message), v("error", n.error);
|
|
422
422
|
return;
|
|
423
423
|
}
|
|
424
|
-
|
|
424
|
+
_.value = null;
|
|
425
425
|
});
|
|
426
|
-
const
|
|
427
|
-
return
|
|
428
|
-
|
|
429
|
-
}), (
|
|
430
|
-
const
|
|
431
|
-
return
|
|
432
|
-
u(o(
|
|
433
|
-
"cache-identifier":
|
|
434
|
-
"default-table-preferences":
|
|
435
|
-
"disable-sorting":
|
|
436
|
-
"empty-state-options":
|
|
426
|
+
const i = S(!1);
|
|
427
|
+
return xe(async () => {
|
|
428
|
+
i.value = await c.canCreate();
|
|
429
|
+
}), (n, f) => {
|
|
430
|
+
const m = M("KButton"), l = M("KBadge"), A = M("KInputSwitch"), d = M("KTruncate"), N = M("KDropdownItem"), ke = M("KClipboardProvider");
|
|
431
|
+
return k(), T("div", pt, [
|
|
432
|
+
u(o(je), {
|
|
433
|
+
"cache-identifier": a.cacheIdentifier,
|
|
434
|
+
"default-table-preferences": fe,
|
|
435
|
+
"disable-sorting": P.value,
|
|
436
|
+
"empty-state-options": ye.value,
|
|
437
437
|
"enable-entity-actions": "",
|
|
438
|
-
"error-message":
|
|
438
|
+
"error-message": _.value,
|
|
439
439
|
fetcher: o(H),
|
|
440
440
|
"fetcher-cache-key": s.value,
|
|
441
|
-
"hide-toolbar": z.value,
|
|
442
441
|
"pagination-type": "offset",
|
|
443
442
|
"preferences-storage-key": "kong-ui-entities-gateway-services-list",
|
|
444
443
|
query: B.value,
|
|
445
|
-
"table-headers": o(
|
|
446
|
-
onClearSearchInput:
|
|
447
|
-
"onClick:row": f[3] || (f[3] = (
|
|
444
|
+
"table-headers": o(pe),
|
|
445
|
+
onClearSearchInput: ve,
|
|
446
|
+
"onClick:row": f[3] || (f[3] = (y) => be(y)),
|
|
448
447
|
onSort: e
|
|
449
448
|
}, {
|
|
450
449
|
"toolbar-filter": p(() => [
|
|
451
|
-
u(o(
|
|
450
|
+
u(o(He), {
|
|
452
451
|
modelValue: B.value,
|
|
453
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
454
|
-
config:
|
|
452
|
+
"onUpdate:modelValue": f[0] || (f[0] = (y) => B.value = y),
|
|
453
|
+
config: C.value
|
|
455
454
|
}, null, 8, ["modelValue", "config"])
|
|
456
455
|
]),
|
|
457
456
|
"toolbar-button": p(() => [
|
|
458
|
-
(
|
|
459
|
-
disabled: !
|
|
457
|
+
(k(), re(Re, {
|
|
458
|
+
disabled: !a.useActionOutside,
|
|
460
459
|
to: "#kong-ui-app-page-header-action-button"
|
|
461
460
|
}, [
|
|
462
|
-
u(o(
|
|
463
|
-
"auth-function": () =>
|
|
461
|
+
u(o(te), {
|
|
462
|
+
"auth-function": () => a.canCreate()
|
|
464
463
|
}, {
|
|
465
464
|
default: p(() => [
|
|
466
|
-
|
|
465
|
+
Ae(u(m, {
|
|
467
466
|
appearance: "primary",
|
|
468
467
|
"data-testid": "toolbar-add-gateway-service",
|
|
469
|
-
size:
|
|
470
|
-
to:
|
|
468
|
+
size: a.useActionOutside ? "medium" : "large",
|
|
469
|
+
to: a.config.createRoute
|
|
471
470
|
}, {
|
|
472
471
|
default: p(() => [
|
|
473
|
-
u(o(
|
|
474
|
-
|
|
472
|
+
u(o(Ge)),
|
|
473
|
+
U(" " + b(o(r)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
|
|
475
474
|
]),
|
|
476
475
|
_: 1
|
|
477
476
|
}, 8, ["size", "to"]), [
|
|
478
|
-
[
|
|
477
|
+
[Fe, t.value]
|
|
479
478
|
])
|
|
480
479
|
]),
|
|
481
480
|
_: 1
|
|
482
481
|
}, 8, ["auth-function"])
|
|
483
482
|
], 8, ["disabled"]))
|
|
484
483
|
]),
|
|
485
|
-
name: p(({ rowValue:
|
|
486
|
-
|
|
484
|
+
name: p(({ rowValue: y }) => [
|
|
485
|
+
V("b", null, b(y ?? "-"), 1)
|
|
487
486
|
]),
|
|
488
|
-
control_plane: p(({ row:
|
|
489
|
-
var
|
|
487
|
+
control_plane: p(({ row: y }) => {
|
|
488
|
+
var E;
|
|
490
489
|
return [
|
|
491
|
-
(
|
|
490
|
+
(E = y.x_meta) != null && E.cluster_id ? (k(), re(l, {
|
|
492
491
|
key: 0,
|
|
493
|
-
tooltip:
|
|
492
|
+
tooltip: y.x_meta.cluster_id,
|
|
494
493
|
"truncation-tooltip": "",
|
|
495
|
-
onClick:
|
|
494
|
+
onClick: ae((ee) => ie(y.x_meta.cluster_id), ["stop"])
|
|
496
495
|
}, {
|
|
497
496
|
default: p(() => [
|
|
498
|
-
|
|
497
|
+
U(b(y.x_meta.cluster_id), 1)
|
|
499
498
|
]),
|
|
500
499
|
_: 2
|
|
501
|
-
}, 1032, ["tooltip", "onClick"])) : (
|
|
500
|
+
}, 1032, ["tooltip", "onClick"])) : (k(), T("b", mt, "-"))
|
|
502
501
|
];
|
|
503
502
|
}),
|
|
504
|
-
enabled: p(({ row:
|
|
505
|
-
u(o(
|
|
506
|
-
"auth-function": () =>
|
|
503
|
+
enabled: p(({ row: y }) => [
|
|
504
|
+
u(o(te), {
|
|
505
|
+
"auth-function": () => a.canEdit(y),
|
|
507
506
|
"force-show": ""
|
|
508
507
|
}, {
|
|
509
|
-
default: p(({ isAllowed:
|
|
510
|
-
|
|
511
|
-
onClick: f[1] || (f[1] =
|
|
508
|
+
default: p(({ isAllowed: E }) => [
|
|
509
|
+
V("div", {
|
|
510
|
+
onClick: f[1] || (f[1] = ae(() => {
|
|
512
511
|
}, ["stop"]))
|
|
513
512
|
}, [
|
|
514
|
-
u(
|
|
515
|
-
modelValue:
|
|
516
|
-
"onUpdate:modelValue": (
|
|
517
|
-
"data-testid": `row-${
|
|
518
|
-
disabled: !
|
|
519
|
-
onClick:
|
|
513
|
+
u(A, {
|
|
514
|
+
modelValue: y.enabled,
|
|
515
|
+
"onUpdate:modelValue": (ee) => y.enabled = ee,
|
|
516
|
+
"data-testid": `row-${y.id}-toggle-input`,
|
|
517
|
+
disabled: !E,
|
|
518
|
+
onClick: ae((ee) => G(y), ["prevent"])
|
|
520
519
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "disabled", "onClick"])
|
|
521
520
|
])
|
|
522
521
|
]),
|
|
523
522
|
_: 2
|
|
524
523
|
}, 1032, ["auth-function"])
|
|
525
524
|
]),
|
|
526
|
-
tags: p(({ rowValue:
|
|
527
|
-
(
|
|
525
|
+
tags: p(({ rowValue: y }) => [
|
|
526
|
+
(y == null ? void 0 : y.length) > 0 ? (k(), re(d, { key: 0 }, {
|
|
528
527
|
default: p(() => [
|
|
529
|
-
(
|
|
530
|
-
key:
|
|
531
|
-
onClick: f[2] || (f[2] =
|
|
528
|
+
(k(!0), T($e, null, Be(y, (E) => (k(), re(l, {
|
|
529
|
+
key: E,
|
|
530
|
+
onClick: f[2] || (f[2] = ae(() => {
|
|
532
531
|
}, ["stop"]))
|
|
533
532
|
}, {
|
|
534
533
|
default: p(() => [
|
|
535
|
-
|
|
534
|
+
U(b(E), 1)
|
|
536
535
|
]),
|
|
537
536
|
_: 2
|
|
538
537
|
}, 1024))), 128))
|
|
539
538
|
]),
|
|
540
539
|
_: 2
|
|
541
|
-
}, 1024)) : (
|
|
540
|
+
}, 1024)) : (k(), T("span", vt, "-"))
|
|
542
541
|
]),
|
|
543
|
-
created_at: p(({ rowValue:
|
|
544
|
-
|
|
542
|
+
created_at: p(({ rowValue: y }) => [
|
|
543
|
+
U(b(o(x)(y)), 1)
|
|
545
544
|
]),
|
|
546
|
-
updated_at: p(({ rowValue:
|
|
547
|
-
|
|
545
|
+
updated_at: p(({ rowValue: y }) => [
|
|
546
|
+
U(b(o(x)(y)), 1)
|
|
548
547
|
]),
|
|
549
|
-
actions: p(({ row:
|
|
550
|
-
u(
|
|
551
|
-
default: p(({ copyToClipboard:
|
|
552
|
-
u(
|
|
548
|
+
actions: p(({ row: y }) => [
|
|
549
|
+
u(ke, null, {
|
|
550
|
+
default: p(({ copyToClipboard: E }) => [
|
|
551
|
+
u(N, {
|
|
553
552
|
"data-testid": "action-entity-copy-id",
|
|
554
|
-
onClick: (
|
|
553
|
+
onClick: (ee) => ge(y, E)
|
|
555
554
|
}, {
|
|
556
555
|
default: p(() => [
|
|
557
|
-
|
|
556
|
+
U(b(o(r)("actions.copy_id")), 1)
|
|
558
557
|
]),
|
|
559
558
|
_: 2
|
|
560
559
|
}, 1032, ["onClick"])
|
|
561
560
|
]),
|
|
562
561
|
_: 2
|
|
563
562
|
}, 1024),
|
|
564
|
-
u(
|
|
565
|
-
default: p(({ copyToClipboard:
|
|
566
|
-
u(
|
|
563
|
+
u(ke, null, {
|
|
564
|
+
default: p(({ copyToClipboard: E }) => [
|
|
565
|
+
u(N, {
|
|
567
566
|
"data-testid": "action-entity-copy-json",
|
|
568
|
-
onClick: (
|
|
567
|
+
onClick: (ee) => _e(y, E)
|
|
569
568
|
}, {
|
|
570
569
|
default: p(() => [
|
|
571
|
-
|
|
570
|
+
U(b(o(r)("actions.copy_json")), 1)
|
|
572
571
|
]),
|
|
573
572
|
_: 2
|
|
574
573
|
}, 1032, ["onClick"])
|
|
575
574
|
]),
|
|
576
575
|
_: 2
|
|
577
576
|
}, 1024),
|
|
578
|
-
u(o(
|
|
579
|
-
"auth-function": () =>
|
|
577
|
+
u(o(te), {
|
|
578
|
+
"auth-function": () => a.canRetrieve(y)
|
|
580
579
|
}, {
|
|
581
580
|
default: p(() => [
|
|
582
|
-
u(
|
|
581
|
+
u(N, {
|
|
583
582
|
"data-testid": "action-entity-view",
|
|
584
583
|
"has-divider": "",
|
|
585
|
-
item:
|
|
584
|
+
item: he(y.id)
|
|
586
585
|
}, null, 8, ["item"])
|
|
587
586
|
]),
|
|
588
587
|
_: 2
|
|
589
588
|
}, 1032, ["auth-function"]),
|
|
590
|
-
u(o(
|
|
591
|
-
"auth-function": () =>
|
|
589
|
+
u(o(te), {
|
|
590
|
+
"auth-function": () => a.canEdit(y)
|
|
592
591
|
}, {
|
|
593
592
|
default: p(() => [
|
|
594
|
-
u(
|
|
593
|
+
u(N, {
|
|
595
594
|
"data-testid": "action-entity-edit",
|
|
596
|
-
item:
|
|
595
|
+
item: Y(y.id)
|
|
597
596
|
}, null, 8, ["item"])
|
|
598
597
|
]),
|
|
599
598
|
_: 2
|
|
600
599
|
}, 1032, ["auth-function"]),
|
|
601
|
-
u(o(
|
|
602
|
-
"auth-function": () =>
|
|
600
|
+
u(o(te), {
|
|
601
|
+
"auth-function": () => a.canDelete(y)
|
|
603
602
|
}, {
|
|
604
603
|
default: p(() => [
|
|
605
|
-
u(
|
|
604
|
+
u(N, {
|
|
606
605
|
danger: "",
|
|
607
606
|
"data-testid": "action-entity-delete",
|
|
608
607
|
"has-divider": "",
|
|
609
|
-
onClick: (
|
|
608
|
+
onClick: (E) => q(y)
|
|
610
609
|
}, {
|
|
611
610
|
default: p(() => [
|
|
612
|
-
|
|
611
|
+
U(b(o(r)("actions.delete.menu_label")), 1)
|
|
613
612
|
]),
|
|
614
613
|
_: 2
|
|
615
614
|
}, 1032, ["onClick"])
|
|
@@ -618,65 +617,65 @@ const pe = {
|
|
|
618
617
|
}, 1032, ["auth-function"])
|
|
619
618
|
]),
|
|
620
619
|
_: 1
|
|
621
|
-
}, 8, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "
|
|
622
|
-
u(o(
|
|
623
|
-
action:
|
|
624
|
-
"entity-id":
|
|
625
|
-
"entity-name":
|
|
620
|
+
}, 8, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers"]),
|
|
621
|
+
u(o(Je), {
|
|
622
|
+
action: Q.value.action,
|
|
623
|
+
"entity-id": Q.value.id,
|
|
624
|
+
"entity-name": Q.value.name,
|
|
626
625
|
"entity-type": o(r)("glossary.gateway_services"),
|
|
627
|
-
"on-confirm":
|
|
628
|
-
visible:
|
|
629
|
-
onCancel:
|
|
630
|
-
onProceed:
|
|
626
|
+
"on-confirm": oe,
|
|
627
|
+
visible: z.value,
|
|
628
|
+
onCancel: X,
|
|
629
|
+
onProceed: X
|
|
631
630
|
}, null, 8, ["action", "entity-id", "entity-name", "entity-type", "visible"]),
|
|
632
|
-
u(o(
|
|
633
|
-
"action-pending":
|
|
631
|
+
u(o(ze), {
|
|
632
|
+
"action-pending": Z.value,
|
|
634
633
|
description: o(r)("actions.delete.description"),
|
|
635
|
-
"entity-name":
|
|
636
|
-
"entity-type": o(
|
|
637
|
-
error:
|
|
634
|
+
"entity-name": R.value && (R.value.name || R.value.id),
|
|
635
|
+
"entity-type": o(Qe).GatewayService,
|
|
636
|
+
error: K.value,
|
|
638
637
|
title: o(r)("actions.delete.title"),
|
|
639
|
-
visible:
|
|
640
|
-
onCancel:
|
|
641
|
-
onProceed:
|
|
638
|
+
visible: O.value,
|
|
639
|
+
onCancel: j,
|
|
640
|
+
onProceed: se
|
|
642
641
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
643
642
|
]);
|
|
644
643
|
};
|
|
645
644
|
}
|
|
646
|
-
}),
|
|
647
|
-
const
|
|
648
|
-
for (const [
|
|
649
|
-
|
|
650
|
-
return
|
|
651
|
-
},
|
|
645
|
+
}), Me = (a, $) => {
|
|
646
|
+
const v = a.__vccOpts || a;
|
|
647
|
+
for (const [c, r] of $)
|
|
648
|
+
v[c] = r;
|
|
649
|
+
return v;
|
|
650
|
+
}, Kt = /* @__PURE__ */ Me(yt, [["__scopeId", "data-v-b80eea28"]]), gt = { class: "kong-ui-entities-gateway-service-form" }, _t = { key: 0 }, bt = { class: "gateway-service-form-traffic-label" }, ht = { class: "gateway-service-form-margin-bottom" }, wt = {
|
|
652
651
|
key: 0,
|
|
653
652
|
class: "gateway-service-form-group-fields"
|
|
654
|
-
},
|
|
653
|
+
}, kt = {
|
|
655
654
|
key: 1,
|
|
656
655
|
class: "gateway-service-form-group-fields"
|
|
657
|
-
},
|
|
656
|
+
}, Ct = { key: 0 }, Vt = { class: "gateway-service-form-margin-top" }, St = { class: "gateway-service-form-margin-bottom" }, Tt = { class: "gateway-service-form-margin-bottom" }, It = { class: "gateway-service-form-margin-bottom" }, Pt = { class: "gateway-service-form-margin-bottom" }, Ut = {
|
|
658
657
|
key: 0,
|
|
659
658
|
class: "gateway-service-form-margin-bottom"
|
|
660
|
-
},
|
|
659
|
+
}, Et = {
|
|
661
660
|
key: 1,
|
|
662
661
|
class: "gateway-service-form-margin-bottom"
|
|
663
|
-
},
|
|
662
|
+
}, Mt = {
|
|
664
663
|
key: 2,
|
|
665
664
|
class: "gateway-service-form-margin-bottom"
|
|
666
665
|
}, xt = {
|
|
667
666
|
key: 0,
|
|
668
667
|
class: "checkbox-aligned-radio"
|
|
669
|
-
},
|
|
668
|
+
}, Rt = {
|
|
670
669
|
key: 1,
|
|
671
670
|
class: "checkbox-aligned-radio"
|
|
672
|
-
},
|
|
671
|
+
}, At = /* @__PURE__ */ Ve({
|
|
673
672
|
__name: "GatewayServiceForm",
|
|
674
673
|
props: {
|
|
675
674
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
676
675
|
config: {
|
|
677
676
|
type: Object,
|
|
678
677
|
required: !0,
|
|
679
|
-
validator: (
|
|
678
|
+
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)
|
|
680
679
|
},
|
|
681
680
|
/** If a valid Gateway Service ID is provided, it will put the form in Edit mode instead of Create */
|
|
682
681
|
gatewayServiceId: {
|
|
@@ -700,9 +699,9 @@ const pe = {
|
|
|
700
699
|
}
|
|
701
700
|
},
|
|
702
701
|
emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated"],
|
|
703
|
-
setup(
|
|
704
|
-
var
|
|
705
|
-
const
|
|
702
|
+
setup(a, { expose: $, emit: v }) {
|
|
703
|
+
var se;
|
|
704
|
+
const c = v, r = a, x = S(!0), W = Pe(), { i18nT: L, i18n: { t: s } } = ue.useI18n(), { getMessageFromError: P } = Xe(), { axiosInstance: h } = Ue((se = r.config) == null ? void 0 : se.axiosRequestConfig), fe = Ye(), pe = w(() => le.form[r.config.app].edit), F = w(() => r.gatewayServiceId ? Te.Edit : Te.Create), me = S(!1), B = w(() => !!r.gatewayServiceId), C = S(B.value ? "protocol" : "url"), H = ue.usePortFromProtocol(), J = S(""), ve = w(() => !!J.value), e = Se({
|
|
706
705
|
fields: {
|
|
707
706
|
name: "",
|
|
708
707
|
protocol: "http",
|
|
@@ -722,7 +721,7 @@ const pe = {
|
|
|
722
721
|
},
|
|
723
722
|
isReadonly: !1,
|
|
724
723
|
errorMessage: ""
|
|
725
|
-
}),
|
|
724
|
+
}), _ = Se({
|
|
726
725
|
name: "",
|
|
727
726
|
protocol: "http",
|
|
728
727
|
host: "",
|
|
@@ -738,13 +737,13 @@ const pe = {
|
|
|
738
737
|
tls_verify_enabled: !1,
|
|
739
738
|
tls_verify_value: !1,
|
|
740
739
|
tags: ""
|
|
741
|
-
}),
|
|
740
|
+
}), ye = r.config.app === "konnect" || Ze({
|
|
742
741
|
gatewayInfo: r.config.gatewayInfo,
|
|
743
742
|
// 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
|
|
744
743
|
supportedRange: {
|
|
745
744
|
enterprise: ["3.0"]
|
|
746
745
|
}
|
|
747
|
-
}),
|
|
746
|
+
}), z = [
|
|
748
747
|
{
|
|
749
748
|
label: s("gateway_services.form.fields.protocol.options.http"),
|
|
750
749
|
value: "http",
|
|
@@ -780,7 +779,7 @@ const pe = {
|
|
|
780
779
|
value: "grpcs",
|
|
781
780
|
group: "grpc"
|
|
782
781
|
},
|
|
783
|
-
...
|
|
782
|
+
...ye ? [
|
|
784
783
|
{
|
|
785
784
|
label: s("gateway_services.form.fields.protocol.options.ws"),
|
|
786
785
|
value: "ws",
|
|
@@ -797,60 +796,60 @@ const pe = {
|
|
|
797
796
|
value: "udp",
|
|
798
797
|
group: "udp"
|
|
799
798
|
}
|
|
800
|
-
],
|
|
799
|
+
], I = { url: "url", protocol: "protocol" }, Q = (t, i) => {
|
|
801
800
|
i.value;
|
|
802
|
-
},
|
|
803
|
-
x.value = !0, e.errorMessage = "", e.fields.host =
|
|
804
|
-
},
|
|
805
|
-
if (e.fields.url &&
|
|
801
|
+
}, G = (t) => t ? parseFloat(t) : 0, X = () => {
|
|
802
|
+
x.value = !0, e.errorMessage = "", e.fields.host = _.host, e.fields.path = _.path, e.fields.port = _.port, e.fields.protocol = _.protocol, e.fields.url = _.url, e.fields.retries = _.retries, e.fields.connect_timeout = _.connect_timeout, e.fields.write_timeout = _.write_timeout, e.fields.read_timeout = _.read_timeout, e.fields.client_certificate = _.client_certificate, e.fields.ca_certificates = _.ca_certificates, e.fields.tls_verify_enabled = _.tls_verify_enabled, e.fields.tls_verify_value = _.tls_verify_value;
|
|
803
|
+
}, oe = () => {
|
|
804
|
+
if (e.fields.url && C.value === "url")
|
|
806
805
|
try {
|
|
807
806
|
const t = new URL(e.fields.url);
|
|
808
807
|
e.errorMessage = "", e.fields.protocol = t.protocol.slice(0, -1), e.fields.host = t.hostname, e.fields.path = t.pathname;
|
|
809
808
|
const i = Number(t.port);
|
|
810
|
-
|
|
809
|
+
me.value = !!i, e.fields.port = i || H.getPortFromProtocol(e.fields.protocol), e.errorMessage = "", c("url-valid:success");
|
|
811
810
|
} catch (t) {
|
|
812
|
-
e.errorMessage = s("errors.urlErrorMessage"),
|
|
811
|
+
e.errorMessage = s("errors.urlErrorMessage"), c("url-valid:error", P(t));
|
|
813
812
|
}
|
|
814
813
|
else
|
|
815
|
-
|
|
816
|
-
},
|
|
817
|
-
if (
|
|
814
|
+
c("url-valid:success"), e.errorMessage = "";
|
|
815
|
+
}, ie = w(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(e.fields.protocol)), ge = w(() => {
|
|
816
|
+
if (C.value === "url")
|
|
818
817
|
return !0;
|
|
819
818
|
const t = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
820
|
-
return
|
|
821
|
-
}),
|
|
822
|
-
if (
|
|
819
|
+
return C.value === "protocol" && t;
|
|
820
|
+
}), _e = w(() => {
|
|
821
|
+
if (C.value === "url")
|
|
823
822
|
return !0;
|
|
824
823
|
const t = ["https", "tls"].includes(e.fields.protocol);
|
|
825
|
-
return
|
|
826
|
-
}),
|
|
827
|
-
if (
|
|
824
|
+
return C.value === "protocol" && t;
|
|
825
|
+
}), be = w(() => {
|
|
826
|
+
if (C.value === "url")
|
|
828
827
|
return !0;
|
|
829
828
|
const t = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
830
|
-
return
|
|
831
|
-
}),
|
|
832
|
-
J.value =
|
|
833
|
-
},
|
|
834
|
-
var i,
|
|
835
|
-
e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((i = t == null ? void 0 : t.tags) == null ? void 0 : i.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 = ((
|
|
836
|
-
},
|
|
837
|
-
|
|
838
|
-
},
|
|
839
|
-
var i,
|
|
840
|
-
let t = `${r.config.apiBaseUrl}${
|
|
841
|
-
return r.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((i = r.config) == null ? void 0 : i.controlPlaneId) || "") : r.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (
|
|
842
|
-
}), K =
|
|
843
|
-
var i,
|
|
844
|
-
let t = `${r.config.apiBaseUrl}${
|
|
845
|
-
return r.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((i = r.config) == null ? void 0 : i.controlPlaneId) || "") : r.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (
|
|
846
|
-
}),
|
|
829
|
+
return C.value === "protocol" && t;
|
|
830
|
+
}), he = (t) => {
|
|
831
|
+
J.value = fe.utf8Name(t);
|
|
832
|
+
}, Y = w(() => B.value && JSON.stringify(e.fields) !== JSON.stringify(_) || C.value === "url" && !!e.fields.url || C.value === "protocol" && !!e.fields.host), R = (t) => {
|
|
833
|
+
var i, g, n;
|
|
834
|
+
e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((i = t == null ? void 0 : t.tags) == null ? void 0 : i.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 = ((g = t == null ? void 0 : t.ca_certificates) == null ? void 0 : g.join(",")) || "", e.fields.client_certificate = ((n = t == null ? void 0 : t.client_certificate) == null ? void 0 : n.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, Object.assign(_, e.fields);
|
|
835
|
+
}, O = () => {
|
|
836
|
+
W.push(r.config.cancelRoute);
|
|
837
|
+
}, Z = w(() => {
|
|
838
|
+
var i, g;
|
|
839
|
+
let t = `${r.config.apiBaseUrl}${le.form[r.config.app].validate}`;
|
|
840
|
+
return r.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((i = r.config) == null ? void 0 : i.controlPlaneId) || "") : r.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (g = r.config) != null && g.workspace ? `/${r.config.workspace}` : "")), t = t.replace(/{id}/gi, r.gatewayServiceId), t;
|
|
841
|
+
}), K = w(() => {
|
|
842
|
+
var i, g;
|
|
843
|
+
let t = `${r.config.apiBaseUrl}${le.form[r.config.app][F.value]}`;
|
|
844
|
+
return r.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((i = r.config) == null ? void 0 : i.controlPlaneId) || "") : r.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (g = r.config) != null && g.workspace ? `/${r.config.workspace}` : "")), t = t.replace(/{id}/gi, r.gatewayServiceId), t;
|
|
845
|
+
}), we = (t) => {
|
|
847
846
|
let i = "";
|
|
848
847
|
t.url && (i = new URL(t.url).protocol), (["https", "wss", "tls"].includes(t.protocol) || ["https", "wss", "tls"].includes(i)) && (t.tls_verify = t.tls_verify_enabled ? t.tls_verify_value : null), delete t.tls_verify_enabled, delete t.tls_verify_value;
|
|
849
|
-
}, q =
|
|
850
|
-
var i,
|
|
848
|
+
}, q = w(() => {
|
|
849
|
+
var i, g, n, f;
|
|
851
850
|
const t = {
|
|
852
851
|
name: e.fields.name || null,
|
|
853
|
-
tags: e.fields.tags ? (
|
|
852
|
+
tags: e.fields.tags ? (n = (g = (i = e.fields.tags) == null ? void 0 : i.split(",")) == null ? void 0 : g.map((m) => String(m || "").trim())) == null ? void 0 : n.filter((m) => m !== "") : null,
|
|
854
853
|
protocol: e.fields.protocol,
|
|
855
854
|
path: e.fields.path || null,
|
|
856
855
|
read_timeout: e.fields.read_timeout,
|
|
@@ -859,83 +858,83 @@ const pe = {
|
|
|
859
858
|
connect_timeout: e.fields.connect_timeout,
|
|
860
859
|
tls_verify_value: e.fields.tls_verify_value,
|
|
861
860
|
tls_verify_enabled: e.fields.tls_verify_enabled,
|
|
862
|
-
ca_certificates: e.fields.ca_certificates ? (
|
|
861
|
+
ca_certificates: e.fields.ca_certificates ? (f = e.fields.ca_certificates) == null ? void 0 : f.split(",").filter((m) => m !== "") : null,
|
|
863
862
|
client_certificate: e.fields.client_certificate ? { id: e.fields.client_certificate } : null,
|
|
864
863
|
write_timeout: e.fields.write_timeout,
|
|
865
864
|
port: e.fields.port,
|
|
866
865
|
url: e.fields.url
|
|
867
866
|
};
|
|
868
|
-
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),
|
|
869
|
-
}),
|
|
870
|
-
var t, i,
|
|
867
|
+
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), ie.value || (t.path = null), F.value === "create" ? C.value === "url" ? (delete t.protocol, delete t.host, delete t.path, r.config.app === "konnect" && delete t.port) : delete t.url : F.value === "edit" && delete t.url, t;
|
|
868
|
+
}), j = async () => {
|
|
869
|
+
var t, i, g, n;
|
|
871
870
|
try {
|
|
872
|
-
e.isReadonly = !0,
|
|
873
|
-
const
|
|
874
|
-
|
|
875
|
-
let
|
|
876
|
-
if (await
|
|
877
|
-
const { data: l } =
|
|
878
|
-
e.fields.name = (l == null ? void 0 : l.name) || "", e.fields.port = l.port || H.getPortFromProtocol(l.protocol), e.fields.protocol = (l == null ? void 0 : l.protocol) || "http", e.fields.host = (l == null ? void 0 : l.host) || "", e.fields.path = (l == null ? void 0 : l.path) || "", e.fields.url = (l == null ? void 0 : l.url) || "", e.fields.retries = l != null && l.retries || (l == null ? void 0 : l.retries) === 0 ? l == null ? void 0 : l.retries : 5, e.fields.connect_timeout = l != null && l.connect_timeout || (l == null ? void 0 : l.connect_timeout) === 0 ? l == null ? void 0 : l.connect_timeout : 6e4, e.fields.write_timeout = l != null && l.write_timeout || (l == null ? void 0 : l.write_timeout) === 0 ? l == null ? void 0 : l.write_timeout : 6e4, e.fields.read_timeout = l != null && l.read_timeout || (l == null ? void 0 : l.read_timeout) === 0 ? l == null ? void 0 : l.read_timeout : 6e4, e.fields.client_certificate = ((i = l == null ? void 0 : l.client_certificate) == null ? void 0 : i.id) || "", e.fields.ca_certificates = (
|
|
871
|
+
e.isReadonly = !0, oe();
|
|
872
|
+
const f = q.value;
|
|
873
|
+
we(f);
|
|
874
|
+
let m;
|
|
875
|
+
if (await h.post(Z.value, f), F.value === "create" ? m = await h.post(K.value, f) : F.value === "edit" && (m = ((t = r.config) == null ? void 0 : t.app) === "konnect" ? await h.put(K.value, f) : await h.patch(K.value, f)), m) {
|
|
876
|
+
const { data: l } = m;
|
|
877
|
+
e.fields.name = (l == null ? void 0 : l.name) || "", e.fields.port = l.port || H.getPortFromProtocol(l.protocol), e.fields.protocol = (l == null ? void 0 : l.protocol) || "http", e.fields.host = (l == null ? void 0 : l.host) || "", e.fields.path = (l == null ? void 0 : l.path) || "", e.fields.url = (l == null ? void 0 : l.url) || "", e.fields.retries = l != null && l.retries || (l == null ? void 0 : l.retries) === 0 ? l == null ? void 0 : l.retries : 5, e.fields.connect_timeout = l != null && l.connect_timeout || (l == null ? void 0 : l.connect_timeout) === 0 ? l == null ? void 0 : l.connect_timeout : 6e4, e.fields.write_timeout = l != null && l.write_timeout || (l == null ? void 0 : l.write_timeout) === 0 ? l == null ? void 0 : l.write_timeout : 6e4, e.fields.read_timeout = l != null && l.read_timeout || (l == null ? void 0 : l.read_timeout) === 0 ? l == null ? void 0 : l.read_timeout : 6e4, e.fields.client_certificate = ((i = l == null ? void 0 : l.client_certificate) == null ? void 0 : i.id) || "", e.fields.ca_certificates = (g = l == null ? void 0 : l.ca_certificates) != null && g.length ? l == null ? void 0 : l.ca_certificates.join(",") : "", e.fields.tls_verify_enabled = (l == null ? void 0 : l.tls_verify) !== "" && (l == null ? void 0 : l.tls_verify) !== null && (l == null ? void 0 : l.tls_verify) !== void 0, e.fields.tls_verify_value = e.fields.tls_verify_enabled && (l == null ? void 0 : l.tls_verify), e.fields.tags = (n = l == null ? void 0 : l.tags) != null && n.length ? l.tags.join(", ") : "", Object.assign(_, e.fields), c("update", m == null ? void 0 : m.data);
|
|
879
878
|
}
|
|
880
|
-
return
|
|
881
|
-
} catch (
|
|
882
|
-
e.errorMessage =
|
|
879
|
+
return m;
|
|
880
|
+
} catch (f) {
|
|
881
|
+
e.errorMessage = P(f), c("error", f);
|
|
883
882
|
} finally {
|
|
884
883
|
e.isReadonly = !1;
|
|
885
884
|
}
|
|
886
885
|
};
|
|
887
|
-
return
|
|
888
|
-
Object.assign(e.fields,
|
|
889
|
-
}),
|
|
890
|
-
e.fields.port = H.getPortFromProtocol(t.protocol, String(t.port)),
|
|
891
|
-
}),
|
|
892
|
-
|
|
886
|
+
return Ce(() => r.gatewayServiceId, () => {
|
|
887
|
+
Object.assign(e.fields, _);
|
|
888
|
+
}), Ce(e.fields, (t) => {
|
|
889
|
+
e.fields.port = H.getPortFromProtocol(t.protocol, String(t.port)), c("model-updated", q.value);
|
|
890
|
+
}), De(() => {
|
|
891
|
+
c("model-updated", q.value);
|
|
893
892
|
}), $({
|
|
894
|
-
validateUrl:
|
|
893
|
+
validateUrl: oe,
|
|
895
894
|
getPayload: q,
|
|
896
|
-
saveFormData:
|
|
897
|
-
canSubmit:
|
|
898
|
-
initForm:
|
|
895
|
+
saveFormData: j,
|
|
896
|
+
canSubmit: Y,
|
|
897
|
+
initForm: R
|
|
899
898
|
}), (t, i) => {
|
|
900
|
-
const
|
|
901
|
-
return
|
|
902
|
-
u(o(
|
|
903
|
-
"can-submit":
|
|
904
|
-
config:
|
|
905
|
-
"edit-id":
|
|
906
|
-
"enable-terraform":
|
|
907
|
-
"entity-type": o(
|
|
899
|
+
const g = M("KInput"), n = M("KLabel"), f = M("KRadio"), m = M("KSelect"), l = M("KCheckbox"), A = M("KCollapse");
|
|
900
|
+
return k(), T("div", gt, [
|
|
901
|
+
u(o(et), {
|
|
902
|
+
"can-submit": Y.value,
|
|
903
|
+
config: a.config,
|
|
904
|
+
"edit-id": a.gatewayServiceId,
|
|
905
|
+
"enable-terraform": a.enableTerraform,
|
|
906
|
+
"entity-type": o(Ee).GatewayService,
|
|
908
907
|
"error-message": e.errorMessage,
|
|
909
|
-
"fetch-url":
|
|
908
|
+
"fetch-url": pe.value,
|
|
910
909
|
"form-fields": q.value,
|
|
911
910
|
"is-readonly": e.isReadonly,
|
|
912
|
-
onCancel:
|
|
913
|
-
"onFetch:error": i[25] || (i[25] = (
|
|
914
|
-
"onFetch:success":
|
|
915
|
-
onLoading: i[26] || (i[26] = (
|
|
916
|
-
onSubmit:
|
|
911
|
+
onCancel: O,
|
|
912
|
+
"onFetch:error": i[25] || (i[25] = (d) => t.$emit("error", d)),
|
|
913
|
+
"onFetch:success": R,
|
|
914
|
+
onLoading: i[26] || (i[26] = (d) => t.$emit("loading", d)),
|
|
915
|
+
onSubmit: j
|
|
917
916
|
}, {
|
|
918
917
|
"form-actions": p(() => [
|
|
919
|
-
|
|
920
|
-
canSubmit:
|
|
921
|
-
cancel:
|
|
922
|
-
submit:
|
|
918
|
+
Le(t.$slots, "form-actions", {
|
|
919
|
+
canSubmit: Y.value,
|
|
920
|
+
cancel: O,
|
|
921
|
+
submit: j
|
|
923
922
|
}, void 0, !0)
|
|
924
923
|
]),
|
|
925
924
|
default: p(() => [
|
|
926
|
-
u(o(
|
|
925
|
+
u(o(Ie), {
|
|
927
926
|
description: o(s)("gateway_services.form.sections.general.description"),
|
|
928
|
-
"hide-info-header":
|
|
927
|
+
"hide-info-header": a.hideSectionsInfo,
|
|
929
928
|
title: o(s)("gateway_services.form.sections.general.title")
|
|
930
929
|
}, {
|
|
931
930
|
default: p(() => [
|
|
932
|
-
u(
|
|
931
|
+
u(g, {
|
|
933
932
|
modelValue: e.fields.name,
|
|
934
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
933
|
+
"onUpdate:modelValue": i[0] || (i[0] = (d) => e.fields.name = d),
|
|
935
934
|
modelModifiers: { trim: !0 },
|
|
936
935
|
autocomplete: "off",
|
|
937
936
|
"data-testid": "gateway-service-name-input",
|
|
938
|
-
error:
|
|
937
|
+
error: ve.value,
|
|
939
938
|
"error-message": J.value,
|
|
940
939
|
label: o(s)("gateway_services.form.fields.name.label"),
|
|
941
940
|
"label-attributes": {
|
|
@@ -946,11 +945,11 @@ const pe = {
|
|
|
946
945
|
placeholder: o(s)("gateway_services.form.fields.name.placeholder"),
|
|
947
946
|
readonly: e.isReadonly,
|
|
948
947
|
type: "text",
|
|
949
|
-
onInput:
|
|
948
|
+
onInput: he
|
|
950
949
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
|
|
951
|
-
u(
|
|
950
|
+
u(g, {
|
|
952
951
|
modelValue: e.fields.tags,
|
|
953
|
-
"onUpdate:modelValue": i[1] || (i[1] = (
|
|
952
|
+
"onUpdate:modelValue": i[1] || (i[1] = (d) => e.fields.tags = d),
|
|
954
953
|
modelModifiers: { trim: !0 },
|
|
955
954
|
autocomplete: "off",
|
|
956
955
|
"data-testid": "gateway-service-tags-input",
|
|
@@ -968,72 +967,72 @@ const pe = {
|
|
|
968
967
|
]),
|
|
969
968
|
_: 1
|
|
970
969
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
971
|
-
u(o(
|
|
970
|
+
u(o(Ie), {
|
|
972
971
|
description: o(s)("gateway_services.form.sections.keys.description"),
|
|
973
|
-
"hide-info-header":
|
|
972
|
+
"hide-info-header": a.hideSectionsInfo,
|
|
974
973
|
title: o(s)("gateway_services.form.sections.keys.title")
|
|
975
974
|
}, {
|
|
976
975
|
default: p(() => [
|
|
977
|
-
B.value ?
|
|
978
|
-
|
|
979
|
-
u(
|
|
976
|
+
B.value ? D("", !0) : (k(), T("div", _t, [
|
|
977
|
+
V("div", bt, [
|
|
978
|
+
u(n, { required: "" }, {
|
|
980
979
|
default: p(() => [
|
|
981
|
-
|
|
980
|
+
U(b(o(s)("gateway_services.form.sections.keys.checkedGroupLabel")), 1)
|
|
982
981
|
]),
|
|
983
982
|
_: 1
|
|
984
983
|
})
|
|
985
984
|
]),
|
|
986
|
-
|
|
987
|
-
u(
|
|
988
|
-
modelValue:
|
|
989
|
-
"onUpdate:modelValue": i[2] || (i[2] = (
|
|
985
|
+
V("div", ht, [
|
|
986
|
+
u(f, {
|
|
987
|
+
modelValue: C.value,
|
|
988
|
+
"onUpdate:modelValue": i[2] || (i[2] = (d) => C.value = d),
|
|
990
989
|
"data-testid": "gateway-service-url-radio",
|
|
991
|
-
"selected-value":
|
|
992
|
-
onChange:
|
|
990
|
+
"selected-value": I.url,
|
|
991
|
+
onChange: X
|
|
993
992
|
}, {
|
|
994
993
|
default: p(() => [
|
|
995
|
-
|
|
994
|
+
U(b(o(s)("gateway_services.form.sections.keys.urlLabel")), 1)
|
|
996
995
|
]),
|
|
997
996
|
_: 1
|
|
998
997
|
}, 8, ["modelValue", "selected-value"])
|
|
999
998
|
]),
|
|
1000
|
-
|
|
1001
|
-
u(
|
|
999
|
+
C.value === "url" ? (k(), T("div", wt, [
|
|
1000
|
+
u(g, {
|
|
1002
1001
|
modelValue: e.fields.url,
|
|
1003
|
-
"onUpdate:modelValue": i[3] || (i[3] = (
|
|
1002
|
+
"onUpdate:modelValue": i[3] || (i[3] = (d) => e.fields.url = d),
|
|
1004
1003
|
modelModifiers: { trim: !0 },
|
|
1005
1004
|
class: "gateway-service-url-input gateway-service-form-margin-bottom",
|
|
1006
1005
|
"data-testid": "gateway-service-url-input",
|
|
1007
1006
|
label: o(s)("gateway_services.form.fields.upstream_url.label"),
|
|
1008
1007
|
"label-attributes": {
|
|
1009
|
-
info:
|
|
1008
|
+
info: a.config.app === "konnect" ? o(s)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(s)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
|
|
1010
1009
|
tooltipAttributes: { maxWidth: "400" }
|
|
1011
1010
|
},
|
|
1012
1011
|
name: "url",
|
|
1013
1012
|
placeholder: o(s)("gateway_services.form.fields.upstream_url.placeholder"),
|
|
1014
1013
|
required: ""
|
|
1015
1014
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
|
|
1016
|
-
])) :
|
|
1017
|
-
u(
|
|
1018
|
-
modelValue:
|
|
1019
|
-
"onUpdate:modelValue": i[4] || (i[4] = (
|
|
1015
|
+
])) : D("", !0),
|
|
1016
|
+
u(f, {
|
|
1017
|
+
modelValue: C.value,
|
|
1018
|
+
"onUpdate:modelValue": i[4] || (i[4] = (d) => C.value = d),
|
|
1020
1019
|
"checked-group": "protocol",
|
|
1021
1020
|
"data-testid": "gateway-service-protocol-radio",
|
|
1022
|
-
"selected-value":
|
|
1023
|
-
onChange:
|
|
1021
|
+
"selected-value": I.protocol,
|
|
1022
|
+
onChange: X
|
|
1024
1023
|
}, {
|
|
1025
1024
|
default: p(() => [
|
|
1026
|
-
|
|
1025
|
+
U(b(o(s)("gateway_services.form.sections.keys.checkedGroupAltLabel")), 1)
|
|
1027
1026
|
]),
|
|
1028
1027
|
_: 1
|
|
1029
1028
|
}, 8, ["modelValue", "selected-value"])
|
|
1030
1029
|
])),
|
|
1031
|
-
|
|
1032
|
-
u(
|
|
1030
|
+
C.value === "protocol" || B.value ? (k(), T("div", kt, [
|
|
1031
|
+
u(m, {
|
|
1033
1032
|
modelValue: e.fields.protocol,
|
|
1034
|
-
"onUpdate:modelValue": i[5] || (i[5] = (
|
|
1033
|
+
"onUpdate:modelValue": i[5] || (i[5] = (d) => e.fields.protocol = d),
|
|
1035
1034
|
"data-testid": "gateway-service-protocol-select",
|
|
1036
|
-
items:
|
|
1035
|
+
items: z,
|
|
1037
1036
|
label: o(s)("gateway_services.form.fields.protocol.label"),
|
|
1038
1037
|
"label-attributes": {
|
|
1039
1038
|
info: o(s)("gateway_services.form.fields.protocol.tooltip"),
|
|
@@ -1042,11 +1041,11 @@ const pe = {
|
|
|
1042
1041
|
readonly: e.isReadonly,
|
|
1043
1042
|
required: "",
|
|
1044
1043
|
width: "100%",
|
|
1045
|
-
onSelected: i[6] || (i[6] = (
|
|
1044
|
+
onSelected: i[6] || (i[6] = (d) => Q(e.fields.protocol, d))
|
|
1046
1045
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
|
|
1047
|
-
u(
|
|
1046
|
+
u(g, {
|
|
1048
1047
|
modelValue: e.fields.host,
|
|
1049
|
-
"onUpdate:modelValue": i[7] || (i[7] = (
|
|
1048
|
+
"onUpdate:modelValue": i[7] || (i[7] = (d) => e.fields.host = d),
|
|
1050
1049
|
modelModifiers: { trim: !0 },
|
|
1051
1050
|
class: "gateway-service-form-margin-top",
|
|
1052
1051
|
"data-testid": "gateway-service-host-input",
|
|
@@ -1059,10 +1058,10 @@ const pe = {
|
|
|
1059
1058
|
placeholder: o(s)("gateway_services.form.fields.host.placeholder"),
|
|
1060
1059
|
required: ""
|
|
1061
1060
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"]),
|
|
1062
|
-
|
|
1063
|
-
u(
|
|
1061
|
+
ie.value ? (k(), T("div", Ct, [
|
|
1062
|
+
u(g, {
|
|
1064
1063
|
modelValue: e.fields.path,
|
|
1065
|
-
"onUpdate:modelValue": i[8] || (i[8] = (
|
|
1064
|
+
"onUpdate:modelValue": i[8] || (i[8] = (d) => e.fields.path = d),
|
|
1066
1065
|
modelModifiers: { trim: !0 },
|
|
1067
1066
|
class: "gateway-service-form-margin-top",
|
|
1068
1067
|
"data-testid": "gateway-service-path-input",
|
|
@@ -1074,13 +1073,13 @@ const pe = {
|
|
|
1074
1073
|
name: "path",
|
|
1075
1074
|
placeholder: o(s)("gateway_services.form.fields.path.placeholder")
|
|
1076
1075
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
|
|
1077
|
-
])) :
|
|
1078
|
-
u(
|
|
1076
|
+
])) : D("", !0),
|
|
1077
|
+
u(g, {
|
|
1079
1078
|
modelValue: e.fields.port,
|
|
1080
1079
|
"onUpdate:modelValue": [
|
|
1081
|
-
i[9] || (i[9] = (
|
|
1080
|
+
i[9] || (i[9] = (d) => e.fields.port = d),
|
|
1082
1081
|
i[10] || (i[10] = () => {
|
|
1083
|
-
e.fields.port =
|
|
1082
|
+
e.fields.port = G(e.fields.port + "");
|
|
1084
1083
|
})
|
|
1085
1084
|
],
|
|
1086
1085
|
class: "gateway-service-form-margin-top",
|
|
@@ -1093,23 +1092,23 @@ const pe = {
|
|
|
1093
1092
|
name: "port",
|
|
1094
1093
|
type: "number"
|
|
1095
1094
|
}, null, 8, ["modelValue", "label", "label-attributes"])
|
|
1096
|
-
])) :
|
|
1097
|
-
u(
|
|
1095
|
+
])) : D("", !0),
|
|
1096
|
+
u(A, {
|
|
1098
1097
|
modelValue: x.value,
|
|
1099
|
-
"onUpdate:modelValue": i[24] || (i[24] = (
|
|
1098
|
+
"onUpdate:modelValue": i[24] || (i[24] = (d) => x.value = d),
|
|
1100
1099
|
"data-testid": "advanced-fields-collapse",
|
|
1101
1100
|
"trigger-alignment": "leading",
|
|
1102
1101
|
"trigger-label": o(s)("gateway_services.form.sections.keys.viewAdvancedFields")
|
|
1103
1102
|
}, {
|
|
1104
1103
|
default: p(() => [
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
u(
|
|
1104
|
+
V("div", Vt, [
|
|
1105
|
+
V("div", St, [
|
|
1106
|
+
u(g, {
|
|
1108
1107
|
modelValue: e.fields.retries,
|
|
1109
1108
|
"onUpdate:modelValue": [
|
|
1110
|
-
i[11] || (i[11] = (
|
|
1109
|
+
i[11] || (i[11] = (d) => e.fields.retries = d),
|
|
1111
1110
|
i[12] || (i[12] = () => {
|
|
1112
|
-
e.fields.retries =
|
|
1111
|
+
e.fields.retries = G(e.fields.retries + "");
|
|
1113
1112
|
})
|
|
1114
1113
|
],
|
|
1115
1114
|
autocomplete: "off",
|
|
@@ -1124,13 +1123,13 @@ const pe = {
|
|
|
1124
1123
|
type: "number"
|
|
1125
1124
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1126
1125
|
]),
|
|
1127
|
-
|
|
1128
|
-
u(
|
|
1126
|
+
V("div", Tt, [
|
|
1127
|
+
u(g, {
|
|
1129
1128
|
modelValue: e.fields.connect_timeout,
|
|
1130
1129
|
"onUpdate:modelValue": [
|
|
1131
|
-
i[13] || (i[13] = (
|
|
1130
|
+
i[13] || (i[13] = (d) => e.fields.connect_timeout = d),
|
|
1132
1131
|
i[14] || (i[14] = () => {
|
|
1133
|
-
e.fields.connect_timeout =
|
|
1132
|
+
e.fields.connect_timeout = G(e.fields.connect_timeout + "");
|
|
1134
1133
|
})
|
|
1135
1134
|
],
|
|
1136
1135
|
autocomplete: "off",
|
|
@@ -1145,13 +1144,13 @@ const pe = {
|
|
|
1145
1144
|
type: "number"
|
|
1146
1145
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1147
1146
|
]),
|
|
1148
|
-
|
|
1149
|
-
u(
|
|
1147
|
+
V("div", It, [
|
|
1148
|
+
u(g, {
|
|
1150
1149
|
modelValue: e.fields.write_timeout,
|
|
1151
1150
|
"onUpdate:modelValue": [
|
|
1152
|
-
i[15] || (i[15] = (
|
|
1151
|
+
i[15] || (i[15] = (d) => e.fields.write_timeout = d),
|
|
1153
1152
|
i[16] || (i[16] = () => {
|
|
1154
|
-
e.fields.write_timeout =
|
|
1153
|
+
e.fields.write_timeout = G(e.fields.write_timeout + "");
|
|
1155
1154
|
})
|
|
1156
1155
|
],
|
|
1157
1156
|
autocomplete: "off",
|
|
@@ -1166,13 +1165,13 @@ const pe = {
|
|
|
1166
1165
|
type: "number"
|
|
1167
1166
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1168
1167
|
]),
|
|
1169
|
-
|
|
1170
|
-
u(
|
|
1168
|
+
V("div", Pt, [
|
|
1169
|
+
u(g, {
|
|
1171
1170
|
modelValue: e.fields.read_timeout,
|
|
1172
1171
|
"onUpdate:modelValue": [
|
|
1173
|
-
i[17] || (i[17] = (
|
|
1172
|
+
i[17] || (i[17] = (d) => e.fields.read_timeout = d),
|
|
1174
1173
|
i[18] || (i[18] = () => {
|
|
1175
|
-
e.fields.read_timeout =
|
|
1174
|
+
e.fields.read_timeout = G(e.fields.read_timeout + "");
|
|
1176
1175
|
})
|
|
1177
1176
|
],
|
|
1178
1177
|
autocomplete: "off",
|
|
@@ -1187,10 +1186,10 @@ const pe = {
|
|
|
1187
1186
|
type: "number"
|
|
1188
1187
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1189
1188
|
]),
|
|
1190
|
-
|
|
1191
|
-
u(
|
|
1189
|
+
ge.value ? (k(), T("div", Ut, [
|
|
1190
|
+
u(g, {
|
|
1192
1191
|
modelValue: e.fields.client_certificate,
|
|
1193
|
-
"onUpdate:modelValue": i[19] || (i[19] = (
|
|
1192
|
+
"onUpdate:modelValue": i[19] || (i[19] = (d) => e.fields.client_certificate = d),
|
|
1194
1193
|
modelModifiers: { trim: !0 },
|
|
1195
1194
|
autocomplete: "off",
|
|
1196
1195
|
"data-testid": "gateway-service-clientCert-input",
|
|
@@ -1204,11 +1203,11 @@ const pe = {
|
|
|
1204
1203
|
readonly: e.isReadonly,
|
|
1205
1204
|
type: "text"
|
|
1206
1205
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])
|
|
1207
|
-
])) :
|
|
1208
|
-
|
|
1209
|
-
u(
|
|
1206
|
+
])) : D("", !0),
|
|
1207
|
+
_e.value ? (k(), T("div", Et, [
|
|
1208
|
+
u(g, {
|
|
1210
1209
|
modelValue: e.fields.ca_certificates,
|
|
1211
|
-
"onUpdate:modelValue": i[20] || (i[20] = (
|
|
1210
|
+
"onUpdate:modelValue": i[20] || (i[20] = (d) => e.fields.ca_certificates = d),
|
|
1212
1211
|
modelModifiers: { trim: !0 },
|
|
1213
1212
|
autocomplete: "off",
|
|
1214
1213
|
"data-testid": "gateway-service-ca-certs-input",
|
|
@@ -1219,63 +1218,63 @@ const pe = {
|
|
|
1219
1218
|
type: "text"
|
|
1220
1219
|
}, {
|
|
1221
1220
|
"label-tooltip": p(() => [
|
|
1222
|
-
u(o(
|
|
1221
|
+
u(o(L), {
|
|
1223
1222
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1224
1223
|
scope: "global"
|
|
1225
1224
|
}, {
|
|
1226
1225
|
code1: p(() => [
|
|
1227
|
-
|
|
1226
|
+
V("code", null, b(o(s)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
1228
1227
|
]),
|
|
1229
1228
|
code2: p(() => [
|
|
1230
|
-
|
|
1229
|
+
V("code", null, b(o(s)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
1231
1230
|
]),
|
|
1232
1231
|
_: 1
|
|
1233
1232
|
})
|
|
1234
1233
|
]),
|
|
1235
1234
|
_: 1
|
|
1236
1235
|
}, 8, ["modelValue", "label", "placeholder", "readonly"])
|
|
1237
|
-
])) :
|
|
1238
|
-
|
|
1236
|
+
])) : D("", !0),
|
|
1237
|
+
be.value ? (k(), T("div", Mt, [
|
|
1239
1238
|
u(l, {
|
|
1240
1239
|
modelValue: e.fields.tls_verify_enabled,
|
|
1241
|
-
"onUpdate:modelValue": i[21] || (i[21] = (
|
|
1240
|
+
"onUpdate:modelValue": i[21] || (i[21] = (d) => e.fields.tls_verify_enabled = d),
|
|
1242
1241
|
"data-testid": "gateway-service-tls-verify-checkbox",
|
|
1243
1242
|
description: o(s)("gateway_services.form.fields.tls_verify_enabled.help"),
|
|
1244
1243
|
label: o(s)("gateway_services.form.fields.tls_verify_enabled.label"),
|
|
1245
1244
|
"label-attributes": { tooltipAttributes: { maxWidth: "400" } }
|
|
1246
1245
|
}, {
|
|
1247
1246
|
tooltip: p(() => [
|
|
1248
|
-
u(o(
|
|
1247
|
+
u(o(L), {
|
|
1249
1248
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
1250
1249
|
scope: "global"
|
|
1251
1250
|
}, {
|
|
1252
1251
|
code1: p(() => [
|
|
1253
|
-
|
|
1252
|
+
V("code", null, b(o(s)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
1254
1253
|
]),
|
|
1255
1254
|
_: 1
|
|
1256
1255
|
})
|
|
1257
1256
|
]),
|
|
1258
1257
|
_: 1
|
|
1259
1258
|
}, 8, ["modelValue", "description", "label"]),
|
|
1260
|
-
e.fields.tls_verify_enabled ? (
|
|
1261
|
-
u(
|
|
1259
|
+
e.fields.tls_verify_enabled ? (k(), T("div", xt, [
|
|
1260
|
+
u(f, {
|
|
1262
1261
|
modelValue: e.fields.tls_verify_value,
|
|
1263
|
-
"onUpdate:modelValue": i[22] || (i[22] = (
|
|
1262
|
+
"onUpdate:modelValue": i[22] || (i[22] = (d) => e.fields.tls_verify_value = d),
|
|
1264
1263
|
"data-testid": "gateway-service-tls-verify-true-option",
|
|
1265
1264
|
label: o(s)("gateway_services.form.fields.tls_verify_option.true.label"),
|
|
1266
1265
|
"selected-value": !0
|
|
1267
1266
|
}, null, 8, ["modelValue", "label"])
|
|
1268
|
-
])) :
|
|
1269
|
-
e.fields.tls_verify_enabled ? (
|
|
1270
|
-
u(
|
|
1267
|
+
])) : D("", !0),
|
|
1268
|
+
e.fields.tls_verify_enabled ? (k(), T("div", Rt, [
|
|
1269
|
+
u(f, {
|
|
1271
1270
|
modelValue: e.fields.tls_verify_value,
|
|
1272
|
-
"onUpdate:modelValue": i[23] || (i[23] = (
|
|
1271
|
+
"onUpdate:modelValue": i[23] || (i[23] = (d) => e.fields.tls_verify_value = d),
|
|
1273
1272
|
"data-testid": "gateway-service-tls-verify-false-option",
|
|
1274
1273
|
label: o(s)("gateway_services.form.fields.tls_verify_option.false.label"),
|
|
1275
1274
|
"selected-value": !1
|
|
1276
1275
|
}, null, 8, ["modelValue", "label"])
|
|
1277
|
-
])) :
|
|
1278
|
-
])) :
|
|
1276
|
+
])) : D("", !0)
|
|
1277
|
+
])) : D("", !0)
|
|
1279
1278
|
])
|
|
1280
1279
|
]),
|
|
1281
1280
|
_: 1
|
|
@@ -1289,14 +1288,14 @@ const pe = {
|
|
|
1289
1288
|
]);
|
|
1290
1289
|
};
|
|
1291
1290
|
}
|
|
1292
|
-
}),
|
|
1291
|
+
}), qt = /* @__PURE__ */ Me(At, [["__scopeId", "data-v-b3bd262f"]]), Ft = { class: "kong-ui-gateway-service-entity-config-card" }, Nt = /* @__PURE__ */ Ve({
|
|
1293
1292
|
__name: "GatewayServiceConfigCard",
|
|
1294
1293
|
props: {
|
|
1295
1294
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
1296
1295
|
config: {
|
|
1297
1296
|
type: Object,
|
|
1298
1297
|
required: !0,
|
|
1299
|
-
validator: (
|
|
1298
|
+
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)
|
|
1300
1299
|
},
|
|
1301
1300
|
/**
|
|
1302
1301
|
* External link for documentation that determines visibility of Documentation button
|
|
@@ -1323,124 +1322,124 @@ const pe = {
|
|
|
1323
1322
|
}
|
|
1324
1323
|
},
|
|
1325
1324
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
1326
|
-
setup(
|
|
1327
|
-
const $ =
|
|
1325
|
+
setup(a) {
|
|
1326
|
+
const $ = a, { i18n: { t: v }, i18nT: c } = ue.useI18n(), r = w(() => le.form[$.config.app].edit), { getPropValue: x } = tt(), W = (s, P) => x(s, P) === !0 ? v("gateway_services.form.fields.tls_verify_option.true.display") : v("gateway_services.form.fields.tls_verify_option.false.display"), L = S({
|
|
1328
1327
|
id: {},
|
|
1329
1328
|
name: {
|
|
1330
|
-
tooltip:
|
|
1329
|
+
tooltip: v("gateway_services.form.fields.name.tooltip")
|
|
1331
1330
|
},
|
|
1332
1331
|
enabled: {},
|
|
1333
1332
|
updated_at: {},
|
|
1334
1333
|
created_at: {},
|
|
1335
1334
|
protocol: {
|
|
1336
|
-
section:
|
|
1337
|
-
tooltip:
|
|
1335
|
+
section: ne.Basic,
|
|
1336
|
+
tooltip: v("gateway_services.form.fields.protocol.tooltip")
|
|
1338
1337
|
},
|
|
1339
1338
|
host: {
|
|
1340
|
-
section:
|
|
1341
|
-
tooltip:
|
|
1339
|
+
section: ne.Basic,
|
|
1340
|
+
tooltip: v("gateway_services.form.fields.host.tooltip")
|
|
1342
1341
|
},
|
|
1343
1342
|
path: {
|
|
1344
|
-
section:
|
|
1345
|
-
tooltip:
|
|
1343
|
+
section: ne.Basic,
|
|
1344
|
+
tooltip: v("gateway_services.form.fields.path.tooltip")
|
|
1346
1345
|
},
|
|
1347
1346
|
port: {
|
|
1348
|
-
section:
|
|
1349
|
-
tooltip:
|
|
1347
|
+
section: ne.Basic,
|
|
1348
|
+
tooltip: v("gateway_services.form.fields.port.tooltip")
|
|
1350
1349
|
},
|
|
1351
1350
|
tags: {
|
|
1352
|
-
tooltip:
|
|
1351
|
+
tooltip: v("gateway_services.form.fields.tags.tooltip")
|
|
1353
1352
|
},
|
|
1354
1353
|
// advanced fields
|
|
1355
1354
|
retries: {
|
|
1356
1355
|
order: 1,
|
|
1357
|
-
tooltip:
|
|
1356
|
+
tooltip: v("gateway_services.form.fields.retries.tooltip")
|
|
1358
1357
|
},
|
|
1359
1358
|
connect_timeout: {
|
|
1360
1359
|
order: 2,
|
|
1361
|
-
tooltip:
|
|
1360
|
+
tooltip: v("gateway_services.form.fields.connect_timeout.tooltip")
|
|
1362
1361
|
},
|
|
1363
1362
|
write_timeout: {
|
|
1364
1363
|
order: 3,
|
|
1365
|
-
tooltip:
|
|
1364
|
+
tooltip: v("gateway_services.form.fields.write_timeout.tooltip")
|
|
1366
1365
|
},
|
|
1367
1366
|
read_timeout: {
|
|
1368
1367
|
order: 4,
|
|
1369
|
-
tooltip:
|
|
1368
|
+
tooltip: v("gateway_services.form.fields.read_timeout.tooltip")
|
|
1370
1369
|
},
|
|
1371
1370
|
client_certificate: {
|
|
1372
1371
|
order: 5,
|
|
1373
|
-
tooltip:
|
|
1372
|
+
tooltip: v("gateway_services.form.fields.client_certificate.tooltip")
|
|
1374
1373
|
},
|
|
1375
1374
|
ca_certificates: {
|
|
1376
|
-
type:
|
|
1377
|
-
label:
|
|
1375
|
+
type: lt.BadgeTag,
|
|
1376
|
+
label: v("gateway_services.form.fields.ca_certificates.label"),
|
|
1378
1377
|
order: 6
|
|
1379
1378
|
},
|
|
1380
1379
|
tls_verify: {
|
|
1381
|
-
label:
|
|
1380
|
+
label: v("gateway_services.form.fields.tls_verify_enabled.label")
|
|
1382
1381
|
},
|
|
1383
1382
|
tls_verify_depth: {
|
|
1384
1383
|
hidden: !0
|
|
1385
1384
|
}
|
|
1386
1385
|
});
|
|
1387
|
-
return (s,
|
|
1388
|
-
u(o(
|
|
1389
|
-
config:
|
|
1390
|
-
"config-card-doc":
|
|
1391
|
-
"config-schema":
|
|
1392
|
-
"enable-terraform":
|
|
1393
|
-
"entity-type": o(
|
|
1386
|
+
return (s, P) => (k(), T("div", Ft, [
|
|
1387
|
+
u(o(ot), {
|
|
1388
|
+
config: a.config,
|
|
1389
|
+
"config-card-doc": a.configCardDoc,
|
|
1390
|
+
"config-schema": L.value,
|
|
1391
|
+
"enable-terraform": a.enableTerraform,
|
|
1392
|
+
"entity-type": o(Ee).GatewayService,
|
|
1394
1393
|
"fetch-url": r.value,
|
|
1395
|
-
"hide-title":
|
|
1396
|
-
"onFetch:error":
|
|
1397
|
-
"onFetch:success":
|
|
1398
|
-
onLoading:
|
|
1394
|
+
"hide-title": a.hideTitle,
|
|
1395
|
+
"onFetch:error": P[0] || (P[0] = (h) => s.$emit("fetch:error", h)),
|
|
1396
|
+
"onFetch:success": P[1] || (P[1] = (h) => s.$emit("fetch:success", h)),
|
|
1397
|
+
onLoading: P[2] || (P[2] = (h) => s.$emit("loading", h))
|
|
1399
1398
|
}, {
|
|
1400
1399
|
"enabled-label-tooltip": p(() => [
|
|
1401
|
-
u(o(
|
|
1400
|
+
u(o(c), {
|
|
1402
1401
|
keypath: "gateway_services.form.fields.enabled.tooltip",
|
|
1403
1402
|
scope: "global"
|
|
1404
1403
|
}, {
|
|
1405
1404
|
false: p(() => [
|
|
1406
|
-
|
|
1405
|
+
V("code", null, b(o(v)("gateway_services.form.fields.enabled.false")), 1)
|
|
1407
1406
|
]),
|
|
1408
1407
|
true: p(() => [
|
|
1409
|
-
|
|
1408
|
+
V("code", null, b(o(v)("gateway_services.form.fields.enabled.true")), 1)
|
|
1410
1409
|
]),
|
|
1411
1410
|
_: 1
|
|
1412
1411
|
})
|
|
1413
1412
|
]),
|
|
1414
1413
|
"ca_certificates-label-tooltip": p(() => [
|
|
1415
|
-
u(o(
|
|
1414
|
+
u(o(c), {
|
|
1416
1415
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1417
1416
|
scope: "global"
|
|
1418
1417
|
}, {
|
|
1419
1418
|
code1: p(() => [
|
|
1420
|
-
|
|
1419
|
+
V("code", null, b(o(v)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
1421
1420
|
]),
|
|
1422
1421
|
code2: p(() => [
|
|
1423
|
-
|
|
1422
|
+
V("code", null, b(o(v)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
1424
1423
|
]),
|
|
1425
1424
|
_: 1
|
|
1426
1425
|
})
|
|
1427
1426
|
]),
|
|
1428
1427
|
"tls_verify-label-tooltip": p(() => [
|
|
1429
|
-
u(o(
|
|
1428
|
+
u(o(c), {
|
|
1430
1429
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
1431
1430
|
scope: "global"
|
|
1432
1431
|
}, {
|
|
1433
1432
|
code1: p(() => [
|
|
1434
|
-
|
|
1433
|
+
V("code", null, b(o(v)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
1435
1434
|
]),
|
|
1436
1435
|
_: 1
|
|
1437
1436
|
})
|
|
1438
1437
|
]),
|
|
1439
|
-
tls_verify: p((
|
|
1440
|
-
|
|
1438
|
+
tls_verify: p((h) => [
|
|
1439
|
+
U(b(typeof o(x)("rowValue", h) == "boolean" ? W("rowValue", h) : o(v)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
|
|
1441
1440
|
]),
|
|
1442
|
-
client_certificate: p((
|
|
1443
|
-
|
|
1441
|
+
client_certificate: p((h) => [
|
|
1442
|
+
U(b(o(x)("rowValue", h) ? o(x)("rowValue", h).id : "–"), 1)
|
|
1444
1443
|
]),
|
|
1445
1444
|
_: 1
|
|
1446
1445
|
}, 8, ["config", "config-card-doc", "config-schema", "enable-terraform", "entity-type", "fetch-url", "hide-title"])
|
|
@@ -1448,7 +1447,7 @@ const pe = {
|
|
|
1448
1447
|
}
|
|
1449
1448
|
});
|
|
1450
1449
|
export {
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1450
|
+
Nt as GatewayServiceConfigCard,
|
|
1451
|
+
qt as GatewayServiceForm,
|
|
1452
|
+
Kt as GatewayServiceList
|
|
1454
1453
|
};
|