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