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