@kong-ui-public/entities-upstreams-targets 3.12.22 → 3.12.23-pr.2722.b1aa23ae4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/dist/entities-upstreams-targets.es.js +0 -3701
- package/dist/entities-upstreams-targets.umd.js +0 -1
- package/dist/style.css +0 -1
- package/dist/types/components/TargetForm.vue.d.ts +0 -87
- package/dist/types/components/TargetForm.vue.d.ts.map +0 -1
- package/dist/types/components/TargetsList.vue.d.ts +0 -129
- package/dist/types/components/TargetsList.vue.d.ts.map +0 -1
- package/dist/types/components/UpstreamsConfigCard.vue.d.ts +0 -62
- package/dist/types/components/UpstreamsConfigCard.vue.d.ts.map +0 -1
- package/dist/types/components/UpstreamsForm.vue.d.ts +0 -43
- package/dist/types/components/UpstreamsForm.vue.d.ts.map +0 -1
- package/dist/types/components/UpstreamsFormActiveHealthCheck.vue.d.ts +0 -179
- package/dist/types/components/UpstreamsFormActiveHealthCheck.vue.d.ts.map +0 -1
- package/dist/types/components/UpstreamsFormGeneralInfo.vue.d.ts +0 -69
- package/dist/types/components/UpstreamsFormGeneralInfo.vue.d.ts.map +0 -1
- package/dist/types/components/UpstreamsFormHealthChecks.vue.d.ts +0 -49
- package/dist/types/components/UpstreamsFormHealthChecks.vue.d.ts.map +0 -1
- package/dist/types/components/UpstreamsFormLoadBalancing.vue.d.ts +0 -172
- package/dist/types/components/UpstreamsFormLoadBalancing.vue.d.ts.map +0 -1
- package/dist/types/components/UpstreamsFormPassiveHealthCheck.vue.d.ts +0 -91
- package/dist/types/components/UpstreamsFormPassiveHealthCheck.vue.d.ts.map +0 -1
- package/dist/types/components/UpstreamsList.vue.d.ts +0 -106
- package/dist/types/components/UpstreamsList.vue.d.ts.map +0 -1
- package/dist/types/composables/index.d.ts +0 -10
- package/dist/types/composables/index.d.ts.map +0 -1
- package/dist/types/composables/useHelpers.d.ts +0 -12
- package/dist/types/composables/useHelpers.d.ts.map +0 -1
- package/dist/types/composables/useI18n.d.ts +0 -9
- package/dist/types/composables/useI18n.d.ts.map +0 -1
- package/dist/types/composables/useMultiselectCreation.d.ts +0 -23
- package/dist/types/composables/useMultiselectCreation.d.ts.map +0 -1
- package/dist/types/constants.d.ts +0 -22
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -12
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/links.d.ts +0 -6
- package/dist/types/links.d.ts.map +0 -1
- package/dist/types/targets-endpoints.d.ts +0 -18
- package/dist/types/targets-endpoints.d.ts.map +0 -1
- package/dist/types/types/index.d.ts +0 -18
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/types/target-form.d.ts +0 -30
- package/dist/types/types/target-form.d.ts.map +0 -1
- package/dist/types/types/targets-list.d.ts +0 -18
- package/dist/types/types/targets-list.d.ts.map +0 -1
- package/dist/types/types/upstreams-config.d.ts +0 -29
- package/dist/types/types/upstreams-config.d.ts.map +0 -1
- package/dist/types/types/upstreams-form.d.ts +0 -168
- package/dist/types/types/upstreams-form.d.ts.map +0 -1
- package/dist/types/types/upstreams-list.d.ts +0 -19
- package/dist/types/types/upstreams-list.d.ts.map +0 -1
- package/dist/types/upstreams-endpoints.d.ts +0 -22
- package/dist/types/upstreams-endpoints.d.ts.map +0 -1
|
@@ -1,3701 +0,0 @@
|
|
|
1
|
-
import { ref as R, defineComponent as ne, computed as U, watch as de, onBeforeMount as De, resolveComponent as P, createElementBlock as oe, openBlock as q, createVNode as u, unref as e, createSlots as Ie, withCtx as n, createTextVNode as Q, toDisplayString as f, createElementVNode as v, createBlock as E, Teleport as bt, createCommentVNode as B, reactive as qe, renderSlot as vt, Fragment as Ce, renderList as Pt, normalizeClass as $t } from "vue";
|
|
2
|
-
import { useAxios as $e, useTableState as At, useFetcher as kt, useDeleteUrlBuilder as _t, FetcherStatus as Ct, EntityBaseTable as St, PermissionsWrapper as ce, TableTags as Ht, EntityFilter as Mt, EntityDeleteModal as Ut, EntityTypes as It, useErrors as qt, EntityBaseFormType as ue, EntityBaseForm as wt, SupportedEntityType as Le, useDebouncedFilter as mt, EntityFormSection as He, useHelpers as Kt, ConfigurationSchemaType as Vt, ConfigurationSchemaSection as he, EntityBaseConfigCard as Et } from "@kong-ui-public/entities-shared";
|
|
3
|
-
import { useRouter as Tt } from "vue-router";
|
|
4
|
-
import { BookIcon as ft, AddIcon as we, CloudUploadIcon as Nt, TrashIcon as Bt } from "@kong/icons";
|
|
5
|
-
import { createI18n as Rt, i18nTComponent as Dt } from "@kong-ui-public/i18n";
|
|
6
|
-
const Lt = {
|
|
7
|
-
list: {
|
|
8
|
-
table_headers: {
|
|
9
|
-
id: "ID",
|
|
10
|
-
name: "Name",
|
|
11
|
-
slots: "Slots",
|
|
12
|
-
tags: "Tags"
|
|
13
|
-
},
|
|
14
|
-
empty_state: {
|
|
15
|
-
title: "Configure a New Upstream",
|
|
16
|
-
description: "Upstreams are used to load balance incoming requests."
|
|
17
|
-
},
|
|
18
|
-
empty_state_v2: {
|
|
19
|
-
title: "Configure your first upstream",
|
|
20
|
-
description: "Upstreams route traffic to multiple backend services, handling load balancing, health checks, and circuit breaking for reliability.",
|
|
21
|
-
create_cta: "New upstream",
|
|
22
|
-
group: "Upstreams created in gateways within this group will automatically appear here.",
|
|
23
|
-
learn_more: "Learn more"
|
|
24
|
-
},
|
|
25
|
-
toolbar_actions: {
|
|
26
|
-
new_upstream: "New upstream"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
title: "Upstreams",
|
|
30
|
-
search: {
|
|
31
|
-
placeholder: "Filter by exact name or ID"
|
|
32
|
-
},
|
|
33
|
-
actions: {
|
|
34
|
-
create: "New upstream",
|
|
35
|
-
copy_id: "Copy ID",
|
|
36
|
-
copy_json: "Copy JSON",
|
|
37
|
-
edit: "Edit",
|
|
38
|
-
delete: "Delete",
|
|
39
|
-
view: "View Details"
|
|
40
|
-
},
|
|
41
|
-
delete: {
|
|
42
|
-
title: "Delete an Upstream",
|
|
43
|
-
description: "This action cannot be reversed so make sure to check upstream usage before deleting."
|
|
44
|
-
},
|
|
45
|
-
errors: {
|
|
46
|
-
general: "Upstreams could not be retrieved",
|
|
47
|
-
delete: "The upstream could not be deleted at this time.",
|
|
48
|
-
copy: "Failed to copy to clipboard"
|
|
49
|
-
},
|
|
50
|
-
copy: {
|
|
51
|
-
success: "Copied {val} to clipboard",
|
|
52
|
-
success_brief: "Successfully copied to clipboard"
|
|
53
|
-
},
|
|
54
|
-
form: {
|
|
55
|
-
errors: {
|
|
56
|
-
name_required: "Name is required",
|
|
57
|
-
should_be_integer: "Field should contain an integer",
|
|
58
|
-
in_range: "Accepts an integer in the range of 10 - 65536"
|
|
59
|
-
},
|
|
60
|
-
general_info: {
|
|
61
|
-
title: "General Information",
|
|
62
|
-
help: "General information will help identify and manage this Upstream."
|
|
63
|
-
},
|
|
64
|
-
load_balancing: {
|
|
65
|
-
title: "Load Balancing",
|
|
66
|
-
help: "Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."
|
|
67
|
-
},
|
|
68
|
-
health_check: {
|
|
69
|
-
title: "Health Checks & Circuit Breakers",
|
|
70
|
-
help: "Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."
|
|
71
|
-
},
|
|
72
|
-
active_health_check: {
|
|
73
|
-
title: "Active Health Checks",
|
|
74
|
-
help: "Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."
|
|
75
|
-
},
|
|
76
|
-
passive_health_check: {
|
|
77
|
-
title: "Passive Health Checks",
|
|
78
|
-
help: "Passive health checks, also known as circuit breakers, are checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."
|
|
79
|
-
},
|
|
80
|
-
buttons: {
|
|
81
|
-
view_documentation: "View documentation"
|
|
82
|
-
},
|
|
83
|
-
algorithms: {
|
|
84
|
-
round_robin_label: "Round Robin",
|
|
85
|
-
least_connections_label: "Least Connections",
|
|
86
|
-
consistent_hashing_label: "Consistent Hashing",
|
|
87
|
-
latency_label: "Latency",
|
|
88
|
-
sticky_sessions_label: "Sticky Sessions"
|
|
89
|
-
},
|
|
90
|
-
hash_labels: {
|
|
91
|
-
none: "None",
|
|
92
|
-
consumer: "Consumer",
|
|
93
|
-
ip: "IP",
|
|
94
|
-
header: "Header",
|
|
95
|
-
cookie: "Cookie",
|
|
96
|
-
path: "Path",
|
|
97
|
-
query_argument: "Query Argument",
|
|
98
|
-
uri_capture: "URI Capture"
|
|
99
|
-
},
|
|
100
|
-
hash_tooltips: {
|
|
101
|
-
hash_on_header: {
|
|
102
|
-
text: "The header name to take the value from as hash input. Only required when {hash_on} is set to {header}",
|
|
103
|
-
hash_on: "hash_on",
|
|
104
|
-
header: "header"
|
|
105
|
-
},
|
|
106
|
-
hash_on_uri_capture: {
|
|
107
|
-
text: "The name of the route URI capture to take the value from as hash input. Only required when {hash_on} is set to {uri_capture}",
|
|
108
|
-
hash_on: "hash_on",
|
|
109
|
-
uri_capture: "uri_capture"
|
|
110
|
-
},
|
|
111
|
-
hash_on_query_arg: {
|
|
112
|
-
text: "The name of the query string argument to take the value from as hash input. Only required when {hash_on} is set to {query_arg}",
|
|
113
|
-
hash_on: "hash_on",
|
|
114
|
-
query_arg: "query_arg"
|
|
115
|
-
},
|
|
116
|
-
hash_on_cookie: {
|
|
117
|
-
text: "The cookie name to take the value from as hash input. Only required when {hash_on} or {hash_fallback} is set to {cookie}. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.",
|
|
118
|
-
hash_on: "hash_on",
|
|
119
|
-
hash_fallback: "hash_fallback",
|
|
120
|
-
cookie: "cookie"
|
|
121
|
-
},
|
|
122
|
-
hash_on_cookie_path: {
|
|
123
|
-
text: "The cookie path to set in the response headers. Only required when {hash_on} or {hash_fallback} is set to {cookie}.",
|
|
124
|
-
hash_on: "hash_on",
|
|
125
|
-
hash_fallback: "hash_fallback",
|
|
126
|
-
cookie: "cookie"
|
|
127
|
-
},
|
|
128
|
-
slots: {
|
|
129
|
-
text: "The number of slots in the load balancer algorithm. If {algorithm} is set to {round_robin}, this setting determines the maximum number of slots. If {algorithm} is set to {consistent_hashing}, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range {min}-{max}",
|
|
130
|
-
algorithm: "algorithm",
|
|
131
|
-
round_robin: "round-robin",
|
|
132
|
-
consistent_hashing: "consistent-hashing"
|
|
133
|
-
},
|
|
134
|
-
tags: "An optional set of strings associated with the Upstream for grouping and filtering.",
|
|
135
|
-
hash_fallback: {
|
|
136
|
-
text: "What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}",
|
|
137
|
-
hash_on: "hash_on",
|
|
138
|
-
cookie: "cookie"
|
|
139
|
-
},
|
|
140
|
-
hash_fallback_header: {
|
|
141
|
-
text: "The header name to take the value from as hash input. Only required when {hash_fallback} is set to {header}",
|
|
142
|
-
hash_fallback: "hash_fallback",
|
|
143
|
-
header: "header"
|
|
144
|
-
},
|
|
145
|
-
hash_fallback_query_arg: {
|
|
146
|
-
text: "The name of the query string argument to take the value from as hash input. Only required when {hash_fallback} is set to {query_arg}",
|
|
147
|
-
hash_fallback: "hash_fallback",
|
|
148
|
-
query_arg: "query_arg"
|
|
149
|
-
},
|
|
150
|
-
hash_fallback_uri_capture: {
|
|
151
|
-
text: "The name of the route URI capture to take the value from as hash input. Only required when {hash_fallback} is set to {uri_capture}",
|
|
152
|
-
hash_fallback: "hash_fallback",
|
|
153
|
-
uri_capture: "uri_capture"
|
|
154
|
-
},
|
|
155
|
-
host_header: {
|
|
156
|
-
text: "The hostname to be used as {host} header when proxying requests through Kong.",
|
|
157
|
-
host: "Host"
|
|
158
|
-
},
|
|
159
|
-
client_certificate: "If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."
|
|
160
|
-
},
|
|
161
|
-
healthcheck_type_labels: {
|
|
162
|
-
http: "HTTP",
|
|
163
|
-
https: "HTTPS",
|
|
164
|
-
tcp: "TCP",
|
|
165
|
-
grsp: "gRPC",
|
|
166
|
-
grsps: "gRPCs"
|
|
167
|
-
},
|
|
168
|
-
healthy: {
|
|
169
|
-
label: "Healthy",
|
|
170
|
-
help: "The counter thresholds to determine whether targets are healthy."
|
|
171
|
-
},
|
|
172
|
-
unhealthy: {
|
|
173
|
-
label: "Unhealthy",
|
|
174
|
-
help: "The counter thresholds to determine whether targets are unhealthy."
|
|
175
|
-
},
|
|
176
|
-
passive_healthy: {
|
|
177
|
-
label: "Healthy",
|
|
178
|
-
help: "The counter thresholds to determine whether targets are healthy."
|
|
179
|
-
},
|
|
180
|
-
passive_unhealthy: {
|
|
181
|
-
label: "Unhealthy",
|
|
182
|
-
help: "The counter thresholds to determine whether targets are unhealthy."
|
|
183
|
-
},
|
|
184
|
-
fields: {
|
|
185
|
-
name: {
|
|
186
|
-
label: "Name",
|
|
187
|
-
placeholder: "Enter or select a host",
|
|
188
|
-
tooltip: "This is a hostname, which must be equal to the {host} of a Service.",
|
|
189
|
-
host: "host"
|
|
190
|
-
},
|
|
191
|
-
host_header: {
|
|
192
|
-
label: "Host Header"
|
|
193
|
-
},
|
|
194
|
-
client_certificate: {
|
|
195
|
-
label: "Client Certificate",
|
|
196
|
-
placeholder: "Select or enter a Certificate ID",
|
|
197
|
-
tooltip: "If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."
|
|
198
|
-
},
|
|
199
|
-
tags: {
|
|
200
|
-
label: "Tags",
|
|
201
|
-
placeholder: "Enter a list of tags separated by comma",
|
|
202
|
-
help: "e.g. tag1, tag2, tag3",
|
|
203
|
-
tooltip: "An optional set of strings associated with the Upstream for grouping and filtering."
|
|
204
|
-
},
|
|
205
|
-
algorithm: {
|
|
206
|
-
label: "Algorithm",
|
|
207
|
-
tooltip: "Which load balancing algorithm to use."
|
|
208
|
-
},
|
|
209
|
-
sticky_sessions_cookie: {
|
|
210
|
-
label: "Sticky Sessions Cookie",
|
|
211
|
-
tooltip: "The cookie name to keep sticky sessions."
|
|
212
|
-
},
|
|
213
|
-
sticky_sessions_cookie_path: {
|
|
214
|
-
label: "Sticky Sessions Cookie Path",
|
|
215
|
-
tooltip: "A string representing a URL path, such as /path/to/resource. Must start with a forward slash (/) and must not contain empty segments (i.e., two consecutive forward slashes)."
|
|
216
|
-
},
|
|
217
|
-
slots: {
|
|
218
|
-
label: "Slots",
|
|
219
|
-
help: "Accepts an integer in the range of 10 - 65536"
|
|
220
|
-
},
|
|
221
|
-
hash_on: {
|
|
222
|
-
label: "Hash on",
|
|
223
|
-
help: "What to use as hashing input.",
|
|
224
|
-
tooltip: "What to use as hashing input. Using {result} results in a weighted-round-robin scheme with no hashing."
|
|
225
|
-
},
|
|
226
|
-
hash_fallback: {
|
|
227
|
-
label: "Hash Fallback",
|
|
228
|
-
help: "What to use as hashing input if the primary hash_on does not return a hash",
|
|
229
|
-
tooltip: "What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}.",
|
|
230
|
-
hash_on: "hash_on",
|
|
231
|
-
cookie: "cookie"
|
|
232
|
-
},
|
|
233
|
-
active_health_checks: {
|
|
234
|
-
label: "Active Health Checks",
|
|
235
|
-
help: "Actively probe the targets for their health."
|
|
236
|
-
},
|
|
237
|
-
passive_health_checks: {
|
|
238
|
-
label: "Passive Health Checks / Circuit Breakers",
|
|
239
|
-
help: "Checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."
|
|
240
|
-
},
|
|
241
|
-
healthchecks_threshold: {
|
|
242
|
-
label: "Healthchecks Threshold"
|
|
243
|
-
},
|
|
244
|
-
header: {
|
|
245
|
-
label: "Header"
|
|
246
|
-
},
|
|
247
|
-
headers: {
|
|
248
|
-
label: "Headers",
|
|
249
|
-
tooltip_active: "Header values can be separated by commas (value1, value2, value3)."
|
|
250
|
-
},
|
|
251
|
-
cookie: {
|
|
252
|
-
label: "Cookie"
|
|
253
|
-
},
|
|
254
|
-
cookie_path: {
|
|
255
|
-
label: "Cookie Path"
|
|
256
|
-
},
|
|
257
|
-
query_argument: {
|
|
258
|
-
label: "Query Argument"
|
|
259
|
-
},
|
|
260
|
-
uri_capture: {
|
|
261
|
-
label: "URI Capture"
|
|
262
|
-
},
|
|
263
|
-
active_healthcheck_type: {
|
|
264
|
-
label: "Active Health Check Type"
|
|
265
|
-
},
|
|
266
|
-
http_path: {
|
|
267
|
-
label: "HTTP Path"
|
|
268
|
-
},
|
|
269
|
-
timeout: {
|
|
270
|
-
label: "Timeout"
|
|
271
|
-
},
|
|
272
|
-
concurrency: {
|
|
273
|
-
label: "Concurrency"
|
|
274
|
-
},
|
|
275
|
-
https_sni: {
|
|
276
|
-
label: "HTTPS SNI"
|
|
277
|
-
},
|
|
278
|
-
verify_ssl: {
|
|
279
|
-
label: "Verify the SSL certificate when performing active health checks using HTTPS"
|
|
280
|
-
},
|
|
281
|
-
interval: {
|
|
282
|
-
label: "Interval",
|
|
283
|
-
help: "A value of zero indicates that active probes for healthy targets are disabled."
|
|
284
|
-
},
|
|
285
|
-
successes: {
|
|
286
|
-
label: "Successes"
|
|
287
|
-
},
|
|
288
|
-
http_statuses: {
|
|
289
|
-
label: "HTTP Statuses"
|
|
290
|
-
},
|
|
291
|
-
http_failures: {
|
|
292
|
-
label: "HTTP Failures"
|
|
293
|
-
},
|
|
294
|
-
tcp_failures: {
|
|
295
|
-
label: "TCP Failures"
|
|
296
|
-
},
|
|
297
|
-
timeouts: {
|
|
298
|
-
label: "Timeouts"
|
|
299
|
-
},
|
|
300
|
-
passive_health_check_type: {
|
|
301
|
-
label: "Passive Health Check Type"
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
labels: {
|
|
306
|
-
created_at: "Created at"
|
|
307
|
-
}
|
|
308
|
-
}, jt = {
|
|
309
|
-
list: {
|
|
310
|
-
table_headers: {
|
|
311
|
-
id: "ID",
|
|
312
|
-
target_address: "Target Address",
|
|
313
|
-
weight: "Weight",
|
|
314
|
-
tags: "Tags",
|
|
315
|
-
target_type: "Target Type"
|
|
316
|
-
},
|
|
317
|
-
empty_state: {
|
|
318
|
-
title: "Configure a New Target",
|
|
319
|
-
description: "A target is an IP address/hostname with a port that identifies an instance of a backend service."
|
|
320
|
-
},
|
|
321
|
-
toolbar_actions: {
|
|
322
|
-
new_target: "New Target"
|
|
323
|
-
}
|
|
324
|
-
},
|
|
325
|
-
title: "Targets",
|
|
326
|
-
actions: {
|
|
327
|
-
create: "New Target",
|
|
328
|
-
copy_id: "Copy ID",
|
|
329
|
-
copy_json: "Copy JSON",
|
|
330
|
-
edit: "Edit",
|
|
331
|
-
delete: "Delete",
|
|
332
|
-
mark_healthy: "Mark Healthy",
|
|
333
|
-
mark_unhealthy: "Mark Unhealthy"
|
|
334
|
-
},
|
|
335
|
-
delete: {
|
|
336
|
-
title: "Delete a Target",
|
|
337
|
-
description: "This action cannot be reversed so make sure to check target usage before deleting."
|
|
338
|
-
},
|
|
339
|
-
errors: {
|
|
340
|
-
general: "Targets could not be retrieved",
|
|
341
|
-
delete: "The target could not be deleted at this time.",
|
|
342
|
-
copy: "Failed to copy to clipboard",
|
|
343
|
-
weight: "Value must be in range 0 to 65535"
|
|
344
|
-
},
|
|
345
|
-
copy: {
|
|
346
|
-
success: "Copied {val} to clipboard",
|
|
347
|
-
success_brief: "Successfully copied to clipboard"
|
|
348
|
-
},
|
|
349
|
-
form: {
|
|
350
|
-
create: {
|
|
351
|
-
title: "New Target"
|
|
352
|
-
},
|
|
353
|
-
edit: {
|
|
354
|
-
title: "Edit Target"
|
|
355
|
-
},
|
|
356
|
-
buttons: {
|
|
357
|
-
save: "Save",
|
|
358
|
-
cancel: "Cancel"
|
|
359
|
-
},
|
|
360
|
-
fields: {
|
|
361
|
-
target: {
|
|
362
|
-
label: "Target Address",
|
|
363
|
-
placeholder: "Enter IP/hostname and port",
|
|
364
|
-
tooltip: "The target address (IP or hostname) and port. If omitted the port defaults to 8000."
|
|
365
|
-
},
|
|
366
|
-
weight: {
|
|
367
|
-
label: "Weight",
|
|
368
|
-
tooltip: "The weight of this target in relation to other targets in the upstream. Value must be in range 0 to 65535, defaults to 100."
|
|
369
|
-
},
|
|
370
|
-
tags: {
|
|
371
|
-
label: "Tags",
|
|
372
|
-
placeholder: "Enter a list of tags separated by comma",
|
|
373
|
-
help: "e.g. tag1, tag2, tag3"
|
|
374
|
-
},
|
|
375
|
-
failover: {
|
|
376
|
-
label: "Failover Target",
|
|
377
|
-
load_balance_target: "Load balance",
|
|
378
|
-
failover_target: "Failover",
|
|
379
|
-
help: "Whether to use this target only as backup.",
|
|
380
|
-
unsupported: "The current load balance algorithm does not support failover."
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}, Qt = {
|
|
385
|
-
upstreams: Lt,
|
|
386
|
-
targets: jt
|
|
387
|
-
};
|
|
388
|
-
function Wt() {
|
|
389
|
-
const a = Rt("en-us", Qt);
|
|
390
|
-
return {
|
|
391
|
-
i18n: a,
|
|
392
|
-
i18nT: Dt(a)
|
|
393
|
-
// Translation component <i18n-t>
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
function Se(a) {
|
|
397
|
-
const { replaceId: D = !1 } = a, i = R([]);
|
|
398
|
-
return {
|
|
399
|
-
addedItems: i,
|
|
400
|
-
trackNewItems: (h, g) => {
|
|
401
|
-
if (g) {
|
|
402
|
-
const y = { ...h };
|
|
403
|
-
D && (y.value = h.label), i.value.push(y);
|
|
404
|
-
} else
|
|
405
|
-
i.value = i.value.filter((y) => y.value !== h.value);
|
|
406
|
-
}
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
const Te = [
|
|
410
|
-
{
|
|
411
|
-
label: "100",
|
|
412
|
-
value: "100"
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
label: "101",
|
|
416
|
-
value: "101"
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
label: "102",
|
|
420
|
-
value: "102"
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
label: "103",
|
|
424
|
-
value: "103"
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
label: "200",
|
|
428
|
-
value: "200"
|
|
429
|
-
},
|
|
430
|
-
{
|
|
431
|
-
label: "201",
|
|
432
|
-
value: "201"
|
|
433
|
-
},
|
|
434
|
-
{
|
|
435
|
-
label: "202",
|
|
436
|
-
value: "202"
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
label: "203",
|
|
440
|
-
value: "203"
|
|
441
|
-
},
|
|
442
|
-
{
|
|
443
|
-
label: "204",
|
|
444
|
-
value: "204"
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
label: "205",
|
|
448
|
-
value: "205"
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
label: "206",
|
|
452
|
-
value: "206"
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
label: "207",
|
|
456
|
-
value: "207"
|
|
457
|
-
},
|
|
458
|
-
{
|
|
459
|
-
label: "208",
|
|
460
|
-
value: "208"
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
label: "226",
|
|
464
|
-
value: "226"
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
label: "300",
|
|
468
|
-
value: "300"
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
label: "301",
|
|
472
|
-
value: "301"
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
label: "302",
|
|
476
|
-
value: "302"
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
label: "303",
|
|
480
|
-
value: "303"
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
label: "304",
|
|
484
|
-
value: "304"
|
|
485
|
-
},
|
|
486
|
-
{
|
|
487
|
-
label: "305",
|
|
488
|
-
value: "305"
|
|
489
|
-
},
|
|
490
|
-
{
|
|
491
|
-
label: "306",
|
|
492
|
-
value: "306"
|
|
493
|
-
},
|
|
494
|
-
{
|
|
495
|
-
label: "307",
|
|
496
|
-
value: "307"
|
|
497
|
-
},
|
|
498
|
-
{
|
|
499
|
-
label: "308",
|
|
500
|
-
value: "308"
|
|
501
|
-
},
|
|
502
|
-
{
|
|
503
|
-
label: "400",
|
|
504
|
-
value: "400"
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
label: "401",
|
|
508
|
-
value: "401"
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
label: "402",
|
|
512
|
-
value: "402"
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
label: "403",
|
|
516
|
-
value: "403"
|
|
517
|
-
},
|
|
518
|
-
{
|
|
519
|
-
label: "404",
|
|
520
|
-
value: "404"
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
label: "405",
|
|
524
|
-
value: "405"
|
|
525
|
-
},
|
|
526
|
-
{
|
|
527
|
-
label: "406",
|
|
528
|
-
value: "406"
|
|
529
|
-
},
|
|
530
|
-
{
|
|
531
|
-
label: "407",
|
|
532
|
-
value: "407"
|
|
533
|
-
},
|
|
534
|
-
{
|
|
535
|
-
label: "408",
|
|
536
|
-
value: "408"
|
|
537
|
-
},
|
|
538
|
-
{
|
|
539
|
-
label: "409",
|
|
540
|
-
value: "409"
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
label: "410",
|
|
544
|
-
value: "410"
|
|
545
|
-
},
|
|
546
|
-
{
|
|
547
|
-
label: "411",
|
|
548
|
-
value: "411"
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
label: "412",
|
|
552
|
-
value: "412"
|
|
553
|
-
},
|
|
554
|
-
{
|
|
555
|
-
label: "413",
|
|
556
|
-
value: "413"
|
|
557
|
-
},
|
|
558
|
-
{
|
|
559
|
-
label: "414",
|
|
560
|
-
value: "414"
|
|
561
|
-
},
|
|
562
|
-
{
|
|
563
|
-
label: "415",
|
|
564
|
-
value: "415"
|
|
565
|
-
},
|
|
566
|
-
{
|
|
567
|
-
label: "416",
|
|
568
|
-
value: "416"
|
|
569
|
-
},
|
|
570
|
-
{
|
|
571
|
-
label: "417",
|
|
572
|
-
value: "417"
|
|
573
|
-
},
|
|
574
|
-
{
|
|
575
|
-
label: "418",
|
|
576
|
-
value: "418"
|
|
577
|
-
},
|
|
578
|
-
{
|
|
579
|
-
label: "419",
|
|
580
|
-
value: "419"
|
|
581
|
-
},
|
|
582
|
-
{
|
|
583
|
-
label: "420",
|
|
584
|
-
value: "420"
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
label: "421",
|
|
588
|
-
value: "421"
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
label: "422",
|
|
592
|
-
value: "422"
|
|
593
|
-
},
|
|
594
|
-
{
|
|
595
|
-
label: "423",
|
|
596
|
-
value: "423"
|
|
597
|
-
},
|
|
598
|
-
{
|
|
599
|
-
label: "424",
|
|
600
|
-
value: "424"
|
|
601
|
-
},
|
|
602
|
-
{
|
|
603
|
-
label: "425",
|
|
604
|
-
value: "425"
|
|
605
|
-
},
|
|
606
|
-
{
|
|
607
|
-
label: "426",
|
|
608
|
-
value: "426"
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
label: "428",
|
|
612
|
-
value: "428"
|
|
613
|
-
},
|
|
614
|
-
{
|
|
615
|
-
label: "429",
|
|
616
|
-
value: "429"
|
|
617
|
-
},
|
|
618
|
-
{
|
|
619
|
-
label: "430",
|
|
620
|
-
value: "430"
|
|
621
|
-
},
|
|
622
|
-
{
|
|
623
|
-
label: "431",
|
|
624
|
-
value: "431"
|
|
625
|
-
},
|
|
626
|
-
{
|
|
627
|
-
label: "440",
|
|
628
|
-
value: "440"
|
|
629
|
-
},
|
|
630
|
-
{
|
|
631
|
-
label: "444",
|
|
632
|
-
value: "444"
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
label: "449",
|
|
636
|
-
value: "449"
|
|
637
|
-
},
|
|
638
|
-
{
|
|
639
|
-
label: "450",
|
|
640
|
-
value: "450"
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
label: "451",
|
|
644
|
-
value: "451"
|
|
645
|
-
},
|
|
646
|
-
{
|
|
647
|
-
label: "460",
|
|
648
|
-
value: "460"
|
|
649
|
-
},
|
|
650
|
-
{
|
|
651
|
-
label: "463",
|
|
652
|
-
value: "463"
|
|
653
|
-
},
|
|
654
|
-
{
|
|
655
|
-
label: "494",
|
|
656
|
-
value: "494"
|
|
657
|
-
},
|
|
658
|
-
{
|
|
659
|
-
label: "495",
|
|
660
|
-
value: "495"
|
|
661
|
-
},
|
|
662
|
-
{
|
|
663
|
-
label: "496",
|
|
664
|
-
value: "496"
|
|
665
|
-
},
|
|
666
|
-
{
|
|
667
|
-
label: "497",
|
|
668
|
-
value: "497"
|
|
669
|
-
},
|
|
670
|
-
{
|
|
671
|
-
label: "498",
|
|
672
|
-
value: "498"
|
|
673
|
-
},
|
|
674
|
-
{
|
|
675
|
-
label: "499",
|
|
676
|
-
value: "499"
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
label: "500",
|
|
680
|
-
value: "500"
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
label: "501",
|
|
684
|
-
value: "501"
|
|
685
|
-
},
|
|
686
|
-
{
|
|
687
|
-
label: "502",
|
|
688
|
-
value: "502"
|
|
689
|
-
},
|
|
690
|
-
{
|
|
691
|
-
label: "503",
|
|
692
|
-
value: "503"
|
|
693
|
-
},
|
|
694
|
-
{
|
|
695
|
-
label: "504",
|
|
696
|
-
value: "504"
|
|
697
|
-
},
|
|
698
|
-
{
|
|
699
|
-
label: "505",
|
|
700
|
-
value: "505"
|
|
701
|
-
},
|
|
702
|
-
{
|
|
703
|
-
label: "506",
|
|
704
|
-
value: "506"
|
|
705
|
-
},
|
|
706
|
-
{
|
|
707
|
-
label: "507",
|
|
708
|
-
value: "507"
|
|
709
|
-
},
|
|
710
|
-
{
|
|
711
|
-
label: "508",
|
|
712
|
-
value: "508"
|
|
713
|
-
},
|
|
714
|
-
{
|
|
715
|
-
label: "509",
|
|
716
|
-
value: "509"
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
label: "510",
|
|
720
|
-
value: "510"
|
|
721
|
-
},
|
|
722
|
-
{
|
|
723
|
-
label: "511",
|
|
724
|
-
value: "511"
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
label: "520",
|
|
728
|
-
value: "520"
|
|
729
|
-
},
|
|
730
|
-
{
|
|
731
|
-
label: "521",
|
|
732
|
-
value: "521"
|
|
733
|
-
},
|
|
734
|
-
{
|
|
735
|
-
label: "522",
|
|
736
|
-
value: "522"
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
label: "523",
|
|
740
|
-
value: "523"
|
|
741
|
-
},
|
|
742
|
-
{
|
|
743
|
-
label: "524",
|
|
744
|
-
value: "524"
|
|
745
|
-
},
|
|
746
|
-
{
|
|
747
|
-
label: "525",
|
|
748
|
-
value: "525"
|
|
749
|
-
},
|
|
750
|
-
{
|
|
751
|
-
label: "526",
|
|
752
|
-
value: "526"
|
|
753
|
-
},
|
|
754
|
-
{
|
|
755
|
-
label: "527",
|
|
756
|
-
value: "527"
|
|
757
|
-
},
|
|
758
|
-
{
|
|
759
|
-
label: "529",
|
|
760
|
-
value: "529"
|
|
761
|
-
},
|
|
762
|
-
{
|
|
763
|
-
label: "530",
|
|
764
|
-
value: "530"
|
|
765
|
-
},
|
|
766
|
-
{
|
|
767
|
-
label: "561",
|
|
768
|
-
value: "561"
|
|
769
|
-
},
|
|
770
|
-
{
|
|
771
|
-
label: "598",
|
|
772
|
-
value: "598"
|
|
773
|
-
},
|
|
774
|
-
{
|
|
775
|
-
label: "599",
|
|
776
|
-
value: "599"
|
|
777
|
-
}
|
|
778
|
-
], Ne = 10, Be = 65536, Jt = 0, Gt = 65535, ge = 0, be = 255, Ft = 0, xt = 255, zt = 0, Xt = 65535, yt = 0, gt = 65535, Yt = 0, Zt = 2 ** 31, Fe = ["200", "302"], xe = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226", "300", "301", "302", "303", "304", "305", "306", "307", "308"], Oe = ["429", "404", "500", "501", "502", "503", "504", "505"], Pe = ["429", "500", "503"], ea = ["latency", "least-connections", "round-robin"];
|
|
779
|
-
function Ae() {
|
|
780
|
-
const a = (l) => /^\d+$/.test(l), D = (l, c, C) => {
|
|
781
|
-
if (a(l)) {
|
|
782
|
-
const m = Number(l);
|
|
783
|
-
return m >= c && m <= C;
|
|
784
|
-
} else
|
|
785
|
-
return !1;
|
|
786
|
-
}, i = (l) => l.map((c) => Number(c)), s = (l) => l.map((c) => c.toString()), h = (l) => {
|
|
787
|
-
var C, m, t, V, w, p, S, G, N, X, k, T, $, A, _, O, W, le, z, re, M, K, ee, se, ae, te, H, L, b, I, x, Y, d, o, r, J, Z, ie, fe, ye, Ue, je, Qe, We, Je, Ge, ze, Xe, Ye, Ze, et, tt, at, lt, st, it, ot, rt, nt, ht, ut, ct, dt, pt;
|
|
788
|
-
return {
|
|
789
|
-
name: (l == null ? void 0 : l.name) || "",
|
|
790
|
-
hostHeader: (l == null ? void 0 : l.host_header) || "",
|
|
791
|
-
clientCertificate: ((C = l == null ? void 0 : l.client_certificate) == null ? void 0 : C.id) || "",
|
|
792
|
-
tags: ((m = l == null ? void 0 : l.tags) == null ? void 0 : m.join(", ")) || "",
|
|
793
|
-
algorithm: (l == null ? void 0 : l.algorithm) || "round-robin",
|
|
794
|
-
stickySessionsCookie: (l == null ? void 0 : l.sticky_sessions_cookie) || "",
|
|
795
|
-
stickySessionsCookiePath: (l == null ? void 0 : l.sticky_sessions_cookie_path) || "/",
|
|
796
|
-
slots: ((t = l == null ? void 0 : l.slots) == null ? void 0 : t.toString()) || "10000",
|
|
797
|
-
hashOn: (l == null ? void 0 : l.hash_on) || "none",
|
|
798
|
-
hashFallback: (l == null ? void 0 : l.hash_fallback) || "none",
|
|
799
|
-
hashOnHeader: (l == null ? void 0 : l.hash_on_header) || "",
|
|
800
|
-
hashOnCookie: (l == null ? void 0 : l.hash_on_cookie) || "",
|
|
801
|
-
hashOnCookiePath: (l == null ? void 0 : l.hash_on_cookie_path) || "/",
|
|
802
|
-
hashOnQueryArgument: (l == null ? void 0 : l.hash_on_query_arg) || "",
|
|
803
|
-
hashOnUriCapture: (l == null ? void 0 : l.hash_on_uri_capture) || "",
|
|
804
|
-
hashFallbackHeader: (l == null ? void 0 : l.hash_fallback_header) || "",
|
|
805
|
-
hashFallbackQueryArgument: (l == null ? void 0 : l.hash_fallback_query_arg) || "",
|
|
806
|
-
hashFallbackUriCapture: (l == null ? void 0 : l.hash_fallback_uri_capture) || "",
|
|
807
|
-
activeHealthSwitch: l ? ((w = (V = l.healthchecks.active) == null ? void 0 : V.healthy) == null ? void 0 : w.interval) !== 0 || ((S = (p = l.healthchecks.active) == null ? void 0 : p.unhealthy) == null ? void 0 : S.interval) !== 0 : !1,
|
|
808
|
-
passiveHealthSwitch: l ? ((N = (G = l.healthchecks.passive) == null ? void 0 : G.healthy) == null ? void 0 : N.successes) !== 0 || ((k = (X = l.healthchecks.passive) == null ? void 0 : X.unhealthy) == null ? void 0 : k.timeouts) !== 0 || (($ = (T = l.healthchecks.passive) == null ? void 0 : T.unhealthy) == null ? void 0 : $.tcp_failures) !== 0 || ((_ = (A = l.healthchecks.passive) == null ? void 0 : A.unhealthy) == null ? void 0 : _.http_failures) !== 0 : !1,
|
|
809
|
-
healthchecksThreshold: ((O = l == null ? void 0 : l.healthchecks.threshold) == null ? void 0 : O.toString()) || "0",
|
|
810
|
-
activeHealthCheck: {
|
|
811
|
-
type: ((W = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : W.type) || "http",
|
|
812
|
-
httpPath: ((le = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : le.http_path) || "/",
|
|
813
|
-
timeout: ((re = (z = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : z.timeout) == null ? void 0 : re.toString()) || "1",
|
|
814
|
-
concurrency: ((K = (M = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : M.concurrency) == null ? void 0 : K.toString()) || "10",
|
|
815
|
-
httpsSni: ((ee = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : ee.https_sni) || "",
|
|
816
|
-
verifySsl: ((se = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : se.https_verify_certificate) || !1,
|
|
817
|
-
headers: (ae = l == null ? void 0 : l.healthchecks.active) != null && ae.headers && Object.entries(l.healthchecks.active.headers).length > 0 ? Object.entries(l.healthchecks.active.headers).map(([Ot, Ke]) => ({ key: Ot, values: Ke == null ? void 0 : Ke.join(", ") })) : [{ key: "", values: "" }],
|
|
818
|
-
healthy: {
|
|
819
|
-
interval: ((L = (H = (te = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : te.healthy) == null ? void 0 : H.interval) == null ? void 0 : L.toString()) || "0",
|
|
820
|
-
successes: ((x = (I = (b = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : b.healthy) == null ? void 0 : I.successes) == null ? void 0 : x.toString()) || "5",
|
|
821
|
-
httpStatuses: (d = (Y = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : Y.healthy) != null && d.http_statuses ? s(l.healthchecks.active.healthy.http_statuses) : Fe
|
|
822
|
-
},
|
|
823
|
-
unhealthy: {
|
|
824
|
-
interval: ((J = (r = (o = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : o.unhealthy) == null ? void 0 : r.interval) == null ? void 0 : J.toString()) || "0",
|
|
825
|
-
httpFailures: ((fe = (ie = (Z = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : Z.unhealthy) == null ? void 0 : ie.http_failures) == null ? void 0 : fe.toString()) || "5",
|
|
826
|
-
tcpFailures: ((je = (Ue = (ye = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : ye.unhealthy) == null ? void 0 : Ue.tcp_failures) == null ? void 0 : je.toString()) || "5",
|
|
827
|
-
httpStatuses: (We = (Qe = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : Qe.unhealthy) != null && We.http_statuses ? s(l.healthchecks.active.unhealthy.http_statuses) : Oe,
|
|
828
|
-
timeouts: ((ze = (Ge = (Je = l == null ? void 0 : l.healthchecks.active) == null ? void 0 : Je.unhealthy) == null ? void 0 : Ge.timeouts) == null ? void 0 : ze.toString()) || "0"
|
|
829
|
-
}
|
|
830
|
-
},
|
|
831
|
-
passiveHealthCheck: {
|
|
832
|
-
type: ((Xe = l == null ? void 0 : l.healthchecks.passive) == null ? void 0 : Xe.type) || "http",
|
|
833
|
-
healthy: {
|
|
834
|
-
successes: ((et = (Ze = (Ye = l == null ? void 0 : l.healthchecks.passive) == null ? void 0 : Ye.healthy) == null ? void 0 : Ze.successes) == null ? void 0 : et.toString()) || "5",
|
|
835
|
-
httpStatuses: (at = (tt = l == null ? void 0 : l.healthchecks.passive) == null ? void 0 : tt.healthy) != null && at.http_statuses ? s(l.healthchecks.passive.healthy.http_statuses) : xe
|
|
836
|
-
},
|
|
837
|
-
unhealthy: {
|
|
838
|
-
timeouts: ((it = (st = (lt = l == null ? void 0 : l.healthchecks.passive) == null ? void 0 : lt.unhealthy) == null ? void 0 : st.timeouts) == null ? void 0 : it.toString()) || "0",
|
|
839
|
-
httpFailures: ((nt = (rt = (ot = l == null ? void 0 : l.healthchecks.passive) == null ? void 0 : ot.unhealthy) == null ? void 0 : rt.http_failures) == null ? void 0 : nt.toString()) || "5",
|
|
840
|
-
tcpFailures: ((ct = (ut = (ht = l == null ? void 0 : l.healthchecks.passive) == null ? void 0 : ht.unhealthy) == null ? void 0 : ut.tcp_failures) == null ? void 0 : ct.toString()) || "5",
|
|
841
|
-
httpStatuses: (pt = (dt = l == null ? void 0 : l.healthchecks.passive) == null ? void 0 : dt.unhealthy) != null && pt.http_statuses ? s(l.healthchecks.passive.unhealthy.http_statuses) : Pe
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
};
|
|
845
|
-
};
|
|
846
|
-
return {
|
|
847
|
-
isInteger: a,
|
|
848
|
-
inRange: D,
|
|
849
|
-
stringToNumberArray: i,
|
|
850
|
-
numberToStringArray: s,
|
|
851
|
-
upstreamsResponseToFields: (l) => h(l),
|
|
852
|
-
getDefaultUpstreamFields: () => h(),
|
|
853
|
-
objectsAreEqual: (l, c) => {
|
|
854
|
-
try {
|
|
855
|
-
return JSON.stringify(l) === JSON.stringify(c);
|
|
856
|
-
} catch {
|
|
857
|
-
return !1;
|
|
858
|
-
}
|
|
859
|
-
},
|
|
860
|
-
cloneDeep: (l) => JSON.parse(JSON.stringify(l))
|
|
861
|
-
};
|
|
862
|
-
}
|
|
863
|
-
const pe = {
|
|
864
|
-
useI18n: Wt,
|
|
865
|
-
useMultiselectCreation: Se,
|
|
866
|
-
useHelpers: Ae
|
|
867
|
-
}, ke = "/v2/control-planes/{controlPlaneId}/core-entities", _e = "/{workspace}", ve = {
|
|
868
|
-
list: {
|
|
869
|
-
konnect: `${ke}/upstreams`,
|
|
870
|
-
kongManager: `${_e}/upstreams`
|
|
871
|
-
},
|
|
872
|
-
form: {
|
|
873
|
-
konnect: {
|
|
874
|
-
getServices: `${ke}/services`,
|
|
875
|
-
getCertificates: `${ke}/certificates`,
|
|
876
|
-
create: `${ke}/upstreams`,
|
|
877
|
-
edit: `${ke}/upstreams/{id}`
|
|
878
|
-
},
|
|
879
|
-
kongManager: {
|
|
880
|
-
getServices: `${_e}/services`,
|
|
881
|
-
getCertificates: `${_e}/certificates`,
|
|
882
|
-
create: `${_e}/upstreams`,
|
|
883
|
-
edit: `${_e}/upstreams/{id}`
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
}, ta = { class: "kong-ui-entities-upstreams-list" }, aa = { class: "button-row" }, la = { class: "upstream-name" }, sa = /* @__PURE__ */ ne({
|
|
887
|
-
__name: "UpstreamsList",
|
|
888
|
-
props: {
|
|
889
|
-
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
890
|
-
config: {
|
|
891
|
-
type: Object,
|
|
892
|
-
required: !0,
|
|
893
|
-
validator: (a) => !(!a || !["konnect", "kongManager"].includes(a == null ? void 0 : a.app) || !a.createRoute || !a.getViewRoute || !a.getEditRoute || a.app === "kongManager" && !a.isExactMatch && !a.filterSchema)
|
|
894
|
-
},
|
|
895
|
-
// used to override the default identifier for the cache entry
|
|
896
|
-
cacheIdentifier: {
|
|
897
|
-
type: String,
|
|
898
|
-
default: ""
|
|
899
|
-
},
|
|
900
|
-
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can create a new entity */
|
|
901
|
-
canCreate: {
|
|
902
|
-
type: Function,
|
|
903
|
-
required: !1,
|
|
904
|
-
default: async () => !0
|
|
905
|
-
},
|
|
906
|
-
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can delete a given entity */
|
|
907
|
-
canDelete: {
|
|
908
|
-
type: Function,
|
|
909
|
-
required: !1,
|
|
910
|
-
default: async () => !0
|
|
911
|
-
},
|
|
912
|
-
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can edit a given entity */
|
|
913
|
-
canEdit: {
|
|
914
|
-
type: Function,
|
|
915
|
-
required: !1,
|
|
916
|
-
default: async () => !0
|
|
917
|
-
},
|
|
918
|
-
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can retrieve (view details) a given entity */
|
|
919
|
-
canRetrieve: {
|
|
920
|
-
type: Function,
|
|
921
|
-
required: !1,
|
|
922
|
-
default: async () => !0
|
|
923
|
-
},
|
|
924
|
-
/** default to false, setting to true will teleport the toolbar button to the destination in the consuming app */
|
|
925
|
-
useActionOutside: {
|
|
926
|
-
type: Boolean,
|
|
927
|
-
default: !1
|
|
928
|
-
}
|
|
929
|
-
},
|
|
930
|
-
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success"],
|
|
931
|
-
setup(a, { emit: D }) {
|
|
932
|
-
var L;
|
|
933
|
-
const i = D, s = a, { i18n: { t: h } } = pe.useI18n(), g = Tt(), { axiosInstance: y } = $e((L = s.config) == null ? void 0 : L.axiosRequestConfig), { hasRecords: j, handleStateChange: F } = At(() => V.value), l = U(() => j.value && s.config.app === "konnect"), c = U(() => s.config.app !== "kongManager" || !!s.config.disableSorting), C = {
|
|
934
|
-
// the Name column is non-hidable
|
|
935
|
-
name: { label: h("upstreams.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
936
|
-
slots: { label: h("upstreams.list.table_headers.slots"), searchable: !0, sortable: !0 },
|
|
937
|
-
tags: { label: h("upstreams.list.table_headers.tags"), sortable: !1 }
|
|
938
|
-
}, m = C, t = U(() => {
|
|
939
|
-
var I, x;
|
|
940
|
-
let b = `${s.config.apiBaseUrl}${ve.list[s.config.app]}`;
|
|
941
|
-
return s.config.app === "konnect" ? b = b.replace(/{controlPlaneId}/gi, ((I = s.config) == null ? void 0 : I.controlPlaneId) || "") : s.config.app === "kongManager" && (b = b.replace(/\/{workspace}/gi, (x = s.config) != null && x.workspace ? `/${s.config.workspace}` : "")), b;
|
|
942
|
-
}), V = R(""), w = U(() => {
|
|
943
|
-
const b = s.config.app === "konnect" || s.config.isExactMatch;
|
|
944
|
-
if (b)
|
|
945
|
-
return {
|
|
946
|
-
isExactMatch: b,
|
|
947
|
-
placeholder: h("upstreams.search.placeholder")
|
|
948
|
-
};
|
|
949
|
-
const { name: I, slots: x } = C;
|
|
950
|
-
return {
|
|
951
|
-
isExactMatch: b,
|
|
952
|
-
fields: { name: I, slots: x },
|
|
953
|
-
schema: s.config.filterSchema
|
|
954
|
-
};
|
|
955
|
-
}), {
|
|
956
|
-
fetcher: p,
|
|
957
|
-
fetcherState: S,
|
|
958
|
-
fetcherCacheKey: G
|
|
959
|
-
} = kt(U(() => ({ ...s.config, cacheIdentifier: s.cacheIdentifier })), t), N = () => {
|
|
960
|
-
V.value = "";
|
|
961
|
-
}, X = () => {
|
|
962
|
-
G.value++;
|
|
963
|
-
}, k = R(null), T = async (b, I) => {
|
|
964
|
-
const x = b.id;
|
|
965
|
-
if (!await I(x)) {
|
|
966
|
-
i("copy:error", {
|
|
967
|
-
entity: b,
|
|
968
|
-
field: "id",
|
|
969
|
-
message: h("upstreams.errors.copy")
|
|
970
|
-
});
|
|
971
|
-
return;
|
|
972
|
-
}
|
|
973
|
-
i("copy:success", {
|
|
974
|
-
entity: b,
|
|
975
|
-
field: "id",
|
|
976
|
-
message: h("upstreams.copy.success", { val: x })
|
|
977
|
-
});
|
|
978
|
-
}, $ = async (b, I) => {
|
|
979
|
-
const x = JSON.stringify(b);
|
|
980
|
-
if (!await I(x)) {
|
|
981
|
-
i("copy:error", {
|
|
982
|
-
entity: b,
|
|
983
|
-
message: h("upstreams.errors.copy")
|
|
984
|
-
});
|
|
985
|
-
return;
|
|
986
|
-
}
|
|
987
|
-
i("copy:success", {
|
|
988
|
-
entity: b,
|
|
989
|
-
message: h("upstreams.copy.success_brief")
|
|
990
|
-
});
|
|
991
|
-
}, A = async (b) => {
|
|
992
|
-
var x;
|
|
993
|
-
await ((x = s.canRetrieve) == null ? void 0 : x.call(s, b)) && g.push(s.config.getViewRoute(b.id));
|
|
994
|
-
}, _ = (b) => ({
|
|
995
|
-
label: h("upstreams.actions.view"),
|
|
996
|
-
to: s.config.getViewRoute(b)
|
|
997
|
-
}), O = (b) => ({
|
|
998
|
-
label: h("upstreams.actions.edit"),
|
|
999
|
-
to: s.config.getEditRoute(b)
|
|
1000
|
-
}), W = R(void 0), le = R(!1), z = R(!1), re = R(""), M = _t(s.config, t.value), K = (b) => {
|
|
1001
|
-
W.value = b, le.value = !0;
|
|
1002
|
-
}, ee = () => {
|
|
1003
|
-
le.value = !1;
|
|
1004
|
-
}, se = async () => {
|
|
1005
|
-
var b, I, x;
|
|
1006
|
-
if ((b = W.value) != null && b.id) {
|
|
1007
|
-
z.value = !0;
|
|
1008
|
-
try {
|
|
1009
|
-
await y.delete(M(W.value.id)), z.value = !1, le.value = !1, G.value++, i("delete:success", W.value);
|
|
1010
|
-
} catch (Y) {
|
|
1011
|
-
re.value = ((x = (I = Y.response) == null ? void 0 : I.data) == null ? void 0 : x.message) || Y.message || h("upstreams.errors.delete"), i("error", Y);
|
|
1012
|
-
} finally {
|
|
1013
|
-
z.value = !1;
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
}, ae = () => {
|
|
1017
|
-
g.push(s.config.createRoute);
|
|
1018
|
-
};
|
|
1019
|
-
de(S, (b) => {
|
|
1020
|
-
var I, x, Y;
|
|
1021
|
-
if (b.status === Ct.Error) {
|
|
1022
|
-
k.value = {
|
|
1023
|
-
title: h("upstreams.errors.general")
|
|
1024
|
-
}, (Y = (x = (I = b.error) == null ? void 0 : I.response) == null ? void 0 : x.data) != null && Y.message && (k.value.message = b.error.response.data.message), i("error", b.error);
|
|
1025
|
-
return;
|
|
1026
|
-
}
|
|
1027
|
-
k.value = null;
|
|
1028
|
-
});
|
|
1029
|
-
const te = R({
|
|
1030
|
-
ctaPath: s.config.createRoute,
|
|
1031
|
-
ctaText: void 0,
|
|
1032
|
-
message: `${h("upstreams.list.empty_state.description")}${s.config.additionMessageForEmptyState ? ` ${s.config.additionMessageForEmptyState}` : ""}`,
|
|
1033
|
-
title: h("upstreams.title")
|
|
1034
|
-
}), H = R(!1);
|
|
1035
|
-
return De(async () => {
|
|
1036
|
-
H.value = await s.canCreate(), H.value && (te.value.title = h("upstreams.list.empty_state.title"), te.value.ctaText = h("upstreams.actions.create"));
|
|
1037
|
-
}), (b, I) => {
|
|
1038
|
-
const x = P("KButton"), Y = P("KEmptyState"), d = P("KDropdownItem"), o = P("KClipboardProvider");
|
|
1039
|
-
return q(), oe("div", ta, [
|
|
1040
|
-
u(e(St), {
|
|
1041
|
-
"cache-identifier": a.cacheIdentifier,
|
|
1042
|
-
"disable-sorting": c.value,
|
|
1043
|
-
"empty-state-options": te.value,
|
|
1044
|
-
"enable-entity-actions": "",
|
|
1045
|
-
"error-message": k.value,
|
|
1046
|
-
fetcher: e(p),
|
|
1047
|
-
"fetcher-cache-key": e(G),
|
|
1048
|
-
"pagination-type": "offset",
|
|
1049
|
-
"preferences-storage-key": "kong-ui-entities-upstreams-list",
|
|
1050
|
-
query: V.value,
|
|
1051
|
-
"table-headers": e(m),
|
|
1052
|
-
onClearSearchInput: N,
|
|
1053
|
-
"onClick:row": I[3] || (I[3] = (r) => A(r)),
|
|
1054
|
-
onSort: X,
|
|
1055
|
-
onState: e(F)
|
|
1056
|
-
}, Ie({
|
|
1057
|
-
"toolbar-filter": n(() => [
|
|
1058
|
-
u(e(Mt), {
|
|
1059
|
-
modelValue: V.value,
|
|
1060
|
-
"onUpdate:modelValue": I[0] || (I[0] = (r) => V.value = r),
|
|
1061
|
-
config: w.value
|
|
1062
|
-
}, null, 8, ["modelValue", "config"])
|
|
1063
|
-
]),
|
|
1064
|
-
"toolbar-button": n(() => [
|
|
1065
|
-
(q(), E(bt, {
|
|
1066
|
-
disabled: !a.useActionOutside,
|
|
1067
|
-
to: "#kong-ui-app-page-header-action-button"
|
|
1068
|
-
}, [
|
|
1069
|
-
v("div", aa, [
|
|
1070
|
-
l.value ? (q(), E(x, {
|
|
1071
|
-
key: 0,
|
|
1072
|
-
appearance: "secondary",
|
|
1073
|
-
class: "open-learning-hub",
|
|
1074
|
-
"data-testid": "upstream-learn-more-button",
|
|
1075
|
-
icon: "",
|
|
1076
|
-
onClick: I[1] || (I[1] = (r) => b.$emit("click:learn-more"))
|
|
1077
|
-
}, {
|
|
1078
|
-
default: n(() => [
|
|
1079
|
-
u(e(ft), { decorative: "" })
|
|
1080
|
-
]),
|
|
1081
|
-
_: 1
|
|
1082
|
-
})) : B("", !0),
|
|
1083
|
-
u(e(ce), {
|
|
1084
|
-
"auth-function": () => a.canCreate()
|
|
1085
|
-
}, {
|
|
1086
|
-
default: n(() => [
|
|
1087
|
-
u(x, {
|
|
1088
|
-
appearance: "primary",
|
|
1089
|
-
"data-testid": "toolbar-add-upstream",
|
|
1090
|
-
size: a.useActionOutside ? "medium" : "large",
|
|
1091
|
-
to: a.config.createRoute
|
|
1092
|
-
}, {
|
|
1093
|
-
default: n(() => [
|
|
1094
|
-
u(e(we)),
|
|
1095
|
-
Q(" " + f(e(h)("upstreams.list.toolbar_actions.new_upstream")), 1)
|
|
1096
|
-
]),
|
|
1097
|
-
_: 1
|
|
1098
|
-
}, 8, ["size", "to"])
|
|
1099
|
-
]),
|
|
1100
|
-
_: 1
|
|
1101
|
-
}, 8, ["auth-function"])
|
|
1102
|
-
])
|
|
1103
|
-
], 8, ["disabled"]))
|
|
1104
|
-
]),
|
|
1105
|
-
name: n(({ rowValue: r }) => [
|
|
1106
|
-
v("span", la, f(r), 1)
|
|
1107
|
-
]),
|
|
1108
|
-
tags: n(({ rowValue: r }) => [
|
|
1109
|
-
u(e(Ht), {
|
|
1110
|
-
"tag-max-width": "auto",
|
|
1111
|
-
tags: r
|
|
1112
|
-
}, null, 8, ["tags"])
|
|
1113
|
-
]),
|
|
1114
|
-
actions: n(({ row: r }) => [
|
|
1115
|
-
u(o, null, {
|
|
1116
|
-
default: n(({ copyToClipboard: J }) => [
|
|
1117
|
-
u(d, {
|
|
1118
|
-
"data-testid": "action-entity-copy-id",
|
|
1119
|
-
onClick: (Z) => T(r, J)
|
|
1120
|
-
}, {
|
|
1121
|
-
default: n(() => [
|
|
1122
|
-
Q(f(e(h)("upstreams.actions.copy_id")), 1)
|
|
1123
|
-
]),
|
|
1124
|
-
_: 1
|
|
1125
|
-
}, 8, ["onClick"])
|
|
1126
|
-
]),
|
|
1127
|
-
_: 2
|
|
1128
|
-
}, 1024),
|
|
1129
|
-
u(o, null, {
|
|
1130
|
-
default: n(({ copyToClipboard: J }) => [
|
|
1131
|
-
u(d, {
|
|
1132
|
-
"data-testid": "action-entity-copy-json",
|
|
1133
|
-
onClick: (Z) => $(r, J)
|
|
1134
|
-
}, {
|
|
1135
|
-
default: n(() => [
|
|
1136
|
-
Q(f(e(h)("upstreams.actions.copy_json")), 1)
|
|
1137
|
-
]),
|
|
1138
|
-
_: 1
|
|
1139
|
-
}, 8, ["onClick"])
|
|
1140
|
-
]),
|
|
1141
|
-
_: 2
|
|
1142
|
-
}, 1024),
|
|
1143
|
-
u(e(ce), {
|
|
1144
|
-
"auth-function": () => a.canRetrieve(r)
|
|
1145
|
-
}, {
|
|
1146
|
-
default: n(() => [
|
|
1147
|
-
u(d, {
|
|
1148
|
-
"data-testid": "action-entity-view",
|
|
1149
|
-
"has-divider": "",
|
|
1150
|
-
item: _(r.id)
|
|
1151
|
-
}, null, 8, ["item"])
|
|
1152
|
-
]),
|
|
1153
|
-
_: 2
|
|
1154
|
-
}, 1032, ["auth-function"]),
|
|
1155
|
-
u(e(ce), {
|
|
1156
|
-
"auth-function": () => a.canEdit(r)
|
|
1157
|
-
}, {
|
|
1158
|
-
default: n(() => [
|
|
1159
|
-
u(d, {
|
|
1160
|
-
"data-testid": "action-entity-edit",
|
|
1161
|
-
item: O(r.id)
|
|
1162
|
-
}, null, 8, ["item"])
|
|
1163
|
-
]),
|
|
1164
|
-
_: 2
|
|
1165
|
-
}, 1032, ["auth-function"]),
|
|
1166
|
-
u(e(ce), {
|
|
1167
|
-
"auth-function": () => a.canDelete(r)
|
|
1168
|
-
}, {
|
|
1169
|
-
default: n(() => [
|
|
1170
|
-
u(d, {
|
|
1171
|
-
danger: "",
|
|
1172
|
-
"data-testid": "action-entity-delete",
|
|
1173
|
-
"has-divider": "",
|
|
1174
|
-
onClick: (J) => K(r)
|
|
1175
|
-
}, {
|
|
1176
|
-
default: n(() => [
|
|
1177
|
-
Q(f(e(h)("upstreams.actions.delete")), 1)
|
|
1178
|
-
]),
|
|
1179
|
-
_: 1
|
|
1180
|
-
}, 8, ["onClick"])
|
|
1181
|
-
]),
|
|
1182
|
-
_: 2
|
|
1183
|
-
}, 1032, ["auth-function"])
|
|
1184
|
-
]),
|
|
1185
|
-
_: 2
|
|
1186
|
-
}, [
|
|
1187
|
-
!V.value && a.config.app === "konnect" ? {
|
|
1188
|
-
name: "empty-state",
|
|
1189
|
-
fn: n(() => {
|
|
1190
|
-
var r;
|
|
1191
|
-
return [
|
|
1192
|
-
u(Y, {
|
|
1193
|
-
"data-testid": "upstreams-entity-empty-state",
|
|
1194
|
-
"icon-background": "",
|
|
1195
|
-
message: e(h)("upstreams.list.empty_state_v2.description"),
|
|
1196
|
-
title: e(h)("upstreams.list.empty_state_v2.title")
|
|
1197
|
-
}, Ie({
|
|
1198
|
-
icon: n(() => [
|
|
1199
|
-
u(e(Nt), { decorative: "" })
|
|
1200
|
-
]),
|
|
1201
|
-
action: n(() => [
|
|
1202
|
-
H.value ? (q(), E(x, {
|
|
1203
|
-
key: 0,
|
|
1204
|
-
"data-testid": "entity-create-button",
|
|
1205
|
-
onClick: ae
|
|
1206
|
-
}, {
|
|
1207
|
-
default: n(() => [
|
|
1208
|
-
u(e(we), { decorative: "" }),
|
|
1209
|
-
Q(" " + f(e(h)("upstreams.list.empty_state_v2.create_cta")), 1)
|
|
1210
|
-
]),
|
|
1211
|
-
_: 1
|
|
1212
|
-
})) : B("", !0),
|
|
1213
|
-
u(x, {
|
|
1214
|
-
appearance: "secondary",
|
|
1215
|
-
"data-testid": "entity-learn-more-button",
|
|
1216
|
-
onClick: I[2] || (I[2] = (J) => b.$emit("click:learn-more"))
|
|
1217
|
-
}, {
|
|
1218
|
-
default: n(() => [
|
|
1219
|
-
u(e(ft), { decorative: "" }),
|
|
1220
|
-
Q(" " + f(e(h)("upstreams.list.empty_state_v2.learn_more")), 1)
|
|
1221
|
-
]),
|
|
1222
|
-
_: 1
|
|
1223
|
-
})
|
|
1224
|
-
]),
|
|
1225
|
-
_: 2
|
|
1226
|
-
}, [
|
|
1227
|
-
(r = a.config) != null && r.isControlPlaneGroup ? {
|
|
1228
|
-
name: "default",
|
|
1229
|
-
fn: n(() => [
|
|
1230
|
-
Q(f(e(h)("upstreams.list.empty_state_v2.group")), 1)
|
|
1231
|
-
]),
|
|
1232
|
-
key: "0"
|
|
1233
|
-
} : void 0
|
|
1234
|
-
]), 1032, ["message", "title"])
|
|
1235
|
-
];
|
|
1236
|
-
}),
|
|
1237
|
-
key: "0"
|
|
1238
|
-
} : void 0
|
|
1239
|
-
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
|
|
1240
|
-
u(e(Ut), {
|
|
1241
|
-
"action-pending": z.value,
|
|
1242
|
-
description: e(h)("upstreams.delete.description"),
|
|
1243
|
-
"entity-name": W.value && (W.value.name || W.value.id),
|
|
1244
|
-
"entity-type": e(It).Upstream,
|
|
1245
|
-
error: re.value,
|
|
1246
|
-
title: e(h)("upstreams.delete.title"),
|
|
1247
|
-
visible: le.value,
|
|
1248
|
-
onCancel: ee,
|
|
1249
|
-
onProceed: se
|
|
1250
|
-
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
1251
|
-
]);
|
|
1252
|
-
};
|
|
1253
|
-
}
|
|
1254
|
-
}), me = (a, D) => {
|
|
1255
|
-
const i = a.__vccOpts || a;
|
|
1256
|
-
for (const [s, h] of D)
|
|
1257
|
-
i[s] = h;
|
|
1258
|
-
return i;
|
|
1259
|
-
}, za = /* @__PURE__ */ me(sa, [["__scopeId", "data-v-fd5b2677"]]), Ve = "/v2/control-planes/{controlPlaneId}/core-entities", Ee = "/{workspace}", Re = {
|
|
1260
|
-
list: {
|
|
1261
|
-
konnect: `${Ve}/upstreams/{upstreamId}/targets`,
|
|
1262
|
-
kongManager: `${Ee}/upstreams/{upstreamId}/targets`
|
|
1263
|
-
},
|
|
1264
|
-
form: {
|
|
1265
|
-
konnect: {
|
|
1266
|
-
create: `${Ve}/upstreams/{upstreamId}/targets`,
|
|
1267
|
-
edit: `${Ve}/upstreams/{upstreamId}/targets/{id}`
|
|
1268
|
-
},
|
|
1269
|
-
kongManager: {
|
|
1270
|
-
create: `${Ee}/upstreams/{upstreamId}/targets`,
|
|
1271
|
-
edit: `${Ee}/upstreams/{upstreamId}/targets/{id}`
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
}, ia = { class: "kong-ui-entities-target-form" }, oa = { class: "target-form-container" }, ra = {
|
|
1275
|
-
key: 0,
|
|
1276
|
-
class: "target-form-info"
|
|
1277
|
-
}, na = {
|
|
1278
|
-
key: 1,
|
|
1279
|
-
class: "failover-target"
|
|
1280
|
-
}, ha = /* @__PURE__ */ ne({
|
|
1281
|
-
__name: "TargetForm",
|
|
1282
|
-
props: {
|
|
1283
|
-
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
1284
|
-
config: {
|
|
1285
|
-
type: Object,
|
|
1286
|
-
required: !0,
|
|
1287
|
-
validator: (a) => !(!a || !["konnect", "kongManager"].includes(a == null ? void 0 : a.app) || a.app === "konnect" && !a.controlPlaneId || a.app === "kongManager" && typeof a.workspace != "string" || !a.upstreamId)
|
|
1288
|
-
},
|
|
1289
|
-
// Controls whether the modal is visible or not
|
|
1290
|
-
isVisible: {
|
|
1291
|
-
type: Boolean,
|
|
1292
|
-
required: !0,
|
|
1293
|
-
default: !1
|
|
1294
|
-
},
|
|
1295
|
-
/** If a valid Target ID is provided, it will put the form in Edit mode instead of Create */
|
|
1296
|
-
targetId: {
|
|
1297
|
-
type: String,
|
|
1298
|
-
required: !1,
|
|
1299
|
-
default: ""
|
|
1300
|
-
},
|
|
1301
|
-
failoverEnabled: {
|
|
1302
|
-
type: Boolean,
|
|
1303
|
-
required: !1,
|
|
1304
|
-
default: !1
|
|
1305
|
-
},
|
|
1306
|
-
failoverUnsupported: {
|
|
1307
|
-
type: Boolean,
|
|
1308
|
-
required: !1,
|
|
1309
|
-
default: !1
|
|
1310
|
-
}
|
|
1311
|
-
},
|
|
1312
|
-
emits: ["update", "error", "loading", "cancel"],
|
|
1313
|
-
setup(a, { emit: D }) {
|
|
1314
|
-
var X;
|
|
1315
|
-
const i = D, s = a, { i18n: { t: h } } = pe.useI18n(), { getMessageFromError: g } = qt(), { axiosInstance: y } = $e((X = s.config) == null ? void 0 : X.axiosRequestConfig), j = U(() => {
|
|
1316
|
-
var k;
|
|
1317
|
-
return Re.form[s.config.app].edit.replace(/{upstreamId}/gi, ((k = s.config) == null ? void 0 : k.upstreamId) || "");
|
|
1318
|
-
}), F = U(() => s.targetId ? ue.Edit : ue.Create), l = U(() => F.value === ue.Edit ? h("targets.form.edit.title") : h("targets.form.create.title")), c = qe({
|
|
1319
|
-
fields: {
|
|
1320
|
-
target: "",
|
|
1321
|
-
weight: 100,
|
|
1322
|
-
tags: "",
|
|
1323
|
-
failover: !1
|
|
1324
|
-
},
|
|
1325
|
-
isReadonly: !1,
|
|
1326
|
-
errorMessage: ""
|
|
1327
|
-
}), C = qe({
|
|
1328
|
-
target: "",
|
|
1329
|
-
weight: 100,
|
|
1330
|
-
tags: "",
|
|
1331
|
-
failover: !1
|
|
1332
|
-
}), m = {
|
|
1333
|
-
target: "",
|
|
1334
|
-
weight: 100,
|
|
1335
|
-
tags: ""
|
|
1336
|
-
}, t = U(() => {
|
|
1337
|
-
const k = parseInt(c.fields.weight.toString(), 10);
|
|
1338
|
-
return k < 0 || k > 65535;
|
|
1339
|
-
}), V = U(
|
|
1340
|
-
() => JSON.stringify(c.fields) !== JSON.stringify(C) && !!c.fields.target && !!c.fields.weight && !t.value
|
|
1341
|
-
), w = (k) => {
|
|
1342
|
-
var T;
|
|
1343
|
-
c.fields.target = (k == null ? void 0 : k.target) || "", c.fields.weight = (k == null ? void 0 : k.weight) ?? "", c.fields.tags = ((T = k == null ? void 0 : k.tags) == null ? void 0 : T.join(", ")) || "", s.failoverEnabled && (c.fields.failover = (k == null ? void 0 : k.failover) || !1), Object.assign(C, c.fields);
|
|
1344
|
-
}, p = () => {
|
|
1345
|
-
c.errorMessage = "", i("cancel");
|
|
1346
|
-
}, S = U(() => {
|
|
1347
|
-
var T, $, A, _;
|
|
1348
|
-
let k = `${s.config.apiBaseUrl}${Re.form[s.config.app][F.value]}`;
|
|
1349
|
-
return s.config.app === "konnect" ? k = k.replace(/{controlPlaneId}/gi, ((T = s.config) == null ? void 0 : T.controlPlaneId) || "").replace(/{upstreamId}/gi, (($ = s.config) == null ? void 0 : $.upstreamId) || "") : s.config.app === "kongManager" && (k = k.replace(/\/{workspace}/gi, (A = s.config) != null && A.workspace ? `/${s.config.workspace}` : "").replace(/{upstreamId}/gi, ((_ = s.config) == null ? void 0 : _.upstreamId) || "")), k = k.replace(/{id}/gi, s.targetId), k;
|
|
1350
|
-
}), G = U(() => {
|
|
1351
|
-
var k, T, $;
|
|
1352
|
-
return {
|
|
1353
|
-
target: c.fields.target,
|
|
1354
|
-
weight: parseInt(c.fields.weight),
|
|
1355
|
-
tags: ($ = (T = (k = c.fields.tags) == null ? void 0 : k.split(",")) == null ? void 0 : T.map((A) => String(A || "").trim())) == null ? void 0 : $.filter((A) => A !== ""),
|
|
1356
|
-
upstream: { id: s.config.upstreamId },
|
|
1357
|
-
...s.failoverEnabled ? { failover: c.fields.failover } : {}
|
|
1358
|
-
};
|
|
1359
|
-
}), N = async () => {
|
|
1360
|
-
var k, T;
|
|
1361
|
-
try {
|
|
1362
|
-
c.isReadonly = !0, c.errorMessage = "";
|
|
1363
|
-
let $;
|
|
1364
|
-
if (F.value === "create" ? $ = await y.post(S.value, G.value) : F.value === "edit" && ($ = ((k = s.config) == null ? void 0 : k.app) === "konnect" ? await y.put(S.value, G.value) : await y.patch(S.value, G.value)), $) {
|
|
1365
|
-
const { data: A } = $;
|
|
1366
|
-
c.fields.target = (A == null ? void 0 : A.name) || "", c.fields.weight = (A == null ? void 0 : A.weight) ?? 100, c.fields.tags = ((T = A == null ? void 0 : A.tags) == null ? void 0 : T.join(", ")) || "", i("update", A), Object.assign(c.fields, m);
|
|
1367
|
-
}
|
|
1368
|
-
} catch ($) {
|
|
1369
|
-
c.errorMessage = g($), i("error", $);
|
|
1370
|
-
} finally {
|
|
1371
|
-
c.isReadonly = !1;
|
|
1372
|
-
}
|
|
1373
|
-
};
|
|
1374
|
-
return de(() => s.targetId, () => {
|
|
1375
|
-
Object.assign(c.fields, m);
|
|
1376
|
-
}), (k, T) => {
|
|
1377
|
-
const $ = P("KInput"), A = P("KCheckbox"), _ = P("KPrompt");
|
|
1378
|
-
return q(), E(_, {
|
|
1379
|
-
"action-button-disabled": !V.value || c.isReadonly,
|
|
1380
|
-
"action-button-text": e(h)("targets.form.buttons.save"),
|
|
1381
|
-
"cancel-button-text": e(h)("targets.form.buttons.cancel"),
|
|
1382
|
-
title: l.value,
|
|
1383
|
-
visible: a.isVisible,
|
|
1384
|
-
onCancel: p,
|
|
1385
|
-
onProceed: N
|
|
1386
|
-
}, {
|
|
1387
|
-
default: n(() => [
|
|
1388
|
-
v("div", ia, [
|
|
1389
|
-
u(e(wt), {
|
|
1390
|
-
config: a.config,
|
|
1391
|
-
"edit-id": a.targetId,
|
|
1392
|
-
"entity-type": e(Le).Target,
|
|
1393
|
-
"error-message": c.errorMessage,
|
|
1394
|
-
"fetch-url": j.value,
|
|
1395
|
-
"form-fields": G.value,
|
|
1396
|
-
"is-readonly": c.isReadonly,
|
|
1397
|
-
onCancel: p,
|
|
1398
|
-
"onFetch:error": T[4] || (T[4] = (O) => k.$emit("error", O)),
|
|
1399
|
-
"onFetch:success": w,
|
|
1400
|
-
onLoading: T[5] || (T[5] = (O) => k.$emit("loading", O))
|
|
1401
|
-
}, {
|
|
1402
|
-
default: n(() => [
|
|
1403
|
-
v("div", oa, [
|
|
1404
|
-
k.$slots.info ? (q(), oe("div", ra, [
|
|
1405
|
-
vt(k.$slots, "info", {}, void 0, !0)
|
|
1406
|
-
])) : B("", !0),
|
|
1407
|
-
u($, {
|
|
1408
|
-
modelValue: c.fields.target,
|
|
1409
|
-
"onUpdate:modelValue": T[0] || (T[0] = (O) => c.fields.target = O),
|
|
1410
|
-
modelModifiers: { trim: !0 },
|
|
1411
|
-
autocomplete: "off",
|
|
1412
|
-
class: "target-form-input",
|
|
1413
|
-
"data-testid": "target-form-target",
|
|
1414
|
-
label: e(h)("targets.form.fields.target.label"),
|
|
1415
|
-
"label-attributes": {
|
|
1416
|
-
info: e(h)("targets.form.fields.target.tooltip"),
|
|
1417
|
-
tooltipAttributes: { maxWidth: "400" }
|
|
1418
|
-
},
|
|
1419
|
-
placeholder: e(h)("targets.form.fields.target.placeholder"),
|
|
1420
|
-
readonly: c.isReadonly,
|
|
1421
|
-
required: "",
|
|
1422
|
-
type: "text"
|
|
1423
|
-
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1424
|
-
u($, {
|
|
1425
|
-
modelValue: c.fields.weight,
|
|
1426
|
-
"onUpdate:modelValue": T[1] || (T[1] = (O) => c.fields.weight = O),
|
|
1427
|
-
autocomplete: "off",
|
|
1428
|
-
class: "target-form-input",
|
|
1429
|
-
"data-testid": "target-form-weight",
|
|
1430
|
-
error: t.value,
|
|
1431
|
-
"error-message": e(h)("targets.errors.weight"),
|
|
1432
|
-
label: e(h)("targets.form.fields.weight.label"),
|
|
1433
|
-
"label-attributes": {
|
|
1434
|
-
info: e(h)("targets.form.fields.weight.tooltip"),
|
|
1435
|
-
tooltipAttributes: { maxWidth: "400" }
|
|
1436
|
-
},
|
|
1437
|
-
max: "65535",
|
|
1438
|
-
min: "0",
|
|
1439
|
-
readonly: c.isReadonly,
|
|
1440
|
-
required: "",
|
|
1441
|
-
type: "number"
|
|
1442
|
-
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "readonly"]),
|
|
1443
|
-
a.failoverEnabled ? (q(), oe("div", na, [
|
|
1444
|
-
u(A, {
|
|
1445
|
-
modelValue: c.fields.failover,
|
|
1446
|
-
"onUpdate:modelValue": T[2] || (T[2] = (O) => c.fields.failover = O),
|
|
1447
|
-
disabled: a.failoverUnsupported,
|
|
1448
|
-
label: e(h)("targets.form.fields.failover.label"),
|
|
1449
|
-
"label-attributes": {
|
|
1450
|
-
info: a.failoverUnsupported ? e(h)("targets.form.fields.failover.unsupported") : e(h)("targets.form.fields.failover.help")
|
|
1451
|
-
}
|
|
1452
|
-
}, null, 8, ["modelValue", "disabled", "label", "label-attributes"])
|
|
1453
|
-
])) : B("", !0),
|
|
1454
|
-
u($, {
|
|
1455
|
-
modelValue: c.fields.tags,
|
|
1456
|
-
"onUpdate:modelValue": T[3] || (T[3] = (O) => c.fields.tags = O),
|
|
1457
|
-
modelModifiers: { trim: !0 },
|
|
1458
|
-
autocomplete: "off",
|
|
1459
|
-
class: "target-form-input",
|
|
1460
|
-
"data-testid": "target-form-tags",
|
|
1461
|
-
help: e(h)("targets.form.fields.tags.help"),
|
|
1462
|
-
label: e(h)("targets.form.fields.tags.label"),
|
|
1463
|
-
placeholder: e(h)("targets.form.fields.tags.placeholder"),
|
|
1464
|
-
readonly: c.isReadonly,
|
|
1465
|
-
type: "text"
|
|
1466
|
-
}, null, 8, ["modelValue", "help", "label", "placeholder", "readonly"])
|
|
1467
|
-
])
|
|
1468
|
-
]),
|
|
1469
|
-
_: 3
|
|
1470
|
-
}, 8, ["config", "edit-id", "entity-type", "error-message", "fetch-url", "form-fields", "is-readonly"])
|
|
1471
|
-
])
|
|
1472
|
-
]),
|
|
1473
|
-
_: 3
|
|
1474
|
-
}, 8, ["action-button-disabled", "action-button-text", "cancel-button-text", "title", "visible"]);
|
|
1475
|
-
};
|
|
1476
|
-
}
|
|
1477
|
-
}), ua = /* @__PURE__ */ me(ha, [["__scopeId", "data-v-dc1948b7"]]), ca = { class: "kong-ui-entities-targets-list" }, da = { class: "target-address" }, pa = /* @__PURE__ */ ne({
|
|
1478
|
-
__name: "TargetsList",
|
|
1479
|
-
props: {
|
|
1480
|
-
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
1481
|
-
config: {
|
|
1482
|
-
type: Object,
|
|
1483
|
-
required: !0,
|
|
1484
|
-
validator: (a) => !(!a || !["konnect", "kongManager"].includes(a == null ? void 0 : a.app) || !a.upstreamId || a.app === "kongManager" && (typeof a.canMarkHealthy > "u" || typeof a.canMarkUnhealthy > "u"))
|
|
1485
|
-
},
|
|
1486
|
-
// used to override the default identifier for the cache entry
|
|
1487
|
-
cacheIdentifier: {
|
|
1488
|
-
type: String,
|
|
1489
|
-
default: ""
|
|
1490
|
-
},
|
|
1491
|
-
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can create a new entity */
|
|
1492
|
-
canCreate: {
|
|
1493
|
-
type: Function,
|
|
1494
|
-
required: !1,
|
|
1495
|
-
default: async () => !0
|
|
1496
|
-
},
|
|
1497
|
-
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can delete a given entity */
|
|
1498
|
-
canDelete: {
|
|
1499
|
-
type: Function,
|
|
1500
|
-
required: !1,
|
|
1501
|
-
default: async () => !0
|
|
1502
|
-
},
|
|
1503
|
-
/** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can edit a given entity */
|
|
1504
|
-
canEdit: {
|
|
1505
|
-
type: Function,
|
|
1506
|
-
required: !1,
|
|
1507
|
-
default: async () => !0
|
|
1508
|
-
},
|
|
1509
|
-
/** default to false, setting to true will teleport the toolbar button to the destination in the consuming app */
|
|
1510
|
-
useActionOutside: {
|
|
1511
|
-
type: Boolean,
|
|
1512
|
-
default: !1
|
|
1513
|
-
},
|
|
1514
|
-
failoverEnabled: {
|
|
1515
|
-
type: Boolean,
|
|
1516
|
-
default: !1
|
|
1517
|
-
},
|
|
1518
|
-
algorithm: {
|
|
1519
|
-
type: String,
|
|
1520
|
-
required: !1,
|
|
1521
|
-
default: ""
|
|
1522
|
-
}
|
|
1523
|
-
},
|
|
1524
|
-
emits: ["error", "copy:success", "copy:error", "delete:success", "health-actions:healthy", "health-actions:unhealthy", "create:target", "update:target"],
|
|
1525
|
-
setup(a, { emit: D }) {
|
|
1526
|
-
var te;
|
|
1527
|
-
const i = D, s = a, { i18n: { t: h } } = pe.useI18n(), { axiosInstance: g } = $e((te = s.config) == null ? void 0 : te.axiosRequestConfig), y = U(() => s.config.app !== "kongManager" || !!s.config.disableSorting), F = {
|
|
1528
|
-
// the Target Address column is non-hidable
|
|
1529
|
-
target: { label: h("targets.list.table_headers.target_address"), sortable: !0, hidable: !1 },
|
|
1530
|
-
weight: { label: h("targets.list.table_headers.weight"), sortable: !0 },
|
|
1531
|
-
...s.failoverEnabled ? { failover: { label: h("targets.list.table_headers.target_type"), sortable: !1 } } : {},
|
|
1532
|
-
tags: { label: h("targets.list.table_headers.tags"), sortable: !1 }
|
|
1533
|
-
}, l = U(() => {
|
|
1534
|
-
var L, b, I, x;
|
|
1535
|
-
let H = `${s.config.apiBaseUrl}${Re.list[s.config.app]}`;
|
|
1536
|
-
return s.config.app === "konnect" ? H = H.replace(/{controlPlaneId}/gi, ((L = s.config) == null ? void 0 : L.controlPlaneId) || "").replace(/{upstreamId}/gi, ((b = s.config) == null ? void 0 : b.upstreamId) || "") : s.config.app === "kongManager" && (H = H.replace(/\/{workspace}/gi, (I = s.config) != null && I.workspace ? `/${s.config.workspace}` : "").replace(/{upstreamId}/gi, ((x = s.config) == null ? void 0 : x.upstreamId) || "")), H;
|
|
1537
|
-
}), {
|
|
1538
|
-
fetcher: c,
|
|
1539
|
-
fetcherState: C,
|
|
1540
|
-
fetcherCacheKey: m
|
|
1541
|
-
} = kt(U(() => ({ ...s.config, cacheIdentifier: s.cacheIdentifier })), l), t = () => {
|
|
1542
|
-
m.value++;
|
|
1543
|
-
}, V = R(null), w = () => {
|
|
1544
|
-
K.value = !0;
|
|
1545
|
-
}, p = async (H, L) => {
|
|
1546
|
-
const b = H.id;
|
|
1547
|
-
if (!await L(b)) {
|
|
1548
|
-
i("copy:error", {
|
|
1549
|
-
entity: H,
|
|
1550
|
-
field: "id",
|
|
1551
|
-
message: h("targets.errors.copy")
|
|
1552
|
-
});
|
|
1553
|
-
return;
|
|
1554
|
-
}
|
|
1555
|
-
i("copy:success", {
|
|
1556
|
-
entity: H,
|
|
1557
|
-
field: "id",
|
|
1558
|
-
message: h("targets.copy.success", { val: b })
|
|
1559
|
-
});
|
|
1560
|
-
}, S = async (H, L) => {
|
|
1561
|
-
const b = JSON.stringify(H);
|
|
1562
|
-
if (!await L(b)) {
|
|
1563
|
-
i("copy:error", {
|
|
1564
|
-
entity: H,
|
|
1565
|
-
message: h("targets.errors.copy")
|
|
1566
|
-
});
|
|
1567
|
-
return;
|
|
1568
|
-
}
|
|
1569
|
-
i("copy:success", {
|
|
1570
|
-
entity: H,
|
|
1571
|
-
message: h("targets.copy.success_brief")
|
|
1572
|
-
});
|
|
1573
|
-
}, G = (H) => {
|
|
1574
|
-
M.value = H, K.value = !0;
|
|
1575
|
-
}, N = (H) => s.config.app === "konnect" ? !1 : s.config.canMarkHealthy(H), X = (H) => s.config.app === "konnect" ? !1 : s.config.canMarkUnhealthy(H), k = R(void 0), T = R(!1), $ = R(!1), A = R(""), _ = _t(s.config, l.value), O = (H) => {
|
|
1576
|
-
k.value = H, T.value = !0;
|
|
1577
|
-
}, W = () => {
|
|
1578
|
-
T.value = !1;
|
|
1579
|
-
}, le = async () => {
|
|
1580
|
-
var H, L, b;
|
|
1581
|
-
if ((H = k.value) != null && H.id) {
|
|
1582
|
-
$.value = !0;
|
|
1583
|
-
try {
|
|
1584
|
-
await g.delete(_(k.value.id)), $.value = !1, T.value = !1, m.value++, i("delete:success", k.value);
|
|
1585
|
-
} catch (I) {
|
|
1586
|
-
A.value = ((b = (L = I.response) == null ? void 0 : L.data) == null ? void 0 : b.message) || I.message || h("targets.errors.delete"), i("error", I);
|
|
1587
|
-
} finally {
|
|
1588
|
-
$.value = !1;
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
};
|
|
1592
|
-
de(C, (H) => {
|
|
1593
|
-
var L, b, I;
|
|
1594
|
-
if (H.status === Ct.Error) {
|
|
1595
|
-
V.value = {
|
|
1596
|
-
title: h("targets.errors.general")
|
|
1597
|
-
}, (I = (b = (L = H.error) == null ? void 0 : L.response) == null ? void 0 : b.data) != null && I.message && (V.value.message = H.error.response.data.message), i("error", H.error);
|
|
1598
|
-
return;
|
|
1599
|
-
}
|
|
1600
|
-
V.value = null;
|
|
1601
|
-
});
|
|
1602
|
-
const z = R({
|
|
1603
|
-
ctaText: void 0,
|
|
1604
|
-
message: `${h("targets.list.empty_state.description")}${s.config.additionMessageForEmptyState ? ` ${s.config.additionMessageForEmptyState}` : ""}`,
|
|
1605
|
-
title: h("targets.title"),
|
|
1606
|
-
...s.config.createRoute && {
|
|
1607
|
-
// If `createRoute` provided in config, add a `ctaPath` to empty state CTA button so it becomes a link
|
|
1608
|
-
ctaPath: s.config.createRoute
|
|
1609
|
-
}
|
|
1610
|
-
});
|
|
1611
|
-
De(async () => {
|
|
1612
|
-
await s.canCreate() && (z.value.title = h("targets.list.empty_state.title"), z.value.ctaText = h("targets.actions.create"));
|
|
1613
|
-
});
|
|
1614
|
-
const re = U(() => ({
|
|
1615
|
-
app: s.config.app,
|
|
1616
|
-
apiBaseUrl: s.config.apiBaseUrl,
|
|
1617
|
-
upstreamId: s.config.upstreamId,
|
|
1618
|
-
axiosRequestConfig: s.config.axiosRequestConfig,
|
|
1619
|
-
// Depending on the app, we need to pass in the control plane ID or workspace
|
|
1620
|
-
// see KonnectTargetFormConfig and KongManagerTargetFormConfig types
|
|
1621
|
-
...s.config.app === "konnect" && {
|
|
1622
|
-
controlPlaneId: s.config.controlPlaneId
|
|
1623
|
-
},
|
|
1624
|
-
...s.config.app === "kongManager" && {
|
|
1625
|
-
workspace: s.config.workspace
|
|
1626
|
-
}
|
|
1627
|
-
})), M = R(""), K = R(!1), ee = (H) => {
|
|
1628
|
-
M.value ? i("update:target", H) : i("create:target", H), se();
|
|
1629
|
-
}, se = () => {
|
|
1630
|
-
ae(), m.value++;
|
|
1631
|
-
}, ae = () => {
|
|
1632
|
-
K.value = !1, M.value = "";
|
|
1633
|
-
};
|
|
1634
|
-
return (H, L) => {
|
|
1635
|
-
const b = P("KButton"), I = P("KBadge"), x = P("KDropdownItem"), Y = P("KClipboardProvider");
|
|
1636
|
-
return q(), oe("div", ca, [
|
|
1637
|
-
u(e(St), {
|
|
1638
|
-
"cache-identifier": a.cacheIdentifier,
|
|
1639
|
-
"disable-sorting": y.value,
|
|
1640
|
-
"empty-state-options": z.value,
|
|
1641
|
-
"enable-entity-actions": "",
|
|
1642
|
-
"error-message": V.value,
|
|
1643
|
-
fetcher: e(c),
|
|
1644
|
-
"fetcher-cache-key": e(m),
|
|
1645
|
-
"pagination-type": "offset",
|
|
1646
|
-
"preferences-storage-key": "kong-ui-entities-targets-list",
|
|
1647
|
-
"table-headers": e(F),
|
|
1648
|
-
onEmptyStateCtaClicked: L[1] || (L[1] = () => s.config.createRoute ? void 0 : w()),
|
|
1649
|
-
onSort: t
|
|
1650
|
-
}, Ie({
|
|
1651
|
-
"toolbar-button": n(() => [
|
|
1652
|
-
(q(), E(bt, {
|
|
1653
|
-
disabled: !a.useActionOutside,
|
|
1654
|
-
to: "#kong-ui-app-page-header-action-button"
|
|
1655
|
-
}, [
|
|
1656
|
-
u(e(ce), {
|
|
1657
|
-
"auth-function": () => a.canCreate()
|
|
1658
|
-
}, {
|
|
1659
|
-
default: n(() => [
|
|
1660
|
-
u(b, {
|
|
1661
|
-
appearance: "primary",
|
|
1662
|
-
"data-testid": "toolbar-new-target",
|
|
1663
|
-
size: a.useActionOutside ? "medium" : "large",
|
|
1664
|
-
to: s.config.createRoute ? s.config.createRoute : void 0,
|
|
1665
|
-
onClick: L[0] || (L[0] = () => s.config.createRoute ? void 0 : w())
|
|
1666
|
-
}, {
|
|
1667
|
-
default: n(() => [
|
|
1668
|
-
u(e(we)),
|
|
1669
|
-
Q(" " + f(e(h)("targets.list.toolbar_actions.new_target")), 1)
|
|
1670
|
-
]),
|
|
1671
|
-
_: 1
|
|
1672
|
-
}, 8, ["size", "to"])
|
|
1673
|
-
]),
|
|
1674
|
-
_: 1
|
|
1675
|
-
}, 8, ["auth-function"])
|
|
1676
|
-
], 8, ["disabled"]))
|
|
1677
|
-
]),
|
|
1678
|
-
target: n(({ rowValue: d }) => [
|
|
1679
|
-
v("span", da, f(d), 1)
|
|
1680
|
-
]),
|
|
1681
|
-
tags: n(({ rowValue: d }) => [
|
|
1682
|
-
u(e(Ht), {
|
|
1683
|
-
"tag-max-width": "auto",
|
|
1684
|
-
tags: d
|
|
1685
|
-
}, null, 8, ["tags"])
|
|
1686
|
-
]),
|
|
1687
|
-
actions: n(({ row: d }) => [
|
|
1688
|
-
u(Y, null, {
|
|
1689
|
-
default: n(({ copyToClipboard: o }) => [
|
|
1690
|
-
u(x, {
|
|
1691
|
-
"data-testid": "action-entity-copy-id",
|
|
1692
|
-
onClick: (r) => p(d, o)
|
|
1693
|
-
}, {
|
|
1694
|
-
default: n(() => [
|
|
1695
|
-
Q(f(e(h)("targets.actions.copy_id")), 1)
|
|
1696
|
-
]),
|
|
1697
|
-
_: 1
|
|
1698
|
-
}, 8, ["onClick"])
|
|
1699
|
-
]),
|
|
1700
|
-
_: 2
|
|
1701
|
-
}, 1024),
|
|
1702
|
-
u(Y, null, {
|
|
1703
|
-
default: n(({ copyToClipboard: o }) => [
|
|
1704
|
-
u(x, {
|
|
1705
|
-
"data-testid": "action-entity-copy-json",
|
|
1706
|
-
onClick: (r) => S(d, o)
|
|
1707
|
-
}, {
|
|
1708
|
-
default: n(() => [
|
|
1709
|
-
Q(f(e(h)("targets.actions.copy_json")), 1)
|
|
1710
|
-
]),
|
|
1711
|
-
_: 1
|
|
1712
|
-
}, 8, ["onClick"])
|
|
1713
|
-
]),
|
|
1714
|
-
_: 2
|
|
1715
|
-
}, 1024),
|
|
1716
|
-
u(e(ce), {
|
|
1717
|
-
"auth-function": () => a.canEdit(d)
|
|
1718
|
-
}, {
|
|
1719
|
-
default: n(() => [
|
|
1720
|
-
u(x, {
|
|
1721
|
-
"data-testid": "action-entity-edit",
|
|
1722
|
-
"has-divider": "",
|
|
1723
|
-
onClick: (o) => G(d.id)
|
|
1724
|
-
}, {
|
|
1725
|
-
default: n(() => [
|
|
1726
|
-
Q(f(e(h)("targets.actions.edit")), 1)
|
|
1727
|
-
]),
|
|
1728
|
-
_: 1
|
|
1729
|
-
}, 8, ["onClick"])
|
|
1730
|
-
]),
|
|
1731
|
-
_: 2
|
|
1732
|
-
}, 1032, ["auth-function"]),
|
|
1733
|
-
u(e(ce), {
|
|
1734
|
-
"auth-function": () => N(d)
|
|
1735
|
-
}, {
|
|
1736
|
-
default: n(() => [
|
|
1737
|
-
u(x, {
|
|
1738
|
-
"data-testid": "action-target-mark-healthy",
|
|
1739
|
-
onClick: (o) => i("health-actions:healthy", d)
|
|
1740
|
-
}, {
|
|
1741
|
-
default: n(() => [
|
|
1742
|
-
Q(f(e(h)("targets.actions.mark_healthy")), 1)
|
|
1743
|
-
]),
|
|
1744
|
-
_: 1
|
|
1745
|
-
}, 8, ["onClick"])
|
|
1746
|
-
]),
|
|
1747
|
-
_: 2
|
|
1748
|
-
}, 1032, ["auth-function"]),
|
|
1749
|
-
u(e(ce), {
|
|
1750
|
-
"auth-function": () => X(d)
|
|
1751
|
-
}, {
|
|
1752
|
-
default: n(() => [
|
|
1753
|
-
u(x, {
|
|
1754
|
-
"data-testid": "action-target-mark-unhealthy",
|
|
1755
|
-
onClick: (o) => i("health-actions:unhealthy", d)
|
|
1756
|
-
}, {
|
|
1757
|
-
default: n(() => [
|
|
1758
|
-
Q(f(e(h)("targets.actions.mark_unhealthy")), 1)
|
|
1759
|
-
]),
|
|
1760
|
-
_: 1
|
|
1761
|
-
}, 8, ["onClick"])
|
|
1762
|
-
]),
|
|
1763
|
-
_: 2
|
|
1764
|
-
}, 1032, ["auth-function"]),
|
|
1765
|
-
u(e(ce), {
|
|
1766
|
-
"auth-function": () => a.canDelete(d)
|
|
1767
|
-
}, {
|
|
1768
|
-
default: n(() => [
|
|
1769
|
-
u(x, {
|
|
1770
|
-
danger: "",
|
|
1771
|
-
"data-testid": "action-entity-delete",
|
|
1772
|
-
"has-divider": "",
|
|
1773
|
-
onClick: (o) => O(d)
|
|
1774
|
-
}, {
|
|
1775
|
-
default: n(() => [
|
|
1776
|
-
Q(f(e(h)("targets.actions.delete")), 1)
|
|
1777
|
-
]),
|
|
1778
|
-
_: 1
|
|
1779
|
-
}, 8, ["onClick"])
|
|
1780
|
-
]),
|
|
1781
|
-
_: 2
|
|
1782
|
-
}, 1032, ["auth-function"])
|
|
1783
|
-
]),
|
|
1784
|
-
_: 2
|
|
1785
|
-
}, [
|
|
1786
|
-
a.failoverEnabled ? {
|
|
1787
|
-
name: "failover",
|
|
1788
|
-
fn: n(({ rowValue: d }) => [
|
|
1789
|
-
u(I, {
|
|
1790
|
-
appearance: "info",
|
|
1791
|
-
class: "upstream-failover"
|
|
1792
|
-
}, {
|
|
1793
|
-
default: n(() => [
|
|
1794
|
-
Q(f(d ? e(h)("targets.form.fields.failover.failover_target") : e(h)("targets.form.fields.failover.load_balance_target")), 1)
|
|
1795
|
-
]),
|
|
1796
|
-
_: 2
|
|
1797
|
-
}, 1024)
|
|
1798
|
-
]),
|
|
1799
|
-
key: "0"
|
|
1800
|
-
} : void 0
|
|
1801
|
-
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "table-headers"]),
|
|
1802
|
-
u(e(Ut), {
|
|
1803
|
-
"action-pending": $.value,
|
|
1804
|
-
description: e(h)("targets.delete.description"),
|
|
1805
|
-
"entity-type": e(It).Target,
|
|
1806
|
-
error: A.value,
|
|
1807
|
-
"need-confirm": !1,
|
|
1808
|
-
title: e(h)("targets.delete.title"),
|
|
1809
|
-
visible: T.value,
|
|
1810
|
-
onCancel: W,
|
|
1811
|
-
onProceed: le
|
|
1812
|
-
}, null, 8, ["action-pending", "description", "entity-type", "error", "title", "visible"]),
|
|
1813
|
-
u(ua, {
|
|
1814
|
-
config: re.value,
|
|
1815
|
-
"failover-enabled": a.failoverEnabled,
|
|
1816
|
-
"failover-unsupported": a.failoverEnabled && !e(ea).includes(a.algorithm),
|
|
1817
|
-
"is-visible": K.value,
|
|
1818
|
-
"target-id": M.value,
|
|
1819
|
-
onCancel: ae,
|
|
1820
|
-
onUpdate: ee
|
|
1821
|
-
}, Ie({ _: 2 }, [
|
|
1822
|
-
H.$slots["form-info"] ? {
|
|
1823
|
-
name: "info",
|
|
1824
|
-
fn: n(() => [
|
|
1825
|
-
vt(H.$slots, "form-info", {}, void 0, !0)
|
|
1826
|
-
]),
|
|
1827
|
-
key: "0"
|
|
1828
|
-
} : void 0
|
|
1829
|
-
]), 1032, ["config", "failover-enabled", "failover-unsupported", "is-visible", "target-id"])
|
|
1830
|
-
]);
|
|
1831
|
-
};
|
|
1832
|
-
}
|
|
1833
|
-
}), Xa = /* @__PURE__ */ me(pa, [["__scopeId", "data-v-9fdfe77a"]]), ma = { key: 1 }, fa = /* @__PURE__ */ ne({
|
|
1834
|
-
__name: "UpstreamsFormGeneralInfo",
|
|
1835
|
-
props: {
|
|
1836
|
-
config: {
|
|
1837
|
-
type: Object,
|
|
1838
|
-
required: !0
|
|
1839
|
-
},
|
|
1840
|
-
name: {
|
|
1841
|
-
type: String,
|
|
1842
|
-
required: !0
|
|
1843
|
-
},
|
|
1844
|
-
hostHeader: {
|
|
1845
|
-
type: String,
|
|
1846
|
-
required: !0
|
|
1847
|
-
},
|
|
1848
|
-
clientCertificate: {
|
|
1849
|
-
type: String,
|
|
1850
|
-
required: !0
|
|
1851
|
-
},
|
|
1852
|
-
tags: {
|
|
1853
|
-
type: String,
|
|
1854
|
-
required: !0
|
|
1855
|
-
},
|
|
1856
|
-
readonly: {
|
|
1857
|
-
type: Boolean,
|
|
1858
|
-
required: !1,
|
|
1859
|
-
default: !1
|
|
1860
|
-
}
|
|
1861
|
-
},
|
|
1862
|
-
emits: ["update:name", "update:host-header", "update:client-certificate", "update:tags"],
|
|
1863
|
-
setup(a, { emit: D }) {
|
|
1864
|
-
var W, le, z, re;
|
|
1865
|
-
const { i18nT: i, i18n: { t: s } } = pe.useI18n(), h = a, g = D, {
|
|
1866
|
-
debouncedQueryChange: y,
|
|
1867
|
-
loading: j,
|
|
1868
|
-
loadItems: F,
|
|
1869
|
-
results: l,
|
|
1870
|
-
allRecords: c
|
|
1871
|
-
} = mt(h.config, (le = ve.form[(W = h.config) == null ? void 0 : W.app]) == null ? void 0 : le.getServices, "", {
|
|
1872
|
-
fetchedItemsKey: "data",
|
|
1873
|
-
searchKeys: ["host"]
|
|
1874
|
-
}), {
|
|
1875
|
-
debouncedQueryChange: C,
|
|
1876
|
-
loading: m,
|
|
1877
|
-
loadItems: t,
|
|
1878
|
-
results: V
|
|
1879
|
-
} = mt(h.config, (re = ve.form[(z = h.config) == null ? void 0 : z.app]) == null ? void 0 : re.getCertificates), w = R(""), p = U(() => {
|
|
1880
|
-
var M;
|
|
1881
|
-
return !!h.name && !((M = c.value) != null && M.some((K) => K.host === h.name));
|
|
1882
|
-
}), S = U(() => {
|
|
1883
|
-
var K, ee, se;
|
|
1884
|
-
const M = p.value && h.name.includes((K = w.value) == null ? void 0 : K.toLowerCase());
|
|
1885
|
-
return (se = l.value) == null ? void 0 : se.map((ae) => ({ label: ae.host, value: ae.id })).concat(
|
|
1886
|
-
M ? [{ label: h.name, value: ((ee = X.value) == null ? void 0 : ee.value) || h.name }] : []
|
|
1887
|
-
);
|
|
1888
|
-
}), G = U(() => {
|
|
1889
|
-
var M;
|
|
1890
|
-
return (M = V.value) == null ? void 0 : M.map((K) => ({ label: K.id, value: K.id }));
|
|
1891
|
-
}), N = R(""), X = R({ value: "", label: "" }), k = U(() => {
|
|
1892
|
-
var M, K;
|
|
1893
|
-
return ((M = S.value.find((ee) => ee.value === N.value)) == null ? void 0 : M.label) || ((K = X.value) == null ? void 0 : K.label);
|
|
1894
|
-
}), T = (M) => {
|
|
1895
|
-
w.value = M, y(M);
|
|
1896
|
-
}, $ = (M) => {
|
|
1897
|
-
X.value = M;
|
|
1898
|
-
}, A = () => {
|
|
1899
|
-
X.value = { value: "", label: "" };
|
|
1900
|
-
}, _ = (M) => {
|
|
1901
|
-
N.value = M, g("update:name", k.value);
|
|
1902
|
-
}, O = R(!1);
|
|
1903
|
-
return De(async () => {
|
|
1904
|
-
var M, K;
|
|
1905
|
-
try {
|
|
1906
|
-
O.value = !0, await F(), h.name && (N.value = ((K = (M = S.value.find((ee) => ee.label === h.name)) == null ? void 0 : M.value) == null ? void 0 : K.toString()) || h.name), await t();
|
|
1907
|
-
} finally {
|
|
1908
|
-
O.value = !1;
|
|
1909
|
-
}
|
|
1910
|
-
}), (M, K) => {
|
|
1911
|
-
const ee = P("KSkeleton"), se = P("KSelect"), ae = P("KInput");
|
|
1912
|
-
return q(), E(e(He), {
|
|
1913
|
-
class: "kong-ui-entities-upstreams-general-info",
|
|
1914
|
-
description: e(s)("upstreams.form.general_info.help"),
|
|
1915
|
-
title: e(s)("upstreams.form.general_info.title")
|
|
1916
|
-
}, {
|
|
1917
|
-
default: n(() => [
|
|
1918
|
-
O.value ? (q(), E(ee, {
|
|
1919
|
-
key: 0,
|
|
1920
|
-
type: "form"
|
|
1921
|
-
})) : (q(), oe("div", ma, [
|
|
1922
|
-
u(se, {
|
|
1923
|
-
class: "name-select margin-bottom-6",
|
|
1924
|
-
clearable: "",
|
|
1925
|
-
"data-testid": "upstreams-form-name",
|
|
1926
|
-
"enable-filtering": "",
|
|
1927
|
-
"enable-item-creation": "",
|
|
1928
|
-
"filter-function": () => !0,
|
|
1929
|
-
items: S.value,
|
|
1930
|
-
label: e(s)("upstreams.form.fields.name.label"),
|
|
1931
|
-
"label-attributes": { tooltipAttributes: { maxWidth: "400" } },
|
|
1932
|
-
loading: e(j),
|
|
1933
|
-
"model-value": N.value,
|
|
1934
|
-
placeholder: e(s)("upstreams.form.fields.name.placeholder"),
|
|
1935
|
-
readonly: a.readonly,
|
|
1936
|
-
required: "",
|
|
1937
|
-
width: "100%",
|
|
1938
|
-
onItemAdded: $,
|
|
1939
|
-
onItemRemoved: A,
|
|
1940
|
-
onQueryChange: T,
|
|
1941
|
-
"onUpdate:modelValue": _
|
|
1942
|
-
}, {
|
|
1943
|
-
"label-tooltip": n(() => [
|
|
1944
|
-
u(e(i), {
|
|
1945
|
-
keypath: "upstreams.form.fields.name.tooltip",
|
|
1946
|
-
scope: "global"
|
|
1947
|
-
}, {
|
|
1948
|
-
host: n(() => [
|
|
1949
|
-
v("code", null, f(e(s)("upstreams.form.fields.name.host")), 1)
|
|
1950
|
-
]),
|
|
1951
|
-
_: 1
|
|
1952
|
-
})
|
|
1953
|
-
]),
|
|
1954
|
-
_: 1
|
|
1955
|
-
}, 8, ["items", "label", "loading", "model-value", "placeholder", "readonly", "onUpdate:modelValue"]),
|
|
1956
|
-
u(ae, {
|
|
1957
|
-
autocomplete: "off",
|
|
1958
|
-
class: "margin-bottom-6",
|
|
1959
|
-
"data-testid": "upstreams-form-host-header",
|
|
1960
|
-
label: e(s)("upstreams.form.fields.host_header.label"),
|
|
1961
|
-
"model-value": a.hostHeader,
|
|
1962
|
-
readonly: a.readonly,
|
|
1963
|
-
type: "text",
|
|
1964
|
-
"onUpdate:modelValue": K[0] || (K[0] = (te) => g("update:host-header", te))
|
|
1965
|
-
}, null, 8, ["label", "model-value", "readonly"]),
|
|
1966
|
-
u(se, {
|
|
1967
|
-
class: "certificate-select margin-bottom-6",
|
|
1968
|
-
clearable: "",
|
|
1969
|
-
"data-testid": "upstreams-form-client-certificate",
|
|
1970
|
-
"enable-filtering": "",
|
|
1971
|
-
"filter-function": () => !0,
|
|
1972
|
-
items: G.value,
|
|
1973
|
-
label: e(s)("upstreams.form.fields.client_certificate.label"),
|
|
1974
|
-
"label-attributes": {
|
|
1975
|
-
info: e(s)("upstreams.form.fields.client_certificate.tooltip"),
|
|
1976
|
-
tooltipAttributes: { maxWidth: "400" }
|
|
1977
|
-
},
|
|
1978
|
-
loading: e(m),
|
|
1979
|
-
"model-value": a.clientCertificate,
|
|
1980
|
-
placeholder: e(s)("upstreams.form.fields.client_certificate.placeholder"),
|
|
1981
|
-
readonly: a.readonly,
|
|
1982
|
-
width: "100%",
|
|
1983
|
-
onQueryChange: e(C),
|
|
1984
|
-
"onUpdate:modelValue": K[1] || (K[1] = (te) => g("update:client-certificate", te))
|
|
1985
|
-
}, null, 8, ["items", "label", "label-attributes", "loading", "model-value", "placeholder", "readonly", "onQueryChange"]),
|
|
1986
|
-
u(ae, {
|
|
1987
|
-
autocomplete: "off",
|
|
1988
|
-
"data-testid": "upstreams-form-tags",
|
|
1989
|
-
help: e(s)("upstreams.form.fields.tags.help"),
|
|
1990
|
-
label: e(s)("upstreams.form.fields.tags.label"),
|
|
1991
|
-
"label-attributes": {
|
|
1992
|
-
info: e(s)("upstreams.form.fields.tags.tooltip"),
|
|
1993
|
-
tooltipAttributes: { maxWidth: "400" }
|
|
1994
|
-
},
|
|
1995
|
-
"model-value": a.tags,
|
|
1996
|
-
placeholder: e(s)("upstreams.form.fields.tags.placeholder"),
|
|
1997
|
-
readonly: a.readonly,
|
|
1998
|
-
type: "text",
|
|
1999
|
-
"onUpdate:modelValue": K[2] || (K[2] = (te) => g("update:tags", te))
|
|
2000
|
-
}, null, 8, ["help", "label", "label-attributes", "model-value", "placeholder", "readonly"])
|
|
2001
|
-
]))
|
|
2002
|
-
]),
|
|
2003
|
-
_: 1
|
|
2004
|
-
}, 8, ["description", "title"]);
|
|
2005
|
-
};
|
|
2006
|
-
}
|
|
2007
|
-
}), ya = /* @__PURE__ */ me(fa, [["__scopeId", "data-v-1a71740c"]]), Me = {
|
|
2008
|
-
upstreamObject: "https://developer.konghq.com/gateway/entities/upstream/",
|
|
2009
|
-
loadBalancing: "https://developer.konghq.com/gateway/traffic-control/load-balancing-reference/"
|
|
2010
|
-
}, ga = { class: "fields-group-title" }, ba = { class: "fields-group-text" }, va = { class: "fields-group-title" }, ka = { class: "fields-group-text" }, _a = /* @__PURE__ */ ne({
|
|
2011
|
-
__name: "UpstreamsFormLoadBalancing",
|
|
2012
|
-
props: {
|
|
2013
|
-
stickySessionsAvailable: {
|
|
2014
|
-
type: Boolean,
|
|
2015
|
-
required: !1,
|
|
2016
|
-
default: !1
|
|
2017
|
-
},
|
|
2018
|
-
algorithm: {
|
|
2019
|
-
type: String,
|
|
2020
|
-
required: !0
|
|
2021
|
-
},
|
|
2022
|
-
stickySessionsCookie: {
|
|
2023
|
-
type: String,
|
|
2024
|
-
required: !0
|
|
2025
|
-
},
|
|
2026
|
-
stickySessionsCookiePath: {
|
|
2027
|
-
type: String,
|
|
2028
|
-
required: !0
|
|
2029
|
-
},
|
|
2030
|
-
slots: {
|
|
2031
|
-
type: String,
|
|
2032
|
-
required: !0
|
|
2033
|
-
},
|
|
2034
|
-
hashOn: {
|
|
2035
|
-
type: String,
|
|
2036
|
-
required: !0
|
|
2037
|
-
},
|
|
2038
|
-
hashFallback: {
|
|
2039
|
-
type: String,
|
|
2040
|
-
required: !0
|
|
2041
|
-
},
|
|
2042
|
-
hashOnHeader: {
|
|
2043
|
-
type: String,
|
|
2044
|
-
required: !0
|
|
2045
|
-
},
|
|
2046
|
-
hashOnCookie: {
|
|
2047
|
-
type: String,
|
|
2048
|
-
required: !0
|
|
2049
|
-
},
|
|
2050
|
-
hashOnCookiePath: {
|
|
2051
|
-
type: String,
|
|
2052
|
-
required: !0
|
|
2053
|
-
},
|
|
2054
|
-
hashOnQueryArgument: {
|
|
2055
|
-
type: String,
|
|
2056
|
-
required: !0
|
|
2057
|
-
},
|
|
2058
|
-
hashOnUriCapture: {
|
|
2059
|
-
type: String,
|
|
2060
|
-
required: !0
|
|
2061
|
-
},
|
|
2062
|
-
hashFallbackHeader: {
|
|
2063
|
-
type: String,
|
|
2064
|
-
required: !0
|
|
2065
|
-
},
|
|
2066
|
-
hashFallbackQueryArgument: {
|
|
2067
|
-
type: String,
|
|
2068
|
-
required: !0
|
|
2069
|
-
},
|
|
2070
|
-
hashFallbackUriCapture: {
|
|
2071
|
-
type: String,
|
|
2072
|
-
required: !0
|
|
2073
|
-
},
|
|
2074
|
-
readonly: {
|
|
2075
|
-
type: Boolean,
|
|
2076
|
-
required: !1,
|
|
2077
|
-
default: !1
|
|
2078
|
-
}
|
|
2079
|
-
},
|
|
2080
|
-
emits: ["update:algorithm", "update:sticky-sessions-cookie", "update:sticky-sessions-cookie-path", "update:slots", "update:hash-on", "update:hash-fallback", "update:hash-on-header", "update:hash-on-cookie", "update:hash-on-cookie-path", "update:hash-on-query-argument", "update:hash-on-uri-capture", "update:hash-fallback-header", "update:hash-fallback-query-argument", "update:hash-fallback-uri-capture"],
|
|
2081
|
-
setup(a, { emit: D }) {
|
|
2082
|
-
const { i18nT: i, i18n: { t: s } } = pe.useI18n(), { inRange: h } = Ae(), g = a, y = D, j = R([
|
|
2083
|
-
{
|
|
2084
|
-
label: s("upstreams.form.algorithms.round_robin_label"),
|
|
2085
|
-
value: "round-robin",
|
|
2086
|
-
selected: !1
|
|
2087
|
-
},
|
|
2088
|
-
{
|
|
2089
|
-
label: s("upstreams.form.algorithms.least_connections_label"),
|
|
2090
|
-
value: "least-connections",
|
|
2091
|
-
selected: !1
|
|
2092
|
-
},
|
|
2093
|
-
{
|
|
2094
|
-
label: s("upstreams.form.algorithms.consistent_hashing_label"),
|
|
2095
|
-
value: "consistent-hashing",
|
|
2096
|
-
selected: !1
|
|
2097
|
-
},
|
|
2098
|
-
{
|
|
2099
|
-
label: s("upstreams.form.algorithms.latency_label"),
|
|
2100
|
-
value: "latency",
|
|
2101
|
-
selected: !1
|
|
2102
|
-
},
|
|
2103
|
-
...g.stickySessionsAvailable ? [{
|
|
2104
|
-
label: s("upstreams.form.algorithms.sticky_sessions_label"),
|
|
2105
|
-
value: "sticky-sessions",
|
|
2106
|
-
selected: !1
|
|
2107
|
-
}] : []
|
|
2108
|
-
]), F = R([
|
|
2109
|
-
{
|
|
2110
|
-
label: s("upstreams.form.hash_labels.none"),
|
|
2111
|
-
value: "none",
|
|
2112
|
-
selected: !1
|
|
2113
|
-
},
|
|
2114
|
-
{
|
|
2115
|
-
label: s("upstreams.form.hash_labels.consumer"),
|
|
2116
|
-
value: "consumer",
|
|
2117
|
-
selected: !1
|
|
2118
|
-
},
|
|
2119
|
-
{
|
|
2120
|
-
label: s("upstreams.form.hash_labels.ip"),
|
|
2121
|
-
value: "ip",
|
|
2122
|
-
selected: !1
|
|
2123
|
-
},
|
|
2124
|
-
{
|
|
2125
|
-
label: s("upstreams.form.hash_labels.header"),
|
|
2126
|
-
value: "header",
|
|
2127
|
-
selected: !1
|
|
2128
|
-
},
|
|
2129
|
-
{
|
|
2130
|
-
label: s("upstreams.form.hash_labels.cookie"),
|
|
2131
|
-
value: "cookie",
|
|
2132
|
-
selected: !1
|
|
2133
|
-
},
|
|
2134
|
-
{
|
|
2135
|
-
label: s("upstreams.form.hash_labels.path"),
|
|
2136
|
-
value: "path",
|
|
2137
|
-
selected: !1
|
|
2138
|
-
},
|
|
2139
|
-
{
|
|
2140
|
-
label: s("upstreams.form.hash_labels.query_argument"),
|
|
2141
|
-
value: "query_arg",
|
|
2142
|
-
selected: !1
|
|
2143
|
-
},
|
|
2144
|
-
{
|
|
2145
|
-
label: s("upstreams.form.hash_labels.uri_capture"),
|
|
2146
|
-
value: "uri_capture",
|
|
2147
|
-
selected: !1
|
|
2148
|
-
}
|
|
2149
|
-
]);
|
|
2150
|
-
de(() => g.hashOn, (C, m) => {
|
|
2151
|
-
m === "header" && C !== m && y("update:hash-on-header", ""), m === "cookie" && C !== m && (y("update:hash-on-cookie", ""), y("update:hash-on-cookie-path", "/")), m === "query_arg" && C !== m && y("update:hash-on-query-argument", ""), m === "uri_capture" && C !== m && y("update:hash-on-uri-capture", ""), (C === "cookie" || C === "none") && (y("update:hash-fallback", "none"), y("update:hash-fallback-header", ""), y("update:hash-fallback-query-argument", ""), y("update:hash-fallback-uri-capture", ""));
|
|
2152
|
-
}), de(() => g.hashFallback, (C, m) => {
|
|
2153
|
-
m === "header" && C !== m && y("update:hash-fallback-header", ""), m === "cookie" && C !== m && (y("update:hash-on-cookie", ""), y("update:hash-on-cookie-path", "/")), m === "query_arg" && C !== m && y("update:hash-fallback-query-argument", ""), m === "uri_capture" && C !== m && y("update:hash-fallback-uri-capture", "");
|
|
2154
|
-
}), de(() => g.algorithm, (C) => {
|
|
2155
|
-
C === "sticky-sessions" && (y("update:slots", "10000"), y("update:hash-on", "none"), y("update:hash-fallback", "none"), y("update:hash-on-header", ""), y("update:hash-on-cookie", ""), y("update:hash-on-cookie-path", "/"), y("update:hash-on-query-argument", ""), y("update:hash-on-uri-capture", ""), y("update:hash-fallback-header", ""), y("update:hash-fallback-query-argument", ""), y("update:hash-fallback-uri-capture", ""));
|
|
2156
|
-
}, { immediate: !0 });
|
|
2157
|
-
const l = U(() => g.hashOn === "cookie" || g.hashOn === "none"), c = U(() => g.slots ? h(g.slots, Ne, Be) ? "" : s("upstreams.form.errors.in_range") : "");
|
|
2158
|
-
return (C, m) => {
|
|
2159
|
-
const t = P("KExternalLink"), V = P("KSelect"), w = P("KInput"), p = P("KCard");
|
|
2160
|
-
return q(), E(e(He), {
|
|
2161
|
-
class: "kong-ui-entities-upstreams-load-balancing",
|
|
2162
|
-
title: e(s)("upstreams.form.load_balancing.title")
|
|
2163
|
-
}, {
|
|
2164
|
-
description: n(() => [
|
|
2165
|
-
v("p", null, [
|
|
2166
|
-
Q(f(e(s)("upstreams.form.load_balancing.help")) + " ", 1),
|
|
2167
|
-
u(t, {
|
|
2168
|
-
"hide-icon": "",
|
|
2169
|
-
href: e(Me).upstreamObject
|
|
2170
|
-
}, {
|
|
2171
|
-
default: n(() => [
|
|
2172
|
-
Q(f(e(s)("upstreams.form.buttons.view_documentation")), 1)
|
|
2173
|
-
]),
|
|
2174
|
-
_: 1
|
|
2175
|
-
}, 8, ["href"])
|
|
2176
|
-
])
|
|
2177
|
-
]),
|
|
2178
|
-
default: n(() => [
|
|
2179
|
-
u(V, {
|
|
2180
|
-
class: "algorithm-select",
|
|
2181
|
-
items: j.value,
|
|
2182
|
-
label: e(s)("upstreams.form.fields.algorithm.label"),
|
|
2183
|
-
"model-value": a.algorithm,
|
|
2184
|
-
readonly: a.readonly,
|
|
2185
|
-
width: "100%",
|
|
2186
|
-
"onUpdate:modelValue": m[0] || (m[0] = (S) => y("update:algorithm", S))
|
|
2187
|
-
}, null, 8, ["items", "label", "model-value", "readonly"]),
|
|
2188
|
-
a.algorithm === "sticky-sessions" ? (q(), oe(Ce, { key: 0 }, [
|
|
2189
|
-
u(w, {
|
|
2190
|
-
autocomplete: "off",
|
|
2191
|
-
"data-testid": "upstreams-form-sticky-sessions-cookie",
|
|
2192
|
-
label: e(s)("upstreams.form.fields.sticky_sessions_cookie.label"),
|
|
2193
|
-
"label-attributes": {
|
|
2194
|
-
info: e(s)("upstreams.form.fields.sticky_sessions_cookie.tooltip"),
|
|
2195
|
-
tooltipAttributes: { maxWidth: "400" }
|
|
2196
|
-
},
|
|
2197
|
-
"model-value": a.stickySessionsCookie,
|
|
2198
|
-
readonly: a.readonly,
|
|
2199
|
-
required: "",
|
|
2200
|
-
type: "text",
|
|
2201
|
-
"onUpdate:modelValue": m[1] || (m[1] = (S) => y("update:sticky-sessions-cookie", S))
|
|
2202
|
-
}, null, 8, ["label", "label-attributes", "model-value", "readonly"]),
|
|
2203
|
-
u(w, {
|
|
2204
|
-
autocomplete: "off",
|
|
2205
|
-
"data-testid": "upstreams-form-sticky-sessions-cookie-path",
|
|
2206
|
-
label: e(s)("upstreams.form.fields.sticky_sessions_cookie_path.label"),
|
|
2207
|
-
"label-attributes": {
|
|
2208
|
-
info: e(s)("upstreams.form.fields.sticky_sessions_cookie_path.tooltip"),
|
|
2209
|
-
tooltipAttributes: { maxWidth: "400" }
|
|
2210
|
-
},
|
|
2211
|
-
"model-value": a.stickySessionsCookiePath,
|
|
2212
|
-
readonly: a.readonly,
|
|
2213
|
-
required: "",
|
|
2214
|
-
type: "text",
|
|
2215
|
-
"onUpdate:modelValue": m[2] || (m[2] = (S) => y("update:sticky-sessions-cookie-path", S))
|
|
2216
|
-
}, null, 8, ["label", "label-attributes", "model-value", "readonly"])
|
|
2217
|
-
], 64)) : B("", !0),
|
|
2218
|
-
a.algorithm !== "sticky-sessions" ? (q(), E(w, {
|
|
2219
|
-
key: 1,
|
|
2220
|
-
autocomplete: "off",
|
|
2221
|
-
"data-testid": "upstreams-form-slots",
|
|
2222
|
-
error: !!c.value,
|
|
2223
|
-
"error-message": c.value,
|
|
2224
|
-
help: e(s)("upstreams.form.fields.slots.help"),
|
|
2225
|
-
label: e(s)("upstreams.form.fields.slots.label"),
|
|
2226
|
-
max: e(Be),
|
|
2227
|
-
min: e(Ne),
|
|
2228
|
-
"model-value": a.slots,
|
|
2229
|
-
readonly: a.readonly,
|
|
2230
|
-
type: "number",
|
|
2231
|
-
"onUpdate:modelValue": m[3] || (m[3] = (S) => y("update:slots", S))
|
|
2232
|
-
}, null, 8, ["error", "error-message", "help", "label", "max", "min", "model-value", "readonly"])) : B("", !0),
|
|
2233
|
-
a.algorithm !== "sticky-sessions" ? (q(), E(p, { key: 2 }, {
|
|
2234
|
-
default: n(() => [
|
|
2235
|
-
v("h5", ga, f(e(s)("upstreams.form.fields.hash_on.label")), 1),
|
|
2236
|
-
v("p", ba, f(e(s)("upstreams.form.fields.hash_on.help")), 1),
|
|
2237
|
-
u(V, {
|
|
2238
|
-
class: "hash-on-select",
|
|
2239
|
-
items: F.value,
|
|
2240
|
-
label: e(s)("upstreams.form.fields.hash_on.label"),
|
|
2241
|
-
"model-value": a.hashOn,
|
|
2242
|
-
readonly: a.readonly,
|
|
2243
|
-
width: "100%",
|
|
2244
|
-
"onUpdate:modelValue": m[4] || (m[4] = (S) => y("update:hash-on", S))
|
|
2245
|
-
}, null, 8, ["items", "label", "model-value", "readonly"]),
|
|
2246
|
-
a.hashOn === "header" ? (q(), E(w, {
|
|
2247
|
-
key: 0,
|
|
2248
|
-
autocomplete: "off",
|
|
2249
|
-
class: "margin-top-6",
|
|
2250
|
-
"data-testid": "upstreams-form-hash-on-header",
|
|
2251
|
-
label: e(s)("upstreams.form.fields.header.label"),
|
|
2252
|
-
"model-value": a.hashOnHeader,
|
|
2253
|
-
readonly: a.readonly,
|
|
2254
|
-
required: "",
|
|
2255
|
-
type: "text",
|
|
2256
|
-
"onUpdate:modelValue": m[5] || (m[5] = (S) => y("update:hash-on-header", S))
|
|
2257
|
-
}, null, 8, ["label", "model-value", "readonly"])) : B("", !0),
|
|
2258
|
-
a.hashOn === "cookie" ? (q(), oe(Ce, { key: 1 }, [
|
|
2259
|
-
u(w, {
|
|
2260
|
-
autocomplete: "off",
|
|
2261
|
-
class: "margin-top-6",
|
|
2262
|
-
"data-testid": "upstreams-form-hash-on-cookie",
|
|
2263
|
-
label: e(s)("upstreams.form.fields.cookie.label"),
|
|
2264
|
-
"model-value": a.hashOnCookie,
|
|
2265
|
-
readonly: a.readonly,
|
|
2266
|
-
required: "",
|
|
2267
|
-
type: "text",
|
|
2268
|
-
"onUpdate:modelValue": m[6] || (m[6] = (S) => y("update:hash-on-cookie", S))
|
|
2269
|
-
}, null, 8, ["label", "model-value", "readonly"]),
|
|
2270
|
-
u(w, {
|
|
2271
|
-
autocomplete: "off",
|
|
2272
|
-
class: "margin-top-6",
|
|
2273
|
-
"data-testid": "upstreams-form-hash-on-cookie-path",
|
|
2274
|
-
label: e(s)("upstreams.form.fields.cookie_path.label"),
|
|
2275
|
-
"model-value": a.hashOnCookiePath,
|
|
2276
|
-
readonly: a.readonly,
|
|
2277
|
-
required: "",
|
|
2278
|
-
type: "text",
|
|
2279
|
-
"onUpdate:modelValue": m[7] || (m[7] = (S) => y("update:hash-on-cookie-path", S))
|
|
2280
|
-
}, null, 8, ["label", "model-value", "readonly"])
|
|
2281
|
-
], 64)) : B("", !0),
|
|
2282
|
-
a.hashOn === "query_arg" ? (q(), E(w, {
|
|
2283
|
-
key: 2,
|
|
2284
|
-
autocomplete: "off",
|
|
2285
|
-
class: "margin-top-6",
|
|
2286
|
-
"data-testid": "upstreams-form-query-argument",
|
|
2287
|
-
label: e(s)("upstreams.form.fields.query_argument.label"),
|
|
2288
|
-
"model-value": a.hashOnQueryArgument,
|
|
2289
|
-
readonly: a.readonly,
|
|
2290
|
-
required: "",
|
|
2291
|
-
type: "text",
|
|
2292
|
-
"onUpdate:modelValue": m[8] || (m[8] = (S) => y("update:hash-on-query-argument", S))
|
|
2293
|
-
}, null, 8, ["label", "model-value", "readonly"])) : B("", !0),
|
|
2294
|
-
a.hashOn === "uri_capture" ? (q(), E(w, {
|
|
2295
|
-
key: 3,
|
|
2296
|
-
autocomplete: "off",
|
|
2297
|
-
class: "margin-top-6",
|
|
2298
|
-
"data-testid": "upstreams-form-uri-capture",
|
|
2299
|
-
label: e(s)("upstreams.form.fields.uri_capture.label"),
|
|
2300
|
-
"model-value": a.hashOnUriCapture,
|
|
2301
|
-
readonly: a.readonly,
|
|
2302
|
-
required: "",
|
|
2303
|
-
type: "text",
|
|
2304
|
-
"onUpdate:modelValue": m[9] || (m[9] = (S) => y("update:hash-on-uri-capture", S))
|
|
2305
|
-
}, null, 8, ["label", "model-value", "readonly"])) : B("", !0)
|
|
2306
|
-
]),
|
|
2307
|
-
_: 1
|
|
2308
|
-
})) : B("", !0),
|
|
2309
|
-
a.algorithm !== "sticky-sessions" ? (q(), E(p, { key: 3 }, {
|
|
2310
|
-
default: n(() => [
|
|
2311
|
-
v("h5", va, f(e(s)("upstreams.form.fields.hash_fallback.label")), 1),
|
|
2312
|
-
v("p", ka, f(e(s)("upstreams.form.fields.hash_fallback.help")), 1),
|
|
2313
|
-
u(V, {
|
|
2314
|
-
class: "hash-fallback-select",
|
|
2315
|
-
disabled: l.value,
|
|
2316
|
-
items: F.value,
|
|
2317
|
-
label: e(s)("upstreams.form.fields.hash_fallback.label"),
|
|
2318
|
-
"label-attributes": { tooltipAttributes: { maxWidth: "400" } },
|
|
2319
|
-
"model-value": a.hashFallback,
|
|
2320
|
-
readonly: a.readonly,
|
|
2321
|
-
width: "100%",
|
|
2322
|
-
"onUpdate:modelValue": m[10] || (m[10] = (S) => y("update:hash-fallback", S))
|
|
2323
|
-
}, {
|
|
2324
|
-
"label-tooltip": n(() => [
|
|
2325
|
-
u(e(i), {
|
|
2326
|
-
keypath: "upstreams.form.fields.hash_fallback.tooltip",
|
|
2327
|
-
scope: "global"
|
|
2328
|
-
}, {
|
|
2329
|
-
hash_on: n(() => [
|
|
2330
|
-
v("code", null, f(e(s)("upstreams.form.fields.hash_fallback.hash_on")), 1)
|
|
2331
|
-
]),
|
|
2332
|
-
cookie: n(() => [
|
|
2333
|
-
v("code", null, f(e(s)("upstreams.form.fields.hash_fallback.cookie")), 1)
|
|
2334
|
-
]),
|
|
2335
|
-
_: 1
|
|
2336
|
-
})
|
|
2337
|
-
]),
|
|
2338
|
-
_: 1
|
|
2339
|
-
}, 8, ["disabled", "items", "label", "model-value", "readonly"]),
|
|
2340
|
-
a.hashFallback === "header" ? (q(), E(w, {
|
|
2341
|
-
key: 0,
|
|
2342
|
-
autocomplete: "off",
|
|
2343
|
-
class: "margin-top-6",
|
|
2344
|
-
"data-testid": "upstreams-form-hash-fallback-header",
|
|
2345
|
-
label: e(s)("upstreams.form.fields.header.label"),
|
|
2346
|
-
"model-value": a.hashFallbackHeader,
|
|
2347
|
-
readonly: a.readonly,
|
|
2348
|
-
required: "",
|
|
2349
|
-
type: "text",
|
|
2350
|
-
"onUpdate:modelValue": m[11] || (m[11] = (S) => y("update:hash-fallback-header", S))
|
|
2351
|
-
}, null, 8, ["label", "model-value", "readonly"])) : B("", !0),
|
|
2352
|
-
a.hashFallback === "cookie" ? (q(), oe(Ce, { key: 1 }, [
|
|
2353
|
-
u(w, {
|
|
2354
|
-
autocomplete: "off",
|
|
2355
|
-
class: "margin-top-6",
|
|
2356
|
-
"data-testid": "upstreams-form-hash-on-cookie",
|
|
2357
|
-
label: e(s)("upstreams.form.fields.cookie.label"),
|
|
2358
|
-
"model-value": a.hashOnCookie,
|
|
2359
|
-
readonly: a.readonly,
|
|
2360
|
-
required: "",
|
|
2361
|
-
type: "text",
|
|
2362
|
-
"onUpdate:modelValue": m[12] || (m[12] = (S) => y("update:hash-on-cookie", S))
|
|
2363
|
-
}, null, 8, ["label", "model-value", "readonly"]),
|
|
2364
|
-
u(w, {
|
|
2365
|
-
autocomplete: "off",
|
|
2366
|
-
class: "margin-top-6",
|
|
2367
|
-
"data-testid": "upstreams-form-hash-on-cookie-path",
|
|
2368
|
-
label: e(s)("upstreams.form.fields.cookie_path.label"),
|
|
2369
|
-
"model-value": a.hashOnCookiePath,
|
|
2370
|
-
readonly: a.readonly,
|
|
2371
|
-
required: "",
|
|
2372
|
-
type: "text",
|
|
2373
|
-
"onUpdate:modelValue": m[13] || (m[13] = (S) => y("update:hash-on-cookie-path", S))
|
|
2374
|
-
}, null, 8, ["label", "model-value", "readonly"])
|
|
2375
|
-
], 64)) : B("", !0),
|
|
2376
|
-
a.hashFallback === "query_arg" ? (q(), E(w, {
|
|
2377
|
-
key: 2,
|
|
2378
|
-
autocomplete: "off",
|
|
2379
|
-
class: "margin-top-6",
|
|
2380
|
-
"data-testid": "upstreams-form-hash-fallback-query-argument",
|
|
2381
|
-
label: e(s)("upstreams.form.fields.query_argument.label"),
|
|
2382
|
-
"model-value": a.hashFallbackQueryArgument,
|
|
2383
|
-
readonly: a.readonly,
|
|
2384
|
-
required: "",
|
|
2385
|
-
type: "text",
|
|
2386
|
-
"onUpdate:modelValue": m[14] || (m[14] = (S) => y("update:hash-fallback-query-argument", S))
|
|
2387
|
-
}, null, 8, ["label", "model-value", "readonly"])) : B("", !0),
|
|
2388
|
-
a.hashFallback === "uri_capture" ? (q(), E(w, {
|
|
2389
|
-
key: 3,
|
|
2390
|
-
autocomplete: "off",
|
|
2391
|
-
class: "margin-top-6",
|
|
2392
|
-
"data-testid": "upstreams-form-hash-fallback-uri-capture",
|
|
2393
|
-
label: e(s)("upstreams.form.fields.uri_capture.label"),
|
|
2394
|
-
"model-value": a.hashFallbackUriCapture,
|
|
2395
|
-
readonly: a.readonly,
|
|
2396
|
-
required: "",
|
|
2397
|
-
type: "text",
|
|
2398
|
-
"onUpdate:modelValue": m[15] || (m[15] = (S) => y("update:hash-fallback-uri-capture", S))
|
|
2399
|
-
}, null, 8, ["label", "model-value", "readonly"])) : B("", !0)
|
|
2400
|
-
]),
|
|
2401
|
-
_: 1
|
|
2402
|
-
})) : B("", !0)
|
|
2403
|
-
]),
|
|
2404
|
-
_: 1
|
|
2405
|
-
}, 8, ["title"]);
|
|
2406
|
-
};
|
|
2407
|
-
}
|
|
2408
|
-
}), Ca = /* @__PURE__ */ me(_a, [["__scopeId", "data-v-656aa4f4"]]), Sa = { class: "fields-group-title" }, Ha = { class: "fields-group-text" }, Ua = { class: "fields-group-title" }, Ia = { class: "fields-group-text" }, qa = /* @__PURE__ */ ne({
|
|
2409
|
-
__name: "UpstreamsFormHealthChecks",
|
|
2410
|
-
props: {
|
|
2411
|
-
activeHealthSwitch: {
|
|
2412
|
-
type: Boolean,
|
|
2413
|
-
required: !0
|
|
2414
|
-
},
|
|
2415
|
-
passiveHealthSwitch: {
|
|
2416
|
-
type: Boolean,
|
|
2417
|
-
required: !0
|
|
2418
|
-
},
|
|
2419
|
-
healthchecksThreshold: {
|
|
2420
|
-
type: String,
|
|
2421
|
-
required: !0
|
|
2422
|
-
},
|
|
2423
|
-
readonly: {
|
|
2424
|
-
type: Boolean,
|
|
2425
|
-
required: !1,
|
|
2426
|
-
default: !1
|
|
2427
|
-
}
|
|
2428
|
-
},
|
|
2429
|
-
emits: ["update:active-health-switch", "update:passive-health-switch", "update:healthchecks-threshold"],
|
|
2430
|
-
setup(a, { emit: D }) {
|
|
2431
|
-
const { i18n: { t: i } } = pe.useI18n(), s = D;
|
|
2432
|
-
return (h, g) => {
|
|
2433
|
-
const y = P("KExternalLink"), j = P("KInputSwitch"), F = P("KCard"), l = P("KInput");
|
|
2434
|
-
return q(), E(e(He), {
|
|
2435
|
-
class: "kong-ui-entities-upstreams-healthchecks",
|
|
2436
|
-
title: e(i)("upstreams.form.health_check.title")
|
|
2437
|
-
}, {
|
|
2438
|
-
description: n(() => [
|
|
2439
|
-
v("p", null, [
|
|
2440
|
-
Q(f(e(i)("upstreams.form.health_check.help")) + " ", 1),
|
|
2441
|
-
u(y, {
|
|
2442
|
-
"hide-icon": "",
|
|
2443
|
-
href: e(Me).loadBalancing
|
|
2444
|
-
}, {
|
|
2445
|
-
default: n(() => [
|
|
2446
|
-
Q(f(e(i)("upstreams.form.buttons.view_documentation")), 1)
|
|
2447
|
-
]),
|
|
2448
|
-
_: 1
|
|
2449
|
-
}, 8, ["href"])
|
|
2450
|
-
])
|
|
2451
|
-
]),
|
|
2452
|
-
default: n(() => [
|
|
2453
|
-
u(F, null, {
|
|
2454
|
-
default: n(() => [
|
|
2455
|
-
v("h5", Sa, f(e(i)("upstreams.form.fields.active_health_checks.label")), 1),
|
|
2456
|
-
v("p", Ha, f(e(i)("upstreams.form.fields.active_health_checks.help")), 1),
|
|
2457
|
-
u(j, {
|
|
2458
|
-
class: "active-health-switch",
|
|
2459
|
-
"data-testid": "active-health-switch",
|
|
2460
|
-
disabled: a.readonly,
|
|
2461
|
-
"model-value": a.activeHealthSwitch,
|
|
2462
|
-
onChange: g[0] || (g[0] = (c) => s("update:active-health-switch", c))
|
|
2463
|
-
}, null, 8, ["disabled", "model-value"])
|
|
2464
|
-
]),
|
|
2465
|
-
_: 1
|
|
2466
|
-
}),
|
|
2467
|
-
u(F, null, {
|
|
2468
|
-
default: n(() => [
|
|
2469
|
-
v("h5", Ua, f(e(i)("upstreams.form.fields.passive_health_checks.label")), 1),
|
|
2470
|
-
v("p", Ia, f(e(i)("upstreams.form.fields.passive_health_checks.help")), 1),
|
|
2471
|
-
u(j, {
|
|
2472
|
-
class: "passive-health-switch",
|
|
2473
|
-
"data-testid": "passive-health-switch",
|
|
2474
|
-
disabled: a.readonly,
|
|
2475
|
-
"model-value": a.passiveHealthSwitch,
|
|
2476
|
-
onChange: g[1] || (g[1] = (c) => s("update:passive-health-switch", c))
|
|
2477
|
-
}, null, 8, ["disabled", "model-value"])
|
|
2478
|
-
]),
|
|
2479
|
-
_: 1
|
|
2480
|
-
}),
|
|
2481
|
-
u(l, {
|
|
2482
|
-
autocomplete: "off",
|
|
2483
|
-
"data-testid": "upstreams-form-healthchecks-threshold",
|
|
2484
|
-
label: e(i)("upstreams.form.fields.healthchecks_threshold.label"),
|
|
2485
|
-
max: e(Gt),
|
|
2486
|
-
min: e(Jt),
|
|
2487
|
-
"model-value": a.healthchecksThreshold,
|
|
2488
|
-
readonly: a.readonly,
|
|
2489
|
-
type: "number",
|
|
2490
|
-
"onUpdate:modelValue": g[2] || (g[2] = (c) => s("update:healthchecks-threshold", c))
|
|
2491
|
-
}, null, 8, ["label", "max", "min", "model-value", "readonly"])
|
|
2492
|
-
]),
|
|
2493
|
-
_: 1
|
|
2494
|
-
}, 8, ["title"]);
|
|
2495
|
-
};
|
|
2496
|
-
}
|
|
2497
|
-
}), wa = /* @__PURE__ */ me(qa, [["__scopeId", "data-v-c2ff95ff"]]), Ta = "#d60027", Fa = { class: "fields-group-title" }, xa = { class: "fields-group-text" }, Oa = { class: "fields-group-title" }, Pa = { class: "fields-group-text" }, $a = /* @__PURE__ */ ne({
|
|
2498
|
-
__name: "UpstreamsFormActiveHealthCheck",
|
|
2499
|
-
props: {
|
|
2500
|
-
config: {
|
|
2501
|
-
type: Object,
|
|
2502
|
-
required: !0
|
|
2503
|
-
},
|
|
2504
|
-
type: {
|
|
2505
|
-
type: String,
|
|
2506
|
-
required: !0
|
|
2507
|
-
},
|
|
2508
|
-
httpPath: {
|
|
2509
|
-
type: String,
|
|
2510
|
-
required: !0
|
|
2511
|
-
},
|
|
2512
|
-
timeout: {
|
|
2513
|
-
type: String,
|
|
2514
|
-
required: !0
|
|
2515
|
-
},
|
|
2516
|
-
concurrency: {
|
|
2517
|
-
type: String,
|
|
2518
|
-
required: !0
|
|
2519
|
-
},
|
|
2520
|
-
httpsSni: {
|
|
2521
|
-
type: String,
|
|
2522
|
-
required: !0
|
|
2523
|
-
},
|
|
2524
|
-
verifySsl: {
|
|
2525
|
-
type: Boolean,
|
|
2526
|
-
required: !0
|
|
2527
|
-
},
|
|
2528
|
-
headers: {
|
|
2529
|
-
type: Array,
|
|
2530
|
-
required: !0
|
|
2531
|
-
},
|
|
2532
|
-
healthyInterval: {
|
|
2533
|
-
type: String,
|
|
2534
|
-
required: !0
|
|
2535
|
-
},
|
|
2536
|
-
healthySuccesses: {
|
|
2537
|
-
type: String,
|
|
2538
|
-
required: !0
|
|
2539
|
-
},
|
|
2540
|
-
healthyHttpStatuses: {
|
|
2541
|
-
type: Array,
|
|
2542
|
-
required: !0
|
|
2543
|
-
},
|
|
2544
|
-
unhealthyInterval: {
|
|
2545
|
-
type: String,
|
|
2546
|
-
required: !0
|
|
2547
|
-
},
|
|
2548
|
-
unhealthyHttpFailures: {
|
|
2549
|
-
type: String,
|
|
2550
|
-
required: !0
|
|
2551
|
-
},
|
|
2552
|
-
unhealthyTcpFailures: {
|
|
2553
|
-
type: String,
|
|
2554
|
-
required: !0
|
|
2555
|
-
},
|
|
2556
|
-
unhealthyHttpStatuses: {
|
|
2557
|
-
type: Array,
|
|
2558
|
-
required: !0
|
|
2559
|
-
},
|
|
2560
|
-
unhealthyTimeouts: {
|
|
2561
|
-
type: String,
|
|
2562
|
-
required: !0
|
|
2563
|
-
},
|
|
2564
|
-
readonly: {
|
|
2565
|
-
type: Boolean,
|
|
2566
|
-
required: !1,
|
|
2567
|
-
default: !1
|
|
2568
|
-
}
|
|
2569
|
-
},
|
|
2570
|
-
emits: ["update:type", "update:http-path", "update:timeout", "update:concurrency", "update:https-sni", "update:verify-ssl", "update:headers", "update:healthy-interval", "update:healthy-successes", "update:healthy-http-statuses", "update:unhealthy-interval", "update:unhealthy-http-failures", "update:unhealthy-tcp-failures", "update:unhealthy-http-statuses", "update:unhealthy-timeouts"],
|
|
2571
|
-
setup(a, { emit: D }) {
|
|
2572
|
-
const { i18n: { t: i } } = pe.useI18n(), { objectsAreEqual: s } = Ae(), h = a, g = D, y = R([
|
|
2573
|
-
{
|
|
2574
|
-
label: i("upstreams.form.healthcheck_type_labels.http"),
|
|
2575
|
-
value: "http",
|
|
2576
|
-
selected: !1
|
|
2577
|
-
},
|
|
2578
|
-
{
|
|
2579
|
-
label: i("upstreams.form.healthcheck_type_labels.https"),
|
|
2580
|
-
value: "https",
|
|
2581
|
-
selected: !1
|
|
2582
|
-
},
|
|
2583
|
-
{
|
|
2584
|
-
label: i("upstreams.form.healthcheck_type_labels.tcp"),
|
|
2585
|
-
value: "tcp",
|
|
2586
|
-
selected: !1
|
|
2587
|
-
},
|
|
2588
|
-
{
|
|
2589
|
-
label: i("upstreams.form.healthcheck_type_labels.grsp"),
|
|
2590
|
-
value: "grpc",
|
|
2591
|
-
selected: !1
|
|
2592
|
-
},
|
|
2593
|
-
{
|
|
2594
|
-
label: i("upstreams.form.healthcheck_type_labels.grsps"),
|
|
2595
|
-
value: "grpcs",
|
|
2596
|
-
selected: !1
|
|
2597
|
-
}
|
|
2598
|
-
]), j = U(() => h.type === "https" || h.type === "grpcs"), F = U(() => h.type === "tcp"), {
|
|
2599
|
-
trackNewItems: l
|
|
2600
|
-
} = Se({ replaceId: !0 }), {
|
|
2601
|
-
trackNewItems: c
|
|
2602
|
-
} = Se({ replaceId: !0 });
|
|
2603
|
-
de(() => h.type, (w, p) => {
|
|
2604
|
-
p === "tcp" && w !== p && g("update:unhealthy-tcp-failures", "5"), (p === "https" || p === "grpcs") && w !== p && (g("update:https-sni", ""), g("update:verify-ssl", !1)), p !== "tcp" && w === "tcp" && (g("update:http-path", "/"), g("update:healthy-http-statuses", Fe), g("update:unhealthy-http-statuses", Oe));
|
|
2605
|
-
});
|
|
2606
|
-
const C = R([{ key: "", values: "" }]);
|
|
2607
|
-
de(() => h.headers, (w) => {
|
|
2608
|
-
s(C.value, w) || (C.value = [...w]);
|
|
2609
|
-
}, {
|
|
2610
|
-
immediate: !0,
|
|
2611
|
-
deep: !0
|
|
2612
|
-
});
|
|
2613
|
-
const m = () => {
|
|
2614
|
-
g("update:headers", C.value);
|
|
2615
|
-
}, t = () => {
|
|
2616
|
-
C.value.push({ key: "", values: "" }), m();
|
|
2617
|
-
}, V = (w) => {
|
|
2618
|
-
w === 0 && C.value.length === 1 ? C.value[0] = { key: "", values: "" } : C.value.splice(w, 1), m();
|
|
2619
|
-
};
|
|
2620
|
-
return (w, p) => {
|
|
2621
|
-
const S = P("KExternalLink"), G = P("KSelect"), N = P("KInput"), X = P("KCheckbox"), k = P("KLabel"), T = P("KButton"), $ = P("KMultiselect"), A = P("KCard");
|
|
2622
|
-
return q(), E(e(He), {
|
|
2623
|
-
class: "kong-ui-entities-upstreams-active-healthcheck",
|
|
2624
|
-
title: e(i)("upstreams.form.active_health_check.title")
|
|
2625
|
-
}, {
|
|
2626
|
-
description: n(() => [
|
|
2627
|
-
v("p", null, [
|
|
2628
|
-
Q(f(e(i)("upstreams.form.active_health_check.help")) + " ", 1),
|
|
2629
|
-
u(S, {
|
|
2630
|
-
"hide-icon": "",
|
|
2631
|
-
href: e(Me).upstreamObject
|
|
2632
|
-
}, {
|
|
2633
|
-
default: n(() => [
|
|
2634
|
-
Q(f(e(i)("upstreams.form.buttons.view_documentation")), 1)
|
|
2635
|
-
]),
|
|
2636
|
-
_: 1
|
|
2637
|
-
}, 8, ["href"])
|
|
2638
|
-
])
|
|
2639
|
-
]),
|
|
2640
|
-
default: n(() => [
|
|
2641
|
-
u(G, {
|
|
2642
|
-
class: "active-healthcheck-type-select",
|
|
2643
|
-
items: y.value,
|
|
2644
|
-
label: e(i)("upstreams.form.fields.active_healthcheck_type.label"),
|
|
2645
|
-
"model-value": a.type,
|
|
2646
|
-
readonly: a.readonly,
|
|
2647
|
-
width: "100%",
|
|
2648
|
-
"onUpdate:modelValue": p[0] || (p[0] = (_) => g("update:type", _))
|
|
2649
|
-
}, null, 8, ["items", "label", "model-value", "readonly"]),
|
|
2650
|
-
F.value ? B("", !0) : (q(), E(N, {
|
|
2651
|
-
key: 0,
|
|
2652
|
-
autocomplete: "off",
|
|
2653
|
-
"data-testid": "active-healthcheck-http-path",
|
|
2654
|
-
label: e(i)("upstreams.form.fields.http_path.label"),
|
|
2655
|
-
"model-value": a.httpPath,
|
|
2656
|
-
readonly: a.readonly,
|
|
2657
|
-
type: "text",
|
|
2658
|
-
"onUpdate:modelValue": p[1] || (p[1] = (_) => g("update:http-path", _))
|
|
2659
|
-
}, null, 8, ["label", "model-value", "readonly"])),
|
|
2660
|
-
u(N, {
|
|
2661
|
-
autocomplete: "off",
|
|
2662
|
-
"data-testid": "active-healthcheck-timeout",
|
|
2663
|
-
label: e(i)("upstreams.form.fields.timeout.label"),
|
|
2664
|
-
max: e(Xt),
|
|
2665
|
-
min: e(zt),
|
|
2666
|
-
"model-value": a.timeout,
|
|
2667
|
-
readonly: a.readonly,
|
|
2668
|
-
type: "number",
|
|
2669
|
-
"onUpdate:modelValue": p[2] || (p[2] = (_) => g("update:timeout", _))
|
|
2670
|
-
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
2671
|
-
u(N, {
|
|
2672
|
-
autocomplete: "off",
|
|
2673
|
-
"data-testid": "active-healthcheck-concurrency",
|
|
2674
|
-
label: e(i)("upstreams.form.fields.concurrency.label"),
|
|
2675
|
-
max: e(Zt),
|
|
2676
|
-
min: e(Yt),
|
|
2677
|
-
"model-value": a.concurrency,
|
|
2678
|
-
readonly: a.readonly,
|
|
2679
|
-
type: "number",
|
|
2680
|
-
"onUpdate:modelValue": p[3] || (p[3] = (_) => g("update:concurrency", _))
|
|
2681
|
-
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
2682
|
-
j.value ? (q(), oe(Ce, { key: 1 }, [
|
|
2683
|
-
u(N, {
|
|
2684
|
-
autocomplete: "off",
|
|
2685
|
-
class: "margin-bottom-6",
|
|
2686
|
-
"data-testid": "active-healthcheck-https-sni",
|
|
2687
|
-
label: e(i)("upstreams.form.fields.https_sni.label"),
|
|
2688
|
-
"model-value": a.httpsSni,
|
|
2689
|
-
readonly: a.readonly,
|
|
2690
|
-
type: "text",
|
|
2691
|
-
"onUpdate:modelValue": p[4] || (p[4] = (_) => g("update:https-sni", _))
|
|
2692
|
-
}, null, 8, ["label", "model-value", "readonly"]),
|
|
2693
|
-
u(X, {
|
|
2694
|
-
"data-testid": "active-healthcheck-verify-ssl",
|
|
2695
|
-
disabled: a.readonly,
|
|
2696
|
-
label: e(i)("upstreams.form.fields.verify_ssl.label"),
|
|
2697
|
-
"model-value": a.verifySsl,
|
|
2698
|
-
"onUpdate:modelValue": p[5] || (p[5] = (_) => g("update:verify-ssl", _))
|
|
2699
|
-
}, null, 8, ["disabled", "label", "model-value"])
|
|
2700
|
-
], 64)) : B("", !0),
|
|
2701
|
-
v("div", null, [
|
|
2702
|
-
u(k, {
|
|
2703
|
-
info: e(i)("upstreams.form.fields.headers.tooltip_active"),
|
|
2704
|
-
"tooltip-attributes": { maxWidth: "250px" }
|
|
2705
|
-
}, {
|
|
2706
|
-
default: n(() => [
|
|
2707
|
-
Q(f(e(i)("upstreams.form.fields.headers.label")), 1)
|
|
2708
|
-
]),
|
|
2709
|
-
_: 1
|
|
2710
|
-
}, 8, ["info"]),
|
|
2711
|
-
v("div", null, [
|
|
2712
|
-
(q(!0), oe(Ce, null, Pt(C.value, (_, O) => (q(), oe("div", {
|
|
2713
|
-
key: `${_.header}_${O}`,
|
|
2714
|
-
class: $t(["headers-row", { "margin-top-6": O > 0 }])
|
|
2715
|
-
}, [
|
|
2716
|
-
u(N, {
|
|
2717
|
-
modelValue: C.value[O].key,
|
|
2718
|
-
"onUpdate:modelValue": (W) => C.value[O].key = W,
|
|
2719
|
-
autocomplete: "off",
|
|
2720
|
-
"data-testid": `active-healthcheck-headers-header-${O + 1}`,
|
|
2721
|
-
readonly: a.readonly,
|
|
2722
|
-
type: "text",
|
|
2723
|
-
onBlur: m
|
|
2724
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "readonly"]),
|
|
2725
|
-
u(N, {
|
|
2726
|
-
modelValue: C.value[O].values,
|
|
2727
|
-
"onUpdate:modelValue": (W) => C.value[O].values = W,
|
|
2728
|
-
autocomplete: "off",
|
|
2729
|
-
"data-testid": `active-healthcheck-headers-value-${O + 1}`,
|
|
2730
|
-
readonly: a.readonly,
|
|
2731
|
-
type: "text",
|
|
2732
|
-
onBlur: m
|
|
2733
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "readonly"]),
|
|
2734
|
-
u(T, {
|
|
2735
|
-
appearance: "tertiary",
|
|
2736
|
-
class: "btn-remove",
|
|
2737
|
-
"data-testid": "btn-remove-header",
|
|
2738
|
-
disabled: C.value.length === 1,
|
|
2739
|
-
icon: "",
|
|
2740
|
-
onClick: (W) => V(O)
|
|
2741
|
-
}, {
|
|
2742
|
-
default: n(() => [
|
|
2743
|
-
u(e(Bt), {
|
|
2744
|
-
class: "delete-item",
|
|
2745
|
-
color: C.value.length > 1 ? e(Ta) : void 0
|
|
2746
|
-
}, null, 8, ["color"])
|
|
2747
|
-
]),
|
|
2748
|
-
_: 1
|
|
2749
|
-
}, 8, ["disabled", "onClick"]),
|
|
2750
|
-
C.value && O === C.value.length - 1 ? (q(), E(T, {
|
|
2751
|
-
key: 0,
|
|
2752
|
-
appearance: "tertiary",
|
|
2753
|
-
class: "btn-add-header",
|
|
2754
|
-
"data-testid": "btn-add-header",
|
|
2755
|
-
icon: "",
|
|
2756
|
-
onClick: t
|
|
2757
|
-
}, {
|
|
2758
|
-
default: n(() => [
|
|
2759
|
-
u(e(we))
|
|
2760
|
-
]),
|
|
2761
|
-
_: 1
|
|
2762
|
-
})) : B("", !0)
|
|
2763
|
-
], 2))), 128))
|
|
2764
|
-
])
|
|
2765
|
-
]),
|
|
2766
|
-
u(A, null, {
|
|
2767
|
-
default: n(() => [
|
|
2768
|
-
v("h5", Fa, f(e(i)("upstreams.form.healthy.label")), 1),
|
|
2769
|
-
v("p", xa, f(e(i)("upstreams.form.healthy.help")), 1),
|
|
2770
|
-
u(N, {
|
|
2771
|
-
autocomplete: "off",
|
|
2772
|
-
class: "margin-bottom-6",
|
|
2773
|
-
"data-testid": "active-healthcheck-healthy-interval",
|
|
2774
|
-
help: e(i)("upstreams.form.fields.interval.help"),
|
|
2775
|
-
label: e(i)("upstreams.form.fields.interval.label"),
|
|
2776
|
-
max: e(gt),
|
|
2777
|
-
min: e(yt),
|
|
2778
|
-
"model-value": a.healthyInterval,
|
|
2779
|
-
readonly: a.readonly,
|
|
2780
|
-
type: "number",
|
|
2781
|
-
"onUpdate:modelValue": p[6] || (p[6] = (_) => g("update:healthy-interval", _))
|
|
2782
|
-
}, null, 8, ["help", "label", "max", "min", "model-value", "readonly"]),
|
|
2783
|
-
u(N, {
|
|
2784
|
-
autocomplete: "off",
|
|
2785
|
-
"data-testid": "active-healthcheck-healthy-successes",
|
|
2786
|
-
label: e(i)("upstreams.form.fields.successes.label"),
|
|
2787
|
-
max: e(be),
|
|
2788
|
-
min: e(ge),
|
|
2789
|
-
"model-value": a.healthySuccesses,
|
|
2790
|
-
readonly: a.readonly,
|
|
2791
|
-
type: "number",
|
|
2792
|
-
"onUpdate:modelValue": p[7] || (p[7] = (_) => g("update:healthy-successes", _))
|
|
2793
|
-
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
2794
|
-
F.value ? B("", !0) : (q(), E($, {
|
|
2795
|
-
key: 0,
|
|
2796
|
-
autocomplete: "off",
|
|
2797
|
-
class: "margin-top-6 active-healthcheck-healthy-http-statuses",
|
|
2798
|
-
"data-testid": "active-healthcheck-healthy-http-statuses",
|
|
2799
|
-
"enable-item-creation": "",
|
|
2800
|
-
items: e(Te),
|
|
2801
|
-
label: e(i)("upstreams.form.fields.http_statuses.label"),
|
|
2802
|
-
"model-value": a.healthyHttpStatuses,
|
|
2803
|
-
readonly: a.readonly,
|
|
2804
|
-
width: "100%",
|
|
2805
|
-
onItemAdded: p[8] || (p[8] = (_) => e(l)(_, !0)),
|
|
2806
|
-
onItemRemoved: p[9] || (p[9] = (_) => e(l)(_, !1)),
|
|
2807
|
-
"onUpdate:modelValue": p[10] || (p[10] = (_) => g("update:healthy-http-statuses", _))
|
|
2808
|
-
}, null, 8, ["items", "label", "model-value", "readonly"]))
|
|
2809
|
-
]),
|
|
2810
|
-
_: 1
|
|
2811
|
-
}),
|
|
2812
|
-
u(A, null, {
|
|
2813
|
-
default: n(() => [
|
|
2814
|
-
v("h5", Oa, f(e(i)("upstreams.form.unhealthy.label")), 1),
|
|
2815
|
-
v("p", Pa, f(e(i)("upstreams.form.unhealthy.help")), 1),
|
|
2816
|
-
u(N, {
|
|
2817
|
-
autocomplete: "off",
|
|
2818
|
-
class: "margin-bottom-6",
|
|
2819
|
-
"data-testid": "active-healthcheck-unhealthy-interval",
|
|
2820
|
-
help: e(i)("upstreams.form.fields.interval.help"),
|
|
2821
|
-
label: e(i)("upstreams.form.fields.interval.label"),
|
|
2822
|
-
max: e(gt),
|
|
2823
|
-
min: e(yt),
|
|
2824
|
-
"model-value": a.unhealthyInterval,
|
|
2825
|
-
readonly: a.readonly,
|
|
2826
|
-
type: "number",
|
|
2827
|
-
"onUpdate:modelValue": p[11] || (p[11] = (_) => g("update:unhealthy-interval", _))
|
|
2828
|
-
}, null, 8, ["help", "label", "max", "min", "model-value", "readonly"]),
|
|
2829
|
-
u(N, {
|
|
2830
|
-
autocomplete: "off",
|
|
2831
|
-
class: "margin-bottom-6",
|
|
2832
|
-
"data-testid": "active-healthcheck-unhealthy-tcp-failures",
|
|
2833
|
-
label: e(i)("upstreams.form.fields.tcp_failures.label"),
|
|
2834
|
-
max: e(be),
|
|
2835
|
-
min: e(ge),
|
|
2836
|
-
"model-value": a.unhealthyTcpFailures,
|
|
2837
|
-
readonly: a.readonly,
|
|
2838
|
-
type: "number",
|
|
2839
|
-
"onUpdate:modelValue": p[12] || (p[12] = (_) => g("update:unhealthy-tcp-failures", _))
|
|
2840
|
-
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
2841
|
-
F.value ? B("", !0) : (q(), E(N, {
|
|
2842
|
-
key: 0,
|
|
2843
|
-
autocomplete: "off",
|
|
2844
|
-
class: "margin-bottom-6",
|
|
2845
|
-
"data-testid": "active-healthcheck-unhealthy-http-failures",
|
|
2846
|
-
label: e(i)("upstreams.form.fields.http_failures.label"),
|
|
2847
|
-
max: e(be),
|
|
2848
|
-
min: e(ge),
|
|
2849
|
-
"model-value": a.unhealthyHttpFailures,
|
|
2850
|
-
readonly: a.readonly,
|
|
2851
|
-
type: "number",
|
|
2852
|
-
"onUpdate:modelValue": p[13] || (p[13] = (_) => g("update:unhealthy-http-failures", _))
|
|
2853
|
-
}, null, 8, ["label", "max", "min", "model-value", "readonly"])),
|
|
2854
|
-
F.value ? B("", !0) : (q(), E($, {
|
|
2855
|
-
key: 1,
|
|
2856
|
-
autocomplete: "off",
|
|
2857
|
-
class: "margin-bottom-6 active-healthcheck-unhealthy-http-statuses",
|
|
2858
|
-
"data-testid": "active-healthcheck-unhealthy-http-statuses",
|
|
2859
|
-
"enable-item-creation": "",
|
|
2860
|
-
items: e(Te),
|
|
2861
|
-
label: e(i)("upstreams.form.fields.http_statuses.label"),
|
|
2862
|
-
"model-value": a.unhealthyHttpStatuses,
|
|
2863
|
-
readonly: a.readonly,
|
|
2864
|
-
width: "100%",
|
|
2865
|
-
onItemAdded: p[14] || (p[14] = (_) => e(c)(_, !0)),
|
|
2866
|
-
onItemRemoved: p[15] || (p[15] = (_) => e(c)(_, !1)),
|
|
2867
|
-
"onUpdate:modelValue": p[16] || (p[16] = (_) => g("update:unhealthy-http-statuses", _))
|
|
2868
|
-
}, null, 8, ["items", "label", "model-value", "readonly"])),
|
|
2869
|
-
u(N, {
|
|
2870
|
-
autocomplete: "off",
|
|
2871
|
-
"data-testid": "active-healthcheck-unhealthy-timeouts",
|
|
2872
|
-
label: e(i)("upstreams.form.fields.timeouts.label"),
|
|
2873
|
-
max: e(xt),
|
|
2874
|
-
min: e(Ft),
|
|
2875
|
-
"model-value": a.unhealthyTimeouts,
|
|
2876
|
-
readonly: a.readonly,
|
|
2877
|
-
type: "number",
|
|
2878
|
-
"onUpdate:modelValue": p[17] || (p[17] = (_) => g("update:unhealthy-timeouts", _))
|
|
2879
|
-
}, null, 8, ["label", "max", "min", "model-value", "readonly"])
|
|
2880
|
-
]),
|
|
2881
|
-
_: 1
|
|
2882
|
-
})
|
|
2883
|
-
]),
|
|
2884
|
-
_: 1
|
|
2885
|
-
}, 8, ["title"]);
|
|
2886
|
-
};
|
|
2887
|
-
}
|
|
2888
|
-
}), Aa = /* @__PURE__ */ me($a, [["__scopeId", "data-v-cfc70316"]]), Ma = { class: "fields-group-title" }, Ka = { class: "fields-group-text" }, Va = { class: "fields-group-title" }, Ea = { class: "fields-group-text" }, Na = /* @__PURE__ */ ne({
|
|
2889
|
-
__name: "UpstreamsFormPassiveHealthCheck",
|
|
2890
|
-
props: {
|
|
2891
|
-
type: {
|
|
2892
|
-
type: String,
|
|
2893
|
-
required: !0
|
|
2894
|
-
},
|
|
2895
|
-
healthySuccesses: {
|
|
2896
|
-
type: String,
|
|
2897
|
-
required: !0
|
|
2898
|
-
},
|
|
2899
|
-
healthyHttpStatuses: {
|
|
2900
|
-
type: Array,
|
|
2901
|
-
required: !0
|
|
2902
|
-
},
|
|
2903
|
-
unhealthyTimeouts: {
|
|
2904
|
-
type: String,
|
|
2905
|
-
required: !0
|
|
2906
|
-
},
|
|
2907
|
-
unhealthyHttpFailures: {
|
|
2908
|
-
type: String,
|
|
2909
|
-
required: !0
|
|
2910
|
-
},
|
|
2911
|
-
unhealthyHttpStatuses: {
|
|
2912
|
-
type: Array,
|
|
2913
|
-
required: !0
|
|
2914
|
-
},
|
|
2915
|
-
unhealthyTcpFailures: {
|
|
2916
|
-
type: String,
|
|
2917
|
-
required: !0
|
|
2918
|
-
},
|
|
2919
|
-
readonly: {
|
|
2920
|
-
type: Boolean,
|
|
2921
|
-
required: !1,
|
|
2922
|
-
default: !1
|
|
2923
|
-
}
|
|
2924
|
-
},
|
|
2925
|
-
emits: ["update:type", "update:healthy-successes", "update:healthy-http-statuses", "update:unhealthy-timeouts", "update:unhealthy-http-failures", "update:unhealthy-http-statuses", "update:unhealthy-tcp-failures"],
|
|
2926
|
-
setup(a, { emit: D }) {
|
|
2927
|
-
const { i18n: { t: i } } = pe.useI18n(), s = a, h = D, g = R([
|
|
2928
|
-
{
|
|
2929
|
-
label: i("upstreams.form.healthcheck_type_labels.http"),
|
|
2930
|
-
value: "http",
|
|
2931
|
-
selected: !1
|
|
2932
|
-
},
|
|
2933
|
-
{
|
|
2934
|
-
label: i("upstreams.form.healthcheck_type_labels.https"),
|
|
2935
|
-
value: "https",
|
|
2936
|
-
selected: !1
|
|
2937
|
-
},
|
|
2938
|
-
{
|
|
2939
|
-
label: i("upstreams.form.healthcheck_type_labels.tcp"),
|
|
2940
|
-
value: "tcp",
|
|
2941
|
-
selected: !1
|
|
2942
|
-
},
|
|
2943
|
-
{
|
|
2944
|
-
label: i("upstreams.form.healthcheck_type_labels.grsp"),
|
|
2945
|
-
value: "grpc",
|
|
2946
|
-
selected: !1
|
|
2947
|
-
},
|
|
2948
|
-
{
|
|
2949
|
-
label: i("upstreams.form.healthcheck_type_labels.grsps"),
|
|
2950
|
-
value: "grpcs",
|
|
2951
|
-
selected: !1
|
|
2952
|
-
}
|
|
2953
|
-
]), y = U(() => s.type === "tcp"), {
|
|
2954
|
-
trackNewItems: j
|
|
2955
|
-
} = Se({ replaceId: !0 }), {
|
|
2956
|
-
trackNewItems: F
|
|
2957
|
-
} = Se({ replaceId: !0 });
|
|
2958
|
-
return de(() => s.type, (l, c) => {
|
|
2959
|
-
c === "tcp" && l !== c && h("update:unhealthy-tcp-failures", "5"), c !== "tcp" && l === "tcp" && (h("update:healthy-http-statuses", xe), h("update:unhealthy-http-statuses", Pe));
|
|
2960
|
-
}), (l, c) => {
|
|
2961
|
-
const C = P("KExternalLink"), m = P("KSelect"), t = P("KInput"), V = P("KMultiselect"), w = P("KCard");
|
|
2962
|
-
return q(), E(e(He), {
|
|
2963
|
-
class: "kong-ui-entities-upstreams-passive-healthcheck",
|
|
2964
|
-
title: e(i)("upstreams.form.passive_health_check.title")
|
|
2965
|
-
}, {
|
|
2966
|
-
description: n(() => [
|
|
2967
|
-
v("p", null, [
|
|
2968
|
-
Q(f(e(i)("upstreams.form.passive_health_check.help")) + " ", 1),
|
|
2969
|
-
u(C, {
|
|
2970
|
-
"hide-icon": "",
|
|
2971
|
-
href: e(Me).upstreamObject
|
|
2972
|
-
}, {
|
|
2973
|
-
default: n(() => [
|
|
2974
|
-
Q(f(e(i)("upstreams.form.buttons.view_documentation")), 1)
|
|
2975
|
-
]),
|
|
2976
|
-
_: 1
|
|
2977
|
-
}, 8, ["href"])
|
|
2978
|
-
])
|
|
2979
|
-
]),
|
|
2980
|
-
default: n(() => [
|
|
2981
|
-
u(m, {
|
|
2982
|
-
class: "passive-healthcheck-type-select",
|
|
2983
|
-
items: g.value,
|
|
2984
|
-
label: e(i)("upstreams.form.fields.passive_health_check_type.label"),
|
|
2985
|
-
"model-value": a.type,
|
|
2986
|
-
readonly: a.readonly,
|
|
2987
|
-
width: "100%",
|
|
2988
|
-
"onUpdate:modelValue": c[0] || (c[0] = (p) => h("update:type", p))
|
|
2989
|
-
}, null, 8, ["items", "label", "model-value", "readonly"]),
|
|
2990
|
-
u(w, null, {
|
|
2991
|
-
default: n(() => [
|
|
2992
|
-
v("h5", Ma, f(e(i)("upstreams.form.passive_healthy.label")), 1),
|
|
2993
|
-
v("p", Ka, f(e(i)("upstreams.form.passive_healthy.help")), 1),
|
|
2994
|
-
u(t, {
|
|
2995
|
-
autocomplete: "off",
|
|
2996
|
-
"data-testid": "passive-healthcheck-healthy-successes",
|
|
2997
|
-
label: e(i)("upstreams.form.fields.successes.label"),
|
|
2998
|
-
max: e(be),
|
|
2999
|
-
min: e(ge),
|
|
3000
|
-
"model-value": a.healthySuccesses,
|
|
3001
|
-
readonly: a.readonly,
|
|
3002
|
-
type: "number",
|
|
3003
|
-
"onUpdate:modelValue": c[1] || (c[1] = (p) => h("update:healthy-successes", p))
|
|
3004
|
-
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
3005
|
-
y.value ? B("", !0) : (q(), E(V, {
|
|
3006
|
-
key: 0,
|
|
3007
|
-
class: "margin-top-6 passive-healthcheck-healthy-http-statuses",
|
|
3008
|
-
"enable-item-creation": "",
|
|
3009
|
-
items: e(Te),
|
|
3010
|
-
label: e(i)("upstreams.form.fields.http_statuses.label"),
|
|
3011
|
-
"model-value": a.healthyHttpStatuses,
|
|
3012
|
-
readonly: a.readonly,
|
|
3013
|
-
width: "100%",
|
|
3014
|
-
onItemAdded: c[2] || (c[2] = (p) => e(j)(p, !0)),
|
|
3015
|
-
onItemRemoved: c[3] || (c[3] = (p) => e(j)(p, !1)),
|
|
3016
|
-
"onUpdate:modelValue": c[4] || (c[4] = (p) => h("update:healthy-http-statuses", p))
|
|
3017
|
-
}, null, 8, ["items", "label", "model-value", "readonly"]))
|
|
3018
|
-
]),
|
|
3019
|
-
_: 1
|
|
3020
|
-
}),
|
|
3021
|
-
u(w, null, {
|
|
3022
|
-
default: n(() => [
|
|
3023
|
-
v("h5", Va, f(e(i)("upstreams.form.passive_unhealthy.label")), 1),
|
|
3024
|
-
v("p", Ea, f(e(i)("upstreams.form.passive_unhealthy.help")), 1),
|
|
3025
|
-
u(t, {
|
|
3026
|
-
autocomplete: "off",
|
|
3027
|
-
"data-testid": "passive-healthcheck-unhealthy-timeouts",
|
|
3028
|
-
label: e(i)("upstreams.form.fields.timeouts.label"),
|
|
3029
|
-
max: e(xt),
|
|
3030
|
-
min: e(Ft),
|
|
3031
|
-
"model-value": a.unhealthyTimeouts,
|
|
3032
|
-
readonly: a.readonly,
|
|
3033
|
-
type: "number",
|
|
3034
|
-
"onUpdate:modelValue": c[5] || (c[5] = (p) => h("update:unhealthy-timeouts", p))
|
|
3035
|
-
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
3036
|
-
u(t, {
|
|
3037
|
-
autocomplete: "off",
|
|
3038
|
-
class: "margin-top-6",
|
|
3039
|
-
"data-testid": "passive-healthcheck-unhealthy-tcp-failures",
|
|
3040
|
-
label: e(i)("upstreams.form.fields.tcp_failures.label"),
|
|
3041
|
-
max: e(be),
|
|
3042
|
-
min: e(ge),
|
|
3043
|
-
"model-value": a.unhealthyTcpFailures,
|
|
3044
|
-
readonly: a.readonly,
|
|
3045
|
-
type: "number",
|
|
3046
|
-
"onUpdate:modelValue": c[6] || (c[6] = (p) => h("update:unhealthy-tcp-failures", p))
|
|
3047
|
-
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
3048
|
-
y.value ? B("", !0) : (q(), E(t, {
|
|
3049
|
-
key: 0,
|
|
3050
|
-
autocomplete: "off",
|
|
3051
|
-
class: "margin-top-6",
|
|
3052
|
-
"data-testid": "passive-healthcheck-unhealthy-http-failures",
|
|
3053
|
-
label: e(i)("upstreams.form.fields.http_failures.label"),
|
|
3054
|
-
max: e(be),
|
|
3055
|
-
min: e(ge),
|
|
3056
|
-
"model-value": a.unhealthyHttpFailures,
|
|
3057
|
-
readonly: a.readonly,
|
|
3058
|
-
type: "number",
|
|
3059
|
-
"onUpdate:modelValue": c[7] || (c[7] = (p) => h("update:unhealthy-http-failures", p))
|
|
3060
|
-
}, null, 8, ["label", "max", "min", "model-value", "readonly"])),
|
|
3061
|
-
y.value ? B("", !0) : (q(), E(V, {
|
|
3062
|
-
key: 1,
|
|
3063
|
-
autocomplete: "off",
|
|
3064
|
-
class: "margin-top-6 passive-healthcheck-unhealthy-http-statuses",
|
|
3065
|
-
"data-testid": "passive-healthcheck-unhealthy-http-statuses",
|
|
3066
|
-
"enable-item-creation": "",
|
|
3067
|
-
items: e(Te),
|
|
3068
|
-
label: e(i)("upstreams.form.fields.http_statuses.label"),
|
|
3069
|
-
"model-value": a.unhealthyHttpStatuses,
|
|
3070
|
-
readonly: a.readonly,
|
|
3071
|
-
width: "100%",
|
|
3072
|
-
onItemAdded: c[8] || (c[8] = (p) => e(F)(p, !0)),
|
|
3073
|
-
onItemRemoved: c[9] || (c[9] = (p) => e(F)(p, !1)),
|
|
3074
|
-
"onUpdate:modelValue": c[10] || (c[10] = (p) => h("update:unhealthy-http-statuses", p))
|
|
3075
|
-
}, null, 8, ["items", "label", "model-value", "readonly"]))
|
|
3076
|
-
]),
|
|
3077
|
-
_: 1
|
|
3078
|
-
})
|
|
3079
|
-
]),
|
|
3080
|
-
_: 1
|
|
3081
|
-
}, 8, ["title"]);
|
|
3082
|
-
};
|
|
3083
|
-
}
|
|
3084
|
-
}), Ba = /* @__PURE__ */ me(Na, [["__scopeId", "data-v-7c20c5c5"]]), Ra = { class: "kong-ui-entities-upstreams-form" }, Da = /* @__PURE__ */ ne({
|
|
3085
|
-
__name: "UpstreamsForm",
|
|
3086
|
-
props: {
|
|
3087
|
-
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
3088
|
-
config: {
|
|
3089
|
-
type: Object,
|
|
3090
|
-
required: !0,
|
|
3091
|
-
validator: (a) => !(!a || !["konnect", "kongManager"].includes(a == null ? void 0 : a.app) || (a == null ? void 0 : a.app) === "konnect" && !(a != null && a.controlPlaneId) || (a == null ? void 0 : a.app) === "kongManager" && typeof (a == null ? void 0 : a.workspace) != "string" || !(a != null && a.cancelRoute))
|
|
3092
|
-
},
|
|
3093
|
-
/** If a valid upstreamId is provided, it will put the form in Edit mode instead of Create */
|
|
3094
|
-
upstreamId: {
|
|
3095
|
-
type: String,
|
|
3096
|
-
required: !1,
|
|
3097
|
-
default: ""
|
|
3098
|
-
}
|
|
3099
|
-
},
|
|
3100
|
-
emits: ["update", "error", "loading"],
|
|
3101
|
-
setup(a, { emit: D }) {
|
|
3102
|
-
var Y;
|
|
3103
|
-
const i = a, s = D, { inRange: h, stringToNumberArray: g, upstreamsResponseToFields: y, getDefaultUpstreamFields: j, objectsAreEqual: F, cloneDeep: l } = Ae(), { axiosInstance: c } = $e((Y = i.config) == null ? void 0 : Y.axiosRequestConfig), { getMessageFromError: C } = qt(), m = Tt(), t = qe({
|
|
3104
|
-
fields: j(),
|
|
3105
|
-
readonly: !1,
|
|
3106
|
-
errorMessage: ""
|
|
3107
|
-
}), V = qe(j()), w = U(() => !F(t.fields, V)), p = (d) => {
|
|
3108
|
-
t.fields.activeHealthCheck.healthy.interval = d ? "5" : "0", t.fields.activeHealthCheck.healthy.successes = d ? "5" : "0", t.fields.activeHealthCheck.healthy.httpStatuses = d ? Fe : [], t.fields.activeHealthCheck.unhealthy.httpStatuses = d ? Oe : [], t.fields.activeHealthCheck.unhealthy.httpFailures = d ? "5" : "0", t.fields.activeHealthCheck.unhealthy.interval = d ? "5" : "0", t.fields.activeHealthCheck.unhealthy.tcpFailures = d ? "5" : "0", t.fields.activeHealthCheck.unhealthy.timeouts = d ? "5" : "0", t.fields.activeHealthCheck.timeout = d ? "1" : "0", t.fields.activeHealthCheck.concurrency = d ? "10" : "0", t.fields.activeHealthCheck.httpPath = d ? "/" : "", t.fields.activeHealthCheck.httpsSni = "", t.fields.activeHealthCheck.type = "http";
|
|
3109
|
-
}, S = (d) => {
|
|
3110
|
-
t.fields.passiveHealthCheck.healthy.successes = d ? "80" : "0", t.fields.passiveHealthCheck.healthy.httpStatuses = d ? xe : [], t.fields.passiveHealthCheck.unhealthy.timeouts = d ? "5" : "0", t.fields.passiveHealthCheck.unhealthy.tcpFailures = d ? "5" : "0", t.fields.passiveHealthCheck.unhealthy.httpFailures = d ? "5" : "0", t.fields.passiveHealthCheck.unhealthy.httpStatuses = d ? Pe : [], t.fields.passiveHealthCheck.type = "http";
|
|
3111
|
-
}, G = U(() => t.fields.algorithm !== "sticky-sessions" ? !0 : !!t.fields.stickySessionsCookie && !!t.fields.stickySessionsCookiePath), N = U(() => t.fields.slots ? h(t.fields.slots, Ne, Be) : !0), X = U(() => t.fields.hashOn === "header" ? !!t.fields.hashOnHeader : !0), k = U(() => t.fields.hashOn === "cookie" || t.fields.hashFallback === "cookie" ? !!t.fields.hashOnCookie : !0), T = U(() => t.fields.hashOn === "cookie" || t.fields.hashFallback === "cookie" ? !!t.fields.hashOnCookiePath : !0), $ = U(() => t.fields.hashOn === "query_arg" ? !!t.fields.hashOnQueryArgument : !0), A = U(() => t.fields.hashOn === "uri_capture" ? !!t.fields.hashOnUriCapture : !0), _ = U(() => t.fields.hashFallback === "header" ? !!t.fields.hashFallbackHeader : !0), O = U(() => t.fields.hashFallback === "query_arg" ? !!t.fields.hashFallbackQueryArgument : !0), W = U(() => t.fields.hashFallback === "uri_capture" ? !!t.fields.hashFallbackUriCapture : !0), le = U(() => !!t.fields.name && G.value && N.value && X.value && k.value && T.value && $.value && A.value && _.value && O.value && W.value), z = U(() => i.upstreamId ? ue.Edit : ue.Create), re = U(() => {
|
|
3112
|
-
var d, o;
|
|
3113
|
-
return (o = ve.form[(d = i.config) == null ? void 0 : d.app]) == null ? void 0 : o.edit;
|
|
3114
|
-
}), M = (d) => {
|
|
3115
|
-
Object.assign(t.fields, y(d)), Object.assign(V, l(t.fields));
|
|
3116
|
-
}, K = () => {
|
|
3117
|
-
var d;
|
|
3118
|
-
m.push(((d = i.config) == null ? void 0 : d.cancelRoute) || { name: "upstreams-list" });
|
|
3119
|
-
}, ee = (d) => {
|
|
3120
|
-
s("loading", d);
|
|
3121
|
-
}, se = (d) => {
|
|
3122
|
-
s("error", d);
|
|
3123
|
-
}, ae = U(() => {
|
|
3124
|
-
const d = i.config.stickySessionsAvailable ? {
|
|
3125
|
-
sticky_sessions_cookie: null,
|
|
3126
|
-
sticky_sessions_cookie_path: null
|
|
3127
|
-
} : {};
|
|
3128
|
-
return t.fields.algorithm === "sticky-sessions" && (d.sticky_sessions_cookie = t.fields.stickySessionsCookie || null, d.sticky_sessions_cookie_path = t.fields.stickySessionsCookiePath || null), d;
|
|
3129
|
-
}), te = U(() => {
|
|
3130
|
-
const d = {};
|
|
3131
|
-
return t.fields.hashOn === "header" && (d.hash_on_header = t.fields.hashOnHeader), (t.fields.hashOn === "cookie" || t.fields.hashFallback === "cookie") && (d.hash_on_cookie = t.fields.hashOnCookie, d.hash_on_cookie_path = t.fields.hashOnCookiePath), t.fields.hashOn === "query_arg" && (d.hash_on_query_arg = t.fields.hashOnQueryArgument), t.fields.hashOn === "uri_capture" && (d.hash_on_uri_capture = t.fields.hashOnUriCapture), t.fields.hashFallback === "header" && (d.hash_fallback_header = t.fields.hashFallbackHeader), t.fields.hashFallback === "query_arg" && (d.hash_fallback_query_arg = t.fields.hashFallbackQueryArgument), t.fields.hashFallback === "uri_capture" && (d.hash_fallback_uri_capture = t.fields.hashFallbackUriCapture), d;
|
|
3132
|
-
}), H = U(() => {
|
|
3133
|
-
var o, r, J;
|
|
3134
|
-
if (!t.fields.activeHealthSwitch)
|
|
3135
|
-
return ((o = i.config) == null ? void 0 : o.app) === "kongManager" && z.value === ue.Edit ? {
|
|
3136
|
-
type: t.fields.activeHealthCheck.type,
|
|
3137
|
-
headers: {},
|
|
3138
|
-
healthy: {
|
|
3139
|
-
interval: 0,
|
|
3140
|
-
successes: 0
|
|
3141
|
-
},
|
|
3142
|
-
unhealthy: {
|
|
3143
|
-
interval: 0,
|
|
3144
|
-
http_failures: 0,
|
|
3145
|
-
tcp_failures: 0,
|
|
3146
|
-
timeouts: 0
|
|
3147
|
-
}
|
|
3148
|
-
} : void 0;
|
|
3149
|
-
const d = {
|
|
3150
|
-
type: t.fields.activeHealthCheck.type,
|
|
3151
|
-
healthy: {
|
|
3152
|
-
interval: Number(t.fields.activeHealthCheck.healthy.interval || "0"),
|
|
3153
|
-
successes: Number(t.fields.activeHealthCheck.healthy.successes || "0")
|
|
3154
|
-
},
|
|
3155
|
-
unhealthy: {
|
|
3156
|
-
interval: Number(t.fields.activeHealthCheck.unhealthy.interval || "0"),
|
|
3157
|
-
timeouts: Number(t.fields.activeHealthCheck.unhealthy.timeouts || "0"),
|
|
3158
|
-
tcp_failures: Number(t.fields.activeHealthCheck.unhealthy.tcpFailures || "0")
|
|
3159
|
-
},
|
|
3160
|
-
timeout: Number(t.fields.activeHealthCheck.timeout || "1"),
|
|
3161
|
-
concurrency: Number(t.fields.activeHealthCheck.concurrency || "10")
|
|
3162
|
-
};
|
|
3163
|
-
if (t.fields.activeHealthCheck.type !== "tcp") {
|
|
3164
|
-
d.http_path = t.fields.activeHealthCheck.httpPath || "/", d.unhealthy.http_failures = Number(t.fields.activeHealthCheck.unhealthy.httpFailures || "5");
|
|
3165
|
-
const Z = (r = t.fields.activeHealthCheck.unhealthy.httpStatuses) != null && r.length ? t.fields.activeHealthCheck.unhealthy.httpStatuses : Oe;
|
|
3166
|
-
d.unhealthy.http_statuses = g(Z);
|
|
3167
|
-
const ie = (J = t.fields.activeHealthCheck.healthy.httpStatuses) != null && J.length ? t.fields.activeHealthCheck.healthy.httpStatuses : Fe;
|
|
3168
|
-
d.healthy.http_statuses = g(ie);
|
|
3169
|
-
}
|
|
3170
|
-
return ["https", "grpcs"].includes(t.fields.activeHealthCheck.type) && (d.https_sni = t.fields.activeHealthCheck.httpsSni || null, d.https_verify_certificate = t.fields.activeHealthCheck.verifySsl), d.headers = t.fields.activeHealthCheck.headers.reduce((Z, ie) => {
|
|
3171
|
-
var fe, ye;
|
|
3172
|
-
return ie.key ? {
|
|
3173
|
-
...Z,
|
|
3174
|
-
[ie.key]: (ye = (fe = ie.values.split(",")) == null ? void 0 : fe.map((Ue) => Ue.trim())) == null ? void 0 : ye.filter(Boolean)
|
|
3175
|
-
} : Z;
|
|
3176
|
-
}, {}), d;
|
|
3177
|
-
}), L = U(() => {
|
|
3178
|
-
var o, r, J;
|
|
3179
|
-
if (!t.fields.passiveHealthSwitch)
|
|
3180
|
-
return ((o = i.config) == null ? void 0 : o.app) === "kongManager" && z.value === ue.Edit ? {
|
|
3181
|
-
type: t.fields.passiveHealthCheck.type,
|
|
3182
|
-
healthy: { successes: 0 },
|
|
3183
|
-
unhealthy: {
|
|
3184
|
-
timeouts: 0,
|
|
3185
|
-
tcp_failures: 0,
|
|
3186
|
-
http_failures: 0
|
|
3187
|
-
}
|
|
3188
|
-
} : void 0;
|
|
3189
|
-
const d = {
|
|
3190
|
-
type: t.fields.passiveHealthCheck.type,
|
|
3191
|
-
healthy: {
|
|
3192
|
-
successes: Number(t.fields.passiveHealthCheck.healthy.successes || "0")
|
|
3193
|
-
},
|
|
3194
|
-
unhealthy: {
|
|
3195
|
-
timeouts: Number(t.fields.passiveHealthCheck.unhealthy.timeouts || "0"),
|
|
3196
|
-
tcp_failures: Number(t.fields.passiveHealthCheck.unhealthy.tcpFailures || "5")
|
|
3197
|
-
}
|
|
3198
|
-
};
|
|
3199
|
-
if (t.fields.passiveHealthCheck.type !== "tcp") {
|
|
3200
|
-
d.unhealthy.http_failures = Number(t.fields.passiveHealthCheck.unhealthy.httpFailures || "5");
|
|
3201
|
-
const Z = (r = t.fields.passiveHealthCheck.healthy.httpStatuses) != null && r.length ? t.fields.passiveHealthCheck.healthy.httpStatuses : xe;
|
|
3202
|
-
d.healthy.http_statuses = g(Z);
|
|
3203
|
-
const ie = (J = t.fields.passiveHealthCheck.unhealthy.httpStatuses) != null && J.length ? t.fields.passiveHealthCheck.unhealthy.httpStatuses : Pe;
|
|
3204
|
-
d.unhealthy.http_statuses = g(ie);
|
|
3205
|
-
}
|
|
3206
|
-
return d;
|
|
3207
|
-
}), b = U(() => {
|
|
3208
|
-
const d = {
|
|
3209
|
-
name: t.fields.name,
|
|
3210
|
-
slots: Number(t.fields.slots),
|
|
3211
|
-
algorithm: t.fields.algorithm,
|
|
3212
|
-
hash_on: t.fields.hashOn,
|
|
3213
|
-
hash_fallback: t.fields.hashFallback,
|
|
3214
|
-
healthchecks: {
|
|
3215
|
-
threshold: Number(t.fields.healthchecksThreshold || "0")
|
|
3216
|
-
},
|
|
3217
|
-
host_header: t.fields.hostHeader || null,
|
|
3218
|
-
client_certificate: t.fields.clientCertificate ? { id: t.fields.clientCertificate } : null
|
|
3219
|
-
}, o = H.value, r = L.value, J = {
|
|
3220
|
-
...d,
|
|
3221
|
-
...ae.value,
|
|
3222
|
-
healthchecks: {
|
|
3223
|
-
...d.healthchecks,
|
|
3224
|
-
active: o || void 0,
|
|
3225
|
-
passive: r || void 0
|
|
3226
|
-
}
|
|
3227
|
-
};
|
|
3228
|
-
return J.tags = t.fields.tags ? t.fields.tags.split(",").map((Z) => String(Z || "").trim()).filter((Z) => Z !== "") : [], Object.assign(J, te.value), J;
|
|
3229
|
-
}), I = (d) => {
|
|
3230
|
-
var r, J, Z, ie, fe, ye;
|
|
3231
|
-
let o = `${(r = i.config) == null ? void 0 : r.apiBaseUrl}${ve.form[(J = i.config) == null ? void 0 : J.app][d]}`;
|
|
3232
|
-
return ((Z = i.config) == null ? void 0 : Z.app) === "konnect" ? o = o.replace(/{controlPlaneId}/gi, ((ie = i.config) == null ? void 0 : ie.controlPlaneId) || "") : ((fe = i.config) == null ? void 0 : fe.app) === "kongManager" && (o = o.replace(/\/{workspace}/gi, (ye = i.config) != null && ye.workspace ? `/${i.config.workspace}` : "")), o = o.replace(/{id}/gi, i.upstreamId), o;
|
|
3233
|
-
}, x = async () => {
|
|
3234
|
-
var d;
|
|
3235
|
-
try {
|
|
3236
|
-
t.readonly = !0;
|
|
3237
|
-
let o;
|
|
3238
|
-
z.value === ue.Create ? o = await c.post(I("create"), b.value) : z.value === ue.Edit && (o = ((d = i.config) == null ? void 0 : d.app) === "konnect" ? await c.put(I("edit"), b.value) : await c.patch(I("edit"), b.value)), s("update", o == null ? void 0 : o.data);
|
|
3239
|
-
} catch (o) {
|
|
3240
|
-
t.errorMessage = C(o), s("error", o);
|
|
3241
|
-
} finally {
|
|
3242
|
-
t.readonly = !1;
|
|
3243
|
-
}
|
|
3244
|
-
};
|
|
3245
|
-
return (d, o) => (q(), oe("div", Ra, [
|
|
3246
|
-
u(e(wt), {
|
|
3247
|
-
"can-submit": le.value && w.value,
|
|
3248
|
-
config: a.config,
|
|
3249
|
-
"edit-id": a.upstreamId,
|
|
3250
|
-
"entity-type": e(Le).Upstream,
|
|
3251
|
-
"error-message": t.errorMessage,
|
|
3252
|
-
"fetch-url": re.value,
|
|
3253
|
-
"form-fields": b.value,
|
|
3254
|
-
"is-readonly": t.readonly,
|
|
3255
|
-
onCancel: K,
|
|
3256
|
-
"onFetch:error": se,
|
|
3257
|
-
"onFetch:success": M,
|
|
3258
|
-
onLoading: ee,
|
|
3259
|
-
onSubmit: x
|
|
3260
|
-
}, {
|
|
3261
|
-
default: n(() => [
|
|
3262
|
-
u(ya, {
|
|
3263
|
-
"client-certificate": t.fields.clientCertificate,
|
|
3264
|
-
"onUpdate:clientCertificate": o[0] || (o[0] = (r) => t.fields.clientCertificate = r),
|
|
3265
|
-
"host-header": t.fields.hostHeader,
|
|
3266
|
-
"onUpdate:hostHeader": o[1] || (o[1] = (r) => t.fields.hostHeader = r),
|
|
3267
|
-
name: t.fields.name,
|
|
3268
|
-
"onUpdate:name": o[2] || (o[2] = (r) => t.fields.name = r),
|
|
3269
|
-
tags: t.fields.tags,
|
|
3270
|
-
"onUpdate:tags": o[3] || (o[3] = (r) => t.fields.tags = r),
|
|
3271
|
-
config: a.config,
|
|
3272
|
-
readonly: t.readonly
|
|
3273
|
-
}, null, 8, ["client-certificate", "host-header", "name", "tags", "config", "readonly"]),
|
|
3274
|
-
u(Ca, {
|
|
3275
|
-
algorithm: t.fields.algorithm,
|
|
3276
|
-
"onUpdate:algorithm": o[4] || (o[4] = (r) => t.fields.algorithm = r),
|
|
3277
|
-
"hash-fallback": t.fields.hashFallback,
|
|
3278
|
-
"onUpdate:hashFallback": o[5] || (o[5] = (r) => t.fields.hashFallback = r),
|
|
3279
|
-
"hash-fallback-header": t.fields.hashFallbackHeader,
|
|
3280
|
-
"onUpdate:hashFallbackHeader": o[6] || (o[6] = (r) => t.fields.hashFallbackHeader = r),
|
|
3281
|
-
"hash-fallback-query-argument": t.fields.hashFallbackQueryArgument,
|
|
3282
|
-
"onUpdate:hashFallbackQueryArgument": o[7] || (o[7] = (r) => t.fields.hashFallbackQueryArgument = r),
|
|
3283
|
-
"hash-fallback-uri-capture": t.fields.hashFallbackUriCapture,
|
|
3284
|
-
"onUpdate:hashFallbackUriCapture": o[8] || (o[8] = (r) => t.fields.hashFallbackUriCapture = r),
|
|
3285
|
-
"hash-on": t.fields.hashOn,
|
|
3286
|
-
"onUpdate:hashOn": o[9] || (o[9] = (r) => t.fields.hashOn = r),
|
|
3287
|
-
"hash-on-cookie": t.fields.hashOnCookie,
|
|
3288
|
-
"onUpdate:hashOnCookie": o[10] || (o[10] = (r) => t.fields.hashOnCookie = r),
|
|
3289
|
-
"hash-on-cookie-path": t.fields.hashOnCookiePath,
|
|
3290
|
-
"onUpdate:hashOnCookiePath": o[11] || (o[11] = (r) => t.fields.hashOnCookiePath = r),
|
|
3291
|
-
"hash-on-header": t.fields.hashOnHeader,
|
|
3292
|
-
"onUpdate:hashOnHeader": o[12] || (o[12] = (r) => t.fields.hashOnHeader = r),
|
|
3293
|
-
"hash-on-query-argument": t.fields.hashOnQueryArgument,
|
|
3294
|
-
"onUpdate:hashOnQueryArgument": o[13] || (o[13] = (r) => t.fields.hashOnQueryArgument = r),
|
|
3295
|
-
"hash-on-uri-capture": t.fields.hashOnUriCapture,
|
|
3296
|
-
"onUpdate:hashOnUriCapture": o[14] || (o[14] = (r) => t.fields.hashOnUriCapture = r),
|
|
3297
|
-
slots: t.fields.slots,
|
|
3298
|
-
"onUpdate:slots": o[15] || (o[15] = (r) => t.fields.slots = r),
|
|
3299
|
-
"sticky-sessions-cookie": t.fields.stickySessionsCookie,
|
|
3300
|
-
"onUpdate:stickySessionsCookie": o[16] || (o[16] = (r) => t.fields.stickySessionsCookie = r),
|
|
3301
|
-
"sticky-sessions-cookie-path": t.fields.stickySessionsCookiePath,
|
|
3302
|
-
"onUpdate:stickySessionsCookiePath": o[17] || (o[17] = (r) => t.fields.stickySessionsCookiePath = r),
|
|
3303
|
-
readonly: t.readonly,
|
|
3304
|
-
"sticky-sessions-available": a.config.stickySessionsAvailable
|
|
3305
|
-
}, null, 8, ["algorithm", "hash-fallback", "hash-fallback-header", "hash-fallback-query-argument", "hash-fallback-uri-capture", "hash-on", "hash-on-cookie", "hash-on-cookie-path", "hash-on-header", "hash-on-query-argument", "hash-on-uri-capture", "slots", "sticky-sessions-cookie", "sticky-sessions-cookie-path", "readonly", "sticky-sessions-available"]),
|
|
3306
|
-
u(wa, {
|
|
3307
|
-
"active-health-switch": t.fields.activeHealthSwitch,
|
|
3308
|
-
"onUpdate:activeHealthSwitch": [
|
|
3309
|
-
o[18] || (o[18] = (r) => t.fields.activeHealthSwitch = r),
|
|
3310
|
-
p
|
|
3311
|
-
],
|
|
3312
|
-
"healthchecks-threshold": t.fields.healthchecksThreshold,
|
|
3313
|
-
"onUpdate:healthchecksThreshold": o[19] || (o[19] = (r) => t.fields.healthchecksThreshold = r),
|
|
3314
|
-
"passive-health-switch": t.fields.passiveHealthSwitch,
|
|
3315
|
-
"onUpdate:passiveHealthSwitch": [
|
|
3316
|
-
o[20] || (o[20] = (r) => t.fields.passiveHealthSwitch = r),
|
|
3317
|
-
S
|
|
3318
|
-
],
|
|
3319
|
-
readonly: t.readonly
|
|
3320
|
-
}, null, 8, ["active-health-switch", "healthchecks-threshold", "passive-health-switch", "readonly"]),
|
|
3321
|
-
t.fields.activeHealthSwitch ? (q(), E(Aa, {
|
|
3322
|
-
key: 0,
|
|
3323
|
-
concurrency: t.fields.activeHealthCheck.concurrency,
|
|
3324
|
-
"onUpdate:concurrency": o[21] || (o[21] = (r) => t.fields.activeHealthCheck.concurrency = r),
|
|
3325
|
-
headers: t.fields.activeHealthCheck.headers,
|
|
3326
|
-
"onUpdate:headers": o[22] || (o[22] = (r) => t.fields.activeHealthCheck.headers = r),
|
|
3327
|
-
"healthy-http-statuses": t.fields.activeHealthCheck.healthy.httpStatuses,
|
|
3328
|
-
"onUpdate:healthyHttpStatuses": o[23] || (o[23] = (r) => t.fields.activeHealthCheck.healthy.httpStatuses = r),
|
|
3329
|
-
"healthy-interval": t.fields.activeHealthCheck.healthy.interval,
|
|
3330
|
-
"onUpdate:healthyInterval": o[24] || (o[24] = (r) => t.fields.activeHealthCheck.healthy.interval = r),
|
|
3331
|
-
"healthy-successes": t.fields.activeHealthCheck.healthy.successes,
|
|
3332
|
-
"onUpdate:healthySuccesses": o[25] || (o[25] = (r) => t.fields.activeHealthCheck.healthy.successes = r),
|
|
3333
|
-
"http-path": t.fields.activeHealthCheck.httpPath,
|
|
3334
|
-
"onUpdate:httpPath": o[26] || (o[26] = (r) => t.fields.activeHealthCheck.httpPath = r),
|
|
3335
|
-
"https-sni": t.fields.activeHealthCheck.httpsSni,
|
|
3336
|
-
"onUpdate:httpsSni": o[27] || (o[27] = (r) => t.fields.activeHealthCheck.httpsSni = r),
|
|
3337
|
-
timeout: t.fields.activeHealthCheck.timeout,
|
|
3338
|
-
"onUpdate:timeout": o[28] || (o[28] = (r) => t.fields.activeHealthCheck.timeout = r),
|
|
3339
|
-
type: t.fields.activeHealthCheck.type,
|
|
3340
|
-
"onUpdate:type": o[29] || (o[29] = (r) => t.fields.activeHealthCheck.type = r),
|
|
3341
|
-
"unhealthy-http-failures": t.fields.activeHealthCheck.unhealthy.httpFailures,
|
|
3342
|
-
"onUpdate:unhealthyHttpFailures": o[30] || (o[30] = (r) => t.fields.activeHealthCheck.unhealthy.httpFailures = r),
|
|
3343
|
-
"unhealthy-http-statuses": t.fields.activeHealthCheck.unhealthy.httpStatuses,
|
|
3344
|
-
"onUpdate:unhealthyHttpStatuses": o[31] || (o[31] = (r) => t.fields.activeHealthCheck.unhealthy.httpStatuses = r),
|
|
3345
|
-
"unhealthy-interval": t.fields.activeHealthCheck.unhealthy.interval,
|
|
3346
|
-
"onUpdate:unhealthyInterval": o[32] || (o[32] = (r) => t.fields.activeHealthCheck.unhealthy.interval = r),
|
|
3347
|
-
"unhealthy-tcp-failures": t.fields.activeHealthCheck.unhealthy.tcpFailures,
|
|
3348
|
-
"onUpdate:unhealthyTcpFailures": o[33] || (o[33] = (r) => t.fields.activeHealthCheck.unhealthy.tcpFailures = r),
|
|
3349
|
-
"unhealthy-timeouts": t.fields.activeHealthCheck.unhealthy.timeouts,
|
|
3350
|
-
"onUpdate:unhealthyTimeouts": o[34] || (o[34] = (r) => t.fields.activeHealthCheck.unhealthy.timeouts = r),
|
|
3351
|
-
"verify-ssl": t.fields.activeHealthCheck.verifySsl,
|
|
3352
|
-
"onUpdate:verifySsl": o[35] || (o[35] = (r) => t.fields.activeHealthCheck.verifySsl = r),
|
|
3353
|
-
config: a.config,
|
|
3354
|
-
readonly: t.readonly
|
|
3355
|
-
}, null, 8, ["concurrency", "headers", "healthy-http-statuses", "healthy-interval", "healthy-successes", "http-path", "https-sni", "timeout", "type", "unhealthy-http-failures", "unhealthy-http-statuses", "unhealthy-interval", "unhealthy-tcp-failures", "unhealthy-timeouts", "verify-ssl", "config", "readonly"])) : B("", !0),
|
|
3356
|
-
t.fields.passiveHealthSwitch ? (q(), E(Ba, {
|
|
3357
|
-
key: 1,
|
|
3358
|
-
"healthy-http-statuses": t.fields.passiveHealthCheck.healthy.httpStatuses,
|
|
3359
|
-
"onUpdate:healthyHttpStatuses": o[36] || (o[36] = (r) => t.fields.passiveHealthCheck.healthy.httpStatuses = r),
|
|
3360
|
-
"healthy-successes": t.fields.passiveHealthCheck.healthy.successes,
|
|
3361
|
-
"onUpdate:healthySuccesses": o[37] || (o[37] = (r) => t.fields.passiveHealthCheck.healthy.successes = r),
|
|
3362
|
-
type: t.fields.passiveHealthCheck.type,
|
|
3363
|
-
"onUpdate:type": o[38] || (o[38] = (r) => t.fields.passiveHealthCheck.type = r),
|
|
3364
|
-
"unhealthy-http-failures": t.fields.passiveHealthCheck.unhealthy.httpFailures,
|
|
3365
|
-
"onUpdate:unhealthyHttpFailures": o[39] || (o[39] = (r) => t.fields.passiveHealthCheck.unhealthy.httpFailures = r),
|
|
3366
|
-
"unhealthy-http-statuses": t.fields.passiveHealthCheck.unhealthy.httpStatuses,
|
|
3367
|
-
"onUpdate:unhealthyHttpStatuses": o[40] || (o[40] = (r) => t.fields.passiveHealthCheck.unhealthy.httpStatuses = r),
|
|
3368
|
-
"unhealthy-tcp-failures": t.fields.passiveHealthCheck.unhealthy.tcpFailures,
|
|
3369
|
-
"onUpdate:unhealthyTcpFailures": o[41] || (o[41] = (r) => t.fields.passiveHealthCheck.unhealthy.tcpFailures = r),
|
|
3370
|
-
"unhealthy-timeouts": t.fields.passiveHealthCheck.unhealthy.timeouts,
|
|
3371
|
-
"onUpdate:unhealthyTimeouts": o[42] || (o[42] = (r) => t.fields.passiveHealthCheck.unhealthy.timeouts = r),
|
|
3372
|
-
readonly: t.readonly
|
|
3373
|
-
}, null, 8, ["healthy-http-statuses", "healthy-successes", "type", "unhealthy-http-failures", "unhealthy-http-statuses", "unhealthy-tcp-failures", "unhealthy-timeouts", "readonly"])) : B("", !0)
|
|
3374
|
-
]),
|
|
3375
|
-
_: 1
|
|
3376
|
-
}, 8, ["can-submit", "config", "edit-id", "entity-type", "error-message", "fetch-url", "form-fields", "is-readonly"])
|
|
3377
|
-
]));
|
|
3378
|
-
}
|
|
3379
|
-
}), Ya = /* @__PURE__ */ me(Da, [["__scopeId", "data-v-ee1ce06f"]]), La = { "data-testid": "client_certificate-plain-text" }, Za = /* @__PURE__ */ ne({
|
|
3380
|
-
__name: "UpstreamsConfigCard",
|
|
3381
|
-
props: {
|
|
3382
|
-
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
3383
|
-
config: {
|
|
3384
|
-
type: Object,
|
|
3385
|
-
required: !0,
|
|
3386
|
-
validator: (a) => !(!a || !["konnect", "kongManager"].includes(a == null ? void 0 : a.app) || a.app === "konnect" && !a.controlPlaneId || a.app === "kongManager" && typeof a.workspace != "string" || !a.entityId)
|
|
3387
|
-
},
|
|
3388
|
-
/**
|
|
3389
|
-
* External link for documentation that determines visibility of Documentation button
|
|
3390
|
-
*/
|
|
3391
|
-
configCardDoc: {
|
|
3392
|
-
type: String,
|
|
3393
|
-
default: "",
|
|
3394
|
-
required: !1
|
|
3395
|
-
},
|
|
3396
|
-
/**
|
|
3397
|
-
* Control visibility of card title content
|
|
3398
|
-
*/
|
|
3399
|
-
hideTitle: {
|
|
3400
|
-
type: Boolean,
|
|
3401
|
-
default: !1
|
|
3402
|
-
}
|
|
3403
|
-
},
|
|
3404
|
-
emits: ["loading", "fetch:error", "fetch:success"],
|
|
3405
|
-
setup(a) {
|
|
3406
|
-
const D = a, { i18n: { t: i }, i18nT: s } = pe.useI18n(), { getPropValue: h } = Kt(), g = U(() => ve.form[D.config.app].edit), y = R({
|
|
3407
|
-
id: {},
|
|
3408
|
-
name: {},
|
|
3409
|
-
created_at: {},
|
|
3410
|
-
updated_at: {},
|
|
3411
|
-
algorithm: {
|
|
3412
|
-
order: 5,
|
|
3413
|
-
section: he.Basic,
|
|
3414
|
-
tooltip: i("upstreams.form.fields.algorithm.tooltip")
|
|
3415
|
-
},
|
|
3416
|
-
slots: {
|
|
3417
|
-
order: 6,
|
|
3418
|
-
section: he.Basic
|
|
3419
|
-
},
|
|
3420
|
-
hash_on: {
|
|
3421
|
-
order: 7,
|
|
3422
|
-
section: he.Basic
|
|
3423
|
-
},
|
|
3424
|
-
hash_on_header: {
|
|
3425
|
-
order: 8,
|
|
3426
|
-
section: he.Basic
|
|
3427
|
-
},
|
|
3428
|
-
hash_on_uri_capture: {
|
|
3429
|
-
order: 9,
|
|
3430
|
-
section: he.Basic
|
|
3431
|
-
},
|
|
3432
|
-
hash_on_query_arg: {
|
|
3433
|
-
order: 10,
|
|
3434
|
-
section: he.Basic,
|
|
3435
|
-
label: `${i("upstreams.form.fields.hash_on.label")} ${i("upstreams.form.hash_labels.query_argument")}`
|
|
3436
|
-
},
|
|
3437
|
-
hash_on_cookie: {
|
|
3438
|
-
order: 11,
|
|
3439
|
-
section: he.Basic
|
|
3440
|
-
},
|
|
3441
|
-
hash_on_cookie_path: {
|
|
3442
|
-
order: 12,
|
|
3443
|
-
section: he.Basic
|
|
3444
|
-
},
|
|
3445
|
-
healthchecks: {
|
|
3446
|
-
order: 13,
|
|
3447
|
-
section: he.Basic,
|
|
3448
|
-
// TODO: change to JsonArray
|
|
3449
|
-
type: Vt.Json
|
|
3450
|
-
},
|
|
3451
|
-
tags: {
|
|
3452
|
-
order: 14,
|
|
3453
|
-
tooltip: i("upstreams.form.hash_tooltips.tags")
|
|
3454
|
-
},
|
|
3455
|
-
// Advanced section
|
|
3456
|
-
hash_fallback: {
|
|
3457
|
-
order: 1
|
|
3458
|
-
},
|
|
3459
|
-
hash_fallback_header: {
|
|
3460
|
-
order: 2
|
|
3461
|
-
},
|
|
3462
|
-
hash_fallback_query_arg: {
|
|
3463
|
-
order: 3,
|
|
3464
|
-
label: `${i("upstreams.form.fields.hash_fallback.label")} ${i("upstreams.form.hash_labels.query_argument")}`
|
|
3465
|
-
},
|
|
3466
|
-
hash_fallback_uri_capture: {
|
|
3467
|
-
order: 4
|
|
3468
|
-
},
|
|
3469
|
-
host_header: {
|
|
3470
|
-
order: 5
|
|
3471
|
-
},
|
|
3472
|
-
use_srv_name: {
|
|
3473
|
-
order: 6
|
|
3474
|
-
},
|
|
3475
|
-
client_certificate: {
|
|
3476
|
-
order: 7,
|
|
3477
|
-
tooltip: i("upstreams.form.hash_tooltips.client_certificate")
|
|
3478
|
-
}
|
|
3479
|
-
});
|
|
3480
|
-
return (j, F) => (q(), oe("div", null, [
|
|
3481
|
-
u(e(Et), {
|
|
3482
|
-
config: a.config,
|
|
3483
|
-
"config-card-doc": a.configCardDoc,
|
|
3484
|
-
"config-schema": y.value,
|
|
3485
|
-
"entity-type": e(Le).Upstream,
|
|
3486
|
-
"fetch-url": g.value,
|
|
3487
|
-
"hide-title": a.hideTitle,
|
|
3488
|
-
"onFetch:error": F[0] || (F[0] = (l) => j.$emit("fetch:error", l)),
|
|
3489
|
-
"onFetch:success": F[1] || (F[1] = (l) => j.$emit("fetch:success", l)),
|
|
3490
|
-
onLoading: F[2] || (F[2] = (l) => j.$emit("loading", l))
|
|
3491
|
-
}, {
|
|
3492
|
-
"name-label-tooltip": n(() => [
|
|
3493
|
-
u(e(s), {
|
|
3494
|
-
keypath: "upstreams.form.fields.name.tooltip",
|
|
3495
|
-
scope: "global"
|
|
3496
|
-
}, {
|
|
3497
|
-
host: n(() => [
|
|
3498
|
-
v("code", null, f(e(i)("upstreams.form.fields.name.host")), 1)
|
|
3499
|
-
]),
|
|
3500
|
-
_: 1
|
|
3501
|
-
})
|
|
3502
|
-
]),
|
|
3503
|
-
"hash_on-label-tooltip": n(({ row: l }) => [
|
|
3504
|
-
u(e(s), {
|
|
3505
|
-
keypath: "upstreams.form.fields.hash_on.tooltip",
|
|
3506
|
-
scope: "global"
|
|
3507
|
-
}, {
|
|
3508
|
-
result: n(() => [
|
|
3509
|
-
v("code", null, f(l.value), 1)
|
|
3510
|
-
]),
|
|
3511
|
-
_: 2
|
|
3512
|
-
}, 1024)
|
|
3513
|
-
]),
|
|
3514
|
-
"hash_on_header-label-tooltip": n(() => [
|
|
3515
|
-
u(e(s), {
|
|
3516
|
-
keypath: "upstreams.form.hash_tooltips.hash_on_header.text",
|
|
3517
|
-
scope: "global"
|
|
3518
|
-
}, {
|
|
3519
|
-
hash_on: n(() => [
|
|
3520
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_header.hash_on")), 1)
|
|
3521
|
-
]),
|
|
3522
|
-
header: n(() => [
|
|
3523
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_header.header")), 1)
|
|
3524
|
-
]),
|
|
3525
|
-
_: 1
|
|
3526
|
-
})
|
|
3527
|
-
]),
|
|
3528
|
-
"hash_on_uri_capture-label-tooltip": n(() => [
|
|
3529
|
-
u(e(s), {
|
|
3530
|
-
keypath: "upstreams.form.hash_tooltips.hash_on_uri_capture.text",
|
|
3531
|
-
scope: "global"
|
|
3532
|
-
}, {
|
|
3533
|
-
hash_on: n(() => [
|
|
3534
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")), 1)
|
|
3535
|
-
]),
|
|
3536
|
-
uri_capture: n(() => [
|
|
3537
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")), 1)
|
|
3538
|
-
]),
|
|
3539
|
-
_: 1
|
|
3540
|
-
})
|
|
3541
|
-
]),
|
|
3542
|
-
"hash_on_query_arg-label-tooltip": n(() => [
|
|
3543
|
-
u(e(s), {
|
|
3544
|
-
keypath: "upstreams.form.hash_tooltips.hash_on_query_arg.text",
|
|
3545
|
-
scope: "global"
|
|
3546
|
-
}, {
|
|
3547
|
-
hash_on: n(() => [
|
|
3548
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")), 1)
|
|
3549
|
-
]),
|
|
3550
|
-
query_arg: n(() => [
|
|
3551
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")), 1)
|
|
3552
|
-
]),
|
|
3553
|
-
_: 1
|
|
3554
|
-
})
|
|
3555
|
-
]),
|
|
3556
|
-
"hash_on_cookie-label-tooltip": n(() => [
|
|
3557
|
-
u(e(s), {
|
|
3558
|
-
keypath: "upstreams.form.hash_tooltips.hash_on_cookie.text",
|
|
3559
|
-
scope: "global"
|
|
3560
|
-
}, {
|
|
3561
|
-
hash_on: n(() => [
|
|
3562
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")), 1)
|
|
3563
|
-
]),
|
|
3564
|
-
hash_fallback: n(() => [
|
|
3565
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")), 1)
|
|
3566
|
-
]),
|
|
3567
|
-
cookie: n(() => [
|
|
3568
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")), 1)
|
|
3569
|
-
]),
|
|
3570
|
-
_: 1
|
|
3571
|
-
})
|
|
3572
|
-
]),
|
|
3573
|
-
"hash_on_cookie_path-label-tooltip": n(() => [
|
|
3574
|
-
u(e(s), {
|
|
3575
|
-
keypath: "upstreams.form.hash_tooltips.hash_on_cookie_path.text",
|
|
3576
|
-
scope: "global"
|
|
3577
|
-
}, {
|
|
3578
|
-
hash_on: n(() => [
|
|
3579
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")), 1)
|
|
3580
|
-
]),
|
|
3581
|
-
hash_fallback: n(() => [
|
|
3582
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")), 1)
|
|
3583
|
-
]),
|
|
3584
|
-
cookie: n(() => [
|
|
3585
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")), 1)
|
|
3586
|
-
]),
|
|
3587
|
-
_: 1
|
|
3588
|
-
})
|
|
3589
|
-
]),
|
|
3590
|
-
"slots-label-tooltip": n(() => [
|
|
3591
|
-
u(e(s), {
|
|
3592
|
-
keypath: "upstreams.form.hash_tooltips.slots.text",
|
|
3593
|
-
scope: "global"
|
|
3594
|
-
}, {
|
|
3595
|
-
algorithm: n(() => [
|
|
3596
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.slots.algorithm")), 1)
|
|
3597
|
-
]),
|
|
3598
|
-
round_robin: n(() => [
|
|
3599
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.slots.round_robin")), 1)
|
|
3600
|
-
]),
|
|
3601
|
-
consistent_hashing: n(() => [
|
|
3602
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.slots.consistent_hashing")), 1)
|
|
3603
|
-
]),
|
|
3604
|
-
min: n(() => [...F[3] || (F[3] = [
|
|
3605
|
-
v("code", null, "10", -1)
|
|
3606
|
-
])]),
|
|
3607
|
-
max: n(() => [...F[4] || (F[4] = [
|
|
3608
|
-
v("code", null, "65536", -1)
|
|
3609
|
-
])]),
|
|
3610
|
-
_: 1
|
|
3611
|
-
})
|
|
3612
|
-
]),
|
|
3613
|
-
"hash_fallback-label-tooltip": n(() => [
|
|
3614
|
-
u(e(s), {
|
|
3615
|
-
keypath: "upstreams.form.hash_tooltips.hash_fallback.text",
|
|
3616
|
-
scope: "global"
|
|
3617
|
-
}, {
|
|
3618
|
-
hash_on: n(() => [
|
|
3619
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback.hash_on")), 1)
|
|
3620
|
-
]),
|
|
3621
|
-
cookie: n(() => [
|
|
3622
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback.cookie")), 1)
|
|
3623
|
-
]),
|
|
3624
|
-
_: 1
|
|
3625
|
-
})
|
|
3626
|
-
]),
|
|
3627
|
-
"hash_fallback_header-label-tooltip": n(() => [
|
|
3628
|
-
u(e(s), {
|
|
3629
|
-
keypath: "upstreams.form.hash_tooltips.hash_fallback_header.text",
|
|
3630
|
-
scope: "global"
|
|
3631
|
-
}, {
|
|
3632
|
-
hash_fallback: n(() => [
|
|
3633
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")), 1)
|
|
3634
|
-
]),
|
|
3635
|
-
header: n(() => [
|
|
3636
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_header.header")), 1)
|
|
3637
|
-
]),
|
|
3638
|
-
_: 1
|
|
3639
|
-
})
|
|
3640
|
-
]),
|
|
3641
|
-
"hash_fallback_query_arg-label-tooltip": n(() => [
|
|
3642
|
-
u(e(s), {
|
|
3643
|
-
keypath: "upstreams.form.hash_tooltips.hash_fallback_query_arg.text",
|
|
3644
|
-
scope: "global"
|
|
3645
|
-
}, {
|
|
3646
|
-
hash_fallback: n(() => [
|
|
3647
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")), 1)
|
|
3648
|
-
]),
|
|
3649
|
-
query_arg: n(() => [
|
|
3650
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")), 1)
|
|
3651
|
-
]),
|
|
3652
|
-
_: 1
|
|
3653
|
-
})
|
|
3654
|
-
]),
|
|
3655
|
-
"hash_fallback_uri_capture-label-tooltip": n(() => [
|
|
3656
|
-
u(e(s), {
|
|
3657
|
-
keypath: "upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",
|
|
3658
|
-
scope: "global"
|
|
3659
|
-
}, {
|
|
3660
|
-
hash_fallback: n(() => [
|
|
3661
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")), 1)
|
|
3662
|
-
]),
|
|
3663
|
-
uri_capture: n(() => [
|
|
3664
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")), 1)
|
|
3665
|
-
]),
|
|
3666
|
-
_: 1
|
|
3667
|
-
})
|
|
3668
|
-
]),
|
|
3669
|
-
"host_header-label-tooltip": n(() => [
|
|
3670
|
-
u(e(s), {
|
|
3671
|
-
keypath: "upstreams.form.hash_tooltips.host_header.text",
|
|
3672
|
-
scope: "global"
|
|
3673
|
-
}, {
|
|
3674
|
-
host: n(() => [
|
|
3675
|
-
v("code", null, f(e(i)("upstreams.form.hash_tooltips.host_header.host")), 1)
|
|
3676
|
-
]),
|
|
3677
|
-
_: 1
|
|
3678
|
-
})
|
|
3679
|
-
]),
|
|
3680
|
-
client_certificate: n((l) => {
|
|
3681
|
-
var c;
|
|
3682
|
-
return [
|
|
3683
|
-
v("div", null, [
|
|
3684
|
-
v("div", La, [
|
|
3685
|
-
v("span", null, f((c = e(h)("rowValue", l)) == null ? void 0 : c.id), 1)
|
|
3686
|
-
])
|
|
3687
|
-
])
|
|
3688
|
-
];
|
|
3689
|
-
}),
|
|
3690
|
-
_: 1
|
|
3691
|
-
}, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
|
|
3692
|
-
]));
|
|
3693
|
-
}
|
|
3694
|
-
});
|
|
3695
|
-
export {
|
|
3696
|
-
ua as TargetForm,
|
|
3697
|
-
Xa as TargetsList,
|
|
3698
|
-
Za as UpstreamsConfigCard,
|
|
3699
|
-
Ya as UpstreamsForm,
|
|
3700
|
-
za as UpstreamsList
|
|
3701
|
-
};
|