@kong-ui-public/entities-gateway-services 3.10.5-pr.1990.afc0f1375.0 → 3.10.5-pr.2005.e9e725032.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities-gateway-services.es.js +376 -362
- package/dist/entities-gateway-services.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/GatewayServiceConfigCard.vue.d.ts.map +1 -1
- package/dist/types/components/GatewayServiceForm.vue.d.ts.map +1 -1
- package/dist/types/components/GatewayServiceList.vue.d.ts +11 -0
- package/dist/types/components/GatewayServiceList.vue.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { BookIcon as
|
|
4
|
-
import { createI18n as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as Te, computed as b, ref as E, watch as Ie, onBeforeMount as Le, resolveComponent as F, openBlock as S, createElementBlock as U, createVNode as d, unref as o, createSlots as Ee, withCtx as f, createBlock as ue, Teleport as Pe, createElementVNode as w, createCommentVNode as L, createTextVNode as M, toDisplayString as y, withModifiers as Se, reactive as Ue, onMounted as De, renderSlot as Ge } from "vue";
|
|
2
|
+
import { useRouter as xe } from "vue-router";
|
|
3
|
+
import { BookIcon as Re, AddIcon as Ke, ServicesIcon as qe } from "@kong/icons";
|
|
4
|
+
import { createI18n as Oe, i18nTComponent as Ne } from "@kong-ui-public/i18n";
|
|
5
|
+
import { useAxios as Ae, useTableState as We, useFetcher as je, useDeleteUrlBuilder as He, FetcherStatus as Je, EntityBaseTable as ze, EntityFilter as Qe, PermissionsWrapper as ie, TableTags as Xe, EntityEmptyState as Ze, EntityToggleModal as Ye, EntityDeleteModal as et, EntityTypes as tt, useErrors as ot, useValidators as lt, EntityBaseFormType as Me, useGatewayFeatureSupported as it, EntityBaseForm as st, SupportedEntityType as Fe, EntityFormSection as $e, useHelpers as rt, ConfigurationSchemaSection as fe, ConfigurationSchemaType as at, EntityBaseConfigCard as nt } from "@kong-ui-public/entities-shared";
|
|
6
|
+
const ct = {
|
|
7
7
|
create: "New gateway service",
|
|
8
8
|
serverless_create: "Add a Service",
|
|
9
9
|
copy_id: "Copy ID",
|
|
@@ -16,12 +16,12 @@ const dt = {
|
|
|
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
|
+
}, dt = {
|
|
20
20
|
placeholder: {
|
|
21
21
|
konnect: "Filter by name",
|
|
22
22
|
kongManager: "Filter by exact name or ID"
|
|
23
23
|
}
|
|
24
|
-
},
|
|
24
|
+
}, ut = {
|
|
25
25
|
title: "Gateway Services",
|
|
26
26
|
list: {
|
|
27
27
|
toolbar_actions: {
|
|
@@ -49,7 +49,8 @@ const dt = {
|
|
|
49
49
|
empty_state_v2: {
|
|
50
50
|
create: "New gateway service",
|
|
51
51
|
title: "Configure your first gateway service",
|
|
52
|
-
|
|
52
|
+
group: "Services created in gateways within this group will automatically appear here.",
|
|
53
|
+
description: "Gateway services represent backend APIs or microservices that receive traffic routed through the gateway."
|
|
53
54
|
},
|
|
54
55
|
form: {
|
|
55
56
|
sections: {
|
|
@@ -169,33 +170,33 @@ const dt = {
|
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
|
-
},
|
|
173
|
+
}, ft = {
|
|
173
174
|
general: "Gateway Services could not be retrieved",
|
|
174
175
|
delete: "The gateway service could not be deleted at this time.",
|
|
175
176
|
copy: "Failed to copy to clipboard",
|
|
176
177
|
urlErrorMessage: "Error: invalid URL"
|
|
177
|
-
},
|
|
178
|
+
}, pt = {
|
|
178
179
|
success: "Copied {val} to clipboard",
|
|
179
180
|
success_brief: "Successfully copied to clipboard"
|
|
180
|
-
},
|
|
181
|
+
}, mt = {
|
|
181
182
|
gateway_services: "gateway services"
|
|
182
|
-
},
|
|
183
|
-
actions:
|
|
184
|
-
search:
|
|
185
|
-
gateway_services:
|
|
186
|
-
errors:
|
|
187
|
-
copy:
|
|
188
|
-
glossary:
|
|
183
|
+
}, vt = {
|
|
184
|
+
actions: ct,
|
|
185
|
+
search: dt,
|
|
186
|
+
gateway_services: ut,
|
|
187
|
+
errors: ft,
|
|
188
|
+
copy: pt,
|
|
189
|
+
glossary: mt
|
|
189
190
|
};
|
|
190
191
|
function gt() {
|
|
191
|
-
const n =
|
|
192
|
+
const n = Oe("en-us", vt);
|
|
192
193
|
return {
|
|
193
194
|
i18n: n,
|
|
194
|
-
i18nT:
|
|
195
|
+
i18nT: Ne(n)
|
|
195
196
|
// Translation component <i18n-t>
|
|
196
197
|
};
|
|
197
198
|
}
|
|
198
|
-
function
|
|
199
|
+
function yt() {
|
|
199
200
|
return {
|
|
200
201
|
getPortFromProtocol: (D, p) => {
|
|
201
202
|
const c = [80, 443], r = Number(p);
|
|
@@ -217,38 +218,38 @@ function _t() {
|
|
|
217
218
|
}
|
|
218
219
|
};
|
|
219
220
|
}
|
|
220
|
-
const
|
|
221
|
+
const ve = {
|
|
221
222
|
useI18n: gt,
|
|
222
|
-
usePortFromProtocol:
|
|
223
|
-
},
|
|
223
|
+
usePortFromProtocol: yt
|
|
224
|
+
}, pe = "/v2/control-planes/{controlPlaneId}/core-entities", me = "/{workspace}", se = {
|
|
224
225
|
list: {
|
|
225
226
|
konnect: {
|
|
226
|
-
all: `${
|
|
227
|
+
all: `${pe}/services`
|
|
227
228
|
},
|
|
228
229
|
kongManager: {
|
|
229
|
-
all: `${
|
|
230
|
+
all: `${me}/services`
|
|
230
231
|
}
|
|
231
232
|
},
|
|
232
233
|
form: {
|
|
233
234
|
konnect: {
|
|
234
|
-
create: `${
|
|
235
|
-
validate: `${
|
|
236
|
-
edit: `${
|
|
235
|
+
create: `${pe}/services`,
|
|
236
|
+
validate: `${pe}/v1/schemas/json/service/validate`,
|
|
237
|
+
edit: `${pe}/services/{id}`
|
|
237
238
|
},
|
|
238
239
|
kongManager: {
|
|
239
|
-
create: `${
|
|
240
|
-
validate: `${
|
|
241
|
-
edit: `${
|
|
240
|
+
create: `${me}/services`,
|
|
241
|
+
validate: `${me}/schemas/services/validate`,
|
|
242
|
+
edit: `${me}/services/{id}`
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
|
-
},
|
|
245
|
+
}, _t = "#00abd2", bt = "24px", ht = { class: "kong-ui-entities-gateway-services-list" }, wt = { class: "button-row" }, kt = { class: "empty-state-icon-gateway" }, Ct = { class: "control-group-message" }, Vt = { key: 1 }, St = /* @__PURE__ */ Te({
|
|
245
246
|
__name: "GatewayServiceList",
|
|
246
247
|
props: {
|
|
247
248
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
248
249
|
config: {
|
|
249
250
|
type: Object,
|
|
250
251
|
required: !0,
|
|
251
|
-
validator: (n) => !(!n || ![
|
|
252
|
+
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)
|
|
252
253
|
},
|
|
253
254
|
// used to override the default identifier for the cache entry
|
|
254
255
|
cacheIdentifier: {
|
|
@@ -289,6 +290,11 @@ const ye = {
|
|
|
289
290
|
type: Boolean,
|
|
290
291
|
default: !1
|
|
291
292
|
},
|
|
293
|
+
/** identifies if type control group or not */
|
|
294
|
+
isControlPlaneGroup: {
|
|
295
|
+
type: Boolean,
|
|
296
|
+
default: !1
|
|
297
|
+
},
|
|
292
298
|
/**
|
|
293
299
|
* Enables the new empty state design, this prop can be removed when
|
|
294
300
|
* the khcp-14756-empty-states-m2 FF is removed.
|
|
@@ -300,8 +306,8 @@ const ye = {
|
|
|
300
306
|
},
|
|
301
307
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success"],
|
|
302
308
|
setup(n, { emit: D }) {
|
|
303
|
-
var
|
|
304
|
-
const p = D, c = n, { i18n: { t: r, formatUnixTimeStamp: $ } } =
|
|
309
|
+
var l;
|
|
310
|
+
const p = D, c = n, { i18n: { t: r, formatUnixTimeStamp: $ } } = ve.useI18n(), N = xe(), { axiosInstance: q } = Ae((l = c.config) == null ? void 0 : l.axiosRequestConfig), { hasRecords: a, handleStateChange: P } = We(() => G.value), C = b(() => a.value && c.config.app === "konnect"), ge = b(() => !c.enableV2EmptyStates && c.config.app === "konnect"), ye = b(() => c.config.app !== "kongManager" || !!c.config.disableSorting), O = {
|
|
305
311
|
// the Name column is non-hidable
|
|
306
312
|
name: { label: r("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
307
313
|
...c.config.showControlPlaneColumn ? { control_plane: { label: r("gateway_services.list.table_headers.control_plane") } } : {},
|
|
@@ -313,71 +319,71 @@ const ye = {
|
|
|
313
319
|
tags: { label: r("gateway_services.list.table_headers.tags"), sortable: !1 },
|
|
314
320
|
updated_at: { label: r("gateway_services.list.table_headers.updated_at"), sortable: !0 },
|
|
315
321
|
created_at: { label: r("gateway_services.list.table_headers.created_at"), sortable: !0 }
|
|
316
|
-
},
|
|
322
|
+
}, _e = {
|
|
317
323
|
columnVisibility: {
|
|
318
324
|
created_at: !1
|
|
319
325
|
}
|
|
320
|
-
},
|
|
321
|
-
var s,
|
|
322
|
-
let u = `${c.config.apiBaseUrl}${
|
|
323
|
-
return c.config.app ===
|
|
324
|
-
}),
|
|
325
|
-
const u = c.config.app ===
|
|
326
|
+
}, H = O, _ = b(() => {
|
|
327
|
+
var s, g;
|
|
328
|
+
let u = `${c.config.apiBaseUrl}${se.list[c.config.app].all}`;
|
|
329
|
+
return c.config.app === "konnect" ? u = u.replace(/{controlPlaneId}/gi, ((s = c.config) == null ? void 0 : s.controlPlaneId) || "") : c.config.app === "kongManager" && (u = u.replace(/\/{workspace}/gi, (g = c.config) != null && g.workspace ? `/${c.config.workspace}` : "")), u;
|
|
330
|
+
}), Y = b(() => c.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${_.value}`) : new URL(_.value)), G = E(""), be = b(() => {
|
|
331
|
+
const u = c.config.app === "konnect" || c.config.isExactMatch;
|
|
326
332
|
if (u)
|
|
327
333
|
return {
|
|
328
334
|
isExactMatch: u,
|
|
329
335
|
placeholder: r(`search.placeholder.${c.config.app}`)
|
|
330
336
|
};
|
|
331
|
-
const { name: s, enabled:
|
|
337
|
+
const { name: s, enabled: g, protocol: I, host: Z, port: x, path: de } = O;
|
|
332
338
|
return {
|
|
333
339
|
isExactMatch: u,
|
|
334
|
-
fields: { name: s, enabled:
|
|
340
|
+
fields: { name: s, enabled: g, protocol: I, host: Z, port: x, path: de },
|
|
335
341
|
schema: c.config.filterSchema
|
|
336
342
|
};
|
|
337
343
|
}), {
|
|
338
344
|
fetcher: e,
|
|
339
345
|
fetcherState: k,
|
|
340
|
-
fetcherCacheKey:
|
|
341
|
-
} =
|
|
346
|
+
fetcherCacheKey: ee
|
|
347
|
+
} = je({ ...c.config, cacheIdentifier: c.cacheIdentifier }, _.value), he = () => {
|
|
342
348
|
G.value = "";
|
|
343
|
-
},
|
|
344
|
-
|
|
345
|
-
}, J =
|
|
349
|
+
}, re = () => {
|
|
350
|
+
ee.value++;
|
|
351
|
+
}, J = E(null), W = b(() => ({
|
|
346
352
|
ctaPath: c.config.createRoute,
|
|
347
|
-
ctaText:
|
|
353
|
+
ctaText: h.value ? c.isServerless ? r("actions.serverless_create") : r("actions.create") : void 0,
|
|
348
354
|
message: `${r("gateway_services.list.empty_state.description")}${c.config.additionMessageForEmptyState ? ` ${c.config.additionMessageForEmptyState}` : ""}`,
|
|
349
|
-
title:
|
|
350
|
-
})),
|
|
355
|
+
title: h.value ? c.isServerless ? r("gateway_services.list.empty_state.serverless_title") : r("gateway_services.list.empty_state.title") : r("gateway_services.title")
|
|
356
|
+
})), z = E(!1), T = E(null), Q = b(() => {
|
|
351
357
|
const u = {
|
|
352
358
|
action: "disable",
|
|
353
359
|
id: "",
|
|
354
360
|
name: ""
|
|
355
361
|
};
|
|
356
|
-
if (
|
|
357
|
-
const { enabled: s, id:
|
|
358
|
-
u.action = s ? "disable" : "enable", u.id =
|
|
362
|
+
if (T.value) {
|
|
363
|
+
const { enabled: s, id: g, name: I } = T.value;
|
|
364
|
+
u.action = s ? "disable" : "enable", u.id = g, u.name = I || g;
|
|
359
365
|
}
|
|
360
366
|
return u;
|
|
361
|
-
}),
|
|
362
|
-
|
|
363
|
-
},
|
|
364
|
-
|
|
365
|
-
},
|
|
366
|
-
var
|
|
367
|
-
if (!await ((
|
|
367
|
+
}), we = (u) => {
|
|
368
|
+
z.value = !0, T.value = u;
|
|
369
|
+
}, ae = () => {
|
|
370
|
+
z.value = !1, T.value = null;
|
|
371
|
+
}, ke = async () => {
|
|
372
|
+
var I, Z;
|
|
373
|
+
if (!await ((I = c.canEdit) == null ? void 0 : I.call(c, T.value)) || !T.value)
|
|
368
374
|
return;
|
|
369
|
-
const s = `${
|
|
375
|
+
const s = `${Y.value.href}/${T.value.id}`, g = !T.value.enabled;
|
|
370
376
|
try {
|
|
371
|
-
const { data: x } = ((
|
|
372
|
-
p("toggle:success", x),
|
|
377
|
+
const { data: x } = ((Z = c.config) == null ? void 0 : Z.app) === "konnect" ? await q.put(s, { ...T.value, enabled: g }) : await q.patch(s, { ...T.value, enabled: g });
|
|
378
|
+
p("toggle:success", x), T.value.enabled = g;
|
|
373
379
|
} catch (x) {
|
|
374
380
|
p("error", x);
|
|
375
381
|
}
|
|
376
|
-
},
|
|
377
|
-
c.config.getControlPlaneRoute &&
|
|
378
|
-
},
|
|
379
|
-
const
|
|
380
|
-
if (!s(
|
|
382
|
+
}, Ce = (u) => {
|
|
383
|
+
c.config.getControlPlaneRoute && N.push(c.config.getControlPlaneRoute(u));
|
|
384
|
+
}, te = (u, s) => {
|
|
385
|
+
const g = u.id;
|
|
386
|
+
if (!s(g)) {
|
|
381
387
|
p("copy:error", {
|
|
382
388
|
entity: u,
|
|
383
389
|
field: "id",
|
|
@@ -388,11 +394,11 @@ const ye = {
|
|
|
388
394
|
p("copy:success", {
|
|
389
395
|
entity: u,
|
|
390
396
|
field: "id",
|
|
391
|
-
message: r("copy.success", { val:
|
|
397
|
+
message: r("copy.success", { val: g })
|
|
392
398
|
});
|
|
393
|
-
},
|
|
394
|
-
const
|
|
395
|
-
if (!s(
|
|
399
|
+
}, ne = (u, s) => {
|
|
400
|
+
const g = JSON.stringify(u);
|
|
401
|
+
if (!s(g)) {
|
|
396
402
|
p("copy:error", {
|
|
397
403
|
entity: u,
|
|
398
404
|
message: r("errors.copy")
|
|
@@ -403,82 +409,82 @@ const ye = {
|
|
|
403
409
|
entity: u,
|
|
404
410
|
message: r("copy.success_brief")
|
|
405
411
|
});
|
|
406
|
-
},
|
|
407
|
-
var
|
|
408
|
-
await ((
|
|
409
|
-
},
|
|
412
|
+
}, ce = async (u) => {
|
|
413
|
+
var g;
|
|
414
|
+
await ((g = c.canRetrieve) == null ? void 0 : g.call(c, u)) && N.push(c.config.getViewRoute(u.id));
|
|
415
|
+
}, Ve = (u) => ({
|
|
410
416
|
label: r("actions.view"),
|
|
411
417
|
to: c.config.getViewRoute(u)
|
|
412
418
|
}), oe = (u) => ({
|
|
413
419
|
label: r("actions.edit"),
|
|
414
420
|
to: c.config.getEditRoute(u)
|
|
415
|
-
}), B =
|
|
416
|
-
B.value = u,
|
|
421
|
+
}), B = E(void 0), K = E(!1), j = E(!1), X = E(""), t = He(c.config, _.value), i = (u) => {
|
|
422
|
+
B.value = u, K.value = !0, X.value = "";
|
|
417
423
|
}, v = () => {
|
|
418
|
-
|
|
424
|
+
K.value = !1, B.value = void 0;
|
|
419
425
|
}, R = async () => {
|
|
420
|
-
var u, s,
|
|
426
|
+
var u, s, g;
|
|
421
427
|
if ((u = B.value) != null && u.id) {
|
|
422
|
-
|
|
428
|
+
j.value = !0;
|
|
423
429
|
try {
|
|
424
|
-
await
|
|
425
|
-
} catch (
|
|
426
|
-
|
|
430
|
+
await q.delete(t(B.value.id)), p("delete:success", B.value), v(), ee.value++;
|
|
431
|
+
} catch (I) {
|
|
432
|
+
X.value = ((g = (s = I.response) == null ? void 0 : s.data) == null ? void 0 : g.message) || I.message || r("errors.delete"), p("error", I);
|
|
427
433
|
} finally {
|
|
428
|
-
|
|
434
|
+
j.value = !1;
|
|
429
435
|
}
|
|
430
436
|
}
|
|
431
|
-
},
|
|
432
|
-
|
|
437
|
+
}, V = () => {
|
|
438
|
+
N.push(c.config.createRoute);
|
|
433
439
|
};
|
|
434
|
-
|
|
435
|
-
var s,
|
|
440
|
+
Ie(k, (u) => {
|
|
441
|
+
var s, g, I;
|
|
436
442
|
if (u.status === Je.Error) {
|
|
437
443
|
J.value = {
|
|
438
444
|
title: r("errors.general")
|
|
439
|
-
}, (
|
|
445
|
+
}, (I = (g = (s = u.error) == null ? void 0 : s.response) == null ? void 0 : g.data) != null && I.message && (J.value.message = u.error.response.data.message), p("error", u.error);
|
|
440
446
|
return;
|
|
441
447
|
}
|
|
442
448
|
J.value = null;
|
|
443
449
|
});
|
|
444
|
-
const
|
|
445
|
-
return
|
|
446
|
-
|
|
450
|
+
const h = E(!1);
|
|
451
|
+
return Le(async () => {
|
|
452
|
+
h.value = await c.canCreate();
|
|
447
453
|
}), (u, s) => {
|
|
448
|
-
const
|
|
449
|
-
return
|
|
450
|
-
d(
|
|
454
|
+
const g = F("KButton"), I = F("KBadge"), Z = F("KInputSwitch"), x = F("KDropdownItem"), de = F("KClipboardProvider");
|
|
455
|
+
return S(), U("div", ht, [
|
|
456
|
+
d(o(ze), {
|
|
451
457
|
"cache-identifier": n.cacheIdentifier,
|
|
452
|
-
"default-table-preferences":
|
|
453
|
-
"disable-sorting":
|
|
454
|
-
"empty-state-options":
|
|
458
|
+
"default-table-preferences": _e,
|
|
459
|
+
"disable-sorting": ye.value,
|
|
460
|
+
"empty-state-options": W.value,
|
|
455
461
|
"enable-entity-actions": "",
|
|
456
462
|
"error-message": J.value,
|
|
457
|
-
fetcher:
|
|
458
|
-
"fetcher-cache-key":
|
|
463
|
+
fetcher: o(e),
|
|
464
|
+
"fetcher-cache-key": o(ee),
|
|
459
465
|
"pagination-type": "offset",
|
|
460
466
|
"preferences-storage-key": "kong-ui-entities-gateway-services-list",
|
|
461
467
|
query: G.value,
|
|
462
|
-
"table-headers":
|
|
463
|
-
onClearSearchInput:
|
|
464
|
-
"onClick:row": s[5] || (s[5] = (m) =>
|
|
465
|
-
onSort:
|
|
466
|
-
onState:
|
|
467
|
-
},
|
|
468
|
+
"table-headers": o(H),
|
|
469
|
+
onClearSearchInput: he,
|
|
470
|
+
"onClick:row": s[5] || (s[5] = (m) => ce(m)),
|
|
471
|
+
onSort: re,
|
|
472
|
+
onState: o(P)
|
|
473
|
+
}, Ee({
|
|
468
474
|
"toolbar-filter": f(() => [
|
|
469
|
-
d(
|
|
475
|
+
d(o(Qe), {
|
|
470
476
|
modelValue: G.value,
|
|
471
477
|
"onUpdate:modelValue": s[0] || (s[0] = (m) => G.value = m),
|
|
472
|
-
config:
|
|
478
|
+
config: be.value
|
|
473
479
|
}, null, 8, ["modelValue", "config"])
|
|
474
480
|
]),
|
|
475
481
|
"toolbar-button": f(() => [
|
|
476
|
-
(
|
|
482
|
+
(S(), ue(Pe, {
|
|
477
483
|
disabled: !n.useActionOutside,
|
|
478
484
|
to: "#kong-ui-app-page-header-action-button"
|
|
479
485
|
}, [
|
|
480
|
-
|
|
481
|
-
|
|
486
|
+
w("div", wt, [
|
|
487
|
+
C.value ? (S(), ue(g, {
|
|
482
488
|
key: 0,
|
|
483
489
|
appearance: "secondary",
|
|
484
490
|
class: "open-learning-hub",
|
|
@@ -487,23 +493,23 @@ const ye = {
|
|
|
487
493
|
onClick: s[1] || (s[1] = (m) => u.$emit("click:learn-more"))
|
|
488
494
|
}, {
|
|
489
495
|
default: f(() => [
|
|
490
|
-
d(
|
|
496
|
+
d(o(Re), { decorative: "" })
|
|
491
497
|
]),
|
|
492
498
|
_: 1
|
|
493
499
|
})) : L("", !0),
|
|
494
|
-
d(
|
|
500
|
+
d(o(ie), {
|
|
495
501
|
"auth-function": () => n.canCreate()
|
|
496
502
|
}, {
|
|
497
503
|
default: f(() => [
|
|
498
|
-
d(
|
|
504
|
+
d(g, {
|
|
499
505
|
appearance: "primary",
|
|
500
506
|
"data-testid": "toolbar-add-gateway-service",
|
|
501
507
|
size: n.useActionOutside ? "medium" : "large",
|
|
502
508
|
to: n.config.createRoute
|
|
503
509
|
}, {
|
|
504
510
|
default: f(() => [
|
|
505
|
-
d(
|
|
506
|
-
M(" " +
|
|
511
|
+
d(o(Ke)),
|
|
512
|
+
M(" " + y(o(r)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
|
|
507
513
|
]),
|
|
508
514
|
_: 1
|
|
509
515
|
}, 8, ["size", "to"])
|
|
@@ -514,40 +520,40 @@ const ye = {
|
|
|
514
520
|
], 8, ["disabled"]))
|
|
515
521
|
]),
|
|
516
522
|
name: f(({ rowValue: m }) => [
|
|
517
|
-
|
|
523
|
+
w("b", null, y(m ?? "-"), 1)
|
|
518
524
|
]),
|
|
519
525
|
control_plane: f(({ row: m }) => {
|
|
520
526
|
var A;
|
|
521
527
|
return [
|
|
522
|
-
(A = m.x_meta) != null && A.cluster_id ? (
|
|
528
|
+
(A = m.x_meta) != null && A.cluster_id ? (S(), ue(I, {
|
|
523
529
|
key: 0,
|
|
524
530
|
tooltip: m.x_meta.cluster_id,
|
|
525
531
|
"truncation-tooltip": "",
|
|
526
|
-
onClick:
|
|
532
|
+
onClick: Se((le) => Ce(m.x_meta.cluster_id), ["stop"])
|
|
527
533
|
}, {
|
|
528
534
|
default: f(() => [
|
|
529
|
-
M(
|
|
535
|
+
M(y(m.x_meta.cluster_id), 1)
|
|
530
536
|
]),
|
|
531
537
|
_: 2
|
|
532
|
-
}, 1032, ["tooltip", "onClick"])) : (
|
|
538
|
+
}, 1032, ["tooltip", "onClick"])) : (S(), U("b", Vt, "-"))
|
|
533
539
|
];
|
|
534
540
|
}),
|
|
535
541
|
enabled: f(({ row: m }) => [
|
|
536
|
-
d(
|
|
542
|
+
d(o(ie), {
|
|
537
543
|
"auth-function": () => n.canEdit(m),
|
|
538
544
|
"force-show": ""
|
|
539
545
|
}, {
|
|
540
546
|
default: f(({ isAllowed: A }) => [
|
|
541
|
-
|
|
542
|
-
onClick: s[4] || (s[4] =
|
|
547
|
+
w("div", {
|
|
548
|
+
onClick: s[4] || (s[4] = Se(() => {
|
|
543
549
|
}, ["stop"]))
|
|
544
550
|
}, [
|
|
545
|
-
d(
|
|
551
|
+
d(Z, {
|
|
546
552
|
modelValue: m.enabled,
|
|
547
|
-
"onUpdate:modelValue": (
|
|
553
|
+
"onUpdate:modelValue": (le) => m.enabled = le,
|
|
548
554
|
"data-testid": `row-${m.id}-toggle-input`,
|
|
549
555
|
disabled: !A,
|
|
550
|
-
onClick:
|
|
556
|
+
onClick: Se((le) => we(m), ["prevent"])
|
|
551
557
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "disabled", "onClick"])
|
|
552
558
|
])
|
|
553
559
|
]),
|
|
@@ -555,56 +561,56 @@ const ye = {
|
|
|
555
561
|
}, 1032, ["auth-function"])
|
|
556
562
|
]),
|
|
557
563
|
tags: f(({ rowValue: m }) => [
|
|
558
|
-
d(
|
|
564
|
+
d(o(Xe), { tags: m }, null, 8, ["tags"])
|
|
559
565
|
]),
|
|
560
566
|
created_at: f(({ rowValue: m }) => [
|
|
561
|
-
M(
|
|
567
|
+
M(y(o($)(m)), 1)
|
|
562
568
|
]),
|
|
563
569
|
updated_at: f(({ row: m, rowValue: A }) => [
|
|
564
|
-
M(
|
|
570
|
+
M(y(o($)(A ?? m.created_at)), 1)
|
|
565
571
|
]),
|
|
566
572
|
actions: f(({ row: m }) => [
|
|
567
|
-
d(
|
|
573
|
+
d(de, null, {
|
|
568
574
|
default: f(({ copyToClipboard: A }) => [
|
|
569
575
|
d(x, {
|
|
570
576
|
"data-testid": "action-entity-copy-id",
|
|
571
|
-
onClick: (
|
|
577
|
+
onClick: (le) => te(m, A)
|
|
572
578
|
}, {
|
|
573
579
|
default: f(() => [
|
|
574
|
-
M(
|
|
580
|
+
M(y(o(r)("actions.copy_id")), 1)
|
|
575
581
|
]),
|
|
576
582
|
_: 2
|
|
577
583
|
}, 1032, ["onClick"])
|
|
578
584
|
]),
|
|
579
585
|
_: 2
|
|
580
586
|
}, 1024),
|
|
581
|
-
d(
|
|
587
|
+
d(de, null, {
|
|
582
588
|
default: f(({ copyToClipboard: A }) => [
|
|
583
589
|
d(x, {
|
|
584
590
|
"data-testid": "action-entity-copy-json",
|
|
585
|
-
onClick: (
|
|
591
|
+
onClick: (le) => ne(m, A)
|
|
586
592
|
}, {
|
|
587
593
|
default: f(() => [
|
|
588
|
-
M(
|
|
594
|
+
M(y(o(r)("actions.copy_json")), 1)
|
|
589
595
|
]),
|
|
590
596
|
_: 2
|
|
591
597
|
}, 1032, ["onClick"])
|
|
592
598
|
]),
|
|
593
599
|
_: 2
|
|
594
600
|
}, 1024),
|
|
595
|
-
d(
|
|
601
|
+
d(o(ie), {
|
|
596
602
|
"auth-function": () => n.canRetrieve(m)
|
|
597
603
|
}, {
|
|
598
604
|
default: f(() => [
|
|
599
605
|
d(x, {
|
|
600
606
|
"data-testid": "action-entity-view",
|
|
601
607
|
"has-divider": "",
|
|
602
|
-
item:
|
|
608
|
+
item: Ve(m.id)
|
|
603
609
|
}, null, 8, ["item"])
|
|
604
610
|
]),
|
|
605
611
|
_: 2
|
|
606
612
|
}, 1032, ["auth-function"]),
|
|
607
|
-
d(
|
|
613
|
+
d(o(ie), {
|
|
608
614
|
"auth-function": () => n.canEdit(m)
|
|
609
615
|
}, {
|
|
610
616
|
default: f(() => [
|
|
@@ -615,7 +621,7 @@ const ye = {
|
|
|
615
621
|
]),
|
|
616
622
|
_: 2
|
|
617
623
|
}, 1032, ["auth-function"]),
|
|
618
|
-
d(
|
|
624
|
+
d(o(ie), {
|
|
619
625
|
"auth-function": () => n.canDelete(m)
|
|
620
626
|
}, {
|
|
621
627
|
default: f(() => [
|
|
@@ -626,7 +632,7 @@ const ye = {
|
|
|
626
632
|
onClick: (A) => i(m)
|
|
627
633
|
}, {
|
|
628
634
|
default: f(() => [
|
|
629
|
-
M(
|
|
635
|
+
M(y(o(r)("actions.delete.menu_label")), 1)
|
|
630
636
|
]),
|
|
631
637
|
_: 2
|
|
632
638
|
}, 1032, ["onClick"])
|
|
@@ -636,14 +642,14 @@ const ye = {
|
|
|
636
642
|
]),
|
|
637
643
|
_: 2
|
|
638
644
|
}, [
|
|
639
|
-
!
|
|
645
|
+
!o(a) && ge.value ? {
|
|
640
646
|
name: "outside-actions",
|
|
641
647
|
fn: f(() => [
|
|
642
|
-
(
|
|
648
|
+
(S(), ue(Pe, {
|
|
643
649
|
disabled: !n.useActionOutside,
|
|
644
650
|
to: "#kong-ui-app-page-header-action-button"
|
|
645
651
|
}, [
|
|
646
|
-
d(
|
|
652
|
+
d(g, {
|
|
647
653
|
appearance: "secondary",
|
|
648
654
|
class: "open-learning-hub",
|
|
649
655
|
"data-testid": "gateway-services-more-button",
|
|
@@ -651,7 +657,7 @@ const ye = {
|
|
|
651
657
|
onClick: s[2] || (s[2] = (m) => u.$emit("click:learn-more"))
|
|
652
658
|
}, {
|
|
653
659
|
default: f(() => [
|
|
654
|
-
d(
|
|
660
|
+
d(o(Re), { decorative: "" })
|
|
655
661
|
]),
|
|
656
662
|
_: 1
|
|
657
663
|
})
|
|
@@ -659,92 +665,100 @@ const ye = {
|
|
|
659
665
|
]),
|
|
660
666
|
key: "0"
|
|
661
667
|
} : void 0,
|
|
662
|
-
n.enableV2EmptyStates && n.config.app ===
|
|
668
|
+
n.enableV2EmptyStates && n.config.app === "konnect" ? {
|
|
663
669
|
name: "empty-state",
|
|
664
670
|
fn: f(() => [
|
|
665
|
-
d(
|
|
666
|
-
"action-button-text":
|
|
671
|
+
d(o(Ze), {
|
|
672
|
+
"action-button-text": o(r)("gateway_services.empty_state_v2.create"),
|
|
667
673
|
appearance: "secondary",
|
|
668
674
|
"can-create": () => n.canCreate(),
|
|
669
675
|
"data-testid": "gateway-services-entity-empty-state",
|
|
670
|
-
description:
|
|
671
|
-
"learn-more": n.config.app ===
|
|
672
|
-
title:
|
|
673
|
-
"onClick:create":
|
|
676
|
+
description: o(r)("gateway_services.empty_state_v2.description"),
|
|
677
|
+
"learn-more": n.config.app === "konnect",
|
|
678
|
+
title: o(r)("gateway_services.empty_state_v2.title"),
|
|
679
|
+
"onClick:create": V,
|
|
674
680
|
"onClick:learnMore": s[3] || (s[3] = (m) => u.$emit("click:learn-more"))
|
|
675
|
-
}, {
|
|
681
|
+
}, Ee({
|
|
676
682
|
image: f(() => [
|
|
677
|
-
|
|
678
|
-
d(
|
|
679
|
-
color:
|
|
680
|
-
size:
|
|
683
|
+
w("div", kt, [
|
|
684
|
+
d(o(qe), {
|
|
685
|
+
color: o(_t),
|
|
686
|
+
size: o(bt)
|
|
681
687
|
}, null, 8, ["color", "size"])
|
|
682
688
|
])
|
|
683
689
|
]),
|
|
684
|
-
_:
|
|
685
|
-
},
|
|
690
|
+
_: 2
|
|
691
|
+
}, [
|
|
692
|
+
n.isControlPlaneGroup ? {
|
|
693
|
+
name: "message",
|
|
694
|
+
fn: f(() => [
|
|
695
|
+
w("p", Ct, y(o(r)("gateway_services.empty_state_v2.group")), 1)
|
|
696
|
+
]),
|
|
697
|
+
key: "0"
|
|
698
|
+
} : void 0
|
|
699
|
+
]), 1032, ["action-button-text", "can-create", "description", "learn-more", "title"])
|
|
686
700
|
]),
|
|
687
701
|
key: "1"
|
|
688
702
|
} : void 0
|
|
689
703
|
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
|
|
690
|
-
d(
|
|
691
|
-
action:
|
|
692
|
-
"entity-id":
|
|
693
|
-
"entity-name":
|
|
694
|
-
"entity-type":
|
|
695
|
-
"on-confirm":
|
|
696
|
-
visible:
|
|
697
|
-
onCancel:
|
|
698
|
-
onProceed:
|
|
704
|
+
d(o(Ye), {
|
|
705
|
+
action: Q.value.action,
|
|
706
|
+
"entity-id": Q.value.id,
|
|
707
|
+
"entity-name": Q.value.name,
|
|
708
|
+
"entity-type": o(r)("glossary.gateway_services"),
|
|
709
|
+
"on-confirm": ke,
|
|
710
|
+
visible: z.value,
|
|
711
|
+
onCancel: ae,
|
|
712
|
+
onProceed: ae
|
|
699
713
|
}, null, 8, ["action", "entity-id", "entity-name", "entity-type", "visible"]),
|
|
700
|
-
d(
|
|
701
|
-
"action-pending":
|
|
702
|
-
description:
|
|
714
|
+
d(o(et), {
|
|
715
|
+
"action-pending": j.value,
|
|
716
|
+
description: o(r)("actions.delete.description"),
|
|
703
717
|
"entity-name": B.value && (B.value.name || B.value.id),
|
|
704
|
-
"entity-type":
|
|
705
|
-
error:
|
|
706
|
-
title:
|
|
707
|
-
visible:
|
|
718
|
+
"entity-type": o(tt).GatewayService,
|
|
719
|
+
error: X.value,
|
|
720
|
+
title: o(r)("actions.delete.title"),
|
|
721
|
+
visible: K.value,
|
|
708
722
|
onCancel: v,
|
|
709
723
|
onProceed: R
|
|
710
724
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
711
725
|
]);
|
|
712
726
|
};
|
|
713
727
|
}
|
|
714
|
-
}),
|
|
728
|
+
}), Be = (n, D) => {
|
|
715
729
|
const p = n.__vccOpts || n;
|
|
716
730
|
for (const [c, r] of D)
|
|
717
731
|
p[c] = r;
|
|
718
732
|
return p;
|
|
719
|
-
}, Qt = /* @__PURE__ */
|
|
733
|
+
}, Qt = /* @__PURE__ */ Be(St, [["__scopeId", "data-v-e23d7666"]]), It = { class: "kong-ui-entities-gateway-service-form" }, Tt = { key: 0 }, Et = { class: "gateway-service-form-traffic-label" }, Pt = { class: "gateway-service-form-margin-bottom" }, Ut = {
|
|
720
734
|
key: 0,
|
|
721
735
|
class: "gateway-service-form-group-fields"
|
|
722
|
-
},
|
|
736
|
+
}, Rt = {
|
|
723
737
|
key: 1,
|
|
724
738
|
class: "gateway-service-form-group-fields"
|
|
725
|
-
},
|
|
739
|
+
}, Mt = { key: 0 }, $t = { class: "gateway-service-form-margin-top" }, xt = { class: "gateway-service-form-margin-bottom" }, At = { class: "gateway-service-form-margin-bottom" }, Ft = { class: "gateway-service-form-margin-bottom" }, Bt = { class: "gateway-service-form-margin-bottom" }, Lt = {
|
|
726
740
|
key: 0,
|
|
727
741
|
class: "gateway-service-form-margin-bottom"
|
|
728
|
-
},
|
|
742
|
+
}, Dt = {
|
|
729
743
|
key: 1,
|
|
730
744
|
class: "gateway-service-form-margin-bottom"
|
|
731
|
-
},
|
|
745
|
+
}, Gt = {
|
|
732
746
|
key: 2,
|
|
733
747
|
class: "gateway-service-form-margin-bottom"
|
|
734
|
-
},
|
|
748
|
+
}, Kt = {
|
|
735
749
|
key: 0,
|
|
736
750
|
class: "checkbox-aligned-radio"
|
|
737
751
|
}, qt = {
|
|
738
752
|
key: 1,
|
|
739
753
|
class: "checkbox-aligned-radio"
|
|
740
|
-
}, Ot = /* @__PURE__ */
|
|
754
|
+
}, Ot = /* @__PURE__ */ Te({
|
|
741
755
|
__name: "GatewayServiceForm",
|
|
742
756
|
props: {
|
|
743
757
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
744
758
|
config: {
|
|
745
759
|
type: Object,
|
|
746
760
|
required: !0,
|
|
747
|
-
validator: (n) => !(!n || ![
|
|
761
|
+
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)
|
|
748
762
|
},
|
|
749
763
|
/** If a valid Gateway Service ID is provided, it will put the form in Edit mode instead of Create */
|
|
750
764
|
gatewayServiceId: {
|
|
@@ -761,8 +775,8 @@ const ye = {
|
|
|
761
775
|
},
|
|
762
776
|
emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated"],
|
|
763
777
|
setup(n, { expose: D, emit: p }) {
|
|
764
|
-
var
|
|
765
|
-
const c = p, r = n, $ =
|
|
778
|
+
var X;
|
|
779
|
+
const c = p, r = n, $ = E(!0), N = xe(), { i18nT: q, i18n: { t: a } } = ve.useI18n(), { getMessageFromError: P } = ot(), { axiosInstance: C } = Ae((X = r.config) == null ? void 0 : X.axiosRequestConfig), ge = lt(), ye = b(() => se.form[r.config.app].edit), O = b(() => r.gatewayServiceId ? Me.Edit : Me.Create), _e = E(!1), H = b(() => !!r.gatewayServiceId), _ = E(H.value ? "protocol" : "url"), Y = ve.usePortFromProtocol(), G = E(""), be = b(() => !!G.value), e = Ue({
|
|
766
780
|
fields: {
|
|
767
781
|
name: "",
|
|
768
782
|
protocol: "http",
|
|
@@ -798,13 +812,13 @@ const ye = {
|
|
|
798
812
|
tls_verify_enabled: !1,
|
|
799
813
|
tls_verify_value: !1,
|
|
800
814
|
tags: ""
|
|
801
|
-
}),
|
|
815
|
+
}), ee = r.config.app === "konnect" || it({
|
|
802
816
|
gatewayInfo: r.config.gatewayInfo,
|
|
803
817
|
// 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
|
|
804
818
|
supportedRange: {
|
|
805
819
|
enterprise: ["3.0"]
|
|
806
820
|
}
|
|
807
|
-
}),
|
|
821
|
+
}), he = [
|
|
808
822
|
{
|
|
809
823
|
label: a("gateway_services.form.fields.protocol.options.http"),
|
|
810
824
|
value: "http",
|
|
@@ -840,7 +854,7 @@ const ye = {
|
|
|
840
854
|
value: "grpcs",
|
|
841
855
|
group: "grpc"
|
|
842
856
|
},
|
|
843
|
-
...
|
|
857
|
+
...ee ? [
|
|
844
858
|
{
|
|
845
859
|
label: a("gateway_services.form.fields.protocol.options.ws"),
|
|
846
860
|
value: "ws",
|
|
@@ -857,60 +871,60 @@ const ye = {
|
|
|
857
871
|
value: "udp",
|
|
858
872
|
group: "udp"
|
|
859
873
|
}
|
|
860
|
-
],
|
|
874
|
+
], re = { url: "url", protocol: "protocol" }, J = (t, i) => {
|
|
861
875
|
i.value;
|
|
862
|
-
},
|
|
876
|
+
}, W = (t) => t ? parseFloat(t) : 0, z = () => {
|
|
863
877
|
$.value = !0, e.errorMessage = "", e.fields.host = k.host, e.fields.path = k.path, e.fields.port = k.port, e.fields.protocol = k.protocol, e.fields.url = k.url, e.fields.retries = k.retries, e.fields.connect_timeout = k.connect_timeout, e.fields.write_timeout = k.write_timeout, e.fields.read_timeout = k.read_timeout, e.fields.client_certificate = k.client_certificate, e.fields.ca_certificates = k.ca_certificates, e.fields.tls_verify_enabled = k.tls_verify_enabled, e.fields.tls_verify_value = k.tls_verify_value;
|
|
864
|
-
},
|
|
878
|
+
}, T = () => {
|
|
865
879
|
if (e.fields.url && _.value === "url")
|
|
866
880
|
try {
|
|
867
881
|
const t = new URL(e.fields.url);
|
|
868
882
|
e.errorMessage = "", e.fields.protocol = t.protocol.slice(0, -1), e.fields.host = t.hostname, e.fields.path = t.pathname;
|
|
869
883
|
const i = Number(t.port);
|
|
870
|
-
|
|
884
|
+
_e.value = !!i, e.fields.port = i || Y.getPortFromProtocol(e.fields.protocol), e.errorMessage = "", c("url-valid:success");
|
|
871
885
|
} catch (t) {
|
|
872
|
-
e.errorMessage = a("errors.urlErrorMessage"), c("url-valid:error",
|
|
886
|
+
e.errorMessage = a("errors.urlErrorMessage"), c("url-valid:error", P(t));
|
|
873
887
|
}
|
|
874
888
|
else
|
|
875
889
|
c("url-valid:success"), e.errorMessage = "";
|
|
876
|
-
},
|
|
890
|
+
}, Q = b(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(e.fields.protocol)), we = b(() => {
|
|
877
891
|
if (_.value === "url")
|
|
878
892
|
return !0;
|
|
879
893
|
const t = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
880
894
|
return _.value === "protocol" && t;
|
|
881
|
-
}),
|
|
895
|
+
}), ae = b(() => {
|
|
882
896
|
if (_.value === "url")
|
|
883
897
|
return !0;
|
|
884
898
|
const t = ["https", "tls"].includes(e.fields.protocol);
|
|
885
899
|
return _.value === "protocol" && t;
|
|
886
|
-
}),
|
|
900
|
+
}), ke = b(() => {
|
|
887
901
|
if (_.value === "url")
|
|
888
902
|
return !0;
|
|
889
903
|
const t = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
890
904
|
return _.value === "protocol" && t;
|
|
891
|
-
}),
|
|
905
|
+
}), Ce = (t) => {
|
|
892
906
|
G.value = ge.utf8Name(t);
|
|
893
|
-
},
|
|
907
|
+
}, te = b(() => H.value && JSON.stringify(e.fields) !== JSON.stringify(k) || _.value === "url" && !!e.fields.url || _.value === "protocol" && !!e.fields.host), ne = (t) => {
|
|
894
908
|
var i, v, R;
|
|
895
909
|
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 = ((v = t == null ? void 0 : t.ca_certificates) == null ? void 0 : v.join(",")) || "", e.fields.client_certificate = ((R = t == null ? void 0 : t.client_certificate) == null ? void 0 : R.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(k, e.fields);
|
|
896
|
-
},
|
|
897
|
-
|
|
898
|
-
},
|
|
910
|
+
}, ce = () => {
|
|
911
|
+
N.push(r.config.cancelRoute);
|
|
912
|
+
}, Ve = b(() => {
|
|
899
913
|
var i, v;
|
|
900
|
-
let t = `${r.config.apiBaseUrl}${
|
|
901
|
-
return r.config.app ===
|
|
914
|
+
let t = `${r.config.apiBaseUrl}${se.form[r.config.app].validate}`;
|
|
915
|
+
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, (v = r.config) != null && v.workspace ? `/${r.config.workspace}` : "")), t = t.replace(/{id}/gi, r.gatewayServiceId), t;
|
|
902
916
|
}), oe = b(() => {
|
|
903
917
|
var i, v;
|
|
904
|
-
let t = `${r.config.apiBaseUrl}${
|
|
905
|
-
return r.config.app ===
|
|
918
|
+
let t = `${r.config.apiBaseUrl}${se.form[r.config.app][O.value]}`;
|
|
919
|
+
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, (v = r.config) != null && v.workspace ? `/${r.config.workspace}` : "")), t = t.replace(/{id}/gi, r.gatewayServiceId), t;
|
|
906
920
|
}), B = (t) => {
|
|
907
921
|
let i = "";
|
|
908
922
|
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;
|
|
909
|
-
},
|
|
910
|
-
var i, v, R,
|
|
923
|
+
}, K = b(() => {
|
|
924
|
+
var i, v, R, V;
|
|
911
925
|
const t = {
|
|
912
926
|
name: e.fields.name || null,
|
|
913
|
-
tags: e.fields.tags ? (R = (v = (i = e.fields.tags) == null ? void 0 : i.split(",")) == null ? void 0 : v.map((
|
|
927
|
+
tags: e.fields.tags ? (R = (v = (i = e.fields.tags) == null ? void 0 : i.split(",")) == null ? void 0 : v.map((h) => String(h || "").trim())) == null ? void 0 : R.filter((h) => h !== "") : null,
|
|
914
928
|
protocol: e.fields.protocol,
|
|
915
929
|
path: e.fields.path || null,
|
|
916
930
|
read_timeout: e.fields.read_timeout,
|
|
@@ -919,73 +933,73 @@ const ye = {
|
|
|
919
933
|
connect_timeout: e.fields.connect_timeout,
|
|
920
934
|
tls_verify_value: e.fields.tls_verify_value,
|
|
921
935
|
tls_verify_enabled: e.fields.tls_verify_enabled,
|
|
922
|
-
ca_certificates: e.fields.ca_certificates ? (
|
|
936
|
+
ca_certificates: e.fields.ca_certificates ? (V = e.fields.ca_certificates) == null ? void 0 : V.split(",").filter((h) => h !== "") : null,
|
|
923
937
|
client_certificate: e.fields.client_certificate ? { id: e.fields.client_certificate } : null,
|
|
924
938
|
write_timeout: e.fields.write_timeout,
|
|
925
939
|
port: e.fields.port,
|
|
926
940
|
url: e.fields.url
|
|
927
941
|
};
|
|
928
|
-
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),
|
|
929
|
-
}),
|
|
942
|
+
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), Q.value || (t.path = null), O.value === "create" ? _.value === "url" ? (delete t.protocol, delete t.host, delete t.path, r.config.app === "konnect" && delete t.port) : delete t.url : O.value === "edit" && delete t.url, t;
|
|
943
|
+
}), j = async () => {
|
|
930
944
|
var t, i, v, R;
|
|
931
945
|
try {
|
|
932
|
-
e.isReadonly = !0,
|
|
933
|
-
const
|
|
934
|
-
B(
|
|
935
|
-
let
|
|
936
|
-
if (await
|
|
937
|
-
const { data:
|
|
938
|
-
e.fields.name = (
|
|
946
|
+
e.isReadonly = !0, T();
|
|
947
|
+
const V = K.value;
|
|
948
|
+
B(V);
|
|
949
|
+
let h;
|
|
950
|
+
if (await C.post(Ve.value, V), O.value === "create" ? h = await C.post(oe.value, V) : O.value === "edit" && (h = ((t = r.config) == null ? void 0 : t.app) === "konnect" ? await C.put(oe.value, V) : await C.patch(oe.value, V)), h) {
|
|
951
|
+
const { data: l } = h;
|
|
952
|
+
e.fields.name = (l == null ? void 0 : l.name) || "", e.fields.port = l.port || Y.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 = (v = l == null ? void 0 : l.ca_certificates) != null && v.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 = (R = l == null ? void 0 : l.tags) != null && R.length ? l.tags.join(", ") : "", Object.assign(k, e.fields), c("update", h == null ? void 0 : h.data);
|
|
939
953
|
}
|
|
940
|
-
return
|
|
941
|
-
} catch (
|
|
942
|
-
e.errorMessage =
|
|
954
|
+
return h;
|
|
955
|
+
} catch (V) {
|
|
956
|
+
e.errorMessage = P(V), c("error", V);
|
|
943
957
|
} finally {
|
|
944
958
|
e.isReadonly = !1;
|
|
945
959
|
}
|
|
946
960
|
};
|
|
947
|
-
return
|
|
961
|
+
return Ie(() => r.gatewayServiceId, () => {
|
|
948
962
|
Object.assign(e.fields, k);
|
|
949
|
-
}),
|
|
950
|
-
e.fields.port =
|
|
963
|
+
}), Ie(e.fields, (t) => {
|
|
964
|
+
e.fields.port = Y.getPortFromProtocol(t.protocol, String(t.port)), c("model-updated", K.value);
|
|
951
965
|
}), De(() => {
|
|
952
|
-
c("model-updated",
|
|
966
|
+
c("model-updated", K.value);
|
|
953
967
|
}), D({
|
|
954
|
-
validateUrl:
|
|
955
|
-
getPayload:
|
|
956
|
-
saveFormData:
|
|
957
|
-
canSubmit:
|
|
958
|
-
initForm:
|
|
968
|
+
validateUrl: T,
|
|
969
|
+
getPayload: K,
|
|
970
|
+
saveFormData: j,
|
|
971
|
+
canSubmit: te,
|
|
972
|
+
initForm: ne
|
|
959
973
|
}), (t, i) => {
|
|
960
|
-
const v = F("KInput"), R = F("KLabel"),
|
|
961
|
-
return
|
|
962
|
-
d(
|
|
963
|
-
"can-submit":
|
|
974
|
+
const v = F("KInput"), R = F("KLabel"), V = F("KRadio"), h = F("KSelect"), l = F("KCheckbox"), u = F("KCollapse");
|
|
975
|
+
return S(), U("div", It, [
|
|
976
|
+
d(o(st), {
|
|
977
|
+
"can-submit": te.value,
|
|
964
978
|
config: n.config,
|
|
965
979
|
"edit-id": n.gatewayServiceId,
|
|
966
|
-
"entity-type":
|
|
980
|
+
"entity-type": o(Fe).GatewayService,
|
|
967
981
|
"error-message": e.errorMessage,
|
|
968
|
-
"fetch-url":
|
|
969
|
-
"form-fields":
|
|
982
|
+
"fetch-url": ye.value,
|
|
983
|
+
"form-fields": K.value,
|
|
970
984
|
"is-readonly": e.isReadonly,
|
|
971
|
-
onCancel:
|
|
985
|
+
onCancel: ce,
|
|
972
986
|
"onFetch:error": i[25] || (i[25] = (s) => t.$emit("error", s)),
|
|
973
|
-
"onFetch:success":
|
|
987
|
+
"onFetch:success": ne,
|
|
974
988
|
onLoading: i[26] || (i[26] = (s) => t.$emit("loading", s)),
|
|
975
|
-
onSubmit:
|
|
989
|
+
onSubmit: j
|
|
976
990
|
}, {
|
|
977
991
|
"form-actions": f(() => [
|
|
978
992
|
Ge(t.$slots, "form-actions", {
|
|
979
|
-
canSubmit:
|
|
980
|
-
cancel:
|
|
981
|
-
submit:
|
|
993
|
+
canSubmit: te.value,
|
|
994
|
+
cancel: ce,
|
|
995
|
+
submit: j
|
|
982
996
|
}, void 0, !0)
|
|
983
997
|
]),
|
|
984
998
|
default: f(() => [
|
|
985
|
-
d(
|
|
986
|
-
description:
|
|
999
|
+
d(o($e), {
|
|
1000
|
+
description: o(a)("gateway_services.form.sections.general.description"),
|
|
987
1001
|
"hide-info-header": n.hideSectionsInfo,
|
|
988
|
-
title:
|
|
1002
|
+
title: o(a)("gateway_services.form.sections.general.title")
|
|
989
1003
|
}, {
|
|
990
1004
|
default: f(() => [
|
|
991
1005
|
d(v, {
|
|
@@ -994,18 +1008,18 @@ const ye = {
|
|
|
994
1008
|
modelModifiers: { trim: !0 },
|
|
995
1009
|
autocomplete: "off",
|
|
996
1010
|
"data-testid": "gateway-service-name-input",
|
|
997
|
-
error:
|
|
1011
|
+
error: be.value,
|
|
998
1012
|
"error-message": G.value,
|
|
999
|
-
label:
|
|
1013
|
+
label: o(a)("gateway_services.form.fields.name.label"),
|
|
1000
1014
|
"label-attributes": {
|
|
1001
|
-
info:
|
|
1015
|
+
info: o(a)("gateway_services.form.fields.name.tooltip"),
|
|
1002
1016
|
tooltipAttributes: { maxWidth: "400" }
|
|
1003
1017
|
},
|
|
1004
1018
|
name: "name",
|
|
1005
|
-
placeholder:
|
|
1019
|
+
placeholder: o(a)("gateway_services.form.fields.name.placeholder"),
|
|
1006
1020
|
readonly: e.isReadonly,
|
|
1007
1021
|
type: "text",
|
|
1008
|
-
onInput:
|
|
1022
|
+
onInput: Ce
|
|
1009
1023
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1010
1024
|
d(v, {
|
|
1011
1025
|
modelValue: e.fields.tags,
|
|
@@ -1013,89 +1027,89 @@ const ye = {
|
|
|
1013
1027
|
modelModifiers: { trim: !0 },
|
|
1014
1028
|
autocomplete: "off",
|
|
1015
1029
|
"data-testid": "gateway-service-tags-input",
|
|
1016
|
-
help:
|
|
1017
|
-
label:
|
|
1030
|
+
help: o(a)("gateway_services.form.fields.tags.help"),
|
|
1031
|
+
label: o(a)("gateway_services.form.fields.tags.label"),
|
|
1018
1032
|
"label-attributes": {
|
|
1019
|
-
info:
|
|
1033
|
+
info: o(a)("gateway_services.form.fields.tags.tooltip"),
|
|
1020
1034
|
tooltipAttributes: { maxWidth: "400" }
|
|
1021
1035
|
},
|
|
1022
1036
|
name: "tags",
|
|
1023
|
-
placeholder:
|
|
1037
|
+
placeholder: o(a)("gateway_services.form.fields.tags.placeholder"),
|
|
1024
1038
|
readonly: e.isReadonly,
|
|
1025
1039
|
type: "text"
|
|
1026
1040
|
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
|
|
1027
1041
|
]),
|
|
1028
1042
|
_: 1
|
|
1029
1043
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
1030
|
-
d(
|
|
1031
|
-
description:
|
|
1044
|
+
d(o($e), {
|
|
1045
|
+
description: o(a)("gateway_services.form.sections.keys.description"),
|
|
1032
1046
|
"hide-info-header": n.hideSectionsInfo,
|
|
1033
|
-
title:
|
|
1047
|
+
title: o(a)("gateway_services.form.sections.keys.title")
|
|
1034
1048
|
}, {
|
|
1035
1049
|
default: f(() => [
|
|
1036
|
-
|
|
1037
|
-
|
|
1050
|
+
H.value ? L("", !0) : (S(), U("div", Tt, [
|
|
1051
|
+
w("div", Et, [
|
|
1038
1052
|
d(R, { required: "" }, {
|
|
1039
1053
|
default: f(() => [
|
|
1040
|
-
M(
|
|
1054
|
+
M(y(o(a)("gateway_services.form.sections.keys.checkedGroupLabel")), 1)
|
|
1041
1055
|
]),
|
|
1042
1056
|
_: 1
|
|
1043
1057
|
})
|
|
1044
1058
|
]),
|
|
1045
|
-
|
|
1046
|
-
d(
|
|
1059
|
+
w("div", Pt, [
|
|
1060
|
+
d(V, {
|
|
1047
1061
|
modelValue: _.value,
|
|
1048
1062
|
"onUpdate:modelValue": i[2] || (i[2] = (s) => _.value = s),
|
|
1049
1063
|
"data-testid": "gateway-service-url-radio",
|
|
1050
|
-
"selected-value":
|
|
1051
|
-
onChange:
|
|
1064
|
+
"selected-value": re.url,
|
|
1065
|
+
onChange: z
|
|
1052
1066
|
}, {
|
|
1053
1067
|
default: f(() => [
|
|
1054
|
-
M(
|
|
1068
|
+
M(y(o(a)("gateway_services.form.sections.keys.urlLabel")), 1)
|
|
1055
1069
|
]),
|
|
1056
1070
|
_: 1
|
|
1057
1071
|
}, 8, ["modelValue", "selected-value"])
|
|
1058
1072
|
]),
|
|
1059
|
-
_.value === "url" ? (
|
|
1073
|
+
_.value === "url" ? (S(), U("div", Ut, [
|
|
1060
1074
|
d(v, {
|
|
1061
1075
|
modelValue: e.fields.url,
|
|
1062
1076
|
"onUpdate:modelValue": i[3] || (i[3] = (s) => e.fields.url = s),
|
|
1063
1077
|
modelModifiers: { trim: !0 },
|
|
1064
1078
|
class: "gateway-service-url-input gateway-service-form-margin-bottom",
|
|
1065
1079
|
"data-testid": "gateway-service-url-input",
|
|
1066
|
-
label:
|
|
1080
|
+
label: o(a)("gateway_services.form.fields.upstream_url.label"),
|
|
1067
1081
|
"label-attributes": {
|
|
1068
|
-
info: n.config.app ===
|
|
1082
|
+
info: n.config.app === "konnect" ? o(a)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(a)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
|
|
1069
1083
|
tooltipAttributes: { maxWidth: "400" }
|
|
1070
1084
|
},
|
|
1071
1085
|
name: "url",
|
|
1072
|
-
placeholder:
|
|
1086
|
+
placeholder: o(a)("gateway_services.form.fields.upstream_url.placeholder"),
|
|
1073
1087
|
required: ""
|
|
1074
1088
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
|
|
1075
1089
|
])) : L("", !0),
|
|
1076
|
-
d(
|
|
1090
|
+
d(V, {
|
|
1077
1091
|
modelValue: _.value,
|
|
1078
1092
|
"onUpdate:modelValue": i[4] || (i[4] = (s) => _.value = s),
|
|
1079
1093
|
"checked-group": "protocol",
|
|
1080
1094
|
"data-testid": "gateway-service-protocol-radio",
|
|
1081
|
-
"selected-value":
|
|
1082
|
-
onChange:
|
|
1095
|
+
"selected-value": re.protocol,
|
|
1096
|
+
onChange: z
|
|
1083
1097
|
}, {
|
|
1084
1098
|
default: f(() => [
|
|
1085
|
-
M(
|
|
1099
|
+
M(y(o(a)("gateway_services.form.sections.keys.checkedGroupAltLabel")), 1)
|
|
1086
1100
|
]),
|
|
1087
1101
|
_: 1
|
|
1088
1102
|
}, 8, ["modelValue", "selected-value"])
|
|
1089
1103
|
])),
|
|
1090
|
-
_.value === "protocol" ||
|
|
1091
|
-
d(
|
|
1104
|
+
_.value === "protocol" || H.value ? (S(), U("div", Rt, [
|
|
1105
|
+
d(h, {
|
|
1092
1106
|
modelValue: e.fields.protocol,
|
|
1093
1107
|
"onUpdate:modelValue": i[5] || (i[5] = (s) => e.fields.protocol = s),
|
|
1094
1108
|
"data-testid": "gateway-service-protocol-select",
|
|
1095
|
-
items:
|
|
1096
|
-
label:
|
|
1109
|
+
items: he,
|
|
1110
|
+
label: o(a)("gateway_services.form.fields.protocol.label"),
|
|
1097
1111
|
"label-attributes": {
|
|
1098
|
-
info:
|
|
1112
|
+
info: o(a)("gateway_services.form.fields.protocol.tooltip"),
|
|
1099
1113
|
tooltipAttributes: { maxWidth: "400" }
|
|
1100
1114
|
},
|
|
1101
1115
|
readonly: e.isReadonly,
|
|
@@ -1109,29 +1123,29 @@ const ye = {
|
|
|
1109
1123
|
modelModifiers: { trim: !0 },
|
|
1110
1124
|
class: "gateway-service-form-margin-top",
|
|
1111
1125
|
"data-testid": "gateway-service-host-input",
|
|
1112
|
-
label:
|
|
1126
|
+
label: o(a)("gateway_services.form.fields.host.label"),
|
|
1113
1127
|
"label-attributes": {
|
|
1114
|
-
info:
|
|
1128
|
+
info: o(a)("gateway_services.form.fields.host.tooltip"),
|
|
1115
1129
|
tooltipAttributes: { maxWidth: "400" }
|
|
1116
1130
|
},
|
|
1117
1131
|
name: "host",
|
|
1118
|
-
placeholder:
|
|
1132
|
+
placeholder: o(a)("gateway_services.form.fields.host.placeholder"),
|
|
1119
1133
|
required: ""
|
|
1120
1134
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"]),
|
|
1121
|
-
|
|
1135
|
+
Q.value ? (S(), U("div", Mt, [
|
|
1122
1136
|
d(v, {
|
|
1123
1137
|
modelValue: e.fields.path,
|
|
1124
1138
|
"onUpdate:modelValue": i[8] || (i[8] = (s) => e.fields.path = s),
|
|
1125
1139
|
modelModifiers: { trim: !0 },
|
|
1126
1140
|
class: "gateway-service-form-margin-top",
|
|
1127
1141
|
"data-testid": "gateway-service-path-input",
|
|
1128
|
-
label:
|
|
1142
|
+
label: o(a)("gateway_services.form.fields.path.label"),
|
|
1129
1143
|
"label-attributes": {
|
|
1130
|
-
info:
|
|
1144
|
+
info: o(a)("gateway_services.form.fields.path.tooltip"),
|
|
1131
1145
|
tooltipAttributes: { maxWidth: "400" }
|
|
1132
1146
|
},
|
|
1133
1147
|
name: "path",
|
|
1134
|
-
placeholder:
|
|
1148
|
+
placeholder: o(a)("gateway_services.form.fields.path.placeholder")
|
|
1135
1149
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
|
|
1136
1150
|
])) : L("", !0),
|
|
1137
1151
|
d(v, {
|
|
@@ -1139,14 +1153,14 @@ const ye = {
|
|
|
1139
1153
|
"onUpdate:modelValue": [
|
|
1140
1154
|
i[9] || (i[9] = (s) => e.fields.port = s),
|
|
1141
1155
|
i[10] || (i[10] = () => {
|
|
1142
|
-
e.fields.port =
|
|
1156
|
+
e.fields.port = W(e.fields.port + "");
|
|
1143
1157
|
})
|
|
1144
1158
|
],
|
|
1145
1159
|
class: "gateway-service-form-margin-top",
|
|
1146
1160
|
"data-testid": "gateway-service-port-input",
|
|
1147
|
-
label:
|
|
1161
|
+
label: o(a)("gateway_services.form.fields.port.label"),
|
|
1148
1162
|
"label-attributes": {
|
|
1149
|
-
info:
|
|
1163
|
+
info: o(a)("gateway_services.form.fields.port.tooltip"),
|
|
1150
1164
|
tooltipAttributes: { maxWidth: "400" }
|
|
1151
1165
|
},
|
|
1152
1166
|
name: "port",
|
|
@@ -1158,24 +1172,24 @@ const ye = {
|
|
|
1158
1172
|
"onUpdate:modelValue": i[24] || (i[24] = (s) => $.value = s),
|
|
1159
1173
|
"data-testid": "advanced-fields-collapse",
|
|
1160
1174
|
"trigger-alignment": "leading",
|
|
1161
|
-
"trigger-label":
|
|
1175
|
+
"trigger-label": o(a)("gateway_services.form.sections.keys.viewAdvancedFields")
|
|
1162
1176
|
}, {
|
|
1163
1177
|
default: f(() => [
|
|
1164
|
-
|
|
1165
|
-
|
|
1178
|
+
w("div", $t, [
|
|
1179
|
+
w("div", xt, [
|
|
1166
1180
|
d(v, {
|
|
1167
1181
|
modelValue: e.fields.retries,
|
|
1168
1182
|
"onUpdate:modelValue": [
|
|
1169
1183
|
i[11] || (i[11] = (s) => e.fields.retries = s),
|
|
1170
1184
|
i[12] || (i[12] = () => {
|
|
1171
|
-
e.fields.retries =
|
|
1185
|
+
e.fields.retries = W(e.fields.retries + "");
|
|
1172
1186
|
})
|
|
1173
1187
|
],
|
|
1174
1188
|
autocomplete: "off",
|
|
1175
1189
|
"data-testid": "gateway-service-retries-input",
|
|
1176
|
-
label:
|
|
1190
|
+
label: o(a)("gateway_services.form.fields.retries.label"),
|
|
1177
1191
|
"label-attributes": {
|
|
1178
|
-
info:
|
|
1192
|
+
info: o(a)("gateway_services.form.fields.retries.tooltip"),
|
|
1179
1193
|
tooltipAttributes: { maxWidth: "400" }
|
|
1180
1194
|
},
|
|
1181
1195
|
name: "retries",
|
|
@@ -1183,20 +1197,20 @@ const ye = {
|
|
|
1183
1197
|
type: "number"
|
|
1184
1198
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1185
1199
|
]),
|
|
1186
|
-
|
|
1200
|
+
w("div", At, [
|
|
1187
1201
|
d(v, {
|
|
1188
1202
|
modelValue: e.fields.connect_timeout,
|
|
1189
1203
|
"onUpdate:modelValue": [
|
|
1190
1204
|
i[13] || (i[13] = (s) => e.fields.connect_timeout = s),
|
|
1191
1205
|
i[14] || (i[14] = () => {
|
|
1192
|
-
e.fields.connect_timeout =
|
|
1206
|
+
e.fields.connect_timeout = W(e.fields.connect_timeout + "");
|
|
1193
1207
|
})
|
|
1194
1208
|
],
|
|
1195
1209
|
autocomplete: "off",
|
|
1196
1210
|
"data-testid": "gateway-service-connTimeout-input",
|
|
1197
|
-
label:
|
|
1211
|
+
label: o(a)("gateway_services.form.fields.connect_timeout.label"),
|
|
1198
1212
|
"label-attributes": {
|
|
1199
|
-
info:
|
|
1213
|
+
info: o(a)("gateway_services.form.fields.connect_timeout.tooltip"),
|
|
1200
1214
|
tooltipAttributes: { maxWidth: "400" }
|
|
1201
1215
|
},
|
|
1202
1216
|
name: "connTimeout",
|
|
@@ -1204,20 +1218,20 @@ const ye = {
|
|
|
1204
1218
|
type: "number"
|
|
1205
1219
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1206
1220
|
]),
|
|
1207
|
-
|
|
1221
|
+
w("div", Ft, [
|
|
1208
1222
|
d(v, {
|
|
1209
1223
|
modelValue: e.fields.write_timeout,
|
|
1210
1224
|
"onUpdate:modelValue": [
|
|
1211
1225
|
i[15] || (i[15] = (s) => e.fields.write_timeout = s),
|
|
1212
1226
|
i[16] || (i[16] = () => {
|
|
1213
|
-
e.fields.write_timeout =
|
|
1227
|
+
e.fields.write_timeout = W(e.fields.write_timeout + "");
|
|
1214
1228
|
})
|
|
1215
1229
|
],
|
|
1216
1230
|
autocomplete: "off",
|
|
1217
1231
|
"data-testid": "gateway-service-writeTimeout-input",
|
|
1218
|
-
label:
|
|
1232
|
+
label: o(a)("gateway_services.form.fields.write_timeout.label"),
|
|
1219
1233
|
"label-attributes": {
|
|
1220
|
-
info:
|
|
1234
|
+
info: o(a)("gateway_services.form.fields.write_timeout.tooltip"),
|
|
1221
1235
|
tooltipAttributes: { maxWidth: "400" }
|
|
1222
1236
|
},
|
|
1223
1237
|
name: "writeTimeout",
|
|
@@ -1225,20 +1239,20 @@ const ye = {
|
|
|
1225
1239
|
type: "number"
|
|
1226
1240
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1227
1241
|
]),
|
|
1228
|
-
|
|
1242
|
+
w("div", Bt, [
|
|
1229
1243
|
d(v, {
|
|
1230
1244
|
modelValue: e.fields.read_timeout,
|
|
1231
1245
|
"onUpdate:modelValue": [
|
|
1232
1246
|
i[17] || (i[17] = (s) => e.fields.read_timeout = s),
|
|
1233
1247
|
i[18] || (i[18] = () => {
|
|
1234
|
-
e.fields.read_timeout =
|
|
1248
|
+
e.fields.read_timeout = W(e.fields.read_timeout + "");
|
|
1235
1249
|
})
|
|
1236
1250
|
],
|
|
1237
1251
|
autocomplete: "off",
|
|
1238
1252
|
"data-testid": "gateway-service-readTimeout-input",
|
|
1239
|
-
label:
|
|
1253
|
+
label: o(a)("gateway_services.form.fields.read_timeout.label"),
|
|
1240
1254
|
"label-attributes": {
|
|
1241
|
-
info:
|
|
1255
|
+
info: o(a)("gateway_services.form.fields.read_timeout.tooltip"),
|
|
1242
1256
|
tooltipAttributes: { maxWidth: "400" }
|
|
1243
1257
|
},
|
|
1244
1258
|
name: "readTimeout",
|
|
@@ -1246,47 +1260,47 @@ const ye = {
|
|
|
1246
1260
|
type: "number"
|
|
1247
1261
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1248
1262
|
]),
|
|
1249
|
-
|
|
1263
|
+
we.value ? (S(), U("div", Lt, [
|
|
1250
1264
|
d(v, {
|
|
1251
1265
|
modelValue: e.fields.client_certificate,
|
|
1252
1266
|
"onUpdate:modelValue": i[19] || (i[19] = (s) => e.fields.client_certificate = s),
|
|
1253
1267
|
modelModifiers: { trim: !0 },
|
|
1254
1268
|
autocomplete: "off",
|
|
1255
1269
|
"data-testid": "gateway-service-clientCert-input",
|
|
1256
|
-
label:
|
|
1270
|
+
label: o(a)("gateway_services.form.fields.client_certificate.label"),
|
|
1257
1271
|
"label-attributes": {
|
|
1258
|
-
info:
|
|
1272
|
+
info: o(a)("gateway_services.form.fields.client_certificate.tooltip"),
|
|
1259
1273
|
tooltipAttributes: { maxWidth: "400" }
|
|
1260
1274
|
},
|
|
1261
1275
|
name: "clientCert",
|
|
1262
|
-
placeholder:
|
|
1276
|
+
placeholder: o(a)("gateway_services.form.fields.client_certificate.placeholder"),
|
|
1263
1277
|
readonly: e.isReadonly,
|
|
1264
1278
|
type: "text"
|
|
1265
1279
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])
|
|
1266
1280
|
])) : L("", !0),
|
|
1267
|
-
|
|
1281
|
+
ae.value ? (S(), U("div", Dt, [
|
|
1268
1282
|
d(v, {
|
|
1269
1283
|
modelValue: e.fields.ca_certificates,
|
|
1270
1284
|
"onUpdate:modelValue": i[20] || (i[20] = (s) => e.fields.ca_certificates = s),
|
|
1271
1285
|
modelModifiers: { trim: !0 },
|
|
1272
1286
|
autocomplete: "off",
|
|
1273
1287
|
"data-testid": "gateway-service-ca-certs-input",
|
|
1274
|
-
label:
|
|
1288
|
+
label: o(a)("gateway_services.form.fields.ca_certificates.label"),
|
|
1275
1289
|
"label-attributes": { tooltipAttributes: { maxWidth: "400" } },
|
|
1276
|
-
placeholder:
|
|
1290
|
+
placeholder: o(a)("gateway_services.form.fields.ca_certificates.placeholder"),
|
|
1277
1291
|
readonly: e.isReadonly,
|
|
1278
1292
|
type: "text"
|
|
1279
1293
|
}, {
|
|
1280
1294
|
"label-tooltip": f(() => [
|
|
1281
|
-
d(
|
|
1295
|
+
d(o(q), {
|
|
1282
1296
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1283
1297
|
scope: "global"
|
|
1284
1298
|
}, {
|
|
1285
1299
|
code1: f(() => [
|
|
1286
|
-
|
|
1300
|
+
w("code", null, y(o(a)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
1287
1301
|
]),
|
|
1288
1302
|
code2: f(() => [
|
|
1289
|
-
|
|
1303
|
+
w("code", null, y(o(a)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
1290
1304
|
]),
|
|
1291
1305
|
_: 1
|
|
1292
1306
|
})
|
|
@@ -1294,43 +1308,43 @@ const ye = {
|
|
|
1294
1308
|
_: 1
|
|
1295
1309
|
}, 8, ["modelValue", "label", "placeholder", "readonly"])
|
|
1296
1310
|
])) : L("", !0),
|
|
1297
|
-
|
|
1298
|
-
d(
|
|
1311
|
+
ke.value ? (S(), U("div", Gt, [
|
|
1312
|
+
d(l, {
|
|
1299
1313
|
modelValue: e.fields.tls_verify_enabled,
|
|
1300
1314
|
"onUpdate:modelValue": i[21] || (i[21] = (s) => e.fields.tls_verify_enabled = s),
|
|
1301
1315
|
"data-testid": "gateway-service-tls-verify-checkbox",
|
|
1302
|
-
description:
|
|
1303
|
-
label:
|
|
1316
|
+
description: o(a)("gateway_services.form.fields.tls_verify_enabled.help"),
|
|
1317
|
+
label: o(a)("gateway_services.form.fields.tls_verify_enabled.label"),
|
|
1304
1318
|
"label-attributes": { tooltipAttributes: { maxWidth: "400" } }
|
|
1305
1319
|
}, {
|
|
1306
1320
|
tooltip: f(() => [
|
|
1307
|
-
d(
|
|
1321
|
+
d(o(q), {
|
|
1308
1322
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
1309
1323
|
scope: "global"
|
|
1310
1324
|
}, {
|
|
1311
1325
|
code1: f(() => [
|
|
1312
|
-
|
|
1326
|
+
w("code", null, y(o(a)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
1313
1327
|
]),
|
|
1314
1328
|
_: 1
|
|
1315
1329
|
})
|
|
1316
1330
|
]),
|
|
1317
1331
|
_: 1
|
|
1318
1332
|
}, 8, ["modelValue", "description", "label"]),
|
|
1319
|
-
e.fields.tls_verify_enabled ? (
|
|
1320
|
-
d(
|
|
1333
|
+
e.fields.tls_verify_enabled ? (S(), U("div", Kt, [
|
|
1334
|
+
d(V, {
|
|
1321
1335
|
modelValue: e.fields.tls_verify_value,
|
|
1322
1336
|
"onUpdate:modelValue": i[22] || (i[22] = (s) => e.fields.tls_verify_value = s),
|
|
1323
1337
|
"data-testid": "gateway-service-tls-verify-true-option",
|
|
1324
|
-
label:
|
|
1338
|
+
label: o(a)("gateway_services.form.fields.tls_verify_option.true.label"),
|
|
1325
1339
|
"selected-value": !0
|
|
1326
1340
|
}, null, 8, ["modelValue", "label"])
|
|
1327
1341
|
])) : L("", !0),
|
|
1328
|
-
e.fields.tls_verify_enabled ? (
|
|
1329
|
-
d(
|
|
1342
|
+
e.fields.tls_verify_enabled ? (S(), U("div", qt, [
|
|
1343
|
+
d(V, {
|
|
1330
1344
|
modelValue: e.fields.tls_verify_value,
|
|
1331
1345
|
"onUpdate:modelValue": i[23] || (i[23] = (s) => e.fields.tls_verify_value = s),
|
|
1332
1346
|
"data-testid": "gateway-service-tls-verify-false-option",
|
|
1333
|
-
label:
|
|
1347
|
+
label: o(a)("gateway_services.form.fields.tls_verify_option.false.label"),
|
|
1334
1348
|
"selected-value": !1
|
|
1335
1349
|
}, null, 8, ["modelValue", "label"])
|
|
1336
1350
|
])) : L("", !0)
|
|
@@ -1348,14 +1362,14 @@ const ye = {
|
|
|
1348
1362
|
]);
|
|
1349
1363
|
};
|
|
1350
1364
|
}
|
|
1351
|
-
}), Xt = /* @__PURE__ */
|
|
1365
|
+
}), Xt = /* @__PURE__ */ Be(Ot, [["__scopeId", "data-v-35e0db56"]]), Nt = { class: "kong-ui-gateway-service-entity-config-card" }, Zt = /* @__PURE__ */ Te({
|
|
1352
1366
|
__name: "GatewayServiceConfigCard",
|
|
1353
1367
|
props: {
|
|
1354
1368
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
1355
1369
|
config: {
|
|
1356
1370
|
type: Object,
|
|
1357
1371
|
required: !0,
|
|
1358
|
-
validator: (n) => !(!n || ![
|
|
1372
|
+
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)
|
|
1359
1373
|
},
|
|
1360
1374
|
/**
|
|
1361
1375
|
* External link for documentation that determines visibility of Documentation button
|
|
@@ -1375,7 +1389,7 @@ const ye = {
|
|
|
1375
1389
|
},
|
|
1376
1390
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
1377
1391
|
setup(n) {
|
|
1378
|
-
const D = n, { i18n: { t: p }, i18nT: c } =
|
|
1392
|
+
const D = n, { i18n: { t: p }, i18nT: c } = ve.useI18n(), r = b(() => se.form[D.config.app].edit), { getPropValue: $ } = rt(), N = (a, P) => $(a, P) === !0 ? p("gateway_services.form.fields.tls_verify_option.true.display") : p("gateway_services.form.fields.tls_verify_option.false.display"), q = E({
|
|
1379
1393
|
id: {},
|
|
1380
1394
|
name: {
|
|
1381
1395
|
tooltip: p("gateway_services.form.fields.name.tooltip")
|
|
@@ -1384,19 +1398,19 @@ const ye = {
|
|
|
1384
1398
|
updated_at: {},
|
|
1385
1399
|
created_at: {},
|
|
1386
1400
|
protocol: {
|
|
1387
|
-
section:
|
|
1401
|
+
section: fe.Basic,
|
|
1388
1402
|
tooltip: p("gateway_services.form.fields.protocol.tooltip")
|
|
1389
1403
|
},
|
|
1390
1404
|
host: {
|
|
1391
|
-
section:
|
|
1405
|
+
section: fe.Basic,
|
|
1392
1406
|
tooltip: p("gateway_services.form.fields.host.tooltip")
|
|
1393
1407
|
},
|
|
1394
1408
|
path: {
|
|
1395
|
-
section:
|
|
1409
|
+
section: fe.Basic,
|
|
1396
1410
|
tooltip: p("gateway_services.form.fields.path.tooltip")
|
|
1397
1411
|
},
|
|
1398
1412
|
port: {
|
|
1399
|
-
section:
|
|
1413
|
+
section: fe.Basic,
|
|
1400
1414
|
tooltip: p("gateway_services.form.fields.port.tooltip")
|
|
1401
1415
|
},
|
|
1402
1416
|
tags: {
|
|
@@ -1424,7 +1438,7 @@ const ye = {
|
|
|
1424
1438
|
tooltip: p("gateway_services.form.fields.client_certificate.tooltip")
|
|
1425
1439
|
},
|
|
1426
1440
|
ca_certificates: {
|
|
1427
|
-
type:
|
|
1441
|
+
type: at.BadgeTag,
|
|
1428
1442
|
label: p("gateway_services.form.fields.ca_certificates.label"),
|
|
1429
1443
|
order: 6
|
|
1430
1444
|
},
|
|
@@ -1435,62 +1449,62 @@ const ye = {
|
|
|
1435
1449
|
hidden: !0
|
|
1436
1450
|
}
|
|
1437
1451
|
});
|
|
1438
|
-
return (a,
|
|
1439
|
-
d(
|
|
1452
|
+
return (a, P) => (S(), U("div", Nt, [
|
|
1453
|
+
d(o(nt), {
|
|
1440
1454
|
config: n.config,
|
|
1441
1455
|
"config-card-doc": n.configCardDoc,
|
|
1442
|
-
"config-schema":
|
|
1443
|
-
"entity-type":
|
|
1456
|
+
"config-schema": q.value,
|
|
1457
|
+
"entity-type": o(Fe).GatewayService,
|
|
1444
1458
|
"fetch-url": r.value,
|
|
1445
1459
|
"hide-title": n.hideTitle,
|
|
1446
|
-
"onFetch:error":
|
|
1447
|
-
"onFetch:success":
|
|
1448
|
-
onLoading:
|
|
1460
|
+
"onFetch:error": P[0] || (P[0] = (C) => a.$emit("fetch:error", C)),
|
|
1461
|
+
"onFetch:success": P[1] || (P[1] = (C) => a.$emit("fetch:success", C)),
|
|
1462
|
+
onLoading: P[2] || (P[2] = (C) => a.$emit("loading", C))
|
|
1449
1463
|
}, {
|
|
1450
1464
|
"enabled-label-tooltip": f(() => [
|
|
1451
|
-
d(
|
|
1465
|
+
d(o(c), {
|
|
1452
1466
|
keypath: "gateway_services.form.fields.enabled.tooltip",
|
|
1453
1467
|
scope: "global"
|
|
1454
1468
|
}, {
|
|
1455
1469
|
false: f(() => [
|
|
1456
|
-
|
|
1470
|
+
w("code", null, y(o(p)("gateway_services.form.fields.enabled.false")), 1)
|
|
1457
1471
|
]),
|
|
1458
1472
|
true: f(() => [
|
|
1459
|
-
|
|
1473
|
+
w("code", null, y(o(p)("gateway_services.form.fields.enabled.true")), 1)
|
|
1460
1474
|
]),
|
|
1461
1475
|
_: 1
|
|
1462
1476
|
})
|
|
1463
1477
|
]),
|
|
1464
1478
|
"ca_certificates-label-tooltip": f(() => [
|
|
1465
|
-
d(
|
|
1479
|
+
d(o(c), {
|
|
1466
1480
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1467
1481
|
scope: "global"
|
|
1468
1482
|
}, {
|
|
1469
1483
|
code1: f(() => [
|
|
1470
|
-
|
|
1484
|
+
w("code", null, y(o(p)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
1471
1485
|
]),
|
|
1472
1486
|
code2: f(() => [
|
|
1473
|
-
|
|
1487
|
+
w("code", null, y(o(p)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
1474
1488
|
]),
|
|
1475
1489
|
_: 1
|
|
1476
1490
|
})
|
|
1477
1491
|
]),
|
|
1478
1492
|
"tls_verify-label-tooltip": f(() => [
|
|
1479
|
-
d(
|
|
1493
|
+
d(o(c), {
|
|
1480
1494
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
1481
1495
|
scope: "global"
|
|
1482
1496
|
}, {
|
|
1483
1497
|
code1: f(() => [
|
|
1484
|
-
|
|
1498
|
+
w("code", null, y(o(p)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
1485
1499
|
]),
|
|
1486
1500
|
_: 1
|
|
1487
1501
|
})
|
|
1488
1502
|
]),
|
|
1489
|
-
tls_verify: f((
|
|
1490
|
-
M(
|
|
1503
|
+
tls_verify: f((C) => [
|
|
1504
|
+
M(y(typeof o($)("rowValue", C) == "boolean" ? N("rowValue", C) : o(p)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
|
|
1491
1505
|
]),
|
|
1492
|
-
client_certificate: f((
|
|
1493
|
-
M(
|
|
1506
|
+
client_certificate: f((C) => [
|
|
1507
|
+
M(y(o($)("rowValue", C) ? o($)("rowValue", C).id : "–"), 1)
|
|
1494
1508
|
]),
|
|
1495
1509
|
_: 1
|
|
1496
1510
|
}, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
|