@kong-ui-public/entities-gateway-services 3.22.3 → 3.23.1
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 +474 -473
- package/dist/entities-gateway-services.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/GatewayServiceList.vue.d.ts.map +1 -1
- package/dist/types/gateway-services-endpoints.d.ts +1 -0
- package/dist/types/gateway-services-endpoints.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { BookIcon as
|
|
1
|
+
import { defineComponent as Ie, computed as k, ref as B, watch as xe, onBeforeMount as Ze, resolveComponent as U, openBlock as y, createElementBlock as V, createVNode as i, unref as t, createSlots as Se, withCtx as n, createTextVNode as F, toDisplayString as _, createBlock as G, createCommentVNode as E, createElementVNode as P, withModifiers as Ue, Teleport as Je, Fragment as Be, renderList as Ge, reactive as Me, onMounted as Qe, Transition as Ae, renderSlot as Xe } from "vue";
|
|
2
|
+
import { useRouter as We } from "vue-router";
|
|
3
|
+
import { BookIcon as Ke, AddIcon as Ce, ServicesIcon as Ye, TrashIcon as et } from "@kong/icons";
|
|
4
4
|
import { createI18n as tt, i18nTComponent as at } from "@kong-ui-public/i18n";
|
|
5
|
-
import { useAxios as
|
|
6
|
-
const
|
|
7
|
-
actions:
|
|
8
|
-
search:
|
|
5
|
+
import { useAxios as Oe, useTableState as st, useFetcher as ot, useDeleteUrlBuilder as lt, FetcherStatus as rt, EntityBaseTable as it, PermissionsWrapper as ne, TableTags as nt, EntityFilter as ct, EntityToggleModal as dt, EntityDeleteModal as ut, EntityTypes as ft, useHelpers as je, ConfigurationSchemaType as pt, ConfigurationSchemaSection as ke, EntityBaseConfigCard as mt, SupportedEntityType as ze, useErrors as vt, useValidators as gt, EntityBaseFormType as Le, useGatewayFeatureSupported as yt, EntityBaseForm as _t, EntityFormSection as Ne } from "@kong-ui-public/entities-shared";
|
|
6
|
+
const ht = { create: "New gateway service", debugger: "Start debugging", serverless_create: "Add a service", copy_id: "Copy ID", copy_json: "Copy JSON", edit: "Edit", clear: "Clear", view: "View details", delete: { title: "Delete a gateway service", description: "Deleting this gateway service will also remove any associated plugins. This action cannot be reversed.", menu_label: "Delete" } }, bt = { placeholder: { konnect: "Filter by name", kongManager: "Filter by exact name or ID" } }, wt = { title: "Gateway services", list: { toolbar_actions: { new_gateway_service: "New gateway service" }, table_headers: { name: "Name", control_plane: "Control plane", protocol: "Protocol", host: "Host", port: "Port", path: "Path", enabled: "Enabled", tags: "Tags", id: "ID", created_at: "Created at", updated_at: "Last modified" }, empty_state: { title: "Configure a new gateway service", description: "Gateway services are used to proxy traffic.", serverless_title: "Configure your first gateway service" } }, empty_state_v2: { create: "New gateway service", create_new: "Create new", import_spec: "Import via Open API spec", title: "Configure your first gateway service", group: "Services created in gateways within this group will automatically appear here.", description: "Gateway services represent backend APIs or microservices that receive traffic routed through the gateway.", learn_more: "Learn more" }, form: { buttons: { try_sample: "Try sample API" }, errors: { host: { empty: "Host cannot be empty", invalid: "Invalid host" }, port: { type: "Port must be a number", invalid: "Port must be between 0 and 65535" }, path: { prefix: "Path must begin with /", invalid: "Path should not include characters outside of the reserved list of RFC 3986" }, protocol: { empty: "Protocol cannot be empty", invalid: "Protocol - value must be one of http, https, grpc, grpcs, tcp, udp, tls, tls_passthrough, ws, wss" }, url: { invalid: "The URL must follow a valid format. Example: https://api.kong-air.com/flights" } }, sections: { general: { title: "General information", description: "Provide a name and tags to help identify and manage this service." }, keys: { title: "Service endpoint", description: "Define where this service should send requests.", checkedGroupLabel: "Choose how and where to send traffic", urlLabel: "Full URL", checkedGroupAltLabel: "Protocol, host, port and path", url: { label: "Full URL", description: "Define the service using a single, complete API URL for simple setup." }, protocol: { label: "Protocol, host, port, and path", description: "Manually specify each component of the API’s URL for advanced configurations." }, viewAdvancedFields: "View advanced fields" } }, fields: { upstream_url: { label: "Full URL", placeholder: "e.g. https://api.kong-air.com/flights", tooltip_for_konnect: "This is the URL of the API you will manage in Konnect.", tooltip_for_km: "This is the URL of the API you will manage in Kong Gateway." }, name: { label: "Name", placeholder: "Enter a unique name", tooltip: "The gateway service name." }, protocol: { label: "Protocol", tooltip: "The protocol used to communicate with the upstream.", options: { http: "http", https: "https", tcp: "tcp", tls: "tls", tls_passthrough: "tls_passthrough", grpc: "grpc", grpcs: "grpcs", ws: "ws", wss: "wss", udp: "udp" } }, host: { label: "Host", placeholder: "e.g. api.kong-air.com", tooltip: "The host of the upstream server. Note that the host value is case sensitive." }, path: { label: "Path", placeholder: "e.g. /sample", tooltip: "The path to be used in request to the upstream server." }, port: { label: "Port", tooltip: "The upstream server port." }, retries: { label: "Retries", tooltip: "The number of retries to execute upon failure to proxy." }, connect_timeout: { label: "Connection timeout", tooltip: "The timeout in milliseconds for establishing a connection to the upstream server." }, write_timeout: { label: "Write timeout", tooltip: "The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server." }, read_timeout: { label: "Read timeout", tooltip: "The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server." }, client_certificate: { label: "Client certificate", placeholder: "Enter a certificate ID", tooltip: "Certificate to be used as client certificate while TLS handshaking to the upstream server." }, tls_sans_dnsnames: { label: "TLS SANs - DNS names", placeholder: "Enter a DNS name", tooltip: "Additional DNS names that can be matched on the upstream server's TLS certificate.", add: "Add DNS name" }, tls_sans_uris: { label: "TLS SANs - URIs", placeholder: "Enter a URI", tooltip: "Additional URIs that can be matched on the upstream server's TLS certificate.", add: "Add URI" }, ca_certificates: { label: "CA certificates", placeholder: "Enter a comma separated list of CA certificate IDs", tooltip: "Array of {code1} object UUIDs that are used to build the trust store while verifying upstream server's TLS certificate. If set to {code2} when Nginx default is respected. If default CA list in Nginx are not specified and TLS verification is enabled, then handshake with upstream server will always fail (because no CA are trusted).", code1: "CA certificate", code2: "null" }, tls_verify_enabled: { label: "TLS verify", help: "If unchecked, use default system setting", tooltip: "Whether to enable verification of upstream server TLS certificate. If set to {code1}, then the Nginx default is respected.", code1: "null" }, tls_verify_option: { unset: { display: "Use default system setting" }, true: { label: "True", display: "On" }, false: { label: "False", display: "Off" } }, tags: { label: "Tags", tooltip: "An optional set of strings associated with the service for grouping and filtering.", placeholder: "Enter a list of tags separated by comma", help: "e.g. tag1, tag2, tag3", collapse: "Add tags" }, enabled: { label: "Enabled", tooltip: "Whether the service is active. If set to {false}, the proxy behavior will be as if any routes attached to it do not exist (404). Default: {true}.", false: "false", true: "true" } } } }, kt = { general: "Gateway services could not be retrieved", delete: "The gateway service could not be deleted at this time.", copy: "Failed to copy to clipboard", urlErrorMessage: "Error: invalid URL" }, Vt = { success: "Copied {val} to clipboard", success_brief: "Successfully copied to clipboard" }, St = { gateway_services: "gateway services" }, Ct = {
|
|
7
|
+
actions: ht,
|
|
8
|
+
search: bt,
|
|
9
9
|
gateway_services: wt,
|
|
10
10
|
errors: kt,
|
|
11
11
|
copy: Vt,
|
|
@@ -21,9 +21,9 @@ function It() {
|
|
|
21
21
|
}
|
|
22
22
|
function Et() {
|
|
23
23
|
return {
|
|
24
|
-
getPortFromProtocol: (D,
|
|
25
|
-
const
|
|
26
|
-
if ((r || r === 0) && !
|
|
24
|
+
getPortFromProtocol: (D, p) => {
|
|
25
|
+
const c = [80, 443], r = Number(p);
|
|
26
|
+
if ((r || r === 0) && !c.includes(r))
|
|
27
27
|
return r;
|
|
28
28
|
switch (D) {
|
|
29
29
|
case "grpcs":
|
|
@@ -37,16 +37,16 @@ function Et() {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
const
|
|
41
|
-
function
|
|
40
|
+
const Ft = /^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*(\.)?$/, Pt = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/, $t = (o) => /^[0-9A-Fa-f:.]+$/.test(o) && o.includes(":");
|
|
41
|
+
function Tt() {
|
|
42
42
|
const { i18n: { t: o } } = te.useI18n();
|
|
43
43
|
return {
|
|
44
44
|
validateHost: (v) => {
|
|
45
45
|
if (!v || v.trim() === "") return o("gateway_services.form.errors.host.empty");
|
|
46
46
|
try {
|
|
47
|
-
if (
|
|
47
|
+
if ($t(v))
|
|
48
48
|
return new URL("/", `https://[${v}]`), "";
|
|
49
|
-
if (
|
|
49
|
+
if (Ft.test(v) || Pt.test(v))
|
|
50
50
|
return new URL("/", `https://${v}`), "";
|
|
51
51
|
} catch {
|
|
52
52
|
}
|
|
@@ -67,27 +67,28 @@ function $t() {
|
|
|
67
67
|
const te = {
|
|
68
68
|
useI18n: It,
|
|
69
69
|
usePortFromProtocol: Et,
|
|
70
|
-
useUrlValidators:
|
|
71
|
-
},
|
|
70
|
+
useUrlValidators: Tt
|
|
71
|
+
}, Ve = "/v2/control-planes/{controlPlaneId}/core-entities/{workspace}", Re = "/{workspace}", ge = {
|
|
72
72
|
list: {
|
|
73
73
|
konnect: {
|
|
74
|
-
all: `${
|
|
74
|
+
all: `${Ve}/services`,
|
|
75
|
+
search: `${Ve}/services/search`
|
|
75
76
|
},
|
|
76
77
|
kongManager: {
|
|
77
|
-
all: `${
|
|
78
|
+
all: `${Re}/services`
|
|
78
79
|
}
|
|
79
80
|
},
|
|
80
81
|
form: {
|
|
81
82
|
konnect: {
|
|
82
|
-
create: `${
|
|
83
|
-
edit: `${
|
|
83
|
+
create: `${Ve}/services`,
|
|
84
|
+
edit: `${Ve}/services/{id}`
|
|
84
85
|
},
|
|
85
86
|
kongManager: {
|
|
86
|
-
create: `${
|
|
87
|
-
edit: `${
|
|
87
|
+
create: `${Re}/services`,
|
|
88
|
+
edit: `${Re}/services/{id}`
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
|
-
},
|
|
91
|
+
}, Ut = { class: "kong-ui-entities-gateway-services-list" }, At = { class: "button-row" }, Rt = { key: 1 }, xt = /* @__PURE__ */ Ie({
|
|
91
92
|
__name: "GatewayServiceList",
|
|
92
93
|
props: {
|
|
93
94
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -148,10 +149,10 @@ const te = {
|
|
|
148
149
|
},
|
|
149
150
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success", "click:import"],
|
|
150
151
|
setup(o, { emit: D }) {
|
|
151
|
-
const
|
|
152
|
+
const p = D, c = o, { i18n: { t: r, formatUnixTimeStamp: v } } = te.useI18n(), A = We(), { axiosInstance: R } = Oe(c.config?.axiosRequestConfig), { hasRecords: l, handleStateChange: $ } = st(() => q.value), C = k(() => l.value && c.config.app === "konnect"), j = k(() => c.config.app !== "kongManager" || !!c.config.disableSorting), ae = {
|
|
152
153
|
// the Name column is non-hidable
|
|
153
154
|
name: { label: r("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
154
|
-
...
|
|
155
|
+
...c.config.showControlPlaneColumn ? { control_plane: { label: r("gateway_services.list.table_headers.control_plane") } } : {},
|
|
155
156
|
protocol: { label: r("gateway_services.list.table_headers.protocol"), searchable: !0, sortable: !0 },
|
|
156
157
|
host: { label: r("gateway_services.list.table_headers.host"), searchable: !0, sortable: !0 },
|
|
157
158
|
port: { label: r("gateway_services.list.table_headers.port"), searchable: !0, sortable: !0 },
|
|
@@ -164,185 +165,185 @@ const te = {
|
|
|
164
165
|
columnVisibility: {
|
|
165
166
|
created_at: !1
|
|
166
167
|
}
|
|
167
|
-
},
|
|
168
|
-
let
|
|
169
|
-
return
|
|
170
|
-
}),
|
|
171
|
-
const f =
|
|
168
|
+
}, z = ae, ye = (f) => {
|
|
169
|
+
let g = `${c.config.apiBaseUrl}${f}`;
|
|
170
|
+
return c.config.app === "konnect" && (g = g.replace(/{controlPlaneId}/gi, c.config?.controlPlaneId || "")), g.replace(/\/{workspace}/gi, c.config?.workspace ? `/${c.config.workspace}` : "");
|
|
171
|
+
}, se = k(() => ye(ge.list[c.config.app].all)), Ee = k(() => c.config.app === "konnect" && c.config.workspace && q.value ? ye(ge.list.konnect.search) : se.value), H = k(() => c.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${se.value}`) : new URL(se.value)), q = B(""), Z = k(() => {
|
|
172
|
+
const f = c.config.app === "konnect" || c.config.isExactMatch;
|
|
172
173
|
if (f)
|
|
173
174
|
return {
|
|
174
175
|
isExactMatch: f,
|
|
175
|
-
placeholder: r(`search.placeholder.${
|
|
176
|
+
placeholder: r(`search.placeholder.${c.config.app}`)
|
|
176
177
|
};
|
|
177
|
-
const { name:
|
|
178
|
+
const { name: g, enabled: w, protocol: S, host: s, port: a, path: u } = ae;
|
|
178
179
|
return {
|
|
179
180
|
isExactMatch: f,
|
|
180
|
-
fields: { name:
|
|
181
|
-
schema:
|
|
181
|
+
fields: { name: g, enabled: w, protocol: S, host: s, port: a, path: u },
|
|
182
|
+
schema: c.config.filterSchema
|
|
182
183
|
};
|
|
183
184
|
}), {
|
|
184
|
-
fetcher:
|
|
185
|
-
fetcherState:
|
|
186
|
-
fetcherCacheKey:
|
|
187
|
-
} = ot(k(() => ({ ...
|
|
185
|
+
fetcher: T,
|
|
186
|
+
fetcherState: ce,
|
|
187
|
+
fetcherCacheKey: J
|
|
188
|
+
} = ot(k(() => ({ ...c.config, cacheIdentifier: c.cacheIdentifier })), Ee), Fe = () => {
|
|
188
189
|
q.value = "";
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
ctaPath:
|
|
193
|
-
ctaText:
|
|
194
|
-
message: `${r("gateway_services.list.empty_state.description")}${
|
|
195
|
-
title:
|
|
196
|
-
})),
|
|
190
|
+
}, e = () => {
|
|
191
|
+
J.value++;
|
|
192
|
+
}, h = B(null), Pe = k(() => ({
|
|
193
|
+
ctaPath: c.config.createRoute,
|
|
194
|
+
ctaText: Y.value ? c.isServerless ? r("actions.serverless_create") : r("actions.create") : void 0,
|
|
195
|
+
message: `${r("gateway_services.list.empty_state.description")}${c.config.additionMessageForEmptyState ? ` ${c.config.additionMessageForEmptyState}` : ""}`,
|
|
196
|
+
title: Y.value ? c.isServerless ? r("gateway_services.list.empty_state.serverless_title") : r("gateway_services.list.empty_state.title") : r("gateway_services.title")
|
|
197
|
+
})), oe = B(!1), x = B(null), de = k(() => {
|
|
197
198
|
const f = {
|
|
198
199
|
action: "disable",
|
|
199
200
|
id: "",
|
|
200
201
|
name: ""
|
|
201
202
|
};
|
|
202
203
|
if (x.value) {
|
|
203
|
-
const { enabled:
|
|
204
|
-
f.action =
|
|
204
|
+
const { enabled: g, id: w, name: S } = x.value;
|
|
205
|
+
f.action = g ? "disable" : "enable", f.id = w, f.name = S || w;
|
|
205
206
|
}
|
|
206
207
|
return f;
|
|
207
|
-
}),
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
if (!await
|
|
208
|
+
}), Q = (f) => {
|
|
209
|
+
oe.value = !0, x.value = f;
|
|
210
|
+
}, ue = () => {
|
|
211
|
+
oe.value = !1, x.value = null;
|
|
212
|
+
}, _e = async () => {
|
|
213
|
+
if (!await c.canEdit?.(x.value) || !x.value)
|
|
213
214
|
return;
|
|
214
|
-
const
|
|
215
|
+
const g = `${H.value.href}/${x.value.id}`, w = !x.value.enabled;
|
|
215
216
|
try {
|
|
216
|
-
const
|
|
217
|
-
let
|
|
218
|
-
q.value &&
|
|
219
|
-
const { data:
|
|
220
|
-
|
|
221
|
-
} catch (
|
|
222
|
-
|
|
217
|
+
const S = c.config?.app;
|
|
218
|
+
let s;
|
|
219
|
+
q.value && S === "konnect" && (s = await R.get(g));
|
|
220
|
+
const { data: a } = S === "konnect" ? await R.put(g, { ...s?.data || x.value, enabled: w }) : await R.patch(g, { ...x.value, enabled: w });
|
|
221
|
+
p("toggle:success", a), x.value.enabled = w;
|
|
222
|
+
} catch (S) {
|
|
223
|
+
p("error", S);
|
|
223
224
|
}
|
|
224
|
-
},
|
|
225
|
-
|
|
226
|
-
},
|
|
225
|
+
}, he = (f) => {
|
|
226
|
+
c.config.getControlPlaneRoute && A.push(c.config.getControlPlaneRoute(f));
|
|
227
|
+
}, be = async (f, g) => {
|
|
227
228
|
const w = f.id;
|
|
228
|
-
if (!await
|
|
229
|
-
|
|
229
|
+
if (!await g(w)) {
|
|
230
|
+
p("copy:error", {
|
|
230
231
|
entity: f,
|
|
231
232
|
field: "id",
|
|
232
233
|
message: r("errors.copy")
|
|
233
234
|
});
|
|
234
235
|
return;
|
|
235
236
|
}
|
|
236
|
-
|
|
237
|
+
p("copy:success", {
|
|
237
238
|
entity: f,
|
|
238
239
|
field: "id",
|
|
239
240
|
message: r("copy.success", { val: w })
|
|
240
241
|
});
|
|
241
|
-
},
|
|
242
|
+
}, le = async (f, g) => {
|
|
242
243
|
const w = JSON.stringify(f);
|
|
243
|
-
if (!await
|
|
244
|
-
|
|
244
|
+
if (!await g(w)) {
|
|
245
|
+
p("copy:error", {
|
|
245
246
|
entity: f,
|
|
246
247
|
message: r("errors.copy")
|
|
247
248
|
});
|
|
248
249
|
return;
|
|
249
250
|
}
|
|
250
|
-
|
|
251
|
+
p("copy:success", {
|
|
251
252
|
entity: f,
|
|
252
253
|
message: r("copy.success_brief")
|
|
253
254
|
});
|
|
254
|
-
},
|
|
255
|
-
await
|
|
256
|
-
},
|
|
255
|
+
}, $e = async (f) => {
|
|
256
|
+
await c.canRetrieve?.(f) && A.push(c.config.getViewRoute(f.id));
|
|
257
|
+
}, X = (f) => ({
|
|
257
258
|
label: r("actions.view"),
|
|
258
|
-
to:
|
|
259
|
-
}),
|
|
259
|
+
to: c.config.getViewRoute(f)
|
|
260
|
+
}), re = (f) => ({
|
|
260
261
|
label: r("actions.edit"),
|
|
261
|
-
to:
|
|
262
|
-
}),
|
|
263
|
-
if (
|
|
262
|
+
to: c.config.getEditRoute(f)
|
|
263
|
+
}), W = (f) => {
|
|
264
|
+
if (c.config.getDebugRoute)
|
|
264
265
|
return {
|
|
265
266
|
label: r("actions.debugger"),
|
|
266
|
-
to:
|
|
267
|
+
to: c.config.getDebugRoute(f)
|
|
267
268
|
};
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
},
|
|
271
|
-
|
|
272
|
-
},
|
|
273
|
-
if (
|
|
274
|
-
|
|
269
|
+
}, M = B(void 0), fe = B(!1), pe = B(!1), ie = B(""), O = lt(c.config, se.value), Te = (f) => {
|
|
270
|
+
M.value = f, fe.value = !0, ie.value = "";
|
|
271
|
+
}, we = () => {
|
|
272
|
+
fe.value = !1, M.value = void 0;
|
|
273
|
+
}, me = async () => {
|
|
274
|
+
if (M.value?.id) {
|
|
275
|
+
pe.value = !0;
|
|
275
276
|
try {
|
|
276
|
-
await
|
|
277
|
+
await R.delete(O(M.value.id)), p("delete:success", M.value), we(), J.value++;
|
|
277
278
|
} catch (f) {
|
|
278
|
-
|
|
279
|
+
ie.value = f.response?.data?.message || f.message || r("errors.delete"), p("error", f);
|
|
279
280
|
} finally {
|
|
280
|
-
|
|
281
|
+
pe.value = !1;
|
|
281
282
|
}
|
|
282
283
|
}
|
|
283
|
-
},
|
|
284
|
-
A.push(
|
|
284
|
+
}, ve = () => {
|
|
285
|
+
A.push(c.config.createRoute);
|
|
285
286
|
};
|
|
286
|
-
|
|
287
|
+
xe(ce, (f) => {
|
|
287
288
|
if (f.status === rt.Error) {
|
|
288
|
-
|
|
289
|
+
h.value = {
|
|
289
290
|
title: r("errors.general")
|
|
290
|
-
}, f.error?.response?.data?.message && (
|
|
291
|
+
}, f.error?.response?.data?.message && (h.value.message = f.error.response.data.message), p("error", f.error);
|
|
291
292
|
return;
|
|
292
293
|
}
|
|
293
|
-
|
|
294
|
+
h.value = null;
|
|
294
295
|
});
|
|
295
|
-
const
|
|
296
|
+
const Y = B(!1);
|
|
296
297
|
return Ze(async () => {
|
|
297
|
-
|
|
298
|
-
}), (f,
|
|
299
|
-
const w =
|
|
300
|
-
return y(), V("div",
|
|
298
|
+
Y.value = await c.canCreate();
|
|
299
|
+
}), (f, g) => {
|
|
300
|
+
const w = U("KButton"), S = U("KDropdownItem"), s = U("KDropdown"), a = U("KEmptyState"), u = U("KBadge"), I = U("KInputSwitch"), b = U("KClipboardProvider");
|
|
301
|
+
return y(), V("div", Ut, [
|
|
301
302
|
i(t(it), {
|
|
302
303
|
"cache-identifier": o.cacheIdentifier,
|
|
303
304
|
"default-table-preferences": K,
|
|
304
|
-
"disable-sorting":
|
|
305
|
-
"empty-state-options":
|
|
305
|
+
"disable-sorting": j.value,
|
|
306
|
+
"empty-state-options": Pe.value,
|
|
306
307
|
"enable-entity-actions": "",
|
|
307
|
-
"error-message":
|
|
308
|
-
fetcher: t(
|
|
309
|
-
"fetcher-cache-key": t(
|
|
308
|
+
"error-message": h.value,
|
|
309
|
+
fetcher: t(T),
|
|
310
|
+
"fetcher-cache-key": t(J),
|
|
310
311
|
"pagination-type": "offset",
|
|
311
312
|
"preferences-storage-key": "kong-ui-entities-gateway-services-list",
|
|
312
313
|
query: q.value,
|
|
313
|
-
"table-headers": t(
|
|
314
|
-
onClearSearchInput:
|
|
315
|
-
"onClick:row":
|
|
316
|
-
onSort:
|
|
317
|
-
onState: t(
|
|
318
|
-
},
|
|
314
|
+
"table-headers": t(z),
|
|
315
|
+
onClearSearchInput: Fe,
|
|
316
|
+
"onClick:row": g[5] || (g[5] = (m) => $e(m)),
|
|
317
|
+
onSort: e,
|
|
318
|
+
onState: t($)
|
|
319
|
+
}, Se({
|
|
319
320
|
"toolbar-filter": n(() => [
|
|
320
|
-
i(t(
|
|
321
|
+
i(t(ct), {
|
|
321
322
|
modelValue: q.value,
|
|
322
|
-
"onUpdate:modelValue":
|
|
323
|
-
config:
|
|
323
|
+
"onUpdate:modelValue": g[0] || (g[0] = (m) => q.value = m),
|
|
324
|
+
config: Z.value
|
|
324
325
|
}, null, 8, ["modelValue", "config"])
|
|
325
326
|
]),
|
|
326
327
|
"toolbar-button": n(() => [
|
|
327
|
-
(y(),
|
|
328
|
+
(y(), G(Je, {
|
|
328
329
|
disabled: !o.useActionOutside,
|
|
329
330
|
to: "#kong-ui-app-page-header-action-button"
|
|
330
331
|
}, [
|
|
331
|
-
|
|
332
|
-
|
|
332
|
+
P("div", At, [
|
|
333
|
+
C.value ? (y(), G(w, {
|
|
333
334
|
key: 0,
|
|
334
335
|
appearance: "secondary",
|
|
335
336
|
class: "open-learning-hub",
|
|
336
337
|
"data-testid": "gateway-services-learn-more-button",
|
|
337
338
|
icon: "",
|
|
338
|
-
onClick:
|
|
339
|
+
onClick: g[1] || (g[1] = (m) => f.$emit("click:learn-more"))
|
|
339
340
|
}, {
|
|
340
341
|
default: n(() => [
|
|
341
|
-
i(t(
|
|
342
|
+
i(t(Ke), { decorative: "" })
|
|
342
343
|
]),
|
|
343
344
|
_: 1
|
|
344
345
|
})) : E("", !0),
|
|
345
|
-
i(t(
|
|
346
|
+
i(t(ne), { "auth-function": o.canCreate }, {
|
|
346
347
|
default: n(() => [
|
|
347
348
|
i(w, {
|
|
348
349
|
appearance: "primary",
|
|
@@ -351,8 +352,8 @@ const te = {
|
|
|
351
352
|
to: o.config.createRoute
|
|
352
353
|
}, {
|
|
353
354
|
default: n(() => [
|
|
354
|
-
i(t(
|
|
355
|
-
|
|
355
|
+
i(t(Ce)),
|
|
356
|
+
F(" " + _(t(r)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
|
|
356
357
|
]),
|
|
357
358
|
_: 1
|
|
358
359
|
}, 8, ["size", "to"])
|
|
@@ -362,129 +363,129 @@ const te = {
|
|
|
362
363
|
])
|
|
363
364
|
], 8, ["disabled"]))
|
|
364
365
|
]),
|
|
365
|
-
name: n(({ rowValue:
|
|
366
|
-
|
|
366
|
+
name: n(({ rowValue: m }) => [
|
|
367
|
+
P("b", null, _(m ?? "-"), 1)
|
|
367
368
|
]),
|
|
368
|
-
control_plane: n(({ row:
|
|
369
|
-
|
|
369
|
+
control_plane: n(({ row: m }) => [
|
|
370
|
+
m.x_meta?.cluster_id ? (y(), G(u, {
|
|
370
371
|
key: 0,
|
|
371
|
-
tooltip:
|
|
372
|
+
tooltip: m.x_meta.cluster_id,
|
|
372
373
|
"truncation-tooltip": "",
|
|
373
|
-
onClick:
|
|
374
|
+
onClick: Ue((L) => he(m.x_meta.cluster_id), ["stop"])
|
|
374
375
|
}, {
|
|
375
376
|
default: n(() => [
|
|
376
|
-
|
|
377
|
+
F(_(m.x_meta.cluster_id), 1)
|
|
377
378
|
]),
|
|
378
379
|
_: 2
|
|
379
380
|
}, 1032, ["tooltip", "onClick"])) : (y(), V("b", Rt, "-"))
|
|
380
381
|
]),
|
|
381
|
-
enabled: n(({ row:
|
|
382
|
-
i(t(
|
|
383
|
-
"auth-function": () => o.canEdit(
|
|
382
|
+
enabled: n(({ row: m }) => [
|
|
383
|
+
i(t(ne), {
|
|
384
|
+
"auth-function": () => o.canEdit(m),
|
|
384
385
|
"force-show": ""
|
|
385
386
|
}, {
|
|
386
|
-
default: n(({ isAllowed:
|
|
387
|
-
|
|
388
|
-
onClick:
|
|
387
|
+
default: n(({ isAllowed: L }) => [
|
|
388
|
+
P("div", {
|
|
389
|
+
onClick: g[4] || (g[4] = Ue(() => {
|
|
389
390
|
}, ["stop"]))
|
|
390
391
|
}, [
|
|
391
|
-
i(
|
|
392
|
-
modelValue:
|
|
393
|
-
"onUpdate:modelValue": (
|
|
394
|
-
"data-testid": `row-${
|
|
395
|
-
disabled: !
|
|
396
|
-
onClick:
|
|
392
|
+
i(I, {
|
|
393
|
+
modelValue: m.enabled,
|
|
394
|
+
"onUpdate:modelValue": (ee) => m.enabled = ee,
|
|
395
|
+
"data-testid": `row-${m.id}-toggle-input`,
|
|
396
|
+
disabled: !L,
|
|
397
|
+
onClick: Ue((ee) => Q(m), ["prevent"])
|
|
397
398
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "disabled", "onClick"])
|
|
398
399
|
])
|
|
399
400
|
]),
|
|
400
401
|
_: 2
|
|
401
402
|
}, 1032, ["auth-function"])
|
|
402
403
|
]),
|
|
403
|
-
tags: n(({ rowValue:
|
|
404
|
-
i(t(nt), { tags:
|
|
404
|
+
tags: n(({ rowValue: m }) => [
|
|
405
|
+
i(t(nt), { tags: m }, null, 8, ["tags"])
|
|
405
406
|
]),
|
|
406
|
-
created_at: n(({ rowValue:
|
|
407
|
-
|
|
407
|
+
created_at: n(({ rowValue: m }) => [
|
|
408
|
+
F(_(t(v)(m)), 1)
|
|
408
409
|
]),
|
|
409
|
-
updated_at: n(({ row:
|
|
410
|
-
|
|
410
|
+
updated_at: n(({ row: m, rowValue: L }) => [
|
|
411
|
+
F(_(t(v)(L ?? m.created_at)), 1)
|
|
411
412
|
]),
|
|
412
|
-
actions: n(({ row:
|
|
413
|
-
i(
|
|
414
|
-
default: n(({ copyToClipboard:
|
|
415
|
-
i(
|
|
413
|
+
actions: n(({ row: m }) => [
|
|
414
|
+
i(b, null, {
|
|
415
|
+
default: n(({ copyToClipboard: L }) => [
|
|
416
|
+
i(S, {
|
|
416
417
|
"data-testid": "action-entity-copy-id",
|
|
417
|
-
onClick: (
|
|
418
|
+
onClick: (ee) => be(m, L)
|
|
418
419
|
}, {
|
|
419
420
|
default: n(() => [
|
|
420
|
-
|
|
421
|
+
F(_(t(r)("actions.copy_id")), 1)
|
|
421
422
|
]),
|
|
422
423
|
_: 1
|
|
423
424
|
}, 8, ["onClick"])
|
|
424
425
|
]),
|
|
425
426
|
_: 2
|
|
426
427
|
}, 1024),
|
|
427
|
-
i(
|
|
428
|
-
default: n(({ copyToClipboard:
|
|
429
|
-
i(
|
|
428
|
+
i(b, null, {
|
|
429
|
+
default: n(({ copyToClipboard: L }) => [
|
|
430
|
+
i(S, {
|
|
430
431
|
"data-testid": "action-entity-copy-json",
|
|
431
|
-
onClick: (
|
|
432
|
+
onClick: (ee) => le(m, L)
|
|
432
433
|
}, {
|
|
433
434
|
default: n(() => [
|
|
434
|
-
|
|
435
|
+
F(_(t(r)("actions.copy_json")), 1)
|
|
435
436
|
]),
|
|
436
437
|
_: 1
|
|
437
438
|
}, 8, ["onClick"])
|
|
438
439
|
]),
|
|
439
440
|
_: 2
|
|
440
441
|
}, 1024),
|
|
441
|
-
i(t(
|
|
442
|
-
"auth-function": () => o.canRetrieve(
|
|
442
|
+
i(t(ne), {
|
|
443
|
+
"auth-function": () => o.canRetrieve(m)
|
|
443
444
|
}, {
|
|
444
445
|
default: n(() => [
|
|
445
|
-
i(
|
|
446
|
+
i(S, {
|
|
446
447
|
"data-testid": "action-entity-view",
|
|
447
448
|
"has-divider": "",
|
|
448
|
-
item:
|
|
449
|
+
item: X(m.id)
|
|
449
450
|
}, null, 8, ["item"])
|
|
450
451
|
]),
|
|
451
452
|
_: 2
|
|
452
453
|
}, 1032, ["auth-function"]),
|
|
453
|
-
i(t(
|
|
454
|
-
"auth-function": () => o.canDebug(
|
|
454
|
+
i(t(ne), {
|
|
455
|
+
"auth-function": () => o.canDebug(m)
|
|
455
456
|
}, {
|
|
456
457
|
default: n(() => [
|
|
457
|
-
o.config.getDebugRoute ? (y(),
|
|
458
|
+
o.config.getDebugRoute ? (y(), G(S, {
|
|
458
459
|
key: 0,
|
|
459
460
|
"data-testid": "action-entity-debug",
|
|
460
|
-
item:
|
|
461
|
+
item: W(m.id)
|
|
461
462
|
}, null, 8, ["item"])) : E("", !0)
|
|
462
463
|
]),
|
|
463
464
|
_: 2
|
|
464
465
|
}, 1032, ["auth-function"]),
|
|
465
|
-
i(t(
|
|
466
|
-
"auth-function": () => o.canEdit(
|
|
466
|
+
i(t(ne), {
|
|
467
|
+
"auth-function": () => o.canEdit(m)
|
|
467
468
|
}, {
|
|
468
469
|
default: n(() => [
|
|
469
|
-
i(
|
|
470
|
+
i(S, {
|
|
470
471
|
"data-testid": "action-entity-edit",
|
|
471
|
-
item:
|
|
472
|
+
item: re(m.id)
|
|
472
473
|
}, null, 8, ["item"])
|
|
473
474
|
]),
|
|
474
475
|
_: 2
|
|
475
476
|
}, 1032, ["auth-function"]),
|
|
476
|
-
i(t(
|
|
477
|
-
"auth-function": () => o.canDelete(
|
|
477
|
+
i(t(ne), {
|
|
478
|
+
"auth-function": () => o.canDelete(m)
|
|
478
479
|
}, {
|
|
479
480
|
default: n(() => [
|
|
480
|
-
i(
|
|
481
|
+
i(S, {
|
|
481
482
|
danger: "",
|
|
482
483
|
"data-testid": "action-entity-delete",
|
|
483
484
|
"has-divider": "",
|
|
484
|
-
onClick: (
|
|
485
|
+
onClick: (L) => Te(m)
|
|
485
486
|
}, {
|
|
486
487
|
default: n(() => [
|
|
487
|
-
|
|
488
|
+
F(_(t(r)("actions.delete.menu_label")), 1)
|
|
488
489
|
]),
|
|
489
490
|
_: 1
|
|
490
491
|
}, 8, ["onClick"])
|
|
@@ -497,18 +498,18 @@ const te = {
|
|
|
497
498
|
!q.value && o.config.app === "konnect" ? {
|
|
498
499
|
name: "empty-state",
|
|
499
500
|
fn: n(() => [
|
|
500
|
-
i(
|
|
501
|
+
i(a, {
|
|
501
502
|
"data-testid": "gateway-services-entity-empty-state",
|
|
502
503
|
"icon-background": "",
|
|
503
504
|
message: t(r)("gateway_services.empty_state_v2.description"),
|
|
504
505
|
title: t(r)("gateway_services.empty_state_v2.title")
|
|
505
|
-
},
|
|
506
|
+
}, Se({
|
|
506
507
|
icon: n(() => [
|
|
507
508
|
i(t(Ye), { decorative: "" })
|
|
508
509
|
]),
|
|
509
510
|
action: n(() => [
|
|
510
|
-
|
|
511
|
-
o.canImportSpecs ? (y(),
|
|
511
|
+
Y.value ? (y(), V(Be, { key: 0 }, [
|
|
512
|
+
o.canImportSpecs ? (y(), G(s, {
|
|
512
513
|
key: 0,
|
|
513
514
|
"data-testid": "entity-create-dropdown",
|
|
514
515
|
"show-caret": "",
|
|
@@ -516,34 +517,34 @@ const te = {
|
|
|
516
517
|
width: "220"
|
|
517
518
|
}, {
|
|
518
519
|
items: n(() => [
|
|
519
|
-
i(
|
|
520
|
+
i(S, {
|
|
520
521
|
"data-testid": "entity-create-dropdown-item",
|
|
521
|
-
onClick:
|
|
522
|
+
onClick: ve
|
|
522
523
|
}, {
|
|
523
524
|
default: n(() => [
|
|
524
|
-
|
|
525
|
+
F(_(t(r)("gateway_services.empty_state_v2.create_new")), 1)
|
|
525
526
|
]),
|
|
526
527
|
_: 1
|
|
527
528
|
}),
|
|
528
|
-
i(
|
|
529
|
+
i(S, {
|
|
529
530
|
"data-testid": "entity-import-dropdown-item",
|
|
530
|
-
onClick:
|
|
531
|
+
onClick: g[2] || (g[2] = (m) => f.$emit("click:import"))
|
|
531
532
|
}, {
|
|
532
533
|
default: n(() => [
|
|
533
|
-
|
|
534
|
+
F(_(t(r)("gateway_services.empty_state_v2.import_spec")), 1)
|
|
534
535
|
]),
|
|
535
536
|
_: 1
|
|
536
537
|
})
|
|
537
538
|
]),
|
|
538
539
|
_: 1
|
|
539
|
-
}, 8, ["trigger-text"])) : (y(),
|
|
540
|
+
}, 8, ["trigger-text"])) : (y(), G(w, {
|
|
540
541
|
key: 1,
|
|
541
542
|
"data-testid": "entity-create-button",
|
|
542
|
-
onClick:
|
|
543
|
+
onClick: ve
|
|
543
544
|
}, {
|
|
544
545
|
default: n(() => [
|
|
545
|
-
i(t(
|
|
546
|
-
|
|
546
|
+
i(t(Ce), { decorative: "" }),
|
|
547
|
+
F(" " + _(t(r)("gateway_services.empty_state_v2.create")), 1)
|
|
547
548
|
]),
|
|
548
549
|
_: 1
|
|
549
550
|
}))
|
|
@@ -551,11 +552,11 @@ const te = {
|
|
|
551
552
|
i(w, {
|
|
552
553
|
appearance: "secondary",
|
|
553
554
|
"data-testid": "entity-learn-more-button",
|
|
554
|
-
onClick:
|
|
555
|
+
onClick: g[3] || (g[3] = (m) => f.$emit("click:learn-more"))
|
|
555
556
|
}, {
|
|
556
557
|
default: n(() => [
|
|
557
|
-
i(t(
|
|
558
|
-
|
|
558
|
+
i(t(Ke), { decorative: "" }),
|
|
559
|
+
F(" " + _(t(r)("gateway_services.empty_state_v2.learn_more")), 1)
|
|
559
560
|
]),
|
|
560
561
|
_: 1
|
|
561
562
|
})
|
|
@@ -565,7 +566,7 @@ const te = {
|
|
|
565
566
|
o.config?.isControlPlaneGroup ? {
|
|
566
567
|
name: "default",
|
|
567
568
|
fn: n(() => [
|
|
568
|
-
|
|
569
|
+
F(_(t(r)("gateway_services.empty_state_v2.group")), 1)
|
|
569
570
|
]),
|
|
570
571
|
key: "0"
|
|
571
572
|
} : void 0
|
|
@@ -574,36 +575,36 @@ const te = {
|
|
|
574
575
|
key: "0"
|
|
575
576
|
} : void 0
|
|
576
577
|
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
|
|
577
|
-
i(t(
|
|
578
|
-
action:
|
|
579
|
-
"entity-id":
|
|
580
|
-
"entity-name":
|
|
578
|
+
i(t(dt), {
|
|
579
|
+
action: de.value.action,
|
|
580
|
+
"entity-id": de.value.id,
|
|
581
|
+
"entity-name": de.value.name,
|
|
581
582
|
"entity-type": t(r)("glossary.gateway_services"),
|
|
582
|
-
"on-confirm":
|
|
583
|
-
visible:
|
|
584
|
-
onCancel:
|
|
585
|
-
onProceed:
|
|
583
|
+
"on-confirm": _e,
|
|
584
|
+
visible: oe.value,
|
|
585
|
+
onCancel: ue,
|
|
586
|
+
onProceed: ue
|
|
586
587
|
}, null, 8, ["action", "entity-id", "entity-name", "entity-type", "visible"]),
|
|
587
588
|
i(t(ut), {
|
|
588
|
-
"action-pending":
|
|
589
|
+
"action-pending": pe.value,
|
|
589
590
|
description: t(r)("actions.delete.description"),
|
|
590
|
-
"entity-name":
|
|
591
|
+
"entity-name": M.value && (M.value.name || M.value.id),
|
|
591
592
|
"entity-type": t(ft).GatewayService,
|
|
592
|
-
error:
|
|
593
|
+
error: ie.value,
|
|
593
594
|
title: t(r)("actions.delete.title"),
|
|
594
|
-
visible:
|
|
595
|
-
onCancel:
|
|
596
|
-
onProceed:
|
|
595
|
+
visible: fe.value,
|
|
596
|
+
onCancel: we,
|
|
597
|
+
onProceed: me
|
|
597
598
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
598
599
|
]);
|
|
599
600
|
};
|
|
600
601
|
}
|
|
601
|
-
}),
|
|
602
|
-
const
|
|
603
|
-
for (const [
|
|
604
|
-
|
|
605
|
-
return
|
|
606
|
-
}, ga = /* @__PURE__ */
|
|
602
|
+
}), De = (o, D) => {
|
|
603
|
+
const p = o.__vccOpts || o;
|
|
604
|
+
for (const [c, r] of D)
|
|
605
|
+
p[c] = r;
|
|
606
|
+
return p;
|
|
607
|
+
}, ga = /* @__PURE__ */ De(xt, [["__scopeId", "data-v-ba8ffcb8"]]), Bt = { class: "kong-ui-gateway-service-entity-config-card" }, ya = /* @__PURE__ */ Ie({
|
|
607
608
|
__name: "GatewayServiceConfigCard",
|
|
608
609
|
props: {
|
|
609
610
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -630,128 +631,128 @@ const te = {
|
|
|
630
631
|
},
|
|
631
632
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
632
633
|
setup(o) {
|
|
633
|
-
const D = o, { i18n: { t:
|
|
634
|
+
const D = o, { i18n: { t: p }, i18nT: c } = te.useI18n(), r = k(() => ge.form[D.config.app].edit), { getPropValue: v } = je(), A = (l, $) => v(l, $) === !0 ? p("gateway_services.form.fields.tls_verify_option.true.display") : p("gateway_services.form.fields.tls_verify_option.false.display"), R = B({
|
|
634
635
|
id: {},
|
|
635
636
|
name: {
|
|
636
|
-
tooltip:
|
|
637
|
+
tooltip: p("gateway_services.form.fields.name.tooltip")
|
|
637
638
|
},
|
|
638
639
|
enabled: {},
|
|
639
640
|
updated_at: {},
|
|
640
641
|
created_at: {},
|
|
641
642
|
protocol: {
|
|
642
|
-
section:
|
|
643
|
-
tooltip:
|
|
643
|
+
section: ke.Basic,
|
|
644
|
+
tooltip: p("gateway_services.form.fields.protocol.tooltip")
|
|
644
645
|
},
|
|
645
646
|
host: {
|
|
646
|
-
section:
|
|
647
|
-
tooltip:
|
|
647
|
+
section: ke.Basic,
|
|
648
|
+
tooltip: p("gateway_services.form.fields.host.tooltip")
|
|
648
649
|
},
|
|
649
650
|
path: {
|
|
650
|
-
section:
|
|
651
|
-
tooltip:
|
|
651
|
+
section: ke.Basic,
|
|
652
|
+
tooltip: p("gateway_services.form.fields.path.tooltip")
|
|
652
653
|
},
|
|
653
654
|
port: {
|
|
654
|
-
section:
|
|
655
|
-
tooltip:
|
|
655
|
+
section: ke.Basic,
|
|
656
|
+
tooltip: p("gateway_services.form.fields.port.tooltip")
|
|
656
657
|
},
|
|
657
658
|
tags: {
|
|
658
|
-
tooltip:
|
|
659
|
+
tooltip: p("gateway_services.form.fields.tags.tooltip")
|
|
659
660
|
},
|
|
660
661
|
// advanced fields
|
|
661
662
|
retries: {
|
|
662
663
|
order: 1,
|
|
663
|
-
tooltip:
|
|
664
|
+
tooltip: p("gateway_services.form.fields.retries.tooltip")
|
|
664
665
|
},
|
|
665
666
|
connect_timeout: {
|
|
666
667
|
order: 2,
|
|
667
|
-
tooltip:
|
|
668
|
+
tooltip: p("gateway_services.form.fields.connect_timeout.tooltip")
|
|
668
669
|
},
|
|
669
670
|
write_timeout: {
|
|
670
671
|
order: 3,
|
|
671
|
-
tooltip:
|
|
672
|
+
tooltip: p("gateway_services.form.fields.write_timeout.tooltip")
|
|
672
673
|
},
|
|
673
674
|
read_timeout: {
|
|
674
675
|
order: 4,
|
|
675
|
-
tooltip:
|
|
676
|
+
tooltip: p("gateway_services.form.fields.read_timeout.tooltip")
|
|
676
677
|
},
|
|
677
678
|
client_certificate: {
|
|
678
679
|
order: 5,
|
|
679
|
-
tooltip:
|
|
680
|
+
tooltip: p("gateway_services.form.fields.client_certificate.tooltip")
|
|
680
681
|
},
|
|
681
682
|
ca_certificates: {
|
|
682
683
|
type: pt.BadgeTag,
|
|
683
|
-
label:
|
|
684
|
+
label: p("gateway_services.form.fields.ca_certificates.label"),
|
|
684
685
|
order: 6
|
|
685
686
|
},
|
|
686
687
|
tls_verify: {
|
|
687
|
-
label:
|
|
688
|
+
label: p("gateway_services.form.fields.tls_verify_enabled.label")
|
|
688
689
|
},
|
|
689
690
|
tls_verify_depth: {
|
|
690
691
|
hidden: !0
|
|
691
692
|
}
|
|
692
693
|
});
|
|
693
|
-
return (l,
|
|
694
|
+
return (l, $) => (y(), V("div", Bt, [
|
|
694
695
|
i(t(mt), {
|
|
695
696
|
config: o.config,
|
|
696
697
|
"config-card-doc": o.configCardDoc,
|
|
697
|
-
"config-schema":
|
|
698
|
-
"entity-type": t(
|
|
698
|
+
"config-schema": R.value,
|
|
699
|
+
"entity-type": t(ze).GatewayService,
|
|
699
700
|
"fetch-url": r.value,
|
|
700
701
|
"hide-title": o.hideTitle,
|
|
701
|
-
"onFetch:error":
|
|
702
|
-
"onFetch:success":
|
|
703
|
-
onLoading:
|
|
702
|
+
"onFetch:error": $[0] || ($[0] = (C) => l.$emit("fetch:error", C)),
|
|
703
|
+
"onFetch:success": $[1] || ($[1] = (C) => l.$emit("fetch:success", C)),
|
|
704
|
+
onLoading: $[2] || ($[2] = (C) => l.$emit("loading", C))
|
|
704
705
|
}, {
|
|
705
706
|
"enabled-label-tooltip": n(() => [
|
|
706
|
-
i(t(
|
|
707
|
+
i(t(c), {
|
|
707
708
|
keypath: "gateway_services.form.fields.enabled.tooltip",
|
|
708
709
|
scope: "global"
|
|
709
710
|
}, {
|
|
710
711
|
false: n(() => [
|
|
711
|
-
|
|
712
|
+
P("code", null, _(t(p)("gateway_services.form.fields.enabled.false")), 1)
|
|
712
713
|
]),
|
|
713
714
|
true: n(() => [
|
|
714
|
-
|
|
715
|
+
P("code", null, _(t(p)("gateway_services.form.fields.enabled.true")), 1)
|
|
715
716
|
]),
|
|
716
717
|
_: 1
|
|
717
718
|
})
|
|
718
719
|
]),
|
|
719
720
|
"ca_certificates-label-tooltip": n(() => [
|
|
720
|
-
i(t(
|
|
721
|
+
i(t(c), {
|
|
721
722
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
722
723
|
scope: "global"
|
|
723
724
|
}, {
|
|
724
725
|
code1: n(() => [
|
|
725
|
-
|
|
726
|
+
P("code", null, _(t(p)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
726
727
|
]),
|
|
727
728
|
code2: n(() => [
|
|
728
|
-
|
|
729
|
+
P("code", null, _(t(p)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
729
730
|
]),
|
|
730
731
|
_: 1
|
|
731
732
|
})
|
|
732
733
|
]),
|
|
733
734
|
"tls_verify-label-tooltip": n(() => [
|
|
734
|
-
i(t(
|
|
735
|
+
i(t(c), {
|
|
735
736
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
736
737
|
scope: "global"
|
|
737
738
|
}, {
|
|
738
739
|
code1: n(() => [
|
|
739
|
-
|
|
740
|
+
P("code", null, _(t(p)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
740
741
|
]),
|
|
741
742
|
_: 1
|
|
742
743
|
})
|
|
743
744
|
]),
|
|
744
|
-
tls_verify: n((
|
|
745
|
-
|
|
745
|
+
tls_verify: n((C) => [
|
|
746
|
+
F(_(typeof t(v)("rowValue", C) == "boolean" ? A("rowValue", C) : t(p)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
|
|
746
747
|
]),
|
|
747
|
-
client_certificate: n((
|
|
748
|
-
|
|
748
|
+
client_certificate: n((C) => [
|
|
749
|
+
F(_(t(v)("rowValue", C) ? t(v)("rowValue", C).id : "–"), 1)
|
|
749
750
|
]),
|
|
750
751
|
_: 1
|
|
751
752
|
}, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
|
|
752
753
|
]));
|
|
753
754
|
}
|
|
754
|
-
}),
|
|
755
|
+
}), N = {
|
|
755
756
|
name: "Kong-Air-Flights-API",
|
|
756
757
|
protocol: "https",
|
|
757
758
|
path: "/flights",
|
|
@@ -760,7 +761,7 @@ const te = {
|
|
|
760
761
|
}, Dt = "#d60027", Mt = { class: "tls-sans-field-container" }, Kt = {
|
|
761
762
|
key: 0,
|
|
762
763
|
class: "tls-sans-field-controls"
|
|
763
|
-
}, Lt = { key: 0 }, Nt = /* @__PURE__ */
|
|
764
|
+
}, Lt = { key: 0 }, Nt = /* @__PURE__ */ Ie({
|
|
764
765
|
__name: "GatewayServiceFormTlsSansField",
|
|
765
766
|
props: {
|
|
766
767
|
modelValue: {},
|
|
@@ -774,29 +775,29 @@ const te = {
|
|
|
774
775
|
},
|
|
775
776
|
emits: ["update:modelValue", "input"],
|
|
776
777
|
setup(o, { emit: D }) {
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
}, v = (
|
|
780
|
-
const l = [...
|
|
781
|
-
l.splice(
|
|
782
|
-
}, A = (
|
|
783
|
-
const
|
|
784
|
-
|
|
778
|
+
const p = o, c = D, r = () => {
|
|
779
|
+
c("update:modelValue", [...p.modelValue, ""]);
|
|
780
|
+
}, v = (R) => {
|
|
781
|
+
const l = [...p.modelValue];
|
|
782
|
+
l.splice(R, 1), c("update:modelValue", l);
|
|
783
|
+
}, A = (R, l) => {
|
|
784
|
+
const $ = [...p.modelValue];
|
|
785
|
+
$[R] = l, c("update:modelValue", $), c("input");
|
|
785
786
|
};
|
|
786
|
-
return (
|
|
787
|
-
const
|
|
787
|
+
return (R, l) => {
|
|
788
|
+
const $ = U("KLabel"), C = U("KInput"), j = U("KButton");
|
|
788
789
|
return y(), V("div", Mt, [
|
|
789
|
-
i(
|
|
790
|
+
i($, { info: o.tooltip }, {
|
|
790
791
|
default: n(() => [
|
|
791
|
-
|
|
792
|
+
F(_(o.label), 1)
|
|
792
793
|
]),
|
|
793
794
|
_: 1
|
|
794
795
|
}, 8, ["info"]),
|
|
795
|
-
(y(!0), V(
|
|
796
|
+
(y(!0), V(Be, null, Ge(o.modelValue, (ae, K) => (y(), V("div", {
|
|
796
797
|
key: K,
|
|
797
798
|
class: "tls-sans-field-input"
|
|
798
799
|
}, [
|
|
799
|
-
i(
|
|
800
|
+
i(C, {
|
|
800
801
|
autocomplete: "off",
|
|
801
802
|
"data-testid": `${o.testIdPrefix}-input-${K}`,
|
|
802
803
|
error: o.error,
|
|
@@ -804,14 +805,14 @@ const te = {
|
|
|
804
805
|
placeholder: o.placeholder,
|
|
805
806
|
readonly: o.readonly,
|
|
806
807
|
type: "text",
|
|
807
|
-
"onUpdate:modelValue": (
|
|
808
|
+
"onUpdate:modelValue": (z) => A(K, z.trim())
|
|
808
809
|
}, null, 8, ["data-testid", "error", "model-value", "placeholder", "readonly", "onUpdate:modelValue"]),
|
|
809
810
|
o.readonly ? E("", !0) : (y(), V("div", Kt, [
|
|
810
|
-
i(
|
|
811
|
+
i(j, {
|
|
811
812
|
appearance: "tertiary",
|
|
812
813
|
"data-testid": `remove-${o.testIdPrefix}`,
|
|
813
814
|
icon: "",
|
|
814
|
-
onClick: (
|
|
815
|
+
onClick: (z) => v(K)
|
|
815
816
|
}, {
|
|
816
817
|
default: n(() => [
|
|
817
818
|
i(t(et), {
|
|
@@ -820,7 +821,7 @@ const te = {
|
|
|
820
821
|
]),
|
|
821
822
|
_: 1
|
|
822
823
|
}, 8, ["data-testid", "onClick"]),
|
|
823
|
-
i(
|
|
824
|
+
i(j, {
|
|
824
825
|
appearance: "tertiary",
|
|
825
826
|
"data-testid": `add-${o.testIdPrefix}`,
|
|
826
827
|
disabled: K !== o.modelValue.length - 1,
|
|
@@ -828,20 +829,20 @@ const te = {
|
|
|
828
829
|
onClick: r
|
|
829
830
|
}, {
|
|
830
831
|
default: n(() => [
|
|
831
|
-
i(t(
|
|
832
|
+
i(t(Ce))
|
|
832
833
|
]),
|
|
833
834
|
_: 1
|
|
834
835
|
}, 8, ["data-testid", "disabled"])
|
|
835
836
|
]))
|
|
836
837
|
]))), 128)),
|
|
837
838
|
o.modelValue.length === 0 && !o.readonly ? (y(), V("div", Lt, [
|
|
838
|
-
i(
|
|
839
|
+
i(j, {
|
|
839
840
|
"data-testid": `add-${o.testIdPrefix}`,
|
|
840
841
|
onClick: r
|
|
841
842
|
}, {
|
|
842
843
|
default: n(() => [
|
|
843
|
-
i(t(
|
|
844
|
-
|
|
844
|
+
i(t(Ce)),
|
|
845
|
+
F(" " + _(o.addButtonText), 1)
|
|
845
846
|
]),
|
|
846
847
|
_: 1
|
|
847
848
|
}, 8, ["data-testid"])
|
|
@@ -849,7 +850,7 @@ const te = {
|
|
|
849
850
|
]);
|
|
850
851
|
};
|
|
851
852
|
}
|
|
852
|
-
}),
|
|
853
|
+
}), qe = /* @__PURE__ */ De(Nt, [["__scopeId", "data-v-4f239c35"]]), qt = { class: "kong-ui-entities-gateway-service-form" }, Gt = {
|
|
853
854
|
key: 0,
|
|
854
855
|
class: "gateway-service-form-general-info"
|
|
855
856
|
}, Wt = { class: "gateway-service-form-group-selection-wrapper" }, Ot = {
|
|
@@ -876,7 +877,7 @@ const te = {
|
|
|
876
877
|
}, sa = {
|
|
877
878
|
key: 1,
|
|
878
879
|
class: "checkbox-aligned-radio"
|
|
879
|
-
}, oa = { class: "gateway-service-form-tags" }, la = { class: "form-error-list" }, ra = /* @__PURE__ */
|
|
880
|
+
}, oa = { class: "gateway-service-form-tags" }, la = { class: "form-error-list" }, ra = /* @__PURE__ */ Ie({
|
|
880
881
|
__name: "GatewayServiceForm",
|
|
881
882
|
props: {
|
|
882
883
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -911,8 +912,8 @@ const te = {
|
|
|
911
912
|
}
|
|
912
913
|
},
|
|
913
914
|
emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated", "try-sample-api"],
|
|
914
|
-
setup(o, { expose: D, emit:
|
|
915
|
-
const
|
|
915
|
+
setup(o, { expose: D, emit: p }) {
|
|
916
|
+
const c = p, r = o, v = B(!0), A = We(), { i18nT: R, i18n: { t: l } } = te.useI18n(), { getErrorFieldsFromError: $ } = vt(), { axiosInstance: C } = Oe(r.config?.axiosRequestConfig), j = gt(), { validateHost: ae, validatePath: K, validatePort: z, validateProtocol: ye } = te.useUrlValidators(), { objectsAreEqual: se } = je(), Ee = k(() => ge.form[r.config.app].edit), H = k(() => r.gatewayServiceId ? Le.Edit : Le.Create), q = B(!1), Z = k(() => !!r.gatewayServiceId), T = B(Z.value ? "protocol" : "url"), ce = te.usePortFromProtocol(), J = B(""), Fe = k(() => !!J.value || !!X("name")), e = Me({
|
|
916
917
|
fields: {
|
|
917
918
|
name: "",
|
|
918
919
|
protocol: "http",
|
|
@@ -952,7 +953,7 @@ const te = {
|
|
|
952
953
|
tls_verify_enabled: "",
|
|
953
954
|
tls_verify_value: ""
|
|
954
955
|
}
|
|
955
|
-
}), h =
|
|
956
|
+
}), h = Me({
|
|
956
957
|
name: "",
|
|
957
958
|
protocol: "http",
|
|
958
959
|
host: "",
|
|
@@ -970,13 +971,13 @@ const te = {
|
|
|
970
971
|
tls_verify_value: !1,
|
|
971
972
|
tags: "",
|
|
972
973
|
enabled: !0
|
|
973
|
-
}),
|
|
974
|
+
}), Pe = r.config.app === "konnect" || yt({
|
|
974
975
|
gatewayInfo: r.config.gatewayInfo,
|
|
975
976
|
// 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
|
|
976
977
|
supportedRange: {
|
|
977
978
|
enterprise: ["3.0"]
|
|
978
979
|
}
|
|
979
|
-
}),
|
|
980
|
+
}), oe = [
|
|
980
981
|
{
|
|
981
982
|
label: l("gateway_services.form.fields.protocol.options.http"),
|
|
982
983
|
value: "http",
|
|
@@ -1012,7 +1013,7 @@ const te = {
|
|
|
1012
1013
|
value: "grpcs",
|
|
1013
1014
|
group: "grpc"
|
|
1014
1015
|
},
|
|
1015
|
-
...
|
|
1016
|
+
...Pe ? [
|
|
1016
1017
|
{
|
|
1017
1018
|
label: l("gateway_services.form.fields.protocol.options.ws"),
|
|
1018
1019
|
value: "ws",
|
|
@@ -1029,89 +1030,89 @@ const te = {
|
|
|
1029
1030
|
value: "udp",
|
|
1030
1031
|
group: "udp"
|
|
1031
1032
|
}
|
|
1032
|
-
],
|
|
1033
|
-
e.fields.protocol = s.value, e.fields.port =
|
|
1034
|
-
},
|
|
1033
|
+
], x = { url: "url", protocol: "protocol" }, de = (s) => {
|
|
1034
|
+
e.fields.protocol = s.value, e.fields.port = ce.getPortFromProtocol(e.fields.protocol, String(e.fields.port));
|
|
1035
|
+
}, Q = (s) => s ? parseFloat(s) : 0, ue = () => {
|
|
1035
1036
|
e.fields.host = h.host, e.fields.path = h.path, e.fields.port = h.port, e.fields.protocol = h.protocol, e.fields.url = h.url, e.fields.retries = h.retries, e.fields.connect_timeout = h.connect_timeout, e.fields.write_timeout = h.write_timeout, e.fields.read_timeout = h.read_timeout, e.fields.client_certificate = h.client_certificate, e.fields.tls_sans = {
|
|
1036
1037
|
dnsnames: [...h.tls_sans.dnsnames],
|
|
1037
1038
|
uris: [...h.tls_sans.uris]
|
|
1038
1039
|
}, e.fields.ca_certificates = h.ca_certificates, e.fields.tls_verify_enabled = h.tls_verify_enabled, e.fields.tls_verify_value = h.tls_verify_value, e.fields.enabled = h.enabled;
|
|
1039
|
-
},
|
|
1040
|
-
v.value = !0,
|
|
1041
|
-
},
|
|
1042
|
-
switch (
|
|
1040
|
+
}, _e = () => {
|
|
1041
|
+
v.value = !0, W(), e.errorMessages = [], ue();
|
|
1042
|
+
}, he = () => {
|
|
1043
|
+
switch (ue(), e.fields.name = `${N.name}-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, T.value) {
|
|
1043
1044
|
case "url":
|
|
1044
|
-
e.fields.url = `${
|
|
1045
|
+
e.fields.url = `${N.protocol}://${N.host}${N.path}`;
|
|
1045
1046
|
break;
|
|
1046
1047
|
case "protocol":
|
|
1047
|
-
e.fields.host =
|
|
1048
|
+
e.fields.host = N.host, e.fields.path = N.path, e.fields.protocol = N.protocol, e.fields.port = N.port;
|
|
1048
1049
|
break;
|
|
1049
1050
|
default:
|
|
1050
|
-
e.fields.url = `${
|
|
1051
|
+
e.fields.url = `${N.protocol}://${N.host}${N.path}`;
|
|
1051
1052
|
}
|
|
1052
|
-
},
|
|
1053
|
-
if (
|
|
1053
|
+
}, be = () => {
|
|
1054
|
+
if (W(), e.fields.url.length)
|
|
1054
1055
|
try {
|
|
1055
|
-
const s = new URL(e.fields.url), a =
|
|
1056
|
+
const s = new URL(e.fields.url), a = ye(s.protocol, oe);
|
|
1056
1057
|
if (a) throw new Error(a);
|
|
1057
1058
|
e.fields.protocol = s.protocol.slice(0, -1);
|
|
1058
1059
|
const u = ae(s.hostname);
|
|
1059
1060
|
if (u) throw new Error(u);
|
|
1060
1061
|
e.fields.host = s.hostname;
|
|
1061
|
-
const
|
|
1062
|
-
if (
|
|
1062
|
+
const I = K(s.pathname);
|
|
1063
|
+
if (I) throw new Error(I);
|
|
1063
1064
|
e.fields.path = s.pathname;
|
|
1064
|
-
const
|
|
1065
|
-
if (
|
|
1066
|
-
const
|
|
1067
|
-
|
|
1065
|
+
const b = z(s.port);
|
|
1066
|
+
if (b) throw new Error(b);
|
|
1067
|
+
const m = Number(s.port);
|
|
1068
|
+
q.value = !!m, e.fields.port = m || ce.getPortFromProtocol(e.fields.protocol), c("url-valid:success");
|
|
1068
1069
|
} catch {
|
|
1069
|
-
|
|
1070
|
+
c("url-valid:error", l("gateway_services.form.errors.url.invalid")), e.formFieldErrors.url = l("gateway_services.form.errors.url.invalid");
|
|
1070
1071
|
}
|
|
1071
|
-
},
|
|
1072
|
-
|
|
1073
|
-
},
|
|
1072
|
+
}, le = (s) => {
|
|
1073
|
+
W(s);
|
|
1074
|
+
}, $e = k(() => !!e.formFieldErrors.url || !!e.formFieldErrors.host || !!e.formFieldErrors.port), X = (s) => {
|
|
1074
1075
|
if (e.errorMessages.length) return "";
|
|
1075
1076
|
const a = e.formFieldErrors;
|
|
1076
1077
|
return a[s] ? a[s] : "";
|
|
1077
|
-
},
|
|
1078
|
-
|
|
1078
|
+
}, re = (s) => {
|
|
1079
|
+
W(s ?? void 0);
|
|
1079
1080
|
const a = ae(e.fields.host);
|
|
1080
1081
|
a && (e.formFieldErrors.host = a);
|
|
1081
1082
|
const u = K(e.fields.path);
|
|
1082
1083
|
u && (e.formFieldErrors.path = u);
|
|
1083
|
-
const
|
|
1084
|
-
|
|
1085
|
-
},
|
|
1084
|
+
const I = z(e.fields.port);
|
|
1085
|
+
I && (e.formFieldErrors.port = I), M.value ? c("url-valid:success") : c("url-valid:error", e.errorMessages.join(",") || l("gateway_services.form.errors.url.invalid"));
|
|
1086
|
+
}, W = (s) => {
|
|
1086
1087
|
if (s)
|
|
1087
1088
|
e.formFieldErrors[s] = "";
|
|
1088
1089
|
else
|
|
1089
1090
|
for (let a in e.formFieldErrors)
|
|
1090
1091
|
e.formFieldErrors[a] = "";
|
|
1091
1092
|
e.errorMessages = [];
|
|
1092
|
-
},
|
|
1093
|
+
}, M = k(() => {
|
|
1093
1094
|
for (let s in e.formFieldErrors)
|
|
1094
1095
|
if (e.formFieldErrors[s].length)
|
|
1095
1096
|
return !1;
|
|
1096
1097
|
return !0;
|
|
1097
|
-
}),
|
|
1098
|
-
e.fields.url &&
|
|
1099
|
-
},
|
|
1100
|
-
if (
|
|
1098
|
+
}), fe = () => {
|
|
1099
|
+
e.fields.url && T.value === "url" ? be() : re();
|
|
1100
|
+
}, pe = () => `new-service-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, ie = k(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(e.fields.protocol)), O = k(() => {
|
|
1101
|
+
if (T.value === "url")
|
|
1101
1102
|
return !0;
|
|
1102
1103
|
const s = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
1103
|
-
return
|
|
1104
|
-
}),
|
|
1105
|
-
if (
|
|
1104
|
+
return T.value === "protocol" && s;
|
|
1105
|
+
}), Te = k(() => {
|
|
1106
|
+
if (T.value === "url")
|
|
1106
1107
|
return !0;
|
|
1107
1108
|
const s = ["https", "tls"].includes(e.fields.protocol);
|
|
1108
|
-
return
|
|
1109
|
-
}),
|
|
1110
|
-
|
|
1111
|
-
},
|
|
1112
|
-
const s = !
|
|
1109
|
+
return T.value === "protocol" && s;
|
|
1110
|
+
}), we = (s) => {
|
|
1111
|
+
W("name"), J.value = j.utf8Name(s);
|
|
1112
|
+
}, me = k(() => {
|
|
1113
|
+
const s = !Z.value || !se(e.fields, h), a = T.value === "url" && !!e.fields.url && M.value, u = T.value === "protocol" && !!e.fields.host && M.value;
|
|
1113
1114
|
return s && (a || u);
|
|
1114
|
-
}),
|
|
1115
|
+
}), ve = (s) => {
|
|
1115
1116
|
e.fields.name = s?.name || "", e.fields.tags = s?.tags?.join(", ") || "", e.fields.protocol = s?.protocol || "http", e.fields.path = s?.path || "", e.fields.read_timeout = s?.read_timeout || s?.read_timeout === 0 ? s?.read_timeout : 6e4, e.fields.retries = s?.retries || s?.retries === 0 ? s?.retries : 5, e.fields.host = s?.host || "", e.fields.connect_timeout = s?.connect_timeout || s?.connect_timeout === 0 ? s?.connect_timeout : 6e4, e.fields.tls_verify_enabled = s?.tls_verify !== "" && s?.tls_verify !== null && s?.tls_verify !== void 0, e.fields.tls_verify_value = s?.tls_verify ? s?.tls_verify : !1, e.fields.ca_certificates = s?.ca_certificates?.join(",") || "", e.fields.client_certificate = s?.client_certificate?.id || "", e.fields.tls_sans = {
|
|
1116
1117
|
dnsnames: s?.tls_sans?.dnsnames ?? [""],
|
|
1117
1118
|
uris: s?.tls_sans?.uris ?? [""]
|
|
@@ -1119,22 +1120,22 @@ const te = {
|
|
|
1119
1120
|
dnsnames: [...e.fields.tls_sans.dnsnames],
|
|
1120
1121
|
uris: [...e.fields.tls_sans.uris]
|
|
1121
1122
|
};
|
|
1122
|
-
},
|
|
1123
|
+
}, Y = () => {
|
|
1123
1124
|
A.push(r.config.cancelRoute);
|
|
1124
|
-
},
|
|
1125
|
-
let s = `${r.config.apiBaseUrl}${
|
|
1125
|
+
}, f = k(() => {
|
|
1126
|
+
let s = `${r.config.apiBaseUrl}${ge.form[r.config.app][H.value]}`;
|
|
1126
1127
|
return r.config.app === "konnect" && (s = s.replace(/{controlPlaneId}/gi, r.config?.controlPlaneId || "")), s.replace(/\/{workspace}/gi, r.config?.workspace ? `/${r.config.workspace}` : "").replace(/{id}/gi, r.gatewayServiceId ?? "");
|
|
1127
|
-
}),
|
|
1128
|
+
}), g = k(() => {
|
|
1128
1129
|
if (!r.isTlsSansSupported)
|
|
1129
1130
|
return;
|
|
1130
|
-
if (!
|
|
1131
|
+
if (!O.value)
|
|
1131
1132
|
return null;
|
|
1132
1133
|
const s = e.fields.tls_sans.dnsnames.map((u) => u.trim()).filter(Boolean), a = e.fields.tls_sans.uris.map((u) => u.trim()).filter(Boolean);
|
|
1133
1134
|
return s.length || a.length ? {
|
|
1134
1135
|
dnsnames: s.length ? s : null,
|
|
1135
1136
|
uris: a.length ? a : null
|
|
1136
1137
|
} : null;
|
|
1137
|
-
}),
|
|
1138
|
+
}), w = k(() => {
|
|
1138
1139
|
const s = {
|
|
1139
1140
|
name: e.fields.name || null,
|
|
1140
1141
|
tags: e.fields.tags ? e.fields.tags?.split(",")?.map((a) => String(a || "").trim())?.filter((a) => a !== "") : null,
|
|
@@ -1146,122 +1147,122 @@ const te = {
|
|
|
1146
1147
|
connect_timeout: e.fields.connect_timeout,
|
|
1147
1148
|
ca_certificates: e.fields.ca_certificates ? e.fields.ca_certificates?.split(",").filter((a) => a !== "") : null,
|
|
1148
1149
|
client_certificate: e.fields.client_certificate ? { id: e.fields.client_certificate } : null,
|
|
1149
|
-
tls_sans:
|
|
1150
|
+
tls_sans: g.value,
|
|
1150
1151
|
write_timeout: e.fields.write_timeout,
|
|
1151
1152
|
port: e.fields.port,
|
|
1152
1153
|
url: e.fields.url,
|
|
1153
1154
|
enabled: e.fields.enabled
|
|
1154
1155
|
};
|
|
1155
|
-
return
|
|
1156
|
-
}),
|
|
1156
|
+
return O.value || (s.client_certificate = null), e.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(e.fields.protocol) && (s.tls_verify = e.fields.tls_verify_value), ie.value || (s.path = null), H.value === "create" ? T.value === "url" ? (delete s.protocol, delete s.host, delete s.path, r.config.app === "konnect" && delete s.port) : delete s.url : H.value === "edit" && delete s.url, s;
|
|
1157
|
+
}), S = async () => {
|
|
1157
1158
|
try {
|
|
1158
1159
|
e.isReadonly = !0;
|
|
1159
|
-
const s =
|
|
1160
|
+
const s = w.value;
|
|
1160
1161
|
let a;
|
|
1161
|
-
if (
|
|
1162
|
+
if (H.value === "create" ? a = await C.post(f.value, s) : H.value === "edit" && (a = r.config?.app === "konnect" ? await C.put(f.value, s) : await C.patch(f.value, s)), a) {
|
|
1162
1163
|
const { data: u } = a;
|
|
1163
|
-
e.fields.name = u?.name || "", e.fields.port = u.port ||
|
|
1164
|
+
e.fields.name = u?.name || "", e.fields.port = u.port || ce.getPortFromProtocol(u.protocol), e.fields.protocol = u?.protocol || "http", e.fields.host = u?.host || "", e.fields.path = u?.path || "", e.fields.url = u?.url || "", e.fields.retries = u?.retries || u?.retries === 0 ? u?.retries : 5, e.fields.connect_timeout = u?.connect_timeout || u?.connect_timeout === 0 ? u?.connect_timeout : 6e4, e.fields.write_timeout = u?.write_timeout || u?.write_timeout === 0 ? u?.write_timeout : 6e4, e.fields.read_timeout = u?.read_timeout || u?.read_timeout === 0 ? u?.read_timeout : 6e4, e.fields.client_certificate = u?.client_certificate?.id || "", e.fields.tls_sans = {
|
|
1164
1165
|
dnsnames: u?.tls_sans?.dnsnames ?? [],
|
|
1165
1166
|
uris: u?.tls_sans?.uris ?? []
|
|
1166
1167
|
}, e.fields.ca_certificates = u?.ca_certificates?.length ? u?.ca_certificates.join(",") : "", e.fields.tls_verify_enabled = u?.tls_verify !== "" && u?.tls_verify !== null && u?.tls_verify !== void 0, e.fields.tls_verify_value = e.fields.tls_verify_enabled && u?.tls_verify, e.fields.tags = u?.tags?.length ? u.tags.join(", ") : "", e.fields.enabled = u?.enabled ?? !0, Object.assign(h, e.fields), h.tls_sans = {
|
|
1167
1168
|
dnsnames: [...e.fields.tls_sans.dnsnames],
|
|
1168
1169
|
uris: [...e.fields.tls_sans.uris]
|
|
1169
|
-
},
|
|
1170
|
+
}, c("update", a?.data);
|
|
1170
1171
|
}
|
|
1171
1172
|
return a;
|
|
1172
1173
|
} catch (s) {
|
|
1173
|
-
const { fields: a, messages: u } =
|
|
1174
|
-
e.errorMessages = u, a.length && a.forEach((
|
|
1175
|
-
const
|
|
1176
|
-
|
|
1174
|
+
const { fields: a, messages: u } = $(s);
|
|
1175
|
+
e.errorMessages = u, a.length && a.forEach((I) => {
|
|
1176
|
+
const b = I.field;
|
|
1177
|
+
b === "client_certificate.id" ? e.formFieldErrors.client_certificate = I.message : b.startsWith("tls_sans.dnsnames") ? e.formFieldErrors.tls_sans_dnsnames = I.message : b.startsWith("tls_sans.uris") ? e.formFieldErrors.tls_sans_uris = I.message : b.startsWith("ca_certificates") ? e.formFieldErrors.ca_certificates = I.message : Object.keys(e.formFieldErrors).includes(b) && (e.formFieldErrors = {
|
|
1177
1178
|
...e.formFieldErrors,
|
|
1178
|
-
[
|
|
1179
|
+
[b]: I.message
|
|
1179
1180
|
});
|
|
1180
|
-
}),
|
|
1181
|
+
}), c("error", s);
|
|
1181
1182
|
} finally {
|
|
1182
1183
|
e.isReadonly = !1;
|
|
1183
1184
|
}
|
|
1184
1185
|
};
|
|
1185
|
-
return
|
|
1186
|
+
return xe(() => r.gatewayServiceId, () => {
|
|
1186
1187
|
Object.assign(e.fields, h);
|
|
1187
|
-
}),
|
|
1188
|
-
|
|
1188
|
+
}), xe(e.fields, () => {
|
|
1189
|
+
c("model-updated", w.value);
|
|
1189
1190
|
}), Qe(() => {
|
|
1190
|
-
|
|
1191
|
+
c("model-updated", w.value), Z.value || (e.fields.name = pe());
|
|
1191
1192
|
}), D({
|
|
1192
|
-
validateUrl:
|
|
1193
|
-
getPayload:
|
|
1194
|
-
saveFormData:
|
|
1195
|
-
canSubmit:
|
|
1196
|
-
initForm:
|
|
1193
|
+
validateUrl: fe,
|
|
1194
|
+
getPayload: w,
|
|
1195
|
+
saveFormData: S,
|
|
1196
|
+
canSubmit: me,
|
|
1197
|
+
initForm: ve
|
|
1197
1198
|
}), (s, a) => {
|
|
1198
|
-
const u =
|
|
1199
|
+
const u = U("KRadio"), I = U("KButton"), b = U("KInput"), m = U("KSelect"), L = U("KCheckbox"), ee = U("KCollapse"), He = U("KAlert");
|
|
1199
1200
|
return y(), V("div", qt, [
|
|
1200
1201
|
i(t(_t), {
|
|
1201
|
-
"can-submit":
|
|
1202
|
+
"can-submit": me.value,
|
|
1202
1203
|
config: o.config,
|
|
1203
1204
|
"edit-id": o.gatewayServiceId,
|
|
1204
|
-
"entity-type": t(
|
|
1205
|
-
"fetch-url":
|
|
1206
|
-
"form-fields":
|
|
1205
|
+
"entity-type": t(ze).GatewayService,
|
|
1206
|
+
"fetch-url": Ee.value,
|
|
1207
|
+
"form-fields": w.value,
|
|
1207
1208
|
"is-readonly": e.isReadonly,
|
|
1208
|
-
onCancel:
|
|
1209
|
-
"onFetch:error": a[34] || (a[34] = (
|
|
1210
|
-
"onFetch:success":
|
|
1211
|
-
onLoading: a[35] || (a[35] = (
|
|
1212
|
-
onSubmit:
|
|
1209
|
+
onCancel: Y,
|
|
1210
|
+
"onFetch:error": a[34] || (a[34] = (d) => s.$emit("error", d)),
|
|
1211
|
+
"onFetch:success": ve,
|
|
1212
|
+
onLoading: a[35] || (a[35] = (d) => s.$emit("loading", d)),
|
|
1213
|
+
onSubmit: S
|
|
1213
1214
|
}, {
|
|
1214
1215
|
"form-actions": n(() => [
|
|
1215
1216
|
Xe(s.$slots, "form-actions", {
|
|
1216
|
-
canSubmit:
|
|
1217
|
-
cancel:
|
|
1218
|
-
submit:
|
|
1217
|
+
canSubmit: me.value,
|
|
1218
|
+
cancel: Y,
|
|
1219
|
+
submit: S
|
|
1219
1220
|
}, void 0, !0)
|
|
1220
1221
|
]),
|
|
1221
1222
|
default: n(() => [
|
|
1222
|
-
i(t(
|
|
1223
|
+
i(t(Ne), {
|
|
1223
1224
|
description: t(l)("gateway_services.form.sections.keys.description"),
|
|
1224
1225
|
"hide-info-header": o.hideSectionsInfo,
|
|
1225
1226
|
title: t(l)("gateway_services.form.sections.keys.title")
|
|
1226
1227
|
}, {
|
|
1227
1228
|
default: n(() => [
|
|
1228
|
-
|
|
1229
|
-
|
|
1229
|
+
Z.value ? E("", !0) : (y(), V("div", Gt, [
|
|
1230
|
+
P("div", Wt, [
|
|
1230
1231
|
i(u, {
|
|
1231
|
-
modelValue:
|
|
1232
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
1232
|
+
modelValue: T.value,
|
|
1233
|
+
"onUpdate:modelValue": a[0] || (a[0] = (d) => T.value = d),
|
|
1233
1234
|
card: "",
|
|
1234
1235
|
"card-orientation": "horizontal",
|
|
1235
1236
|
"data-testid": "gateway-service-url-radio",
|
|
1236
1237
|
description: t(l)("gateway_services.form.sections.keys.url.description"),
|
|
1237
1238
|
label: t(l)("gateway_services.form.sections.keys.url.label"),
|
|
1238
|
-
"selected-value":
|
|
1239
|
-
onChange:
|
|
1239
|
+
"selected-value": x.url,
|
|
1240
|
+
onChange: _e
|
|
1240
1241
|
}, null, 8, ["modelValue", "description", "label", "selected-value"]),
|
|
1241
1242
|
i(u, {
|
|
1242
|
-
modelValue:
|
|
1243
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
1243
|
+
modelValue: T.value,
|
|
1244
|
+
"onUpdate:modelValue": a[1] || (a[1] = (d) => T.value = d),
|
|
1244
1245
|
card: "",
|
|
1245
1246
|
"card-orientation": "horizontal",
|
|
1246
1247
|
"checked-group": "protocol",
|
|
1247
1248
|
"data-testid": "gateway-service-protocol-radio",
|
|
1248
1249
|
description: t(l)("gateway_services.form.sections.keys.protocol.description"),
|
|
1249
1250
|
label: t(l)("gateway_services.form.sections.keys.protocol.label"),
|
|
1250
|
-
"selected-value":
|
|
1251
|
-
onChange:
|
|
1251
|
+
"selected-value": x.protocol,
|
|
1252
|
+
onChange: _e
|
|
1252
1253
|
}, null, 8, ["modelValue", "description", "label", "selected-value"])
|
|
1253
1254
|
]),
|
|
1254
|
-
i(
|
|
1255
|
+
i(Ae, { name: "slide-fade" }, {
|
|
1255
1256
|
default: n(() => [
|
|
1256
|
-
|
|
1257
|
-
i(
|
|
1257
|
+
T.value === "url" ? (y(), V("div", Ot, [
|
|
1258
|
+
i(b, {
|
|
1258
1259
|
modelValue: e.fields.url,
|
|
1259
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
1260
|
+
"onUpdate:modelValue": a[2] || (a[2] = (d) => e.fields.url = d),
|
|
1260
1261
|
modelModifiers: { trim: !0 },
|
|
1261
1262
|
class: "gateway-service-url-input gateway-service-form-margin-bottom",
|
|
1262
1263
|
"data-testid": "gateway-service-url-input",
|
|
1263
|
-
error:
|
|
1264
|
-
"error-message":
|
|
1264
|
+
error: $e.value,
|
|
1265
|
+
"error-message": X("url"),
|
|
1265
1266
|
label: t(l)("gateway_services.form.fields.upstream_url.label"),
|
|
1266
1267
|
"label-attributes": {
|
|
1267
1268
|
info: o.config.app === "konnect" ? t(l)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : t(l)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
|
|
@@ -1270,19 +1271,19 @@ const te = {
|
|
|
1270
1271
|
name: "url",
|
|
1271
1272
|
placeholder: t(l)("gateway_services.form.fields.upstream_url.placeholder"),
|
|
1272
1273
|
required: "",
|
|
1273
|
-
onInput:
|
|
1274
|
-
},
|
|
1274
|
+
onInput: be
|
|
1275
|
+
}, Se({ _: 2 }, [
|
|
1275
1276
|
o.hideTrySampleApiButton ? void 0 : {
|
|
1276
1277
|
name: "after",
|
|
1277
1278
|
fn: n(() => [
|
|
1278
|
-
i(
|
|
1279
|
+
i(I, {
|
|
1279
1280
|
appearance: "tertiary",
|
|
1280
1281
|
"data-testid": "try-sample-api",
|
|
1281
1282
|
size: "small",
|
|
1282
|
-
onClick:
|
|
1283
|
+
onClick: he
|
|
1283
1284
|
}, {
|
|
1284
1285
|
default: n(() => [
|
|
1285
|
-
|
|
1286
|
+
F(_(t(l)("gateway_services.form.buttons.try_sample")), 1)
|
|
1286
1287
|
]),
|
|
1287
1288
|
_: 1
|
|
1288
1289
|
})
|
|
@@ -1295,14 +1296,14 @@ const te = {
|
|
|
1295
1296
|
_: 1
|
|
1296
1297
|
})
|
|
1297
1298
|
])),
|
|
1298
|
-
i(
|
|
1299
|
+
i(Ae, { name: "slide-fade" }, {
|
|
1299
1300
|
default: n(() => [
|
|
1300
|
-
|
|
1301
|
-
i(
|
|
1301
|
+
T.value === "protocol" || Z.value ? (y(), V("div", jt, [
|
|
1302
|
+
i(m, {
|
|
1302
1303
|
modelValue: e.fields.protocol,
|
|
1303
|
-
"onUpdate:modelValue": a[3] || (a[3] = (
|
|
1304
|
+
"onUpdate:modelValue": a[3] || (a[3] = (d) => e.fields.protocol = d),
|
|
1304
1305
|
"data-testid": "gateway-service-protocol-select",
|
|
1305
|
-
items:
|
|
1306
|
+
items: oe,
|
|
1306
1307
|
label: t(l)("gateway_services.form.fields.protocol.label"),
|
|
1307
1308
|
"label-attributes": {
|
|
1308
1309
|
info: t(l)("gateway_services.form.fields.protocol.tooltip"),
|
|
@@ -1311,16 +1312,16 @@ const te = {
|
|
|
1311
1312
|
readonly: e.isReadonly,
|
|
1312
1313
|
required: "",
|
|
1313
1314
|
width: "100%",
|
|
1314
|
-
onSelected:
|
|
1315
|
+
onSelected: de
|
|
1315
1316
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
|
|
1316
|
-
i(
|
|
1317
|
+
i(b, {
|
|
1317
1318
|
modelValue: e.fields.host,
|
|
1318
|
-
"onUpdate:modelValue": a[4] || (a[4] = (
|
|
1319
|
+
"onUpdate:modelValue": a[4] || (a[4] = (d) => e.fields.host = d),
|
|
1319
1320
|
modelModifiers: { trim: !0 },
|
|
1320
1321
|
class: "gateway-service-form-margin-top",
|
|
1321
1322
|
"data-testid": "gateway-service-host-input",
|
|
1322
1323
|
error: !!e.formFieldErrors.host,
|
|
1323
|
-
"error-message":
|
|
1324
|
+
"error-message": X("host"),
|
|
1324
1325
|
label: t(l)("gateway_services.form.fields.host.label"),
|
|
1325
1326
|
"label-attributes": {
|
|
1326
1327
|
info: t(l)("gateway_services.form.fields.host.tooltip"),
|
|
@@ -1329,18 +1330,18 @@ const te = {
|
|
|
1329
1330
|
name: "host",
|
|
1330
1331
|
placeholder: t(l)("gateway_services.form.fields.host.placeholder"),
|
|
1331
1332
|
required: "",
|
|
1332
|
-
onInput: a[5] || (a[5] = (
|
|
1333
|
-
},
|
|
1333
|
+
onInput: a[5] || (a[5] = (d) => re("host"))
|
|
1334
|
+
}, Se({ _: 2 }, [
|
|
1334
1335
|
o.hideTrySampleApiButton ? void 0 : {
|
|
1335
1336
|
name: "after",
|
|
1336
1337
|
fn: n(() => [
|
|
1337
|
-
i(
|
|
1338
|
+
i(I, {
|
|
1338
1339
|
appearance: "tertiary",
|
|
1339
1340
|
size: "small",
|
|
1340
|
-
onClick:
|
|
1341
|
+
onClick: he
|
|
1341
1342
|
}, {
|
|
1342
1343
|
default: n(() => [
|
|
1343
|
-
|
|
1344
|
+
F(_(t(l)("gateway_services.form.buttons.try_sample")), 1)
|
|
1344
1345
|
]),
|
|
1345
1346
|
_: 1
|
|
1346
1347
|
})
|
|
@@ -1348,15 +1349,15 @@ const te = {
|
|
|
1348
1349
|
key: "0"
|
|
1349
1350
|
}
|
|
1350
1351
|
]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"]),
|
|
1351
|
-
|
|
1352
|
-
i(
|
|
1352
|
+
ie.value ? (y(), V("div", zt, [
|
|
1353
|
+
i(b, {
|
|
1353
1354
|
modelValue: e.fields.path,
|
|
1354
|
-
"onUpdate:modelValue": a[6] || (a[6] = (
|
|
1355
|
+
"onUpdate:modelValue": a[6] || (a[6] = (d) => e.fields.path = d),
|
|
1355
1356
|
modelModifiers: { trim: !0 },
|
|
1356
1357
|
class: "gateway-service-form-margin-top",
|
|
1357
1358
|
"data-testid": "gateway-service-path-input",
|
|
1358
1359
|
error: !!e.formFieldErrors.path,
|
|
1359
|
-
"error-message":
|
|
1360
|
+
"error-message": X("path"),
|
|
1360
1361
|
label: t(l)("gateway_services.form.fields.path.label"),
|
|
1361
1362
|
"label-attributes": {
|
|
1362
1363
|
info: t(l)("gateway_services.form.fields.path.tooltip"),
|
|
@@ -1364,21 +1365,21 @@ const te = {
|
|
|
1364
1365
|
},
|
|
1365
1366
|
name: "path",
|
|
1366
1367
|
placeholder: t(l)("gateway_services.form.fields.path.placeholder"),
|
|
1367
|
-
onInput: a[7] || (a[7] = (
|
|
1368
|
+
onInput: a[7] || (a[7] = (d) => re("path"))
|
|
1368
1369
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
|
|
1369
1370
|
])) : E("", !0),
|
|
1370
|
-
i(
|
|
1371
|
+
i(b, {
|
|
1371
1372
|
modelValue: e.fields.port,
|
|
1372
1373
|
"onUpdate:modelValue": [
|
|
1373
|
-
a[8] || (a[8] = (
|
|
1374
|
+
a[8] || (a[8] = (d) => e.fields.port = d),
|
|
1374
1375
|
a[10] || (a[10] = () => {
|
|
1375
|
-
e.fields.port =
|
|
1376
|
+
e.fields.port = Q(e.fields.port + "");
|
|
1376
1377
|
})
|
|
1377
1378
|
],
|
|
1378
1379
|
class: "gateway-service-form-margin-top",
|
|
1379
1380
|
"data-testid": "gateway-service-port-input",
|
|
1380
1381
|
error: !!e.formFieldErrors.port,
|
|
1381
|
-
"error-message":
|
|
1382
|
+
"error-message": X("port"),
|
|
1382
1383
|
label: t(l)("gateway_services.form.fields.port.label"),
|
|
1383
1384
|
"label-attributes": {
|
|
1384
1385
|
info: t(l)("gateway_services.form.fields.port.tooltip"),
|
|
@@ -1386,30 +1387,30 @@ const te = {
|
|
|
1386
1387
|
},
|
|
1387
1388
|
name: "port",
|
|
1388
1389
|
type: "number",
|
|
1389
|
-
onInput: a[9] || (a[9] = (
|
|
1390
|
+
onInput: a[9] || (a[9] = (d) => re("port"))
|
|
1390
1391
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes"])
|
|
1391
1392
|
])) : E("", !0)
|
|
1392
1393
|
]),
|
|
1393
1394
|
_: 1
|
|
1394
1395
|
}),
|
|
1395
|
-
i(
|
|
1396
|
+
i(ee, {
|
|
1396
1397
|
modelValue: v.value,
|
|
1397
|
-
"onUpdate:modelValue": a[30] || (a[30] = (
|
|
1398
|
+
"onUpdate:modelValue": a[30] || (a[30] = (d) => v.value = d),
|
|
1398
1399
|
"data-testid": "advanced-fields-collapse",
|
|
1399
1400
|
"trigger-alignment": "leading",
|
|
1400
1401
|
"trigger-label": t(l)("gateway_services.form.sections.keys.viewAdvancedFields")
|
|
1401
1402
|
}, {
|
|
1402
1403
|
default: n(() => [
|
|
1403
|
-
i(
|
|
1404
|
+
i(Ae, { name: "slide-fade" }, {
|
|
1404
1405
|
default: n(() => [
|
|
1405
1406
|
v.value ? E("", !0) : (y(), V("div", Ht, [
|
|
1406
|
-
|
|
1407
|
-
i(
|
|
1407
|
+
P("div", Zt, [
|
|
1408
|
+
i(b, {
|
|
1408
1409
|
modelValue: e.fields.retries,
|
|
1409
1410
|
"onUpdate:modelValue": [
|
|
1410
|
-
a[11] || (a[11] = (
|
|
1411
|
+
a[11] || (a[11] = (d) => e.fields.retries = d),
|
|
1411
1412
|
a[12] || (a[12] = () => {
|
|
1412
|
-
e.fields.retries =
|
|
1413
|
+
e.fields.retries = Q(e.fields.retries + "");
|
|
1413
1414
|
})
|
|
1414
1415
|
],
|
|
1415
1416
|
autocomplete: "off",
|
|
@@ -1424,13 +1425,13 @@ const te = {
|
|
|
1424
1425
|
type: "number"
|
|
1425
1426
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1426
1427
|
]),
|
|
1427
|
-
|
|
1428
|
-
i(
|
|
1428
|
+
P("div", Jt, [
|
|
1429
|
+
i(b, {
|
|
1429
1430
|
modelValue: e.fields.connect_timeout,
|
|
1430
1431
|
"onUpdate:modelValue": [
|
|
1431
|
-
a[13] || (a[13] = (
|
|
1432
|
+
a[13] || (a[13] = (d) => e.fields.connect_timeout = d),
|
|
1432
1433
|
a[14] || (a[14] = () => {
|
|
1433
|
-
e.fields.connect_timeout =
|
|
1434
|
+
e.fields.connect_timeout = Q(e.fields.connect_timeout + "");
|
|
1434
1435
|
})
|
|
1435
1436
|
],
|
|
1436
1437
|
autocomplete: "off",
|
|
@@ -1445,13 +1446,13 @@ const te = {
|
|
|
1445
1446
|
type: "number"
|
|
1446
1447
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1447
1448
|
]),
|
|
1448
|
-
|
|
1449
|
-
i(
|
|
1449
|
+
P("div", Qt, [
|
|
1450
|
+
i(b, {
|
|
1450
1451
|
modelValue: e.fields.write_timeout,
|
|
1451
1452
|
"onUpdate:modelValue": [
|
|
1452
|
-
a[15] || (a[15] = (
|
|
1453
|
+
a[15] || (a[15] = (d) => e.fields.write_timeout = d),
|
|
1453
1454
|
a[16] || (a[16] = () => {
|
|
1454
|
-
e.fields.write_timeout =
|
|
1455
|
+
e.fields.write_timeout = Q(e.fields.write_timeout + "");
|
|
1455
1456
|
})
|
|
1456
1457
|
],
|
|
1457
1458
|
autocomplete: "off",
|
|
@@ -1466,13 +1467,13 @@ const te = {
|
|
|
1466
1467
|
type: "number"
|
|
1467
1468
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1468
1469
|
]),
|
|
1469
|
-
|
|
1470
|
-
i(
|
|
1470
|
+
P("div", Xt, [
|
|
1471
|
+
i(b, {
|
|
1471
1472
|
modelValue: e.fields.read_timeout,
|
|
1472
1473
|
"onUpdate:modelValue": [
|
|
1473
|
-
a[17] || (a[17] = (
|
|
1474
|
+
a[17] || (a[17] = (d) => e.fields.read_timeout = d),
|
|
1474
1475
|
a[18] || (a[18] = () => {
|
|
1475
|
-
e.fields.read_timeout =
|
|
1476
|
+
e.fields.read_timeout = Q(e.fields.read_timeout + "");
|
|
1476
1477
|
})
|
|
1477
1478
|
],
|
|
1478
1479
|
autocomplete: "off",
|
|
@@ -1487,10 +1488,10 @@ const te = {
|
|
|
1487
1488
|
type: "number"
|
|
1488
1489
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1489
1490
|
]),
|
|
1490
|
-
|
|
1491
|
-
i(
|
|
1491
|
+
O.value ? (y(), V("div", Yt, [
|
|
1492
|
+
i(b, {
|
|
1492
1493
|
modelValue: e.fields.client_certificate,
|
|
1493
|
-
"onUpdate:modelValue": a[19] || (a[19] = (
|
|
1494
|
+
"onUpdate:modelValue": a[19] || (a[19] = (d) => e.fields.client_certificate = d),
|
|
1494
1495
|
modelModifiers: { trim: !0 },
|
|
1495
1496
|
autocomplete: "off",
|
|
1496
1497
|
"data-testid": "gateway-service-clientCert-input",
|
|
@@ -1504,13 +1505,13 @@ const te = {
|
|
|
1504
1505
|
placeholder: t(l)("gateway_services.form.fields.client_certificate.placeholder"),
|
|
1505
1506
|
readonly: e.isReadonly,
|
|
1506
1507
|
type: "text",
|
|
1507
|
-
onInput: a[20] || (a[20] = (
|
|
1508
|
+
onInput: a[20] || (a[20] = (d) => le("client_certificate"))
|
|
1508
1509
|
}, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"])
|
|
1509
1510
|
])) : E("", !0),
|
|
1510
|
-
|
|
1511
|
+
O.value && o.isTlsSansSupported ? (y(), G(qe, {
|
|
1511
1512
|
key: 1,
|
|
1512
1513
|
modelValue: e.fields.tls_sans.dnsnames,
|
|
1513
|
-
"onUpdate:modelValue": a[21] || (a[21] = (
|
|
1514
|
+
"onUpdate:modelValue": a[21] || (a[21] = (d) => e.fields.tls_sans.dnsnames = d),
|
|
1514
1515
|
"add-button-text": t(l)("gateway_services.form.fields.tls_sans_dnsnames.add"),
|
|
1515
1516
|
class: "gateway-service-form-margin-bottom",
|
|
1516
1517
|
"data-testid": "gateway-service-tls-sans-dnsnames",
|
|
@@ -1520,12 +1521,12 @@ const te = {
|
|
|
1520
1521
|
readonly: e.isReadonly,
|
|
1521
1522
|
"test-id-prefix": "tls-sans-dnsnames",
|
|
1522
1523
|
tooltip: t(l)("gateway_services.form.fields.tls_sans_dnsnames.tooltip"),
|
|
1523
|
-
onInput: a[22] || (a[22] = (
|
|
1524
|
+
onInput: a[22] || (a[22] = (d) => le("tls_sans_dnsnames"))
|
|
1524
1525
|
}, null, 8, ["modelValue", "add-button-text", "error", "label", "placeholder", "readonly", "tooltip"])) : E("", !0),
|
|
1525
|
-
|
|
1526
|
+
O.value && o.isTlsSansSupported ? (y(), G(qe, {
|
|
1526
1527
|
key: 2,
|
|
1527
1528
|
modelValue: e.fields.tls_sans.uris,
|
|
1528
|
-
"onUpdate:modelValue": a[23] || (a[23] = (
|
|
1529
|
+
"onUpdate:modelValue": a[23] || (a[23] = (d) => e.fields.tls_sans.uris = d),
|
|
1529
1530
|
"add-button-text": t(l)("gateway_services.form.fields.tls_sans_uris.add"),
|
|
1530
1531
|
class: "gateway-service-form-margin-bottom",
|
|
1531
1532
|
"data-testid": "gateway-service-tls-sans-uris",
|
|
@@ -1535,12 +1536,12 @@ const te = {
|
|
|
1535
1536
|
readonly: e.isReadonly,
|
|
1536
1537
|
"test-id-prefix": "tls-sans-uris",
|
|
1537
1538
|
tooltip: t(l)("gateway_services.form.fields.tls_sans_uris.tooltip"),
|
|
1538
|
-
onInput: a[24] || (a[24] = (
|
|
1539
|
+
onInput: a[24] || (a[24] = (d) => le("tls_sans_uris"))
|
|
1539
1540
|
}, null, 8, ["modelValue", "add-button-text", "error", "label", "placeholder", "readonly", "tooltip"])) : E("", !0),
|
|
1540
|
-
|
|
1541
|
-
i(
|
|
1541
|
+
Te.value ? (y(), V("div", ea, [
|
|
1542
|
+
i(b, {
|
|
1542
1543
|
modelValue: e.fields.ca_certificates,
|
|
1543
|
-
"onUpdate:modelValue": a[25] || (a[25] = (
|
|
1544
|
+
"onUpdate:modelValue": a[25] || (a[25] = (d) => e.fields.ca_certificates = d),
|
|
1544
1545
|
modelModifiers: { trim: !0 },
|
|
1545
1546
|
autocomplete: "off",
|
|
1546
1547
|
"data-testid": "gateway-service-ca-certs-input",
|
|
@@ -1550,18 +1551,18 @@ const te = {
|
|
|
1550
1551
|
placeholder: t(l)("gateway_services.form.fields.ca_certificates.placeholder"),
|
|
1551
1552
|
readonly: e.isReadonly,
|
|
1552
1553
|
type: "text",
|
|
1553
|
-
onInput: a[26] || (a[26] = (
|
|
1554
|
+
onInput: a[26] || (a[26] = (d) => le("ca_certificates"))
|
|
1554
1555
|
}, {
|
|
1555
1556
|
"label-tooltip": n(() => [
|
|
1556
|
-
i(t(
|
|
1557
|
+
i(t(R), {
|
|
1557
1558
|
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1558
1559
|
scope: "global"
|
|
1559
1560
|
}, {
|
|
1560
1561
|
code1: n(() => [
|
|
1561
|
-
|
|
1562
|
+
P("code", null, _(t(l)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
1562
1563
|
]),
|
|
1563
1564
|
code2: n(() => [
|
|
1564
|
-
|
|
1565
|
+
P("code", null, _(t(l)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
1565
1566
|
]),
|
|
1566
1567
|
_: 1
|
|
1567
1568
|
})
|
|
@@ -1569,22 +1570,22 @@ const te = {
|
|
|
1569
1570
|
_: 1
|
|
1570
1571
|
}, 8, ["modelValue", "error", "label", "placeholder", "readonly"])
|
|
1571
1572
|
])) : E("", !0),
|
|
1572
|
-
|
|
1573
|
-
i(
|
|
1573
|
+
O.value ? (y(), V("div", ta, [
|
|
1574
|
+
i(L, {
|
|
1574
1575
|
modelValue: e.fields.tls_verify_enabled,
|
|
1575
|
-
"onUpdate:modelValue": a[27] || (a[27] = (
|
|
1576
|
+
"onUpdate:modelValue": a[27] || (a[27] = (d) => e.fields.tls_verify_enabled = d),
|
|
1576
1577
|
"data-testid": "gateway-service-tls-verify-checkbox",
|
|
1577
1578
|
description: t(l)("gateway_services.form.fields.tls_verify_enabled.help"),
|
|
1578
1579
|
label: t(l)("gateway_services.form.fields.tls_verify_enabled.label"),
|
|
1579
1580
|
"label-attributes": { tooltipAttributes: { maxWidth: "400" } }
|
|
1580
1581
|
}, {
|
|
1581
1582
|
tooltip: n(() => [
|
|
1582
|
-
i(t(
|
|
1583
|
+
i(t(R), {
|
|
1583
1584
|
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
1584
1585
|
scope: "global"
|
|
1585
1586
|
}, {
|
|
1586
1587
|
code1: n(() => [
|
|
1587
|
-
|
|
1588
|
+
P("code", null, _(t(l)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
1588
1589
|
]),
|
|
1589
1590
|
_: 1
|
|
1590
1591
|
})
|
|
@@ -1594,7 +1595,7 @@ const te = {
|
|
|
1594
1595
|
e.fields.tls_verify_enabled ? (y(), V("div", aa, [
|
|
1595
1596
|
i(u, {
|
|
1596
1597
|
modelValue: e.fields.tls_verify_value,
|
|
1597
|
-
"onUpdate:modelValue": a[28] || (a[28] = (
|
|
1598
|
+
"onUpdate:modelValue": a[28] || (a[28] = (d) => e.fields.tls_verify_value = d),
|
|
1598
1599
|
"data-testid": "gateway-service-tls-verify-true-option",
|
|
1599
1600
|
label: t(l)("gateway_services.form.fields.tls_verify_option.true.label"),
|
|
1600
1601
|
"selected-value": !0
|
|
@@ -1603,7 +1604,7 @@ const te = {
|
|
|
1603
1604
|
e.fields.tls_verify_enabled ? (y(), V("div", sa, [
|
|
1604
1605
|
i(u, {
|
|
1605
1606
|
modelValue: e.fields.tls_verify_value,
|
|
1606
|
-
"onUpdate:modelValue": a[29] || (a[29] = (
|
|
1607
|
+
"onUpdate:modelValue": a[29] || (a[29] = (d) => e.fields.tls_verify_value = d),
|
|
1607
1608
|
"data-testid": "gateway-service-tls-verify-false-option",
|
|
1608
1609
|
label: t(l)("gateway_services.form.fields.tls_verify_option.false.label"),
|
|
1609
1610
|
"selected-value": !1
|
|
@@ -1620,20 +1621,20 @@ const te = {
|
|
|
1620
1621
|
]),
|
|
1621
1622
|
_: 1
|
|
1622
1623
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
1623
|
-
i(t(
|
|
1624
|
+
i(t(Ne), {
|
|
1624
1625
|
description: t(l)("gateway_services.form.sections.general.description"),
|
|
1625
1626
|
"hide-info-header": o.hideSectionsInfo,
|
|
1626
1627
|
title: t(l)("gateway_services.form.sections.general.title")
|
|
1627
1628
|
}, {
|
|
1628
1629
|
default: n(() => [
|
|
1629
|
-
i(
|
|
1630
|
+
i(b, {
|
|
1630
1631
|
modelValue: e.fields.name,
|
|
1631
|
-
"onUpdate:modelValue": a[31] || (a[31] = (
|
|
1632
|
+
"onUpdate:modelValue": a[31] || (a[31] = (d) => e.fields.name = d),
|
|
1632
1633
|
modelModifiers: { trim: !0 },
|
|
1633
1634
|
autocomplete: "off",
|
|
1634
1635
|
"data-testid": "gateway-service-name-input",
|
|
1635
|
-
error:
|
|
1636
|
-
"error-message":
|
|
1636
|
+
error: Fe.value,
|
|
1637
|
+
"error-message": J.value,
|
|
1637
1638
|
label: t(l)("gateway_services.form.fields.name.label"),
|
|
1638
1639
|
"label-attributes": {
|
|
1639
1640
|
info: t(l)("gateway_services.form.fields.name.tooltip"),
|
|
@@ -1643,18 +1644,18 @@ const te = {
|
|
|
1643
1644
|
placeholder: t(l)("gateway_services.form.fields.name.placeholder"),
|
|
1644
1645
|
readonly: e.isReadonly,
|
|
1645
1646
|
type: "text",
|
|
1646
|
-
onInput:
|
|
1647
|
+
onInput: we
|
|
1647
1648
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1648
|
-
i(
|
|
1649
|
+
i(ee, {
|
|
1649
1650
|
"data-testid": "tags-collapse",
|
|
1650
1651
|
"trigger-alignment": "leading",
|
|
1651
1652
|
"trigger-label": t(l)("gateway_services.form.fields.tags.collapse")
|
|
1652
1653
|
}, {
|
|
1653
1654
|
default: n(() => [
|
|
1654
|
-
|
|
1655
|
-
i(
|
|
1655
|
+
P("div", oa, [
|
|
1656
|
+
i(b, {
|
|
1656
1657
|
modelValue: e.fields.tags,
|
|
1657
|
-
"onUpdate:modelValue": a[32] || (a[32] = (
|
|
1658
|
+
"onUpdate:modelValue": a[32] || (a[32] = (d) => e.fields.tags = d),
|
|
1658
1659
|
modelModifiers: { trim: !0 },
|
|
1659
1660
|
autocomplete: "off",
|
|
1660
1661
|
"data-testid": "gateway-service-tags-input",
|
|
@@ -1668,7 +1669,7 @@ const te = {
|
|
|
1668
1669
|
placeholder: t(l)("gateway_services.form.fields.tags.placeholder"),
|
|
1669
1670
|
readonly: e.isReadonly,
|
|
1670
1671
|
type: "text",
|
|
1671
|
-
onInput: a[33] || (a[33] = (
|
|
1672
|
+
onInput: a[33] || (a[33] = (d) => W("tags"))
|
|
1672
1673
|
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
|
|
1673
1674
|
])
|
|
1674
1675
|
]),
|
|
@@ -1677,14 +1678,14 @@ const te = {
|
|
|
1677
1678
|
]),
|
|
1678
1679
|
_: 1
|
|
1679
1680
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
1680
|
-
e.errorMessages.length ? (y(),
|
|
1681
|
+
e.errorMessages.length ? (y(), G(He, {
|
|
1681
1682
|
key: 0,
|
|
1682
1683
|
appearance: "danger",
|
|
1683
1684
|
"data-testid": "form-error"
|
|
1684
1685
|
}, {
|
|
1685
1686
|
default: n(() => [
|
|
1686
|
-
|
|
1687
|
-
(y(!0), V(
|
|
1687
|
+
P("ul", la, [
|
|
1688
|
+
(y(!0), V(Be, null, Ge(e.errorMessages, (d) => (y(), V("li", { key: d }, _(d), 1))), 128))
|
|
1688
1689
|
])
|
|
1689
1690
|
]),
|
|
1690
1691
|
_: 1
|
|
@@ -1695,15 +1696,15 @@ const te = {
|
|
|
1695
1696
|
]);
|
|
1696
1697
|
};
|
|
1697
1698
|
}
|
|
1698
|
-
}), _a = /* @__PURE__ */
|
|
1699
|
+
}), _a = /* @__PURE__ */ De(ra, [["__scopeId", "data-v-fac65b64"]]), { validateHost: ia, validatePort: na, validateProtocol: ca, validatePath: da } = te.useUrlValidators(), ha = () => ({
|
|
1699
1700
|
validateHost: ia,
|
|
1700
1701
|
validatePort: na,
|
|
1701
|
-
validateProtocol:
|
|
1702
|
-
validatePath:
|
|
1702
|
+
validateProtocol: ca,
|
|
1703
|
+
validatePath: da
|
|
1703
1704
|
});
|
|
1704
1705
|
export {
|
|
1705
1706
|
ya as GatewayServiceConfigCard,
|
|
1706
1707
|
_a as GatewayServiceForm,
|
|
1707
1708
|
ga as GatewayServiceList,
|
|
1708
|
-
|
|
1709
|
+
ha as useUrlValidator
|
|
1709
1710
|
};
|