@cobaltcore-dev/aurora 1.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/DeleteFlavorModal-C2MqUgGR.mjs +801 -0
- package/dist/client/DeleteFlavorModal-C2MqUgGR.mjs.map +1 -0
- package/dist/client/{FiltersInput-CKI6zWnm.mjs → FiltersInput-Becwxo_J.mjs} +36 -33
- package/dist/client/FiltersInput-Becwxo_J.mjs.map +1 -0
- package/dist/client/{FloatingIpActionModals-Ch8uozH9.mjs → FloatingIpActionModals-Cq10WljB.mjs} +2 -2
- package/dist/client/{FloatingIpActionModals-Ch8uozH9.mjs.map → FloatingIpActionModals-Cq10WljB.mjs.map} +1 -1
- package/dist/client/ImageToastNotifications-BWfzOUMc.mjs +1135 -0
- package/dist/client/ImageToastNotifications-BWfzOUMc.mjs.map +1 -0
- package/dist/client/RouteIdLevelDefaultError-CSseJ1yG.mjs +26 -0
- package/dist/client/RouteIdLevelDefaultError-CSseJ1yG.mjs.map +1 -0
- package/dist/client/{_flavorId-Dg7MS0Af.mjs → _flavorId-CaA4-Pnf.mjs} +4 -3
- package/dist/client/_flavorId-CaA4-Pnf.mjs.map +1 -0
- package/dist/client/_flavorId-DYv_StX22.mjs +276 -0
- package/dist/client/_flavorId-DYv_StX22.mjs.map +1 -0
- package/dist/client/_flavorId-YV3jCS5g.mjs +22 -0
- package/dist/client/_flavorId-YV3jCS5g.mjs.map +1 -0
- package/dist/client/{_floatingIpId-C9xfRWot.mjs → _floatingIpId-BeYElanB.mjs} +2 -2
- package/dist/client/{_floatingIpId-C9xfRWot.mjs.map → _floatingIpId-BeYElanB.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-DNn6ABCB.mjs → _floatingIpId-Dpsc7GU4.mjs} +5 -5
- package/dist/client/{_floatingIpId-DNn6ABCB.mjs.map → _floatingIpId-Dpsc7GU4.mjs.map} +1 -1
- package/dist/client/_imageId-mfKp3JHn.mjs +558 -0
- package/dist/client/_imageId-mfKp3JHn.mjs.map +1 -0
- package/dist/client/_imageId-mpXUMCh_.mjs +22 -0
- package/dist/client/_imageId-mpXUMCh_.mjs.map +1 -0
- package/dist/client/{_imageId-8JIbFmGB.mjs → _imageId-pBSS0YcC.mjs} +4 -3
- package/dist/client/_imageId-pBSS0YcC.mjs.map +1 -0
- package/dist/client/{_projectId-B3wmSala.mjs → _projectId-AjgJX6Gl.mjs} +2 -2
- package/dist/client/_projectId-AjgJX6Gl.mjs.map +1 -0
- package/dist/client/{_projectId-DPzv0CCp.mjs → _projectId-BnTBxKfp.mjs} +4 -4
- package/dist/client/_projectId-BnTBxKfp.mjs.map +1 -0
- package/dist/client/{_projectId-DfeVJy0G.mjs → _projectId-CVrdJ52s.mjs} +2 -2
- package/dist/client/_projectId-CVrdJ52s.mjs.map +1 -0
- package/dist/client/_projectId-DgciZslU.mjs +92 -0
- package/dist/client/_projectId-DgciZslU.mjs.map +1 -0
- package/dist/client/{_securityGroupId-C6eHmrx_.mjs → _securityGroupId-AO3wnH8g.mjs} +2 -2
- package/dist/client/_securityGroupId-AO3wnH8g.mjs.map +1 -0
- package/dist/client/{_securityGroupId-DmplhDgt.mjs → _securityGroupId-Bq0ZyG6z.mjs} +750 -741
- package/dist/client/_securityGroupId-Bq0ZyG6z.mjs.map +1 -0
- package/dist/client/_storageType-c-DAu8qr.mjs +858 -0
- package/dist/client/_storageType-c-DAu8qr.mjs.map +1 -0
- package/dist/client/components/{Error → Errors}/RouteError.d.ts +5 -0
- package/dist/client/components/Errors/RouteIdLevelDefaultError.d.ts +17 -0
- package/dist/client/components/Errors/ServiceLevelDefaultError.d.ts +9 -0
- package/dist/client/components/ListToolbar/SelectedFilters.d.ts +7 -2
- package/dist/client/components/ListToolbar/types.d.ts +6 -0
- package/dist/client/components/ListToolbar/valueLabels.d.ts +11 -0
- package/dist/client/flavors-Bgq3KZmx.mjs +659 -0
- package/dist/client/flavors-Bgq3KZmx.mjs.map +1 -0
- package/dist/client/{flavors-B1SDOPDu.mjs → flavors-ZudiAiTU.mjs} +2 -2
- package/dist/client/{flavors-B1SDOPDu.mjs.map → flavors-ZudiAiTU.mjs.map} +1 -1
- package/dist/client/{floatingips-DrCvtXtT.mjs → floatingips-B1oLH8z6.mjs} +6 -6
- package/dist/client/{floatingips-DrCvtXtT.mjs.map → floatingips-B1oLH8z6.mjs.map} +1 -1
- package/dist/client/floatingips-BeQEkVH8.mjs +14 -0
- package/dist/client/floatingips-BeQEkVH8.mjs.map +1 -0
- package/dist/client/floatingips-BtLg3yEQ.mjs +22 -0
- package/dist/client/floatingips-BtLg3yEQ.mjs.map +1 -0
- package/dist/client/floatingips-Cz9k80cc.mjs.map +1 -1
- package/dist/client/{images-BGQv9kKT.mjs → images-CnTW3bpy.mjs} +810 -770
- package/dist/client/images-CnTW3bpy.mjs.map +1 -0
- package/dist/client/{images-CPmMa4SQ.mjs → images-DZHDYDQu.mjs} +2 -2
- package/dist/client/{images-CPmMa4SQ.mjs.map → images-DZHDYDQu.mjs.map} +1 -1
- package/dist/client/index.js +412 -409
- package/dist/client/index.js.map +1 -1
- package/dist/client/{objects-DVccbrL1.mjs → objects-25xsh4Ia.mjs} +2 -2
- package/dist/client/objects-25xsh4Ia.mjs.map +1 -0
- package/dist/client/objects-KXY6dgwq.mjs +82 -0
- package/dist/client/objects-KXY6dgwq.mjs.map +1 -0
- package/dist/client/objects-QryuClU3.mjs +82 -0
- package/dist/client/objects-QryuClU3.mjs.map +1 -0
- package/dist/client/{objects-BR3eeSNH.mjs → objects-jYQBFzwg.mjs} +4668 -4699
- package/dist/client/objects-jYQBFzwg.mjs.map +1 -0
- package/dist/client/projects-yiK0HGSA.mjs.map +1 -1
- package/dist/client/securitygroups--0PS2wbM.mjs +580 -0
- package/dist/client/securitygroups--0PS2wbM.mjs.map +1 -0
- package/dist/client/{securitygroups-DEJQBcxm.mjs → securitygroups-BRndk7wh.mjs} +2 -2
- package/dist/client/{securitygroups-DEJQBcxm.mjs.map → securitygroups-BRndk7wh.mjs.map} +1 -1
- package/dist/client/securitygroups-CdN4yAAw.mjs +14 -0
- package/dist/client/securitygroups-CdN4yAAw.mjs.map +1 -0
- package/dist/client/securitygroups-Cs2Op-tu.mjs +22 -0
- package/dist/client/securitygroups-Cs2Op-tu.mjs.map +1 -0
- package/dist/client/securitygroups-CtKne8UQ.mjs.map +1 -1
- package/dist/client/trpcClient.d.ts +6 -1
- package/dist/client/useModalTracking-BYd37pXm.mjs +37 -0
- package/dist/client/useModalTracking-BYd37pXm.mjs.map +1 -0
- package/dist/client/useSecurityGroupPermissions--hK4aR8Y.mjs +294 -0
- package/dist/client/useSecurityGroupPermissions--hK4aR8Y.mjs.map +1 -0
- package/dist/server/index.d.ts +6 -1
- package/dist/server/index.js +96 -30
- package/package.json +4 -4
- package/dist/client/DeleteFlavorModal-V44QCJBd.mjs +0 -773
- package/dist/client/DeleteFlavorModal-V44QCJBd.mjs.map +0 -1
- package/dist/client/FiltersInput-CKI6zWnm.mjs.map +0 -1
- package/dist/client/ImageToastNotifications-m6c3tVPb.mjs +0 -1152
- package/dist/client/ImageToastNotifications-m6c3tVPb.mjs.map +0 -1
- package/dist/client/_flavorId-Dg7MS0Af.mjs.map +0 -1
- package/dist/client/_flavorId-kHl-b8rI.mjs +0 -232
- package/dist/client/_flavorId-kHl-b8rI.mjs.map +0 -1
- package/dist/client/_imageId-8JIbFmGB.mjs.map +0 -1
- package/dist/client/_imageId-BBAlRioC.mjs +0 -574
- package/dist/client/_imageId-BBAlRioC.mjs.map +0 -1
- package/dist/client/_projectId-7Nl1MQTJ.mjs +0 -99
- package/dist/client/_projectId-7Nl1MQTJ.mjs.map +0 -1
- package/dist/client/_projectId-B3wmSala.mjs.map +0 -1
- package/dist/client/_projectId-DPzv0CCp.mjs.map +0 -1
- package/dist/client/_projectId-DfeVJy0G.mjs.map +0 -1
- package/dist/client/_securityGroupId-C6eHmrx_.mjs.map +0 -1
- package/dist/client/_securityGroupId-DmplhDgt.mjs.map +0 -1
- package/dist/client/_storageType-C5gS9eut.mjs +0 -845
- package/dist/client/_storageType-C5gS9eut.mjs.map +0 -1
- package/dist/client/flavors-D8_PzQUB.mjs +0 -628
- package/dist/client/flavors-D8_PzQUB.mjs.map +0 -1
- package/dist/client/images-BGQv9kKT.mjs.map +0 -1
- package/dist/client/objects-AERkhfiM.mjs +0 -66
- package/dist/client/objects-AERkhfiM.mjs.map +0 -1
- package/dist/client/objects-BR3eeSNH.mjs.map +0 -1
- package/dist/client/objects-DVccbrL1.mjs.map +0 -1
- package/dist/client/securitygroups-BjhgLBHm.mjs +0 -620
- package/dist/client/securitygroups-BjhgLBHm.mjs.map +0 -1
- package/dist/client/useModalTracking-BcOKTYRN.mjs +0 -33
- package/dist/client/useModalTracking-BcOKTYRN.mjs.map +0 -1
- package/dist/client/useSecurityGroupPermissions-BOyLQLdC.mjs +0 -227
- package/dist/client/useSecurityGroupPermissions-BOyLQLdC.mjs.map +0 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, K as i, L as a, M as o, P as s, Q as c, R as l, S as u, T as d, X as f,
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
1
|
+
import { A as e, C as t, D as n, E as r, K as i, L as a, M as o, P as s, Q as c, R as l, S as u, T as d, X as f, c as p, et as m, ft as h, g, h as _, i as v, it as y, l as b, lt as x, m as S, n as C, o as w, ot as T, p as E, rt as D, s as O, t as k, v as A, x as j } from "./build-WuxXRAqf.mjs";
|
|
2
|
+
import { a as M } from "./trpcClient-D7gpR7YG.mjs";
|
|
3
|
+
import { t as N } from "./_securityGroupId-AO3wnH8g.mjs";
|
|
4
|
+
import { t as P } from "./useProjectId-DBc5lpoU.mjs";
|
|
5
|
+
import { t as F } from "./SortInput-4g7nSTHW.mjs";
|
|
6
|
+
import { t as I } from "./useModalTracking-BYd37pXm.mjs";
|
|
7
|
+
import { t as ee } from "./ContentHeader-CPJbgYWn.mjs";
|
|
8
|
+
import { t as L } from "./useSetBreadcrumb-tn7lBaQV.mjs";
|
|
9
9
|
import "./hooks-D0yKIumu.mjs";
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { n as
|
|
13
|
-
import { a as
|
|
14
|
-
import { Fragment as
|
|
15
|
-
import { startTransition as
|
|
16
|
-
import { useNavigate as
|
|
17
|
-
import { Trans as
|
|
18
|
-
import { z as
|
|
19
|
-
import { useForm as
|
|
10
|
+
import { t as te } from "./useModal-DCs1OJh7.mjs";
|
|
11
|
+
import { t as ne } from "./TwoColumnDescriptionList-DKS42RKa.mjs";
|
|
12
|
+
import { n as re, t as ie } from "./FiltersInput-Becwxo_J.mjs";
|
|
13
|
+
import { a as ae, c as oe, d as se, f as R, h as ce, i as le, l as ue, m as de, n as fe, o as z, p as pe, r as me, s as B, t as he, u as V } from "./useSecurityGroupPermissions--hK4aR8Y.mjs";
|
|
14
|
+
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
15
|
+
import { startTransition as G, useEffect as K, useMemo as ge, useRef as _e, useState as q } from "react";
|
|
16
|
+
import { useNavigate as ve } from "@tanstack/react-router";
|
|
17
|
+
import { Trans as J, useLingui as Y } from "@lingui/react";
|
|
18
|
+
import { z as X } from "zod";
|
|
19
|
+
import { useForm as Z, useStore as Q } from "@tanstack/react-form";
|
|
20
20
|
//#region src/client/utils/useListWithFiltering.ts
|
|
21
|
-
function
|
|
22
|
-
let [i, a] =
|
|
21
|
+
function ye({ defaultSortKey: e, defaultSortDir: t, sortOptions: n, filterSettings: r }) {
|
|
22
|
+
let [i, a] = q(""), o = (e) => {
|
|
23
23
|
let t = typeof e == "string" ? e : "";
|
|
24
|
-
|
|
25
|
-
}, [s, c] =
|
|
24
|
+
G(() => a(t));
|
|
25
|
+
}, [s, c] = q({
|
|
26
26
|
options: n,
|
|
27
27
|
sortBy: e,
|
|
28
28
|
sortDirection: t
|
|
@@ -33,7 +33,7 @@ function me({ defaultSortKey: e, defaultSortDir: t, sortOptions: n, filterSettin
|
|
|
33
33
|
sortDirection: n.sortDirection || t
|
|
34
34
|
};
|
|
35
35
|
c(r);
|
|
36
|
-
}, [u, d] =
|
|
36
|
+
}, [u, d] = q(r);
|
|
37
37
|
return {
|
|
38
38
|
searchTerm: i,
|
|
39
39
|
sortSettings: s,
|
|
@@ -41,88 +41,80 @@ function me({ defaultSortKey: e, defaultSortDir: t, sortOptions: n, filterSettin
|
|
|
41
41
|
handleSearchChange: o,
|
|
42
42
|
handleSortChange: l,
|
|
43
43
|
handleFilterChange: (e) => {
|
|
44
|
-
|
|
44
|
+
G(() => d(e));
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/SecurityGroupBasicInfo.tsx
|
|
50
|
-
function
|
|
51
|
-
let { i18n:
|
|
50
|
+
function be({ securityGroup: e }) {
|
|
51
|
+
let { i18n: t, _: n } = Y(), r = [
|
|
52
52
|
{
|
|
53
|
-
label:
|
|
54
|
-
value: e.description ||
|
|
53
|
+
label: t._({ id: "Nu4oKW" }),
|
|
54
|
+
value: e.description || t._({ id: "h47p9L" })
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
|
-
label:
|
|
57
|
+
label: t._({ id: "S0kLOH" }),
|
|
58
58
|
value: e.id
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
label:
|
|
62
|
-
value: e.tags?.join(", ") ||
|
|
61
|
+
label: t._({ id: "OYHzN1" }),
|
|
62
|
+
value: e.tags?.join(", ") || t._({ id: "h47p9L" })
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
|
-
label:
|
|
66
|
-
value: e.name ||
|
|
65
|
+
label: t._({ id: "6YtxFj" }),
|
|
66
|
+
value: e.name || t._({ id: "h47p9L" })
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
label:
|
|
70
|
-
value: e.stateful ?
|
|
69
|
+
label: t._({ id: "Jim5X9" }),
|
|
70
|
+
value: e.stateful ?? !0 ? t._({ id: "l75CjT" }) : t._({ id: "1UzENP" })
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
|
-
label:
|
|
74
|
-
value: e.project_id ||
|
|
73
|
+
label: t._({ id: "aI8Tgp" }),
|
|
74
|
+
value: e.project_id || t._({ id: "h47p9L" })
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
|
-
label:
|
|
78
|
-
value: e.shared ?
|
|
77
|
+
label: t._({ id: "0Gd0NU" }),
|
|
78
|
+
value: e.shared ? t._({ id: "l75CjT" }) : t._({ id: "1UzENP" })
|
|
79
79
|
}
|
|
80
80
|
];
|
|
81
|
-
return /*#__PURE__*/
|
|
82
|
-
className: "mb-4 flex flex-row-reverse",
|
|
83
|
-
children: t && n && /*#__PURE__*/ W(_, {
|
|
84
|
-
variant: "primary",
|
|
85
|
-
onClick: t,
|
|
86
|
-
disabled: !n,
|
|
87
|
-
children: /*#__PURE__*/ W(Y, { id: "ePK91l" })
|
|
88
|
-
})
|
|
89
|
-
}), /*#__PURE__*/ W(L, { items: a })] });
|
|
81
|
+
return /*#__PURE__*/ U(ne, { items: r });
|
|
90
82
|
}
|
|
91
83
|
//#endregion
|
|
92
84
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/SecurityGroupTabs.tsx
|
|
93
|
-
function
|
|
85
|
+
function xe({ activeTab: e, onTabChange: t, showRBACTab: n = !0 }) {
|
|
94
86
|
let r = (t) => `px-6 py-3 font-semibold border-b-2 transition-colors ${e === t ? "border-theme-accent text-theme-highest" : "border-transparent text-theme-secondary hover:text-theme-high"}`;
|
|
95
|
-
return /*#__PURE__*/
|
|
96
|
-
className: "border-theme-background-lvl-3 mt-
|
|
97
|
-
children: /*#__PURE__*/
|
|
87
|
+
return /*#__PURE__*/ U("div", {
|
|
88
|
+
className: "border-theme-background-lvl-3 mt-4 border-b",
|
|
89
|
+
children: /*#__PURE__*/ W(c, {
|
|
98
90
|
direction: "horizontal",
|
|
99
91
|
gap: "0",
|
|
100
|
-
children: [/*#__PURE__*/
|
|
92
|
+
children: [/*#__PURE__*/ U("button", {
|
|
101
93
|
className: r("rules"),
|
|
102
94
|
onClick: () => t("rules"),
|
|
103
|
-
children: /*#__PURE__*/
|
|
104
|
-
}), n && /*#__PURE__*/
|
|
95
|
+
children: /*#__PURE__*/ U(J, { id: "4EZrJN" })
|
|
96
|
+
}), n && /*#__PURE__*/ U("button", {
|
|
105
97
|
className: r("rbac"),
|
|
106
98
|
onClick: () => t("rbac"),
|
|
107
|
-
children: /*#__PURE__*/
|
|
99
|
+
children: /*#__PURE__*/ U(J, { id: "/eFtWI" })
|
|
108
100
|
})]
|
|
109
101
|
})
|
|
110
102
|
});
|
|
111
103
|
}
|
|
112
104
|
//#endregion
|
|
113
105
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/DeleteRuleDialog.tsx
|
|
114
|
-
function
|
|
115
|
-
let { i18n: s, _: l } =
|
|
106
|
+
function Se({ rule: e, open: t, onClose: n, onConfirm: r, isLoading: i, error: o }) {
|
|
107
|
+
let { i18n: s, _: l } = Y(), { trackClose: u, markSubmitted: d, resetTracking: p } = I({
|
|
116
108
|
isOpen: t,
|
|
117
109
|
actionPrefix: "network.securitygroup.rule.delete"
|
|
118
|
-
}),
|
|
110
|
+
}), m = X.object({ confirm: X.string().refine((e) => e === "delete", { message: s._({ id: "QytzQr" }) }) }), g = Z({
|
|
119
111
|
defaultValues: { confirm: "" },
|
|
120
|
-
validators: { onSubmit:
|
|
112
|
+
validators: { onSubmit: m },
|
|
121
113
|
onSubmit: async () => {
|
|
122
114
|
!e || i || (d(), r(e.id));
|
|
123
115
|
}
|
|
124
|
-
}), _ =
|
|
125
|
-
return e ? /*#__PURE__*/
|
|
116
|
+
}), _ = Q(g.store, (e) => e.isSubmitting || e.values.confirm !== "delete");
|
|
117
|
+
return e ? /*#__PURE__*/ U(f, {
|
|
126
118
|
open: t,
|
|
127
119
|
onCancel: () => {
|
|
128
120
|
u(), g.reset(), p(), n();
|
|
@@ -136,74 +128,74 @@ function _e({ rule: e, open: t, onClose: n, onConfirm: r, isLoading: i, error: o
|
|
|
136
128
|
disableConfirmButton: _ || i,
|
|
137
129
|
disableCancelButton: i,
|
|
138
130
|
disableCloseButton: i,
|
|
139
|
-
children: /*#__PURE__*/
|
|
131
|
+
children: /*#__PURE__*/ W(c, {
|
|
140
132
|
direction: "vertical",
|
|
141
133
|
gap: "4",
|
|
142
134
|
children: [
|
|
143
|
-
o && /*#__PURE__*/
|
|
135
|
+
o && /*#__PURE__*/ U(a, {
|
|
144
136
|
variant: "error",
|
|
145
137
|
children: o
|
|
146
138
|
}),
|
|
147
|
-
/*#__PURE__*/
|
|
139
|
+
/*#__PURE__*/ U("p", {
|
|
148
140
|
className: "text-theme-default",
|
|
149
|
-
children: /*#__PURE__*/
|
|
141
|
+
children: /*#__PURE__*/ U(J, { id: "CMVP7y" })
|
|
150
142
|
}),
|
|
151
|
-
/*#__PURE__*/
|
|
143
|
+
/*#__PURE__*/ W("div", {
|
|
152
144
|
className: "bg-theme-background-lvl-1 rounded p-4",
|
|
153
|
-
children: [/*#__PURE__*/
|
|
145
|
+
children: [/*#__PURE__*/ U("p", {
|
|
154
146
|
className: "mb-2 font-semibold",
|
|
155
|
-
children: /*#__PURE__*/
|
|
156
|
-
}), /*#__PURE__*/
|
|
147
|
+
children: /*#__PURE__*/ U(J, { id: "uly9ET" })
|
|
148
|
+
}), /*#__PURE__*/ W("ul", {
|
|
157
149
|
className: "list-inside list-disc space-y-1 text-sm",
|
|
158
150
|
children: [
|
|
159
|
-
/*#__PURE__*/
|
|
160
|
-
/*#__PURE__*/
|
|
151
|
+
/*#__PURE__*/ W("li", { children: [
|
|
152
|
+
/*#__PURE__*/ U(J, { id: "MRB7nI" }),
|
|
161
153
|
": ",
|
|
162
154
|
e.direction
|
|
163
155
|
] }),
|
|
164
|
-
e.description && /*#__PURE__*/
|
|
165
|
-
/*#__PURE__*/
|
|
156
|
+
e.description && /*#__PURE__*/ W("li", { children: [
|
|
157
|
+
/*#__PURE__*/ U(J, { id: "Nu4oKW" }),
|
|
166
158
|
": ",
|
|
167
159
|
e.description
|
|
168
160
|
] }),
|
|
169
|
-
/*#__PURE__*/
|
|
170
|
-
/*#__PURE__*/
|
|
161
|
+
/*#__PURE__*/ W("li", { children: [
|
|
162
|
+
/*#__PURE__*/ U(J, { id: "yp0UjB" }),
|
|
171
163
|
": ",
|
|
172
164
|
e.ethertype
|
|
173
165
|
] }),
|
|
174
|
-
e.protocol && /*#__PURE__*/
|
|
175
|
-
/*#__PURE__*/
|
|
166
|
+
e.protocol && /*#__PURE__*/ W("li", { children: [
|
|
167
|
+
/*#__PURE__*/ U(J, { id: "6+OdGi" }),
|
|
176
168
|
": ",
|
|
177
169
|
e.protocol
|
|
178
170
|
] }),
|
|
179
|
-
e.port_range_min !== null && e.port_range_max !== null && /*#__PURE__*/
|
|
180
|
-
/*#__PURE__*/
|
|
171
|
+
e.port_range_min !== null && e.port_range_max !== null && /*#__PURE__*/ W("li", { children: [
|
|
172
|
+
/*#__PURE__*/ U(J, { id: "tV/Ozb" }),
|
|
181
173
|
":",
|
|
182
174
|
" ",
|
|
183
175
|
e.port_range_min === e.port_range_max ? e.port_range_min : `${e.port_range_min}-${e.port_range_max}`
|
|
184
176
|
] }),
|
|
185
|
-
e.remote_ip_prefix && /*#__PURE__*/
|
|
186
|
-
/*#__PURE__*/
|
|
177
|
+
e.remote_ip_prefix && /*#__PURE__*/ W("li", { children: [
|
|
178
|
+
/*#__PURE__*/ U(J, { id: "WoSkGY" }),
|
|
187
179
|
": ",
|
|
188
180
|
e.remote_ip_prefix
|
|
189
181
|
] }),
|
|
190
|
-
e.remote_group_id && /*#__PURE__*/
|
|
191
|
-
/*#__PURE__*/
|
|
182
|
+
e.remote_group_id && /*#__PURE__*/ W("li", { children: [
|
|
183
|
+
/*#__PURE__*/ U(J, { id: "i9TIyi" }),
|
|
192
184
|
": ",
|
|
193
185
|
e.remote_group_id
|
|
194
186
|
] })
|
|
195
187
|
]
|
|
196
188
|
})]
|
|
197
189
|
}),
|
|
198
|
-
/*#__PURE__*/
|
|
190
|
+
/*#__PURE__*/ U(h, {
|
|
199
191
|
className: "mb-0",
|
|
200
192
|
id: "delete-rule-form",
|
|
201
193
|
onSubmit: (e) => {
|
|
202
194
|
e.preventDefault(), g.handleSubmit();
|
|
203
195
|
},
|
|
204
|
-
children: /*#__PURE__*/
|
|
196
|
+
children: /*#__PURE__*/ U(E, { children: /*#__PURE__*/ U(g.Field, {
|
|
205
197
|
name: "confirm",
|
|
206
|
-
children: (e) => /*#__PURE__*/
|
|
198
|
+
children: (e) => /*#__PURE__*/ U(S, {
|
|
207
199
|
label: s._({ id: "QytzQr" }),
|
|
208
200
|
id: e.name,
|
|
209
201
|
name: e.name,
|
|
@@ -224,10 +216,10 @@ function _e({ rule: e, open: t, onClose: n, onConfirm: r, isLoading: i, error: o
|
|
|
224
216
|
}
|
|
225
217
|
//#endregion
|
|
226
218
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/validation/validationHelpers.ts
|
|
227
|
-
function
|
|
219
|
+
function Ce(e) {
|
|
228
220
|
return e.includes(".") ? "IPv4" : e.includes(":") ? "IPv6" : null;
|
|
229
221
|
}
|
|
230
|
-
function
|
|
222
|
+
function we(e, t, n) {
|
|
231
223
|
if (e != null && isNaN(e) || t != null && isNaN(t)) return {
|
|
232
224
|
valid: !1,
|
|
233
225
|
error: "Port must be a valid number"
|
|
@@ -246,7 +238,7 @@ function ye(e, t, n) {
|
|
|
246
238
|
error: "port_range_min must be less than or equal to port_range_max"
|
|
247
239
|
} : { valid: !0 };
|
|
248
240
|
}
|
|
249
|
-
function
|
|
241
|
+
function Te(e, t) {
|
|
250
242
|
return e != null && isNaN(e) ? {
|
|
251
243
|
valid: !1,
|
|
252
244
|
error: "ICMP type must be a valid number"
|
|
@@ -261,7 +253,7 @@ function be(e, t) {
|
|
|
261
253
|
error: "ICMP code must be between 0 and 255"
|
|
262
254
|
} : { valid: !0 };
|
|
263
255
|
}
|
|
264
|
-
function
|
|
256
|
+
function Ee(e) {
|
|
265
257
|
let t = e.split("/");
|
|
266
258
|
if (t.length !== 2) return !1;
|
|
267
259
|
let [n, r] = t;
|
|
@@ -290,61 +282,61 @@ function xe(e) {
|
|
|
290
282
|
}
|
|
291
283
|
//#endregion
|
|
292
284
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/constants.ts
|
|
293
|
-
var
|
|
294
|
-
ruleType:
|
|
295
|
-
direction:
|
|
296
|
-
ethertype:
|
|
297
|
-
description:
|
|
298
|
-
protocol:
|
|
299
|
-
portFrom:
|
|
300
|
-
portTo:
|
|
301
|
-
icmpType:
|
|
302
|
-
icmpCode:
|
|
303
|
-
remoteSourceType:
|
|
304
|
-
remoteCidr:
|
|
305
|
-
remoteSecurityGroupId:
|
|
285
|
+
var De = "0.0.0.0/0", Oe = "::/0", ke = "other-protocol", Ae = X.object({
|
|
286
|
+
ruleType: X.string().min(1, "Rule type is required"),
|
|
287
|
+
direction: X.enum(["ingress", "egress"]),
|
|
288
|
+
ethertype: X.enum(["IPv4", "IPv6"]),
|
|
289
|
+
description: X.string(),
|
|
290
|
+
protocol: X.string().nullable(),
|
|
291
|
+
portFrom: X.string(),
|
|
292
|
+
portTo: X.string(),
|
|
293
|
+
icmpType: X.string(),
|
|
294
|
+
icmpCode: X.string(),
|
|
295
|
+
remoteSourceType: X.enum(["cidr", "security_group"]),
|
|
296
|
+
remoteCidr: X.string(),
|
|
297
|
+
remoteSecurityGroupId: X.string()
|
|
306
298
|
}).superRefine((e, t) => {
|
|
307
|
-
let n = e.protocol === "tcp" || e.protocol === "udp", r = e.protocol === "icmp" || e.protocol === "ipv6-icmp", i = e.ruleType ===
|
|
299
|
+
let n = e.protocol === "tcp" || e.protocol === "udp", r = e.protocol === "icmp" || e.protocol === "ipv6-icmp", i = e.ruleType === ke, a = n && ["custom-tcp", "custom-udp"].includes(e.ruleType);
|
|
308
300
|
if (i && !e.protocol && t.addIssue({
|
|
309
|
-
code:
|
|
301
|
+
code: X.ZodIssueCode.custom,
|
|
310
302
|
message: "Protocol is required",
|
|
311
303
|
path: ["protocol"]
|
|
312
304
|
}), a) if (!e.portFrom) t.addIssue({
|
|
313
|
-
code:
|
|
305
|
+
code: X.ZodIssueCode.custom,
|
|
314
306
|
message: "Port (from) is required",
|
|
315
307
|
path: ["portFrom"]
|
|
316
308
|
});
|
|
317
309
|
else {
|
|
318
310
|
let n = parseInt(e.portFrom, 10);
|
|
319
311
|
if (isNaN(n)) t.addIssue({
|
|
320
|
-
code:
|
|
312
|
+
code: X.ZodIssueCode.custom,
|
|
321
313
|
message: "Port must be a valid number",
|
|
322
314
|
path: ["portFrom"]
|
|
323
315
|
});
|
|
324
316
|
else if (e.portTo) {
|
|
325
317
|
let r = parseInt(e.portTo, 10);
|
|
326
318
|
if (isNaN(r)) t.addIssue({
|
|
327
|
-
code:
|
|
319
|
+
code: X.ZodIssueCode.custom,
|
|
328
320
|
message: "Port must be a valid number",
|
|
329
321
|
path: ["portTo"]
|
|
330
322
|
});
|
|
331
323
|
else if (n >= r) t.addIssue({
|
|
332
|
-
code:
|
|
324
|
+
code: X.ZodIssueCode.custom,
|
|
333
325
|
message: "\"Port (from)\" must be less than \"Port (to)\"",
|
|
334
326
|
path: ["portFrom"]
|
|
335
327
|
});
|
|
336
328
|
else {
|
|
337
|
-
let i =
|
|
329
|
+
let i = we(n, r, e.protocol);
|
|
338
330
|
i.valid || t.addIssue({
|
|
339
|
-
code:
|
|
331
|
+
code: X.ZodIssueCode.custom,
|
|
340
332
|
message: i.error || "Invalid port range",
|
|
341
333
|
path: ["portFrom"]
|
|
342
334
|
});
|
|
343
335
|
}
|
|
344
336
|
} else {
|
|
345
|
-
let r =
|
|
337
|
+
let r = we(n, n, e.protocol);
|
|
346
338
|
r.valid || t.addIssue({
|
|
347
|
-
code:
|
|
339
|
+
code: X.ZodIssueCode.custom,
|
|
348
340
|
message: r.error || "Invalid port",
|
|
349
341
|
path: ["portFrom"]
|
|
350
342
|
});
|
|
@@ -353,44 +345,44 @@ var Se = "0.0.0.0/0", Ce = "::/0", we = "other-protocol", Te = Z.object({
|
|
|
353
345
|
if (r) {
|
|
354
346
|
let n = e.icmpType ? parseInt(e.icmpType, 10) : null, r = e.icmpCode ? parseInt(e.icmpCode, 10) : null;
|
|
355
347
|
if (e.icmpType && isNaN(n) && t.addIssue({
|
|
356
|
-
code:
|
|
348
|
+
code: X.ZodIssueCode.custom,
|
|
357
349
|
message: "ICMP type must be a valid number",
|
|
358
350
|
path: ["icmpType"]
|
|
359
351
|
}), e.icmpCode && isNaN(r) && t.addIssue({
|
|
360
|
-
code:
|
|
352
|
+
code: X.ZodIssueCode.custom,
|
|
361
353
|
message: "ICMP code must be a valid number",
|
|
362
354
|
path: ["icmpCode"]
|
|
363
355
|
}), e.icmpCode && !e.icmpType && t.addIssue({
|
|
364
|
-
code:
|
|
356
|
+
code: X.ZodIssueCode.custom,
|
|
365
357
|
message: "ICMP type is required when ICMP code is specified",
|
|
366
358
|
path: ["icmpType"]
|
|
367
359
|
}), n !== null || r !== null) {
|
|
368
|
-
let e =
|
|
360
|
+
let e = Te(n, r);
|
|
369
361
|
e.valid || (e.error?.includes("type") && t.addIssue({
|
|
370
|
-
code:
|
|
362
|
+
code: X.ZodIssueCode.custom,
|
|
371
363
|
message: "ICMP type must be between 0 and 255",
|
|
372
364
|
path: ["icmpType"]
|
|
373
365
|
}), e.error?.includes("code") && t.addIssue({
|
|
374
|
-
code:
|
|
366
|
+
code: X.ZodIssueCode.custom,
|
|
375
367
|
message: "ICMP code must be between 0 and 255",
|
|
376
368
|
path: ["icmpCode"]
|
|
377
369
|
}));
|
|
378
370
|
}
|
|
379
371
|
}
|
|
380
|
-
if (e.remoteSourceType === "cidr" && e.remoteCidr) if (!
|
|
381
|
-
code:
|
|
372
|
+
if (e.remoteSourceType === "cidr" && e.remoteCidr) if (!Ee(e.remoteCidr)) t.addIssue({
|
|
373
|
+
code: X.ZodIssueCode.custom,
|
|
382
374
|
message: "Invalid CIDR format. Examples: 0.0.0.0/0 (IPv4) or ::/0 (IPv6)",
|
|
383
375
|
path: ["remoteCidr"]
|
|
384
376
|
});
|
|
385
377
|
else {
|
|
386
|
-
let n =
|
|
378
|
+
let n = Ce(e.remoteCidr);
|
|
387
379
|
n && n !== e.ethertype && t.addIssue({
|
|
388
|
-
code:
|
|
380
|
+
code: X.ZodIssueCode.custom,
|
|
389
381
|
message: `CIDR family (${n}) must match Ethertype (${e.ethertype})`,
|
|
390
382
|
path: ["remoteCidr"]
|
|
391
383
|
});
|
|
392
384
|
}
|
|
393
|
-
}),
|
|
385
|
+
}), je = {
|
|
394
386
|
ruleType: "",
|
|
395
387
|
direction: "ingress",
|
|
396
388
|
ethertype: "IPv4",
|
|
@@ -401,9 +393,9 @@ var Se = "0.0.0.0/0", Ce = "::/0", we = "other-protocol", Te = Z.object({
|
|
|
401
393
|
icmpType: "",
|
|
402
394
|
icmpCode: "",
|
|
403
395
|
remoteSourceType: "cidr",
|
|
404
|
-
remoteCidr:
|
|
396
|
+
remoteCidr: De,
|
|
405
397
|
remoteSecurityGroupId: ""
|
|
406
|
-
},
|
|
398
|
+
}, Me = [
|
|
407
399
|
{
|
|
408
400
|
value: "",
|
|
409
401
|
label: "",
|
|
@@ -561,14 +553,14 @@ var Se = "0.0.0.0/0", Ce = "::/0", we = "other-protocol", Te = Z.object({
|
|
|
561
553
|
];
|
|
562
554
|
//#endregion
|
|
563
555
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/RuleTypeSection.tsx
|
|
564
|
-
function
|
|
565
|
-
let { i18n: n, _: r } =
|
|
566
|
-
return /*#__PURE__*/
|
|
556
|
+
function Ne({ form: e, disabled: t = !1 }) {
|
|
557
|
+
let { i18n: n, _: r } = Y();
|
|
558
|
+
return /*#__PURE__*/ U(e.Field, {
|
|
567
559
|
name: "ruleType",
|
|
568
560
|
mode: "value",
|
|
569
|
-
children: (r) => /*#__PURE__*/
|
|
561
|
+
children: (r) => /*#__PURE__*/ U(_, {
|
|
570
562
|
className: "mb-6",
|
|
571
|
-
children: /*#__PURE__*/
|
|
563
|
+
children: /*#__PURE__*/ U(y, {
|
|
572
564
|
id: "ruleType",
|
|
573
565
|
label: n._({ id: "YuGQWb" }),
|
|
574
566
|
value: r.state.value,
|
|
@@ -578,14 +570,14 @@ function Oe({ form: e, disabled: t = !1 }) {
|
|
|
578
570
|
e.setFieldValue("protocol", null), e.setFieldValue("portFrom", ""), e.setFieldValue("portTo", ""), e.setFieldValue("icmpType", ""), e.setFieldValue("icmpCode", "");
|
|
579
571
|
return;
|
|
580
572
|
}
|
|
581
|
-
let i =
|
|
573
|
+
let i = Me.find((e) => e.value === n);
|
|
582
574
|
i && (e.setFieldValue("protocol", i.protocol), (i.protocol === "tcp" || i.protocol === "udp") && i.portRangeMin !== null && i.portRangeMax !== null ? (e.setFieldValue("portFrom", String(i.portRangeMin)), e.setFieldValue("portTo", String(i.portRangeMax))) : (e.setFieldValue("portFrom", ""), e.setFieldValue("portTo", "")), i.protocol !== "icmp" && i.protocol !== "ipv6-icmp" && (e.setFieldValue("icmpType", ""), e.setFieldValue("icmpCode", "")));
|
|
583
575
|
},
|
|
584
576
|
disabled: t,
|
|
585
|
-
children:
|
|
577
|
+
children: Me.map((e) => e.value === "" ? /*#__PURE__*/ U(l, {
|
|
586
578
|
value: e.value,
|
|
587
579
|
label: n._({ id: "eh/k36" })
|
|
588
|
-
}, e.value) : /*#__PURE__*/
|
|
580
|
+
}, e.value) : /*#__PURE__*/ U(l, {
|
|
589
581
|
value: e.value,
|
|
590
582
|
label: e.label
|
|
591
583
|
}, e.value))
|
|
@@ -595,23 +587,23 @@ function Oe({ form: e, disabled: t = !1 }) {
|
|
|
595
587
|
}
|
|
596
588
|
//#endregion
|
|
597
589
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/DirectionEthertypeSection.tsx
|
|
598
|
-
function
|
|
599
|
-
let { i18n: n, _: r } =
|
|
600
|
-
return /*#__PURE__*/
|
|
590
|
+
function Pe({ form: e, disabled: t = !1 }) {
|
|
591
|
+
let { i18n: n, _: r } = Y();
|
|
592
|
+
return /*#__PURE__*/ U(e.Field, {
|
|
601
593
|
name: "direction",
|
|
602
|
-
children: (e) => /*#__PURE__*/
|
|
594
|
+
children: (e) => /*#__PURE__*/ U(_, { children: /*#__PURE__*/ U(A, {
|
|
603
595
|
name: "direction",
|
|
604
596
|
label: n._({ id: "MRB7nI" }),
|
|
605
597
|
selected: e.state.value,
|
|
606
598
|
onChange: (t) => e.handleChange(String(t)),
|
|
607
599
|
required: !0,
|
|
608
600
|
disabled: t,
|
|
609
|
-
children: /*#__PURE__*/
|
|
601
|
+
children: /*#__PURE__*/ W("div", {
|
|
610
602
|
className: "flex gap-4",
|
|
611
|
-
children: [/*#__PURE__*/
|
|
603
|
+
children: [/*#__PURE__*/ U(m, {
|
|
612
604
|
value: "ingress",
|
|
613
605
|
label: n._({ id: "fzfAAa" })
|
|
614
|
-
}), /*#__PURE__*/
|
|
606
|
+
}), /*#__PURE__*/ U(m, {
|
|
615
607
|
value: "egress",
|
|
616
608
|
label: n._({ id: "nETBrc" })
|
|
617
609
|
})]
|
|
@@ -619,23 +611,23 @@ function ke({ form: e, disabled: t = !1 }) {
|
|
|
619
611
|
}) })
|
|
620
612
|
});
|
|
621
613
|
}
|
|
622
|
-
function
|
|
623
|
-
let { i18n: n, _: r } =
|
|
624
|
-
return /*#__PURE__*/
|
|
614
|
+
function Fe({ form: e, disabled: t = !1 }) {
|
|
615
|
+
let { i18n: n, _: r } = Y();
|
|
616
|
+
return /*#__PURE__*/ U(e.Field, {
|
|
625
617
|
name: "ethertype",
|
|
626
|
-
children: (e) => /*#__PURE__*/
|
|
618
|
+
children: (e) => /*#__PURE__*/ U(_, { children: /*#__PURE__*/ U(A, {
|
|
627
619
|
name: "ethertype",
|
|
628
620
|
label: n._({ id: "16085O" }),
|
|
629
621
|
selected: e.state.value,
|
|
630
622
|
onChange: (t) => e.handleChange(String(t)),
|
|
631
623
|
required: !0,
|
|
632
624
|
disabled: t,
|
|
633
|
-
children: /*#__PURE__*/
|
|
625
|
+
children: /*#__PURE__*/ W("div", {
|
|
634
626
|
className: "flex gap-4",
|
|
635
|
-
children: [/*#__PURE__*/
|
|
627
|
+
children: [/*#__PURE__*/ U(m, {
|
|
636
628
|
value: "IPv4",
|
|
637
629
|
label: "IPv4"
|
|
638
|
-
}), /*#__PURE__*/
|
|
630
|
+
}), /*#__PURE__*/ U(m, {
|
|
639
631
|
value: "IPv6",
|
|
640
632
|
label: "IPv6"
|
|
641
633
|
})]
|
|
@@ -645,13 +637,13 @@ function Ae({ form: e, disabled: t = !1 }) {
|
|
|
645
637
|
}
|
|
646
638
|
//#endregion
|
|
647
639
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/ProtocolSection.tsx
|
|
648
|
-
function
|
|
649
|
-
let { i18n: n, _: r } =
|
|
650
|
-
return /*#__PURE__*/
|
|
640
|
+
function Ie({ form: e, disabled: t = !1 }) {
|
|
641
|
+
let { i18n: n, _: r } = Y();
|
|
642
|
+
return /*#__PURE__*/ U(e.Field, {
|
|
651
643
|
name: "protocol",
|
|
652
|
-
children: (e) => /*#__PURE__*/
|
|
644
|
+
children: (e) => /*#__PURE__*/ U(_, {
|
|
653
645
|
className: "mb-6",
|
|
654
|
-
children: /*#__PURE__*/
|
|
646
|
+
children: /*#__PURE__*/ U(S, {
|
|
655
647
|
id: "protocol",
|
|
656
648
|
name: "protocol",
|
|
657
649
|
label: n._({ id: "6+OdGi" }),
|
|
@@ -666,19 +658,19 @@ function je({ form: e, disabled: t = !1 }) {
|
|
|
666
658
|
}
|
|
667
659
|
//#endregion
|
|
668
660
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/PortRangeSection.tsx
|
|
669
|
-
function
|
|
670
|
-
let { i18n: n, _: r } =
|
|
671
|
-
return /*#__PURE__*/
|
|
661
|
+
function Le({ form: e, disabled: t = !1 }) {
|
|
662
|
+
let { i18n: n, _: r } = Y(), i = Q(e.store, (e) => e.values.portFrom), a = Q(e.store, (e) => e.fieldMeta.portFrom?.errors[0]?.message), o = Q(e.store, (e) => e.fieldMeta.portTo?.errors[0]?.message), s = t || !i || i.trim() === "";
|
|
663
|
+
return /*#__PURE__*/ W(_, {
|
|
672
664
|
className: "mb-6",
|
|
673
665
|
children: [
|
|
674
|
-
/*#__PURE__*/
|
|
666
|
+
/*#__PURE__*/ W("div", {
|
|
675
667
|
className: "flex items-center gap-4",
|
|
676
668
|
children: [
|
|
677
|
-
/*#__PURE__*/
|
|
669
|
+
/*#__PURE__*/ U(e.Field, {
|
|
678
670
|
name: "portFrom",
|
|
679
|
-
children: (r) => /*#__PURE__*/
|
|
671
|
+
children: (r) => /*#__PURE__*/ U("div", {
|
|
680
672
|
className: "flex-1",
|
|
681
|
-
children: /*#__PURE__*/
|
|
673
|
+
children: /*#__PURE__*/ U(S, {
|
|
682
674
|
id: "portFrom",
|
|
683
675
|
name: "portFrom",
|
|
684
676
|
label: n._({ id: "LMdsuJ" }),
|
|
@@ -693,15 +685,15 @@ function Me({ form: e, disabled: t = !1 }) {
|
|
|
693
685
|
})
|
|
694
686
|
})
|
|
695
687
|
}),
|
|
696
|
-
/*#__PURE__*/
|
|
688
|
+
/*#__PURE__*/ U("div", {
|
|
697
689
|
className: "text-theme-secondary flex items-center justify-center",
|
|
698
690
|
children: "—"
|
|
699
691
|
}),
|
|
700
|
-
/*#__PURE__*/
|
|
692
|
+
/*#__PURE__*/ U(e.Field, {
|
|
701
693
|
name: "portTo",
|
|
702
|
-
children: (t) => /*#__PURE__*/
|
|
694
|
+
children: (t) => /*#__PURE__*/ U("div", {
|
|
703
695
|
className: "flex-1",
|
|
704
|
-
children: /*#__PURE__*/
|
|
696
|
+
children: /*#__PURE__*/ U(S, {
|
|
705
697
|
id: "portTo",
|
|
706
698
|
name: "portTo",
|
|
707
699
|
label: n._({ id: "a12lSo" }),
|
|
@@ -717,11 +709,11 @@ function Me({ form: e, disabled: t = !1 }) {
|
|
|
717
709
|
})
|
|
718
710
|
]
|
|
719
711
|
}),
|
|
720
|
-
(a || o) && /*#__PURE__*/
|
|
712
|
+
(a || o) && /*#__PURE__*/ W("div", {
|
|
721
713
|
className: "text-theme-error mt-2 text-sm",
|
|
722
|
-
children: [a && /*#__PURE__*/
|
|
714
|
+
children: [a && /*#__PURE__*/ U("div", { children: a }), o && /*#__PURE__*/ U("div", { children: o })]
|
|
723
715
|
}),
|
|
724
|
-
/*#__PURE__*/
|
|
716
|
+
/*#__PURE__*/ U("p", {
|
|
725
717
|
className: "mt-2 text-sm",
|
|
726
718
|
children: n._({ id: "QAUa4B" })
|
|
727
719
|
})
|
|
@@ -730,17 +722,17 @@ function Me({ form: e, disabled: t = !1 }) {
|
|
|
730
722
|
}
|
|
731
723
|
//#endregion
|
|
732
724
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/IcmpSection.tsx
|
|
733
|
-
function
|
|
734
|
-
let { i18n: n, _: r } =
|
|
735
|
-
return /*#__PURE__*/
|
|
725
|
+
function Re({ form: e, disabled: t = !1 }) {
|
|
726
|
+
let { i18n: n, _: r } = Y();
|
|
727
|
+
return /*#__PURE__*/ U(_, {
|
|
736
728
|
className: "mb-6",
|
|
737
|
-
children: /*#__PURE__*/
|
|
729
|
+
children: /*#__PURE__*/ W("div", {
|
|
738
730
|
className: "flex w-full gap-4",
|
|
739
|
-
children: [/*#__PURE__*/
|
|
731
|
+
children: [/*#__PURE__*/ U(e.Field, {
|
|
740
732
|
name: "icmpType",
|
|
741
|
-
children: (e) => /*#__PURE__*/
|
|
733
|
+
children: (e) => /*#__PURE__*/ U("div", {
|
|
742
734
|
className: "flex-1",
|
|
743
|
-
children: /*#__PURE__*/
|
|
735
|
+
children: /*#__PURE__*/ U(S, {
|
|
744
736
|
id: "icmpType",
|
|
745
737
|
name: "icmpType",
|
|
746
738
|
label: n._({ id: "yPWFWy" }),
|
|
@@ -751,11 +743,11 @@ function Ne({ form: e, disabled: t = !1 }) {
|
|
|
751
743
|
disabled: t
|
|
752
744
|
})
|
|
753
745
|
})
|
|
754
|
-
}), /*#__PURE__*/
|
|
746
|
+
}), /*#__PURE__*/ U(e.Field, {
|
|
755
747
|
name: "icmpCode",
|
|
756
|
-
children: (e) => /*#__PURE__*/
|
|
748
|
+
children: (e) => /*#__PURE__*/ U("div", {
|
|
757
749
|
className: "flex-1",
|
|
758
|
-
children: /*#__PURE__*/
|
|
750
|
+
children: /*#__PURE__*/ U(S, {
|
|
759
751
|
id: "icmpCode",
|
|
760
752
|
name: "icmpCode",
|
|
761
753
|
label: n._({ id: "76RKuS" }),
|
|
@@ -772,15 +764,15 @@ function Ne({ form: e, disabled: t = !1 }) {
|
|
|
772
764
|
}
|
|
773
765
|
//#endregion
|
|
774
766
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/RemoteSourceSection.tsx
|
|
775
|
-
function
|
|
776
|
-
let { i18n: r, _: i } =
|
|
777
|
-
return /*#__PURE__*/
|
|
778
|
-
/*#__PURE__*/
|
|
767
|
+
function ze({ form: e, disabled: t = !1, availableSecurityGroups: n }) {
|
|
768
|
+
let { i18n: r, _: i } = Y();
|
|
769
|
+
return /*#__PURE__*/ W(H, { children: [
|
|
770
|
+
/*#__PURE__*/ U(e.Field, {
|
|
779
771
|
name: "remoteSourceType",
|
|
780
772
|
mode: "value",
|
|
781
|
-
children: (n) => /*#__PURE__*/
|
|
773
|
+
children: (n) => /*#__PURE__*/ U(_, {
|
|
782
774
|
className: "mb-1",
|
|
783
|
-
children: /*#__PURE__*/
|
|
775
|
+
children: /*#__PURE__*/ U(A, {
|
|
784
776
|
name: "remoteSourceType",
|
|
785
777
|
label: r._({ id: "I5kZVK" }),
|
|
786
778
|
selected: n.state.value,
|
|
@@ -789,12 +781,12 @@ function Pe({ form: e, disabled: t = !1, availableSecurityGroups: n }) {
|
|
|
789
781
|
n.handleChange(r), r !== "security_group" && e.setFieldValue("ethertype", "IPv4");
|
|
790
782
|
},
|
|
791
783
|
disabled: t,
|
|
792
|
-
children: /*#__PURE__*/
|
|
784
|
+
children: /*#__PURE__*/ W("div", {
|
|
793
785
|
className: "flex gap-4",
|
|
794
|
-
children: [/*#__PURE__*/
|
|
786
|
+
children: [/*#__PURE__*/ U(m, {
|
|
795
787
|
value: "cidr",
|
|
796
788
|
label: r._({ id: "4uXhtt" })
|
|
797
|
-
}), /*#__PURE__*/
|
|
789
|
+
}), /*#__PURE__*/ U(m, {
|
|
798
790
|
value: "security_group",
|
|
799
791
|
label: r._({ id: "bwhBhT" })
|
|
800
792
|
})]
|
|
@@ -802,45 +794,45 @@ function Pe({ form: e, disabled: t = !1, availableSecurityGroups: n }) {
|
|
|
802
794
|
})
|
|
803
795
|
})
|
|
804
796
|
}),
|
|
805
|
-
/*#__PURE__*/
|
|
797
|
+
/*#__PURE__*/ U(e.Field, {
|
|
806
798
|
name: "remoteSourceType",
|
|
807
|
-
children: (n) => n.state.value === "cidr" ? /*#__PURE__*/
|
|
799
|
+
children: (n) => n.state.value === "cidr" ? /*#__PURE__*/ U(e.Field, {
|
|
808
800
|
name: "remoteCidr",
|
|
809
|
-
children: (n) => /*#__PURE__*/
|
|
801
|
+
children: (n) => /*#__PURE__*/ U(e.Field, {
|
|
810
802
|
name: "ethertype",
|
|
811
|
-
children: (e) => /*#__PURE__*/
|
|
803
|
+
children: (e) => /*#__PURE__*/ U(_, {
|
|
812
804
|
className: "mb-6",
|
|
813
|
-
children: /*#__PURE__*/
|
|
805
|
+
children: /*#__PURE__*/ U(S, {
|
|
814
806
|
id: "remoteCidr",
|
|
815
807
|
name: "remoteCidr",
|
|
816
808
|
label: r._({ id: "vmYyLY" }),
|
|
817
809
|
value: n.state.value,
|
|
818
810
|
onChange: (e) => n.handleChange(e.target.value),
|
|
819
811
|
errortext: n.state.meta.errors[0]?.message,
|
|
820
|
-
placeholder: e.state.value === "IPv4" ?
|
|
812
|
+
placeholder: e.state.value === "IPv4" ? De : Oe,
|
|
821
813
|
disabled: t
|
|
822
814
|
})
|
|
823
815
|
})
|
|
824
816
|
})
|
|
825
817
|
}) : null
|
|
826
818
|
}),
|
|
827
|
-
/*#__PURE__*/
|
|
819
|
+
/*#__PURE__*/ U(e.Field, {
|
|
828
820
|
name: "remoteSourceType",
|
|
829
|
-
children: (i) => i.state.value === "security_group" ? /*#__PURE__*/
|
|
821
|
+
children: (i) => i.state.value === "security_group" ? /*#__PURE__*/ U(e.Field, {
|
|
830
822
|
name: "remoteSecurityGroupId",
|
|
831
|
-
children: (e) => /*#__PURE__*/
|
|
823
|
+
children: (e) => /*#__PURE__*/ U(_, {
|
|
832
824
|
className: "mb-6",
|
|
833
|
-
children: /*#__PURE__*/
|
|
825
|
+
children: /*#__PURE__*/ W(y, {
|
|
834
826
|
id: "remoteSecurityGroupId",
|
|
835
827
|
label: r._({ id: "i9TIyi" }),
|
|
836
828
|
value: e.state.value,
|
|
837
829
|
onChange: (t) => e.handleChange(String(t)),
|
|
838
830
|
errortext: e.state.meta.errors[0]?.message,
|
|
839
831
|
disabled: t,
|
|
840
|
-
children: [/*#__PURE__*/
|
|
832
|
+
children: [/*#__PURE__*/ U(l, {
|
|
841
833
|
value: "",
|
|
842
834
|
label: r._({ id: "ZvIpwi" })
|
|
843
|
-
}), n.map((e) => /*#__PURE__*/
|
|
835
|
+
}), n.map((e) => /*#__PURE__*/ U(l, {
|
|
844
836
|
value: e.id,
|
|
845
837
|
label: e.name || e.id
|
|
846
838
|
}, e.id))]
|
|
@@ -852,13 +844,13 @@ function Pe({ form: e, disabled: t = !1, availableSecurityGroups: n }) {
|
|
|
852
844
|
}
|
|
853
845
|
//#endregion
|
|
854
846
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/DescriptionSection.tsx
|
|
855
|
-
function
|
|
856
|
-
let { i18n: n, _: r } =
|
|
857
|
-
return /*#__PURE__*/
|
|
847
|
+
function Be({ form: e, disabled: t = !1 }) {
|
|
848
|
+
let { i18n: n, _: r } = Y();
|
|
849
|
+
return /*#__PURE__*/ U(e.Field, {
|
|
858
850
|
name: "description",
|
|
859
|
-
children: (e) => /*#__PURE__*/
|
|
851
|
+
children: (e) => /*#__PURE__*/ U(_, {
|
|
860
852
|
className: "mb-0",
|
|
861
|
-
children: /*#__PURE__*/
|
|
853
|
+
children: /*#__PURE__*/ U(x, {
|
|
862
854
|
id: "description",
|
|
863
855
|
name: "description",
|
|
864
856
|
label: n._({ id: "Nu4oKW" }),
|
|
@@ -873,10 +865,10 @@ function Fe({ form: e, disabled: t = !1 }) {
|
|
|
873
865
|
}
|
|
874
866
|
//#endregion
|
|
875
867
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/AddRuleModal.tsx
|
|
876
|
-
var
|
|
877
|
-
let { i18n: d, _: p } =
|
|
878
|
-
defaultValues:
|
|
879
|
-
validators: { onSubmit:
|
|
868
|
+
var Ve = ({ securityGroupId: e, open: t, onClose: n, onCreate: r, isLoading: c = !1, error: l = null, availableSecurityGroups: u = [] }) => {
|
|
869
|
+
let { i18n: d, _: p } = Y(), m = Z({
|
|
870
|
+
defaultValues: je,
|
|
871
|
+
validators: { onSubmit: Ae },
|
|
880
872
|
onSubmit: async ({ value: t }) => {
|
|
881
873
|
if (c) return;
|
|
882
874
|
let n = {
|
|
@@ -896,87 +888,85 @@ var Ie = ({ securityGroupId: e, open: t, onClose: n, onCreate: r, isLoading: c =
|
|
|
896
888
|
(t.protocol === "icmp" || t.protocol === "ipv6-icmp") && (t.icmpType && (n.port_range_min = parseInt(t.icmpType, 10)), t.icmpCode && (n.port_range_max = parseInt(t.icmpCode, 10))), t.remoteSourceType === "cidr" && t.remoteCidr ? n.remote_ip_prefix = t.remoteCidr : t.remoteSourceType === "security_group" && t.remoteSecurityGroupId && (n.remote_group_id = t.remoteSecurityGroupId), await r(n), g();
|
|
897
889
|
}
|
|
898
890
|
}), g = () => {
|
|
899
|
-
|
|
891
|
+
m.reset(), n();
|
|
900
892
|
};
|
|
901
|
-
return /*#__PURE__*/
|
|
893
|
+
return /*#__PURE__*/ W(f, {
|
|
902
894
|
open: t,
|
|
903
895
|
onCancel: g,
|
|
904
896
|
size: "large",
|
|
905
897
|
title: d._({ id: "b2BLBa" }),
|
|
906
|
-
modalFooter: /*#__PURE__*/
|
|
898
|
+
modalFooter: /*#__PURE__*/ U(s, {
|
|
907
899
|
className: "flex justify-end",
|
|
908
|
-
children: /*#__PURE__*/
|
|
900
|
+
children: /*#__PURE__*/ U(m.Subscribe, { children: (e) => {
|
|
909
901
|
let t = !!e.values.ruleType;
|
|
910
|
-
return /*#__PURE__*/
|
|
902
|
+
return /*#__PURE__*/ W(o, { children: [/*#__PURE__*/ U(v, {
|
|
911
903
|
variant: "default",
|
|
912
904
|
onClick: g,
|
|
913
905
|
disabled: c || e.isSubmitting,
|
|
914
|
-
children: /*#__PURE__*/
|
|
915
|
-
}), /*#__PURE__*/
|
|
906
|
+
children: /*#__PURE__*/ U(J, { id: "dEgA5A" })
|
|
907
|
+
}), /*#__PURE__*/ U(v, {
|
|
916
908
|
variant: "primary",
|
|
917
909
|
type: "button",
|
|
918
|
-
onClick: () =>
|
|
910
|
+
onClick: () => m.handleSubmit(),
|
|
919
911
|
disabled: c || e.isSubmitting || !t,
|
|
920
912
|
"data-testid": "add-rule-button",
|
|
921
|
-
children: e.isSubmitting || c ? /*#__PURE__*/
|
|
913
|
+
children: e.isSubmitting || c ? /*#__PURE__*/ U(i, { size: "small" }) : /*#__PURE__*/ U(J, { id: "bmQLn5" })
|
|
922
914
|
})] });
|
|
923
915
|
} })
|
|
924
916
|
}),
|
|
925
917
|
children: [
|
|
926
|
-
l && /*#__PURE__*/
|
|
918
|
+
l && /*#__PURE__*/ U(a, {
|
|
927
919
|
dismissible: !1,
|
|
928
920
|
variant: "error",
|
|
929
921
|
className: "mb-4",
|
|
930
922
|
children: l
|
|
931
923
|
}),
|
|
932
|
-
c && /*#__PURE__*/
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
children: /*#__PURE__*/ W(Y, { id: "gU7JFm" })
|
|
937
|
-
})]
|
|
924
|
+
c && /*#__PURE__*/ U(D, {
|
|
925
|
+
status: "progress",
|
|
926
|
+
title: d._({ id: "9RslTb" }),
|
|
927
|
+
className: "mt-0"
|
|
938
928
|
}),
|
|
939
|
-
/*#__PURE__*/
|
|
929
|
+
/*#__PURE__*/ U(h, {
|
|
940
930
|
className: "mb-6",
|
|
941
931
|
onSubmit: (e) => {
|
|
942
|
-
e.preventDefault(),
|
|
932
|
+
e.preventDefault(), m.handleSubmit();
|
|
943
933
|
},
|
|
944
|
-
children: /*#__PURE__*/
|
|
934
|
+
children: /*#__PURE__*/ W(E, {
|
|
945
935
|
className: "mb-6",
|
|
946
|
-
children: [/*#__PURE__*/
|
|
947
|
-
form:
|
|
936
|
+
children: [/*#__PURE__*/ U(Ne, {
|
|
937
|
+
form: m,
|
|
948
938
|
disabled: c
|
|
949
|
-
}), /*#__PURE__*/
|
|
939
|
+
}), /*#__PURE__*/ U(m.Subscribe, { children: (e) => {
|
|
950
940
|
if (!e.values.ruleType) return null;
|
|
951
941
|
let t = (e.values.protocol === "tcp" || e.values.protocol === "udp") && ["custom-tcp", "custom-udp"].includes(e.values.ruleType), n = e.values.protocol === "icmp" || e.values.protocol === "ipv6-icmp";
|
|
952
|
-
return /*#__PURE__*/
|
|
953
|
-
/*#__PURE__*/
|
|
954
|
-
form:
|
|
942
|
+
return /*#__PURE__*/ W(H, { children: [
|
|
943
|
+
/*#__PURE__*/ U(Pe, {
|
|
944
|
+
form: m,
|
|
955
945
|
disabled: c
|
|
956
946
|
}),
|
|
957
|
-
e.values.ruleType === "other-protocol" && /*#__PURE__*/
|
|
958
|
-
form:
|
|
947
|
+
e.values.ruleType === "other-protocol" && /*#__PURE__*/ U(Ie, {
|
|
948
|
+
form: m,
|
|
959
949
|
disabled: c
|
|
960
950
|
}),
|
|
961
|
-
t && /*#__PURE__*/
|
|
962
|
-
form:
|
|
951
|
+
t && /*#__PURE__*/ U(Le, {
|
|
952
|
+
form: m,
|
|
963
953
|
disabled: c
|
|
964
954
|
}),
|
|
965
|
-
n && /*#__PURE__*/
|
|
966
|
-
form:
|
|
955
|
+
n && /*#__PURE__*/ U(Re, {
|
|
956
|
+
form: m,
|
|
967
957
|
disabled: c
|
|
968
958
|
}),
|
|
969
|
-
/*#__PURE__*/
|
|
970
|
-
form:
|
|
959
|
+
/*#__PURE__*/ U(ze, {
|
|
960
|
+
form: m,
|
|
971
961
|
disabled: c,
|
|
972
962
|
availableSecurityGroups: u
|
|
973
963
|
}),
|
|
974
|
-
e.values.remoteSourceType === "security_group" && /*#__PURE__*/
|
|
975
|
-
form:
|
|
964
|
+
e.values.remoteSourceType === "security_group" && /*#__PURE__*/ U(Fe, {
|
|
965
|
+
form: m,
|
|
976
966
|
disabled: c
|
|
977
967
|
}),
|
|
978
|
-
/*#__PURE__*/
|
|
979
|
-
form:
|
|
968
|
+
/*#__PURE__*/ U(Be, {
|
|
969
|
+
form: m,
|
|
980
970
|
disabled: c
|
|
981
971
|
})
|
|
982
972
|
] });
|
|
@@ -985,192 +975,185 @@ var Ie = ({ securityGroupId: e, open: t, onClose: n, onCreate: r, isLoading: c =
|
|
|
985
975
|
})
|
|
986
976
|
]
|
|
987
977
|
});
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
978
|
+
}, He = /* @__PURE__ */ new Set([
|
|
979
|
+
"icmp",
|
|
980
|
+
"1",
|
|
981
|
+
"ipv6-icmp",
|
|
982
|
+
"icmpv6",
|
|
983
|
+
"58"
|
|
984
|
+
]);
|
|
985
|
+
function Ue(e) {
|
|
986
|
+
return e != null && He.has(e.toLowerCase());
|
|
987
|
+
}
|
|
988
|
+
function We({ rules: e, onDeleteRule: r, isDeletingRule: i, deleteError: a, searchTerm: o = "", onSearchChange: s, sortSettings: l, onSortChange: f, filterSettings: p, onFilterChange: m, securityGroupId: h, onCreateRule: _, isCreatingRule: y = !1, createRuleError: x = null, availableSecurityGroups: S = [], canCreateRule: C, canDeleteRule: T }) {
|
|
989
|
+
let { i18n: E, _: O } = Y(), [A, M] = q(null), [N, P] = te(), [I, ee] = q(o), L = _e(void 0);
|
|
993
990
|
K(() => () => clearTimeout(L.current), []);
|
|
994
|
-
let
|
|
991
|
+
let ne = (e) => {
|
|
995
992
|
M(e);
|
|
996
|
-
},
|
|
997
|
-
|
|
998
|
-
},
|
|
999
|
-
|
|
993
|
+
}, ae = (e) => {
|
|
994
|
+
r(e);
|
|
995
|
+
}, oe = () => {
|
|
996
|
+
i || M(null);
|
|
1000
997
|
};
|
|
1001
998
|
K(() => {
|
|
1002
|
-
!
|
|
1003
|
-
}, [
|
|
1004
|
-
let
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
999
|
+
!i && !a && M(null);
|
|
1000
|
+
}, [i, a]);
|
|
1001
|
+
let se = (e) => {
|
|
1002
|
+
let t = e.port_range_min, n = e.port_range_max;
|
|
1003
|
+
if (Ue(e.protocol)) {
|
|
1004
|
+
let e = t, r = n;
|
|
1005
|
+
return e == null ? E._({ id: "h47p9L" }) : r == null ? E._({
|
|
1006
|
+
id: "3BgEOh",
|
|
1007
|
+
values: { typeValue: e }
|
|
1008
|
+
}) : E._({
|
|
1009
|
+
id: "0p+s6m",
|
|
1010
|
+
values: {
|
|
1011
|
+
typeValue: e,
|
|
1012
|
+
codeValue: r
|
|
1013
|
+
}
|
|
1014
|
+
});
|
|
1017
1015
|
}
|
|
1018
|
-
return
|
|
1019
|
-
},
|
|
1020
|
-
return /*#__PURE__*/
|
|
1021
|
-
/*#__PURE__*/
|
|
1016
|
+
return t == null || n == null ? E._({ id: "h47p9L" }) : t === n ? String(t) : `${t}-${n}`;
|
|
1017
|
+
}, R = T ? 6 : 5;
|
|
1018
|
+
return /*#__PURE__*/ W(H, { children: [
|
|
1019
|
+
/*#__PURE__*/ W(c, {
|
|
1020
|
+
distribution: "end",
|
|
1021
|
+
alignment: "center",
|
|
1022
|
+
gap: "2",
|
|
1023
|
+
className: "pb-2",
|
|
1024
|
+
children: [l && f && /*#__PURE__*/ U(F, {
|
|
1025
|
+
options: l.options,
|
|
1026
|
+
sortBy: l.sortBy,
|
|
1027
|
+
sortDirection: l.sortDirection ?? "asc",
|
|
1028
|
+
selectClassName: "min-w-40",
|
|
1029
|
+
onSortByChange: (e) => f({
|
|
1030
|
+
...l,
|
|
1031
|
+
sortBy: e,
|
|
1032
|
+
sortDirection: l.sortDirection
|
|
1033
|
+
}),
|
|
1034
|
+
onSortDirectionChange: (e) => f({
|
|
1035
|
+
...l,
|
|
1036
|
+
sortDirection: e
|
|
1037
|
+
})
|
|
1038
|
+
}), C && _ && /*#__PURE__*/ U(v, {
|
|
1039
|
+
variant: "primary",
|
|
1040
|
+
onClick: P,
|
|
1041
|
+
className: "whitespace-nowrap",
|
|
1042
|
+
children: /*#__PURE__*/ U(J, { id: "bmQLn5" })
|
|
1043
|
+
})]
|
|
1044
|
+
}),
|
|
1045
|
+
(p || s) && /*#__PURE__*/ U(b, { children: /*#__PURE__*/ W(c, {
|
|
1022
1046
|
direction: "vertical",
|
|
1023
|
-
gap: "
|
|
1024
|
-
children: [
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
icon: "addCircle",
|
|
1061
|
-
onClick: P,
|
|
1062
|
-
className: "whitespace-nowrap",
|
|
1063
|
-
children: /*#__PURE__*/ W(Y, { id: "O8tK4v" })
|
|
1064
|
-
})]
|
|
1065
|
-
})]
|
|
1047
|
+
gap: "2",
|
|
1048
|
+
children: [/*#__PURE__*/ W(c, {
|
|
1049
|
+
distribution: "between",
|
|
1050
|
+
alignment: "center",
|
|
1051
|
+
children: [p && m && /*#__PURE__*/ U(ie, {
|
|
1052
|
+
filters: p.filters,
|
|
1053
|
+
selectClassName: "sm:min-w-40",
|
|
1054
|
+
comboboxClassName: "sm:min-w-40",
|
|
1055
|
+
onChange: (e) => {
|
|
1056
|
+
if ((p.selectedFilters || []).some((t) => t.name === e.name && t.value === e.value)) return;
|
|
1057
|
+
let t = p.filters.find((t) => t.filterName === e.name)?.supportsMultiValue ? [...p.selectedFilters || [], e] : [...(p.selectedFilters || []).filter((t) => t.name !== e.name), e];
|
|
1058
|
+
m({
|
|
1059
|
+
...p,
|
|
1060
|
+
selectedFilters: t
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
}), s && /*#__PURE__*/ U(t, {
|
|
1064
|
+
className: "w-60 sm:w-68",
|
|
1065
|
+
placeholder: E._({ id: "HMV+cw" }),
|
|
1066
|
+
"data-testid": "searchbar",
|
|
1067
|
+
value: I,
|
|
1068
|
+
onInput: (e) => {
|
|
1069
|
+
let t = e.currentTarget.value;
|
|
1070
|
+
ee(t), clearTimeout(L.current), L.current = window.setTimeout(() => s(t), 500);
|
|
1071
|
+
},
|
|
1072
|
+
onSearch: (e) => {
|
|
1073
|
+
clearTimeout(L.current), s(typeof e == "string" ? e : "");
|
|
1074
|
+
},
|
|
1075
|
+
onClear: () => {
|
|
1076
|
+
clearTimeout(L.current), ee(""), s("");
|
|
1077
|
+
}
|
|
1078
|
+
})]
|
|
1079
|
+
}), p?.selectedFilters && p.selectedFilters.length > 0 && /*#__PURE__*/ U(re, {
|
|
1080
|
+
selectedFilters: p.selectedFilters,
|
|
1081
|
+
onDelete: (e) => m?.({
|
|
1082
|
+
...p,
|
|
1083
|
+
selectedFilters: (p.selectedFilters || []).filter((t) => t.name !== e.name || t.value !== e.value)
|
|
1066
1084
|
}),
|
|
1067
|
-
(
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
children: [/*#__PURE__*/ G(c, {
|
|
1071
|
-
distribution: "between",
|
|
1072
|
-
alignment: "center",
|
|
1073
|
-
children: [m && g && /*#__PURE__*/ W(ne, {
|
|
1074
|
-
filters: m.filters,
|
|
1075
|
-
selectClassName: "sm:min-w-40",
|
|
1076
|
-
comboboxClassName: "sm:min-w-40",
|
|
1077
|
-
onChange: (e) => {
|
|
1078
|
-
if ((m.selectedFilters || []).some((t) => t.name === e.name && t.value === e.value)) return;
|
|
1079
|
-
let t = m.filters.find((t) => t.filterName === e.name)?.supportsMultiValue ? [...m.selectedFilters || [], e] : [...(m.selectedFilters || []).filter((t) => t.name !== e.name), e];
|
|
1080
|
-
g({
|
|
1081
|
-
...m,
|
|
1082
|
-
selectedFilters: t
|
|
1083
|
-
});
|
|
1084
|
-
}
|
|
1085
|
-
}), l && /*#__PURE__*/ W(t, {
|
|
1086
|
-
placeholder: D._({ id: "HMV+cw" }),
|
|
1087
|
-
"data-testid": "searchbar",
|
|
1088
|
-
value: F,
|
|
1089
|
-
onInput: (e) => {
|
|
1090
|
-
let t = e.currentTarget.value;
|
|
1091
|
-
I(t), clearTimeout(L.current), L.current = window.setTimeout(() => l(t), 500);
|
|
1092
|
-
},
|
|
1093
|
-
onSearch: (e) => {
|
|
1094
|
-
clearTimeout(L.current), l(typeof e == "string" ? e : "");
|
|
1095
|
-
},
|
|
1096
|
-
onClear: () => {
|
|
1097
|
-
clearTimeout(L.current), I(""), l("");
|
|
1098
|
-
}
|
|
1099
|
-
})]
|
|
1100
|
-
}), m?.selectedFilters && m.selectedFilters.length > 0 && /*#__PURE__*/ W(te, {
|
|
1101
|
-
selectedFilters: m.selectedFilters,
|
|
1102
|
-
onDelete: (e) => g?.({
|
|
1103
|
-
...m,
|
|
1104
|
-
selectedFilters: (m.selectedFilters || []).filter((t) => t.name !== e.name || t.value !== e.value)
|
|
1105
|
-
}),
|
|
1106
|
-
onClear: () => g?.({
|
|
1107
|
-
...m,
|
|
1108
|
-
selectedFilters: []
|
|
1109
|
-
})
|
|
1110
|
-
})]
|
|
1111
|
-
}) }),
|
|
1112
|
-
e.length === 0 ? /*#__PURE__*/ W(Y, { id: "nnxwBn" }) : /*#__PURE__*/ G(C, {
|
|
1113
|
-
columns: E ? 6 : 5,
|
|
1114
|
-
className: "security-group-rules-table",
|
|
1115
|
-
children: [/*#__PURE__*/ G(d, { children: [
|
|
1116
|
-
/*#__PURE__*/ W(u, { children: D._({ id: "MRB7nI" }) }),
|
|
1117
|
-
/*#__PURE__*/ W(u, { children: D._({ id: "Nu4oKW" }) }),
|
|
1118
|
-
/*#__PURE__*/ W(u, { children: D._({ id: "yp0UjB" }) }),
|
|
1119
|
-
/*#__PURE__*/ W(u, { children: D._({ id: "6+OdGi" }) }),
|
|
1120
|
-
/*#__PURE__*/ W(u, { children: D._({ id: "6jAi8c" }) }),
|
|
1121
|
-
E && /*#__PURE__*/ W(u, { children: D._({ id: "7L01XJ" }) })
|
|
1122
|
-
] }), e.map((e) => /*#__PURE__*/ G(d, {
|
|
1123
|
-
"data-testid": `rule-row-${e.id}`,
|
|
1124
|
-
children: [
|
|
1125
|
-
/*#__PURE__*/ W(O, { children: e.direction || D._({ id: "h47p9L" }) }),
|
|
1126
|
-
/*#__PURE__*/ W(O, { children: e.description || D._({ id: "h47p9L" }) }),
|
|
1127
|
-
/*#__PURE__*/ W(O, { children: e.ethertype }),
|
|
1128
|
-
/*#__PURE__*/ W(O, { children: e.protocol || D._({ id: "eKC+EC" }) }),
|
|
1129
|
-
/*#__PURE__*/ W(O, { children: ie(e) }),
|
|
1130
|
-
E && /*#__PURE__*/ W(O, {
|
|
1131
|
-
onClick: (e) => e.stopPropagation(),
|
|
1132
|
-
className: "items-end justify-end pr-0",
|
|
1133
|
-
children: /*#__PURE__*/ W(n, { children: /*#__PURE__*/ W(h, { children: /*#__PURE__*/ W(A, {
|
|
1134
|
-
label: D._({ id: "cnGeoo" }),
|
|
1135
|
-
onClick: () => re(e)
|
|
1136
|
-
}) }) })
|
|
1137
|
-
})
|
|
1138
|
-
]
|
|
1139
|
-
}, e.id))]
|
|
1085
|
+
onClear: () => m?.({
|
|
1086
|
+
...p,
|
|
1087
|
+
selectedFilters: []
|
|
1140
1088
|
})
|
|
1141
|
-
]
|
|
1089
|
+
})]
|
|
1090
|
+
}) }),
|
|
1091
|
+
/*#__PURE__*/ W(w, {
|
|
1092
|
+
columns: R,
|
|
1093
|
+
className: "security-group-rules-table",
|
|
1094
|
+
children: [/*#__PURE__*/ W(d, { children: [
|
|
1095
|
+
/*#__PURE__*/ U(u, { children: E._({ id: "MRB7nI" }) }),
|
|
1096
|
+
/*#__PURE__*/ U(u, { children: E._({ id: "Nu4oKW" }) }),
|
|
1097
|
+
/*#__PURE__*/ U(u, { children: E._({ id: "yp0UjB" }) }),
|
|
1098
|
+
/*#__PURE__*/ U(u, { children: E._({ id: "6+OdGi" }) }),
|
|
1099
|
+
/*#__PURE__*/ U(u, { children: E._({ id: "6jAi8c" }) }),
|
|
1100
|
+
T && /*#__PURE__*/ U(u, {})
|
|
1101
|
+
] }), e.length === 0 ? /*#__PURE__*/ U(d, { children: /*#__PURE__*/ U(k, {
|
|
1102
|
+
colSpan: R,
|
|
1103
|
+
children: /*#__PURE__*/ U(D, {
|
|
1104
|
+
status: "empty",
|
|
1105
|
+
title: E._({ id: "nnxwBn" })
|
|
1106
|
+
})
|
|
1107
|
+
}) }) : e.map((e) => /*#__PURE__*/ W(d, {
|
|
1108
|
+
"data-testid": `rule-row-${e.id}`,
|
|
1109
|
+
children: [
|
|
1110
|
+
/*#__PURE__*/ U(k, { children: e.direction || E._({ id: "h47p9L" }) }),
|
|
1111
|
+
/*#__PURE__*/ U(k, { children: e.description || E._({ id: "h47p9L" }) }),
|
|
1112
|
+
/*#__PURE__*/ U(k, { children: e.ethertype }),
|
|
1113
|
+
/*#__PURE__*/ U(k, { children: e.protocol || E._({ id: "h47p9L" }) }),
|
|
1114
|
+
/*#__PURE__*/ U(k, { children: se(e) }),
|
|
1115
|
+
T && /*#__PURE__*/ U(k, {
|
|
1116
|
+
onClick: (e) => e.stopPropagation(),
|
|
1117
|
+
className: "items-end pr-0",
|
|
1118
|
+
children: /*#__PURE__*/ U(n, { children: /*#__PURE__*/ U(g, { children: /*#__PURE__*/ U(j, {
|
|
1119
|
+
label: E._({ id: "lN3xvy" }),
|
|
1120
|
+
onClick: () => ne(e)
|
|
1121
|
+
}) }) })
|
|
1122
|
+
})
|
|
1123
|
+
]
|
|
1124
|
+
}, e.id))]
|
|
1142
1125
|
}),
|
|
1143
|
-
|
|
1144
|
-
rule:
|
|
1145
|
-
open: !!
|
|
1146
|
-
onClose:
|
|
1147
|
-
onConfirm:
|
|
1148
|
-
isLoading:
|
|
1149
|
-
error:
|
|
1126
|
+
T && /*#__PURE__*/ U(Se, {
|
|
1127
|
+
rule: A,
|
|
1128
|
+
open: !!A,
|
|
1129
|
+
onClose: oe,
|
|
1130
|
+
onConfirm: ae,
|
|
1131
|
+
isLoading: i,
|
|
1132
|
+
error: a
|
|
1150
1133
|
}),
|
|
1151
|
-
|
|
1152
|
-
securityGroupId:
|
|
1134
|
+
C && h && _ && N && /*#__PURE__*/ U(Ve, {
|
|
1135
|
+
securityGroupId: h,
|
|
1153
1136
|
open: N,
|
|
1154
1137
|
onClose: P,
|
|
1155
|
-
onCreate:
|
|
1156
|
-
isLoading:
|
|
1157
|
-
error:
|
|
1158
|
-
availableSecurityGroups:
|
|
1138
|
+
onCreate: _,
|
|
1139
|
+
isLoading: y,
|
|
1140
|
+
error: x,
|
|
1141
|
+
availableSecurityGroups: S
|
|
1159
1142
|
})
|
|
1160
1143
|
] });
|
|
1161
1144
|
}
|
|
1162
1145
|
//#endregion
|
|
1163
1146
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/RBACPolicyRow.tsx
|
|
1164
|
-
function
|
|
1165
|
-
let { i18n: i, _: a } =
|
|
1166
|
-
return /*#__PURE__*/
|
|
1167
|
-
/*#__PURE__*/
|
|
1168
|
-
/*#__PURE__*/
|
|
1169
|
-
/*#__PURE__*/
|
|
1147
|
+
function Ge({ policy: e, onDelete: t, canDelete: r }) {
|
|
1148
|
+
let { i18n: i, _: a } = Y();
|
|
1149
|
+
return /*#__PURE__*/ W(d, { children: [
|
|
1150
|
+
/*#__PURE__*/ U(k, { children: e.target_tenant }),
|
|
1151
|
+
/*#__PURE__*/ U(k, { children: e.action }),
|
|
1152
|
+
/*#__PURE__*/ U(k, {
|
|
1170
1153
|
onClick: (e) => e.stopPropagation(),
|
|
1171
|
-
className: "items-end
|
|
1172
|
-
children: r && /*#__PURE__*/
|
|
1173
|
-
label: i._({ id: "
|
|
1154
|
+
className: "items-end pr-0",
|
|
1155
|
+
children: r && /*#__PURE__*/ U(n, { children: /*#__PURE__*/ U(g, { children: /*#__PURE__*/ U(j, {
|
|
1156
|
+
label: i._({ id: "qh5W8q" }),
|
|
1174
1157
|
onClick: t
|
|
1175
1158
|
}) }) })
|
|
1176
1159
|
})
|
|
@@ -1178,12 +1161,12 @@ function Re({ policy: e, onDelete: t, canDelete: r }) {
|
|
|
1178
1161
|
}
|
|
1179
1162
|
//#endregion
|
|
1180
1163
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRBACPolicyModal.tsx
|
|
1181
|
-
var
|
|
1182
|
-
function
|
|
1183
|
-
return
|
|
1164
|
+
var Ke = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, qe = /^[0-9a-f]{32}$/i;
|
|
1165
|
+
function Je(e) {
|
|
1166
|
+
return Ke.test(e) || qe.test(e);
|
|
1184
1167
|
}
|
|
1185
|
-
function
|
|
1186
|
-
let { i18n: r, _: i } =
|
|
1168
|
+
function Ye({ isOpen: e, onClose: t, securityGroupId: n }) {
|
|
1169
|
+
let { i18n: r, _: i } = Y(), o = M.useUtils(), s = P(), [c, l] = q(!1), u = X.object({ targetTenant: X.string().min(1, r._({ id: "1RwosK" })).refine(Je, { message: r._({ id: "CunRry" }) }) }), d = M.network.rbacPolicy.create.useMutation({
|
|
1187
1170
|
onSuccess: (e, t) => {
|
|
1188
1171
|
o.network.rbacPolicy.list.invalidate({
|
|
1189
1172
|
project_id: s,
|
|
@@ -1192,14 +1175,14 @@ function He({ isOpen: e, onClose: t, securityGroupId: n }) {
|
|
|
1192
1175
|
project_id: s,
|
|
1193
1176
|
securityGroupId: n
|
|
1194
1177
|
});
|
|
1195
|
-
let { message: r, ...i } =
|
|
1196
|
-
|
|
1178
|
+
let { message: r, ...i } = ae(t.targetTenant);
|
|
1179
|
+
T.success(r, i), m();
|
|
1197
1180
|
},
|
|
1198
1181
|
onError: (e) => {
|
|
1199
|
-
let { message: t, ...n } =
|
|
1200
|
-
|
|
1182
|
+
let { message: t, ...n } = le(e.message);
|
|
1183
|
+
T.error(t, n);
|
|
1201
1184
|
}
|
|
1202
|
-
}), p =
|
|
1185
|
+
}), p = Z({
|
|
1203
1186
|
defaultValues: { targetTenant: "" },
|
|
1204
1187
|
validators: { onSubmit: u },
|
|
1205
1188
|
onSubmit: async ({ value: e }) => {
|
|
@@ -1209,22 +1192,22 @@ function He({ isOpen: e, onClose: t, securityGroupId: n }) {
|
|
|
1209
1192
|
targetTenant: e.targetTenant.trim()
|
|
1210
1193
|
});
|
|
1211
1194
|
}
|
|
1212
|
-
}),
|
|
1195
|
+
}), m = () => {
|
|
1213
1196
|
p.reset(), d.reset(), l(!1), t();
|
|
1214
1197
|
}, g = async () => {
|
|
1215
1198
|
l(!0), await p.handleSubmit();
|
|
1216
1199
|
};
|
|
1217
|
-
return /*#__PURE__*/
|
|
1200
|
+
return /*#__PURE__*/ W(f, {
|
|
1218
1201
|
open: e,
|
|
1219
|
-
onCancel:
|
|
1202
|
+
onCancel: m,
|
|
1220
1203
|
title: r._({ id: "vmRPFm" }),
|
|
1221
1204
|
size: "large",
|
|
1222
1205
|
onConfirm: g,
|
|
1223
1206
|
cancelButtonLabel: r._({ id: "dEgA5A" }),
|
|
1224
|
-
confirmButtonLabel: r._({ id: "
|
|
1207
|
+
confirmButtonLabel: r._({ id: "1G4zXb" }),
|
|
1225
1208
|
disableConfirmButton: d.isPending,
|
|
1226
1209
|
children: [
|
|
1227
|
-
d.error && /*#__PURE__*/
|
|
1210
|
+
d.error && /*#__PURE__*/ U(a, {
|
|
1228
1211
|
variant: "error",
|
|
1229
1212
|
className: "mb-4",
|
|
1230
1213
|
children: (() => {
|
|
@@ -1232,33 +1215,33 @@ function He({ isOpen: e, onClose: t, securityGroupId: n }) {
|
|
|
1232
1215
|
return e.includes("conflict") || e.includes("409") ? r._({ id: "rbuO5A" }) : e.includes("not found") || e.includes("404") ? r._({ id: "FwSyEp" }) : e.includes("forbidden") || e.includes("403") ? r._({ id: "kqJVBO" }) : d.error.message;
|
|
1233
1216
|
})()
|
|
1234
1217
|
}),
|
|
1235
|
-
/*#__PURE__*/
|
|
1218
|
+
/*#__PURE__*/ U("p", {
|
|
1236
1219
|
className: "mb-4",
|
|
1237
|
-
children: /*#__PURE__*/
|
|
1220
|
+
children: /*#__PURE__*/ U(J, { id: "cjEOmc" })
|
|
1238
1221
|
}),
|
|
1239
|
-
/*#__PURE__*/
|
|
1222
|
+
/*#__PURE__*/ U(h, {
|
|
1240
1223
|
className: "mb-0",
|
|
1241
1224
|
onSubmit: (e) => {
|
|
1242
1225
|
e.preventDefault(), g();
|
|
1243
1226
|
},
|
|
1244
|
-
children: /*#__PURE__*/
|
|
1227
|
+
children: /*#__PURE__*/ U(E, { children: /*#__PURE__*/ U(p.Field, {
|
|
1245
1228
|
name: "targetTenant",
|
|
1246
1229
|
validators: {
|
|
1247
1230
|
onBlur: ({ value: e }) => {
|
|
1248
1231
|
let t = e.trim();
|
|
1249
1232
|
if (!t) return r._({ id: "1RwosK" });
|
|
1250
|
-
if (!
|
|
1233
|
+
if (!Je(t)) return r._({ id: "CunRry" });
|
|
1251
1234
|
},
|
|
1252
1235
|
onChange: ({ value: e }) => {
|
|
1253
1236
|
if (!c) return;
|
|
1254
1237
|
let t = e.trim();
|
|
1255
1238
|
if (!t) return r._({ id: "1RwosK" });
|
|
1256
|
-
if (!
|
|
1239
|
+
if (!Je(t)) return r._({ id: "CunRry" });
|
|
1257
1240
|
}
|
|
1258
1241
|
},
|
|
1259
1242
|
children: (e) => {
|
|
1260
1243
|
let t = (e.state.meta.isTouched || c) && e.state.meta.errors.length > 0, n = e.state.meta.errors[0], i = t ? typeof n == "string" ? n : n?.message : void 0;
|
|
1261
|
-
return /*#__PURE__*/
|
|
1244
|
+
return /*#__PURE__*/ U(S, {
|
|
1262
1245
|
id: e.name,
|
|
1263
1246
|
name: e.name,
|
|
1264
1247
|
label: r._({ id: "WzVwU0" }),
|
|
@@ -1280,21 +1263,21 @@ function He({ isOpen: e, onClose: t, securityGroupId: n }) {
|
|
|
1280
1263
|
}
|
|
1281
1264
|
//#endregion
|
|
1282
1265
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/DeleteRBACPolicyDialog.tsx
|
|
1283
|
-
function
|
|
1284
|
-
let { i18n: l, _: u } =
|
|
1266
|
+
function Xe({ policy: e, open: t, onClose: n, onConfirm: i, isLoading: o, error: s }) {
|
|
1267
|
+
let { i18n: l, _: u } = Y(), { trackClose: d, markSubmitted: p, resetTracking: m } = I({
|
|
1285
1268
|
isOpen: t,
|
|
1286
1269
|
actionPrefix: "network.securitygroup.rbacpolicy.delete"
|
|
1287
|
-
}), g =
|
|
1270
|
+
}), g = X.object({ confirm: X.string().refine((e) => e === "remove", { message: l._({ id: "SVLToM" }) }) }), _ = Z({
|
|
1288
1271
|
defaultValues: { confirm: "" },
|
|
1289
1272
|
validators: { onSubmit: g },
|
|
1290
1273
|
onSubmit: async () => {
|
|
1291
1274
|
o || (p(), i(e.id));
|
|
1292
1275
|
}
|
|
1293
|
-
}), v =
|
|
1294
|
-
return /*#__PURE__*/
|
|
1276
|
+
}), v = Q(_.store, (e) => e.isSubmitting || e.values.confirm !== "remove");
|
|
1277
|
+
return /*#__PURE__*/ U(f, {
|
|
1295
1278
|
open: t,
|
|
1296
1279
|
onCancel: () => {
|
|
1297
|
-
d(), _.reset(),
|
|
1280
|
+
d(), _.reset(), m(), n();
|
|
1298
1281
|
},
|
|
1299
1282
|
size: "small",
|
|
1300
1283
|
title: l._({ id: "Dt5W9T" }),
|
|
@@ -1305,35 +1288,35 @@ function Ue({ policy: e, open: t, onClose: n, onConfirm: i, isLoading: o, error:
|
|
|
1305
1288
|
disableConfirmButton: v || o,
|
|
1306
1289
|
disableCancelButton: o,
|
|
1307
1290
|
disableCloseButton: o,
|
|
1308
|
-
children: /*#__PURE__*/
|
|
1291
|
+
children: /*#__PURE__*/ W(c, {
|
|
1309
1292
|
direction: "vertical",
|
|
1310
1293
|
gap: "4",
|
|
1311
1294
|
children: [
|
|
1312
|
-
s && /*#__PURE__*/
|
|
1295
|
+
s && /*#__PURE__*/ U(a, {
|
|
1313
1296
|
variant: "error",
|
|
1314
1297
|
children: s
|
|
1315
1298
|
}),
|
|
1316
|
-
/*#__PURE__*/
|
|
1299
|
+
/*#__PURE__*/ U("p", {
|
|
1317
1300
|
className: "text-theme-default",
|
|
1318
|
-
children: /*#__PURE__*/
|
|
1301
|
+
children: /*#__PURE__*/ U(J, { id: "BMTd81" })
|
|
1319
1302
|
}),
|
|
1320
|
-
/*#__PURE__*/
|
|
1321
|
-
/*#__PURE__*/
|
|
1322
|
-
/*#__PURE__*/
|
|
1323
|
-
/*#__PURE__*/
|
|
1324
|
-
/*#__PURE__*/
|
|
1325
|
-
/*#__PURE__*/
|
|
1326
|
-
/*#__PURE__*/
|
|
1303
|
+
/*#__PURE__*/ W(O, { children: [
|
|
1304
|
+
/*#__PURE__*/ U(C, { children: /*#__PURE__*/ U(J, { id: "WzVwU0" }) }),
|
|
1305
|
+
/*#__PURE__*/ U(r, { children: e.target_tenant }),
|
|
1306
|
+
/*#__PURE__*/ U(C, { children: /*#__PURE__*/ U(J, { id: "bwRvnp" }) }),
|
|
1307
|
+
/*#__PURE__*/ U(r, { children: e.action }),
|
|
1308
|
+
/*#__PURE__*/ U(C, { children: /*#__PURE__*/ U(J, { id: "UGhVPl" }) }),
|
|
1309
|
+
/*#__PURE__*/ U(r, { children: e.object_type })
|
|
1327
1310
|
] }),
|
|
1328
|
-
/*#__PURE__*/
|
|
1311
|
+
/*#__PURE__*/ U(h, {
|
|
1329
1312
|
className: "mb-0",
|
|
1330
1313
|
id: "delete-rbac-policy-form",
|
|
1331
1314
|
onSubmit: (e) => {
|
|
1332
1315
|
e.preventDefault(), _.handleSubmit();
|
|
1333
1316
|
},
|
|
1334
|
-
children: /*#__PURE__*/
|
|
1317
|
+
children: /*#__PURE__*/ U(E, { children: /*#__PURE__*/ U(_.Field, {
|
|
1335
1318
|
name: "confirm",
|
|
1336
|
-
children: (e) => /*#__PURE__*/
|
|
1319
|
+
children: (e) => /*#__PURE__*/ U(S, {
|
|
1337
1320
|
label: l._({ id: "SVLToM" }),
|
|
1338
1321
|
id: e.name,
|
|
1339
1322
|
name: e.name,
|
|
@@ -1354,188 +1337,172 @@ function Ue({ policy: e, open: t, onClose: n, onConfirm: i, isLoading: o, error:
|
|
|
1354
1337
|
}
|
|
1355
1338
|
//#endregion
|
|
1356
1339
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/SecurityGroupRBACPolicies.tsx
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1340
|
+
var $ = 3;
|
|
1341
|
+
function Ze({ securityGroupId: e, canManageAccess: n }) {
|
|
1342
|
+
let r = M.useUtils(), { i18n: i, _: a } = Y(), o = P(), [s, l] = te(), [f, p] = q(null), [m, h] = q(""), [g, _] = q(""), y = _e(void 0);
|
|
1343
|
+
K(() => () => clearTimeout(y.current), []);
|
|
1344
|
+
let { data: x, isPending: S, isError: C, error: E } = M.network.rbacPolicy.list.useQuery({
|
|
1345
|
+
project_id: o,
|
|
1362
1346
|
securityGroupId: e
|
|
1363
|
-
}, { refetchOnWindowFocus: !1 }),
|
|
1347
|
+
}, { refetchOnWindowFocus: !1 }), O = M.network.rbacPolicy.delete.useMutation({
|
|
1364
1348
|
onSuccess: () => {
|
|
1365
1349
|
r.network.rbacPolicy.list.invalidate({
|
|
1366
|
-
project_id:
|
|
1350
|
+
project_id: o,
|
|
1367
1351
|
securityGroupId: e
|
|
1368
1352
|
}), r.network.securityGroup.getById.invalidate({
|
|
1369
|
-
project_id:
|
|
1353
|
+
project_id: o,
|
|
1370
1354
|
securityGroupId: e
|
|
1371
1355
|
});
|
|
1372
1356
|
},
|
|
1373
1357
|
onError: (e) => {
|
|
1374
|
-
let { message: t, ...n } =
|
|
1375
|
-
|
|
1358
|
+
let { message: t, ...n } = z(e.message);
|
|
1359
|
+
T.error(t, n);
|
|
1376
1360
|
}
|
|
1377
1361
|
}), A = (e) => {
|
|
1378
|
-
|
|
1379
|
-
},
|
|
1380
|
-
let t =
|
|
1381
|
-
|
|
1382
|
-
project_id:
|
|
1362
|
+
p(e);
|
|
1363
|
+
}, j = (e) => {
|
|
1364
|
+
let t = f?.target_tenant || e;
|
|
1365
|
+
O.mutate({
|
|
1366
|
+
project_id: o,
|
|
1383
1367
|
policyId: e
|
|
1384
1368
|
}, { onSuccess: () => {
|
|
1385
|
-
let { message: e, ...n } =
|
|
1386
|
-
|
|
1369
|
+
let { message: e, ...n } = B(t);
|
|
1370
|
+
T.success(e, n);
|
|
1387
1371
|
} });
|
|
1388
|
-
},
|
|
1389
|
-
|
|
1372
|
+
}, N = () => {
|
|
1373
|
+
O.isPending || p(null);
|
|
1390
1374
|
};
|
|
1391
1375
|
K(() => {
|
|
1392
|
-
!
|
|
1376
|
+
!O.isPending && !O.error && O.isSuccess && p(null);
|
|
1393
1377
|
}, [
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1378
|
+
O.isPending,
|
|
1379
|
+
O.error,
|
|
1380
|
+
O.isSuccess
|
|
1397
1381
|
]);
|
|
1398
|
-
let
|
|
1399
|
-
if (!
|
|
1400
|
-
if (!
|
|
1401
|
-
let e =
|
|
1402
|
-
return
|
|
1403
|
-
}, [
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
/*#__PURE__*/
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
children:
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
alignment: "center",
|
|
1449
|
-
children: /*#__PURE__*/ W(t, {
|
|
1450
|
-
placeholder: o._({ id: "mlxk2U" }),
|
|
1451
|
-
"data-testid": "searchbar",
|
|
1452
|
-
value: b,
|
|
1453
|
-
onInput: (e) => {
|
|
1454
|
-
let t = e.currentTarget.value;
|
|
1455
|
-
x(t), clearTimeout(S.current), S.current = window.setTimeout(() => v(t), 500);
|
|
1456
|
-
},
|
|
1457
|
-
onSearch: (e) => {
|
|
1458
|
-
clearTimeout(S.current), v(typeof e == "string" ? e : "");
|
|
1459
|
-
},
|
|
1460
|
-
onClear: () => {
|
|
1461
|
-
clearTimeout(S.current), x(""), v("");
|
|
1462
|
-
}
|
|
1463
|
-
})
|
|
1464
|
-
}) }),
|
|
1465
|
-
I === 0 ? g ? /*#__PURE__*/ W(Y, { id: "qxxo7y" }) : /*#__PURE__*/ W(Y, { id: "Dia2Ue" }) : /*#__PURE__*/ G(C, {
|
|
1466
|
-
columns: 3,
|
|
1467
|
-
children: [/*#__PURE__*/ G(d, { children: [
|
|
1468
|
-
/*#__PURE__*/ W(u, { children: /*#__PURE__*/ W(Y, { id: "WzVwU0" }) }),
|
|
1469
|
-
/*#__PURE__*/ W(u, { children: /*#__PURE__*/ W(Y, { id: "bwRvnp" }) }),
|
|
1470
|
-
/*#__PURE__*/ W(u, { children: /*#__PURE__*/ W(Y, { id: "7L01XJ" }) })
|
|
1471
|
-
] }), P.map((e) => /*#__PURE__*/ W(Re, {
|
|
1472
|
-
policy: e,
|
|
1473
|
-
onDelete: () => A(e),
|
|
1474
|
-
canDelete: n
|
|
1475
|
-
}, e.id))]
|
|
1382
|
+
let F = ge(() => {
|
|
1383
|
+
if (!x) return [];
|
|
1384
|
+
if (!m) return x;
|
|
1385
|
+
let e = m.toLowerCase();
|
|
1386
|
+
return x.filter((t) => t.target_tenant?.toLowerCase().includes(e) || t.action?.toLowerCase().includes(e));
|
|
1387
|
+
}, [x, m]);
|
|
1388
|
+
return /*#__PURE__*/ W(H, { children: [
|
|
1389
|
+
/*#__PURE__*/ U(c, {
|
|
1390
|
+
distribution: "end",
|
|
1391
|
+
alignment: "center",
|
|
1392
|
+
gap: "2",
|
|
1393
|
+
className: "pb-2",
|
|
1394
|
+
children: n && /*#__PURE__*/ U(v, {
|
|
1395
|
+
variant: "primary",
|
|
1396
|
+
onClick: l,
|
|
1397
|
+
className: "whitespace-nowrap",
|
|
1398
|
+
children: /*#__PURE__*/ U(J, { id: "vmRPFm" })
|
|
1399
|
+
})
|
|
1400
|
+
}),
|
|
1401
|
+
/*#__PURE__*/ U(b, { children: /*#__PURE__*/ U(c, {
|
|
1402
|
+
distribution: "end",
|
|
1403
|
+
alignment: "center",
|
|
1404
|
+
children: /*#__PURE__*/ U(t, {
|
|
1405
|
+
className: "w-60 sm:w-68",
|
|
1406
|
+
placeholder: i._({ id: "5kjInU" }),
|
|
1407
|
+
"data-testid": "searchbar",
|
|
1408
|
+
value: g,
|
|
1409
|
+
onInput: (e) => {
|
|
1410
|
+
let t = e.currentTarget.value;
|
|
1411
|
+
_(t), clearTimeout(y.current), y.current = window.setTimeout(() => h(t), 500);
|
|
1412
|
+
},
|
|
1413
|
+
onSearch: (e) => {
|
|
1414
|
+
clearTimeout(y.current), h(typeof e == "string" ? e : "");
|
|
1415
|
+
},
|
|
1416
|
+
onClear: () => {
|
|
1417
|
+
clearTimeout(y.current), _(""), h("");
|
|
1418
|
+
}
|
|
1419
|
+
})
|
|
1420
|
+
}) }),
|
|
1421
|
+
/*#__PURE__*/ W(w, {
|
|
1422
|
+
columns: $,
|
|
1423
|
+
children: [/*#__PURE__*/ W(d, { children: [
|
|
1424
|
+
/*#__PURE__*/ U(u, { children: /*#__PURE__*/ U(J, { id: "WzVwU0" }) }),
|
|
1425
|
+
/*#__PURE__*/ U(u, { children: /*#__PURE__*/ U(J, { id: "bwRvnp" }) }),
|
|
1426
|
+
/*#__PURE__*/ U(u, {})
|
|
1427
|
+
] }), S ? /*#__PURE__*/ U(d, { children: /*#__PURE__*/ U(k, {
|
|
1428
|
+
colSpan: $,
|
|
1429
|
+
children: /*#__PURE__*/ U(D, {
|
|
1430
|
+
status: "progress",
|
|
1431
|
+
title: i._({ id: "Z3FXyt" })
|
|
1476
1432
|
})
|
|
1477
|
-
|
|
1433
|
+
}) }) : C ? /*#__PURE__*/ U(d, { children: /*#__PURE__*/ U(k, {
|
|
1434
|
+
colSpan: $,
|
|
1435
|
+
children: /*#__PURE__*/ U(D, {
|
|
1436
|
+
status: "error",
|
|
1437
|
+
title: E.message
|
|
1438
|
+
})
|
|
1439
|
+
}) }) : F.length === 0 ? /*#__PURE__*/ U(d, { children: /*#__PURE__*/ U(k, {
|
|
1440
|
+
colSpan: $,
|
|
1441
|
+
children: /*#__PURE__*/ U(D, {
|
|
1442
|
+
status: "empty",
|
|
1443
|
+
title: m ? i._({ id: "qxxo7y" }) : i._({ id: "Dia2Ue" })
|
|
1444
|
+
})
|
|
1445
|
+
}) }) : F.map((e) => /*#__PURE__*/ U(Ge, {
|
|
1446
|
+
policy: e,
|
|
1447
|
+
onDelete: () => A(e),
|
|
1448
|
+
canDelete: n
|
|
1449
|
+
}, e.id))]
|
|
1478
1450
|
}),
|
|
1479
|
-
!!
|
|
1480
|
-
policy:
|
|
1481
|
-
open: !!
|
|
1482
|
-
onClose:
|
|
1483
|
-
onConfirm:
|
|
1484
|
-
isLoading:
|
|
1485
|
-
error:
|
|
1451
|
+
!!f && /*#__PURE__*/ U(Xe, {
|
|
1452
|
+
policy: f,
|
|
1453
|
+
open: !!f,
|
|
1454
|
+
onClose: N,
|
|
1455
|
+
onConfirm: j,
|
|
1456
|
+
isLoading: O.isPending,
|
|
1457
|
+
error: O.error?.message || null
|
|
1486
1458
|
}),
|
|
1487
|
-
|
|
1488
|
-
isOpen:
|
|
1489
|
-
onClose:
|
|
1459
|
+
s && /*#__PURE__*/ U(Ye, {
|
|
1460
|
+
isOpen: s,
|
|
1461
|
+
onClose: l,
|
|
1490
1462
|
securityGroupId: e
|
|
1491
1463
|
})
|
|
1492
1464
|
] });
|
|
1493
1465
|
}
|
|
1494
1466
|
//#endregion
|
|
1495
1467
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/SecurityGroupDetailsView.tsx
|
|
1496
|
-
function
|
|
1497
|
-
let [
|
|
1498
|
-
return /*#__PURE__*/
|
|
1468
|
+
function Qe({ securityGroup: t, filteredAndSortedRules: n, onDeleteRule: r, isDeletingRule: i = !1, deleteRuleError: a = null, filterControls: o, onCreateRule: s, isCreatingRule: l = !1, createRuleError: u = null, availableSecurityGroups: d = [], currentProjectId: f, permissions: p }) {
|
|
1469
|
+
let [m, h] = q("rules"), g = t.project_id === f && p.canViewRBAC;
|
|
1470
|
+
return /*#__PURE__*/ U(e, {
|
|
1499
1471
|
px: !1,
|
|
1500
1472
|
py: !0,
|
|
1501
|
-
children: /*#__PURE__*/
|
|
1473
|
+
children: /*#__PURE__*/ W(c, {
|
|
1502
1474
|
direction: "vertical",
|
|
1503
1475
|
gap: "4",
|
|
1504
1476
|
children: [
|
|
1505
|
-
/*#__PURE__*/
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
/*#__PURE__*/ W(ge, {
|
|
1511
|
-
activeTab: h,
|
|
1512
|
-
onTabChange: g,
|
|
1513
|
-
showRBACTab: _
|
|
1477
|
+
/*#__PURE__*/ U(be, { securityGroup: t }),
|
|
1478
|
+
/*#__PURE__*/ U(xe, {
|
|
1479
|
+
activeTab: m,
|
|
1480
|
+
onTabChange: h,
|
|
1481
|
+
showRBACTab: g
|
|
1514
1482
|
}),
|
|
1515
|
-
/*#__PURE__*/
|
|
1483
|
+
/*#__PURE__*/ W("div", {
|
|
1516
1484
|
className: "mt-6",
|
|
1517
|
-
children: [
|
|
1485
|
+
children: [m === "rules" && /*#__PURE__*/ U(We, {
|
|
1518
1486
|
rules: n,
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
onFilterChange: s.onFilterChange,
|
|
1487
|
+
onDeleteRule: r,
|
|
1488
|
+
isDeletingRule: i,
|
|
1489
|
+
deleteError: a,
|
|
1490
|
+
searchTerm: o.searchTerm,
|
|
1491
|
+
onSearchChange: o.onSearchChange,
|
|
1492
|
+
sortSettings: o.sortSettings,
|
|
1493
|
+
onSortChange: o.onSortChange,
|
|
1494
|
+
filterSettings: o.filterSettings,
|
|
1495
|
+
onFilterChange: o.onFilterChange,
|
|
1529
1496
|
securityGroupId: t.id,
|
|
1530
|
-
onCreateRule:
|
|
1531
|
-
isCreatingRule:
|
|
1532
|
-
createRuleError:
|
|
1533
|
-
availableSecurityGroups:
|
|
1534
|
-
canCreateRule:
|
|
1535
|
-
canDeleteRule:
|
|
1536
|
-
}),
|
|
1497
|
+
onCreateRule: p.canCreateRule ? s : void 0,
|
|
1498
|
+
isCreatingRule: l,
|
|
1499
|
+
createRuleError: u,
|
|
1500
|
+
availableSecurityGroups: d,
|
|
1501
|
+
canCreateRule: p.canCreateRule,
|
|
1502
|
+
canDeleteRule: p.canDeleteRule
|
|
1503
|
+
}), m === "rbac" && /*#__PURE__*/ U(Ze, {
|
|
1537
1504
|
securityGroupId: t.id,
|
|
1538
|
-
canManageAccess:
|
|
1505
|
+
canManageAccess: p.canManageAccess
|
|
1539
1506
|
})]
|
|
1540
1507
|
})
|
|
1541
1508
|
]
|
|
@@ -1544,15 +1511,15 @@ function Ge({ securityGroup: t, filteredAndSortedRules: n, onEdit: r, onDeleteRu
|
|
|
1544
1511
|
}
|
|
1545
1512
|
//#endregion
|
|
1546
1513
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-hooks/useSecurityGroupDetails.ts
|
|
1547
|
-
function
|
|
1548
|
-
let [n, r] =
|
|
1549
|
-
project_id:
|
|
1514
|
+
function $e({ securityGroupId: e, filterControls: t }) {
|
|
1515
|
+
let [n, r] = q(!1), [i, a] = q(!1), o = P(), s = M.useUtils(), c = M.network.securityGroup.getById.useQuery({
|
|
1516
|
+
project_id: o,
|
|
1550
1517
|
securityGroupId: e
|
|
1551
|
-
}, { placeholderData: () =>
|
|
1552
|
-
project_id:
|
|
1518
|
+
}, { placeholderData: () => s.network.securityGroup.getById.getData({
|
|
1519
|
+
project_id: o,
|
|
1553
1520
|
securityGroupId: e
|
|
1554
|
-
}) }),
|
|
1555
|
-
let e =
|
|
1521
|
+
}) }), l = ge(() => {
|
|
1522
|
+
let e = c.data?.security_group_rules || [], n = t.filterSettings.selectedFilters?.find((e) => e.name === "direction")?.value, r = t.filterSettings.selectedFilters?.find((e) => e.name === "ethertype")?.value, i = t.filterSettings.selectedFilters?.find((e) => e.name === "protocol")?.value;
|
|
1556
1523
|
if (n && n !== "all" && (e = e.filter((e) => e.direction === n)), r && r !== "all" && (e = e.filter((e) => e.ethertype === r)), i && i !== "all" && (e = e.filter((e) => e.protocol !== null && e.protocol === i)), t.searchTerm) {
|
|
1557
1524
|
let n = t.searchTerm.toLowerCase();
|
|
1558
1525
|
e = e.filter((e) => e.description?.toLowerCase().includes(n) || e.protocol?.toLowerCase().includes(n) || e.ethertype?.toLowerCase().includes(n));
|
|
@@ -1565,59 +1532,72 @@ function Ke({ securityGroupId: e, filterControls: t }) {
|
|
|
1565
1532
|
});
|
|
1566
1533
|
}
|
|
1567
1534
|
return e;
|
|
1568
|
-
}, [
|
|
1535
|
+
}, [c.data?.security_group_rules, t]), u = M.network.securityGroup.update.useMutation({
|
|
1569
1536
|
onSuccess: (t, n) => {
|
|
1570
|
-
|
|
1571
|
-
project_id:
|
|
1537
|
+
s.network.securityGroup.getById.invalidate({
|
|
1538
|
+
project_id: o,
|
|
1572
1539
|
securityGroupId: e
|
|
1573
|
-
}),
|
|
1574
|
-
let { message:
|
|
1575
|
-
|
|
1540
|
+
}), s.network.securityGroup.list.invalidate();
|
|
1541
|
+
let { message: i, ...a } = ce(n.name || c.data?.name || e);
|
|
1542
|
+
T.success(i, a), r(!1);
|
|
1576
1543
|
},
|
|
1577
1544
|
onError: (e) => {
|
|
1578
|
-
let { message: t, ...n } =
|
|
1579
|
-
|
|
1545
|
+
let { message: t, ...n } = de(e.message);
|
|
1546
|
+
T.error(t, n);
|
|
1580
1547
|
}
|
|
1581
|
-
}),
|
|
1548
|
+
}), d = M.network.securityGroup.deleteById.useMutation({
|
|
1582
1549
|
onSuccess: () => {
|
|
1583
|
-
|
|
1584
|
-
|
|
1550
|
+
s.network.securityGroup.list.invalidate();
|
|
1551
|
+
let { message: t, ...n } = ue(c.data?.name || e);
|
|
1552
|
+
T.success(t, n), a(!1);
|
|
1553
|
+
},
|
|
1554
|
+
onError: (e) => {
|
|
1555
|
+
let { message: t, ...n } = oe(e.message);
|
|
1556
|
+
T.error(t, n);
|
|
1557
|
+
}
|
|
1558
|
+
}), f = M.network.securityGroupRule.delete.useMutation({
|
|
1559
|
+
onSuccess: () => {
|
|
1560
|
+
s.network.securityGroup.getById.invalidate({
|
|
1561
|
+
project_id: o,
|
|
1585
1562
|
securityGroupId: e
|
|
1586
|
-
}),
|
|
1587
|
-
let { message: t, ...n } =
|
|
1588
|
-
|
|
1563
|
+
}), s.network.securityGroup.list.invalidate();
|
|
1564
|
+
let { message: t, ...n } = pe();
|
|
1565
|
+
T.success(t, n);
|
|
1589
1566
|
},
|
|
1590
1567
|
onError: (e) => {
|
|
1591
|
-
let { message: t, ...n } =
|
|
1592
|
-
|
|
1568
|
+
let { message: t, ...n } = R(e.message);
|
|
1569
|
+
T.error(t, n);
|
|
1593
1570
|
}
|
|
1594
|
-
}),
|
|
1571
|
+
}), p = M.network.securityGroupRule.create.useMutation({
|
|
1595
1572
|
onSuccess: () => {
|
|
1596
|
-
|
|
1597
|
-
project_id:
|
|
1573
|
+
s.network.securityGroup.getById.invalidate({
|
|
1574
|
+
project_id: o,
|
|
1598
1575
|
securityGroupId: e
|
|
1599
|
-
}),
|
|
1600
|
-
let { message: t, ...n } =
|
|
1601
|
-
|
|
1576
|
+
}), s.network.securityGroup.list.invalidate();
|
|
1577
|
+
let { message: t, ...n } = se();
|
|
1578
|
+
T.success(t, n);
|
|
1602
1579
|
},
|
|
1603
1580
|
onError: (e) => {
|
|
1604
1581
|
let { message: t, ...n } = V(e.message);
|
|
1605
|
-
|
|
1582
|
+
T.error(t, n);
|
|
1606
1583
|
}
|
|
1607
1584
|
});
|
|
1608
1585
|
return {
|
|
1609
|
-
securityGroup:
|
|
1610
|
-
filteredAndSortedRules:
|
|
1611
|
-
isLoading:
|
|
1612
|
-
isError:
|
|
1613
|
-
error:
|
|
1614
|
-
isUpdating:
|
|
1615
|
-
updateError:
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1586
|
+
securityGroup: c.data,
|
|
1587
|
+
filteredAndSortedRules: l,
|
|
1588
|
+
isLoading: c.isPending,
|
|
1589
|
+
isError: c.isError,
|
|
1590
|
+
error: c.error,
|
|
1591
|
+
isUpdating: u.isPending,
|
|
1592
|
+
updateError: u.error?.message || null,
|
|
1593
|
+
isDeleting: d.isPending,
|
|
1594
|
+
deleteError: d.error?.message || null,
|
|
1595
|
+
isDeletingRule: f.isPending,
|
|
1596
|
+
deleteRuleError: f.error?.message || null,
|
|
1597
|
+
isCreatingRule: p.isPending,
|
|
1598
|
+
createRuleError: p.error?.message || null,
|
|
1620
1599
|
editModalOpen: n,
|
|
1600
|
+
deleteModalOpen: i,
|
|
1621
1601
|
handleEdit: () => {
|
|
1622
1602
|
r(!0);
|
|
1623
1603
|
},
|
|
@@ -1625,21 +1605,33 @@ function Ke({ securityGroupId: e, filterControls: t }) {
|
|
|
1625
1605
|
r(!1);
|
|
1626
1606
|
},
|
|
1627
1607
|
handleUpdate: async (e, t) => {
|
|
1628
|
-
await
|
|
1629
|
-
project_id:
|
|
1608
|
+
await u.mutateAsync({
|
|
1609
|
+
project_id: o,
|
|
1630
1610
|
securityGroupId: e,
|
|
1631
1611
|
...t
|
|
1632
1612
|
});
|
|
1633
1613
|
},
|
|
1614
|
+
handleDelete: () => {
|
|
1615
|
+
a(!0);
|
|
1616
|
+
},
|
|
1617
|
+
handleCloseDeleteModal: () => {
|
|
1618
|
+
a(!1);
|
|
1619
|
+
},
|
|
1620
|
+
handleDeleteSecurityGroup: async () => {
|
|
1621
|
+
await d.mutateAsync({
|
|
1622
|
+
project_id: o,
|
|
1623
|
+
securityGroupId: e
|
|
1624
|
+
});
|
|
1625
|
+
},
|
|
1634
1626
|
handleDeleteRule: async (e) => {
|
|
1635
|
-
await
|
|
1636
|
-
project_id:
|
|
1627
|
+
await f.mutateAsync({
|
|
1628
|
+
project_id: o,
|
|
1637
1629
|
ruleId: e
|
|
1638
1630
|
});
|
|
1639
1631
|
},
|
|
1640
1632
|
handleCreateRule: async (e) => {
|
|
1641
|
-
await
|
|
1642
|
-
project_id:
|
|
1633
|
+
await p.mutateAsync({
|
|
1634
|
+
project_id: o,
|
|
1643
1635
|
...e
|
|
1644
1636
|
});
|
|
1645
1637
|
}
|
|
@@ -1647,41 +1639,41 @@ function Ke({ securityGroupId: e, filterControls: t }) {
|
|
|
1647
1639
|
}
|
|
1648
1640
|
//#endregion
|
|
1649
1641
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/index.tsx?tsr-split=component
|
|
1650
|
-
function
|
|
1651
|
-
let { securityGroupId: e } =
|
|
1642
|
+
function et() {
|
|
1643
|
+
let { securityGroupId: e } = N.useParams(), { trpcClient: t } = N.useRouteContext(), r = P(), i = ve(), { i18n: a, _: o } = Y();
|
|
1652
1644
|
if (!t) throw Error("trpcClient is not available in route context");
|
|
1653
|
-
let { permissions:
|
|
1645
|
+
let { permissions: s, isLoading: l, isError: u } = he(r), { searchTerm: d, sortSettings: f, filterSettings: m, handleSearchChange: h, handleSortChange: _, handleFilterChange: y } = ye({
|
|
1654
1646
|
defaultSortKey: "direction",
|
|
1655
1647
|
defaultSortDir: "asc",
|
|
1656
1648
|
sortOptions: [
|
|
1657
1649
|
{
|
|
1658
|
-
label:
|
|
1650
|
+
label: a._({ id: "MRB7nI" }),
|
|
1659
1651
|
value: "direction"
|
|
1660
1652
|
},
|
|
1661
1653
|
{
|
|
1662
|
-
label:
|
|
1654
|
+
label: a._({ id: "6+OdGi" }),
|
|
1663
1655
|
value: "protocol"
|
|
1664
1656
|
},
|
|
1665
1657
|
{
|
|
1666
|
-
label:
|
|
1658
|
+
label: a._({ id: "Nu4oKW" }),
|
|
1667
1659
|
value: "description"
|
|
1668
1660
|
}
|
|
1669
1661
|
],
|
|
1670
1662
|
filterSettings: { filters: [
|
|
1671
1663
|
{
|
|
1672
|
-
displayName:
|
|
1664
|
+
displayName: a._({ id: "MRB7nI" }),
|
|
1673
1665
|
filterName: "direction",
|
|
1674
1666
|
values: ["ingress", "egress"],
|
|
1675
1667
|
supportsMultiValue: !1
|
|
1676
1668
|
},
|
|
1677
1669
|
{
|
|
1678
|
-
displayName:
|
|
1670
|
+
displayName: a._({ id: "yp0UjB" }),
|
|
1679
1671
|
filterName: "ethertype",
|
|
1680
1672
|
values: ["IPv4", "IPv6"],
|
|
1681
1673
|
supportsMultiValue: !1
|
|
1682
1674
|
},
|
|
1683
1675
|
{
|
|
1684
|
-
displayName:
|
|
1676
|
+
displayName: a._({ id: "6+OdGi" }),
|
|
1685
1677
|
filterName: "protocol",
|
|
1686
1678
|
values: [
|
|
1687
1679
|
"tcp",
|
|
@@ -1692,32 +1684,32 @@ function qe() {
|
|
|
1692
1684
|
supportsMultiValue: !1
|
|
1693
1685
|
}
|
|
1694
1686
|
] }
|
|
1695
|
-
}),
|
|
1696
|
-
searchTerm:
|
|
1697
|
-
onSearchChange:
|
|
1698
|
-
sortSettings:
|
|
1699
|
-
onSortChange:
|
|
1700
|
-
filterSettings:
|
|
1701
|
-
onFilterChange:
|
|
1702
|
-
}, { securityGroup:
|
|
1687
|
+
}), b = {
|
|
1688
|
+
searchTerm: d,
|
|
1689
|
+
onSearchChange: h,
|
|
1690
|
+
sortSettings: f,
|
|
1691
|
+
onSortChange: _,
|
|
1692
|
+
filterSettings: m,
|
|
1693
|
+
onFilterChange: y
|
|
1694
|
+
}, { securityGroup: x, filteredAndSortedRules: S, isLoading: C, isError: w, error: T, isUpdating: E, updateError: O, isDeleting: k, deleteError: A, isDeletingRule: F, deleteRuleError: I, isCreatingRule: te, createRuleError: ne, editModalOpen: re, deleteModalOpen: ie, handleEdit: ae, handleCloseEditModal: oe, handleUpdate: se, handleDelete: R, handleCloseDeleteModal: ce, handleDeleteSecurityGroup: le, handleDeleteRule: ue, handleCreateRule: de } = $e({
|
|
1703
1695
|
securityGroupId: e,
|
|
1704
|
-
filterControls:
|
|
1696
|
+
filterControls: b
|
|
1705
1697
|
});
|
|
1706
|
-
|
|
1707
|
-
let { data:
|
|
1698
|
+
L(N.id, x?.name ?? void 0);
|
|
1699
|
+
let { data: z } = M.network.securityGroup.list.useQuery({ project_id: r }), pe = ge(() => (z || []).filter((t) => t.id !== e).map((e) => ({
|
|
1708
1700
|
id: e.id,
|
|
1709
1701
|
name: e.name || e.id
|
|
1710
|
-
})), [
|
|
1711
|
-
|
|
1702
|
+
})), [z, e]), B = () => {
|
|
1703
|
+
i({
|
|
1712
1704
|
to: "/projects/$projectId/network/securitygroups",
|
|
1713
|
-
params: { projectId:
|
|
1705
|
+
params: { projectId: r }
|
|
1714
1706
|
});
|
|
1715
1707
|
};
|
|
1716
|
-
if (
|
|
1708
|
+
if (l) return /*#__PURE__*/ U(D, {
|
|
1717
1709
|
status: "progress",
|
|
1718
|
-
title:
|
|
1710
|
+
title: a._({ id: "EpWoJ9" })
|
|
1719
1711
|
});
|
|
1720
|
-
let
|
|
1712
|
+
let V = u ? {
|
|
1721
1713
|
canView: !1,
|
|
1722
1714
|
canCreate: !1,
|
|
1723
1715
|
canUpdate: !1,
|
|
@@ -1726,85 +1718,102 @@ function qe() {
|
|
|
1726
1718
|
canDeleteRule: !1,
|
|
1727
1719
|
canManageAccess: !1,
|
|
1728
1720
|
canViewRBAC: !1
|
|
1729
|
-
} :
|
|
1730
|
-
if (
|
|
1721
|
+
} : s;
|
|
1722
|
+
if (C) return /*#__PURE__*/ U(D, {
|
|
1731
1723
|
status: "progress",
|
|
1732
|
-
title:
|
|
1724
|
+
title: a._({ id: "3x7Sws" })
|
|
1733
1725
|
});
|
|
1734
|
-
if (
|
|
1735
|
-
let e =
|
|
1736
|
-
return /*#__PURE__*/
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
/*#__PURE__*/
|
|
1744
|
-
|
|
1745
|
-
children: /*#__PURE__*/ W(Y, { id: "FjPnAE" })
|
|
1746
|
-
}),
|
|
1747
|
-
/*#__PURE__*/ W("p", {
|
|
1748
|
-
className: "text-theme-highest",
|
|
1749
|
-
children: e
|
|
1750
|
-
}),
|
|
1751
|
-
/*#__PURE__*/ W(_, {
|
|
1752
|
-
onClick: z,
|
|
1753
|
-
variant: "primary",
|
|
1754
|
-
children: /*#__PURE__*/ W(Y, { id: "U9q4M7" })
|
|
1755
|
-
})
|
|
1756
|
-
]
|
|
1726
|
+
if (w) {
|
|
1727
|
+
let e = T?.message || a._({ id: "LobdAW" });
|
|
1728
|
+
return /*#__PURE__*/ U(D, {
|
|
1729
|
+
status: "error",
|
|
1730
|
+
title: a._({ id: "PA/BPt" }),
|
|
1731
|
+
body: e,
|
|
1732
|
+
action: /*#__PURE__*/ U(v, {
|
|
1733
|
+
onClick: B,
|
|
1734
|
+
variant: "primary",
|
|
1735
|
+
children: /*#__PURE__*/ U(J, { id: "U9q4M7" })
|
|
1736
|
+
})
|
|
1757
1737
|
});
|
|
1758
1738
|
}
|
|
1759
|
-
|
|
1739
|
+
if (!x) return /*#__PURE__*/ U(D, {
|
|
1740
|
+
status: "empty",
|
|
1741
|
+
title: a._({ id: "XuDQlk" }),
|
|
1742
|
+
action: /*#__PURE__*/ U(v, {
|
|
1743
|
+
onClick: B,
|
|
1744
|
+
variant: "primary",
|
|
1745
|
+
children: /*#__PURE__*/ U(J, { id: "U9q4M7" })
|
|
1746
|
+
})
|
|
1747
|
+
});
|
|
1748
|
+
let H = !!(x.project_id && x.project_id !== r), G = V.canUpdate && !H, K = V.canDelete && !H, _e = (G || K) && /*#__PURE__*/ W(c, {
|
|
1749
|
+
gap: "0.5",
|
|
1750
|
+
alignment: "center",
|
|
1751
|
+
children: [K && /*#__PURE__*/ W(n, {
|
|
1752
|
+
className: "flex items-center",
|
|
1753
|
+
children: [/*#__PURE__*/ U(p, {
|
|
1754
|
+
as: "div",
|
|
1755
|
+
children: /*#__PURE__*/ U(v, {
|
|
1756
|
+
icon: "moreVert",
|
|
1757
|
+
title: a._({ id: "PgNNGl" }),
|
|
1758
|
+
disabled: k
|
|
1759
|
+
})
|
|
1760
|
+
}), /*#__PURE__*/ U(g, { children: /*#__PURE__*/ U(j, {
|
|
1761
|
+
label: a._({ id: "bcOdok" }),
|
|
1762
|
+
onClick: R
|
|
1763
|
+
}) })]
|
|
1764
|
+
}), G && /*#__PURE__*/ U(v, {
|
|
1765
|
+
variant: "primary",
|
|
1766
|
+
onClick: ae,
|
|
1767
|
+
disabled: k,
|
|
1768
|
+
children: /*#__PURE__*/ U(J, { id: "Y1YKad" })
|
|
1769
|
+
})]
|
|
1770
|
+
});
|
|
1771
|
+
return /*#__PURE__*/ W(c, {
|
|
1760
1772
|
direction: "vertical",
|
|
1761
1773
|
children: [
|
|
1762
|
-
/*#__PURE__*/
|
|
1763
|
-
title:
|
|
1764
|
-
projectId:
|
|
1765
|
-
|
|
1774
|
+
/*#__PURE__*/ U(ee, {
|
|
1775
|
+
title: x.name || x.id,
|
|
1776
|
+
projectId: r,
|
|
1777
|
+
actions: _e
|
|
1766
1778
|
}),
|
|
1767
|
-
/*#__PURE__*/
|
|
1768
|
-
securityGroup:
|
|
1769
|
-
filteredAndSortedRules:
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
permissions: B
|
|
1779
|
+
/*#__PURE__*/ U(Qe, {
|
|
1780
|
+
securityGroup: x,
|
|
1781
|
+
filteredAndSortedRules: S,
|
|
1782
|
+
onDeleteRule: ue,
|
|
1783
|
+
isDeletingRule: F,
|
|
1784
|
+
deleteRuleError: I,
|
|
1785
|
+
filterControls: b,
|
|
1786
|
+
onCreateRule: de,
|
|
1787
|
+
isCreatingRule: te,
|
|
1788
|
+
createRuleError: ne,
|
|
1789
|
+
availableSecurityGroups: pe,
|
|
1790
|
+
currentProjectId: r,
|
|
1791
|
+
permissions: V
|
|
1781
1792
|
}),
|
|
1782
|
-
/*#__PURE__*/
|
|
1783
|
-
securityGroup:
|
|
1784
|
-
open:
|
|
1785
|
-
onClose:
|
|
1786
|
-
onUpdate:
|
|
1787
|
-
isLoading:
|
|
1788
|
-
error:
|
|
1793
|
+
/*#__PURE__*/ U(me, {
|
|
1794
|
+
securityGroup: x,
|
|
1795
|
+
open: re,
|
|
1796
|
+
onClose: oe,
|
|
1797
|
+
onUpdate: se,
|
|
1798
|
+
isLoading: E,
|
|
1799
|
+
error: O
|
|
1800
|
+
}),
|
|
1801
|
+
ie && /*#__PURE__*/ U(fe, {
|
|
1802
|
+
securityGroup: x,
|
|
1803
|
+
isOpen: ie,
|
|
1804
|
+
onClose: ce,
|
|
1805
|
+
onDelete: async () => {
|
|
1806
|
+
try {
|
|
1807
|
+
await le(), B();
|
|
1808
|
+
} catch {}
|
|
1809
|
+
},
|
|
1810
|
+
isDeleting: k,
|
|
1811
|
+
error: A
|
|
1789
1812
|
})
|
|
1790
1813
|
]
|
|
1791
|
-
}) : /*#__PURE__*/ G(c, {
|
|
1792
|
-
className: "fixed inset-0",
|
|
1793
|
-
distribution: "center",
|
|
1794
|
-
alignment: "center",
|
|
1795
|
-
direction: "vertical",
|
|
1796
|
-
gap: "5",
|
|
1797
|
-
children: [/*#__PURE__*/ W("p", {
|
|
1798
|
-
className: "text-theme-secondary",
|
|
1799
|
-
children: /*#__PURE__*/ W(Y, { id: "Zw8Q49" })
|
|
1800
|
-
}), /*#__PURE__*/ W(_, {
|
|
1801
|
-
onClick: z,
|
|
1802
|
-
variant: "primary",
|
|
1803
|
-
children: /*#__PURE__*/ W(Y, { id: "U9q4M7" })
|
|
1804
|
-
})]
|
|
1805
1814
|
});
|
|
1806
1815
|
}
|
|
1807
1816
|
//#endregion
|
|
1808
|
-
export {
|
|
1817
|
+
export { et as component };
|
|
1809
1818
|
|
|
1810
|
-
//# sourceMappingURL=_securityGroupId-
|
|
1819
|
+
//# sourceMappingURL=_securityGroupId-Bq0ZyG6z.mjs.map
|