@kong-ui-public/entities-upstreams-targets 3.7.31-pr.2132.c7fba69a4.0 → 3.7.31

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