@kong-ui-public/entities-upstreams-targets 3.12.1 → 3.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities-upstreams-targets.es.js +467 -465
- package/dist/entities-upstreams-targets.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/TargetForm.vue.d.ts.map +1 -1
- package/dist/types/types/target-form.d.ts +1 -0
- package/dist/types/types/target-form.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as R, defineComponent as ne, computed as H, watch as de, onBeforeMount as De, resolveComponent as $, createElementBlock as oe, openBlock as w, createVNode as u, unref as e, createSlots as Te, withCtx as n, createTextVNode as Q, toDisplayString as f, createElementVNode as _, createBlock as E, Teleport as bt, createCommentVNode as B, reactive as Fe, renderSlot as vt, Fragment as Ce, renderList as $t, normalizeClass as Pt } from "vue";
|
|
2
2
|
import { useAxios as Ke, useTableState as At, useFetcher as kt, useDeleteUrlBuilder as _t, FetcherStatus as Ct, EntityBaseTable as St, PermissionsWrapper as ce, TableTags as Ht, EntityFilter as Mt, EntityDeleteModal as Ut, EntityTypes as It, useErrors as qt, EntityBaseFormType as ue, EntityBaseForm as wt, SupportedEntityType as Le, useDebouncedFilter as mt, EntityFormSection as He, useHelpers as Kt, ConfigurationSchemaType as Vt, ConfigurationSchemaSection as he, EntityBaseConfigCard as Et } from "@kong-ui-public/entities-shared";
|
|
3
3
|
import { useRouter as Tt } from "vue-router";
|
|
4
4
|
import { BookIcon as ft, AddIcon as xe, CloudUploadIcon as Nt, TrashIcon as Bt } from "@kong/icons";
|
|
@@ -394,11 +394,11 @@ function Wt() {
|
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
396
|
function Se(a) {
|
|
397
|
-
const { replaceId: D = !1 } = a, i =
|
|
397
|
+
const { replaceId: D = !1 } = a, i = R([]);
|
|
398
398
|
return {
|
|
399
399
|
addedItems: i,
|
|
400
|
-
trackNewItems: (h,
|
|
401
|
-
if (
|
|
400
|
+
trackNewItems: (h, k) => {
|
|
401
|
+
if (k) {
|
|
402
402
|
const y = { ...h };
|
|
403
403
|
D && (y.value = h.label), i.value.push(y);
|
|
404
404
|
} else
|
|
@@ -784,7 +784,7 @@ function Ve() {
|
|
|
784
784
|
} else
|
|
785
785
|
return !1;
|
|
786
786
|
}, i = (s) => s.map((c) => Number(c)), l = (s) => s.map((c) => c.toString()), h = (s) => {
|
|
787
|
-
var C, m, t,
|
|
787
|
+
var C, m, t, V, T, p, S, z, M, Z, W, b, I, O, g, N, P, le, G, re, A, K, ee, se, ae, te, U, L, v, q, x, X, d, o, r, J, Y, ie, fe, ye, Ue, je, Qe, We, Je, Ge, ze, Xe, Ye, Ze, et, tt, at, lt, st, it, ot, rt, nt, ht, ut, ct, dt, pt;
|
|
788
788
|
return {
|
|
789
789
|
name: (s == null ? void 0 : s.name) || "",
|
|
790
790
|
hostHeader: (s == null ? void 0 : s.host_header) || "",
|
|
@@ -804,25 +804,25 @@ function Ve() {
|
|
|
804
804
|
hashFallbackHeader: (s == null ? void 0 : s.hash_fallback_header) || "",
|
|
805
805
|
hashFallbackQueryArgument: (s == null ? void 0 : s.hash_fallback_query_arg) || "",
|
|
806
806
|
hashFallbackUriCapture: (s == null ? void 0 : s.hash_fallback_uri_capture) || "",
|
|
807
|
-
activeHealthSwitch: s ? ((T = (
|
|
808
|
-
passiveHealthSwitch: s ? ((
|
|
809
|
-
healthchecksThreshold: ((
|
|
807
|
+
activeHealthSwitch: s ? ((T = (V = s.healthchecks.active) == null ? void 0 : V.healthy) == null ? void 0 : T.interval) !== 0 || ((S = (p = s.healthchecks.active) == null ? void 0 : p.unhealthy) == null ? void 0 : S.interval) !== 0 : !1,
|
|
808
|
+
passiveHealthSwitch: s ? ((M = (z = s.healthchecks.passive) == null ? void 0 : z.healthy) == null ? void 0 : M.successes) !== 0 || ((W = (Z = s.healthchecks.passive) == null ? void 0 : Z.unhealthy) == null ? void 0 : W.timeouts) !== 0 || ((I = (b = s.healthchecks.passive) == null ? void 0 : b.unhealthy) == null ? void 0 : I.tcp_failures) !== 0 || ((g = (O = s.healthchecks.passive) == null ? void 0 : O.unhealthy) == null ? void 0 : g.http_failures) !== 0 : !1,
|
|
809
|
+
healthchecksThreshold: ((N = s == null ? void 0 : s.healthchecks.threshold) == null ? void 0 : N.toString()) || "0",
|
|
810
810
|
activeHealthCheck: {
|
|
811
|
-
type: ((
|
|
812
|
-
httpPath: ((
|
|
813
|
-
timeout: ((re = (
|
|
814
|
-
concurrency: ((
|
|
811
|
+
type: ((P = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : P.type) || "http",
|
|
812
|
+
httpPath: ((le = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : le.http_path) || "/",
|
|
813
|
+
timeout: ((re = (G = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : G.timeout) == null ? void 0 : re.toString()) || "1",
|
|
814
|
+
concurrency: ((K = (A = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : A.concurrency) == null ? void 0 : K.toString()) || "10",
|
|
815
815
|
httpsSni: ((ee = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : ee.https_sni) || "",
|
|
816
816
|
verifySsl: ((se = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : se.https_verify_certificate) || !1,
|
|
817
|
-
headers: (
|
|
817
|
+
headers: (ae = s == null ? void 0 : s.healthchecks.active) != null && ae.headers && Object.entries(s.healthchecks.active.headers).length > 0 ? Object.entries(s.healthchecks.active.headers).map(([Ot, Ne]) => ({ key: Ot, values: Ne == null ? void 0 : Ne.join(", ") })) : [{ key: "", values: "" }],
|
|
818
818
|
healthy: {
|
|
819
819
|
interval: ((L = (U = (te = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : te.healthy) == null ? void 0 : U.interval) == null ? void 0 : L.toString()) || "0",
|
|
820
|
-
successes: ((
|
|
821
|
-
httpStatuses: (d = (
|
|
820
|
+
successes: ((x = (q = (v = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : v.healthy) == null ? void 0 : q.successes) == null ? void 0 : x.toString()) || "5",
|
|
821
|
+
httpStatuses: (d = (X = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : X.healthy) != null && d.http_statuses ? l(s.healthchecks.active.healthy.http_statuses) : $e
|
|
822
822
|
},
|
|
823
823
|
unhealthy: {
|
|
824
824
|
interval: ((J = (r = (o = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : o.unhealthy) == null ? void 0 : r.interval) == null ? void 0 : J.toString()) || "0",
|
|
825
|
-
httpFailures: ((fe = (ie = (
|
|
825
|
+
httpFailures: ((fe = (ie = (Y = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : Y.unhealthy) == null ? void 0 : ie.http_failures) == null ? void 0 : fe.toString()) || "5",
|
|
826
826
|
tcpFailures: ((je = (Ue = (ye = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : ye.unhealthy) == null ? void 0 : Ue.tcp_failures) == null ? void 0 : je.toString()) || "5",
|
|
827
827
|
httpStatuses: (We = (Qe = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : Qe.unhealthy) != null && We.http_statuses ? l(s.healthchecks.active.unhealthy.http_statuses) : Ae,
|
|
828
828
|
timeouts: ((ze = (Ge = (Je = s == null ? void 0 : s.healthchecks.active) == null ? void 0 : Je.unhealthy) == null ? void 0 : Ge.timeouts) == null ? void 0 : ze.toString()) || "0"
|
|
@@ -932,150 +932,150 @@ const pe = {
|
|
|
932
932
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success"],
|
|
933
933
|
setup(a, { emit: D }) {
|
|
934
934
|
var L;
|
|
935
|
-
const i = D, l = a, { i18n: { t: h } } = pe.useI18n(),
|
|
935
|
+
const i = D, l = a, { i18n: { t: h } } = pe.useI18n(), k = Tt(), { axiosInstance: y } = Ke((L = l.config) == null ? void 0 : L.axiosRequestConfig), { hasRecords: j, handleStateChange: F } = At(() => V.value), s = H(() => j.value && l.config.app === "konnect"), c = H(() => l.config.app !== "kongManager" || !!l.config.disableSorting), C = {
|
|
936
936
|
// the Name column is non-hidable
|
|
937
937
|
name: { label: h("upstreams.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
938
938
|
slots: { label: h("upstreams.list.table_headers.slots"), searchable: !0, sortable: !0 },
|
|
939
939
|
tags: { label: h("upstreams.list.table_headers.tags"), sortable: !1 }
|
|
940
940
|
}, m = C, t = H(() => {
|
|
941
|
-
var
|
|
942
|
-
let
|
|
943
|
-
return l.config.app === "konnect" ?
|
|
944
|
-
}),
|
|
945
|
-
const
|
|
946
|
-
if (
|
|
941
|
+
var q, x;
|
|
942
|
+
let v = `${l.config.apiBaseUrl}${_e.list[l.config.app]}`;
|
|
943
|
+
return l.config.app === "konnect" ? v = v.replace(/{controlPlaneId}/gi, ((q = l.config) == null ? void 0 : q.controlPlaneId) || "") : l.config.app === "kongManager" && (v = v.replace(/\/{workspace}/gi, (x = l.config) != null && x.workspace ? `/${l.config.workspace}` : "")), v;
|
|
944
|
+
}), V = R(""), T = H(() => {
|
|
945
|
+
const v = l.config.app === "konnect" || l.config.isExactMatch;
|
|
946
|
+
if (v)
|
|
947
947
|
return {
|
|
948
|
-
isExactMatch:
|
|
948
|
+
isExactMatch: v,
|
|
949
949
|
placeholder: h("upstreams.search.placeholder")
|
|
950
950
|
};
|
|
951
|
-
const { name:
|
|
951
|
+
const { name: q, slots: x } = C;
|
|
952
952
|
return {
|
|
953
|
-
isExactMatch:
|
|
954
|
-
fields: { name:
|
|
953
|
+
isExactMatch: v,
|
|
954
|
+
fields: { name: q, slots: x },
|
|
955
955
|
schema: l.config.filterSchema
|
|
956
956
|
};
|
|
957
957
|
}), {
|
|
958
958
|
fetcher: p,
|
|
959
959
|
fetcherState: S,
|
|
960
|
-
fetcherCacheKey:
|
|
961
|
-
} = kt(H(() => ({ ...l.config, cacheIdentifier: l.cacheIdentifier })), t),
|
|
962
|
-
|
|
963
|
-
},
|
|
964
|
-
|
|
965
|
-
},
|
|
966
|
-
const
|
|
967
|
-
if (!await
|
|
960
|
+
fetcherCacheKey: z
|
|
961
|
+
} = kt(H(() => ({ ...l.config, cacheIdentifier: l.cacheIdentifier })), t), M = () => {
|
|
962
|
+
V.value = "";
|
|
963
|
+
}, Z = () => {
|
|
964
|
+
z.value++;
|
|
965
|
+
}, W = R(null), b = async (v, q) => {
|
|
966
|
+
const x = v.id;
|
|
967
|
+
if (!await q(x)) {
|
|
968
968
|
i("copy:error", {
|
|
969
|
-
entity:
|
|
969
|
+
entity: v,
|
|
970
970
|
field: "id",
|
|
971
971
|
message: h("upstreams.errors.copy")
|
|
972
972
|
});
|
|
973
973
|
return;
|
|
974
974
|
}
|
|
975
975
|
i("copy:success", {
|
|
976
|
-
entity:
|
|
976
|
+
entity: v,
|
|
977
977
|
field: "id",
|
|
978
|
-
message: h("upstreams.copy.success", { val:
|
|
978
|
+
message: h("upstreams.copy.success", { val: x })
|
|
979
979
|
});
|
|
980
|
-
},
|
|
981
|
-
const
|
|
982
|
-
if (!await
|
|
980
|
+
}, I = async (v, q) => {
|
|
981
|
+
const x = JSON.stringify(v);
|
|
982
|
+
if (!await q(x)) {
|
|
983
983
|
i("copy:error", {
|
|
984
|
-
entity:
|
|
984
|
+
entity: v,
|
|
985
985
|
message: h("upstreams.errors.copy")
|
|
986
986
|
});
|
|
987
987
|
return;
|
|
988
988
|
}
|
|
989
989
|
i("copy:success", {
|
|
990
|
-
entity:
|
|
990
|
+
entity: v,
|
|
991
991
|
message: h("upstreams.copy.success_brief")
|
|
992
992
|
});
|
|
993
|
-
},
|
|
994
|
-
var
|
|
995
|
-
await ((
|
|
996
|
-
}, g = (
|
|
993
|
+
}, O = async (v) => {
|
|
994
|
+
var x;
|
|
995
|
+
await ((x = l.canRetrieve) == null ? void 0 : x.call(l, v)) && k.push(l.config.getViewRoute(v.id));
|
|
996
|
+
}, g = (v) => ({
|
|
997
997
|
label: h("upstreams.actions.view"),
|
|
998
|
-
to: l.config.getViewRoute(
|
|
999
|
-
}),
|
|
998
|
+
to: l.config.getViewRoute(v)
|
|
999
|
+
}), N = (v) => ({
|
|
1000
1000
|
label: h("upstreams.actions.edit"),
|
|
1001
|
-
to: l.config.getEditRoute(
|
|
1002
|
-
}),
|
|
1003
|
-
|
|
1001
|
+
to: l.config.getEditRoute(v)
|
|
1002
|
+
}), P = R(void 0), le = R(!1), G = R(!1), re = R(""), A = _t(l.config, t.value), K = (v) => {
|
|
1003
|
+
P.value = v, le.value = !0;
|
|
1004
1004
|
}, ee = () => {
|
|
1005
|
-
|
|
1005
|
+
le.value = !1;
|
|
1006
1006
|
}, se = async () => {
|
|
1007
|
-
var
|
|
1008
|
-
if ((
|
|
1009
|
-
|
|
1007
|
+
var v, q, x;
|
|
1008
|
+
if ((v = P.value) != null && v.id) {
|
|
1009
|
+
G.value = !0;
|
|
1010
1010
|
try {
|
|
1011
|
-
await y.delete(P
|
|
1012
|
-
} catch (
|
|
1013
|
-
re.value = ((
|
|
1011
|
+
await y.delete(A(P.value.id)), G.value = !1, le.value = !1, z.value++, i("delete:success", P.value);
|
|
1012
|
+
} catch (X) {
|
|
1013
|
+
re.value = ((x = (q = X.response) == null ? void 0 : q.data) == null ? void 0 : x.message) || X.message || h("upstreams.errors.delete"), i("error", X);
|
|
1014
1014
|
} finally {
|
|
1015
|
-
|
|
1015
|
+
G.value = !1;
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
1018
|
-
},
|
|
1019
|
-
|
|
1018
|
+
}, ae = () => {
|
|
1019
|
+
k.push(l.config.createRoute);
|
|
1020
1020
|
};
|
|
1021
|
-
de(S, (
|
|
1022
|
-
var
|
|
1023
|
-
if (
|
|
1024
|
-
|
|
1021
|
+
de(S, (v) => {
|
|
1022
|
+
var q, x, X;
|
|
1023
|
+
if (v.status === Ct.Error) {
|
|
1024
|
+
W.value = {
|
|
1025
1025
|
title: h("upstreams.errors.general")
|
|
1026
|
-
}, (
|
|
1026
|
+
}, (X = (x = (q = v.error) == null ? void 0 : q.response) == null ? void 0 : x.data) != null && X.message && (W.value.message = v.error.response.data.message), i("error", v.error);
|
|
1027
1027
|
return;
|
|
1028
1028
|
}
|
|
1029
|
-
|
|
1029
|
+
W.value = null;
|
|
1030
1030
|
});
|
|
1031
|
-
const te =
|
|
1031
|
+
const te = R({
|
|
1032
1032
|
ctaPath: l.config.createRoute,
|
|
1033
1033
|
ctaText: void 0,
|
|
1034
1034
|
message: `${h("upstreams.list.empty_state.description")}${l.config.additionMessageForEmptyState ? ` ${l.config.additionMessageForEmptyState}` : ""}`,
|
|
1035
1035
|
title: h("upstreams.title")
|
|
1036
|
-
}), U =
|
|
1036
|
+
}), U = R(!1);
|
|
1037
1037
|
return De(async () => {
|
|
1038
1038
|
U.value = await l.canCreate(), U.value && (te.value.title = h("upstreams.list.empty_state.title"), te.value.ctaText = h("upstreams.actions.create"));
|
|
1039
|
-
}), (
|
|
1040
|
-
const
|
|
1039
|
+
}), (v, q) => {
|
|
1040
|
+
const x = $("KButton"), X = $("KEmptyState"), d = $("KDropdownItem"), o = $("KClipboardProvider");
|
|
1041
1041
|
return w(), oe("div", ta, [
|
|
1042
1042
|
u(e(St), {
|
|
1043
1043
|
"cache-identifier": a.cacheIdentifier,
|
|
1044
1044
|
"disable-sorting": c.value,
|
|
1045
1045
|
"empty-state-options": te.value,
|
|
1046
1046
|
"enable-entity-actions": "",
|
|
1047
|
-
"error-message":
|
|
1047
|
+
"error-message": W.value,
|
|
1048
1048
|
fetcher: e(p),
|
|
1049
|
-
"fetcher-cache-key": e(
|
|
1049
|
+
"fetcher-cache-key": e(z),
|
|
1050
1050
|
"pagination-type": "offset",
|
|
1051
1051
|
"preferences-storage-key": "kong-ui-entities-upstreams-list",
|
|
1052
|
-
query:
|
|
1052
|
+
query: V.value,
|
|
1053
1053
|
"table-headers": e(m),
|
|
1054
|
-
onClearSearchInput:
|
|
1055
|
-
"onClick:row":
|
|
1056
|
-
onSort:
|
|
1057
|
-
onState: e(
|
|
1054
|
+
onClearSearchInput: M,
|
|
1055
|
+
"onClick:row": q[3] || (q[3] = (r) => O(r)),
|
|
1056
|
+
onSort: Z,
|
|
1057
|
+
onState: e(F)
|
|
1058
1058
|
}, Te({
|
|
1059
1059
|
"toolbar-filter": n(() => [
|
|
1060
1060
|
u(e(Mt), {
|
|
1061
|
-
modelValue:
|
|
1062
|
-
"onUpdate:modelValue":
|
|
1061
|
+
modelValue: V.value,
|
|
1062
|
+
"onUpdate:modelValue": q[0] || (q[0] = (r) => V.value = r),
|
|
1063
1063
|
config: T.value
|
|
1064
1064
|
}, null, 8, ["modelValue", "config"])
|
|
1065
1065
|
]),
|
|
1066
1066
|
"toolbar-button": n(() => [
|
|
1067
|
-
(w(),
|
|
1067
|
+
(w(), E(bt, {
|
|
1068
1068
|
disabled: !a.useActionOutside,
|
|
1069
1069
|
to: "#kong-ui-app-page-header-action-button"
|
|
1070
1070
|
}, [
|
|
1071
|
-
|
|
1072
|
-
s.value ? (w(),
|
|
1071
|
+
_("div", aa, [
|
|
1072
|
+
s.value ? (w(), E(x, {
|
|
1073
1073
|
key: 0,
|
|
1074
1074
|
appearance: "secondary",
|
|
1075
1075
|
class: "open-learning-hub",
|
|
1076
1076
|
"data-testid": "upstream-learn-more-button",
|
|
1077
1077
|
icon: "",
|
|
1078
|
-
onClick:
|
|
1078
|
+
onClick: q[1] || (q[1] = (r) => v.$emit("click:learn-more"))
|
|
1079
1079
|
}, {
|
|
1080
1080
|
default: n(() => [
|
|
1081
1081
|
u(e(ft), { decorative: "" })
|
|
@@ -1086,7 +1086,7 @@ const pe = {
|
|
|
1086
1086
|
"auth-function": () => a.canCreate()
|
|
1087
1087
|
}, {
|
|
1088
1088
|
default: n(() => [
|
|
1089
|
-
u(
|
|
1089
|
+
u(x, {
|
|
1090
1090
|
appearance: "primary",
|
|
1091
1091
|
"data-testid": "toolbar-add-upstream",
|
|
1092
1092
|
size: a.useActionOutside ? "medium" : "large",
|
|
@@ -1105,7 +1105,7 @@ const pe = {
|
|
|
1105
1105
|
], 8, ["disabled"]))
|
|
1106
1106
|
]),
|
|
1107
1107
|
name: n(({ rowValue: r }) => [
|
|
1108
|
-
|
|
1108
|
+
_("span", la, f(r), 1)
|
|
1109
1109
|
]),
|
|
1110
1110
|
tags: n(({ rowValue: r }) => [
|
|
1111
1111
|
u(e(Ht), {
|
|
@@ -1118,7 +1118,7 @@ const pe = {
|
|
|
1118
1118
|
default: n(({ copyToClipboard: J }) => [
|
|
1119
1119
|
u(d, {
|
|
1120
1120
|
"data-testid": "action-entity-copy-id",
|
|
1121
|
-
onClick: (
|
|
1121
|
+
onClick: (Y) => b(r, J)
|
|
1122
1122
|
}, {
|
|
1123
1123
|
default: n(() => [
|
|
1124
1124
|
Q(f(e(h)("upstreams.actions.copy_id")), 1)
|
|
@@ -1132,7 +1132,7 @@ const pe = {
|
|
|
1132
1132
|
default: n(({ copyToClipboard: J }) => [
|
|
1133
1133
|
u(d, {
|
|
1134
1134
|
"data-testid": "action-entity-copy-json",
|
|
1135
|
-
onClick: (
|
|
1135
|
+
onClick: (Y) => I(r, J)
|
|
1136
1136
|
}, {
|
|
1137
1137
|
default: n(() => [
|
|
1138
1138
|
Q(f(e(h)("upstreams.actions.copy_json")), 1)
|
|
@@ -1160,7 +1160,7 @@ const pe = {
|
|
|
1160
1160
|
default: n(() => [
|
|
1161
1161
|
u(d, {
|
|
1162
1162
|
"data-testid": "action-entity-edit",
|
|
1163
|
-
item:
|
|
1163
|
+
item: N(r.id)
|
|
1164
1164
|
}, null, 8, ["item"])
|
|
1165
1165
|
]),
|
|
1166
1166
|
_: 2
|
|
@@ -1173,7 +1173,7 @@ const pe = {
|
|
|
1173
1173
|
danger: "",
|
|
1174
1174
|
"data-testid": "action-entity-delete",
|
|
1175
1175
|
"has-divider": "",
|
|
1176
|
-
onClick: (J) =>
|
|
1176
|
+
onClick: (J) => K(r)
|
|
1177
1177
|
}, {
|
|
1178
1178
|
default: n(() => [
|
|
1179
1179
|
Q(f(e(h)("upstreams.actions.delete")), 1)
|
|
@@ -1186,12 +1186,12 @@ const pe = {
|
|
|
1186
1186
|
]),
|
|
1187
1187
|
_: 2
|
|
1188
1188
|
}, [
|
|
1189
|
-
!
|
|
1189
|
+
!V.value && a.config.app === "konnect" ? {
|
|
1190
1190
|
name: "empty-state",
|
|
1191
1191
|
fn: n(() => {
|
|
1192
1192
|
var r;
|
|
1193
1193
|
return [
|
|
1194
|
-
u(
|
|
1194
|
+
u(X, {
|
|
1195
1195
|
"data-testid": "upstreams-entity-empty-state",
|
|
1196
1196
|
"icon-background": "",
|
|
1197
1197
|
message: e(h)("upstreams.list.empty_state_v2.description"),
|
|
@@ -1201,10 +1201,10 @@ const pe = {
|
|
|
1201
1201
|
u(e(Nt), { decorative: "" })
|
|
1202
1202
|
]),
|
|
1203
1203
|
action: n(() => [
|
|
1204
|
-
U.value ? (w(),
|
|
1204
|
+
U.value ? (w(), E(x, {
|
|
1205
1205
|
key: 0,
|
|
1206
1206
|
"data-testid": "entity-create-button",
|
|
1207
|
-
onClick:
|
|
1207
|
+
onClick: ae
|
|
1208
1208
|
}, {
|
|
1209
1209
|
default: n(() => [
|
|
1210
1210
|
u(e(xe), { decorative: "" }),
|
|
@@ -1212,10 +1212,10 @@ const pe = {
|
|
|
1212
1212
|
]),
|
|
1213
1213
|
_: 1
|
|
1214
1214
|
})) : B("", !0),
|
|
1215
|
-
u(
|
|
1215
|
+
u(x, {
|
|
1216
1216
|
appearance: "secondary",
|
|
1217
1217
|
"data-testid": "entity-learn-more-button",
|
|
1218
|
-
onClick:
|
|
1218
|
+
onClick: q[2] || (q[2] = (J) => v.$emit("click:learn-more"))
|
|
1219
1219
|
}, {
|
|
1220
1220
|
default: n(() => [
|
|
1221
1221
|
u(e(ft), { decorative: "" }),
|
|
@@ -1240,13 +1240,13 @@ const pe = {
|
|
|
1240
1240
|
} : void 0
|
|
1241
1241
|
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
|
|
1242
1242
|
u(e(Ut), {
|
|
1243
|
-
"action-pending":
|
|
1243
|
+
"action-pending": G.value,
|
|
1244
1244
|
description: e(h)("upstreams.delete.description"),
|
|
1245
|
-
"entity-name":
|
|
1245
|
+
"entity-name": P.value && (P.value.name || P.value.id),
|
|
1246
1246
|
"entity-type": e(It).Upstream,
|
|
1247
1247
|
error: re.value,
|
|
1248
1248
|
title: e(h)("upstreams.delete.title"),
|
|
1249
|
-
visible:
|
|
1249
|
+
visible: le.value,
|
|
1250
1250
|
onCancel: ee,
|
|
1251
1251
|
onProceed: se
|
|
1252
1252
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
@@ -1315,104 +1315,106 @@ const pe = {
|
|
|
1315
1315
|
},
|
|
1316
1316
|
emits: ["update", "error", "loading", "cancel"],
|
|
1317
1317
|
setup(a, { emit: D }) {
|
|
1318
|
-
var
|
|
1319
|
-
const i = D, l = a, { i18n: { t: h } } = pe.useI18n(), { getMessageFromError:
|
|
1320
|
-
var
|
|
1321
|
-
return we.form[l.config.app].edit.replace(/{upstreamId}/gi, ((
|
|
1322
|
-
}),
|
|
1318
|
+
var W;
|
|
1319
|
+
const i = D, l = a, { i18n: { t: h } } = pe.useI18n(), { getMessageFromError: k } = qt(), { axiosInstance: y } = Ke((W = l.config) == null ? void 0 : W.axiosRequestConfig), j = H(() => {
|
|
1320
|
+
var b;
|
|
1321
|
+
return we.form[l.config.app].edit.replace(/{upstreamId}/gi, ((b = l.config) == null ? void 0 : b.upstreamId) || "");
|
|
1322
|
+
}), F = H(() => l.targetId ? ue.Edit : ue.Create), s = H(() => F.value === ue.Edit ? h("targets.form.edit.title") : h("targets.form.create.title")), c = Fe({
|
|
1323
1323
|
fields: {
|
|
1324
1324
|
target: "",
|
|
1325
1325
|
weight: 100,
|
|
1326
|
-
tags: ""
|
|
1326
|
+
tags: "",
|
|
1327
|
+
failover: !1
|
|
1327
1328
|
},
|
|
1328
1329
|
isReadonly: !1,
|
|
1329
1330
|
errorMessage: ""
|
|
1330
|
-
}), C =
|
|
1331
|
+
}), C = Fe({
|
|
1331
1332
|
target: "",
|
|
1332
1333
|
weight: 100,
|
|
1333
|
-
tags: ""
|
|
1334
|
-
|
|
1334
|
+
tags: "",
|
|
1335
|
+
failover: !1
|
|
1336
|
+
}), m = {
|
|
1335
1337
|
target: "",
|
|
1336
1338
|
weight: 100,
|
|
1337
1339
|
tags: ""
|
|
1338
|
-
},
|
|
1339
|
-
const
|
|
1340
|
-
return
|
|
1341
|
-
}),
|
|
1342
|
-
() => JSON.stringify(c.fields) !== JSON.stringify(
|
|
1343
|
-
),
|
|
1344
|
-
var
|
|
1345
|
-
c.fields.target = (
|
|
1346
|
-
},
|
|
1340
|
+
}, t = H(() => {
|
|
1341
|
+
const b = parseInt(c.fields.weight.toString(), 10);
|
|
1342
|
+
return b < 0 || b > 65535;
|
|
1343
|
+
}), V = H(
|
|
1344
|
+
() => JSON.stringify(c.fields) !== JSON.stringify(C) && !!c.fields.target && !!c.fields.weight && !t.value
|
|
1345
|
+
), T = (b) => {
|
|
1346
|
+
var I;
|
|
1347
|
+
c.fields.target = (b == null ? void 0 : b.target) || "", c.fields.weight = (b == null ? void 0 : b.weight) ?? "", c.fields.tags = ((I = b == null ? void 0 : b.tags) == null ? void 0 : I.join(", ")) || "", l.failoverEnabled && (c.fields.failover = (b == null ? void 0 : b.failover) || !1), Object.assign(C, c.fields);
|
|
1348
|
+
}, p = () => {
|
|
1347
1349
|
c.errorMessage = "", i("cancel");
|
|
1348
|
-
},
|
|
1349
|
-
var
|
|
1350
|
-
let
|
|
1351
|
-
return l.config.app === "konnect" ?
|
|
1352
|
-
}),
|
|
1353
|
-
var
|
|
1354
|
-
let
|
|
1355
|
-
return l.config.app === "konnect" ?
|
|
1356
|
-
}),
|
|
1357
|
-
var
|
|
1350
|
+
}, S = H(() => {
|
|
1351
|
+
var I, O;
|
|
1352
|
+
let b = `${l.config.apiBaseUrl}${we.form[l.config.app].validate}`;
|
|
1353
|
+
return l.config.app === "konnect" ? b = b.replace(/{controlPlaneId}/gi, ((I = l.config) == null ? void 0 : I.controlPlaneId) || "") : l.config.app === "kongManager" && (b = b.replace(/\/{workspace}/gi, (O = l.config) != null && O.workspace ? `/${l.config.workspace}` : "")), b = b.replace(/{id}/gi, l.targetId), b;
|
|
1354
|
+
}), z = H(() => {
|
|
1355
|
+
var I, O, g, N;
|
|
1356
|
+
let b = `${l.config.apiBaseUrl}${we.form[l.config.app][F.value]}`;
|
|
1357
|
+
return l.config.app === "konnect" ? b = b.replace(/{controlPlaneId}/gi, ((I = l.config) == null ? void 0 : I.controlPlaneId) || "").replace(/{upstreamId}/gi, ((O = l.config) == null ? void 0 : O.upstreamId) || "") : l.config.app === "kongManager" && (b = b.replace(/\/{workspace}/gi, (g = l.config) != null && g.workspace ? `/${l.config.workspace}` : "").replace(/{upstreamId}/gi, ((N = l.config) == null ? void 0 : N.upstreamId) || "")), b = b.replace(/{id}/gi, l.targetId), b;
|
|
1358
|
+
}), M = H(() => {
|
|
1359
|
+
var b, I, O;
|
|
1358
1360
|
return {
|
|
1359
1361
|
target: c.fields.target,
|
|
1360
1362
|
weight: parseInt(c.fields.weight),
|
|
1361
|
-
tags: (
|
|
1363
|
+
tags: (O = (I = (b = c.fields.tags) == null ? void 0 : b.split(",")) == null ? void 0 : I.map((g) => String(g || "").trim())) == null ? void 0 : O.filter((g) => g !== ""),
|
|
1362
1364
|
upstream: { id: l.config.upstreamId },
|
|
1363
|
-
...l.failoverEnabled ? { failover:
|
|
1365
|
+
...l.failoverEnabled ? { failover: c.fields.failover } : {}
|
|
1364
1366
|
};
|
|
1365
|
-
}),
|
|
1366
|
-
var
|
|
1367
|
+
}), Z = async () => {
|
|
1368
|
+
var b, I;
|
|
1367
1369
|
try {
|
|
1368
1370
|
c.isReadonly = !0, c.errorMessage = "";
|
|
1369
|
-
let
|
|
1370
|
-
if (await y.post(
|
|
1371
|
-
const { data:
|
|
1372
|
-
c.fields.target = (
|
|
1371
|
+
let O;
|
|
1372
|
+
if (await y.post(S.value, M.value), F.value === "create" ? O = await y.post(z.value, M.value) : F.value === "edit" && (O = ((b = l.config) == null ? void 0 : b.app) === "konnect" ? await y.put(z.value, M.value) : await y.patch(z.value, M.value)), O) {
|
|
1373
|
+
const { data: g } = O;
|
|
1374
|
+
c.fields.target = (g == null ? void 0 : g.name) || "", c.fields.weight = (g == null ? void 0 : g.weight) ?? 100, c.fields.tags = ((I = g == null ? void 0 : g.tags) == null ? void 0 : I.join(", ")) || "", i("update", g), Object.assign(c.fields, m);
|
|
1373
1375
|
}
|
|
1374
|
-
} catch (
|
|
1375
|
-
c.errorMessage =
|
|
1376
|
+
} catch (O) {
|
|
1377
|
+
c.errorMessage = k(O), i("error", O);
|
|
1376
1378
|
} finally {
|
|
1377
1379
|
c.isReadonly = !1;
|
|
1378
1380
|
}
|
|
1379
1381
|
};
|
|
1380
1382
|
return de(() => l.targetId, () => {
|
|
1381
|
-
Object.assign(c.fields,
|
|
1382
|
-
}), (
|
|
1383
|
-
const
|
|
1384
|
-
return w(),
|
|
1385
|
-
"action-button-disabled": !
|
|
1383
|
+
Object.assign(c.fields, m);
|
|
1384
|
+
}), (b, I) => {
|
|
1385
|
+
const O = $("KInput"), g = $("KCheckbox"), N = $("KPrompt");
|
|
1386
|
+
return w(), E(N, {
|
|
1387
|
+
"action-button-disabled": !V.value || c.isReadonly,
|
|
1386
1388
|
"action-button-text": e(h)("targets.form.buttons.save"),
|
|
1387
1389
|
"cancel-button-text": e(h)("targets.form.buttons.cancel"),
|
|
1388
1390
|
title: s.value,
|
|
1389
1391
|
visible: a.isVisible,
|
|
1390
|
-
onCancel:
|
|
1391
|
-
onProceed:
|
|
1392
|
+
onCancel: p,
|
|
1393
|
+
onProceed: Z
|
|
1392
1394
|
}, {
|
|
1393
1395
|
default: n(() => [
|
|
1394
|
-
|
|
1396
|
+
_("div", ia, [
|
|
1395
1397
|
u(e(wt), {
|
|
1396
1398
|
config: a.config,
|
|
1397
1399
|
"edit-id": a.targetId,
|
|
1398
1400
|
"entity-type": e(Le).Target,
|
|
1399
1401
|
"error-message": c.errorMessage,
|
|
1400
1402
|
"fetch-url": j.value,
|
|
1401
|
-
"form-fields":
|
|
1403
|
+
"form-fields": M.value,
|
|
1402
1404
|
"is-readonly": c.isReadonly,
|
|
1403
|
-
onCancel:
|
|
1404
|
-
"onFetch:error":
|
|
1405
|
-
"onFetch:success":
|
|
1406
|
-
onLoading:
|
|
1405
|
+
onCancel: p,
|
|
1406
|
+
"onFetch:error": I[4] || (I[4] = (P) => b.$emit("error", P)),
|
|
1407
|
+
"onFetch:success": T,
|
|
1408
|
+
onLoading: I[5] || (I[5] = (P) => b.$emit("loading", P))
|
|
1407
1409
|
}, {
|
|
1408
1410
|
default: n(() => [
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
vt(
|
|
1411
|
+
_("div", oa, [
|
|
1412
|
+
b.$slots.info ? (w(), oe("div", ra, [
|
|
1413
|
+
vt(b.$slots, "info", {}, void 0, !0)
|
|
1412
1414
|
])) : B("", !0),
|
|
1413
|
-
u(
|
|
1415
|
+
u(O, {
|
|
1414
1416
|
modelValue: c.fields.target,
|
|
1415
|
-
"onUpdate:modelValue":
|
|
1417
|
+
"onUpdate:modelValue": I[0] || (I[0] = (P) => c.fields.target = P),
|
|
1416
1418
|
modelModifiers: { trim: !0 },
|
|
1417
1419
|
autocomplete: "off",
|
|
1418
1420
|
class: "target-form-input",
|
|
@@ -1427,13 +1429,13 @@ const pe = {
|
|
|
1427
1429
|
required: "",
|
|
1428
1430
|
type: "text"
|
|
1429
1431
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1430
|
-
u(
|
|
1432
|
+
u(O, {
|
|
1431
1433
|
modelValue: c.fields.weight,
|
|
1432
|
-
"onUpdate:modelValue":
|
|
1434
|
+
"onUpdate:modelValue": I[1] || (I[1] = (P) => c.fields.weight = P),
|
|
1433
1435
|
autocomplete: "off",
|
|
1434
1436
|
class: "target-form-input",
|
|
1435
1437
|
"data-testid": "target-form-weight",
|
|
1436
|
-
error:
|
|
1438
|
+
error: t.value,
|
|
1437
1439
|
"error-message": e(h)("targets.errors.weight"),
|
|
1438
1440
|
label: e(h)("targets.form.fields.weight.label"),
|
|
1439
1441
|
"label-attributes": {
|
|
@@ -1447,9 +1449,9 @@ const pe = {
|
|
|
1447
1449
|
type: "number"
|
|
1448
1450
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "readonly"]),
|
|
1449
1451
|
a.failoverEnabled ? (w(), oe("div", na, [
|
|
1450
|
-
u(
|
|
1451
|
-
modelValue:
|
|
1452
|
-
"onUpdate:modelValue":
|
|
1452
|
+
u(g, {
|
|
1453
|
+
modelValue: c.fields.failover,
|
|
1454
|
+
"onUpdate:modelValue": I[2] || (I[2] = (P) => c.fields.failover = P),
|
|
1453
1455
|
disabled: a.failoverUnsupported,
|
|
1454
1456
|
label: e(h)("targets.form.fields.failover.label"),
|
|
1455
1457
|
"label-attributes": {
|
|
@@ -1457,9 +1459,9 @@ const pe = {
|
|
|
1457
1459
|
}
|
|
1458
1460
|
}, null, 8, ["modelValue", "disabled", "label", "label-attributes"])
|
|
1459
1461
|
])) : B("", !0),
|
|
1460
|
-
u(
|
|
1462
|
+
u(O, {
|
|
1461
1463
|
modelValue: c.fields.tags,
|
|
1462
|
-
"onUpdate:modelValue":
|
|
1464
|
+
"onUpdate:modelValue": I[3] || (I[3] = (P) => c.fields.tags = P),
|
|
1463
1465
|
modelModifiers: { trim: !0 },
|
|
1464
1466
|
autocomplete: "off",
|
|
1465
1467
|
class: "target-form-input",
|
|
@@ -1480,7 +1482,7 @@ const pe = {
|
|
|
1480
1482
|
}, 8, ["action-button-disabled", "action-button-text", "cancel-button-text", "title", "visible"]);
|
|
1481
1483
|
};
|
|
1482
1484
|
}
|
|
1483
|
-
}), ua = /* @__PURE__ */ me(ha, [["__scopeId", "data-v-
|
|
1485
|
+
}), ua = /* @__PURE__ */ me(ha, [["__scopeId", "data-v-eac3b1ad"]]), ca = { class: "kong-ui-entities-targets-list" }, da = { class: "target-address" }, pa = /* @__PURE__ */ ne({
|
|
1484
1486
|
__name: "TargetsList",
|
|
1485
1487
|
props: {
|
|
1486
1488
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -1530,27 +1532,27 @@ const pe = {
|
|
|
1530
1532
|
emits: ["error", "copy:success", "copy:error", "delete:success", "health-actions:healthy", "health-actions:unhealthy", "create:target", "update:target"],
|
|
1531
1533
|
setup(a, { emit: D }) {
|
|
1532
1534
|
var te;
|
|
1533
|
-
const i = D, l = a, { i18n: { t: h } } = pe.useI18n(), { axiosInstance:
|
|
1535
|
+
const i = D, l = a, { i18n: { t: h } } = pe.useI18n(), { axiosInstance: k } = Ke((te = l.config) == null ? void 0 : te.axiosRequestConfig), y = H(() => l.config.app !== "kongManager" || !!l.config.disableSorting), F = {
|
|
1534
1536
|
// the Target Address column is non-hidable
|
|
1535
1537
|
target: { label: h("targets.list.table_headers.target_address"), sortable: !0, hidable: !1 },
|
|
1536
1538
|
weight: { label: h("targets.list.table_headers.weight"), sortable: !0 },
|
|
1537
1539
|
...l.failoverEnabled ? { failover: { label: h("targets.list.table_headers.target_type"), sortable: !1 } } : {},
|
|
1538
1540
|
tags: { label: h("targets.list.table_headers.tags"), sortable: !1 }
|
|
1539
1541
|
}, s = H(() => {
|
|
1540
|
-
var L,
|
|
1542
|
+
var L, v, q, x;
|
|
1541
1543
|
let U = `${l.config.apiBaseUrl}${we.list[l.config.app]}`;
|
|
1542
|
-
return l.config.app === "konnect" ? U = U.replace(/{controlPlaneId}/gi, ((L = l.config) == null ? void 0 : L.controlPlaneId) || "").replace(/{upstreamId}/gi, ((
|
|
1544
|
+
return l.config.app === "konnect" ? U = U.replace(/{controlPlaneId}/gi, ((L = l.config) == null ? void 0 : L.controlPlaneId) || "").replace(/{upstreamId}/gi, ((v = l.config) == null ? void 0 : v.upstreamId) || "") : l.config.app === "kongManager" && (U = U.replace(/\/{workspace}/gi, (q = l.config) != null && q.workspace ? `/${l.config.workspace}` : "").replace(/{upstreamId}/gi, ((x = l.config) == null ? void 0 : x.upstreamId) || "")), U;
|
|
1543
1545
|
}), {
|
|
1544
1546
|
fetcher: c,
|
|
1545
1547
|
fetcherState: C,
|
|
1546
1548
|
fetcherCacheKey: m
|
|
1547
1549
|
} = kt(H(() => ({ ...l.config, cacheIdentifier: l.cacheIdentifier })), s), t = () => {
|
|
1548
1550
|
m.value++;
|
|
1549
|
-
},
|
|
1550
|
-
|
|
1551
|
+
}, V = R(null), T = () => {
|
|
1552
|
+
K.value = !0;
|
|
1551
1553
|
}, p = async (U, L) => {
|
|
1552
|
-
const
|
|
1553
|
-
if (!await L(
|
|
1554
|
+
const v = U.id;
|
|
1555
|
+
if (!await L(v)) {
|
|
1554
1556
|
i("copy:error", {
|
|
1555
1557
|
entity: U,
|
|
1556
1558
|
field: "id",
|
|
@@ -1561,11 +1563,11 @@ const pe = {
|
|
|
1561
1563
|
i("copy:success", {
|
|
1562
1564
|
entity: U,
|
|
1563
1565
|
field: "id",
|
|
1564
|
-
message: h("targets.copy.success", { val:
|
|
1566
|
+
message: h("targets.copy.success", { val: v })
|
|
1565
1567
|
});
|
|
1566
1568
|
}, S = async (U, L) => {
|
|
1567
|
-
const
|
|
1568
|
-
if (!await L(
|
|
1569
|
+
const v = JSON.stringify(U);
|
|
1570
|
+
if (!await L(v)) {
|
|
1569
1571
|
i("copy:error", {
|
|
1570
1572
|
entity: U,
|
|
1571
1573
|
message: h("targets.errors.copy")
|
|
@@ -1576,36 +1578,36 @@ const pe = {
|
|
|
1576
1578
|
entity: U,
|
|
1577
1579
|
message: h("targets.copy.success_brief")
|
|
1578
1580
|
});
|
|
1579
|
-
},
|
|
1580
|
-
|
|
1581
|
-
},
|
|
1582
|
-
|
|
1583
|
-
},
|
|
1584
|
-
|
|
1585
|
-
},
|
|
1586
|
-
var U, L,
|
|
1587
|
-
if ((U =
|
|
1588
|
-
|
|
1581
|
+
}, z = (U) => {
|
|
1582
|
+
A.value = U, K.value = !0;
|
|
1583
|
+
}, M = (U) => l.config.app === "konnect" ? !1 : l.config.canMarkHealthy(U), Z = (U) => l.config.app === "konnect" ? !1 : l.config.canMarkUnhealthy(U), W = R(void 0), b = R(!1), I = R(!1), O = R(""), g = _t(l.config, s.value), N = (U) => {
|
|
1584
|
+
W.value = U, b.value = !0;
|
|
1585
|
+
}, P = () => {
|
|
1586
|
+
b.value = !1;
|
|
1587
|
+
}, le = async () => {
|
|
1588
|
+
var U, L, v;
|
|
1589
|
+
if ((U = W.value) != null && U.id) {
|
|
1590
|
+
I.value = !0;
|
|
1589
1591
|
try {
|
|
1590
|
-
await
|
|
1591
|
-
} catch (
|
|
1592
|
-
|
|
1592
|
+
await k.delete(g(W.value.id)), I.value = !1, b.value = !1, m.value++, i("delete:success", W.value);
|
|
1593
|
+
} catch (q) {
|
|
1594
|
+
O.value = ((v = (L = q.response) == null ? void 0 : L.data) == null ? void 0 : v.message) || q.message || h("targets.errors.delete"), i("error", q);
|
|
1593
1595
|
} finally {
|
|
1594
|
-
|
|
1596
|
+
I.value = !1;
|
|
1595
1597
|
}
|
|
1596
1598
|
}
|
|
1597
1599
|
};
|
|
1598
1600
|
de(C, (U) => {
|
|
1599
|
-
var L,
|
|
1601
|
+
var L, v, q;
|
|
1600
1602
|
if (U.status === Ct.Error) {
|
|
1601
|
-
|
|
1603
|
+
V.value = {
|
|
1602
1604
|
title: h("targets.errors.general")
|
|
1603
|
-
}, (
|
|
1605
|
+
}, (q = (v = (L = U.error) == null ? void 0 : L.response) == null ? void 0 : v.data) != null && q.message && (V.value.message = U.error.response.data.message), i("error", U.error);
|
|
1604
1606
|
return;
|
|
1605
1607
|
}
|
|
1606
|
-
|
|
1608
|
+
V.value = null;
|
|
1607
1609
|
});
|
|
1608
|
-
const
|
|
1610
|
+
const G = R({
|
|
1609
1611
|
ctaText: void 0,
|
|
1610
1612
|
message: `${h("targets.list.empty_state.description")}${l.config.additionMessageForEmptyState ? ` ${l.config.additionMessageForEmptyState}` : ""}`,
|
|
1611
1613
|
title: h("targets.title"),
|
|
@@ -1615,7 +1617,7 @@ const pe = {
|
|
|
1615
1617
|
}
|
|
1616
1618
|
});
|
|
1617
1619
|
De(async () => {
|
|
1618
|
-
await l.canCreate() && (
|
|
1620
|
+
await l.canCreate() && (G.value.title = h("targets.list.empty_state.title"), G.value.ctaText = h("targets.actions.create"));
|
|
1619
1621
|
});
|
|
1620
1622
|
const re = H(() => ({
|
|
1621
1623
|
app: l.config.app,
|
|
@@ -1630,32 +1632,32 @@ const pe = {
|
|
|
1630
1632
|
...l.config.app === "kongManager" && {
|
|
1631
1633
|
workspace: l.config.workspace
|
|
1632
1634
|
}
|
|
1633
|
-
})),
|
|
1634
|
-
|
|
1635
|
+
})), A = R(""), K = R(!1), ee = (U) => {
|
|
1636
|
+
A.value ? i("update:target", U) : i("create:target", U), se();
|
|
1635
1637
|
}, se = () => {
|
|
1636
|
-
|
|
1637
|
-
},
|
|
1638
|
-
|
|
1638
|
+
ae(), m.value++;
|
|
1639
|
+
}, ae = () => {
|
|
1640
|
+
K.value = !1, A.value = "";
|
|
1639
1641
|
};
|
|
1640
1642
|
return (U, L) => {
|
|
1641
|
-
const
|
|
1643
|
+
const v = $("KButton"), q = $("KBadge"), x = $("KDropdownItem"), X = $("KClipboardProvider");
|
|
1642
1644
|
return w(), oe("div", ca, [
|
|
1643
1645
|
u(e(St), {
|
|
1644
1646
|
"cache-identifier": a.cacheIdentifier,
|
|
1645
1647
|
"disable-sorting": y.value,
|
|
1646
|
-
"empty-state-options":
|
|
1648
|
+
"empty-state-options": G.value,
|
|
1647
1649
|
"enable-entity-actions": "",
|
|
1648
|
-
"error-message":
|
|
1650
|
+
"error-message": V.value,
|
|
1649
1651
|
fetcher: e(c),
|
|
1650
1652
|
"fetcher-cache-key": e(m),
|
|
1651
1653
|
"pagination-type": "offset",
|
|
1652
1654
|
"preferences-storage-key": "kong-ui-entities-targets-list",
|
|
1653
|
-
"table-headers": e(
|
|
1655
|
+
"table-headers": e(F),
|
|
1654
1656
|
onEmptyStateCtaClicked: L[1] || (L[1] = () => l.config.createRoute ? void 0 : T()),
|
|
1655
1657
|
onSort: t
|
|
1656
1658
|
}, Te({
|
|
1657
1659
|
"toolbar-button": n(() => [
|
|
1658
|
-
(w(),
|
|
1660
|
+
(w(), E(bt, {
|
|
1659
1661
|
disabled: !a.useActionOutside,
|
|
1660
1662
|
to: "#kong-ui-app-page-header-action-button"
|
|
1661
1663
|
}, [
|
|
@@ -1663,7 +1665,7 @@ const pe = {
|
|
|
1663
1665
|
"auth-function": () => a.canCreate()
|
|
1664
1666
|
}, {
|
|
1665
1667
|
default: n(() => [
|
|
1666
|
-
u(
|
|
1668
|
+
u(v, {
|
|
1667
1669
|
appearance: "primary",
|
|
1668
1670
|
"data-testid": "toolbar-new-target",
|
|
1669
1671
|
size: a.useActionOutside ? "medium" : "large",
|
|
@@ -1682,7 +1684,7 @@ const pe = {
|
|
|
1682
1684
|
], 8, ["disabled"]))
|
|
1683
1685
|
]),
|
|
1684
1686
|
target: n(({ rowValue: d }) => [
|
|
1685
|
-
|
|
1687
|
+
_("span", da, f(d), 1)
|
|
1686
1688
|
]),
|
|
1687
1689
|
tags: n(({ rowValue: d }) => [
|
|
1688
1690
|
u(e(Ht), {
|
|
@@ -1691,9 +1693,9 @@ const pe = {
|
|
|
1691
1693
|
}, null, 8, ["tags"])
|
|
1692
1694
|
]),
|
|
1693
1695
|
actions: n(({ row: d }) => [
|
|
1694
|
-
u(
|
|
1696
|
+
u(X, null, {
|
|
1695
1697
|
default: n(({ copyToClipboard: o }) => [
|
|
1696
|
-
u(
|
|
1698
|
+
u(x, {
|
|
1697
1699
|
"data-testid": "action-entity-copy-id",
|
|
1698
1700
|
onClick: (r) => p(d, o)
|
|
1699
1701
|
}, {
|
|
@@ -1705,9 +1707,9 @@ const pe = {
|
|
|
1705
1707
|
]),
|
|
1706
1708
|
_: 2
|
|
1707
1709
|
}, 1024),
|
|
1708
|
-
u(
|
|
1710
|
+
u(X, null, {
|
|
1709
1711
|
default: n(({ copyToClipboard: o }) => [
|
|
1710
|
-
u(
|
|
1712
|
+
u(x, {
|
|
1711
1713
|
"data-testid": "action-entity-copy-json",
|
|
1712
1714
|
onClick: (r) => S(d, o)
|
|
1713
1715
|
}, {
|
|
@@ -1723,10 +1725,10 @@ const pe = {
|
|
|
1723
1725
|
"auth-function": () => a.canEdit(d)
|
|
1724
1726
|
}, {
|
|
1725
1727
|
default: n(() => [
|
|
1726
|
-
u(
|
|
1728
|
+
u(x, {
|
|
1727
1729
|
"data-testid": "action-entity-edit",
|
|
1728
1730
|
"has-divider": "",
|
|
1729
|
-
onClick: (o) =>
|
|
1731
|
+
onClick: (o) => z(d.id)
|
|
1730
1732
|
}, {
|
|
1731
1733
|
default: n(() => [
|
|
1732
1734
|
Q(f(e(h)("targets.actions.edit")), 1)
|
|
@@ -1737,10 +1739,10 @@ const pe = {
|
|
|
1737
1739
|
_: 2
|
|
1738
1740
|
}, 1032, ["auth-function"]),
|
|
1739
1741
|
u(e(ce), {
|
|
1740
|
-
"auth-function": () =>
|
|
1742
|
+
"auth-function": () => M(d)
|
|
1741
1743
|
}, {
|
|
1742
1744
|
default: n(() => [
|
|
1743
|
-
u(
|
|
1745
|
+
u(x, {
|
|
1744
1746
|
"data-testid": "action-target-mark-healthy",
|
|
1745
1747
|
onClick: (o) => i("health-actions:healthy", d)
|
|
1746
1748
|
}, {
|
|
@@ -1753,10 +1755,10 @@ const pe = {
|
|
|
1753
1755
|
_: 2
|
|
1754
1756
|
}, 1032, ["auth-function"]),
|
|
1755
1757
|
u(e(ce), {
|
|
1756
|
-
"auth-function": () =>
|
|
1758
|
+
"auth-function": () => Z(d)
|
|
1757
1759
|
}, {
|
|
1758
1760
|
default: n(() => [
|
|
1759
|
-
u(
|
|
1761
|
+
u(x, {
|
|
1760
1762
|
"data-testid": "action-target-mark-unhealthy",
|
|
1761
1763
|
onClick: (o) => i("health-actions:unhealthy", d)
|
|
1762
1764
|
}, {
|
|
@@ -1772,11 +1774,11 @@ const pe = {
|
|
|
1772
1774
|
"auth-function": () => a.canDelete(d)
|
|
1773
1775
|
}, {
|
|
1774
1776
|
default: n(() => [
|
|
1775
|
-
u(
|
|
1777
|
+
u(x, {
|
|
1776
1778
|
danger: "",
|
|
1777
1779
|
"data-testid": "action-entity-delete",
|
|
1778
1780
|
"has-divider": "",
|
|
1779
|
-
onClick: (o) =>
|
|
1781
|
+
onClick: (o) => N(d)
|
|
1780
1782
|
}, {
|
|
1781
1783
|
default: n(() => [
|
|
1782
1784
|
Q(f(e(h)("targets.actions.delete")), 1)
|
|
@@ -1792,7 +1794,7 @@ const pe = {
|
|
|
1792
1794
|
a.failoverEnabled ? {
|
|
1793
1795
|
name: "failover",
|
|
1794
1796
|
fn: n(({ rowValue: d }) => [
|
|
1795
|
-
u(
|
|
1797
|
+
u(q, {
|
|
1796
1798
|
appearance: "info",
|
|
1797
1799
|
class: "upstream-failover"
|
|
1798
1800
|
}, {
|
|
@@ -1806,23 +1808,23 @@ const pe = {
|
|
|
1806
1808
|
} : void 0
|
|
1807
1809
|
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "table-headers"]),
|
|
1808
1810
|
u(e(Ut), {
|
|
1809
|
-
"action-pending":
|
|
1811
|
+
"action-pending": I.value,
|
|
1810
1812
|
description: e(h)("targets.delete.description"),
|
|
1811
1813
|
"entity-type": e(It).Target,
|
|
1812
|
-
error:
|
|
1814
|
+
error: O.value,
|
|
1813
1815
|
"need-confirm": !1,
|
|
1814
1816
|
title: e(h)("targets.delete.title"),
|
|
1815
|
-
visible:
|
|
1816
|
-
onCancel:
|
|
1817
|
-
onProceed:
|
|
1817
|
+
visible: b.value,
|
|
1818
|
+
onCancel: P,
|
|
1819
|
+
onProceed: le
|
|
1818
1820
|
}, null, 8, ["action-pending", "description", "entity-type", "error", "title", "visible"]),
|
|
1819
1821
|
u(ua, {
|
|
1820
1822
|
config: re.value,
|
|
1821
1823
|
"failover-enabled": a.failoverEnabled,
|
|
1822
1824
|
"failover-unsupported": a.failoverEnabled && !e(ea).includes(a.algorithm),
|
|
1823
|
-
"is-visible":
|
|
1824
|
-
"target-id":
|
|
1825
|
-
onCancel:
|
|
1825
|
+
"is-visible": K.value,
|
|
1826
|
+
"target-id": A.value,
|
|
1827
|
+
onCancel: ae,
|
|
1826
1828
|
onUpdate: ee
|
|
1827
1829
|
}, Te({ _: 2 }, [
|
|
1828
1830
|
U.$slots["form-info"] ? {
|
|
@@ -1867,61 +1869,61 @@ const pe = {
|
|
|
1867
1869
|
},
|
|
1868
1870
|
emits: ["update:name", "update:host-header", "update:client-certificate", "update:tags"],
|
|
1869
1871
|
setup(a, { emit: D }) {
|
|
1870
|
-
var
|
|
1871
|
-
const { i18nT: i, i18n: { t: l } } = pe.useI18n(), h = a,
|
|
1872
|
+
var P, le, G, re;
|
|
1873
|
+
const { i18nT: i, i18n: { t: l } } = pe.useI18n(), h = a, k = D, {
|
|
1872
1874
|
debouncedQueryChange: y,
|
|
1873
1875
|
loading: j,
|
|
1874
|
-
loadItems:
|
|
1876
|
+
loadItems: F,
|
|
1875
1877
|
results: s,
|
|
1876
1878
|
allRecords: c
|
|
1877
|
-
} = mt(h.config, (
|
|
1879
|
+
} = mt(h.config, (le = _e.form[(P = h.config) == null ? void 0 : P.app]) == null ? void 0 : le.getServices, "", {
|
|
1878
1880
|
fetchedItemsKey: "data",
|
|
1879
1881
|
searchKeys: ["host"]
|
|
1880
1882
|
}), {
|
|
1881
1883
|
debouncedQueryChange: C,
|
|
1882
1884
|
loading: m,
|
|
1883
1885
|
loadItems: t,
|
|
1884
|
-
results:
|
|
1885
|
-
} = mt(h.config, (re = _e.form[(
|
|
1886
|
-
var
|
|
1887
|
-
return !!h.name && !((
|
|
1886
|
+
results: V
|
|
1887
|
+
} = mt(h.config, (re = _e.form[(G = h.config) == null ? void 0 : G.app]) == null ? void 0 : re.getCertificates), T = R(""), p = H(() => {
|
|
1888
|
+
var A;
|
|
1889
|
+
return !!h.name && !((A = c.value) != null && A.some((K) => K.host === h.name));
|
|
1888
1890
|
}), S = H(() => {
|
|
1889
|
-
var
|
|
1890
|
-
const
|
|
1891
|
-
return (se = s.value) == null ? void 0 : se.map((
|
|
1892
|
-
|
|
1891
|
+
var K, ee, se;
|
|
1892
|
+
const A = p.value && h.name.includes((K = T.value) == null ? void 0 : K.toLowerCase());
|
|
1893
|
+
return (se = s.value) == null ? void 0 : se.map((ae) => ({ label: ae.host, value: ae.id })).concat(
|
|
1894
|
+
A ? [{ label: h.name, value: ((ee = Z.value) == null ? void 0 : ee.value) || h.name }] : []
|
|
1893
1895
|
);
|
|
1894
|
-
}),
|
|
1895
|
-
var
|
|
1896
|
-
return (
|
|
1897
|
-
}),
|
|
1898
|
-
var
|
|
1899
|
-
return ((
|
|
1900
|
-
}),
|
|
1901
|
-
T.value =
|
|
1902
|
-
},
|
|
1903
|
-
|
|
1904
|
-
},
|
|
1905
|
-
|
|
1906
|
-
}, g = (
|
|
1907
|
-
|
|
1908
|
-
},
|
|
1896
|
+
}), z = H(() => {
|
|
1897
|
+
var A;
|
|
1898
|
+
return (A = V.value) == null ? void 0 : A.map((K) => ({ label: K.id, value: K.id }));
|
|
1899
|
+
}), M = R(""), Z = R({ value: "", label: "" }), W = H(() => {
|
|
1900
|
+
var A, K;
|
|
1901
|
+
return ((A = S.value.find((ee) => ee.value === M.value)) == null ? void 0 : A.label) || ((K = Z.value) == null ? void 0 : K.label);
|
|
1902
|
+
}), b = (A) => {
|
|
1903
|
+
T.value = A, y(A);
|
|
1904
|
+
}, I = (A) => {
|
|
1905
|
+
Z.value = A;
|
|
1906
|
+
}, O = () => {
|
|
1907
|
+
Z.value = { value: "", label: "" };
|
|
1908
|
+
}, g = (A) => {
|
|
1909
|
+
M.value = A, k("update:name", W.value);
|
|
1910
|
+
}, N = R(!1);
|
|
1909
1911
|
return De(async () => {
|
|
1910
|
-
var
|
|
1912
|
+
var A, K;
|
|
1911
1913
|
try {
|
|
1912
|
-
|
|
1914
|
+
N.value = !0, await F(), h.name && (M.value = ((K = (A = S.value.find((ee) => ee.label === h.name)) == null ? void 0 : A.value) == null ? void 0 : K.toString()) || h.name), await t();
|
|
1913
1915
|
} finally {
|
|
1914
|
-
|
|
1916
|
+
N.value = !1;
|
|
1915
1917
|
}
|
|
1916
|
-
}), (
|
|
1917
|
-
const ee = $("KSkeleton"), se = $("KSelect"),
|
|
1918
|
-
return w(),
|
|
1918
|
+
}), (A, K) => {
|
|
1919
|
+
const ee = $("KSkeleton"), se = $("KSelect"), ae = $("KInput");
|
|
1920
|
+
return w(), E(e(He), {
|
|
1919
1921
|
class: "kong-ui-entities-upstreams-general-info",
|
|
1920
1922
|
description: e(l)("upstreams.form.general_info.help"),
|
|
1921
1923
|
title: e(l)("upstreams.form.general_info.title")
|
|
1922
1924
|
}, {
|
|
1923
1925
|
default: n(() => [
|
|
1924
|
-
|
|
1926
|
+
N.value ? (w(), E(ee, {
|
|
1925
1927
|
key: 0,
|
|
1926
1928
|
type: "form"
|
|
1927
1929
|
})) : (w(), oe("div", ma, [
|
|
@@ -1936,14 +1938,14 @@ const pe = {
|
|
|
1936
1938
|
label: e(l)("upstreams.form.fields.name.label"),
|
|
1937
1939
|
"label-attributes": { tooltipAttributes: { maxWidth: "400" } },
|
|
1938
1940
|
loading: e(j),
|
|
1939
|
-
"model-value":
|
|
1941
|
+
"model-value": M.value,
|
|
1940
1942
|
placeholder: e(l)("upstreams.form.fields.name.placeholder"),
|
|
1941
1943
|
readonly: a.readonly,
|
|
1942
1944
|
required: "",
|
|
1943
1945
|
width: "100%",
|
|
1944
|
-
onItemAdded:
|
|
1945
|
-
onItemRemoved:
|
|
1946
|
-
onQueryChange:
|
|
1946
|
+
onItemAdded: I,
|
|
1947
|
+
onItemRemoved: O,
|
|
1948
|
+
onQueryChange: b,
|
|
1947
1949
|
"onUpdate:modelValue": g
|
|
1948
1950
|
}, {
|
|
1949
1951
|
"label-tooltip": n(() => [
|
|
@@ -1952,14 +1954,14 @@ const pe = {
|
|
|
1952
1954
|
scope: "global"
|
|
1953
1955
|
}, {
|
|
1954
1956
|
host: n(() => [
|
|
1955
|
-
|
|
1957
|
+
_("code", null, f(e(l)("upstreams.form.fields.name.host")), 1)
|
|
1956
1958
|
]),
|
|
1957
1959
|
_: 1
|
|
1958
1960
|
})
|
|
1959
1961
|
]),
|
|
1960
1962
|
_: 1
|
|
1961
1963
|
}, 8, ["items", "label", "loading", "model-value", "placeholder", "readonly", "onUpdate:modelValue"]),
|
|
1962
|
-
u(
|
|
1964
|
+
u(ae, {
|
|
1963
1965
|
autocomplete: "off",
|
|
1964
1966
|
class: "margin-bottom-6",
|
|
1965
1967
|
"data-testid": "upstreams-form-host-header",
|
|
@@ -1967,7 +1969,7 @@ const pe = {
|
|
|
1967
1969
|
"model-value": a.hostHeader,
|
|
1968
1970
|
readonly: a.readonly,
|
|
1969
1971
|
type: "text",
|
|
1970
|
-
"onUpdate:modelValue":
|
|
1972
|
+
"onUpdate:modelValue": K[0] || (K[0] = (te) => k("update:host-header", te))
|
|
1971
1973
|
}, null, 8, ["label", "model-value", "readonly"]),
|
|
1972
1974
|
u(se, {
|
|
1973
1975
|
class: "certificate-select margin-bottom-6",
|
|
@@ -1975,7 +1977,7 @@ const pe = {
|
|
|
1975
1977
|
"data-testid": "upstreams-form-client-certificate",
|
|
1976
1978
|
"enable-filtering": "",
|
|
1977
1979
|
"filter-function": () => !0,
|
|
1978
|
-
items:
|
|
1980
|
+
items: z.value,
|
|
1979
1981
|
label: e(l)("upstreams.form.fields.client_certificate.label"),
|
|
1980
1982
|
"label-attributes": {
|
|
1981
1983
|
info: e(l)("upstreams.form.fields.client_certificate.tooltip"),
|
|
@@ -1987,9 +1989,9 @@ const pe = {
|
|
|
1987
1989
|
readonly: a.readonly,
|
|
1988
1990
|
width: "100%",
|
|
1989
1991
|
onQueryChange: e(C),
|
|
1990
|
-
"onUpdate:modelValue":
|
|
1992
|
+
"onUpdate:modelValue": K[1] || (K[1] = (te) => k("update:client-certificate", te))
|
|
1991
1993
|
}, null, 8, ["items", "label", "label-attributes", "loading", "model-value", "placeholder", "readonly", "onQueryChange"]),
|
|
1992
|
-
u(
|
|
1994
|
+
u(ae, {
|
|
1993
1995
|
autocomplete: "off",
|
|
1994
1996
|
"data-testid": "upstreams-form-tags",
|
|
1995
1997
|
help: e(l)("upstreams.form.fields.tags.help"),
|
|
@@ -2002,7 +2004,7 @@ const pe = {
|
|
|
2002
2004
|
placeholder: e(l)("upstreams.form.fields.tags.placeholder"),
|
|
2003
2005
|
readonly: a.readonly,
|
|
2004
2006
|
type: "text",
|
|
2005
|
-
"onUpdate:modelValue":
|
|
2007
|
+
"onUpdate:modelValue": K[2] || (K[2] = (te) => k("update:tags", te))
|
|
2006
2008
|
}, null, 8, ["help", "label", "label-attributes", "model-value", "placeholder", "readonly"])
|
|
2007
2009
|
]))
|
|
2008
2010
|
]),
|
|
@@ -2085,7 +2087,7 @@ const pe = {
|
|
|
2085
2087
|
},
|
|
2086
2088
|
emits: ["update:algorithm", "update:sticky-sessions-cookie", "update:sticky-sessions-cookie-path", "update:slots", "update:hash-on", "update:hash-fallback", "update:hash-on-header", "update:hash-on-cookie", "update:hash-on-cookie-path", "update:hash-on-query-argument", "update:hash-on-uri-capture", "update:hash-fallback-header", "update:hash-fallback-query-argument", "update:hash-fallback-uri-capture"],
|
|
2087
2089
|
setup(a, { emit: D }) {
|
|
2088
|
-
const { i18nT: i, i18n: { t: l } } = pe.useI18n(), { inRange: h } = Ve(),
|
|
2090
|
+
const { i18nT: i, i18n: { t: l } } = pe.useI18n(), { inRange: h } = Ve(), k = a, y = D, j = R([
|
|
2089
2091
|
{
|
|
2090
2092
|
label: l("upstreams.form.algorithms.round_robin_label"),
|
|
2091
2093
|
value: "round-robin",
|
|
@@ -2106,12 +2108,12 @@ const pe = {
|
|
|
2106
2108
|
value: "latency",
|
|
2107
2109
|
selected: !1
|
|
2108
2110
|
},
|
|
2109
|
-
...
|
|
2111
|
+
...k.stickySessionsAvailable ? [{
|
|
2110
2112
|
label: l("upstreams.form.algorithms.sticky_sessions_label"),
|
|
2111
2113
|
value: "sticky-sessions",
|
|
2112
2114
|
selected: !1
|
|
2113
2115
|
}] : []
|
|
2114
|
-
]),
|
|
2116
|
+
]), F = R([
|
|
2115
2117
|
{
|
|
2116
2118
|
label: l("upstreams.form.hash_labels.none"),
|
|
2117
2119
|
value: "none",
|
|
@@ -2153,22 +2155,22 @@ const pe = {
|
|
|
2153
2155
|
selected: !1
|
|
2154
2156
|
}
|
|
2155
2157
|
]);
|
|
2156
|
-
de(() =>
|
|
2158
|
+
de(() => k.hashOn, (C, m) => {
|
|
2157
2159
|
m === "header" && C !== m && y("update:hash-on-header", ""), m === "cookie" && C !== m && (y("update:hash-on-cookie", ""), y("update:hash-on-cookie-path", "/")), m === "query_arg" && C !== m && y("update:hash-on-query-argument", ""), m === "uri_capture" && C !== m && y("update:hash-on-uri-capture", ""), (C === "cookie" || C === "none") && (y("update:hash-fallback", "none"), y("update:hash-fallback-header", ""), y("update:hash-fallback-query-argument", ""), y("update:hash-fallback-uri-capture", ""));
|
|
2158
|
-
}), de(() =>
|
|
2160
|
+
}), de(() => k.hashFallback, (C, m) => {
|
|
2159
2161
|
m === "header" && C !== m && y("update:hash-fallback-header", ""), m === "cookie" && C !== m && (y("update:hash-on-cookie", ""), y("update:hash-on-cookie-path", "/")), m === "query_arg" && C !== m && y("update:hash-fallback-query-argument", ""), m === "uri_capture" && C !== m && y("update:hash-fallback-uri-capture", "");
|
|
2160
|
-
}), de(() =>
|
|
2162
|
+
}), de(() => k.algorithm, (C) => {
|
|
2161
2163
|
C === "sticky-sessions" && (y("update:slots", "10000"), y("update:hash-on", "none"), y("update:hash-fallback", "none"), y("update:hash-on-header", ""), y("update:hash-on-cookie", ""), y("update:hash-on-cookie-path", "/"), y("update:hash-on-query-argument", ""), y("update:hash-on-uri-capture", ""), y("update:hash-fallback-header", ""), y("update:hash-fallback-query-argument", ""), y("update:hash-fallback-uri-capture", ""));
|
|
2162
2164
|
}, { immediate: !0 });
|
|
2163
|
-
const s = H(() =>
|
|
2165
|
+
const s = H(() => k.hashOn === "cookie" || k.hashOn === "none"), c = H(() => k.slots ? h(k.slots, Be, Re) ? "" : l("upstreams.form.errors.in_range") : "");
|
|
2164
2166
|
return (C, m) => {
|
|
2165
|
-
const t = $("KExternalLink"),
|
|
2166
|
-
return w(),
|
|
2167
|
+
const t = $("KExternalLink"), V = $("KSelect"), T = $("KInput"), p = $("KCard");
|
|
2168
|
+
return w(), E(e(He), {
|
|
2167
2169
|
class: "kong-ui-entities-upstreams-load-balancing",
|
|
2168
2170
|
title: e(l)("upstreams.form.load_balancing.title")
|
|
2169
2171
|
}, {
|
|
2170
2172
|
description: n(() => [
|
|
2171
|
-
|
|
2173
|
+
_("p", null, [
|
|
2172
2174
|
Q(f(e(l)("upstreams.form.load_balancing.help")) + " ", 1),
|
|
2173
2175
|
u(t, {
|
|
2174
2176
|
"hide-icon": "",
|
|
@@ -2182,7 +2184,7 @@ const pe = {
|
|
|
2182
2184
|
])
|
|
2183
2185
|
]),
|
|
2184
2186
|
default: n(() => [
|
|
2185
|
-
u(
|
|
2187
|
+
u(V, {
|
|
2186
2188
|
class: "algorithm-select",
|
|
2187
2189
|
items: j.value,
|
|
2188
2190
|
label: e(l)("upstreams.form.fields.algorithm.label"),
|
|
@@ -2221,7 +2223,7 @@ const pe = {
|
|
|
2221
2223
|
"onUpdate:modelValue": m[2] || (m[2] = (S) => y("update:sticky-sessions-cookie-path", S))
|
|
2222
2224
|
}, null, 8, ["label", "label-attributes", "model-value", "readonly"])
|
|
2223
2225
|
], 64)) : B("", !0),
|
|
2224
|
-
a.algorithm !== "sticky-sessions" ? (w(),
|
|
2226
|
+
a.algorithm !== "sticky-sessions" ? (w(), E(T, {
|
|
2225
2227
|
key: 1,
|
|
2226
2228
|
autocomplete: "off",
|
|
2227
2229
|
"data-testid": "upstreams-form-slots",
|
|
@@ -2236,20 +2238,20 @@ const pe = {
|
|
|
2236
2238
|
type: "number",
|
|
2237
2239
|
"onUpdate:modelValue": m[3] || (m[3] = (S) => y("update:slots", S))
|
|
2238
2240
|
}, null, 8, ["error", "error-message", "help", "label", "max", "min", "model-value", "readonly"])) : B("", !0),
|
|
2239
|
-
a.algorithm !== "sticky-sessions" ? (w(),
|
|
2241
|
+
a.algorithm !== "sticky-sessions" ? (w(), E(p, { key: 2 }, {
|
|
2240
2242
|
default: n(() => [
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
u(
|
|
2243
|
+
_("h5", ga, f(e(l)("upstreams.form.fields.hash_on.label")), 1),
|
|
2244
|
+
_("p", ba, f(e(l)("upstreams.form.fields.hash_on.help")), 1),
|
|
2245
|
+
u(V, {
|
|
2244
2246
|
class: "hash-on-select",
|
|
2245
|
-
items:
|
|
2247
|
+
items: F.value,
|
|
2246
2248
|
label: e(l)("upstreams.form.fields.hash_on.label"),
|
|
2247
2249
|
"model-value": a.hashOn,
|
|
2248
2250
|
readonly: a.readonly,
|
|
2249
2251
|
width: "100%",
|
|
2250
2252
|
"onUpdate:modelValue": m[4] || (m[4] = (S) => y("update:hash-on", S))
|
|
2251
2253
|
}, null, 8, ["items", "label", "model-value", "readonly"]),
|
|
2252
|
-
a.hashOn === "header" ? (w(),
|
|
2254
|
+
a.hashOn === "header" ? (w(), E(T, {
|
|
2253
2255
|
key: 0,
|
|
2254
2256
|
autocomplete: "off",
|
|
2255
2257
|
class: "margin-top-6",
|
|
@@ -2285,7 +2287,7 @@ const pe = {
|
|
|
2285
2287
|
"onUpdate:modelValue": m[7] || (m[7] = (S) => y("update:hash-on-cookie-path", S))
|
|
2286
2288
|
}, null, 8, ["label", "model-value", "readonly"])
|
|
2287
2289
|
], 64)) : B("", !0),
|
|
2288
|
-
a.hashOn === "query_arg" ? (w(),
|
|
2290
|
+
a.hashOn === "query_arg" ? (w(), E(T, {
|
|
2289
2291
|
key: 2,
|
|
2290
2292
|
autocomplete: "off",
|
|
2291
2293
|
class: "margin-top-6",
|
|
@@ -2297,7 +2299,7 @@ const pe = {
|
|
|
2297
2299
|
type: "text",
|
|
2298
2300
|
"onUpdate:modelValue": m[8] || (m[8] = (S) => y("update:hash-on-query-argument", S))
|
|
2299
2301
|
}, null, 8, ["label", "model-value", "readonly"])) : B("", !0),
|
|
2300
|
-
a.hashOn === "uri_capture" ? (w(),
|
|
2302
|
+
a.hashOn === "uri_capture" ? (w(), E(T, {
|
|
2301
2303
|
key: 3,
|
|
2302
2304
|
autocomplete: "off",
|
|
2303
2305
|
class: "margin-top-6",
|
|
@@ -2312,14 +2314,14 @@ const pe = {
|
|
|
2312
2314
|
]),
|
|
2313
2315
|
_: 1
|
|
2314
2316
|
})) : B("", !0),
|
|
2315
|
-
a.algorithm !== "sticky-sessions" ? (w(),
|
|
2317
|
+
a.algorithm !== "sticky-sessions" ? (w(), E(p, { key: 3 }, {
|
|
2316
2318
|
default: n(() => [
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
u(
|
|
2319
|
+
_("h5", va, f(e(l)("upstreams.form.fields.hash_fallback.label")), 1),
|
|
2320
|
+
_("p", ka, f(e(l)("upstreams.form.fields.hash_fallback.help")), 1),
|
|
2321
|
+
u(V, {
|
|
2320
2322
|
class: "hash-fallback-select",
|
|
2321
2323
|
disabled: s.value,
|
|
2322
|
-
items:
|
|
2324
|
+
items: F.value,
|
|
2323
2325
|
label: e(l)("upstreams.form.fields.hash_fallback.label"),
|
|
2324
2326
|
"label-attributes": { tooltipAttributes: { maxWidth: "400" } },
|
|
2325
2327
|
"model-value": a.hashFallback,
|
|
@@ -2333,17 +2335,17 @@ const pe = {
|
|
|
2333
2335
|
scope: "global"
|
|
2334
2336
|
}, {
|
|
2335
2337
|
hash_on: n(() => [
|
|
2336
|
-
|
|
2338
|
+
_("code", null, f(e(l)("upstreams.form.fields.hash_fallback.hash_on")), 1)
|
|
2337
2339
|
]),
|
|
2338
2340
|
cookie: n(() => [
|
|
2339
|
-
|
|
2341
|
+
_("code", null, f(e(l)("upstreams.form.fields.hash_fallback.cookie")), 1)
|
|
2340
2342
|
]),
|
|
2341
2343
|
_: 1
|
|
2342
2344
|
})
|
|
2343
2345
|
]),
|
|
2344
2346
|
_: 1
|
|
2345
2347
|
}, 8, ["disabled", "items", "label", "model-value", "readonly"]),
|
|
2346
|
-
a.hashFallback === "header" ? (w(),
|
|
2348
|
+
a.hashFallback === "header" ? (w(), E(T, {
|
|
2347
2349
|
key: 0,
|
|
2348
2350
|
autocomplete: "off",
|
|
2349
2351
|
class: "margin-top-6",
|
|
@@ -2379,7 +2381,7 @@ const pe = {
|
|
|
2379
2381
|
"onUpdate:modelValue": m[13] || (m[13] = (S) => y("update:hash-on-cookie-path", S))
|
|
2380
2382
|
}, null, 8, ["label", "model-value", "readonly"])
|
|
2381
2383
|
], 64)) : B("", !0),
|
|
2382
|
-
a.hashFallback === "query_arg" ? (w(),
|
|
2384
|
+
a.hashFallback === "query_arg" ? (w(), E(T, {
|
|
2383
2385
|
key: 2,
|
|
2384
2386
|
autocomplete: "off",
|
|
2385
2387
|
class: "margin-top-6",
|
|
@@ -2391,7 +2393,7 @@ const pe = {
|
|
|
2391
2393
|
type: "text",
|
|
2392
2394
|
"onUpdate:modelValue": m[14] || (m[14] = (S) => y("update:hash-fallback-query-argument", S))
|
|
2393
2395
|
}, null, 8, ["label", "model-value", "readonly"])) : B("", !0),
|
|
2394
|
-
a.hashFallback === "uri_capture" ? (w(),
|
|
2396
|
+
a.hashFallback === "uri_capture" ? (w(), E(T, {
|
|
2395
2397
|
key: 3,
|
|
2396
2398
|
autocomplete: "off",
|
|
2397
2399
|
class: "margin-top-6",
|
|
@@ -2435,14 +2437,14 @@ const pe = {
|
|
|
2435
2437
|
emits: ["update:active-health-switch", "update:passive-health-switch", "update:healthchecks-threshold"],
|
|
2436
2438
|
setup(a, { emit: D }) {
|
|
2437
2439
|
const { i18n: { t: i } } = pe.useI18n(), l = D;
|
|
2438
|
-
return (h,
|
|
2439
|
-
const y = $("KExternalLink"), j = $("KInputSwitch"),
|
|
2440
|
-
return w(),
|
|
2440
|
+
return (h, k) => {
|
|
2441
|
+
const y = $("KExternalLink"), j = $("KInputSwitch"), F = $("KCard"), s = $("KInput");
|
|
2442
|
+
return w(), E(e(He), {
|
|
2441
2443
|
class: "kong-ui-entities-upstreams-healthchecks",
|
|
2442
2444
|
title: e(i)("upstreams.form.health_check.title")
|
|
2443
2445
|
}, {
|
|
2444
2446
|
description: n(() => [
|
|
2445
|
-
|
|
2447
|
+
_("p", null, [
|
|
2446
2448
|
Q(f(e(i)("upstreams.form.health_check.help")) + " ", 1),
|
|
2447
2449
|
u(y, {
|
|
2448
2450
|
"hide-icon": "",
|
|
@@ -2456,30 +2458,30 @@ const pe = {
|
|
|
2456
2458
|
])
|
|
2457
2459
|
]),
|
|
2458
2460
|
default: n(() => [
|
|
2459
|
-
u(
|
|
2461
|
+
u(F, null, {
|
|
2460
2462
|
default: n(() => [
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
+
_("h5", Sa, f(e(i)("upstreams.form.fields.active_health_checks.label")), 1),
|
|
2464
|
+
_("p", Ha, f(e(i)("upstreams.form.fields.active_health_checks.help")), 1),
|
|
2463
2465
|
u(j, {
|
|
2464
2466
|
class: "active-health-switch",
|
|
2465
2467
|
"data-testid": "active-health-switch",
|
|
2466
2468
|
disabled: a.readonly,
|
|
2467
2469
|
"model-value": a.activeHealthSwitch,
|
|
2468
|
-
onChange:
|
|
2470
|
+
onChange: k[0] || (k[0] = (c) => l("update:active-health-switch", c))
|
|
2469
2471
|
}, null, 8, ["disabled", "model-value"])
|
|
2470
2472
|
]),
|
|
2471
2473
|
_: 1
|
|
2472
2474
|
}),
|
|
2473
|
-
u(
|
|
2475
|
+
u(F, null, {
|
|
2474
2476
|
default: n(() => [
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
+
_("h5", Ua, f(e(i)("upstreams.form.fields.passive_health_checks.label")), 1),
|
|
2478
|
+
_("p", Ia, f(e(i)("upstreams.form.fields.passive_health_checks.help")), 1),
|
|
2477
2479
|
u(j, {
|
|
2478
2480
|
class: "passive-health-switch",
|
|
2479
2481
|
"data-testid": "passive-health-switch",
|
|
2480
2482
|
disabled: a.readonly,
|
|
2481
2483
|
"model-value": a.passiveHealthSwitch,
|
|
2482
|
-
onChange:
|
|
2484
|
+
onChange: k[1] || (k[1] = (c) => l("update:passive-health-switch", c))
|
|
2483
2485
|
}, null, 8, ["disabled", "model-value"])
|
|
2484
2486
|
]),
|
|
2485
2487
|
_: 1
|
|
@@ -2493,7 +2495,7 @@ const pe = {
|
|
|
2493
2495
|
"model-value": a.healthchecksThreshold,
|
|
2494
2496
|
readonly: a.readonly,
|
|
2495
2497
|
type: "number",
|
|
2496
|
-
"onUpdate:modelValue":
|
|
2498
|
+
"onUpdate:modelValue": k[2] || (k[2] = (c) => l("update:healthchecks-threshold", c))
|
|
2497
2499
|
}, null, 8, ["label", "max", "min", "model-value", "readonly"])
|
|
2498
2500
|
]),
|
|
2499
2501
|
_: 1
|
|
@@ -2575,7 +2577,7 @@ const pe = {
|
|
|
2575
2577
|
},
|
|
2576
2578
|
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"],
|
|
2577
2579
|
setup(a, { emit: D }) {
|
|
2578
|
-
const { i18n: { t: i } } = pe.useI18n(), { objectsAreEqual: l } = Ve(), h = a,
|
|
2580
|
+
const { i18n: { t: i } } = pe.useI18n(), { objectsAreEqual: l } = Ve(), h = a, k = D, y = R([
|
|
2579
2581
|
{
|
|
2580
2582
|
label: i("upstreams.form.healthcheck_type_labels.http"),
|
|
2581
2583
|
value: "http",
|
|
@@ -2601,15 +2603,15 @@ const pe = {
|
|
|
2601
2603
|
value: "grpcs",
|
|
2602
2604
|
selected: !1
|
|
2603
2605
|
}
|
|
2604
|
-
]), j = H(() => h.type === "https" || h.type === "grpcs"),
|
|
2606
|
+
]), j = H(() => h.type === "https" || h.type === "grpcs"), F = H(() => h.type === "tcp"), {
|
|
2605
2607
|
trackNewItems: s
|
|
2606
2608
|
} = Se({ replaceId: !0 }), {
|
|
2607
2609
|
trackNewItems: c
|
|
2608
2610
|
} = Se({ replaceId: !0 });
|
|
2609
2611
|
de(() => h.type, (T, p) => {
|
|
2610
|
-
p === "tcp" && T !== p &&
|
|
2612
|
+
p === "tcp" && T !== p && k("update:unhealthy-tcp-failures", "5"), (p === "https" || p === "grpcs") && T !== p && (k("update:https-sni", ""), k("update:verify-ssl", !1)), p !== "tcp" && T === "tcp" && (k("update:http-path", "/"), k("update:healthy-http-statuses", $e), k("update:unhealthy-http-statuses", Ae));
|
|
2611
2613
|
});
|
|
2612
|
-
const C =
|
|
2614
|
+
const C = R([{ key: "", values: "" }]);
|
|
2613
2615
|
de(() => h.headers, (T) => {
|
|
2614
2616
|
l(C.value, T) || (C.value = [...T]);
|
|
2615
2617
|
}, {
|
|
@@ -2617,20 +2619,20 @@ const pe = {
|
|
|
2617
2619
|
deep: !0
|
|
2618
2620
|
});
|
|
2619
2621
|
const m = () => {
|
|
2620
|
-
|
|
2622
|
+
k("update:headers", C.value);
|
|
2621
2623
|
}, t = () => {
|
|
2622
2624
|
C.value.push({ key: "", values: "" }), m();
|
|
2623
|
-
},
|
|
2625
|
+
}, V = (T) => {
|
|
2624
2626
|
T === 0 && C.value.length === 1 ? C.value[0] = { key: "", values: "" } : C.value.splice(T, 1), m();
|
|
2625
2627
|
};
|
|
2626
2628
|
return (T, p) => {
|
|
2627
|
-
const S = $("KExternalLink"),
|
|
2628
|
-
return w(),
|
|
2629
|
+
const S = $("KExternalLink"), z = $("KSelect"), M = $("KInput"), Z = $("KCheckbox"), W = $("KLabel"), b = $("KButton"), I = $("KMultiselect"), O = $("KCard");
|
|
2630
|
+
return w(), E(e(He), {
|
|
2629
2631
|
class: "kong-ui-entities-upstreams-active-healthcheck",
|
|
2630
2632
|
title: e(i)("upstreams.form.active_health_check.title")
|
|
2631
2633
|
}, {
|
|
2632
2634
|
description: n(() => [
|
|
2633
|
-
|
|
2635
|
+
_("p", null, [
|
|
2634
2636
|
Q(f(e(i)("upstreams.form.active_health_check.help")) + " ", 1),
|
|
2635
2637
|
u(S, {
|
|
2636
2638
|
"hide-icon": "",
|
|
@@ -2644,16 +2646,16 @@ const pe = {
|
|
|
2644
2646
|
])
|
|
2645
2647
|
]),
|
|
2646
2648
|
default: n(() => [
|
|
2647
|
-
u(
|
|
2649
|
+
u(z, {
|
|
2648
2650
|
class: "active-healthcheck-type-select",
|
|
2649
2651
|
items: y.value,
|
|
2650
2652
|
label: e(i)("upstreams.form.fields.active_healthcheck_type.label"),
|
|
2651
2653
|
"model-value": a.type,
|
|
2652
2654
|
readonly: a.readonly,
|
|
2653
2655
|
width: "100%",
|
|
2654
|
-
"onUpdate:modelValue": p[0] || (p[0] = (g) =>
|
|
2656
|
+
"onUpdate:modelValue": p[0] || (p[0] = (g) => k("update:type", g))
|
|
2655
2657
|
}, null, 8, ["items", "label", "model-value", "readonly"]),
|
|
2656
|
-
|
|
2658
|
+
F.value ? B("", !0) : (w(), E(M, {
|
|
2657
2659
|
key: 0,
|
|
2658
2660
|
autocomplete: "off",
|
|
2659
2661
|
"data-testid": "active-healthcheck-http-path",
|
|
@@ -2661,9 +2663,9 @@ const pe = {
|
|
|
2661
2663
|
"model-value": a.httpPath,
|
|
2662
2664
|
readonly: a.readonly,
|
|
2663
2665
|
type: "text",
|
|
2664
|
-
"onUpdate:modelValue": p[1] || (p[1] = (g) =>
|
|
2666
|
+
"onUpdate:modelValue": p[1] || (p[1] = (g) => k("update:http-path", g))
|
|
2665
2667
|
}, null, 8, ["label", "model-value", "readonly"])),
|
|
2666
|
-
u(
|
|
2668
|
+
u(M, {
|
|
2667
2669
|
autocomplete: "off",
|
|
2668
2670
|
"data-testid": "active-healthcheck-timeout",
|
|
2669
2671
|
label: e(i)("upstreams.form.fields.timeout.label"),
|
|
@@ -2672,9 +2674,9 @@ const pe = {
|
|
|
2672
2674
|
"model-value": a.timeout,
|
|
2673
2675
|
readonly: a.readonly,
|
|
2674
2676
|
type: "number",
|
|
2675
|
-
"onUpdate:modelValue": p[2] || (p[2] = (g) =>
|
|
2677
|
+
"onUpdate:modelValue": p[2] || (p[2] = (g) => k("update:timeout", g))
|
|
2676
2678
|
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
2677
|
-
u(
|
|
2679
|
+
u(M, {
|
|
2678
2680
|
autocomplete: "off",
|
|
2679
2681
|
"data-testid": "active-healthcheck-concurrency",
|
|
2680
2682
|
label: e(i)("upstreams.form.fields.concurrency.label"),
|
|
@@ -2683,10 +2685,10 @@ const pe = {
|
|
|
2683
2685
|
"model-value": a.concurrency,
|
|
2684
2686
|
readonly: a.readonly,
|
|
2685
2687
|
type: "number",
|
|
2686
|
-
"onUpdate:modelValue": p[3] || (p[3] = (g) =>
|
|
2688
|
+
"onUpdate:modelValue": p[3] || (p[3] = (g) => k("update:concurrency", g))
|
|
2687
2689
|
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
2688
2690
|
j.value ? (w(), oe(Ce, { key: 1 }, [
|
|
2689
|
-
u(
|
|
2691
|
+
u(M, {
|
|
2690
2692
|
autocomplete: "off",
|
|
2691
2693
|
class: "margin-bottom-6",
|
|
2692
2694
|
"data-testid": "active-healthcheck-https-sni",
|
|
@@ -2694,18 +2696,18 @@ const pe = {
|
|
|
2694
2696
|
"model-value": a.httpsSni,
|
|
2695
2697
|
readonly: a.readonly,
|
|
2696
2698
|
type: "text",
|
|
2697
|
-
"onUpdate:modelValue": p[4] || (p[4] = (g) =>
|
|
2699
|
+
"onUpdate:modelValue": p[4] || (p[4] = (g) => k("update:https-sni", g))
|
|
2698
2700
|
}, null, 8, ["label", "model-value", "readonly"]),
|
|
2699
|
-
u(
|
|
2701
|
+
u(Z, {
|
|
2700
2702
|
"data-testid": "active-healthcheck-verify-ssl",
|
|
2701
2703
|
disabled: a.readonly,
|
|
2702
2704
|
label: e(i)("upstreams.form.fields.verify_ssl.label"),
|
|
2703
2705
|
"model-value": a.verifySsl,
|
|
2704
|
-
"onUpdate:modelValue": p[5] || (p[5] = (g) =>
|
|
2706
|
+
"onUpdate:modelValue": p[5] || (p[5] = (g) => k("update:verify-ssl", g))
|
|
2705
2707
|
}, null, 8, ["disabled", "label", "model-value"])
|
|
2706
2708
|
], 64)) : B("", !0),
|
|
2707
|
-
|
|
2708
|
-
u(
|
|
2709
|
+
_("div", null, [
|
|
2710
|
+
u(W, {
|
|
2709
2711
|
info: e(i)("upstreams.form.fields.headers.tooltip_active"),
|
|
2710
2712
|
"tooltip-attributes": { maxWidth: "250px" }
|
|
2711
2713
|
}, {
|
|
@@ -2714,36 +2716,36 @@ const pe = {
|
|
|
2714
2716
|
]),
|
|
2715
2717
|
_: 1
|
|
2716
2718
|
}, 8, ["info"]),
|
|
2717
|
-
|
|
2718
|
-
(w(!0), oe(Ce, null, $t(C.value, (g,
|
|
2719
|
-
key: `${g.header}_${
|
|
2720
|
-
class: Pt(["headers-row", { "margin-top-6":
|
|
2719
|
+
_("div", null, [
|
|
2720
|
+
(w(!0), oe(Ce, null, $t(C.value, (g, N) => (w(), oe("div", {
|
|
2721
|
+
key: `${g.header}_${N}`,
|
|
2722
|
+
class: Pt(["headers-row", { "margin-top-6": N > 0 }])
|
|
2721
2723
|
}, [
|
|
2722
|
-
u(
|
|
2723
|
-
modelValue: C.value[
|
|
2724
|
-
"onUpdate:modelValue": (
|
|
2724
|
+
u(M, {
|
|
2725
|
+
modelValue: C.value[N].key,
|
|
2726
|
+
"onUpdate:modelValue": (P) => C.value[N].key = P,
|
|
2725
2727
|
autocomplete: "off",
|
|
2726
|
-
"data-testid": `active-healthcheck-headers-header-${
|
|
2728
|
+
"data-testid": `active-healthcheck-headers-header-${N + 1}`,
|
|
2727
2729
|
readonly: a.readonly,
|
|
2728
2730
|
type: "text",
|
|
2729
2731
|
onBlur: m
|
|
2730
2732
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "readonly"]),
|
|
2731
|
-
u(
|
|
2732
|
-
modelValue: C.value[
|
|
2733
|
-
"onUpdate:modelValue": (
|
|
2733
|
+
u(M, {
|
|
2734
|
+
modelValue: C.value[N].values,
|
|
2735
|
+
"onUpdate:modelValue": (P) => C.value[N].values = P,
|
|
2734
2736
|
autocomplete: "off",
|
|
2735
|
-
"data-testid": `active-healthcheck-headers-value-${
|
|
2737
|
+
"data-testid": `active-healthcheck-headers-value-${N + 1}`,
|
|
2736
2738
|
readonly: a.readonly,
|
|
2737
2739
|
type: "text",
|
|
2738
2740
|
onBlur: m
|
|
2739
2741
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "readonly"]),
|
|
2740
|
-
u(
|
|
2742
|
+
u(b, {
|
|
2741
2743
|
appearance: "tertiary",
|
|
2742
2744
|
class: "btn-remove",
|
|
2743
2745
|
"data-testid": "btn-remove-header",
|
|
2744
2746
|
disabled: C.value.length === 1,
|
|
2745
2747
|
icon: "",
|
|
2746
|
-
onClick: (
|
|
2748
|
+
onClick: (P) => V(N)
|
|
2747
2749
|
}, {
|
|
2748
2750
|
default: n(() => [
|
|
2749
2751
|
u(e(Bt), {
|
|
@@ -2753,7 +2755,7 @@ const pe = {
|
|
|
2753
2755
|
]),
|
|
2754
2756
|
_: 2
|
|
2755
2757
|
}, 1032, ["disabled", "onClick"]),
|
|
2756
|
-
C.value &&
|
|
2758
|
+
C.value && N === C.value.length - 1 ? (w(), E(b, {
|
|
2757
2759
|
key: 0,
|
|
2758
2760
|
appearance: "tertiary",
|
|
2759
2761
|
class: "btn-add-header",
|
|
@@ -2769,11 +2771,11 @@ const pe = {
|
|
|
2769
2771
|
], 2))), 128))
|
|
2770
2772
|
])
|
|
2771
2773
|
]),
|
|
2772
|
-
u(
|
|
2774
|
+
u(O, null, {
|
|
2773
2775
|
default: n(() => [
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
u(
|
|
2776
|
+
_("h5", Fa, f(e(i)("upstreams.form.healthy.label")), 1),
|
|
2777
|
+
_("p", xa, f(e(i)("upstreams.form.healthy.help")), 1),
|
|
2778
|
+
u(M, {
|
|
2777
2779
|
autocomplete: "off",
|
|
2778
2780
|
class: "margin-bottom-6",
|
|
2779
2781
|
"data-testid": "active-healthcheck-healthy-interval",
|
|
@@ -2784,9 +2786,9 @@ const pe = {
|
|
|
2784
2786
|
"model-value": a.healthyInterval,
|
|
2785
2787
|
readonly: a.readonly,
|
|
2786
2788
|
type: "number",
|
|
2787
|
-
"onUpdate:modelValue": p[6] || (p[6] = (g) =>
|
|
2789
|
+
"onUpdate:modelValue": p[6] || (p[6] = (g) => k("update:healthy-interval", g))
|
|
2788
2790
|
}, null, 8, ["help", "label", "max", "min", "model-value", "readonly"]),
|
|
2789
|
-
u(
|
|
2791
|
+
u(M, {
|
|
2790
2792
|
autocomplete: "off",
|
|
2791
2793
|
"data-testid": "active-healthcheck-healthy-successes",
|
|
2792
2794
|
label: e(i)("upstreams.form.fields.successes.label"),
|
|
@@ -2795,9 +2797,9 @@ const pe = {
|
|
|
2795
2797
|
"model-value": a.healthySuccesses,
|
|
2796
2798
|
readonly: a.readonly,
|
|
2797
2799
|
type: "number",
|
|
2798
|
-
"onUpdate:modelValue": p[7] || (p[7] = (g) =>
|
|
2800
|
+
"onUpdate:modelValue": p[7] || (p[7] = (g) => k("update:healthy-successes", g))
|
|
2799
2801
|
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
2800
|
-
|
|
2802
|
+
F.value ? B("", !0) : (w(), E(I, {
|
|
2801
2803
|
key: 0,
|
|
2802
2804
|
autocomplete: "off",
|
|
2803
2805
|
class: "margin-top-6 active-healthcheck-healthy-http-statuses",
|
|
@@ -2810,16 +2812,16 @@ const pe = {
|
|
|
2810
2812
|
width: "100%",
|
|
2811
2813
|
onItemAdded: p[8] || (p[8] = (g) => e(s)(g, !0)),
|
|
2812
2814
|
onItemRemoved: p[9] || (p[9] = (g) => e(s)(g, !1)),
|
|
2813
|
-
"onUpdate:modelValue": p[10] || (p[10] = (g) =>
|
|
2815
|
+
"onUpdate:modelValue": p[10] || (p[10] = (g) => k("update:healthy-http-statuses", g))
|
|
2814
2816
|
}, null, 8, ["items", "label", "model-value", "readonly"]))
|
|
2815
2817
|
]),
|
|
2816
2818
|
_: 1
|
|
2817
2819
|
}),
|
|
2818
|
-
u(
|
|
2820
|
+
u(O, null, {
|
|
2819
2821
|
default: n(() => [
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
u(
|
|
2822
|
+
_("h5", Oa, f(e(i)("upstreams.form.unhealthy.label")), 1),
|
|
2823
|
+
_("p", $a, f(e(i)("upstreams.form.unhealthy.help")), 1),
|
|
2824
|
+
u(M, {
|
|
2823
2825
|
autocomplete: "off",
|
|
2824
2826
|
class: "margin-bottom-6",
|
|
2825
2827
|
"data-testid": "active-healthcheck-unhealthy-interval",
|
|
@@ -2830,9 +2832,9 @@ const pe = {
|
|
|
2830
2832
|
"model-value": a.unhealthyInterval,
|
|
2831
2833
|
readonly: a.readonly,
|
|
2832
2834
|
type: "number",
|
|
2833
|
-
"onUpdate:modelValue": p[11] || (p[11] = (g) =>
|
|
2835
|
+
"onUpdate:modelValue": p[11] || (p[11] = (g) => k("update:unhealthy-interval", g))
|
|
2834
2836
|
}, null, 8, ["help", "label", "max", "min", "model-value", "readonly"]),
|
|
2835
|
-
u(
|
|
2837
|
+
u(M, {
|
|
2836
2838
|
autocomplete: "off",
|
|
2837
2839
|
class: "margin-bottom-6",
|
|
2838
2840
|
"data-testid": "active-healthcheck-unhealthy-tcp-failures",
|
|
@@ -2842,9 +2844,9 @@ const pe = {
|
|
|
2842
2844
|
"model-value": a.unhealthyTcpFailures,
|
|
2843
2845
|
readonly: a.readonly,
|
|
2844
2846
|
type: "number",
|
|
2845
|
-
"onUpdate:modelValue": p[12] || (p[12] = (g) =>
|
|
2847
|
+
"onUpdate:modelValue": p[12] || (p[12] = (g) => k("update:unhealthy-tcp-failures", g))
|
|
2846
2848
|
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
2847
|
-
|
|
2849
|
+
F.value ? B("", !0) : (w(), E(M, {
|
|
2848
2850
|
key: 0,
|
|
2849
2851
|
autocomplete: "off",
|
|
2850
2852
|
class: "margin-bottom-6",
|
|
@@ -2855,9 +2857,9 @@ const pe = {
|
|
|
2855
2857
|
"model-value": a.unhealthyHttpFailures,
|
|
2856
2858
|
readonly: a.readonly,
|
|
2857
2859
|
type: "number",
|
|
2858
|
-
"onUpdate:modelValue": p[13] || (p[13] = (g) =>
|
|
2860
|
+
"onUpdate:modelValue": p[13] || (p[13] = (g) => k("update:unhealthy-http-failures", g))
|
|
2859
2861
|
}, null, 8, ["label", "max", "min", "model-value", "readonly"])),
|
|
2860
|
-
|
|
2862
|
+
F.value ? B("", !0) : (w(), E(I, {
|
|
2861
2863
|
key: 1,
|
|
2862
2864
|
autocomplete: "off",
|
|
2863
2865
|
class: "margin-bottom-6 active-healthcheck-unhealthy-http-statuses",
|
|
@@ -2870,9 +2872,9 @@ const pe = {
|
|
|
2870
2872
|
width: "100%",
|
|
2871
2873
|
onItemAdded: p[14] || (p[14] = (g) => e(c)(g, !0)),
|
|
2872
2874
|
onItemRemoved: p[15] || (p[15] = (g) => e(c)(g, !1)),
|
|
2873
|
-
"onUpdate:modelValue": p[16] || (p[16] = (g) =>
|
|
2875
|
+
"onUpdate:modelValue": p[16] || (p[16] = (g) => k("update:unhealthy-http-statuses", g))
|
|
2874
2876
|
}, null, 8, ["items", "label", "model-value", "readonly"])),
|
|
2875
|
-
u(
|
|
2877
|
+
u(M, {
|
|
2876
2878
|
autocomplete: "off",
|
|
2877
2879
|
"data-testid": "active-healthcheck-unhealthy-timeouts",
|
|
2878
2880
|
label: e(i)("upstreams.form.fields.timeouts.label"),
|
|
@@ -2881,7 +2883,7 @@ const pe = {
|
|
|
2881
2883
|
"model-value": a.unhealthyTimeouts,
|
|
2882
2884
|
readonly: a.readonly,
|
|
2883
2885
|
type: "number",
|
|
2884
|
-
"onUpdate:modelValue": p[17] || (p[17] = (g) =>
|
|
2886
|
+
"onUpdate:modelValue": p[17] || (p[17] = (g) => k("update:unhealthy-timeouts", g))
|
|
2885
2887
|
}, null, 8, ["label", "max", "min", "model-value", "readonly"])
|
|
2886
2888
|
]),
|
|
2887
2889
|
_: 1
|
|
@@ -2930,7 +2932,7 @@ const pe = {
|
|
|
2930
2932
|
},
|
|
2931
2933
|
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"],
|
|
2932
2934
|
setup(a, { emit: D }) {
|
|
2933
|
-
const { i18n: { t: i } } = pe.useI18n(), l = a, h = D,
|
|
2935
|
+
const { i18n: { t: i } } = pe.useI18n(), l = a, h = D, k = R([
|
|
2934
2936
|
{
|
|
2935
2937
|
label: i("upstreams.form.healthcheck_type_labels.http"),
|
|
2936
2938
|
value: "http",
|
|
@@ -2959,18 +2961,18 @@ const pe = {
|
|
|
2959
2961
|
]), y = H(() => l.type === "tcp"), {
|
|
2960
2962
|
trackNewItems: j
|
|
2961
2963
|
} = Se({ replaceId: !0 }), {
|
|
2962
|
-
trackNewItems:
|
|
2964
|
+
trackNewItems: F
|
|
2963
2965
|
} = Se({ replaceId: !0 });
|
|
2964
2966
|
return de(() => l.type, (s, c) => {
|
|
2965
2967
|
c === "tcp" && s !== c && h("update:unhealthy-tcp-failures", "5"), c !== "tcp" && s === "tcp" && (h("update:healthy-http-statuses", Pe), h("update:unhealthy-http-statuses", Me));
|
|
2966
2968
|
}), (s, c) => {
|
|
2967
|
-
const C = $("KExternalLink"), m = $("KSelect"), t = $("KInput"),
|
|
2968
|
-
return w(),
|
|
2969
|
+
const C = $("KExternalLink"), m = $("KSelect"), t = $("KInput"), V = $("KMultiselect"), T = $("KCard");
|
|
2970
|
+
return w(), E(e(He), {
|
|
2969
2971
|
class: "kong-ui-entities-upstreams-passive-healthcheck",
|
|
2970
2972
|
title: e(i)("upstreams.form.passive_health_check.title")
|
|
2971
2973
|
}, {
|
|
2972
2974
|
description: n(() => [
|
|
2973
|
-
|
|
2975
|
+
_("p", null, [
|
|
2974
2976
|
Q(f(e(i)("upstreams.form.passive_health_check.help")) + " ", 1),
|
|
2975
2977
|
u(C, {
|
|
2976
2978
|
"hide-icon": "",
|
|
@@ -2986,7 +2988,7 @@ const pe = {
|
|
|
2986
2988
|
default: n(() => [
|
|
2987
2989
|
u(m, {
|
|
2988
2990
|
class: "passive-healthcheck-type-select",
|
|
2989
|
-
items:
|
|
2991
|
+
items: k.value,
|
|
2990
2992
|
label: e(i)("upstreams.form.fields.passive_health_check_type.label"),
|
|
2991
2993
|
"model-value": a.type,
|
|
2992
2994
|
readonly: a.readonly,
|
|
@@ -2995,8 +2997,8 @@ const pe = {
|
|
|
2995
2997
|
}, null, 8, ["items", "label", "model-value", "readonly"]),
|
|
2996
2998
|
u(T, null, {
|
|
2997
2999
|
default: n(() => [
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
+
_("h5", Ma, f(e(i)("upstreams.form.passive_healthy.label")), 1),
|
|
3001
|
+
_("p", Ka, f(e(i)("upstreams.form.passive_healthy.help")), 1),
|
|
3000
3002
|
u(t, {
|
|
3001
3003
|
autocomplete: "off",
|
|
3002
3004
|
"data-testid": "passive-healthcheck-healthy-successes",
|
|
@@ -3008,7 +3010,7 @@ const pe = {
|
|
|
3008
3010
|
type: "number",
|
|
3009
3011
|
"onUpdate:modelValue": c[1] || (c[1] = (p) => h("update:healthy-successes", p))
|
|
3010
3012
|
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
3011
|
-
y.value ? B("", !0) : (w(), V
|
|
3013
|
+
y.value ? B("", !0) : (w(), E(V, {
|
|
3012
3014
|
key: 0,
|
|
3013
3015
|
class: "margin-top-6 passive-healthcheck-healthy-http-statuses",
|
|
3014
3016
|
"enable-item-creation": "",
|
|
@@ -3026,8 +3028,8 @@ const pe = {
|
|
|
3026
3028
|
}),
|
|
3027
3029
|
u(T, null, {
|
|
3028
3030
|
default: n(() => [
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
+
_("h5", Va, f(e(i)("upstreams.form.passive_unhealthy.label")), 1),
|
|
3032
|
+
_("p", Ea, f(e(i)("upstreams.form.passive_unhealthy.help")), 1),
|
|
3031
3033
|
u(t, {
|
|
3032
3034
|
autocomplete: "off",
|
|
3033
3035
|
"data-testid": "passive-healthcheck-unhealthy-timeouts",
|
|
@@ -3051,7 +3053,7 @@ const pe = {
|
|
|
3051
3053
|
type: "number",
|
|
3052
3054
|
"onUpdate:modelValue": c[6] || (c[6] = (p) => h("update:unhealthy-tcp-failures", p))
|
|
3053
3055
|
}, null, 8, ["label", "max", "min", "model-value", "readonly"]),
|
|
3054
|
-
y.value ? B("", !0) : (w(),
|
|
3056
|
+
y.value ? B("", !0) : (w(), E(t, {
|
|
3055
3057
|
key: 0,
|
|
3056
3058
|
autocomplete: "off",
|
|
3057
3059
|
class: "margin-top-6",
|
|
@@ -3064,7 +3066,7 @@ const pe = {
|
|
|
3064
3066
|
type: "number",
|
|
3065
3067
|
"onUpdate:modelValue": c[7] || (c[7] = (p) => h("update:unhealthy-http-failures", p))
|
|
3066
3068
|
}, null, 8, ["label", "max", "min", "model-value", "readonly"])),
|
|
3067
|
-
y.value ? B("", !0) : (w(), V
|
|
3069
|
+
y.value ? B("", !0) : (w(), E(V, {
|
|
3068
3070
|
key: 1,
|
|
3069
3071
|
autocomplete: "off",
|
|
3070
3072
|
class: "margin-top-6 passive-healthcheck-unhealthy-http-statuses",
|
|
@@ -3075,8 +3077,8 @@ const pe = {
|
|
|
3075
3077
|
"model-value": a.unhealthyHttpStatuses,
|
|
3076
3078
|
readonly: a.readonly,
|
|
3077
3079
|
width: "100%",
|
|
3078
|
-
onItemAdded: c[8] || (c[8] = (p) => e(
|
|
3079
|
-
onItemRemoved: c[9] || (c[9] = (p) => e(
|
|
3080
|
+
onItemAdded: c[8] || (c[8] = (p) => e(F)(p, !0)),
|
|
3081
|
+
onItemRemoved: c[9] || (c[9] = (p) => e(F)(p, !1)),
|
|
3080
3082
|
"onUpdate:modelValue": c[10] || (c[10] = (p) => h("update:unhealthy-http-statuses", p))
|
|
3081
3083
|
}, null, 8, ["items", "label", "model-value", "readonly"]))
|
|
3082
3084
|
]),
|
|
@@ -3105,28 +3107,28 @@ const pe = {
|
|
|
3105
3107
|
},
|
|
3106
3108
|
emits: ["update", "error", "loading"],
|
|
3107
3109
|
setup(a, { emit: D }) {
|
|
3108
|
-
var
|
|
3109
|
-
const i = a, l = D, { inRange: h, stringToNumberArray:
|
|
3110
|
+
var X;
|
|
3111
|
+
const i = a, l = D, { inRange: h, stringToNumberArray: k, upstreamsResponseToFields: y, getDefaultUpstreamFields: j, objectsAreEqual: F, cloneDeep: s } = Ve(), { axiosInstance: c } = Ke((X = i.config) == null ? void 0 : X.axiosRequestConfig), { getMessageFromError: C } = qt(), m = Tt(), t = Fe({
|
|
3110
3112
|
fields: j(),
|
|
3111
3113
|
readonly: !1,
|
|
3112
3114
|
errorMessage: ""
|
|
3113
|
-
}),
|
|
3115
|
+
}), V = Fe(j()), T = H(() => !F(t.fields, V)), p = (d) => {
|
|
3114
3116
|
t.fields.activeHealthCheck.healthy.interval = d ? "5" : "0", t.fields.activeHealthCheck.healthy.successes = d ? "5" : "0", t.fields.activeHealthCheck.healthy.httpStatuses = d ? $e : [], t.fields.activeHealthCheck.unhealthy.httpStatuses = d ? Ae : [], 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";
|
|
3115
3117
|
}, S = (d) => {
|
|
3116
3118
|
t.fields.passiveHealthCheck.healthy.successes = d ? "80" : "0", t.fields.passiveHealthCheck.healthy.httpStatuses = d ? Pe : [], 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 ? Me : [], t.fields.passiveHealthCheck.type = "http";
|
|
3117
|
-
},
|
|
3119
|
+
}, z = H(() => t.fields.algorithm !== "sticky-sessions" ? !0 : !!t.fields.stickySessionsCookie && !!t.fields.stickySessionsCookiePath), M = H(() => t.fields.slots ? h(t.fields.slots, Be, Re) : !0), Z = H(() => t.fields.hashOn === "header" ? !!t.fields.hashOnHeader : !0), W = H(() => t.fields.hashOn === "cookie" || t.fields.hashFallback === "cookie" ? !!t.fields.hashOnCookie : !0), b = H(() => t.fields.hashOn === "cookie" || t.fields.hashFallback === "cookie" ? !!t.fields.hashOnCookiePath : !0), I = H(() => t.fields.hashOn === "query_arg" ? !!t.fields.hashOnQueryArgument : !0), O = H(() => t.fields.hashOn === "uri_capture" ? !!t.fields.hashOnUriCapture : !0), g = H(() => t.fields.hashFallback === "header" ? !!t.fields.hashFallbackHeader : !0), N = H(() => t.fields.hashFallback === "query_arg" ? !!t.fields.hashFallbackQueryArgument : !0), P = H(() => t.fields.hashFallback === "uri_capture" ? !!t.fields.hashFallbackUriCapture : !0), le = H(() => !!t.fields.name && z.value && M.value && Z.value && W.value && b.value && I.value && O.value && g.value && N.value && P.value), G = H(() => i.upstreamId ? ue.Edit : ue.Create), re = H(() => {
|
|
3118
3120
|
var d, o;
|
|
3119
3121
|
return (o = _e.form[(d = i.config) == null ? void 0 : d.app]) == null ? void 0 : o.edit;
|
|
3120
|
-
}),
|
|
3121
|
-
Object.assign(t.fields, y(d)), Object.assign(
|
|
3122
|
-
},
|
|
3122
|
+
}), A = (d) => {
|
|
3123
|
+
Object.assign(t.fields, y(d)), Object.assign(V, s(t.fields));
|
|
3124
|
+
}, K = () => {
|
|
3123
3125
|
var d;
|
|
3124
3126
|
m.push(((d = i.config) == null ? void 0 : d.cancelRoute) || { name: "upstreams-list" });
|
|
3125
3127
|
}, ee = (d) => {
|
|
3126
3128
|
l("loading", d);
|
|
3127
3129
|
}, se = (d) => {
|
|
3128
3130
|
l("error", d);
|
|
3129
|
-
},
|
|
3131
|
+
}, ae = H(() => {
|
|
3130
3132
|
const d = i.config.stickySessionsAvailable ? {
|
|
3131
3133
|
sticky_sessions_cookie: null,
|
|
3132
3134
|
sticky_sessions_cookie_path: null
|
|
@@ -3138,7 +3140,7 @@ const pe = {
|
|
|
3138
3140
|
}), U = H(() => {
|
|
3139
3141
|
var o, r, J;
|
|
3140
3142
|
if (!t.fields.activeHealthSwitch)
|
|
3141
|
-
return ((o = i.config) == null ? void 0 : o.app) === "kongManager" &&
|
|
3143
|
+
return ((o = i.config) == null ? void 0 : o.app) === "kongManager" && G.value === ue.Edit ? {
|
|
3142
3144
|
type: t.fields.activeHealthCheck.type,
|
|
3143
3145
|
headers: {},
|
|
3144
3146
|
healthy: {
|
|
@@ -3168,22 +3170,22 @@ const pe = {
|
|
|
3168
3170
|
};
|
|
3169
3171
|
if (t.fields.activeHealthCheck.type !== "tcp") {
|
|
3170
3172
|
d.http_path = t.fields.activeHealthCheck.httpPath || "/", d.unhealthy.http_failures = Number(t.fields.activeHealthCheck.unhealthy.httpFailures || "5");
|
|
3171
|
-
const
|
|
3172
|
-
d.unhealthy.http_statuses =
|
|
3173
|
+
const Y = (r = t.fields.activeHealthCheck.unhealthy.httpStatuses) != null && r.length ? t.fields.activeHealthCheck.unhealthy.httpStatuses : Ae;
|
|
3174
|
+
d.unhealthy.http_statuses = k(Y);
|
|
3173
3175
|
const ie = (J = t.fields.activeHealthCheck.healthy.httpStatuses) != null && J.length ? t.fields.activeHealthCheck.healthy.httpStatuses : $e;
|
|
3174
|
-
d.healthy.http_statuses =
|
|
3176
|
+
d.healthy.http_statuses = k(ie);
|
|
3175
3177
|
}
|
|
3176
|
-
return ["https", "grpcs"].includes(t.fields.activeHealthCheck.type) && (d.https_sni = t.fields.activeHealthCheck.httpsSni || null, d.https_verify_certificate = t.fields.activeHealthCheck.verifySsl), d.headers = t.fields.activeHealthCheck.headers.reduce((
|
|
3178
|
+
return ["https", "grpcs"].includes(t.fields.activeHealthCheck.type) && (d.https_sni = t.fields.activeHealthCheck.httpsSni || null, d.https_verify_certificate = t.fields.activeHealthCheck.verifySsl), d.headers = t.fields.activeHealthCheck.headers.reduce((Y, ie) => {
|
|
3177
3179
|
var fe, ye;
|
|
3178
3180
|
return ie.key ? {
|
|
3179
|
-
...
|
|
3181
|
+
...Y,
|
|
3180
3182
|
[ie.key]: (ye = (fe = ie.values.split(",")) == null ? void 0 : fe.map((Ue) => Ue.trim())) == null ? void 0 : ye.filter(Boolean)
|
|
3181
|
-
} :
|
|
3183
|
+
} : Y;
|
|
3182
3184
|
}, {}), d;
|
|
3183
3185
|
}), L = H(() => {
|
|
3184
3186
|
var o, r, J;
|
|
3185
3187
|
if (!t.fields.passiveHealthSwitch)
|
|
3186
|
-
return ((o = i.config) == null ? void 0 : o.app) === "kongManager" &&
|
|
3188
|
+
return ((o = i.config) == null ? void 0 : o.app) === "kongManager" && G.value === ue.Edit ? {
|
|
3187
3189
|
type: t.fields.passiveHealthCheck.type,
|
|
3188
3190
|
healthy: { successes: 0 },
|
|
3189
3191
|
unhealthy: {
|
|
@@ -3204,13 +3206,13 @@ const pe = {
|
|
|
3204
3206
|
};
|
|
3205
3207
|
if (t.fields.passiveHealthCheck.type !== "tcp") {
|
|
3206
3208
|
d.unhealthy.http_failures = Number(t.fields.passiveHealthCheck.unhealthy.httpFailures || "5");
|
|
3207
|
-
const
|
|
3208
|
-
d.healthy.http_statuses =
|
|
3209
|
+
const Y = (r = t.fields.passiveHealthCheck.healthy.httpStatuses) != null && r.length ? t.fields.passiveHealthCheck.healthy.httpStatuses : Pe;
|
|
3210
|
+
d.healthy.http_statuses = k(Y);
|
|
3209
3211
|
const ie = (J = t.fields.passiveHealthCheck.unhealthy.httpStatuses) != null && J.length ? t.fields.passiveHealthCheck.unhealthy.httpStatuses : Me;
|
|
3210
|
-
d.unhealthy.http_statuses =
|
|
3212
|
+
d.unhealthy.http_statuses = k(ie);
|
|
3211
3213
|
}
|
|
3212
3214
|
return d;
|
|
3213
|
-
}),
|
|
3215
|
+
}), v = H(() => {
|
|
3214
3216
|
const d = {
|
|
3215
3217
|
name: t.fields.name,
|
|
3216
3218
|
slots: Number(t.fields.slots),
|
|
@@ -3224,24 +3226,24 @@ const pe = {
|
|
|
3224
3226
|
client_certificate: t.fields.clientCertificate ? { id: t.fields.clientCertificate } : null
|
|
3225
3227
|
}, o = U.value, r = L.value, J = {
|
|
3226
3228
|
...d,
|
|
3227
|
-
...
|
|
3229
|
+
...ae.value,
|
|
3228
3230
|
healthchecks: {
|
|
3229
3231
|
...d.healthchecks,
|
|
3230
3232
|
active: o || void 0,
|
|
3231
3233
|
passive: r || void 0
|
|
3232
3234
|
}
|
|
3233
3235
|
};
|
|
3234
|
-
return J.tags = t.fields.tags ? t.fields.tags.split(",").map((
|
|
3235
|
-
}),
|
|
3236
|
-
var r, J,
|
|
3236
|
+
return J.tags = t.fields.tags ? t.fields.tags.split(",").map((Y) => String(Y || "").trim()).filter((Y) => Y !== "") : [], Object.assign(J, te.value), J;
|
|
3237
|
+
}), q = (d) => {
|
|
3238
|
+
var r, J, Y, ie, fe, ye;
|
|
3237
3239
|
let o = `${(r = i.config) == null ? void 0 : r.apiBaseUrl}${_e.form[(J = i.config) == null ? void 0 : J.app][d]}`;
|
|
3238
|
-
return ((
|
|
3239
|
-
},
|
|
3240
|
+
return ((Y = i.config) == null ? void 0 : Y.app) === "konnect" ? o = o.replace(/{controlPlaneId}/gi, ((ie = i.config) == null ? void 0 : ie.controlPlaneId) || "") : ((fe = i.config) == null ? void 0 : fe.app) === "kongManager" && (o = o.replace(/\/{workspace}/gi, (ye = i.config) != null && ye.workspace ? `/${i.config.workspace}` : "")), o = o.replace(/{id}/gi, i.upstreamId), o;
|
|
3241
|
+
}, x = async () => {
|
|
3240
3242
|
var d;
|
|
3241
3243
|
try {
|
|
3242
|
-
t.readonly = !0, await c.post(
|
|
3244
|
+
t.readonly = !0, await c.post(q("validate"), v.value);
|
|
3243
3245
|
let o;
|
|
3244
|
-
|
|
3246
|
+
G.value === ue.Create ? o = await c.post(q("create"), v.value) : G.value === ue.Edit && (o = ((d = i.config) == null ? void 0 : d.app) === "konnect" ? await c.put(q("edit"), v.value) : await c.patch(q("edit"), v.value)), l("update", o == null ? void 0 : o.data);
|
|
3245
3247
|
} catch (o) {
|
|
3246
3248
|
t.errorMessage = C(o), l("error", o);
|
|
3247
3249
|
} finally {
|
|
@@ -3250,19 +3252,19 @@ const pe = {
|
|
|
3250
3252
|
};
|
|
3251
3253
|
return (d, o) => (w(), oe("div", Ra, [
|
|
3252
3254
|
u(e(wt), {
|
|
3253
|
-
"can-submit":
|
|
3255
|
+
"can-submit": le.value && T.value,
|
|
3254
3256
|
config: a.config,
|
|
3255
3257
|
"edit-id": a.upstreamId,
|
|
3256
3258
|
"entity-type": e(Le).Upstream,
|
|
3257
3259
|
"error-message": t.errorMessage,
|
|
3258
3260
|
"fetch-url": re.value,
|
|
3259
|
-
"form-fields":
|
|
3261
|
+
"form-fields": v.value,
|
|
3260
3262
|
"is-readonly": t.readonly,
|
|
3261
|
-
onCancel:
|
|
3263
|
+
onCancel: K,
|
|
3262
3264
|
"onFetch:error": se,
|
|
3263
|
-
"onFetch:success":
|
|
3265
|
+
"onFetch:success": A,
|
|
3264
3266
|
onLoading: ee,
|
|
3265
|
-
onSubmit:
|
|
3267
|
+
onSubmit: x
|
|
3266
3268
|
}, {
|
|
3267
3269
|
default: n(() => [
|
|
3268
3270
|
u(ya, {
|
|
@@ -3324,7 +3326,7 @@ const pe = {
|
|
|
3324
3326
|
],
|
|
3325
3327
|
readonly: t.readonly
|
|
3326
3328
|
}, null, 8, ["active-health-switch", "healthchecks-threshold", "passive-health-switch", "readonly"]),
|
|
3327
|
-
t.fields.activeHealthSwitch ? (w(),
|
|
3329
|
+
t.fields.activeHealthSwitch ? (w(), E(Aa, {
|
|
3328
3330
|
key: 0,
|
|
3329
3331
|
concurrency: t.fields.activeHealthCheck.concurrency,
|
|
3330
3332
|
"onUpdate:concurrency": o[21] || (o[21] = (r) => t.fields.activeHealthCheck.concurrency = r),
|
|
@@ -3359,7 +3361,7 @@ const pe = {
|
|
|
3359
3361
|
config: a.config,
|
|
3360
3362
|
readonly: t.readonly
|
|
3361
3363
|
}, null, 8, ["concurrency", "headers", "healthy-http-statuses", "healthy-interval", "healthy-successes", "http-path", "https-sni", "timeout", "type", "unhealthy-http-failures", "unhealthy-http-statuses", "unhealthy-interval", "unhealthy-tcp-failures", "unhealthy-timeouts", "verify-ssl", "config", "readonly"])) : B("", !0),
|
|
3362
|
-
t.fields.passiveHealthSwitch ? (w(),
|
|
3364
|
+
t.fields.passiveHealthSwitch ? (w(), E(Ba, {
|
|
3363
3365
|
key: 1,
|
|
3364
3366
|
"healthy-http-statuses": t.fields.passiveHealthCheck.healthy.httpStatuses,
|
|
3365
3367
|
"onUpdate:healthyHttpStatuses": o[36] || (o[36] = (r) => t.fields.passiveHealthCheck.healthy.httpStatuses = r),
|
|
@@ -3409,7 +3411,7 @@ const pe = {
|
|
|
3409
3411
|
},
|
|
3410
3412
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
3411
3413
|
setup(a) {
|
|
3412
|
-
const D = a, { i18n: { t: i }, i18nT: l } = pe.useI18n(), { getPropValue: h } = Kt(),
|
|
3414
|
+
const D = a, { i18n: { t: i }, i18nT: l } = pe.useI18n(), { getPropValue: h } = Kt(), k = H(() => _e.form[D.config.app].edit), y = R({
|
|
3413
3415
|
id: {},
|
|
3414
3416
|
name: {},
|
|
3415
3417
|
created_at: {},
|
|
@@ -3483,17 +3485,17 @@ const pe = {
|
|
|
3483
3485
|
tooltip: i("upstreams.form.hash_tooltips.client_certificate")
|
|
3484
3486
|
}
|
|
3485
3487
|
});
|
|
3486
|
-
return (j,
|
|
3488
|
+
return (j, F) => (w(), oe("div", null, [
|
|
3487
3489
|
u(e(Et), {
|
|
3488
3490
|
config: a.config,
|
|
3489
3491
|
"config-card-doc": a.configCardDoc,
|
|
3490
3492
|
"config-schema": y.value,
|
|
3491
3493
|
"entity-type": e(Le).Upstream,
|
|
3492
|
-
"fetch-url":
|
|
3494
|
+
"fetch-url": k.value,
|
|
3493
3495
|
"hide-title": a.hideTitle,
|
|
3494
|
-
"onFetch:error":
|
|
3495
|
-
"onFetch:success":
|
|
3496
|
-
onLoading:
|
|
3496
|
+
"onFetch:error": F[0] || (F[0] = (s) => j.$emit("fetch:error", s)),
|
|
3497
|
+
"onFetch:success": F[1] || (F[1] = (s) => j.$emit("fetch:success", s)),
|
|
3498
|
+
onLoading: F[2] || (F[2] = (s) => j.$emit("loading", s))
|
|
3497
3499
|
}, {
|
|
3498
3500
|
"name-label-tooltip": n(() => [
|
|
3499
3501
|
u(e(l), {
|
|
@@ -3501,7 +3503,7 @@ const pe = {
|
|
|
3501
3503
|
scope: "global"
|
|
3502
3504
|
}, {
|
|
3503
3505
|
host: n(() => [
|
|
3504
|
-
|
|
3506
|
+
_("code", null, f(e(i)("upstreams.form.fields.name.host")), 1)
|
|
3505
3507
|
]),
|
|
3506
3508
|
_: 1
|
|
3507
3509
|
})
|
|
@@ -3512,7 +3514,7 @@ const pe = {
|
|
|
3512
3514
|
scope: "global"
|
|
3513
3515
|
}, {
|
|
3514
3516
|
result: n(() => [
|
|
3515
|
-
|
|
3517
|
+
_("code", null, f(s.value), 1)
|
|
3516
3518
|
]),
|
|
3517
3519
|
_: 2
|
|
3518
3520
|
}, 1024)
|
|
@@ -3523,10 +3525,10 @@ const pe = {
|
|
|
3523
3525
|
scope: "global"
|
|
3524
3526
|
}, {
|
|
3525
3527
|
hash_on: n(() => [
|
|
3526
|
-
|
|
3528
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_header.hash_on")), 1)
|
|
3527
3529
|
]),
|
|
3528
3530
|
header: n(() => [
|
|
3529
|
-
|
|
3531
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_header.header")), 1)
|
|
3530
3532
|
]),
|
|
3531
3533
|
_: 1
|
|
3532
3534
|
})
|
|
@@ -3537,10 +3539,10 @@ const pe = {
|
|
|
3537
3539
|
scope: "global"
|
|
3538
3540
|
}, {
|
|
3539
3541
|
hash_on: n(() => [
|
|
3540
|
-
|
|
3542
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")), 1)
|
|
3541
3543
|
]),
|
|
3542
3544
|
uri_capture: n(() => [
|
|
3543
|
-
|
|
3545
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")), 1)
|
|
3544
3546
|
]),
|
|
3545
3547
|
_: 1
|
|
3546
3548
|
})
|
|
@@ -3551,10 +3553,10 @@ const pe = {
|
|
|
3551
3553
|
scope: "global"
|
|
3552
3554
|
}, {
|
|
3553
3555
|
hash_on: n(() => [
|
|
3554
|
-
|
|
3556
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")), 1)
|
|
3555
3557
|
]),
|
|
3556
3558
|
query_arg: n(() => [
|
|
3557
|
-
|
|
3559
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")), 1)
|
|
3558
3560
|
]),
|
|
3559
3561
|
_: 1
|
|
3560
3562
|
})
|
|
@@ -3565,13 +3567,13 @@ const pe = {
|
|
|
3565
3567
|
scope: "global"
|
|
3566
3568
|
}, {
|
|
3567
3569
|
hash_on: n(() => [
|
|
3568
|
-
|
|
3570
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")), 1)
|
|
3569
3571
|
]),
|
|
3570
3572
|
hash_fallback: n(() => [
|
|
3571
|
-
|
|
3573
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")), 1)
|
|
3572
3574
|
]),
|
|
3573
3575
|
cookie: n(() => [
|
|
3574
|
-
|
|
3576
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")), 1)
|
|
3575
3577
|
]),
|
|
3576
3578
|
_: 1
|
|
3577
3579
|
})
|
|
@@ -3582,13 +3584,13 @@ const pe = {
|
|
|
3582
3584
|
scope: "global"
|
|
3583
3585
|
}, {
|
|
3584
3586
|
hash_on: n(() => [
|
|
3585
|
-
|
|
3587
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")), 1)
|
|
3586
3588
|
]),
|
|
3587
3589
|
hash_fallback: n(() => [
|
|
3588
|
-
|
|
3590
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")), 1)
|
|
3589
3591
|
]),
|
|
3590
3592
|
cookie: n(() => [
|
|
3591
|
-
|
|
3593
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")), 1)
|
|
3592
3594
|
]),
|
|
3593
3595
|
_: 1
|
|
3594
3596
|
})
|
|
@@ -3599,19 +3601,19 @@ const pe = {
|
|
|
3599
3601
|
scope: "global"
|
|
3600
3602
|
}, {
|
|
3601
3603
|
algorithm: n(() => [
|
|
3602
|
-
|
|
3604
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.slots.algorithm")), 1)
|
|
3603
3605
|
]),
|
|
3604
3606
|
round_robin: n(() => [
|
|
3605
|
-
|
|
3607
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.slots.round_robin")), 1)
|
|
3606
3608
|
]),
|
|
3607
3609
|
consistent_hashing: n(() => [
|
|
3608
|
-
|
|
3610
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.slots.consistent_hashing")), 1)
|
|
3609
3611
|
]),
|
|
3610
|
-
min: n(() =>
|
|
3611
|
-
|
|
3612
|
+
min: n(() => F[3] || (F[3] = [
|
|
3613
|
+
_("code", null, "10", -1)
|
|
3612
3614
|
])),
|
|
3613
|
-
max: n(() =>
|
|
3614
|
-
|
|
3615
|
+
max: n(() => F[4] || (F[4] = [
|
|
3616
|
+
_("code", null, "65536", -1)
|
|
3615
3617
|
])),
|
|
3616
3618
|
_: 1
|
|
3617
3619
|
})
|
|
@@ -3622,10 +3624,10 @@ const pe = {
|
|
|
3622
3624
|
scope: "global"
|
|
3623
3625
|
}, {
|
|
3624
3626
|
hash_on: n(() => [
|
|
3625
|
-
|
|
3627
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback.hash_on")), 1)
|
|
3626
3628
|
]),
|
|
3627
3629
|
cookie: n(() => [
|
|
3628
|
-
|
|
3630
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback.cookie")), 1)
|
|
3629
3631
|
]),
|
|
3630
3632
|
_: 1
|
|
3631
3633
|
})
|
|
@@ -3636,10 +3638,10 @@ const pe = {
|
|
|
3636
3638
|
scope: "global"
|
|
3637
3639
|
}, {
|
|
3638
3640
|
hash_fallback: n(() => [
|
|
3639
|
-
|
|
3641
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")), 1)
|
|
3640
3642
|
]),
|
|
3641
3643
|
header: n(() => [
|
|
3642
|
-
|
|
3644
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_header.header")), 1)
|
|
3643
3645
|
]),
|
|
3644
3646
|
_: 1
|
|
3645
3647
|
})
|
|
@@ -3650,10 +3652,10 @@ const pe = {
|
|
|
3650
3652
|
scope: "global"
|
|
3651
3653
|
}, {
|
|
3652
3654
|
hash_fallback: n(() => [
|
|
3653
|
-
|
|
3655
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")), 1)
|
|
3654
3656
|
]),
|
|
3655
3657
|
query_arg: n(() => [
|
|
3656
|
-
|
|
3658
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")), 1)
|
|
3657
3659
|
]),
|
|
3658
3660
|
_: 1
|
|
3659
3661
|
})
|
|
@@ -3664,10 +3666,10 @@ const pe = {
|
|
|
3664
3666
|
scope: "global"
|
|
3665
3667
|
}, {
|
|
3666
3668
|
hash_fallback: n(() => [
|
|
3667
|
-
|
|
3669
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")), 1)
|
|
3668
3670
|
]),
|
|
3669
3671
|
uri_capture: n(() => [
|
|
3670
|
-
|
|
3672
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")), 1)
|
|
3671
3673
|
]),
|
|
3672
3674
|
_: 1
|
|
3673
3675
|
})
|
|
@@ -3678,7 +3680,7 @@ const pe = {
|
|
|
3678
3680
|
scope: "global"
|
|
3679
3681
|
}, {
|
|
3680
3682
|
host: n(() => [
|
|
3681
|
-
|
|
3683
|
+
_("code", null, f(e(i)("upstreams.form.hash_tooltips.host_header.host")), 1)
|
|
3682
3684
|
]),
|
|
3683
3685
|
_: 1
|
|
3684
3686
|
})
|
|
@@ -3686,9 +3688,9 @@ const pe = {
|
|
|
3686
3688
|
client_certificate: n((s) => {
|
|
3687
3689
|
var c;
|
|
3688
3690
|
return [
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3691
|
+
_("div", null, [
|
|
3692
|
+
_("div", La, [
|
|
3693
|
+
_("span", null, f((c = e(h)("rowValue", s)) == null ? void 0 : c.id), 1)
|
|
3692
3694
|
])
|
|
3693
3695
|
])
|
|
3694
3696
|
];
|