@kong-ui-public/entities-gateway-services 3.28.2-pr.3869.e876c8c8a.0 → 3.28.2
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 +1947 -0
- package/dist/entities-gateway-services.umd.js +1 -0
- package/dist/style.css +1 -0
- package/dist/types/components/GatewayServiceConfigCard.vue.d.ts +63 -0
- package/dist/types/components/GatewayServiceConfigCard.vue.d.ts.map +1 -0
- package/dist/types/components/GatewayServiceForm.vue.d.ts +134 -0
- package/dist/types/components/GatewayServiceForm.vue.d.ts.map +1 -0
- package/dist/types/components/GatewayServiceFormTlsSansField.vue.d.ts +20 -0
- package/dist/types/components/GatewayServiceFormTlsSansField.vue.d.ts.map +1 -0
- package/dist/types/components/GatewayServiceList.vue.d.ts +155 -0
- package/dist/types/components/GatewayServiceList.vue.d.ts.map +1 -0
- package/dist/types/composables/getPortFromProtocol.d.ts +4 -0
- package/dist/types/composables/getPortFromProtocol.d.ts.map +1 -0
- package/dist/types/composables/index.d.ts +10 -0
- package/dist/types/composables/index.d.ts.map +1 -0
- package/dist/types/composables/useI18n.d.ts +9 -0
- package/dist/types/composables/useI18n.d.ts.map +1 -0
- package/dist/types/composables/useUrlValidators.d.ts +8 -0
- package/dist/types/composables/useUrlValidators.d.ts.map +1 -0
- package/dist/types/constants.d.ts +15 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/gateway-services-endpoints.d.ts +33 -0
- package/dist/types/gateway-services-endpoints.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types/gateway-service-config-card.d.ts +28 -0
- package/dist/types/types/gateway-service-config-card.d.ts.map +1 -0
- package/dist/types/types/gateway-service-form.d.ts +75 -0
- package/dist/types/types/gateway-service-form.d.ts.map +1 -0
- package/dist/types/types/gateway-service-list.d.ts +38 -0
- package/dist/types/types/gateway-service-list.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +4 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/urlValidator.d.ts +4 -0
- package/dist/types/utils/urlValidator.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,1947 @@
|
|
|
1
|
+
import { defineComponent as qe, computed as h, ref as x, watch as Ke, onBeforeMount as ht, resolveComponent as $, openBlock as p, createElementBlock as w, createVNode as c, unref as t, createSlots as Ie, withCtx as r, createTextVNode as P, toDisplayString as _, createBlock as D, createCommentVNode as F, createElementVNode as C, withModifiers as tt, Teleport as bt, Fragment as Fe, renderList as Le, reactive as ot, onMounted as wt, Transition as at, renderSlot as kt } from "vue";
|
|
2
|
+
import { useRouter as ft } from "vue-router";
|
|
3
|
+
import { BookIcon as rt, AddIcon as Ne, ServicesIcon as Ct, TrashIcon as St } from "@kong/icons";
|
|
4
|
+
import { createI18n as Vt, i18nTComponent as Et } from "@kong-ui-public/i18n";
|
|
5
|
+
import { useAxios as pt, useTableState as It, useManagedByColumn as Ft, useFetcher as Pt, useDeleteUrlBuilder as $t, FetcherStatus as Tt, EntityBaseTable as xt, PermissionsWrapper as pe, getManagedByLabel as Rt, TableTags as At, EntityFilter as Ut, EntityToggleModal as Dt, EntityDeleteModal as Bt, EntityTypes as Mt, useHelpers as mt, ConfigurationSchemaType as Kt, ConfigurationSchemaSection as Me, EntityBaseConfigCard as Lt, SupportedEntityType as gt, useErrors as Nt, useValidators as qt, useDebouncedFilter as nt, EntityBaseFormType as ct, useGatewayFeatureSupported as Wt, EntityBaseForm as Gt, EntityFormSection as dt } from "@kong-ui-public/entities-shared";
|
|
6
|
+
const Ot = { 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", related_entities: { plugins_only: "{pluginCount} associated {plugin} will be deleted along with this gateway service.", check_failed: "We couldn't verify whether this gateway service has routes or plugins attached. Check the box below to force delete it anyway.", plugin: "{count, plural, one {plugin} other {plugins}}", force_delete_checkbox: "Force delete", force_delete_help: "Check this box to force deletion of all routes and plugins on linked service.", force_delete_notice: "All routes must be deleted before this gateway service can be deleted. To delete the service and all its routes and plugins at once, select Force delete." } } }, jt = { placeholder: { konnect: "Filter by name", kongManager: "Filter by exact name or ID" } }, zt = { 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", select_placeholder: "Select a certificate", 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", select_placeholder: "Select CA certificates", 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" } } } }, Ht = { 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" }, Zt = { success: "Copied {val} to clipboard", success_brief: "Successfully copied to clipboard" }, Qt = { gateway_services: "gateway services" }, Jt = {
|
|
7
|
+
actions: Ot,
|
|
8
|
+
search: jt,
|
|
9
|
+
gateway_services: zt,
|
|
10
|
+
errors: Ht,
|
|
11
|
+
copy: Zt,
|
|
12
|
+
glossary: Qt
|
|
13
|
+
};
|
|
14
|
+
function Xt() {
|
|
15
|
+
const i = Vt("en-us", Jt);
|
|
16
|
+
return {
|
|
17
|
+
i18n: i,
|
|
18
|
+
i18nT: Et(i)
|
|
19
|
+
// Translation component <i18n-t>
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function Yt() {
|
|
23
|
+
return {
|
|
24
|
+
getPortFromProtocol: (K, m) => {
|
|
25
|
+
const d = [80, 443], o = Number(m);
|
|
26
|
+
if ((o || o === 0) && !d.includes(o))
|
|
27
|
+
return o;
|
|
28
|
+
switch (K) {
|
|
29
|
+
case "grpcs":
|
|
30
|
+
case "tls":
|
|
31
|
+
case "https":
|
|
32
|
+
case "wss":
|
|
33
|
+
return 443;
|
|
34
|
+
default:
|
|
35
|
+
return 80;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const ea = /^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*(\.)?$/, ta = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/, aa = (i) => /^[0-9A-Fa-f:.]+$/.test(i) && i.includes(":");
|
|
41
|
+
function sa() {
|
|
42
|
+
const { i18n: { t: i } } = oe.useI18n();
|
|
43
|
+
return {
|
|
44
|
+
validateHost: (v) => {
|
|
45
|
+
if (!v || v.trim() === "") return i("gateway_services.form.errors.host.empty");
|
|
46
|
+
try {
|
|
47
|
+
if (aa(v))
|
|
48
|
+
return new URL("/", `https://[${v}]`), "";
|
|
49
|
+
if (ea.test(v) || ta.test(v))
|
|
50
|
+
return new URL("/", `https://${v}`), "";
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
return i("gateway_services.form.errors.host.invalid");
|
|
54
|
+
},
|
|
55
|
+
validateProtocol: (v, U) => !v || v.trim() === "" ? i("gateway_services.form.errors.protocol.empty") : (v = v.slice(0, -1), U.find((l) => {
|
|
56
|
+
if (l.value === v) return l;
|
|
57
|
+
}) === void 0 ? i("gateway_services.form.errors.protocol.invalid") : ""),
|
|
58
|
+
validatePath: (v) => !v || v === "" ? "" : v.startsWith("/") ? /[^A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]/.test(v) ? i("gateway_services.form.errors.path.invalid") : "" : i("gateway_services.form.errors.path.prefix"),
|
|
59
|
+
validatePort: (v) => {
|
|
60
|
+
if (v == null || v === "")
|
|
61
|
+
return "";
|
|
62
|
+
const U = typeof v == "string" ? parseInt(v, 10) : v;
|
|
63
|
+
return isNaN(U) ? i("gateway_services.form.errors.port.type") : U < 0 || U > 65535 ? i("gateway_services.form.errors.port.invalid") : "";
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const oe = {
|
|
68
|
+
useI18n: Xt,
|
|
69
|
+
usePortFromProtocol: Yt,
|
|
70
|
+
useUrlValidators: sa
|
|
71
|
+
}, X = "/v2/control-planes/{controlPlaneId}/core-entities/{workspace}", Ee = "/{workspace}", Z = {
|
|
72
|
+
list: {
|
|
73
|
+
konnect: {
|
|
74
|
+
all: `${X}/services`,
|
|
75
|
+
search: `${X}/services/search`
|
|
76
|
+
},
|
|
77
|
+
kongManager: {
|
|
78
|
+
all: `${Ee}/services`
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
form: {
|
|
82
|
+
konnect: {
|
|
83
|
+
create: `${X}/services`,
|
|
84
|
+
edit: `${X}/services/{id}`,
|
|
85
|
+
getCertificates: `${X}/certificates`,
|
|
86
|
+
getCaCertificates: `${X}/ca_certificates`
|
|
87
|
+
},
|
|
88
|
+
kongManager: {
|
|
89
|
+
create: `${Ee}/services`,
|
|
90
|
+
edit: `${Ee}/services/{id}`,
|
|
91
|
+
getCertificates: `${Ee}/certificates`,
|
|
92
|
+
getCaCertificates: `${Ee}/ca_certificates`
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
relatedEntities: {
|
|
96
|
+
konnect: {
|
|
97
|
+
routes: `${X}/services/{id}/routes`,
|
|
98
|
+
plugins: `${X}/services/{id}/plugins`
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}, la = { class: "kong-ui-entities-gateway-services-list" }, ia = { class: "button-row" }, oa = { key: 1 }, ra = { key: 0 }, na = {
|
|
102
|
+
key: 1,
|
|
103
|
+
class: "force-delete-notice"
|
|
104
|
+
}, ca = 1e3, da = /* @__PURE__ */ qe({
|
|
105
|
+
__name: "GatewayServiceList",
|
|
106
|
+
props: {
|
|
107
|
+
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
108
|
+
config: {
|
|
109
|
+
type: Object,
|
|
110
|
+
required: !0,
|
|
111
|
+
validator: (i) => !(!i || !["konnect", "kongManager"].includes(i?.app) || !i.createRoute || !i.getViewRoute || !i.getEditRoute || i.app === "kongManager" && !i.isExactMatch && !i.filterSchema)
|
|
112
|
+
},
|
|
113
|
+
// used to override the default identifier for the cache entry
|
|
114
|
+
cacheIdentifier: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: ""
|
|
117
|
+
},
|
|
118
|
+
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can create a new entity */
|
|
119
|
+
canCreate: {
|
|
120
|
+
type: Function,
|
|
121
|
+
required: !1,
|
|
122
|
+
default: async () => !0
|
|
123
|
+
},
|
|
124
|
+
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can delete a given entity */
|
|
125
|
+
canDelete: {
|
|
126
|
+
type: Function,
|
|
127
|
+
required: !1,
|
|
128
|
+
default: async () => !0
|
|
129
|
+
},
|
|
130
|
+
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can edit a given entity */
|
|
131
|
+
canEdit: {
|
|
132
|
+
type: Function,
|
|
133
|
+
required: !1,
|
|
134
|
+
default: async () => !0
|
|
135
|
+
},
|
|
136
|
+
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can retrieve (view details) a given entity */
|
|
137
|
+
canRetrieve: {
|
|
138
|
+
type: Function,
|
|
139
|
+
required: !1,
|
|
140
|
+
default: async () => !0
|
|
141
|
+
},
|
|
142
|
+
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can start debugger session on a given entity */
|
|
143
|
+
canDebug: {
|
|
144
|
+
type: Function,
|
|
145
|
+
required: !1,
|
|
146
|
+
default: async () => !1
|
|
147
|
+
},
|
|
148
|
+
/** default to false, setting to true will teleport the toolbar button to the destination in the consuming app */
|
|
149
|
+
useActionOutside: {
|
|
150
|
+
type: Boolean,
|
|
151
|
+
default: !1
|
|
152
|
+
},
|
|
153
|
+
/** user is onboarding, use onboarding text */
|
|
154
|
+
isServerless: {
|
|
155
|
+
type: Boolean,
|
|
156
|
+
default: !1
|
|
157
|
+
},
|
|
158
|
+
canImportSpecs: {
|
|
159
|
+
type: Boolean,
|
|
160
|
+
default: !1
|
|
161
|
+
},
|
|
162
|
+
/** Feature flag KM-3028-service-force-delete: when enabled, checks for attached routes/plugins before deleting a Konnect gateway service and requires a force-delete confirmation if any are found */
|
|
163
|
+
enableForceDeleteConfirmation: {
|
|
164
|
+
type: Boolean,
|
|
165
|
+
default: !1
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success", "click:import"],
|
|
169
|
+
setup(i, { emit: K }) {
|
|
170
|
+
const m = K, d = i, { i18n: { t: o, formatUnixTimeStamp: v } } = oe.useI18n(), U = ft(), { axiosInstance: R } = pt(d.config?.axiosRequestConfig), { hasRecords: l, handleStateChange: A } = It(() => W.value), T = h(() => l.value && d.config.app === "konnect"), Y = h(() => d.config.app !== "kongManager" || !!d.config.disableSorting), re = {
|
|
171
|
+
// the Name column is non-hidable
|
|
172
|
+
name: { label: o("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
173
|
+
...d.config.showControlPlaneColumn ? { control_plane: { label: o("gateway_services.list.table_headers.control_plane") } } : {},
|
|
174
|
+
protocol: { label: o("gateway_services.list.table_headers.protocol"), searchable: !0, sortable: !0 },
|
|
175
|
+
host: { label: o("gateway_services.list.table_headers.host"), searchable: !0, sortable: !0 },
|
|
176
|
+
port: { label: o("gateway_services.list.table_headers.port"), searchable: !0, sortable: !0 },
|
|
177
|
+
path: { label: o("gateway_services.list.table_headers.path"), searchable: !0, sortable: !0 },
|
|
178
|
+
enabled: { label: o("gateway_services.list.table_headers.enabled"), searchable: !0, sortable: !0 },
|
|
179
|
+
tags: { label: o("gateway_services.list.table_headers.tags"), sortable: !1 },
|
|
180
|
+
updated_at: { label: o("gateway_services.list.table_headers.updated_at"), sortable: !0 },
|
|
181
|
+
created_at: { label: o("gateway_services.list.table_headers.created_at"), sortable: !0 }
|
|
182
|
+
}, { defaultTablePreferences: N, tableHeaders: ee } = Ft(re, { created_at: !1 }), me = (f) => {
|
|
183
|
+
let y = `${d.config.apiBaseUrl}${f}`;
|
|
184
|
+
return d.config.app === "konnect" && (y = y.replace(/{controlPlaneId}/gi, d.config?.controlPlaneId || "")), y.replace(/\/{workspace}/gi, d.config?.workspace ? `/${d.config.workspace}` : "");
|
|
185
|
+
}, ne = h(() => me(Z.list[d.config.app].all)), We = h(() => d.config.app === "konnect" && d.config.workspace && W.value ? me(Z.list.konnect.search) : ne.value), Ge = h(() => d.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${ne.value}`) : new URL(ne.value)), W = x(""), Pe = h(() => {
|
|
186
|
+
const f = d.config.app === "konnect" || d.config.isExactMatch;
|
|
187
|
+
if (f)
|
|
188
|
+
return {
|
|
189
|
+
isExactMatch: f,
|
|
190
|
+
placeholder: o(`search.placeholder.${d.config.app}`)
|
|
191
|
+
};
|
|
192
|
+
const { name: y, enabled: V, protocol: I, host: H, port: L, path: ke } = re;
|
|
193
|
+
return {
|
|
194
|
+
isExactMatch: f,
|
|
195
|
+
fields: { name: y, enabled: V, protocol: I, host: H, port: L, path: ke },
|
|
196
|
+
schema: d.config.filterSchema
|
|
197
|
+
};
|
|
198
|
+
}), {
|
|
199
|
+
fetcher: Oe,
|
|
200
|
+
fetcherState: $e,
|
|
201
|
+
fetcherCacheKey: ge
|
|
202
|
+
} = Pt(h(() => ({ ...d.config, cacheIdentifier: d.cacheIdentifier })), We), je = () => {
|
|
203
|
+
W.value = "";
|
|
204
|
+
}, ze = () => {
|
|
205
|
+
ge.value++;
|
|
206
|
+
}, ce = x(null), ve = h(() => ({
|
|
207
|
+
ctaPath: d.config.createRoute,
|
|
208
|
+
ctaText: z.value ? d.isServerless ? o("actions.serverless_create") : o("actions.create") : void 0,
|
|
209
|
+
message: `${o("gateway_services.list.empty_state.description")}${d.config.additionMessageForEmptyState ? ` ${d.config.additionMessageForEmptyState}` : ""}`,
|
|
210
|
+
title: z.value ? d.isServerless ? o("gateway_services.list.empty_state.serverless_title") : o("gateway_services.list.empty_state.title") : o("gateway_services.title")
|
|
211
|
+
})), ye = x(!1), B = x(null), G = h(() => {
|
|
212
|
+
const f = {
|
|
213
|
+
action: "disable",
|
|
214
|
+
id: "",
|
|
215
|
+
name: ""
|
|
216
|
+
};
|
|
217
|
+
if (B.value) {
|
|
218
|
+
const { enabled: y, id: V, name: I } = B.value;
|
|
219
|
+
f.action = y ? "disable" : "enable", f.id = V, f.name = I || V;
|
|
220
|
+
}
|
|
221
|
+
return f;
|
|
222
|
+
}), _e = (f) => {
|
|
223
|
+
ye.value = !0, B.value = f;
|
|
224
|
+
}, Te = () => {
|
|
225
|
+
ye.value = !1, B.value = null;
|
|
226
|
+
}, He = async () => {
|
|
227
|
+
if (!await d.canEdit?.(B.value) || !B.value)
|
|
228
|
+
return;
|
|
229
|
+
const y = `${Ge.value.href}/${B.value.id}`, V = !B.value.enabled;
|
|
230
|
+
try {
|
|
231
|
+
const I = d.config?.app;
|
|
232
|
+
let H;
|
|
233
|
+
W.value && I === "konnect" && (H = await R.get(y));
|
|
234
|
+
const { data: L } = I === "konnect" ? await R.put(y, { ...H?.data || B.value, enabled: V }) : await R.patch(y, { ...B.value, enabled: V });
|
|
235
|
+
m("toggle:success", L), B.value.enabled = V;
|
|
236
|
+
} catch (I) {
|
|
237
|
+
m("error", I);
|
|
238
|
+
}
|
|
239
|
+
}, he = (f) => {
|
|
240
|
+
d.config.getControlPlaneRoute && U.push(d.config.getControlPlaneRoute(f));
|
|
241
|
+
}, Ze = async (f, y) => {
|
|
242
|
+
const V = f.id;
|
|
243
|
+
if (!await y(V)) {
|
|
244
|
+
m("copy:error", {
|
|
245
|
+
entity: f,
|
|
246
|
+
field: "id",
|
|
247
|
+
message: o("errors.copy")
|
|
248
|
+
});
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
m("copy:success", {
|
|
252
|
+
entity: f,
|
|
253
|
+
field: "id",
|
|
254
|
+
message: o("copy.success", { val: V })
|
|
255
|
+
});
|
|
256
|
+
}, xe = async (f, y) => {
|
|
257
|
+
const V = JSON.stringify(f);
|
|
258
|
+
if (!await y(V)) {
|
|
259
|
+
m("copy:error", {
|
|
260
|
+
entity: f,
|
|
261
|
+
message: o("errors.copy")
|
|
262
|
+
});
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
m("copy:success", {
|
|
266
|
+
entity: f,
|
|
267
|
+
message: o("copy.success_brief")
|
|
268
|
+
});
|
|
269
|
+
}, Qe = async (f) => {
|
|
270
|
+
await d.canRetrieve?.(f) && U.push(d.config.getViewRoute(f.id));
|
|
271
|
+
}, te = (f) => ({
|
|
272
|
+
label: o("actions.view"),
|
|
273
|
+
to: d.config.getViewRoute(f)
|
|
274
|
+
}), Je = (f) => ({
|
|
275
|
+
label: o("actions.edit"),
|
|
276
|
+
to: d.config.getEditRoute(f)
|
|
277
|
+
}), ae = (f) => {
|
|
278
|
+
if (d.config.getDebugRoute)
|
|
279
|
+
return {
|
|
280
|
+
label: o("actions.debugger"),
|
|
281
|
+
to: d.config.getDebugRoute(f)
|
|
282
|
+
};
|
|
283
|
+
}, S = x(void 0), se = x(!1), le = x(!1), be = x(""), e = $t(d.config, ne.value), b = x(0), de = x(0), ie = x(!1), O = x(!1), Xe = h(() => d.enableForceDeleteConfirmation && (O.value || b.value > 0 || de.value > 0)), Q = h(() => d.enableForceDeleteConfirmation && (O.value || b.value > 0)), Re = h(() => d.config.app === "kongManager" ? o("actions.delete.description") : ""), Ae = h(() => {
|
|
284
|
+
if (O.value)
|
|
285
|
+
return o("actions.delete.related_entities.check_failed");
|
|
286
|
+
const f = de.value;
|
|
287
|
+
return o("actions.delete.related_entities.plugins_only", {
|
|
288
|
+
pluginCount: f,
|
|
289
|
+
plugin: o("actions.delete.related_entities.plugin", { count: f })
|
|
290
|
+
});
|
|
291
|
+
}), we = async (f, y) => {
|
|
292
|
+
const V = me(f).replace(/{id}/gi, y), { data: I } = await R.get(V, { params: { size: ca } });
|
|
293
|
+
return I?.total ?? I?.data?.length ?? 0;
|
|
294
|
+
}, Ue = async (f) => {
|
|
295
|
+
if (S.value = f, be.value = "", ie.value = !1, b.value = 0, de.value = 0, O.value = !1, d.enableForceDeleteConfirmation && d.config.app === "konnect")
|
|
296
|
+
try {
|
|
297
|
+
const [y, V] = await Promise.all([
|
|
298
|
+
we(Z.relatedEntities.konnect.routes, f.id),
|
|
299
|
+
we(Z.relatedEntities.konnect.plugins, f.id)
|
|
300
|
+
]);
|
|
301
|
+
b.value = y, de.value = V;
|
|
302
|
+
} catch {
|
|
303
|
+
O.value = !0;
|
|
304
|
+
}
|
|
305
|
+
se.value = !0;
|
|
306
|
+
}, j = () => {
|
|
307
|
+
se.value = !1, S.value = void 0;
|
|
308
|
+
}, Ye = async () => {
|
|
309
|
+
if (S.value?.id) {
|
|
310
|
+
le.value = !0;
|
|
311
|
+
try {
|
|
312
|
+
await R.delete(e(S.value.id), {
|
|
313
|
+
// Only ever send force=true when the user has explicitly confirmed it via the checkbox,
|
|
314
|
+
// not merely because routes/plugins were detected
|
|
315
|
+
...ie.value ? { params: { force: !0 } } : {}
|
|
316
|
+
}), m("delete:success", S.value), j(), ge.value++;
|
|
317
|
+
} catch (f) {
|
|
318
|
+
be.value = f.response?.data?.message || f.message || o("errors.delete"), m("error", f);
|
|
319
|
+
} finally {
|
|
320
|
+
le.value = !1;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}, J = () => {
|
|
324
|
+
U.push(d.config.createRoute);
|
|
325
|
+
};
|
|
326
|
+
Ke($e, (f) => {
|
|
327
|
+
if (f.status === Tt.Error) {
|
|
328
|
+
ce.value = {
|
|
329
|
+
title: o("errors.general")
|
|
330
|
+
}, f.error?.response?.data?.message && (ce.value.message = f.error.response.data.message), m("error", f.error);
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
ce.value = null;
|
|
334
|
+
});
|
|
335
|
+
const z = x(!1);
|
|
336
|
+
return ht(async () => {
|
|
337
|
+
z.value = await d.canCreate();
|
|
338
|
+
}), (f, y) => {
|
|
339
|
+
const V = $("KButton"), I = $("KDropdownItem"), H = $("KDropdown"), L = $("KEmptyState"), ke = $("KBadge"), De = $("KInputSwitch"), ue = $("KClipboardProvider"), Be = $("KCheckbox");
|
|
340
|
+
return p(), w("div", la, [
|
|
341
|
+
c(t(xt), {
|
|
342
|
+
"cache-identifier": i.cacheIdentifier,
|
|
343
|
+
"default-table-preferences": t(N),
|
|
344
|
+
"disable-sorting": Y.value,
|
|
345
|
+
"empty-state-options": ve.value,
|
|
346
|
+
"enable-entity-actions": "",
|
|
347
|
+
"error-message": ce.value,
|
|
348
|
+
fetcher: t(Oe),
|
|
349
|
+
"fetcher-cache-key": t(ge),
|
|
350
|
+
"pagination-type": "offset",
|
|
351
|
+
"preferences-storage-key": "kong-ui-entities-gateway-services-list",
|
|
352
|
+
query: W.value,
|
|
353
|
+
"table-headers": t(ee),
|
|
354
|
+
onClearSearchInput: je,
|
|
355
|
+
"onClick:row": y[5] || (y[5] = (g) => Qe(g)),
|
|
356
|
+
onSort: ze,
|
|
357
|
+
onState: t(A)
|
|
358
|
+
}, Ie({
|
|
359
|
+
"toolbar-filter": r(() => [
|
|
360
|
+
c(t(Ut), {
|
|
361
|
+
modelValue: W.value,
|
|
362
|
+
"onUpdate:modelValue": y[0] || (y[0] = (g) => W.value = g),
|
|
363
|
+
config: Pe.value
|
|
364
|
+
}, null, 8, ["modelValue", "config"])
|
|
365
|
+
]),
|
|
366
|
+
"toolbar-button": r(() => [
|
|
367
|
+
(p(), D(bt, {
|
|
368
|
+
disabled: !i.useActionOutside,
|
|
369
|
+
to: "#kong-ui-app-page-header-action-button"
|
|
370
|
+
}, [
|
|
371
|
+
C("div", ia, [
|
|
372
|
+
T.value ? (p(), D(V, {
|
|
373
|
+
key: 0,
|
|
374
|
+
appearance: "secondary",
|
|
375
|
+
class: "open-learning-hub",
|
|
376
|
+
"data-testid": "gateway-services-learn-more-button",
|
|
377
|
+
icon: "",
|
|
378
|
+
onClick: y[1] || (y[1] = (g) => f.$emit("click:learn-more"))
|
|
379
|
+
}, {
|
|
380
|
+
default: r(() => [
|
|
381
|
+
c(t(rt), { decorative: "" })
|
|
382
|
+
]),
|
|
383
|
+
_: 1
|
|
384
|
+
})) : F("", !0),
|
|
385
|
+
c(t(pe), { "auth-function": i.canCreate }, {
|
|
386
|
+
default: r(() => [
|
|
387
|
+
c(V, {
|
|
388
|
+
appearance: "primary",
|
|
389
|
+
"data-testid": "toolbar-add-gateway-service",
|
|
390
|
+
size: i.useActionOutside ? "medium" : "large",
|
|
391
|
+
to: i.config.createRoute
|
|
392
|
+
}, {
|
|
393
|
+
default: r(() => [
|
|
394
|
+
c(t(Ne)),
|
|
395
|
+
P(" " + _(t(o)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
|
|
396
|
+
]),
|
|
397
|
+
_: 1
|
|
398
|
+
}, 8, ["size", "to"])
|
|
399
|
+
]),
|
|
400
|
+
_: 1
|
|
401
|
+
}, 8, ["auth-function"])
|
|
402
|
+
])
|
|
403
|
+
], 8, ["disabled"]))
|
|
404
|
+
]),
|
|
405
|
+
name: r(({ rowValue: g }) => [
|
|
406
|
+
C("b", null, _(g ?? "-"), 1)
|
|
407
|
+
]),
|
|
408
|
+
control_plane: r(({ row: g }) => [
|
|
409
|
+
g.x_meta?.cluster_id ? (p(), D(ke, {
|
|
410
|
+
key: 0,
|
|
411
|
+
tooltip: g.x_meta.cluster_id,
|
|
412
|
+
"truncation-tooltip": "",
|
|
413
|
+
onClick: tt((M) => he(g.x_meta.cluster_id), ["stop"])
|
|
414
|
+
}, {
|
|
415
|
+
default: r(() => [
|
|
416
|
+
P(_(g.x_meta.cluster_id), 1)
|
|
417
|
+
]),
|
|
418
|
+
_: 2
|
|
419
|
+
}, 1032, ["tooltip", "onClick"])) : (p(), w("b", oa, "-"))
|
|
420
|
+
]),
|
|
421
|
+
enabled: r(({ row: g }) => [
|
|
422
|
+
c(t(pe), {
|
|
423
|
+
"auth-function": () => i.canEdit(g),
|
|
424
|
+
"force-show": ""
|
|
425
|
+
}, {
|
|
426
|
+
default: r(({ isAllowed: M }) => [
|
|
427
|
+
C("div", {
|
|
428
|
+
onClick: y[4] || (y[4] = tt(() => {
|
|
429
|
+
}, ["stop"]))
|
|
430
|
+
}, [
|
|
431
|
+
c(De, {
|
|
432
|
+
modelValue: g.enabled,
|
|
433
|
+
"onUpdate:modelValue": (fe) => g.enabled = fe,
|
|
434
|
+
"data-testid": `row-${g.id}-toggle-input`,
|
|
435
|
+
disabled: !M,
|
|
436
|
+
onClick: tt((fe) => _e(g), ["prevent"])
|
|
437
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "disabled", "onClick"])
|
|
438
|
+
])
|
|
439
|
+
]),
|
|
440
|
+
_: 2
|
|
441
|
+
}, 1032, ["auth-function"])
|
|
442
|
+
]),
|
|
443
|
+
tags: r(({ rowValue: g }) => [
|
|
444
|
+
c(t(At), { tags: g }, null, 8, ["tags"])
|
|
445
|
+
]),
|
|
446
|
+
created_at: r(({ rowValue: g }) => [
|
|
447
|
+
P(_(t(v)(g)), 1)
|
|
448
|
+
]),
|
|
449
|
+
updated_at: r(({ row: g, rowValue: M }) => [
|
|
450
|
+
P(_(t(v)(M ?? g.created_at)), 1)
|
|
451
|
+
]),
|
|
452
|
+
managed_by: r(({ rowValue: g }) => [
|
|
453
|
+
P(_(t(Rt)(g) ?? "-"), 1)
|
|
454
|
+
]),
|
|
455
|
+
actions: r(({ row: g }) => [
|
|
456
|
+
c(ue, null, {
|
|
457
|
+
default: r(({ copyToClipboard: M }) => [
|
|
458
|
+
c(I, {
|
|
459
|
+
"data-testid": "action-entity-copy-id",
|
|
460
|
+
onClick: (fe) => Ze(g, M)
|
|
461
|
+
}, {
|
|
462
|
+
default: r(() => [
|
|
463
|
+
P(_(t(o)("actions.copy_id")), 1)
|
|
464
|
+
]),
|
|
465
|
+
_: 1
|
|
466
|
+
}, 8, ["onClick"])
|
|
467
|
+
]),
|
|
468
|
+
_: 2
|
|
469
|
+
}, 1024),
|
|
470
|
+
c(ue, null, {
|
|
471
|
+
default: r(({ copyToClipboard: M }) => [
|
|
472
|
+
c(I, {
|
|
473
|
+
"data-testid": "action-entity-copy-json",
|
|
474
|
+
onClick: (fe) => xe(g, M)
|
|
475
|
+
}, {
|
|
476
|
+
default: r(() => [
|
|
477
|
+
P(_(t(o)("actions.copy_json")), 1)
|
|
478
|
+
]),
|
|
479
|
+
_: 1
|
|
480
|
+
}, 8, ["onClick"])
|
|
481
|
+
]),
|
|
482
|
+
_: 2
|
|
483
|
+
}, 1024),
|
|
484
|
+
c(t(pe), {
|
|
485
|
+
"auth-function": () => i.canRetrieve(g)
|
|
486
|
+
}, {
|
|
487
|
+
default: r(() => [
|
|
488
|
+
c(I, {
|
|
489
|
+
"data-testid": "action-entity-view",
|
|
490
|
+
"has-divider": "",
|
|
491
|
+
item: te(g.id)
|
|
492
|
+
}, null, 8, ["item"])
|
|
493
|
+
]),
|
|
494
|
+
_: 2
|
|
495
|
+
}, 1032, ["auth-function"]),
|
|
496
|
+
c(t(pe), {
|
|
497
|
+
"auth-function": () => i.canDebug(g)
|
|
498
|
+
}, {
|
|
499
|
+
default: r(() => [
|
|
500
|
+
i.config.getDebugRoute ? (p(), D(I, {
|
|
501
|
+
key: 0,
|
|
502
|
+
"data-testid": "action-entity-debug",
|
|
503
|
+
item: ae(g.id)
|
|
504
|
+
}, null, 8, ["item"])) : F("", !0)
|
|
505
|
+
]),
|
|
506
|
+
_: 2
|
|
507
|
+
}, 1032, ["auth-function"]),
|
|
508
|
+
c(t(pe), {
|
|
509
|
+
"auth-function": () => i.canEdit(g)
|
|
510
|
+
}, {
|
|
511
|
+
default: r(() => [
|
|
512
|
+
c(I, {
|
|
513
|
+
"data-testid": "action-entity-edit",
|
|
514
|
+
item: Je(g.id)
|
|
515
|
+
}, null, 8, ["item"])
|
|
516
|
+
]),
|
|
517
|
+
_: 2
|
|
518
|
+
}, 1032, ["auth-function"]),
|
|
519
|
+
c(t(pe), {
|
|
520
|
+
"auth-function": () => i.canDelete(g)
|
|
521
|
+
}, {
|
|
522
|
+
default: r(() => [
|
|
523
|
+
c(I, {
|
|
524
|
+
danger: "",
|
|
525
|
+
"data-testid": "action-entity-delete",
|
|
526
|
+
"has-divider": "",
|
|
527
|
+
onClick: (M) => Ue(g)
|
|
528
|
+
}, {
|
|
529
|
+
default: r(() => [
|
|
530
|
+
P(_(t(o)("actions.delete.menu_label")), 1)
|
|
531
|
+
]),
|
|
532
|
+
_: 1
|
|
533
|
+
}, 8, ["onClick"])
|
|
534
|
+
]),
|
|
535
|
+
_: 2
|
|
536
|
+
}, 1032, ["auth-function"])
|
|
537
|
+
]),
|
|
538
|
+
_: 2
|
|
539
|
+
}, [
|
|
540
|
+
!W.value && i.config.app === "konnect" ? {
|
|
541
|
+
name: "empty-state",
|
|
542
|
+
fn: r(() => [
|
|
543
|
+
c(L, {
|
|
544
|
+
"data-testid": "gateway-services-entity-empty-state",
|
|
545
|
+
"icon-background": "",
|
|
546
|
+
message: t(o)("gateway_services.empty_state_v2.description"),
|
|
547
|
+
title: t(o)("gateway_services.empty_state_v2.title")
|
|
548
|
+
}, Ie({
|
|
549
|
+
icon: r(() => [
|
|
550
|
+
c(t(Ct), { decorative: "" })
|
|
551
|
+
]),
|
|
552
|
+
action: r(() => [
|
|
553
|
+
z.value ? (p(), w(Fe, { key: 0 }, [
|
|
554
|
+
i.canImportSpecs ? (p(), D(H, {
|
|
555
|
+
key: 0,
|
|
556
|
+
"data-testid": "entity-create-dropdown",
|
|
557
|
+
"show-caret": "",
|
|
558
|
+
"trigger-text": t(o)("gateway_services.empty_state_v2.create"),
|
|
559
|
+
width: "220"
|
|
560
|
+
}, {
|
|
561
|
+
items: r(() => [
|
|
562
|
+
c(I, {
|
|
563
|
+
"data-testid": "entity-create-dropdown-item",
|
|
564
|
+
onClick: J
|
|
565
|
+
}, {
|
|
566
|
+
default: r(() => [
|
|
567
|
+
P(_(t(o)("gateway_services.empty_state_v2.create_new")), 1)
|
|
568
|
+
]),
|
|
569
|
+
_: 1
|
|
570
|
+
}),
|
|
571
|
+
c(I, {
|
|
572
|
+
"data-testid": "entity-import-dropdown-item",
|
|
573
|
+
onClick: y[2] || (y[2] = (g) => f.$emit("click:import"))
|
|
574
|
+
}, {
|
|
575
|
+
default: r(() => [
|
|
576
|
+
P(_(t(o)("gateway_services.empty_state_v2.import_spec")), 1)
|
|
577
|
+
]),
|
|
578
|
+
_: 1
|
|
579
|
+
})
|
|
580
|
+
]),
|
|
581
|
+
_: 1
|
|
582
|
+
}, 8, ["trigger-text"])) : (p(), D(V, {
|
|
583
|
+
key: 1,
|
|
584
|
+
"data-testid": "entity-create-button",
|
|
585
|
+
onClick: J
|
|
586
|
+
}, {
|
|
587
|
+
default: r(() => [
|
|
588
|
+
c(t(Ne), { decorative: "" }),
|
|
589
|
+
P(" " + _(t(o)("gateway_services.empty_state_v2.create")), 1)
|
|
590
|
+
]),
|
|
591
|
+
_: 1
|
|
592
|
+
}))
|
|
593
|
+
], 64)) : F("", !0),
|
|
594
|
+
c(V, {
|
|
595
|
+
appearance: "secondary",
|
|
596
|
+
"data-testid": "entity-learn-more-button",
|
|
597
|
+
onClick: y[3] || (y[3] = (g) => f.$emit("click:learn-more"))
|
|
598
|
+
}, {
|
|
599
|
+
default: r(() => [
|
|
600
|
+
c(t(rt), { decorative: "" }),
|
|
601
|
+
P(" " + _(t(o)("gateway_services.empty_state_v2.learn_more")), 1)
|
|
602
|
+
]),
|
|
603
|
+
_: 1
|
|
604
|
+
})
|
|
605
|
+
]),
|
|
606
|
+
_: 2
|
|
607
|
+
}, [
|
|
608
|
+
i.config?.isControlPlaneGroup ? {
|
|
609
|
+
name: "default",
|
|
610
|
+
fn: r(() => [
|
|
611
|
+
P(_(t(o)("gateway_services.empty_state_v2.group")), 1)
|
|
612
|
+
]),
|
|
613
|
+
key: "0"
|
|
614
|
+
} : void 0
|
|
615
|
+
]), 1032, ["message", "title"])
|
|
616
|
+
]),
|
|
617
|
+
key: "0"
|
|
618
|
+
} : void 0
|
|
619
|
+
]), 1032, ["cache-identifier", "default-table-preferences", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
|
|
620
|
+
c(t(Dt), {
|
|
621
|
+
action: G.value.action,
|
|
622
|
+
"entity-id": G.value.id,
|
|
623
|
+
"entity-name": G.value.name,
|
|
624
|
+
"entity-type": t(o)("glossary.gateway_services"),
|
|
625
|
+
"on-confirm": He,
|
|
626
|
+
visible: ye.value,
|
|
627
|
+
onCancel: Te,
|
|
628
|
+
onProceed: Te
|
|
629
|
+
}, null, 8, ["action", "entity-id", "entity-name", "entity-type", "visible"]),
|
|
630
|
+
c(t(Bt), {
|
|
631
|
+
"action-pending": le.value,
|
|
632
|
+
description: Re.value,
|
|
633
|
+
"entity-name": S.value && (S.value.name || S.value.id),
|
|
634
|
+
"entity-type": t(Mt).GatewayService,
|
|
635
|
+
error: be.value,
|
|
636
|
+
title: t(o)("actions.delete.title"),
|
|
637
|
+
visible: se.value,
|
|
638
|
+
onCancel: j,
|
|
639
|
+
onProceed: Ye
|
|
640
|
+
}, Ie({ _: 2 }, [
|
|
641
|
+
Xe.value ? {
|
|
642
|
+
name: "extra",
|
|
643
|
+
fn: r(() => [
|
|
644
|
+
O.value || !Q.value ? (p(), w("p", ra, _(Ae.value), 1)) : (p(), w("p", na, _(t(o)("actions.delete.related_entities.force_delete_notice")), 1)),
|
|
645
|
+
Q.value ? (p(), D(Be, {
|
|
646
|
+
key: 2,
|
|
647
|
+
modelValue: ie.value,
|
|
648
|
+
"onUpdate:modelValue": y[6] || (y[6] = (g) => ie.value = g),
|
|
649
|
+
"data-testid": "gateway-service-delete-force-checkbox",
|
|
650
|
+
description: t(o)("actions.delete.related_entities.force_delete_help"),
|
|
651
|
+
label: t(o)("actions.delete.related_entities.force_delete_checkbox")
|
|
652
|
+
}, null, 8, ["modelValue", "description", "label"])) : F("", !0)
|
|
653
|
+
]),
|
|
654
|
+
key: "0"
|
|
655
|
+
} : void 0
|
|
656
|
+
]), 1032, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
657
|
+
]);
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
}), st = (i, K) => {
|
|
661
|
+
const m = i.__vccOpts || i;
|
|
662
|
+
for (const [d, o] of K)
|
|
663
|
+
m[d] = o;
|
|
664
|
+
return m;
|
|
665
|
+
}, Ya = /* @__PURE__ */ st(da, [["__scopeId", "data-v-d2a76c1f"]]), ua = { class: "kong-ui-gateway-service-entity-config-card" }, es = /* @__PURE__ */ qe({
|
|
666
|
+
__name: "GatewayServiceConfigCard",
|
|
667
|
+
props: {
|
|
668
|
+
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
669
|
+
config: {
|
|
670
|
+
type: Object,
|
|
671
|
+
required: !0,
|
|
672
|
+
validator: (i) => !(!i || !["konnect", "kongManager"].includes(i?.app) || i.app === "konnect" && !i.controlPlaneId || i.app === "kongManager" && typeof i.workspace != "string" || !i.entityId)
|
|
673
|
+
},
|
|
674
|
+
/**
|
|
675
|
+
* External link for documentation that determines visibility of Documentation button
|
|
676
|
+
*/
|
|
677
|
+
configCardDoc: {
|
|
678
|
+
type: String,
|
|
679
|
+
default: "",
|
|
680
|
+
required: !1
|
|
681
|
+
},
|
|
682
|
+
/**
|
|
683
|
+
* Control visibility of card title content
|
|
684
|
+
*/
|
|
685
|
+
hideTitle: {
|
|
686
|
+
type: Boolean,
|
|
687
|
+
default: !1
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
emits: ["loading", "fetch:error", "fetch:success"],
|
|
691
|
+
setup(i) {
|
|
692
|
+
const K = i, { i18n: { t: m }, i18nT: d } = oe.useI18n(), o = h(() => Z.form[K.config.app].edit), { getPropValue: v } = mt(), U = (l, A) => v(l, A) === !0 ? m("gateway_services.form.fields.tls_verify_option.true.display") : m("gateway_services.form.fields.tls_verify_option.false.display"), R = x({
|
|
693
|
+
id: {},
|
|
694
|
+
name: {
|
|
695
|
+
tooltip: m("gateway_services.form.fields.name.tooltip")
|
|
696
|
+
},
|
|
697
|
+
enabled: {},
|
|
698
|
+
updated_at: {},
|
|
699
|
+
created_at: {},
|
|
700
|
+
protocol: {
|
|
701
|
+
section: Me.Basic,
|
|
702
|
+
tooltip: m("gateway_services.form.fields.protocol.tooltip")
|
|
703
|
+
},
|
|
704
|
+
host: {
|
|
705
|
+
section: Me.Basic,
|
|
706
|
+
tooltip: m("gateway_services.form.fields.host.tooltip")
|
|
707
|
+
},
|
|
708
|
+
path: {
|
|
709
|
+
section: Me.Basic,
|
|
710
|
+
tooltip: m("gateway_services.form.fields.path.tooltip")
|
|
711
|
+
},
|
|
712
|
+
port: {
|
|
713
|
+
section: Me.Basic,
|
|
714
|
+
tooltip: m("gateway_services.form.fields.port.tooltip")
|
|
715
|
+
},
|
|
716
|
+
tags: {
|
|
717
|
+
tooltip: m("gateway_services.form.fields.tags.tooltip")
|
|
718
|
+
},
|
|
719
|
+
// advanced fields
|
|
720
|
+
retries: {
|
|
721
|
+
order: 1,
|
|
722
|
+
tooltip: m("gateway_services.form.fields.retries.tooltip")
|
|
723
|
+
},
|
|
724
|
+
connect_timeout: {
|
|
725
|
+
order: 2,
|
|
726
|
+
tooltip: m("gateway_services.form.fields.connect_timeout.tooltip")
|
|
727
|
+
},
|
|
728
|
+
write_timeout: {
|
|
729
|
+
order: 3,
|
|
730
|
+
tooltip: m("gateway_services.form.fields.write_timeout.tooltip")
|
|
731
|
+
},
|
|
732
|
+
read_timeout: {
|
|
733
|
+
order: 4,
|
|
734
|
+
tooltip: m("gateway_services.form.fields.read_timeout.tooltip")
|
|
735
|
+
},
|
|
736
|
+
client_certificate: {
|
|
737
|
+
order: 5,
|
|
738
|
+
tooltip: m("gateway_services.form.fields.client_certificate.tooltip")
|
|
739
|
+
},
|
|
740
|
+
ca_certificates: {
|
|
741
|
+
type: Kt.BadgeTag,
|
|
742
|
+
label: m("gateway_services.form.fields.ca_certificates.label"),
|
|
743
|
+
order: 6
|
|
744
|
+
},
|
|
745
|
+
tls_verify: {
|
|
746
|
+
label: m("gateway_services.form.fields.tls_verify_enabled.label")
|
|
747
|
+
},
|
|
748
|
+
tls_verify_depth: {
|
|
749
|
+
hidden: !0
|
|
750
|
+
}
|
|
751
|
+
});
|
|
752
|
+
return (l, A) => (p(), w("div", ua, [
|
|
753
|
+
c(t(Lt), {
|
|
754
|
+
config: i.config,
|
|
755
|
+
"config-card-doc": i.configCardDoc,
|
|
756
|
+
"config-schema": R.value,
|
|
757
|
+
"entity-type": t(gt).GatewayService,
|
|
758
|
+
"fetch-url": o.value,
|
|
759
|
+
"hide-title": i.hideTitle,
|
|
760
|
+
"onFetch:error": A[0] || (A[0] = (T) => l.$emit("fetch:error", T)),
|
|
761
|
+
"onFetch:success": A[1] || (A[1] = (T) => l.$emit("fetch:success", T)),
|
|
762
|
+
onLoading: A[2] || (A[2] = (T) => l.$emit("loading", T))
|
|
763
|
+
}, {
|
|
764
|
+
"enabled-label-tooltip": r(() => [
|
|
765
|
+
c(t(d), {
|
|
766
|
+
keypath: "gateway_services.form.fields.enabled.tooltip",
|
|
767
|
+
scope: "global"
|
|
768
|
+
}, {
|
|
769
|
+
false: r(() => [
|
|
770
|
+
C("code", null, _(t(m)("gateway_services.form.fields.enabled.false")), 1)
|
|
771
|
+
]),
|
|
772
|
+
true: r(() => [
|
|
773
|
+
C("code", null, _(t(m)("gateway_services.form.fields.enabled.true")), 1)
|
|
774
|
+
]),
|
|
775
|
+
_: 1
|
|
776
|
+
})
|
|
777
|
+
]),
|
|
778
|
+
"ca_certificates-label-tooltip": r(() => [
|
|
779
|
+
c(t(d), {
|
|
780
|
+
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
781
|
+
scope: "global"
|
|
782
|
+
}, {
|
|
783
|
+
code1: r(() => [
|
|
784
|
+
C("code", null, _(t(m)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
785
|
+
]),
|
|
786
|
+
code2: r(() => [
|
|
787
|
+
C("code", null, _(t(m)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
788
|
+
]),
|
|
789
|
+
_: 1
|
|
790
|
+
})
|
|
791
|
+
]),
|
|
792
|
+
"tls_verify-label-tooltip": r(() => [
|
|
793
|
+
c(t(d), {
|
|
794
|
+
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
795
|
+
scope: "global"
|
|
796
|
+
}, {
|
|
797
|
+
code1: r(() => [
|
|
798
|
+
C("code", null, _(t(m)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
799
|
+
]),
|
|
800
|
+
_: 1
|
|
801
|
+
})
|
|
802
|
+
]),
|
|
803
|
+
tls_verify: r((T) => [
|
|
804
|
+
P(_(typeof t(v)("rowValue", T) == "boolean" ? U("rowValue", T) : t(m)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
|
|
805
|
+
]),
|
|
806
|
+
client_certificate: r((T) => [
|
|
807
|
+
P(_(t(v)("rowValue", T) ? t(v)("rowValue", T).id : "–"), 1)
|
|
808
|
+
]),
|
|
809
|
+
_: 1
|
|
810
|
+
}, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
|
|
811
|
+
]));
|
|
812
|
+
}
|
|
813
|
+
}), q = {
|
|
814
|
+
name: "Kong-Air-Flights-API",
|
|
815
|
+
protocol: "https",
|
|
816
|
+
path: "/flights",
|
|
817
|
+
host: "api.kong-air.com",
|
|
818
|
+
port: 443
|
|
819
|
+
}, fa = "#d60027", pa = { class: "tls-sans-field-container" }, ma = {
|
|
820
|
+
key: 0,
|
|
821
|
+
class: "tls-sans-field-controls"
|
|
822
|
+
}, ga = { key: 0 }, va = /* @__PURE__ */ qe({
|
|
823
|
+
__name: "GatewayServiceFormTlsSansField",
|
|
824
|
+
props: {
|
|
825
|
+
modelValue: {},
|
|
826
|
+
label: {},
|
|
827
|
+
tooltip: {},
|
|
828
|
+
placeholder: {},
|
|
829
|
+
addButtonText: {},
|
|
830
|
+
testIdPrefix: {},
|
|
831
|
+
error: { type: Boolean },
|
|
832
|
+
readonly: { type: Boolean }
|
|
833
|
+
},
|
|
834
|
+
emits: ["update:modelValue", "input"],
|
|
835
|
+
setup(i, { emit: K }) {
|
|
836
|
+
const m = i, d = K, o = () => {
|
|
837
|
+
d("update:modelValue", [...m.modelValue, ""]);
|
|
838
|
+
}, v = (R) => {
|
|
839
|
+
const l = [...m.modelValue];
|
|
840
|
+
l.splice(R, 1), d("update:modelValue", l);
|
|
841
|
+
}, U = (R, l) => {
|
|
842
|
+
const A = [...m.modelValue];
|
|
843
|
+
A[R] = l, d("update:modelValue", A), d("input");
|
|
844
|
+
};
|
|
845
|
+
return (R, l) => {
|
|
846
|
+
const A = $("KLabel"), T = $("KInput"), Y = $("KButton");
|
|
847
|
+
return p(), w("div", pa, [
|
|
848
|
+
c(A, { info: i.tooltip }, {
|
|
849
|
+
default: r(() => [
|
|
850
|
+
P(_(i.label), 1)
|
|
851
|
+
]),
|
|
852
|
+
_: 1
|
|
853
|
+
}, 8, ["info"]),
|
|
854
|
+
(p(!0), w(Fe, null, Le(i.modelValue, (re, N) => (p(), w("div", {
|
|
855
|
+
key: N,
|
|
856
|
+
class: "tls-sans-field-input"
|
|
857
|
+
}, [
|
|
858
|
+
c(T, {
|
|
859
|
+
autocomplete: "off",
|
|
860
|
+
"data-testid": `${i.testIdPrefix}-input-${N}`,
|
|
861
|
+
error: i.error,
|
|
862
|
+
"model-value": i.modelValue[N],
|
|
863
|
+
placeholder: i.placeholder,
|
|
864
|
+
readonly: i.readonly,
|
|
865
|
+
type: "text",
|
|
866
|
+
"onUpdate:modelValue": (ee) => U(N, ee.trim())
|
|
867
|
+
}, null, 8, ["data-testid", "error", "model-value", "placeholder", "readonly", "onUpdate:modelValue"]),
|
|
868
|
+
i.readonly ? F("", !0) : (p(), w("div", ma, [
|
|
869
|
+
c(Y, {
|
|
870
|
+
appearance: "tertiary",
|
|
871
|
+
"data-testid": `remove-${i.testIdPrefix}`,
|
|
872
|
+
icon: "",
|
|
873
|
+
onClick: (ee) => v(N)
|
|
874
|
+
}, {
|
|
875
|
+
default: r(() => [
|
|
876
|
+
c(t(St), {
|
|
877
|
+
color: `var(--kui-color-text-danger, ${t(fa)})`
|
|
878
|
+
}, null, 8, ["color"])
|
|
879
|
+
]),
|
|
880
|
+
_: 1
|
|
881
|
+
}, 8, ["data-testid", "onClick"]),
|
|
882
|
+
c(Y, {
|
|
883
|
+
appearance: "tertiary",
|
|
884
|
+
"data-testid": `add-${i.testIdPrefix}`,
|
|
885
|
+
disabled: N !== i.modelValue.length - 1,
|
|
886
|
+
icon: "",
|
|
887
|
+
onClick: o
|
|
888
|
+
}, {
|
|
889
|
+
default: r(() => [
|
|
890
|
+
c(t(Ne))
|
|
891
|
+
]),
|
|
892
|
+
_: 1
|
|
893
|
+
}, 8, ["data-testid", "disabled"])
|
|
894
|
+
]))
|
|
895
|
+
]))), 128)),
|
|
896
|
+
i.modelValue.length === 0 && !i.readonly ? (p(), w("div", ga, [
|
|
897
|
+
c(Y, {
|
|
898
|
+
"data-testid": `add-${i.testIdPrefix}`,
|
|
899
|
+
onClick: o
|
|
900
|
+
}, {
|
|
901
|
+
default: r(() => [
|
|
902
|
+
c(t(Ne)),
|
|
903
|
+
P(" " + _(i.addButtonText), 1)
|
|
904
|
+
]),
|
|
905
|
+
_: 1
|
|
906
|
+
}, 8, ["data-testid"])
|
|
907
|
+
])) : F("", !0)
|
|
908
|
+
]);
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
}), ut = /* @__PURE__ */ st(va, [["__scopeId", "data-v-4f239c35"]]), ya = { class: "kong-ui-entities-gateway-service-form" }, _a = {
|
|
912
|
+
key: 0,
|
|
913
|
+
class: "gateway-service-form-general-info"
|
|
914
|
+
}, ha = { class: "gateway-service-form-group-selection-wrapper" }, ba = {
|
|
915
|
+
key: 0,
|
|
916
|
+
class: "gateway-service-form-group-fields"
|
|
917
|
+
}, wa = {
|
|
918
|
+
key: 0,
|
|
919
|
+
class: "gateway-service-form-group-fields"
|
|
920
|
+
}, ka = { key: 0 }, Ca = {
|
|
921
|
+
key: 0,
|
|
922
|
+
class: "gateway-service-form-advanced-fields"
|
|
923
|
+
}, Sa = { class: "gateway-service-form-margin-bottom" }, Va = { class: "gateway-service-form-margin-bottom" }, Ea = { class: "gateway-service-form-margin-bottom" }, Ia = { class: "gateway-service-form-margin-bottom" }, Fa = {
|
|
924
|
+
key: 0,
|
|
925
|
+
class: "gateway-service-form-margin-bottom"
|
|
926
|
+
}, Pa = { class: "certificate-select-item" }, $a = { class: "certificate-select-item-id" }, Ta = {
|
|
927
|
+
key: 0,
|
|
928
|
+
class: "certificate-select-item-tags"
|
|
929
|
+
}, xa = {
|
|
930
|
+
key: 3,
|
|
931
|
+
class: "gateway-service-form-margin-bottom"
|
|
932
|
+
}, Ra = { class: "certificate-select-item certificate-select-item--stacked" }, Aa = { class: "certificate-select-item-header" }, Ua = { class: "certificate-select-item-id" }, Da = {
|
|
933
|
+
key: 0,
|
|
934
|
+
class: "certificate-select-item-tags"
|
|
935
|
+
}, Ba = ["title"], Ma = {
|
|
936
|
+
key: 4,
|
|
937
|
+
class: "gateway-service-form-margin-bottom"
|
|
938
|
+
}, Ka = {
|
|
939
|
+
key: 0,
|
|
940
|
+
class: "checkbox-aligned-radio"
|
|
941
|
+
}, La = {
|
|
942
|
+
key: 1,
|
|
943
|
+
class: "checkbox-aligned-radio"
|
|
944
|
+
}, Na = { class: "gateway-service-form-tags" }, qa = { class: "form-error-list" }, Wa = /* @__PURE__ */ qe({
|
|
945
|
+
__name: "GatewayServiceForm",
|
|
946
|
+
props: {
|
|
947
|
+
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
948
|
+
config: {
|
|
949
|
+
type: Object,
|
|
950
|
+
required: !0,
|
|
951
|
+
validator: (i) => !(!i || !["konnect", "kongManager"].includes(i?.app) || i.app === "konnect" && !i.controlPlaneId || i.app === "kongManager" && typeof i.workspace != "string" || !i.cancelRoute)
|
|
952
|
+
},
|
|
953
|
+
/** If a valid Gateway Service ID is provided, it will put the form in Edit mode instead of Create */
|
|
954
|
+
gatewayServiceId: {
|
|
955
|
+
type: String,
|
|
956
|
+
required: !1,
|
|
957
|
+
default: null
|
|
958
|
+
},
|
|
959
|
+
/** Whether show or hide EntityFormSection info column */
|
|
960
|
+
hideSectionsInfo: {
|
|
961
|
+
type: Boolean,
|
|
962
|
+
required: !1,
|
|
963
|
+
default: !1
|
|
964
|
+
},
|
|
965
|
+
/** Whether show or hide Try sample API button */
|
|
966
|
+
hideTrySampleApiButton: {
|
|
967
|
+
type: Boolean,
|
|
968
|
+
required: !1,
|
|
969
|
+
default: !1
|
|
970
|
+
},
|
|
971
|
+
/** Whether tls_sans fields are supported */
|
|
972
|
+
isTlsSansSupported: {
|
|
973
|
+
type: Boolean,
|
|
974
|
+
required: !1,
|
|
975
|
+
default: !0
|
|
976
|
+
},
|
|
977
|
+
/**
|
|
978
|
+
* Feature-flag guard for the client/CA certificate select controls.
|
|
979
|
+
* When `false` (default), the original free-text inputs are shown instead of
|
|
980
|
+
* the certificate select / multiselect. Host apps should pass the resolved
|
|
981
|
+
* feature-flag value here.
|
|
982
|
+
*/
|
|
983
|
+
isCertificateSelectEnabled: {
|
|
984
|
+
type: Boolean,
|
|
985
|
+
required: !1,
|
|
986
|
+
default: !1
|
|
987
|
+
}
|
|
988
|
+
},
|
|
989
|
+
emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated", "try-sample-api"],
|
|
990
|
+
setup(i, { expose: K, emit: m }) {
|
|
991
|
+
const d = m, o = i, v = x(!0), U = ft(), { i18nT: R, i18n: { t: l } } = oe.useI18n(), { getErrorFieldsFromError: A } = Nt(), { axiosInstance: T } = pt(o.config?.axiosRequestConfig), Y = qt(), { validateHost: re, validatePath: N, validatePort: ee, validateProtocol: me } = oe.useUrlValidators(), { objectsAreEqual: ne } = mt(), {
|
|
992
|
+
debouncedQueryChange: We,
|
|
993
|
+
loading: Ge,
|
|
994
|
+
loadItems: W,
|
|
995
|
+
results: Pe
|
|
996
|
+
} = nt(o.config, Z.form[o.config.app].getCertificates), Oe = h(() => new Map((Pe.value ?? []).map((s) => [String(s.id), s.tags ?? []]))), $e = (s) => Oe.value.get(String(s)) ?? [], ge = h(() => {
|
|
997
|
+
const s = (Pe.value ?? []).map((u) => ({
|
|
998
|
+
label: u.id,
|
|
999
|
+
value: u.id
|
|
1000
|
+
})), a = e.fields.client_certificate;
|
|
1001
|
+
return a && !s.some((u) => u.value === a) && s.unshift({ label: a, value: a }), s;
|
|
1002
|
+
}), {
|
|
1003
|
+
debouncedQueryChange: je,
|
|
1004
|
+
loading: ze,
|
|
1005
|
+
loadItems: ce,
|
|
1006
|
+
results: ve
|
|
1007
|
+
} = nt(o.config, Z.form[o.config.app].getCaCertificates), ye = h(() => new Map((ve.value ?? []).map((s) => [String(s.id), s.tags ?? []]))), B = (s) => ye.value.get(String(s)) ?? [], G = x({});
|
|
1008
|
+
let _e = null;
|
|
1009
|
+
const Te = () => (_e || (_e = (async () => (await import("reflect-metadata"), import("@peculiar/x509")))()), _e), He = async (s) => {
|
|
1010
|
+
const a = s.filter((E) => !(String(E.id) in G.value));
|
|
1011
|
+
if (!a.length)
|
|
1012
|
+
return;
|
|
1013
|
+
let u = null;
|
|
1014
|
+
for (const E of a) {
|
|
1015
|
+
const k = String(E.id);
|
|
1016
|
+
if (E.metadata?.issuer) {
|
|
1017
|
+
G.value[k] = E.metadata.issuer;
|
|
1018
|
+
continue;
|
|
1019
|
+
}
|
|
1020
|
+
if (!E.cert) {
|
|
1021
|
+
G.value[k] = "";
|
|
1022
|
+
continue;
|
|
1023
|
+
}
|
|
1024
|
+
try {
|
|
1025
|
+
u ??= await Te(), G.value[k] = new u.X509Certificate(E.cert).issuer;
|
|
1026
|
+
} catch {
|
|
1027
|
+
G.value[k] = "";
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
Ke(ve, (s) => {
|
|
1032
|
+
He(s ?? []);
|
|
1033
|
+
}, { immediate: !0 });
|
|
1034
|
+
const he = (s) => G.value[String(s)] ?? "", Ze = h(() => {
|
|
1035
|
+
const s = (ve.value ?? []).map((a) => ({
|
|
1036
|
+
label: a.id,
|
|
1037
|
+
value: a.id,
|
|
1038
|
+
selected: e.fields.ca_certificates.includes(a.id)
|
|
1039
|
+
}));
|
|
1040
|
+
return e.fields.ca_certificates.forEach((a) => {
|
|
1041
|
+
s.some((u) => u.value === a) || s.unshift({ label: a, value: a, selected: !0 });
|
|
1042
|
+
}), s;
|
|
1043
|
+
}), xe = h({
|
|
1044
|
+
get: () => e.fields.ca_certificates.join(","),
|
|
1045
|
+
set: (s) => {
|
|
1046
|
+
e.fields.ca_certificates = s.split(",");
|
|
1047
|
+
}
|
|
1048
|
+
}), Qe = h(() => Z.form[o.config.app].edit), te = h(() => o.gatewayServiceId ? ct.Edit : ct.Create), Je = x(!1), ae = h(() => !!o.gatewayServiceId), S = x(ae.value ? "protocol" : "url"), se = oe.usePortFromProtocol(), le = x(""), be = h(() => !!le.value || !!J("name")), e = ot({
|
|
1049
|
+
fields: {
|
|
1050
|
+
name: "",
|
|
1051
|
+
protocol: "http",
|
|
1052
|
+
host: "",
|
|
1053
|
+
path: "",
|
|
1054
|
+
port: 80,
|
|
1055
|
+
url: "",
|
|
1056
|
+
retries: 5,
|
|
1057
|
+
connect_timeout: 6e4,
|
|
1058
|
+
write_timeout: 6e4,
|
|
1059
|
+
read_timeout: 6e4,
|
|
1060
|
+
client_certificate: "",
|
|
1061
|
+
tls_sans: { dnsnames: [""], uris: [""] },
|
|
1062
|
+
ca_certificates: [],
|
|
1063
|
+
tls_verify_enabled: !1,
|
|
1064
|
+
tls_verify_value: !1,
|
|
1065
|
+
tags: "",
|
|
1066
|
+
enabled: !0
|
|
1067
|
+
},
|
|
1068
|
+
isReadonly: !1,
|
|
1069
|
+
errorMessages: [],
|
|
1070
|
+
formFieldErrors: {
|
|
1071
|
+
host: "",
|
|
1072
|
+
port: "",
|
|
1073
|
+
path: "",
|
|
1074
|
+
name: "",
|
|
1075
|
+
url: "",
|
|
1076
|
+
tags: "",
|
|
1077
|
+
retries: "",
|
|
1078
|
+
connect_timeout: "",
|
|
1079
|
+
write_timeout: "",
|
|
1080
|
+
read_timeout: "",
|
|
1081
|
+
client_certificate: "",
|
|
1082
|
+
tls_sans_dnsnames: "",
|
|
1083
|
+
tls_sans_uris: "",
|
|
1084
|
+
ca_certificates: "",
|
|
1085
|
+
tls_verify_enabled: "",
|
|
1086
|
+
tls_verify_value: ""
|
|
1087
|
+
}
|
|
1088
|
+
}), b = ot({
|
|
1089
|
+
name: "",
|
|
1090
|
+
protocol: "http",
|
|
1091
|
+
host: "",
|
|
1092
|
+
path: "",
|
|
1093
|
+
port: 80,
|
|
1094
|
+
url: "",
|
|
1095
|
+
retries: 5,
|
|
1096
|
+
connect_timeout: 6e4,
|
|
1097
|
+
write_timeout: 6e4,
|
|
1098
|
+
read_timeout: 6e4,
|
|
1099
|
+
client_certificate: "",
|
|
1100
|
+
tls_sans: { dnsnames: [""], uris: [""] },
|
|
1101
|
+
ca_certificates: [],
|
|
1102
|
+
tls_verify_enabled: !1,
|
|
1103
|
+
tls_verify_value: !1,
|
|
1104
|
+
tags: "",
|
|
1105
|
+
enabled: !0
|
|
1106
|
+
}), de = o.config.app === "konnect" || Wt({
|
|
1107
|
+
gatewayInfo: o.config.gatewayInfo,
|
|
1108
|
+
// 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
|
|
1109
|
+
supportedRange: {
|
|
1110
|
+
enterprise: ["3.0"]
|
|
1111
|
+
}
|
|
1112
|
+
}), ie = [
|
|
1113
|
+
{
|
|
1114
|
+
label: l("gateway_services.form.fields.protocol.options.http"),
|
|
1115
|
+
value: "http",
|
|
1116
|
+
group: "http"
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
label: l("gateway_services.form.fields.protocol.options.https"),
|
|
1120
|
+
value: "https",
|
|
1121
|
+
group: "http"
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
label: l("gateway_services.form.fields.protocol.options.tcp"),
|
|
1125
|
+
value: "tcp",
|
|
1126
|
+
group: "tcp"
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
label: l("gateway_services.form.fields.protocol.options.tls"),
|
|
1130
|
+
value: "tls",
|
|
1131
|
+
group: "tcp"
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
label: l("gateway_services.form.fields.protocol.options.tls_passthrough"),
|
|
1135
|
+
value: "tls_passthrough",
|
|
1136
|
+
group: "tcp"
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
label: l("gateway_services.form.fields.protocol.options.grpc"),
|
|
1140
|
+
value: "grpc",
|
|
1141
|
+
group: "grpc"
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
label: l("gateway_services.form.fields.protocol.options.grpcs"),
|
|
1145
|
+
value: "grpcs",
|
|
1146
|
+
group: "grpc"
|
|
1147
|
+
},
|
|
1148
|
+
...de ? [
|
|
1149
|
+
{
|
|
1150
|
+
label: l("gateway_services.form.fields.protocol.options.ws"),
|
|
1151
|
+
value: "ws",
|
|
1152
|
+
group: "websocket"
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
label: l("gateway_services.form.fields.protocol.options.wss"),
|
|
1156
|
+
value: "wss",
|
|
1157
|
+
group: "websocket"
|
|
1158
|
+
}
|
|
1159
|
+
] : [],
|
|
1160
|
+
{
|
|
1161
|
+
label: l("gateway_services.form.fields.protocol.options.udp"),
|
|
1162
|
+
value: "udp",
|
|
1163
|
+
group: "udp"
|
|
1164
|
+
}
|
|
1165
|
+
], O = { url: "url", protocol: "protocol" }, Xe = (s) => {
|
|
1166
|
+
e.fields.protocol = s.value, e.fields.port = se.getPortFromProtocol(e.fields.protocol, String(e.fields.port));
|
|
1167
|
+
}, Q = (s) => s ? parseFloat(s) : 0, Re = () => {
|
|
1168
|
+
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.tls_sans = {
|
|
1169
|
+
dnsnames: [...b.tls_sans.dnsnames],
|
|
1170
|
+
uris: [...b.tls_sans.uris]
|
|
1171
|
+
}, 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, e.fields.enabled = b.enabled;
|
|
1172
|
+
}, Ae = () => {
|
|
1173
|
+
v.value = !0, f(), e.errorMessages = [], Re();
|
|
1174
|
+
}, we = () => {
|
|
1175
|
+
switch (Re(), e.fields.name = `${q.name}-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, S.value) {
|
|
1176
|
+
case "url":
|
|
1177
|
+
e.fields.url = `${q.protocol}://${q.host}${q.path}`;
|
|
1178
|
+
break;
|
|
1179
|
+
case "protocol":
|
|
1180
|
+
e.fields.host = q.host, e.fields.path = q.path, e.fields.protocol = q.protocol, e.fields.port = q.port;
|
|
1181
|
+
break;
|
|
1182
|
+
default:
|
|
1183
|
+
e.fields.url = `${q.protocol}://${q.host}${q.path}`;
|
|
1184
|
+
}
|
|
1185
|
+
}, Ue = () => {
|
|
1186
|
+
if (f(), e.fields.url.length)
|
|
1187
|
+
try {
|
|
1188
|
+
const s = new URL(e.fields.url), a = me(s.protocol, ie);
|
|
1189
|
+
if (a) throw new Error(a);
|
|
1190
|
+
e.fields.protocol = s.protocol.slice(0, -1);
|
|
1191
|
+
const u = re(s.hostname);
|
|
1192
|
+
if (u) throw new Error(u);
|
|
1193
|
+
e.fields.host = s.hostname;
|
|
1194
|
+
const E = N(s.pathname);
|
|
1195
|
+
if (E) throw new Error(E);
|
|
1196
|
+
e.fields.path = s.pathname;
|
|
1197
|
+
const k = ee(s.port);
|
|
1198
|
+
if (k) throw new Error(k);
|
|
1199
|
+
const Se = Number(s.port);
|
|
1200
|
+
Je.value = !!Se, e.fields.port = Se || se.getPortFromProtocol(e.fields.protocol), d("url-valid:success");
|
|
1201
|
+
} catch {
|
|
1202
|
+
d("url-valid:error", l("gateway_services.form.errors.url.invalid")), e.formFieldErrors.url = l("gateway_services.form.errors.url.invalid");
|
|
1203
|
+
}
|
|
1204
|
+
}, j = (s) => {
|
|
1205
|
+
f(s);
|
|
1206
|
+
}, Ye = h(() => !!e.formFieldErrors.url || !!e.formFieldErrors.host || !!e.formFieldErrors.port), J = (s) => {
|
|
1207
|
+
if (e.errorMessages.length) return "";
|
|
1208
|
+
const a = e.formFieldErrors;
|
|
1209
|
+
return a[s] ? a[s] : "";
|
|
1210
|
+
}, z = (s) => {
|
|
1211
|
+
f(s ?? void 0);
|
|
1212
|
+
const a = re(e.fields.host);
|
|
1213
|
+
a && (e.formFieldErrors.host = a);
|
|
1214
|
+
const u = N(e.fields.path);
|
|
1215
|
+
u && (e.formFieldErrors.path = u);
|
|
1216
|
+
const E = ee(e.fields.port);
|
|
1217
|
+
E && (e.formFieldErrors.port = E), y.value ? d("url-valid:success") : d("url-valid:error", e.errorMessages.join(",") || l("gateway_services.form.errors.url.invalid"));
|
|
1218
|
+
}, f = (s) => {
|
|
1219
|
+
if (s)
|
|
1220
|
+
e.formFieldErrors[s] = "";
|
|
1221
|
+
else
|
|
1222
|
+
for (let a in e.formFieldErrors)
|
|
1223
|
+
e.formFieldErrors[a] = "";
|
|
1224
|
+
e.errorMessages = [];
|
|
1225
|
+
}, y = h(() => {
|
|
1226
|
+
for (let s in e.formFieldErrors)
|
|
1227
|
+
if (e.formFieldErrors[s].length)
|
|
1228
|
+
return !1;
|
|
1229
|
+
return !0;
|
|
1230
|
+
}), V = () => {
|
|
1231
|
+
e.fields.url && S.value === "url" ? Ue() : z();
|
|
1232
|
+
}, I = () => `new-service-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, H = h(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(e.fields.protocol)), L = h(() => {
|
|
1233
|
+
if (S.value === "url")
|
|
1234
|
+
return !0;
|
|
1235
|
+
const s = ["https", "wss", "tls"].includes(e.fields.protocol);
|
|
1236
|
+
return S.value === "protocol" && s;
|
|
1237
|
+
}), ke = h(() => {
|
|
1238
|
+
if (S.value === "url")
|
|
1239
|
+
return !0;
|
|
1240
|
+
const s = ["https", "tls"].includes(e.fields.protocol);
|
|
1241
|
+
return S.value === "protocol" && s;
|
|
1242
|
+
}), De = (s) => {
|
|
1243
|
+
f("name"), le.value = Y.utf8Name(s);
|
|
1244
|
+
}, ue = h(() => {
|
|
1245
|
+
const s = !ae.value || !ne(e.fields, b), a = S.value === "url" && !!e.fields.url && y.value, u = S.value === "protocol" && !!e.fields.host && y.value;
|
|
1246
|
+
return s && (a || u);
|
|
1247
|
+
}), Be = (s) => {
|
|
1248
|
+
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 ? [...s.ca_certificates] : [], e.fields.client_certificate = s?.client_certificate?.id || "", e.fields.tls_sans = {
|
|
1249
|
+
dnsnames: s?.tls_sans?.dnsnames ?? [""],
|
|
1250
|
+
uris: s?.tls_sans?.uris ?? [""]
|
|
1251
|
+
}, e.fields.write_timeout = s?.write_timeout || s?.write_timeout === 0 ? s?.write_timeout : 6e4, e.fields.port = s?.port || s?.port === 0 ? s?.port : 80, e.fields.enabled = s?.enabled ?? !0, Object.assign(b, e.fields), b.tls_sans = {
|
|
1252
|
+
dnsnames: [...e.fields.tls_sans.dnsnames],
|
|
1253
|
+
uris: [...e.fields.tls_sans.uris]
|
|
1254
|
+
}, b.ca_certificates = [...e.fields.ca_certificates];
|
|
1255
|
+
}, g = () => {
|
|
1256
|
+
U.push(o.config.cancelRoute);
|
|
1257
|
+
}, M = h(() => {
|
|
1258
|
+
let s = `${o.config.apiBaseUrl}${Z.form[o.config.app][te.value]}`;
|
|
1259
|
+
return o.config.app === "konnect" && (s = s.replace(/{controlPlaneId}/gi, o.config?.controlPlaneId || "")), s.replace(/\/{workspace}/gi, o.config?.workspace ? `/${o.config.workspace}` : "").replace(/{id}/gi, o.gatewayServiceId ?? "");
|
|
1260
|
+
}), fe = h(() => {
|
|
1261
|
+
if (!o.isTlsSansSupported)
|
|
1262
|
+
return;
|
|
1263
|
+
if (!L.value)
|
|
1264
|
+
return null;
|
|
1265
|
+
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);
|
|
1266
|
+
return s.length || a.length ? {
|
|
1267
|
+
dnsnames: s.length ? s : null,
|
|
1268
|
+
uris: a.length ? a : null
|
|
1269
|
+
} : null;
|
|
1270
|
+
}), Ce = h(() => {
|
|
1271
|
+
const s = e.fields.ca_certificates.filter((u) => u.trim() !== ""), a = {
|
|
1272
|
+
name: e.fields.name || null,
|
|
1273
|
+
tags: e.fields.tags ? e.fields.tags?.split(",")?.map((u) => String(u || "").trim())?.filter((u) => u !== "") : null,
|
|
1274
|
+
protocol: e.fields.protocol,
|
|
1275
|
+
path: e.fields.path || null,
|
|
1276
|
+
read_timeout: e.fields.read_timeout,
|
|
1277
|
+
retries: e.fields.retries,
|
|
1278
|
+
host: e.fields.host,
|
|
1279
|
+
connect_timeout: e.fields.connect_timeout,
|
|
1280
|
+
ca_certificates: s.length ? s : null,
|
|
1281
|
+
client_certificate: e.fields.client_certificate ? { id: e.fields.client_certificate } : null,
|
|
1282
|
+
tls_sans: fe.value,
|
|
1283
|
+
write_timeout: e.fields.write_timeout,
|
|
1284
|
+
port: e.fields.port,
|
|
1285
|
+
url: e.fields.url,
|
|
1286
|
+
enabled: e.fields.enabled
|
|
1287
|
+
};
|
|
1288
|
+
return L.value || (a.client_certificate = null), e.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(e.fields.protocol) && (a.tls_verify = e.fields.tls_verify_value), H.value || (a.path = null), te.value === "create" ? S.value === "url" ? (delete a.protocol, delete a.host, delete a.path, o.config.app === "konnect" && delete a.port) : delete a.url : te.value === "edit" && delete a.url, a;
|
|
1289
|
+
}), et = async () => {
|
|
1290
|
+
try {
|
|
1291
|
+
e.isReadonly = !0;
|
|
1292
|
+
const s = Ce.value;
|
|
1293
|
+
let a;
|
|
1294
|
+
if (te.value === "create" ? a = await T.post(M.value, s) : te.value === "edit" && (a = o.config?.app === "konnect" ? await T.put(M.value, s) : await T.patch(M.value, s)), a) {
|
|
1295
|
+
const { data: u } = a;
|
|
1296
|
+
e.fields.name = u?.name || "", e.fields.port = u.port || se.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 = {
|
|
1297
|
+
dnsnames: u?.tls_sans?.dnsnames ?? [],
|
|
1298
|
+
uris: u?.tls_sans?.uris ?? []
|
|
1299
|
+
}, e.fields.ca_certificates = u?.ca_certificates?.length ? [...u.ca_certificates] : [], 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(b, e.fields), b.tls_sans = {
|
|
1300
|
+
dnsnames: [...e.fields.tls_sans.dnsnames],
|
|
1301
|
+
uris: [...e.fields.tls_sans.uris]
|
|
1302
|
+
}, b.ca_certificates = [...e.fields.ca_certificates], d("update", a?.data);
|
|
1303
|
+
}
|
|
1304
|
+
return a;
|
|
1305
|
+
} catch (s) {
|
|
1306
|
+
const { fields: a, messages: u } = A(s);
|
|
1307
|
+
e.errorMessages = u, a.length && a.forEach((E) => {
|
|
1308
|
+
const k = E.field;
|
|
1309
|
+
k === "client_certificate.id" ? e.formFieldErrors.client_certificate = E.message : k.startsWith("tls_sans.dnsnames") ? e.formFieldErrors.tls_sans_dnsnames = E.message : k.startsWith("tls_sans.uris") ? e.formFieldErrors.tls_sans_uris = E.message : k.startsWith("ca_certificates") ? e.formFieldErrors.ca_certificates = E.message : Object.keys(e.formFieldErrors).includes(k) && (e.formFieldErrors = {
|
|
1310
|
+
...e.formFieldErrors,
|
|
1311
|
+
[k]: E.message
|
|
1312
|
+
});
|
|
1313
|
+
}), d("error", s);
|
|
1314
|
+
} finally {
|
|
1315
|
+
e.isReadonly = !1;
|
|
1316
|
+
}
|
|
1317
|
+
};
|
|
1318
|
+
return Ke(() => o.gatewayServiceId, () => {
|
|
1319
|
+
Object.assign(e.fields, b);
|
|
1320
|
+
}), Ke(e.fields, () => {
|
|
1321
|
+
d("model-updated", Ce.value);
|
|
1322
|
+
}), wt(() => {
|
|
1323
|
+
d("model-updated", Ce.value), ae.value || (e.fields.name = I()), o.isCertificateSelectEnabled && (W(), ce());
|
|
1324
|
+
}), K({
|
|
1325
|
+
validateUrl: V,
|
|
1326
|
+
getPayload: Ce,
|
|
1327
|
+
saveFormData: et,
|
|
1328
|
+
canSubmit: ue,
|
|
1329
|
+
initForm: Be
|
|
1330
|
+
}), (s, a) => {
|
|
1331
|
+
const u = $("KRadio"), E = $("KButton"), k = $("KInput"), Se = $("KSelect"), lt = $("KBadge"), vt = $("KMultiselect"), yt = $("KCheckbox"), it = $("KCollapse"), _t = $("KAlert");
|
|
1332
|
+
return p(), w("div", ya, [
|
|
1333
|
+
c(t(Gt), {
|
|
1334
|
+
"can-submit": ue.value,
|
|
1335
|
+
config: i.config,
|
|
1336
|
+
"edit-id": i.gatewayServiceId,
|
|
1337
|
+
"entity-type": t(gt).GatewayService,
|
|
1338
|
+
"fetch-url": Qe.value,
|
|
1339
|
+
"form-fields": Ce.value,
|
|
1340
|
+
"is-readonly": e.isReadonly,
|
|
1341
|
+
onCancel: g,
|
|
1342
|
+
"onFetch:error": a[38] || (a[38] = (n) => s.$emit("error", n)),
|
|
1343
|
+
"onFetch:success": Be,
|
|
1344
|
+
onLoading: a[39] || (a[39] = (n) => s.$emit("loading", n)),
|
|
1345
|
+
onSubmit: et
|
|
1346
|
+
}, {
|
|
1347
|
+
"form-actions": r(() => [
|
|
1348
|
+
kt(s.$slots, "form-actions", {
|
|
1349
|
+
canSubmit: ue.value,
|
|
1350
|
+
cancel: g,
|
|
1351
|
+
submit: et
|
|
1352
|
+
}, void 0, !0)
|
|
1353
|
+
]),
|
|
1354
|
+
default: r(() => [
|
|
1355
|
+
c(t(dt), {
|
|
1356
|
+
description: t(l)("gateway_services.form.sections.keys.description"),
|
|
1357
|
+
"hide-info-header": i.hideSectionsInfo,
|
|
1358
|
+
title: t(l)("gateway_services.form.sections.keys.title")
|
|
1359
|
+
}, {
|
|
1360
|
+
default: r(() => [
|
|
1361
|
+
ae.value ? F("", !0) : (p(), w("div", _a, [
|
|
1362
|
+
C("div", ha, [
|
|
1363
|
+
c(u, {
|
|
1364
|
+
modelValue: S.value,
|
|
1365
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => S.value = n),
|
|
1366
|
+
card: "",
|
|
1367
|
+
"card-orientation": "horizontal",
|
|
1368
|
+
"data-testid": "gateway-service-url-radio",
|
|
1369
|
+
description: t(l)("gateway_services.form.sections.keys.url.description"),
|
|
1370
|
+
label: t(l)("gateway_services.form.sections.keys.url.label"),
|
|
1371
|
+
"selected-value": O.url,
|
|
1372
|
+
onChange: Ae
|
|
1373
|
+
}, null, 8, ["modelValue", "description", "label", "selected-value"]),
|
|
1374
|
+
c(u, {
|
|
1375
|
+
modelValue: S.value,
|
|
1376
|
+
"onUpdate:modelValue": a[1] || (a[1] = (n) => S.value = n),
|
|
1377
|
+
card: "",
|
|
1378
|
+
"card-orientation": "horizontal",
|
|
1379
|
+
"checked-group": "protocol",
|
|
1380
|
+
"data-testid": "gateway-service-protocol-radio",
|
|
1381
|
+
description: t(l)("gateway_services.form.sections.keys.protocol.description"),
|
|
1382
|
+
label: t(l)("gateway_services.form.sections.keys.protocol.label"),
|
|
1383
|
+
"selected-value": O.protocol,
|
|
1384
|
+
onChange: Ae
|
|
1385
|
+
}, null, 8, ["modelValue", "description", "label", "selected-value"])
|
|
1386
|
+
]),
|
|
1387
|
+
c(at, { name: "slide-fade" }, {
|
|
1388
|
+
default: r(() => [
|
|
1389
|
+
S.value === "url" ? (p(), w("div", ba, [
|
|
1390
|
+
c(k, {
|
|
1391
|
+
modelValue: e.fields.url,
|
|
1392
|
+
"onUpdate:modelValue": a[2] || (a[2] = (n) => e.fields.url = n),
|
|
1393
|
+
modelModifiers: { trim: !0 },
|
|
1394
|
+
class: "gateway-service-url-input gateway-service-form-margin-bottom",
|
|
1395
|
+
"data-testid": "gateway-service-url-input",
|
|
1396
|
+
error: Ye.value,
|
|
1397
|
+
"error-message": J("url"),
|
|
1398
|
+
label: t(l)("gateway_services.form.fields.upstream_url.label"),
|
|
1399
|
+
"label-attributes": {
|
|
1400
|
+
info: i.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"),
|
|
1401
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1402
|
+
},
|
|
1403
|
+
name: "url",
|
|
1404
|
+
placeholder: t(l)("gateway_services.form.fields.upstream_url.placeholder"),
|
|
1405
|
+
required: "",
|
|
1406
|
+
onInput: Ue
|
|
1407
|
+
}, Ie({ _: 2 }, [
|
|
1408
|
+
i.hideTrySampleApiButton ? void 0 : {
|
|
1409
|
+
name: "after",
|
|
1410
|
+
fn: r(() => [
|
|
1411
|
+
c(E, {
|
|
1412
|
+
appearance: "tertiary",
|
|
1413
|
+
"data-testid": "try-sample-api",
|
|
1414
|
+
size: "small",
|
|
1415
|
+
onClick: we
|
|
1416
|
+
}, {
|
|
1417
|
+
default: r(() => [
|
|
1418
|
+
P(_(t(l)("gateway_services.form.buttons.try_sample")), 1)
|
|
1419
|
+
]),
|
|
1420
|
+
_: 1
|
|
1421
|
+
})
|
|
1422
|
+
]),
|
|
1423
|
+
key: "0"
|
|
1424
|
+
}
|
|
1425
|
+
]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
|
|
1426
|
+
])) : F("", !0)
|
|
1427
|
+
]),
|
|
1428
|
+
_: 1
|
|
1429
|
+
})
|
|
1430
|
+
])),
|
|
1431
|
+
c(at, { name: "slide-fade" }, {
|
|
1432
|
+
default: r(() => [
|
|
1433
|
+
S.value === "protocol" || ae.value ? (p(), w("div", wa, [
|
|
1434
|
+
c(Se, {
|
|
1435
|
+
modelValue: e.fields.protocol,
|
|
1436
|
+
"onUpdate:modelValue": a[3] || (a[3] = (n) => e.fields.protocol = n),
|
|
1437
|
+
"data-testid": "gateway-service-protocol-select",
|
|
1438
|
+
items: ie,
|
|
1439
|
+
label: t(l)("gateway_services.form.fields.protocol.label"),
|
|
1440
|
+
"label-attributes": {
|
|
1441
|
+
info: t(l)("gateway_services.form.fields.protocol.tooltip"),
|
|
1442
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1443
|
+
},
|
|
1444
|
+
readonly: e.isReadonly,
|
|
1445
|
+
required: "",
|
|
1446
|
+
width: "100%",
|
|
1447
|
+
onSelected: Xe
|
|
1448
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
|
|
1449
|
+
c(k, {
|
|
1450
|
+
modelValue: e.fields.host,
|
|
1451
|
+
"onUpdate:modelValue": a[4] || (a[4] = (n) => e.fields.host = n),
|
|
1452
|
+
modelModifiers: { trim: !0 },
|
|
1453
|
+
class: "gateway-service-form-margin-top",
|
|
1454
|
+
"data-testid": "gateway-service-host-input",
|
|
1455
|
+
error: !!e.formFieldErrors.host,
|
|
1456
|
+
"error-message": J("host"),
|
|
1457
|
+
label: t(l)("gateway_services.form.fields.host.label"),
|
|
1458
|
+
"label-attributes": {
|
|
1459
|
+
info: t(l)("gateway_services.form.fields.host.tooltip"),
|
|
1460
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1461
|
+
},
|
|
1462
|
+
name: "host",
|
|
1463
|
+
placeholder: t(l)("gateway_services.form.fields.host.placeholder"),
|
|
1464
|
+
required: "",
|
|
1465
|
+
onInput: a[5] || (a[5] = (n) => z("host"))
|
|
1466
|
+
}, Ie({ _: 2 }, [
|
|
1467
|
+
i.hideTrySampleApiButton ? void 0 : {
|
|
1468
|
+
name: "after",
|
|
1469
|
+
fn: r(() => [
|
|
1470
|
+
c(E, {
|
|
1471
|
+
appearance: "tertiary",
|
|
1472
|
+
size: "small",
|
|
1473
|
+
onClick: we
|
|
1474
|
+
}, {
|
|
1475
|
+
default: r(() => [
|
|
1476
|
+
P(_(t(l)("gateway_services.form.buttons.try_sample")), 1)
|
|
1477
|
+
]),
|
|
1478
|
+
_: 1
|
|
1479
|
+
})
|
|
1480
|
+
]),
|
|
1481
|
+
key: "0"
|
|
1482
|
+
}
|
|
1483
|
+
]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"]),
|
|
1484
|
+
H.value ? (p(), w("div", ka, [
|
|
1485
|
+
c(k, {
|
|
1486
|
+
modelValue: e.fields.path,
|
|
1487
|
+
"onUpdate:modelValue": a[6] || (a[6] = (n) => e.fields.path = n),
|
|
1488
|
+
modelModifiers: { trim: !0 },
|
|
1489
|
+
class: "gateway-service-form-margin-top",
|
|
1490
|
+
"data-testid": "gateway-service-path-input",
|
|
1491
|
+
error: !!e.formFieldErrors.path,
|
|
1492
|
+
"error-message": J("path"),
|
|
1493
|
+
label: t(l)("gateway_services.form.fields.path.label"),
|
|
1494
|
+
"label-attributes": {
|
|
1495
|
+
info: t(l)("gateway_services.form.fields.path.tooltip"),
|
|
1496
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1497
|
+
},
|
|
1498
|
+
name: "path",
|
|
1499
|
+
placeholder: t(l)("gateway_services.form.fields.path.placeholder"),
|
|
1500
|
+
onInput: a[7] || (a[7] = (n) => z("path"))
|
|
1501
|
+
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
|
|
1502
|
+
])) : F("", !0),
|
|
1503
|
+
c(k, {
|
|
1504
|
+
modelValue: e.fields.port,
|
|
1505
|
+
"onUpdate:modelValue": [
|
|
1506
|
+
a[8] || (a[8] = (n) => e.fields.port = n),
|
|
1507
|
+
a[10] || (a[10] = () => {
|
|
1508
|
+
e.fields.port = Q(e.fields.port + "");
|
|
1509
|
+
})
|
|
1510
|
+
],
|
|
1511
|
+
class: "gateway-service-form-margin-top",
|
|
1512
|
+
"data-testid": "gateway-service-port-input",
|
|
1513
|
+
error: !!e.formFieldErrors.port,
|
|
1514
|
+
"error-message": J("port"),
|
|
1515
|
+
label: t(l)("gateway_services.form.fields.port.label"),
|
|
1516
|
+
"label-attributes": {
|
|
1517
|
+
info: t(l)("gateway_services.form.fields.port.tooltip"),
|
|
1518
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1519
|
+
},
|
|
1520
|
+
name: "port",
|
|
1521
|
+
type: "number",
|
|
1522
|
+
onInput: a[9] || (a[9] = (n) => z("port"))
|
|
1523
|
+
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes"])
|
|
1524
|
+
])) : F("", !0)
|
|
1525
|
+
]),
|
|
1526
|
+
_: 1
|
|
1527
|
+
}),
|
|
1528
|
+
c(it, {
|
|
1529
|
+
modelValue: v.value,
|
|
1530
|
+
"onUpdate:modelValue": a[34] || (a[34] = (n) => v.value = n),
|
|
1531
|
+
"data-testid": "advanced-fields-collapse",
|
|
1532
|
+
"trigger-alignment": "leading",
|
|
1533
|
+
"trigger-label": t(l)("gateway_services.form.sections.keys.viewAdvancedFields")
|
|
1534
|
+
}, {
|
|
1535
|
+
default: r(() => [
|
|
1536
|
+
c(at, { name: "slide-fade" }, {
|
|
1537
|
+
default: r(() => [
|
|
1538
|
+
v.value ? F("", !0) : (p(), w("div", Ca, [
|
|
1539
|
+
C("div", Sa, [
|
|
1540
|
+
c(k, {
|
|
1541
|
+
modelValue: e.fields.retries,
|
|
1542
|
+
"onUpdate:modelValue": [
|
|
1543
|
+
a[11] || (a[11] = (n) => e.fields.retries = n),
|
|
1544
|
+
a[12] || (a[12] = () => {
|
|
1545
|
+
e.fields.retries = Q(e.fields.retries + "");
|
|
1546
|
+
})
|
|
1547
|
+
],
|
|
1548
|
+
autocomplete: "off",
|
|
1549
|
+
"data-testid": "gateway-service-retries-input",
|
|
1550
|
+
label: t(l)("gateway_services.form.fields.retries.label"),
|
|
1551
|
+
"label-attributes": {
|
|
1552
|
+
info: t(l)("gateway_services.form.fields.retries.tooltip"),
|
|
1553
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1554
|
+
},
|
|
1555
|
+
name: "retries",
|
|
1556
|
+
readonly: e.isReadonly,
|
|
1557
|
+
type: "number"
|
|
1558
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1559
|
+
]),
|
|
1560
|
+
C("div", Va, [
|
|
1561
|
+
c(k, {
|
|
1562
|
+
modelValue: e.fields.connect_timeout,
|
|
1563
|
+
"onUpdate:modelValue": [
|
|
1564
|
+
a[13] || (a[13] = (n) => e.fields.connect_timeout = n),
|
|
1565
|
+
a[14] || (a[14] = () => {
|
|
1566
|
+
e.fields.connect_timeout = Q(e.fields.connect_timeout + "");
|
|
1567
|
+
})
|
|
1568
|
+
],
|
|
1569
|
+
autocomplete: "off",
|
|
1570
|
+
"data-testid": "gateway-service-connTimeout-input",
|
|
1571
|
+
label: t(l)("gateway_services.form.fields.connect_timeout.label"),
|
|
1572
|
+
"label-attributes": {
|
|
1573
|
+
info: t(l)("gateway_services.form.fields.connect_timeout.tooltip"),
|
|
1574
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1575
|
+
},
|
|
1576
|
+
name: "connTimeout",
|
|
1577
|
+
readonly: e.isReadonly,
|
|
1578
|
+
type: "number"
|
|
1579
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1580
|
+
]),
|
|
1581
|
+
C("div", Ea, [
|
|
1582
|
+
c(k, {
|
|
1583
|
+
modelValue: e.fields.write_timeout,
|
|
1584
|
+
"onUpdate:modelValue": [
|
|
1585
|
+
a[15] || (a[15] = (n) => e.fields.write_timeout = n),
|
|
1586
|
+
a[16] || (a[16] = () => {
|
|
1587
|
+
e.fields.write_timeout = Q(e.fields.write_timeout + "");
|
|
1588
|
+
})
|
|
1589
|
+
],
|
|
1590
|
+
autocomplete: "off",
|
|
1591
|
+
"data-testid": "gateway-service-writeTimeout-input",
|
|
1592
|
+
label: t(l)("gateway_services.form.fields.write_timeout.label"),
|
|
1593
|
+
"label-attributes": {
|
|
1594
|
+
info: t(l)("gateway_services.form.fields.write_timeout.tooltip"),
|
|
1595
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1596
|
+
},
|
|
1597
|
+
name: "writeTimeout",
|
|
1598
|
+
readonly: e.isReadonly,
|
|
1599
|
+
type: "number"
|
|
1600
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1601
|
+
]),
|
|
1602
|
+
C("div", Ia, [
|
|
1603
|
+
c(k, {
|
|
1604
|
+
modelValue: e.fields.read_timeout,
|
|
1605
|
+
"onUpdate:modelValue": [
|
|
1606
|
+
a[17] || (a[17] = (n) => e.fields.read_timeout = n),
|
|
1607
|
+
a[18] || (a[18] = () => {
|
|
1608
|
+
e.fields.read_timeout = Q(e.fields.read_timeout + "");
|
|
1609
|
+
})
|
|
1610
|
+
],
|
|
1611
|
+
autocomplete: "off",
|
|
1612
|
+
"data-testid": "gateway-service-readTimeout-input",
|
|
1613
|
+
label: t(l)("gateway_services.form.fields.read_timeout.label"),
|
|
1614
|
+
"label-attributes": {
|
|
1615
|
+
info: t(l)("gateway_services.form.fields.read_timeout.tooltip"),
|
|
1616
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1617
|
+
},
|
|
1618
|
+
name: "readTimeout",
|
|
1619
|
+
readonly: e.isReadonly,
|
|
1620
|
+
type: "number"
|
|
1621
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1622
|
+
]),
|
|
1623
|
+
L.value ? (p(), w("div", Fa, [
|
|
1624
|
+
i.isCertificateSelectEnabled ? (p(), D(Se, {
|
|
1625
|
+
key: 0,
|
|
1626
|
+
modelValue: e.fields.client_certificate,
|
|
1627
|
+
"onUpdate:modelValue": [
|
|
1628
|
+
a[19] || (a[19] = (n) => e.fields.client_certificate = n),
|
|
1629
|
+
a[20] || (a[20] = (n) => j("client_certificate"))
|
|
1630
|
+
],
|
|
1631
|
+
clearable: "",
|
|
1632
|
+
"data-testid": "gateway-service-clientCert-select",
|
|
1633
|
+
"enable-filtering": "",
|
|
1634
|
+
error: !!e.formFieldErrors.client_certificate,
|
|
1635
|
+
"filter-function": () => !0,
|
|
1636
|
+
items: ge.value,
|
|
1637
|
+
label: t(l)("gateway_services.form.fields.client_certificate.label"),
|
|
1638
|
+
"label-attributes": {
|
|
1639
|
+
info: t(l)("gateway_services.form.fields.client_certificate.tooltip"),
|
|
1640
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1641
|
+
},
|
|
1642
|
+
loading: t(Ge),
|
|
1643
|
+
name: "clientCert",
|
|
1644
|
+
placeholder: t(l)("gateway_services.form.fields.client_certificate.select_placeholder"),
|
|
1645
|
+
readonly: e.isReadonly,
|
|
1646
|
+
width: "100%",
|
|
1647
|
+
onQueryChange: t(We)
|
|
1648
|
+
}, {
|
|
1649
|
+
"item-template": r(({ item: n }) => [
|
|
1650
|
+
C("div", Pa, [
|
|
1651
|
+
C("span", $a, _(n.value), 1),
|
|
1652
|
+
$e(n.value).length ? (p(), w("div", Ta, [
|
|
1653
|
+
(p(!0), w(Fe, null, Le($e(n.value), (Ve) => (p(), D(lt, {
|
|
1654
|
+
key: Ve,
|
|
1655
|
+
appearance: "info",
|
|
1656
|
+
"max-width": "150",
|
|
1657
|
+
"truncation-tooltip": ""
|
|
1658
|
+
}, {
|
|
1659
|
+
default: r(() => [
|
|
1660
|
+
P(_(Ve), 1)
|
|
1661
|
+
]),
|
|
1662
|
+
_: 2
|
|
1663
|
+
}, 1024))), 128))
|
|
1664
|
+
])) : F("", !0)
|
|
1665
|
+
])
|
|
1666
|
+
]),
|
|
1667
|
+
_: 1
|
|
1668
|
+
}, 8, ["modelValue", "error", "items", "label", "label-attributes", "loading", "placeholder", "readonly", "onQueryChange"])) : (p(), D(k, {
|
|
1669
|
+
key: 1,
|
|
1670
|
+
modelValue: e.fields.client_certificate,
|
|
1671
|
+
"onUpdate:modelValue": a[21] || (a[21] = (n) => e.fields.client_certificate = n),
|
|
1672
|
+
modelModifiers: { trim: !0 },
|
|
1673
|
+
autocomplete: "off",
|
|
1674
|
+
"data-testid": "gateway-service-clientCert-input",
|
|
1675
|
+
error: !!e.formFieldErrors.client_certificate,
|
|
1676
|
+
label: t(l)("gateway_services.form.fields.client_certificate.label"),
|
|
1677
|
+
"label-attributes": {
|
|
1678
|
+
info: t(l)("gateway_services.form.fields.client_certificate.tooltip"),
|
|
1679
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1680
|
+
},
|
|
1681
|
+
name: "clientCert",
|
|
1682
|
+
placeholder: t(l)("gateway_services.form.fields.client_certificate.placeholder"),
|
|
1683
|
+
readonly: e.isReadonly,
|
|
1684
|
+
type: "text",
|
|
1685
|
+
onInput: a[22] || (a[22] = (n) => j("client_certificate"))
|
|
1686
|
+
}, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"]))
|
|
1687
|
+
])) : F("", !0),
|
|
1688
|
+
L.value && i.isTlsSansSupported ? (p(), D(ut, {
|
|
1689
|
+
key: 1,
|
|
1690
|
+
modelValue: e.fields.tls_sans.dnsnames,
|
|
1691
|
+
"onUpdate:modelValue": a[23] || (a[23] = (n) => e.fields.tls_sans.dnsnames = n),
|
|
1692
|
+
"add-button-text": t(l)("gateway_services.form.fields.tls_sans_dnsnames.add"),
|
|
1693
|
+
class: "gateway-service-form-margin-bottom",
|
|
1694
|
+
"data-testid": "gateway-service-tls-sans-dnsnames",
|
|
1695
|
+
error: !!e.formFieldErrors.tls_sans_dnsnames,
|
|
1696
|
+
label: t(l)("gateway_services.form.fields.tls_sans_dnsnames.label"),
|
|
1697
|
+
placeholder: t(l)("gateway_services.form.fields.tls_sans_dnsnames.placeholder"),
|
|
1698
|
+
readonly: e.isReadonly,
|
|
1699
|
+
"test-id-prefix": "tls-sans-dnsnames",
|
|
1700
|
+
tooltip: t(l)("gateway_services.form.fields.tls_sans_dnsnames.tooltip"),
|
|
1701
|
+
onInput: a[24] || (a[24] = (n) => j("tls_sans_dnsnames"))
|
|
1702
|
+
}, null, 8, ["modelValue", "add-button-text", "error", "label", "placeholder", "readonly", "tooltip"])) : F("", !0),
|
|
1703
|
+
L.value && i.isTlsSansSupported ? (p(), D(ut, {
|
|
1704
|
+
key: 2,
|
|
1705
|
+
modelValue: e.fields.tls_sans.uris,
|
|
1706
|
+
"onUpdate:modelValue": a[25] || (a[25] = (n) => e.fields.tls_sans.uris = n),
|
|
1707
|
+
"add-button-text": t(l)("gateway_services.form.fields.tls_sans_uris.add"),
|
|
1708
|
+
class: "gateway-service-form-margin-bottom",
|
|
1709
|
+
"data-testid": "gateway-service-tls-sans-uris",
|
|
1710
|
+
error: !!e.formFieldErrors.tls_sans_uris,
|
|
1711
|
+
label: t(l)("gateway_services.form.fields.tls_sans_uris.label"),
|
|
1712
|
+
placeholder: t(l)("gateway_services.form.fields.tls_sans_uris.placeholder"),
|
|
1713
|
+
readonly: e.isReadonly,
|
|
1714
|
+
"test-id-prefix": "tls-sans-uris",
|
|
1715
|
+
tooltip: t(l)("gateway_services.form.fields.tls_sans_uris.tooltip"),
|
|
1716
|
+
onInput: a[26] || (a[26] = (n) => j("tls_sans_uris"))
|
|
1717
|
+
}, null, 8, ["modelValue", "add-button-text", "error", "label", "placeholder", "readonly", "tooltip"])) : F("", !0),
|
|
1718
|
+
ke.value ? (p(), w("div", xa, [
|
|
1719
|
+
i.isCertificateSelectEnabled ? (p(), D(vt, {
|
|
1720
|
+
key: 0,
|
|
1721
|
+
modelValue: e.fields.ca_certificates,
|
|
1722
|
+
"onUpdate:modelValue": [
|
|
1723
|
+
a[27] || (a[27] = (n) => e.fields.ca_certificates = n),
|
|
1724
|
+
a[28] || (a[28] = (n) => j("ca_certificates"))
|
|
1725
|
+
],
|
|
1726
|
+
autosuggest: "",
|
|
1727
|
+
"data-testid": "gateway-service-ca-certs-select",
|
|
1728
|
+
error: !!e.formFieldErrors.ca_certificates,
|
|
1729
|
+
items: Ze.value,
|
|
1730
|
+
label: t(l)("gateway_services.form.fields.ca_certificates.label"),
|
|
1731
|
+
"label-attributes": { tooltipAttributes: { maxWidth: "400" } },
|
|
1732
|
+
loading: t(ze),
|
|
1733
|
+
placeholder: t(l)("gateway_services.form.fields.ca_certificates.select_placeholder"),
|
|
1734
|
+
readonly: e.isReadonly,
|
|
1735
|
+
width: "100%",
|
|
1736
|
+
onQueryChange: t(je)
|
|
1737
|
+
}, {
|
|
1738
|
+
"item-template": r(({ item: n }) => [
|
|
1739
|
+
C("div", Ra, [
|
|
1740
|
+
C("div", Aa, [
|
|
1741
|
+
C("span", Ua, _(n.value), 1),
|
|
1742
|
+
B(n.value).length ? (p(), w("div", Da, [
|
|
1743
|
+
(p(!0), w(Fe, null, Le(B(n.value), (Ve) => (p(), D(lt, {
|
|
1744
|
+
key: Ve,
|
|
1745
|
+
appearance: "info",
|
|
1746
|
+
"max-width": "150",
|
|
1747
|
+
"truncation-tooltip": ""
|
|
1748
|
+
}, {
|
|
1749
|
+
default: r(() => [
|
|
1750
|
+
P(_(Ve), 1)
|
|
1751
|
+
]),
|
|
1752
|
+
_: 2
|
|
1753
|
+
}, 1024))), 128))
|
|
1754
|
+
])) : F("", !0)
|
|
1755
|
+
]),
|
|
1756
|
+
he(n.value) ? (p(), w("span", {
|
|
1757
|
+
key: 0,
|
|
1758
|
+
class: "certificate-select-item-issuer",
|
|
1759
|
+
title: he(n.value)
|
|
1760
|
+
}, _(he(n.value)), 9, Ba)) : F("", !0)
|
|
1761
|
+
])
|
|
1762
|
+
]),
|
|
1763
|
+
"label-tooltip": r(() => [
|
|
1764
|
+
c(t(R), {
|
|
1765
|
+
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1766
|
+
scope: "global"
|
|
1767
|
+
}, {
|
|
1768
|
+
code1: r(() => [
|
|
1769
|
+
C("code", null, _(t(l)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
1770
|
+
]),
|
|
1771
|
+
code2: r(() => [
|
|
1772
|
+
C("code", null, _(t(l)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
1773
|
+
]),
|
|
1774
|
+
_: 1
|
|
1775
|
+
})
|
|
1776
|
+
]),
|
|
1777
|
+
_: 1
|
|
1778
|
+
}, 8, ["modelValue", "error", "items", "label", "loading", "placeholder", "readonly", "onQueryChange"])) : (p(), D(k, {
|
|
1779
|
+
key: 1,
|
|
1780
|
+
modelValue: xe.value,
|
|
1781
|
+
"onUpdate:modelValue": a[29] || (a[29] = (n) => xe.value = n),
|
|
1782
|
+
modelModifiers: { trim: !0 },
|
|
1783
|
+
autocomplete: "off",
|
|
1784
|
+
"data-testid": "gateway-service-ca-certs-input",
|
|
1785
|
+
error: !!e.formFieldErrors.ca_certificates,
|
|
1786
|
+
label: t(l)("gateway_services.form.fields.ca_certificates.label"),
|
|
1787
|
+
"label-attributes": { tooltipAttributes: { maxWidth: "400" } },
|
|
1788
|
+
placeholder: t(l)("gateway_services.form.fields.ca_certificates.placeholder"),
|
|
1789
|
+
readonly: e.isReadonly,
|
|
1790
|
+
type: "text",
|
|
1791
|
+
onInput: a[30] || (a[30] = (n) => j("ca_certificates"))
|
|
1792
|
+
}, {
|
|
1793
|
+
"label-tooltip": r(() => [
|
|
1794
|
+
c(t(R), {
|
|
1795
|
+
keypath: "gateway_services.form.fields.ca_certificates.tooltip",
|
|
1796
|
+
scope: "global"
|
|
1797
|
+
}, {
|
|
1798
|
+
code1: r(() => [
|
|
1799
|
+
C("code", null, _(t(l)("gateway_services.form.fields.ca_certificates.code1")), 1)
|
|
1800
|
+
]),
|
|
1801
|
+
code2: r(() => [
|
|
1802
|
+
C("code", null, _(t(l)("gateway_services.form.fields.ca_certificates.code2")), 1)
|
|
1803
|
+
]),
|
|
1804
|
+
_: 1
|
|
1805
|
+
})
|
|
1806
|
+
]),
|
|
1807
|
+
_: 1
|
|
1808
|
+
}, 8, ["modelValue", "error", "label", "placeholder", "readonly"]))
|
|
1809
|
+
])) : F("", !0),
|
|
1810
|
+
L.value ? (p(), w("div", Ma, [
|
|
1811
|
+
c(yt, {
|
|
1812
|
+
modelValue: e.fields.tls_verify_enabled,
|
|
1813
|
+
"onUpdate:modelValue": a[31] || (a[31] = (n) => e.fields.tls_verify_enabled = n),
|
|
1814
|
+
"data-testid": "gateway-service-tls-verify-checkbox",
|
|
1815
|
+
description: t(l)("gateway_services.form.fields.tls_verify_enabled.help"),
|
|
1816
|
+
label: t(l)("gateway_services.form.fields.tls_verify_enabled.label"),
|
|
1817
|
+
"label-attributes": { tooltipAttributes: { maxWidth: "400" } }
|
|
1818
|
+
}, {
|
|
1819
|
+
tooltip: r(() => [
|
|
1820
|
+
c(t(R), {
|
|
1821
|
+
keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
|
|
1822
|
+
scope: "global"
|
|
1823
|
+
}, {
|
|
1824
|
+
code1: r(() => [
|
|
1825
|
+
C("code", null, _(t(l)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
|
|
1826
|
+
]),
|
|
1827
|
+
_: 1
|
|
1828
|
+
})
|
|
1829
|
+
]),
|
|
1830
|
+
_: 1
|
|
1831
|
+
}, 8, ["modelValue", "description", "label"]),
|
|
1832
|
+
e.fields.tls_verify_enabled ? (p(), w("div", Ka, [
|
|
1833
|
+
c(u, {
|
|
1834
|
+
modelValue: e.fields.tls_verify_value,
|
|
1835
|
+
"onUpdate:modelValue": a[32] || (a[32] = (n) => e.fields.tls_verify_value = n),
|
|
1836
|
+
"data-testid": "gateway-service-tls-verify-true-option",
|
|
1837
|
+
label: t(l)("gateway_services.form.fields.tls_verify_option.true.label"),
|
|
1838
|
+
"selected-value": !0
|
|
1839
|
+
}, null, 8, ["modelValue", "label"])
|
|
1840
|
+
])) : F("", !0),
|
|
1841
|
+
e.fields.tls_verify_enabled ? (p(), w("div", La, [
|
|
1842
|
+
c(u, {
|
|
1843
|
+
modelValue: e.fields.tls_verify_value,
|
|
1844
|
+
"onUpdate:modelValue": a[33] || (a[33] = (n) => e.fields.tls_verify_value = n),
|
|
1845
|
+
"data-testid": "gateway-service-tls-verify-false-option",
|
|
1846
|
+
label: t(l)("gateway_services.form.fields.tls_verify_option.false.label"),
|
|
1847
|
+
"selected-value": !1
|
|
1848
|
+
}, null, 8, ["modelValue", "label"])
|
|
1849
|
+
])) : F("", !0)
|
|
1850
|
+
])) : F("", !0)
|
|
1851
|
+
]))
|
|
1852
|
+
]),
|
|
1853
|
+
_: 1
|
|
1854
|
+
})
|
|
1855
|
+
]),
|
|
1856
|
+
_: 1
|
|
1857
|
+
}, 8, ["modelValue", "trigger-label"])
|
|
1858
|
+
]),
|
|
1859
|
+
_: 1
|
|
1860
|
+
}, 8, ["description", "hide-info-header", "title"]),
|
|
1861
|
+
c(t(dt), {
|
|
1862
|
+
description: t(l)("gateway_services.form.sections.general.description"),
|
|
1863
|
+
"hide-info-header": i.hideSectionsInfo,
|
|
1864
|
+
title: t(l)("gateway_services.form.sections.general.title")
|
|
1865
|
+
}, {
|
|
1866
|
+
default: r(() => [
|
|
1867
|
+
c(k, {
|
|
1868
|
+
modelValue: e.fields.name,
|
|
1869
|
+
"onUpdate:modelValue": a[35] || (a[35] = (n) => e.fields.name = n),
|
|
1870
|
+
modelModifiers: { trim: !0 },
|
|
1871
|
+
autocomplete: "off",
|
|
1872
|
+
"data-testid": "gateway-service-name-input",
|
|
1873
|
+
error: be.value,
|
|
1874
|
+
"error-message": le.value,
|
|
1875
|
+
label: t(l)("gateway_services.form.fields.name.label"),
|
|
1876
|
+
"label-attributes": {
|
|
1877
|
+
info: t(l)("gateway_services.form.fields.name.tooltip"),
|
|
1878
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1879
|
+
},
|
|
1880
|
+
name: "name",
|
|
1881
|
+
placeholder: t(l)("gateway_services.form.fields.name.placeholder"),
|
|
1882
|
+
readonly: e.isReadonly,
|
|
1883
|
+
type: "text",
|
|
1884
|
+
onInput: De
|
|
1885
|
+
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1886
|
+
c(it, {
|
|
1887
|
+
"data-testid": "tags-collapse",
|
|
1888
|
+
"trigger-alignment": "leading",
|
|
1889
|
+
"trigger-label": t(l)("gateway_services.form.fields.tags.collapse")
|
|
1890
|
+
}, {
|
|
1891
|
+
default: r(() => [
|
|
1892
|
+
C("div", Na, [
|
|
1893
|
+
c(k, {
|
|
1894
|
+
modelValue: e.fields.tags,
|
|
1895
|
+
"onUpdate:modelValue": a[36] || (a[36] = (n) => e.fields.tags = n),
|
|
1896
|
+
modelModifiers: { trim: !0 },
|
|
1897
|
+
autocomplete: "off",
|
|
1898
|
+
"data-testid": "gateway-service-tags-input",
|
|
1899
|
+
help: t(l)("gateway_services.form.fields.tags.help"),
|
|
1900
|
+
label: t(l)("gateway_services.form.fields.tags.label"),
|
|
1901
|
+
"label-attributes": {
|
|
1902
|
+
info: t(l)("gateway_services.form.fields.tags.tooltip"),
|
|
1903
|
+
tooltipAttributes: { maxWidth: "400" }
|
|
1904
|
+
},
|
|
1905
|
+
name: "tags",
|
|
1906
|
+
placeholder: t(l)("gateway_services.form.fields.tags.placeholder"),
|
|
1907
|
+
readonly: e.isReadonly,
|
|
1908
|
+
type: "text",
|
|
1909
|
+
onInput: a[37] || (a[37] = (n) => f("tags"))
|
|
1910
|
+
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
|
|
1911
|
+
])
|
|
1912
|
+
]),
|
|
1913
|
+
_: 1
|
|
1914
|
+
}, 8, ["trigger-label"])
|
|
1915
|
+
]),
|
|
1916
|
+
_: 1
|
|
1917
|
+
}, 8, ["description", "hide-info-header", "title"]),
|
|
1918
|
+
e.errorMessages.length ? (p(), D(_t, {
|
|
1919
|
+
key: 0,
|
|
1920
|
+
appearance: "danger",
|
|
1921
|
+
"data-testid": "form-error"
|
|
1922
|
+
}, {
|
|
1923
|
+
default: r(() => [
|
|
1924
|
+
C("ul", qa, [
|
|
1925
|
+
(p(!0), w(Fe, null, Le(e.errorMessages, (n) => (p(), w("li", { key: n }, _(n), 1))), 128))
|
|
1926
|
+
])
|
|
1927
|
+
]),
|
|
1928
|
+
_: 1
|
|
1929
|
+
})) : F("", !0)
|
|
1930
|
+
]),
|
|
1931
|
+
_: 3
|
|
1932
|
+
}, 8, ["can-submit", "config", "edit-id", "entity-type", "fetch-url", "form-fields", "is-readonly"])
|
|
1933
|
+
]);
|
|
1934
|
+
};
|
|
1935
|
+
}
|
|
1936
|
+
}), ts = /* @__PURE__ */ st(Wa, [["__scopeId", "data-v-a9f81e18"]]), { validateHost: Ga, validatePort: Oa, validateProtocol: ja, validatePath: za } = oe.useUrlValidators(), as = () => ({
|
|
1937
|
+
validateHost: Ga,
|
|
1938
|
+
validatePort: Oa,
|
|
1939
|
+
validateProtocol: ja,
|
|
1940
|
+
validatePath: za
|
|
1941
|
+
});
|
|
1942
|
+
export {
|
|
1943
|
+
es as GatewayServiceConfigCard,
|
|
1944
|
+
ts as GatewayServiceForm,
|
|
1945
|
+
Ya as GatewayServiceList,
|
|
1946
|
+
as as useUrlValidator
|
|
1947
|
+
};
|