@cobaltcore-dev/aurora 0.23.1 → 1.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/App.d.ts +1 -1
- package/dist/client/{AuthProvider-CQ6Yppoh.mjs → AuthProvider-5TyZKZkx.mjs} +3 -3
- package/dist/client/AuthProvider-5TyZKZkx.mjs.map +1 -0
- package/dist/client/{ContentHeader-9KZdhOoA.mjs → ContentHeader-D64NtKvo.mjs} +26 -25
- package/dist/client/ContentHeader-D64NtKvo.mjs.map +1 -0
- package/dist/client/DeleteFlavorModal-C2K43ABZ.mjs +732 -0
- package/dist/client/DeleteFlavorModal-C2K43ABZ.mjs.map +1 -0
- package/dist/client/DeletePcaModal-D9v8E0Ki.mjs +92 -0
- package/dist/client/DeletePcaModal-D9v8E0Ki.mjs.map +1 -0
- package/dist/client/DetailsInfo-h7rPJ4Jf.mjs +61 -0
- package/dist/client/DetailsInfo-h7rPJ4Jf.mjs.map +1 -0
- package/dist/client/FiltersInput-Bw8TFfwb.mjs +82 -0
- package/dist/client/FiltersInput-Bw8TFfwb.mjs.map +1 -0
- package/dist/client/{FloatingIpActionModals-BcceUHcg.mjs → FloatingIpActionModals-BfEDfYg9.mjs} +66 -66
- package/dist/client/{FloatingIpActionModals-BcceUHcg.mjs.map → FloatingIpActionModals-BfEDfYg9.mjs.map} +1 -1
- package/dist/client/ImageToastNotifications-C0Tluzq-.mjs +1125 -0
- package/dist/client/ImageToastNotifications-C0Tluzq-.mjs.map +1 -0
- package/dist/client/{RouteError-Rm08PcxN.mjs → RouteError-B-NPGIv7.mjs} +2 -2
- package/dist/client/{RouteError-Rm08PcxN.mjs.map → RouteError-B-NPGIv7.mjs.map} +1 -1
- package/dist/client/Slot-CWb612-_.mjs.map +1 -1
- package/dist/client/{SortInput-D_q_jDfe.mjs → SortInput-DysAXpB3.mjs} +6 -6
- package/dist/client/{SortInput-D_q_jDfe.mjs.map → SortInput-DysAXpB3.mjs.map} +1 -1
- package/dist/client/{StatusError-2ZU1gFpu.mjs → StatusError-DX-GvLjq.mjs} +8 -8
- package/dist/client/{StatusError-2ZU1gFpu.mjs.map → StatusError-DX-GvLjq.mjs.map} +1 -1
- package/dist/client/TwoColumnDescriptionList-B3xunXmz.mjs +22 -0
- package/dist/client/TwoColumnDescriptionList-B3xunXmz.mjs.map +1 -0
- package/dist/client/{_auth-D5_QNUos.mjs → _auth-R5H2yKFf.mjs} +2 -2
- package/dist/client/_auth-R5H2yKFf.mjs.map +1 -0
- package/dist/client/_flavorId-Dit5mM8I.mjs +210 -0
- package/dist/client/_flavorId-Dit5mM8I.mjs.map +1 -0
- package/dist/client/{_flavorId-CFmkmg2Y.mjs → _flavorId-Zj7LNL-R.mjs} +4 -4
- package/dist/client/{_flavorId-CFmkmg2Y.mjs.map → _flavorId-Zj7LNL-R.mjs.map} +1 -1
- package/dist/client/_floatingIpId-B0MCoqE3.mjs +215 -0
- package/dist/client/_floatingIpId-B0MCoqE3.mjs.map +1 -0
- package/dist/client/{_floatingIpId-Dzh6_JCI.mjs → _floatingIpId-DCQQpNO-.mjs} +4 -4
- package/dist/client/{_floatingIpId-Dzh6_JCI.mjs.map → _floatingIpId-DCQQpNO-.mjs.map} +1 -1
- package/dist/client/_imageId-CZYzBAVx.mjs +558 -0
- package/dist/client/_imageId-CZYzBAVx.mjs.map +1 -0
- package/dist/client/_pcaId-CHRRsWmO.mjs +605 -0
- package/dist/client/_pcaId-CHRRsWmO.mjs.map +1 -0
- package/dist/client/{_projectId-DNZsNxJw.mjs → _projectId-B8wWSxPu.mjs} +9 -9
- package/dist/client/_projectId-B8wWSxPu.mjs.map +1 -0
- package/dist/client/{_projectId-BuBIFdgG.mjs → _projectId-C5DUYIjt.mjs} +117 -117
- package/dist/client/{_projectId-BuBIFdgG.mjs.map → _projectId-C5DUYIjt.mjs.map} +1 -1
- package/dist/client/{_projectId-CAQkJHZ4.mjs → _projectId-D2pFfYIs.mjs} +3 -3
- package/dist/client/{_projectId-CAQkJHZ4.mjs.map → _projectId-D2pFfYIs.mjs.map} +1 -1
- package/dist/client/{_projectId-D-b7paXE.mjs → _projectId-DhSWowQo.mjs} +4 -4
- package/dist/client/{_projectId-D-b7paXE.mjs.map → _projectId-DhSWowQo.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-DFdNKa2l.mjs → _securityGroupId-DZ4D4WwB.mjs} +635 -617
- package/dist/client/_securityGroupId-DZ4D4WwB.mjs.map +1 -0
- package/dist/client/{_securityGroupId-DRkY3Gt6.mjs → _securityGroupId-Mj8NJT2-.mjs} +4 -4
- package/dist/client/{_securityGroupId-DRkY3Gt6.mjs.map → _securityGroupId-Mj8NJT2-.mjs.map} +1 -1
- package/dist/client/_storageType-C-9bNkmZ.mjs +2211 -0
- package/dist/client/_storageType-C-9bNkmZ.mjs.map +1 -0
- package/dist/client/_storageType-zeSZe--V.mjs.map +1 -1
- package/dist/client/{about-C8tTrQaW.mjs → about-WLyShNgE.mjs} +8 -8
- package/dist/client/about-WLyShNgE.mjs.map +1 -0
- package/dist/client/assets/objectDownload.worker-BXFQIIU_.js.map +1 -0
- package/dist/client/assets/objectDownload.worker-ECvFtmOF.js.map +1 -0
- package/dist/client/{aurora-jyvXcI4T.mjs → aurora-IMO9HhqJ.mjs} +2 -2
- package/dist/client/aurora-IMO9HhqJ.mjs.map +1 -0
- package/dist/client/{build-CRLQyqu2.mjs → build-DnD-T35u.mjs} +8180 -8212
- package/dist/client/build-DnD-T35u.mjs.map +1 -0
- package/dist/client/components/Auth/LoginForm.d.ts +1 -1
- package/dist/client/components/Auth/SessionExpirationTimer.d.ts +1 -1
- package/dist/client/components/ContentHeader/ContentHeader.d.ts +1 -1
- package/dist/client/components/Error/RouteError.d.ts +1 -1
- package/dist/client/components/Error/StatusError.d.ts +1 -1
- package/dist/client/components/JsonEditor.d.ts +1 -1
- package/dist/client/components/ListToolbar/FiltersInput.d.ts +3 -1
- package/dist/client/components/ListToolbar/SelectedFilters.d.ts +1 -1
- package/dist/client/components/ListToolbar/index.d.ts +1 -1
- package/dist/client/components/ProjectView/ProjectInfoBox.d.ts +1 -1
- package/dist/client/components/Slot.d.ts +1 -1
- package/dist/client/components/TwoColumnDescriptionList.d.ts +11 -0
- package/dist/client/components/navigation/LanguageSelect.d.ts +1 -1
- package/dist/client/components/navigation/MainNavigation.d.ts +1 -1
- package/dist/client/components/navigation/UserMenu.d.ts +1 -1
- package/dist/client/{flavors-Dy-2mRGv.mjs → flavors-Cp0LEGOH.mjs} +2 -2
- package/dist/client/{flavors-Dy-2mRGv.mjs.map → flavors-Cp0LEGOH.mjs.map} +1 -1
- package/dist/client/{flavors-BfTXqmoD.mjs → flavors-CwMbDRHm2.mjs} +203 -201
- package/dist/client/flavors-CwMbDRHm2.mjs.map +1 -0
- package/dist/client/flavors-DWMZ6TuJ.mjs.map +1 -1
- package/dist/client/floatingips-ICwo-rV_.mjs +591 -0
- package/dist/client/floatingips-ICwo-rV_.mjs.map +1 -0
- package/dist/client/formatBytes-CZv_XyCY.mjs.map +1 -1
- package/dist/client/helpers-1PpYf-fC.mjs.map +1 -1
- package/dist/client/hooks/useAvailableViewportHeight.d.ts +8 -5
- package/dist/client/hooks/useVirtualizedTableBody.d.ts +1 -3
- package/dist/client/{hooks-Bw3sHHOg.mjs → hooks-CrriowRk.mjs} +2 -2
- package/dist/client/{hooks-Bw3sHHOg.mjs.map → hooks-CrriowRk.mjs.map} +1 -1
- package/dist/client/images-DOGZmr3D.mjs +1937 -0
- package/dist/client/images-DOGZmr3D.mjs.map +1 -0
- package/dist/client/{images-DPKUXryV.mjs → images-DWiM_72I.mjs} +2 -2
- package/dist/client/{images-DPKUXryV.mjs.map → images-DWiM_72I.mjs.map} +1 -1
- package/dist/client/images-NBf2bV43.mjs.map +1 -1
- package/dist/client/index.js +601 -445
- package/dist/client/index.js.map +1 -1
- package/dist/client/{md-CyCflQee.mjs → md-DNzcRhmz.mjs} +6 -60
- package/dist/client/{md-CyCflQee.mjs.map → md-DNzcRhmz.mjs.map} +1 -1
- package/dist/client/network-DuZm76BZ.mjs.map +1 -1
- package/dist/client/objects-D2MKUCxc.mjs +56 -0
- package/dist/client/objects-D2MKUCxc.mjs.map +1 -0
- package/dist/client/objects-DI1-tnKr.mjs +56 -0
- package/dist/client/objects-DI1-tnKr.mjs.map +1 -0
- package/dist/client/objects-DeK2WD5K.mjs +10078 -0
- package/dist/client/objects-DeK2WD5K.mjs.map +1 -0
- package/dist/client/pca-BokFv4Gz.mjs +239 -0
- package/dist/client/pca-BokFv4Gz.mjs.map +1 -0
- package/dist/client/{pca-D0kKxHp4.mjs → pca-D5jHAl0b.mjs} +4 -3
- package/dist/client/{pca-D0kKxHp4.mjs.map → pca-D5jHAl0b.mjs.map} +1 -1
- package/dist/client/projects-yiK0HGSA.mjs.map +1 -1
- package/dist/client/routeInfo-CdTRlSxv.mjs.map +1 -1
- package/dist/client/{routes-CtfnI-aY.mjs → routes-B05u5bk4.mjs} +2 -2
- package/dist/client/{routes-CtfnI-aY.mjs.map → routes-B05u5bk4.mjs.map} +1 -1
- package/dist/client/{routes-BOf-GDMM.mjs → routes-DOJr5onJ.mjs} +31 -28
- package/dist/client/routes-DOJr5onJ.mjs.map +1 -0
- package/dist/client/{securitygroups-DRhFle2O.mjs → securitygroups-Be2Qgmew.mjs} +201 -195
- package/dist/client/securitygroups-Be2Qgmew.mjs.map +1 -0
- package/dist/client/{securitygroups-B8aLyFK7.mjs → securitygroups-_7SYN2jN.mjs} +2 -2
- package/dist/client/{securitygroups-B8aLyFK7.mjs.map → securitygroups-_7SYN2jN.mjs.map} +1 -1
- package/dist/client/store/AuthProvider.d.ts +1 -1
- package/dist/client/{trpcClient-Di56hpVv.mjs → trpcClient-D7gpR7YG.mjs} +2 -2
- package/dist/client/{trpcClient-Di56hpVv.mjs.map → trpcClient-D7gpR7YG.mjs.map} +1 -1
- package/dist/client/trpcClient.d.ts +125 -11
- package/dist/client/useModal-DCs1OJh7.mjs.map +1 -1
- package/dist/client/{useSecurityGroupPermissions-BPS1ibWq.mjs → useSecurityGroupPermissions-qPwm4mFt.mjs} +15 -15
- package/dist/client/{useSecurityGroupPermissions-BPS1ibWq.mjs.map → useSecurityGroupPermissions-qPwm4mFt.mjs.map} +1 -1
- package/dist/server/index.d.ts +125 -11
- package/dist/server/index.js +4142 -2845
- package/package.json +7 -7
- package/dist/client/AuthProvider-CQ6Yppoh.mjs.map +0 -1
- package/dist/client/BucketToastNotifications-Dq4dudkM.mjs +0 -665
- package/dist/client/BucketToastNotifications-Dq4dudkM.mjs.map +0 -1
- package/dist/client/ContentHeader-9KZdhOoA.mjs.map +0 -1
- package/dist/client/DeleteFlavorModal-Be2qZo4w.mjs +0 -713
- package/dist/client/DeleteFlavorModal-Be2qZo4w.mjs.map +0 -1
- package/dist/client/DeletePcaModal-CIFsGWyj.mjs +0 -80
- package/dist/client/DeletePcaModal-CIFsGWyj.mjs.map +0 -1
- package/dist/client/DetailsInfo-CHVD7d-W.mjs +0 -52
- package/dist/client/DetailsInfo-CHVD7d-W.mjs.map +0 -1
- package/dist/client/FiltersInput-DqT08Ib-.mjs +0 -81
- package/dist/client/FiltersInput-DqT08Ib-.mjs.map +0 -1
- package/dist/client/ImageToastNotifications-BGyX2J6j.mjs +0 -1219
- package/dist/client/ImageToastNotifications-BGyX2J6j.mjs.map +0 -1
- package/dist/client/_auth-D5_QNUos.mjs.map +0 -1
- package/dist/client/_flavorId-BsmqS9hP.mjs +0 -194
- package/dist/client/_flavorId-BsmqS9hP.mjs.map +0 -1
- package/dist/client/_floatingIpId-Bb9ZEJ6b.mjs +0 -228
- package/dist/client/_floatingIpId-Bb9ZEJ6b.mjs.map +0 -1
- package/dist/client/_imageId-C3As7sHE.mjs +0 -534
- package/dist/client/_imageId-C3As7sHE.mjs.map +0 -1
- package/dist/client/_pcaId-n0q0aDb6.mjs +0 -545
- package/dist/client/_pcaId-n0q0aDb6.mjs.map +0 -1
- package/dist/client/_projectId-DNZsNxJw.mjs.map +0 -1
- package/dist/client/_securityGroupId-DFdNKa2l.mjs.map +0 -1
- package/dist/client/_storageType-Cn7TSOki.mjs +0 -81
- package/dist/client/_storageType-Cn7TSOki.mjs.map +0 -1
- package/dist/client/_storageType-_8Ambhxc.mjs +0 -2859
- package/dist/client/_storageType-_8Ambhxc.mjs.map +0 -1
- package/dist/client/about-C8tTrQaW.mjs.map +0 -1
- package/dist/client/assets/objectDownload.worker-BAc5Au4B.js.map +0 -1
- package/dist/client/aurora-jyvXcI4T.mjs.map +0 -1
- package/dist/client/build-CRLQyqu2.mjs.map +0 -1
- package/dist/client/flavors-BfTXqmoD.mjs.map +0 -1
- package/dist/client/floatingips-zhNK6Xxn.mjs +0 -562
- package/dist/client/floatingips-zhNK6Xxn.mjs.map +0 -1
- package/dist/client/images-DhZnqUG_.mjs +0 -1890
- package/dist/client/images-DhZnqUG_.mjs.map +0 -1
- package/dist/client/objects-B3mbk6V0.mjs +0 -6636
- package/dist/client/objects-B3mbk6V0.mjs.map +0 -1
- package/dist/client/objects-BQ8xvSW8.mjs +0 -103
- package/dist/client/objects-BQ8xvSW8.mjs.map +0 -1
- package/dist/client/objects-o2Cj_ndZ.mjs +0 -8
- package/dist/client/objects-o2Cj_ndZ.mjs.map +0 -1
- package/dist/client/pca-B60iWWfG.mjs +0 -251
- package/dist/client/pca-B60iWWfG.mjs.map +0 -1
- package/dist/client/routes-BOf-GDMM.mjs.map +0 -1
- package/dist/client/securitygroups-DRhFle2O.mjs.map +0 -1
- package/dist/client/useListWithFiltering-aPTUNRaW.mjs +0 -32
- package/dist/client/useListWithFiltering-aPTUNRaW.mjs.map +0 -1
|
@@ -1,188 +1,170 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import { n as
|
|
1
|
+
import { $ as e, C as t, E as n, G as r, I as i, J as a, L as o, M as s, P as c, R as l, S as u, Y as d, Z as f, _ as p, a as m, ct as h, dt as g, g as _, h as v, j as y, k as b, m as x, nt as S, rt as C, s as w, t as T, u as ee, w as E, y as D } from "./build-DnD-T35u.mjs";
|
|
2
|
+
import { a as O } from "./trpcClient-D7gpR7YG.mjs";
|
|
3
|
+
import { t as k } from "./_securityGroupId-Mj8NJT2-.mjs";
|
|
4
|
+
import { t as A } from "./useProjectId-DBc5lpoU.mjs";
|
|
5
|
+
import { t as j } from "./SortInput-DysAXpB3.mjs";
|
|
6
|
+
import "./hooks-CrriowRk.mjs";
|
|
7
|
+
import { t as M } from "./TwoColumnDescriptionList-B3xunXmz.mjs";
|
|
8
|
+
import { t as N } from "./useModal-DCs1OJh7.mjs";
|
|
9
|
+
import { n as P, t as F } from "./FiltersInput-Bw8TFfwb.mjs";
|
|
10
|
+
import { n as I, t as L } from "./useSecurityGroupPermissions-qPwm4mFt.mjs";
|
|
11
11
|
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
12
|
-
import {
|
|
13
|
-
import { useNavigate as
|
|
14
|
-
import { Trans as
|
|
15
|
-
import { z as
|
|
16
|
-
import { useForm as
|
|
12
|
+
import { startTransition as V, useEffect as H, useMemo as U, useRef as W, useState as G } from "react";
|
|
13
|
+
import { useNavigate as K } from "@tanstack/react-router";
|
|
14
|
+
import { Trans as q, useLingui as J } from "@lingui/react";
|
|
15
|
+
import { z as Y } from "zod";
|
|
16
|
+
import { useForm as X, useStore as Z } from "@tanstack/react-form";
|
|
17
17
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/SecurityGroupHeader.tsx
|
|
18
18
|
function te({ name: e, id: t }) {
|
|
19
19
|
return /*#__PURE__*/ B("div", {
|
|
20
20
|
className: "mb-2",
|
|
21
|
-
children: [/*#__PURE__*/ z(
|
|
21
|
+
children: [/*#__PURE__*/ z(C, { children: `'${e || t}' Details` }), /*#__PURE__*/ z("p", {
|
|
22
22
|
className: "text-theme-secondary mt-2 text-sm",
|
|
23
|
-
children: /*#__PURE__*/ z(
|
|
23
|
+
children: /*#__PURE__*/ z(q, { id: "kIuDMT" })
|
|
24
24
|
})]
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/SecurityGroupBasicInfo.tsx
|
|
29
|
-
function
|
|
30
|
-
let { i18n:
|
|
31
|
-
|
|
29
|
+
function Q({ securityGroup: e, onEdit: t, canUpdate: n }) {
|
|
30
|
+
let { i18n: r, _: i } = J(), a = [
|
|
31
|
+
{
|
|
32
|
+
label: r._({ id: "Nu4oKW" }),
|
|
33
|
+
value: e.description || r._({ id: "h47p9L" })
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: r._({ id: "S0kLOH" }),
|
|
37
|
+
value: e.id
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: r._({ id: "OYHzN1" }),
|
|
41
|
+
value: e.tags?.join(", ") || r._({ id: "h47p9L" })
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: r._({ id: "6YtxFj" }),
|
|
45
|
+
value: e.name || r._({ id: "h47p9L" })
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: r._({ id: "Jim5X9" }),
|
|
49
|
+
value: e.stateful ? r._({ id: "l75CjT" }) : r._({ id: "1UzENP" })
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: r._({ id: "aI8Tgp" }),
|
|
53
|
+
value: e.project_id || r._({ id: "h47p9L" })
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: r._({ id: "0Gd0NU" }),
|
|
57
|
+
value: e.shared ? r._({ id: "l75CjT" }) : r._({ id: "1UzENP" })
|
|
58
|
+
}
|
|
59
|
+
];
|
|
60
|
+
return /*#__PURE__*/ B(R, { children: [/*#__PURE__*/ z("div", {
|
|
32
61
|
className: "mb-4 flex flex-row-reverse",
|
|
33
|
-
children: t &&
|
|
62
|
+
children: t && n && /*#__PURE__*/ z(m, {
|
|
34
63
|
variant: "primary",
|
|
35
64
|
onClick: t,
|
|
36
|
-
disabled: !
|
|
37
|
-
children: /*#__PURE__*/ z(
|
|
65
|
+
disabled: !n,
|
|
66
|
+
children: /*#__PURE__*/ z(q, { id: "ePK91l" })
|
|
38
67
|
})
|
|
39
|
-
}), /*#__PURE__*/
|
|
40
|
-
columns: 4,
|
|
41
|
-
gridColumnTemplate: "15% 35% 15% 35%",
|
|
42
|
-
children: [
|
|
43
|
-
/*#__PURE__*/ B(n, { children: [/*#__PURE__*/ z(c, { children: a._({ id: "Nu4oKW" }) }), /*#__PURE__*/ z(r, {
|
|
44
|
-
colSpan: 3,
|
|
45
|
-
children: /*#__PURE__*/ z("div", {
|
|
46
|
-
className: "overflow-hidden text-ellipsis whitespace-nowrap",
|
|
47
|
-
title: e.description || void 0,
|
|
48
|
-
children: e.description || a._({ id: "h47p9L" })
|
|
49
|
-
})
|
|
50
|
-
})] }),
|
|
51
|
-
/*#__PURE__*/ B(n, { children: [
|
|
52
|
-
/*#__PURE__*/ z(c, { children: a._({ id: "S0kLOH" }) }),
|
|
53
|
-
/*#__PURE__*/ z(r, { children: /*#__PURE__*/ z("div", {
|
|
54
|
-
className: "overflow-hidden text-ellipsis whitespace-nowrap",
|
|
55
|
-
title: e.id,
|
|
56
|
-
children: e.id
|
|
57
|
-
}) }),
|
|
58
|
-
/*#__PURE__*/ z(c, { children: a._({ id: "OYHzN1" }) }),
|
|
59
|
-
/*#__PURE__*/ z(r, { children: /*#__PURE__*/ z("div", {
|
|
60
|
-
className: "overflow-hidden text-ellipsis whitespace-nowrap",
|
|
61
|
-
title: e.tags?.join(", ") || void 0,
|
|
62
|
-
children: e.tags?.join(", ") || a._({ id: "h47p9L" })
|
|
63
|
-
}) })
|
|
64
|
-
] }),
|
|
65
|
-
/*#__PURE__*/ B(n, { children: [
|
|
66
|
-
/*#__PURE__*/ z(c, { children: a._({ id: "6YtxFj" }) }),
|
|
67
|
-
/*#__PURE__*/ z(r, { children: /*#__PURE__*/ z("div", {
|
|
68
|
-
className: "overflow-hidden text-ellipsis whitespace-nowrap",
|
|
69
|
-
title: e.name || void 0,
|
|
70
|
-
children: e.name
|
|
71
|
-
}) }),
|
|
72
|
-
/*#__PURE__*/ z(c, { children: a._({ id: "Jim5X9" }) }),
|
|
73
|
-
/*#__PURE__*/ z(r, { children: /*#__PURE__*/ z(l, { value: e.stateful }) })
|
|
74
|
-
] }),
|
|
75
|
-
/*#__PURE__*/ B(n, { children: [
|
|
76
|
-
/*#__PURE__*/ z(c, { children: a._({ id: "aI8Tgp" }) }),
|
|
77
|
-
/*#__PURE__*/ z(r, { children: /*#__PURE__*/ z("div", {
|
|
78
|
-
className: "overflow-hidden text-ellipsis whitespace-nowrap",
|
|
79
|
-
title: e.project_id || void 0,
|
|
80
|
-
children: e.project_id || a._({ id: "h47p9L" })
|
|
81
|
-
}) }),
|
|
82
|
-
/*#__PURE__*/ z(c, { children: a._({ id: "0Gd0NU" }) }),
|
|
83
|
-
/*#__PURE__*/ z(r, { children: /*#__PURE__*/ z(l, { value: e.shared }) })
|
|
84
|
-
] })
|
|
85
|
-
]
|
|
86
|
-
})] });
|
|
68
|
+
}), /*#__PURE__*/ z(M, { items: a })] });
|
|
87
69
|
}
|
|
88
70
|
//#endregion
|
|
89
71
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/SecurityGroupTabs.tsx
|
|
90
|
-
function
|
|
72
|
+
function $({ activeTab: e, onTabChange: t, showRBACTab: n = !0 }) {
|
|
91
73
|
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"}`;
|
|
92
74
|
return /*#__PURE__*/ z("div", {
|
|
93
75
|
className: "border-theme-background-lvl-3 mt-1 border-b",
|
|
94
|
-
children: /*#__PURE__*/ B(
|
|
76
|
+
children: /*#__PURE__*/ B(f, {
|
|
95
77
|
direction: "horizontal",
|
|
96
78
|
gap: "0",
|
|
97
79
|
children: [/*#__PURE__*/ z("button", {
|
|
98
80
|
className: r("rules"),
|
|
99
81
|
onClick: () => t("rules"),
|
|
100
|
-
children: /*#__PURE__*/ z(
|
|
82
|
+
children: /*#__PURE__*/ z(q, { id: "4EZrJN" })
|
|
101
83
|
}), n && /*#__PURE__*/ z("button", {
|
|
102
84
|
className: r("rbac"),
|
|
103
85
|
onClick: () => t("rbac"),
|
|
104
|
-
children: /*#__PURE__*/ z(
|
|
86
|
+
children: /*#__PURE__*/ z(q, { id: "/eFtWI" })
|
|
105
87
|
})]
|
|
106
88
|
})
|
|
107
89
|
});
|
|
108
90
|
}
|
|
109
91
|
//#endregion
|
|
110
92
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/DeleteRuleDialog.tsx
|
|
111
|
-
function ne({ rule: e, open:
|
|
112
|
-
let { i18n:
|
|
113
|
-
e &&
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
return e ? /*#__PURE__*/ z(
|
|
118
|
-
open:
|
|
119
|
-
onCancel:
|
|
93
|
+
function ne({ rule: e, open: t, onClose: n, onConfirm: r, isLoading: a, error: o }) {
|
|
94
|
+
let { i18n: l, _: u } = J(), [f, p] = G(""), h = () => {
|
|
95
|
+
e && f === "delete" && r(e.id);
|
|
96
|
+
}, g = () => {
|
|
97
|
+
p(""), n();
|
|
98
|
+
}, _ = f !== "delete" || a;
|
|
99
|
+
return e ? /*#__PURE__*/ z(d, {
|
|
100
|
+
open: t,
|
|
101
|
+
onCancel: g,
|
|
120
102
|
size: "small",
|
|
121
|
-
title:
|
|
122
|
-
modalFooter: /*#__PURE__*/ z(
|
|
103
|
+
title: l._({ id: "TM93nK" }),
|
|
104
|
+
modalFooter: /*#__PURE__*/ z(c, {
|
|
123
105
|
className: "flex justify-end",
|
|
124
|
-
children: /*#__PURE__*/ B(
|
|
106
|
+
children: /*#__PURE__*/ B(s, { children: [/*#__PURE__*/ z(m, {
|
|
125
107
|
variant: "default",
|
|
126
|
-
onClick:
|
|
108
|
+
onClick: g,
|
|
127
109
|
disabled: a,
|
|
128
|
-
children: /*#__PURE__*/ z(
|
|
129
|
-
}), /*#__PURE__*/ z(
|
|
110
|
+
children: /*#__PURE__*/ z(q, { id: "dEgA5A" })
|
|
111
|
+
}), /*#__PURE__*/ z(m, {
|
|
130
112
|
variant: "primary-danger",
|
|
131
|
-
onClick:
|
|
132
|
-
disabled:
|
|
113
|
+
onClick: h,
|
|
114
|
+
disabled: _,
|
|
133
115
|
"data-testid": "confirm-delete-rule-button",
|
|
134
|
-
children: a ? /*#__PURE__*/ z(
|
|
116
|
+
children: a ? /*#__PURE__*/ z(q, { id: "EF2EU9" }) : /*#__PURE__*/ z(q, { id: "lN3xvy" })
|
|
135
117
|
})] })
|
|
136
118
|
}),
|
|
137
119
|
children: /*#__PURE__*/ B("div", { children: [
|
|
138
|
-
o && /*#__PURE__*/ z(
|
|
120
|
+
o && /*#__PURE__*/ z(i, {
|
|
139
121
|
dismissible: !1,
|
|
140
122
|
variant: "error",
|
|
141
123
|
className: "mt-4",
|
|
142
124
|
children: o
|
|
143
125
|
}),
|
|
144
|
-
/*#__PURE__*/ z(
|
|
126
|
+
/*#__PURE__*/ z(q, { id: "CMVP7y" }),
|
|
145
127
|
/*#__PURE__*/ B("div", {
|
|
146
128
|
className: "bg-theme-background-lvl-1 mt-4 mb-4 rounded p-4",
|
|
147
129
|
children: [/*#__PURE__*/ z("p", {
|
|
148
130
|
className: "mb-2 font-semibold",
|
|
149
|
-
children: /*#__PURE__*/ z(
|
|
131
|
+
children: /*#__PURE__*/ z(q, { id: "uly9ET" })
|
|
150
132
|
}), /*#__PURE__*/ B("ul", {
|
|
151
133
|
className: "list-inside list-disc space-y-1 text-sm",
|
|
152
134
|
children: [
|
|
153
135
|
/*#__PURE__*/ B("li", { children: [
|
|
154
|
-
/*#__PURE__*/ z(
|
|
136
|
+
/*#__PURE__*/ z(q, { id: "MRB7nI" }),
|
|
155
137
|
": ",
|
|
156
138
|
e.direction
|
|
157
139
|
] }),
|
|
158
140
|
e.description && /*#__PURE__*/ B("li", { children: [
|
|
159
|
-
/*#__PURE__*/ z(
|
|
141
|
+
/*#__PURE__*/ z(q, { id: "Nu4oKW" }),
|
|
160
142
|
": ",
|
|
161
143
|
e.description
|
|
162
144
|
] }),
|
|
163
145
|
/*#__PURE__*/ B("li", { children: [
|
|
164
|
-
/*#__PURE__*/ z(
|
|
146
|
+
/*#__PURE__*/ z(q, { id: "yp0UjB" }),
|
|
165
147
|
": ",
|
|
166
148
|
e.ethertype
|
|
167
149
|
] }),
|
|
168
150
|
e.protocol && /*#__PURE__*/ B("li", { children: [
|
|
169
|
-
/*#__PURE__*/ z(
|
|
151
|
+
/*#__PURE__*/ z(q, { id: "6+OdGi" }),
|
|
170
152
|
": ",
|
|
171
153
|
e.protocol
|
|
172
154
|
] }),
|
|
173
155
|
e.port_range_min !== null && e.port_range_max !== null && /*#__PURE__*/ B("li", { children: [
|
|
174
|
-
/*#__PURE__*/ z(
|
|
156
|
+
/*#__PURE__*/ z(q, { id: "tV/Ozb" }),
|
|
175
157
|
":",
|
|
176
158
|
" ",
|
|
177
159
|
e.port_range_min === e.port_range_max ? e.port_range_min : `${e.port_range_min}-${e.port_range_max}`
|
|
178
160
|
] }),
|
|
179
161
|
e.remote_ip_prefix && /*#__PURE__*/ B("li", { children: [
|
|
180
|
-
/*#__PURE__*/ z(
|
|
162
|
+
/*#__PURE__*/ z(q, { id: "WoSkGY" }),
|
|
181
163
|
": ",
|
|
182
164
|
e.remote_ip_prefix
|
|
183
165
|
] }),
|
|
184
166
|
e.remote_group_id && /*#__PURE__*/ B("li", { children: [
|
|
185
|
-
/*#__PURE__*/ z(
|
|
167
|
+
/*#__PURE__*/ z(q, { id: "i9TIyi" }),
|
|
186
168
|
": ",
|
|
187
169
|
e.remote_group_id
|
|
188
170
|
] })
|
|
@@ -193,14 +175,14 @@ function ne({ rule: e, open: n, onClose: r, onConfirm: i, isLoading: a, error: o
|
|
|
193
175
|
className: "mt-4",
|
|
194
176
|
children: [/*#__PURE__*/ z("p", {
|
|
195
177
|
className: "mb-2 text-sm",
|
|
196
|
-
children: /*#__PURE__*/ z(
|
|
178
|
+
children: /*#__PURE__*/ z(q, {
|
|
197
179
|
id: "PHt+EV",
|
|
198
180
|
components: { 0: /*#__PURE__*/ z("strong", {}) }
|
|
199
181
|
})
|
|
200
|
-
}), /*#__PURE__*/ z(
|
|
201
|
-
value:
|
|
202
|
-
onChange: (e) =>
|
|
203
|
-
placeholder:
|
|
182
|
+
}), /*#__PURE__*/ z(v, {
|
|
183
|
+
value: f,
|
|
184
|
+
onChange: (e) => p(e.target.value),
|
|
185
|
+
placeholder: l._({ id: "HNlEFZ" }),
|
|
204
186
|
autoComplete: "off",
|
|
205
187
|
disabled: a,
|
|
206
188
|
"data-testid": "delete-rule-confirmation-input"
|
|
@@ -211,10 +193,10 @@ function ne({ rule: e, open: n, onClose: r, onConfirm: i, isLoading: a, error: o
|
|
|
211
193
|
}
|
|
212
194
|
//#endregion
|
|
213
195
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/validation/validationHelpers.ts
|
|
214
|
-
function
|
|
196
|
+
function re(e) {
|
|
215
197
|
return e.includes(".") ? "IPv4" : e.includes(":") ? "IPv6" : null;
|
|
216
198
|
}
|
|
217
|
-
function
|
|
199
|
+
function ie(e, t, n) {
|
|
218
200
|
if (e != null && isNaN(e) || t != null && isNaN(t)) return {
|
|
219
201
|
valid: !1,
|
|
220
202
|
error: "Port must be a valid number"
|
|
@@ -233,7 +215,7 @@ function re(e, t, n) {
|
|
|
233
215
|
error: "port_range_min must be less than or equal to port_range_max"
|
|
234
216
|
} : { valid: !0 };
|
|
235
217
|
}
|
|
236
|
-
function
|
|
218
|
+
function ae(e, t) {
|
|
237
219
|
return e != null && isNaN(e) ? {
|
|
238
220
|
valid: !1,
|
|
239
221
|
error: "ICMP type must be a valid number"
|
|
@@ -248,7 +230,7 @@ function ie(e, t) {
|
|
|
248
230
|
error: "ICMP code must be between 0 and 255"
|
|
249
231
|
} : { valid: !0 };
|
|
250
232
|
}
|
|
251
|
-
function
|
|
233
|
+
function oe(e) {
|
|
252
234
|
let t = e.split("/");
|
|
253
235
|
if (t.length !== 2) return !1;
|
|
254
236
|
let [n, r] = t;
|
|
@@ -277,107 +259,111 @@ function ae(e) {
|
|
|
277
259
|
}
|
|
278
260
|
//#endregion
|
|
279
261
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/constants.ts
|
|
280
|
-
var
|
|
281
|
-
ruleType:
|
|
282
|
-
direction:
|
|
283
|
-
ethertype:
|
|
284
|
-
description:
|
|
285
|
-
protocol:
|
|
286
|
-
portFrom:
|
|
287
|
-
portTo:
|
|
288
|
-
icmpType:
|
|
289
|
-
icmpCode:
|
|
290
|
-
remoteSourceType:
|
|
291
|
-
remoteCidr:
|
|
292
|
-
remoteSecurityGroupId:
|
|
262
|
+
var se = "0.0.0.0/0", ce = "::/0", le = "other-protocol", ue = Y.object({
|
|
263
|
+
ruleType: Y.string().min(1, "Rule type is required"),
|
|
264
|
+
direction: Y.enum(["ingress", "egress"]),
|
|
265
|
+
ethertype: Y.enum(["IPv4", "IPv6"]),
|
|
266
|
+
description: Y.string(),
|
|
267
|
+
protocol: Y.string().nullable(),
|
|
268
|
+
portFrom: Y.string(),
|
|
269
|
+
portTo: Y.string(),
|
|
270
|
+
icmpType: Y.string(),
|
|
271
|
+
icmpCode: Y.string(),
|
|
272
|
+
remoteSourceType: Y.enum(["cidr", "security_group"]),
|
|
273
|
+
remoteCidr: Y.string(),
|
|
274
|
+
remoteSecurityGroupId: Y.string()
|
|
293
275
|
}).superRefine((e, t) => {
|
|
294
|
-
let n = e.protocol === "tcp" || e.protocol === "udp", r = e.protocol === "icmp" || e.protocol === "ipv6-icmp", i = e.ruleType ===
|
|
276
|
+
let n = e.protocol === "tcp" || e.protocol === "udp", r = e.protocol === "icmp" || e.protocol === "ipv6-icmp", i = e.ruleType === le, a = n && ["custom-tcp", "custom-udp"].includes(e.ruleType);
|
|
295
277
|
if (i && !e.protocol && t.addIssue({
|
|
296
|
-
code:
|
|
278
|
+
code: Y.ZodIssueCode.custom,
|
|
297
279
|
message: "Protocol is required",
|
|
298
280
|
path: ["protocol"]
|
|
299
|
-
}), a)
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
});
|
|
304
|
-
else {
|
|
305
|
-
let n = parseInt(e.portFrom, 10);
|
|
306
|
-
if (isNaN(n)) t.addIssue({
|
|
307
|
-
code: J.ZodIssueCode.custom,
|
|
308
|
-
message: "Port must be a valid number",
|
|
281
|
+
}), a) {
|
|
282
|
+
if (!e.portFrom) t.addIssue({
|
|
283
|
+
code: Y.ZodIssueCode.custom,
|
|
284
|
+
message: "Port (from) is required",
|
|
309
285
|
path: ["portFrom"]
|
|
310
286
|
});
|
|
311
|
-
else
|
|
312
|
-
let
|
|
313
|
-
if (isNaN(
|
|
314
|
-
code:
|
|
287
|
+
else {
|
|
288
|
+
let n = parseInt(e.portFrom, 10);
|
|
289
|
+
if (isNaN(n)) t.addIssue({
|
|
290
|
+
code: Y.ZodIssueCode.custom,
|
|
315
291
|
message: "Port must be a valid number",
|
|
316
|
-
path: ["portTo"]
|
|
317
|
-
});
|
|
318
|
-
else if (n >= r) t.addIssue({
|
|
319
|
-
code: J.ZodIssueCode.custom,
|
|
320
|
-
message: "\"Port (from)\" must be less than \"Port (to)\"",
|
|
321
292
|
path: ["portFrom"]
|
|
322
293
|
});
|
|
323
|
-
else {
|
|
324
|
-
let
|
|
325
|
-
|
|
326
|
-
code:
|
|
327
|
-
message:
|
|
294
|
+
else if (e.portTo) {
|
|
295
|
+
let r = parseInt(e.portTo, 10);
|
|
296
|
+
if (isNaN(r)) t.addIssue({
|
|
297
|
+
code: Y.ZodIssueCode.custom,
|
|
298
|
+
message: "Port must be a valid number",
|
|
299
|
+
path: ["portTo"]
|
|
300
|
+
});
|
|
301
|
+
else if (n >= r) t.addIssue({
|
|
302
|
+
code: Y.ZodIssueCode.custom,
|
|
303
|
+
message: "\"Port (from)\" must be less than \"Port (to)\"",
|
|
304
|
+
path: ["portFrom"]
|
|
305
|
+
});
|
|
306
|
+
else {
|
|
307
|
+
let i = ie(n, r, e.protocol);
|
|
308
|
+
i.valid || t.addIssue({
|
|
309
|
+
code: Y.ZodIssueCode.custom,
|
|
310
|
+
message: i.error || "Invalid port range",
|
|
311
|
+
path: ["portFrom"]
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
} else {
|
|
315
|
+
let r = ie(n, n, e.protocol);
|
|
316
|
+
r.valid || t.addIssue({
|
|
317
|
+
code: Y.ZodIssueCode.custom,
|
|
318
|
+
message: r.error || "Invalid port",
|
|
328
319
|
path: ["portFrom"]
|
|
329
320
|
});
|
|
330
321
|
}
|
|
331
|
-
} else {
|
|
332
|
-
let r = re(n, n, e.protocol);
|
|
333
|
-
r.valid || t.addIssue({
|
|
334
|
-
code: J.ZodIssueCode.custom,
|
|
335
|
-
message: r.error || "Invalid port",
|
|
336
|
-
path: ["portFrom"]
|
|
337
|
-
});
|
|
338
322
|
}
|
|
339
323
|
}
|
|
340
324
|
if (r) {
|
|
341
325
|
let n = e.icmpType ? parseInt(e.icmpType, 10) : null, r = e.icmpCode ? parseInt(e.icmpCode, 10) : null;
|
|
342
326
|
if (e.icmpType && isNaN(n) && t.addIssue({
|
|
343
|
-
code:
|
|
327
|
+
code: Y.ZodIssueCode.custom,
|
|
344
328
|
message: "ICMP type must be a valid number",
|
|
345
329
|
path: ["icmpType"]
|
|
346
330
|
}), e.icmpCode && isNaN(r) && t.addIssue({
|
|
347
|
-
code:
|
|
331
|
+
code: Y.ZodIssueCode.custom,
|
|
348
332
|
message: "ICMP code must be a valid number",
|
|
349
333
|
path: ["icmpCode"]
|
|
350
334
|
}), e.icmpCode && !e.icmpType && t.addIssue({
|
|
351
|
-
code:
|
|
335
|
+
code: Y.ZodIssueCode.custom,
|
|
352
336
|
message: "ICMP type is required when ICMP code is specified",
|
|
353
337
|
path: ["icmpType"]
|
|
354
338
|
}), n !== null || r !== null) {
|
|
355
|
-
let e =
|
|
339
|
+
let e = ae(n, r);
|
|
356
340
|
e.valid || (e.error?.includes("type") && t.addIssue({
|
|
357
|
-
code:
|
|
341
|
+
code: Y.ZodIssueCode.custom,
|
|
358
342
|
message: "ICMP type must be between 0 and 255",
|
|
359
343
|
path: ["icmpType"]
|
|
360
344
|
}), e.error?.includes("code") && t.addIssue({
|
|
361
|
-
code:
|
|
345
|
+
code: Y.ZodIssueCode.custom,
|
|
362
346
|
message: "ICMP code must be between 0 and 255",
|
|
363
347
|
path: ["icmpCode"]
|
|
364
348
|
}));
|
|
365
349
|
}
|
|
366
350
|
}
|
|
367
|
-
if (e.remoteSourceType === "cidr" && e.remoteCidr)
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
});
|
|
372
|
-
else {
|
|
373
|
-
let n = $(e.remoteCidr);
|
|
374
|
-
n && n !== e.ethertype && t.addIssue({
|
|
375
|
-
code: J.ZodIssueCode.custom,
|
|
376
|
-
message: `CIDR family (${n}) must match Ethertype (${e.ethertype})`,
|
|
351
|
+
if (e.remoteSourceType === "cidr" && e.remoteCidr) {
|
|
352
|
+
if (!oe(e.remoteCidr)) t.addIssue({
|
|
353
|
+
code: Y.ZodIssueCode.custom,
|
|
354
|
+
message: "Invalid CIDR format. Examples: 0.0.0.0/0 (IPv4) or ::/0 (IPv6)",
|
|
377
355
|
path: ["remoteCidr"]
|
|
378
356
|
});
|
|
357
|
+
else {
|
|
358
|
+
let n = re(e.remoteCidr);
|
|
359
|
+
n && n !== e.ethertype && t.addIssue({
|
|
360
|
+
code: Y.ZodIssueCode.custom,
|
|
361
|
+
message: `CIDR family (${n}) must match Ethertype (${e.ethertype})`,
|
|
362
|
+
path: ["remoteCidr"]
|
|
363
|
+
});
|
|
364
|
+
}
|
|
379
365
|
}
|
|
380
|
-
}),
|
|
366
|
+
}), de = {
|
|
381
367
|
ruleType: "",
|
|
382
368
|
direction: "ingress",
|
|
383
369
|
ethertype: "IPv4",
|
|
@@ -388,9 +374,9 @@ var oe = "0.0.0.0/0", se = "::/0", ce = "other-protocol", le = J.object({
|
|
|
388
374
|
icmpType: "",
|
|
389
375
|
icmpCode: "",
|
|
390
376
|
remoteSourceType: "cidr",
|
|
391
|
-
remoteCidr:
|
|
377
|
+
remoteCidr: se,
|
|
392
378
|
remoteSecurityGroupId: ""
|
|
393
|
-
},
|
|
379
|
+
}, fe = [
|
|
394
380
|
{
|
|
395
381
|
value: "",
|
|
396
382
|
label: "",
|
|
@@ -548,14 +534,14 @@ var oe = "0.0.0.0/0", se = "::/0", ce = "other-protocol", le = J.object({
|
|
|
548
534
|
];
|
|
549
535
|
//#endregion
|
|
550
536
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/RuleTypeSection.tsx
|
|
551
|
-
function
|
|
552
|
-
let { i18n: n, _: r } =
|
|
537
|
+
function pe({ form: e, disabled: t = !1 }) {
|
|
538
|
+
let { i18n: n, _: r } = J();
|
|
553
539
|
return /*#__PURE__*/ z(e.Field, {
|
|
554
540
|
name: "ruleType",
|
|
555
541
|
mode: "value",
|
|
556
|
-
children: (r) => /*#__PURE__*/ z(
|
|
542
|
+
children: (r) => /*#__PURE__*/ z(_, {
|
|
557
543
|
className: "mb-6",
|
|
558
|
-
children: /*#__PURE__*/ z(
|
|
544
|
+
children: /*#__PURE__*/ z(S, {
|
|
559
545
|
id: "ruleType",
|
|
560
546
|
label: n._({ id: "YuGQWb" }),
|
|
561
547
|
value: r.state.value,
|
|
@@ -565,14 +551,14 @@ function fe({ form: e, disabled: t = !1 }) {
|
|
|
565
551
|
e.setFieldValue("protocol", null), e.setFieldValue("portFrom", ""), e.setFieldValue("portTo", ""), e.setFieldValue("icmpType", ""), e.setFieldValue("icmpCode", "");
|
|
566
552
|
return;
|
|
567
553
|
}
|
|
568
|
-
let i =
|
|
554
|
+
let i = fe.find((e) => e.value === n);
|
|
569
555
|
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", "")));
|
|
570
556
|
},
|
|
571
557
|
disabled: t,
|
|
572
|
-
children:
|
|
558
|
+
children: fe.map((e) => e.value === "" ? /*#__PURE__*/ z(o, {
|
|
573
559
|
value: e.value,
|
|
574
560
|
label: n._({ id: "eh/k36" })
|
|
575
|
-
}, e.value) : /*#__PURE__*/ z(
|
|
561
|
+
}, e.value) : /*#__PURE__*/ z(o, {
|
|
576
562
|
value: e.value,
|
|
577
563
|
label: e.label
|
|
578
564
|
}, e.value))
|
|
@@ -582,47 +568,47 @@ function fe({ form: e, disabled: t = !1 }) {
|
|
|
582
568
|
}
|
|
583
569
|
//#endregion
|
|
584
570
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/DirectionEthertypeSection.tsx
|
|
585
|
-
function
|
|
586
|
-
let { i18n:
|
|
587
|
-
return /*#__PURE__*/ z(
|
|
571
|
+
function me({ form: t, disabled: n = !1 }) {
|
|
572
|
+
let { i18n: r, _: i } = J();
|
|
573
|
+
return /*#__PURE__*/ z(t.Field, {
|
|
588
574
|
name: "direction",
|
|
589
|
-
children: (
|
|
575
|
+
children: (t) => /*#__PURE__*/ z(_, { children: /*#__PURE__*/ z(D, {
|
|
590
576
|
name: "direction",
|
|
591
|
-
label:
|
|
592
|
-
selected:
|
|
593
|
-
onChange: (
|
|
577
|
+
label: r._({ id: "MRB7nI" }),
|
|
578
|
+
selected: t.state.value,
|
|
579
|
+
onChange: (e) => t.handleChange(String(e)),
|
|
594
580
|
required: !0,
|
|
595
|
-
disabled:
|
|
581
|
+
disabled: n,
|
|
596
582
|
children: /*#__PURE__*/ B("div", {
|
|
597
583
|
className: "flex gap-4",
|
|
598
|
-
children: [/*#__PURE__*/ z(
|
|
584
|
+
children: [/*#__PURE__*/ z(e, {
|
|
599
585
|
value: "ingress",
|
|
600
|
-
label:
|
|
601
|
-
}), /*#__PURE__*/ z(
|
|
586
|
+
label: r._({ id: "fzfAAa" })
|
|
587
|
+
}), /*#__PURE__*/ z(e, {
|
|
602
588
|
value: "egress",
|
|
603
|
-
label:
|
|
589
|
+
label: r._({ id: "nETBrc" })
|
|
604
590
|
})]
|
|
605
591
|
})
|
|
606
592
|
}) })
|
|
607
593
|
});
|
|
608
594
|
}
|
|
609
|
-
function
|
|
610
|
-
let { i18n:
|
|
611
|
-
return /*#__PURE__*/ z(
|
|
595
|
+
function he({ form: t, disabled: n = !1 }) {
|
|
596
|
+
let { i18n: r, _: i } = J();
|
|
597
|
+
return /*#__PURE__*/ z(t.Field, {
|
|
612
598
|
name: "ethertype",
|
|
613
|
-
children: (
|
|
599
|
+
children: (t) => /*#__PURE__*/ z(_, { children: /*#__PURE__*/ z(D, {
|
|
614
600
|
name: "ethertype",
|
|
615
|
-
label:
|
|
616
|
-
selected:
|
|
617
|
-
onChange: (
|
|
601
|
+
label: r._({ id: "16085O" }),
|
|
602
|
+
selected: t.state.value,
|
|
603
|
+
onChange: (e) => t.handleChange(String(e)),
|
|
618
604
|
required: !0,
|
|
619
|
-
disabled:
|
|
605
|
+
disabled: n,
|
|
620
606
|
children: /*#__PURE__*/ B("div", {
|
|
621
607
|
className: "flex gap-4",
|
|
622
|
-
children: [/*#__PURE__*/ z(
|
|
608
|
+
children: [/*#__PURE__*/ z(e, {
|
|
623
609
|
value: "IPv4",
|
|
624
610
|
label: "IPv4"
|
|
625
|
-
}), /*#__PURE__*/ z(
|
|
611
|
+
}), /*#__PURE__*/ z(e, {
|
|
626
612
|
value: "IPv6",
|
|
627
613
|
label: "IPv6"
|
|
628
614
|
})]
|
|
@@ -632,13 +618,13 @@ function me({ form: e, disabled: t = !1 }) {
|
|
|
632
618
|
}
|
|
633
619
|
//#endregion
|
|
634
620
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/ProtocolSection.tsx
|
|
635
|
-
function
|
|
636
|
-
let { i18n: n, _: r } =
|
|
621
|
+
function ge({ form: e, disabled: t = !1 }) {
|
|
622
|
+
let { i18n: n, _: r } = J();
|
|
637
623
|
return /*#__PURE__*/ z(e.Field, {
|
|
638
624
|
name: "protocol",
|
|
639
|
-
children: (e) => /*#__PURE__*/ z(
|
|
625
|
+
children: (e) => /*#__PURE__*/ z(_, {
|
|
640
626
|
className: "mb-6",
|
|
641
|
-
children: /*#__PURE__*/ z(
|
|
627
|
+
children: /*#__PURE__*/ z(v, {
|
|
642
628
|
id: "protocol",
|
|
643
629
|
name: "protocol",
|
|
644
630
|
label: n._({ id: "6+OdGi" }),
|
|
@@ -653,9 +639,9 @@ function he({ form: e, disabled: t = !1 }) {
|
|
|
653
639
|
}
|
|
654
640
|
//#endregion
|
|
655
641
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/PortRangeSection.tsx
|
|
656
|
-
function
|
|
657
|
-
let { i18n: n, _: r } =
|
|
658
|
-
return /*#__PURE__*/ B(
|
|
642
|
+
function _e({ form: e, disabled: t = !1 }) {
|
|
643
|
+
let { i18n: n, _: r } = J(), i = Z(e.store, (e) => e.values.portFrom), a = Z(e.store, (e) => e.fieldMeta.portFrom?.errors[0]?.message), o = Z(e.store, (e) => e.fieldMeta.portTo?.errors[0]?.message), s = t || !i || i.trim() === "";
|
|
644
|
+
return /*#__PURE__*/ B(_, {
|
|
659
645
|
className: "mb-6",
|
|
660
646
|
children: [
|
|
661
647
|
/*#__PURE__*/ B("div", {
|
|
@@ -665,7 +651,7 @@ function ge({ form: e, disabled: t = !1 }) {
|
|
|
665
651
|
name: "portFrom",
|
|
666
652
|
children: (r) => /*#__PURE__*/ z("div", {
|
|
667
653
|
className: "flex-1",
|
|
668
|
-
children: /*#__PURE__*/ z(
|
|
654
|
+
children: /*#__PURE__*/ z(v, {
|
|
669
655
|
id: "portFrom",
|
|
670
656
|
name: "portFrom",
|
|
671
657
|
label: n._({ id: "LMdsuJ" }),
|
|
@@ -688,7 +674,7 @@ function ge({ form: e, disabled: t = !1 }) {
|
|
|
688
674
|
name: "portTo",
|
|
689
675
|
children: (t) => /*#__PURE__*/ z("div", {
|
|
690
676
|
className: "flex-1",
|
|
691
|
-
children: /*#__PURE__*/ z(
|
|
677
|
+
children: /*#__PURE__*/ z(v, {
|
|
692
678
|
id: "portTo",
|
|
693
679
|
name: "portTo",
|
|
694
680
|
label: n._({ id: "a12lSo" }),
|
|
@@ -717,9 +703,9 @@ function ge({ form: e, disabled: t = !1 }) {
|
|
|
717
703
|
}
|
|
718
704
|
//#endregion
|
|
719
705
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/IcmpSection.tsx
|
|
720
|
-
function
|
|
721
|
-
let { i18n: n, _: r } =
|
|
722
|
-
return /*#__PURE__*/ z(
|
|
706
|
+
function ve({ form: e, disabled: t = !1 }) {
|
|
707
|
+
let { i18n: n, _: r } = J();
|
|
708
|
+
return /*#__PURE__*/ z(_, {
|
|
723
709
|
className: "mb-6",
|
|
724
710
|
children: /*#__PURE__*/ B("div", {
|
|
725
711
|
className: "flex w-full gap-4",
|
|
@@ -727,7 +713,7 @@ function _e({ form: e, disabled: t = !1 }) {
|
|
|
727
713
|
name: "icmpType",
|
|
728
714
|
children: (e) => /*#__PURE__*/ z("div", {
|
|
729
715
|
className: "flex-1",
|
|
730
|
-
children: /*#__PURE__*/ z(
|
|
716
|
+
children: /*#__PURE__*/ z(v, {
|
|
731
717
|
id: "icmpType",
|
|
732
718
|
name: "icmpType",
|
|
733
719
|
label: n._({ id: "yPWFWy" }),
|
|
@@ -742,7 +728,7 @@ function _e({ form: e, disabled: t = !1 }) {
|
|
|
742
728
|
name: "icmpCode",
|
|
743
729
|
children: (e) => /*#__PURE__*/ z("div", {
|
|
744
730
|
className: "flex-1",
|
|
745
|
-
children: /*#__PURE__*/ z(
|
|
731
|
+
children: /*#__PURE__*/ z(v, {
|
|
746
732
|
id: "icmpCode",
|
|
747
733
|
name: "icmpCode",
|
|
748
734
|
label: n._({ id: "76RKuS" }),
|
|
@@ -759,75 +745,75 @@ function _e({ form: e, disabled: t = !1 }) {
|
|
|
759
745
|
}
|
|
760
746
|
//#endregion
|
|
761
747
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/RemoteSourceSection.tsx
|
|
762
|
-
function
|
|
763
|
-
let { i18n:
|
|
748
|
+
function ye({ form: t, disabled: n = !1, availableSecurityGroups: r }) {
|
|
749
|
+
let { i18n: i, _: a } = J();
|
|
764
750
|
return /*#__PURE__*/ B(R, { children: [
|
|
765
|
-
/*#__PURE__*/ z(
|
|
751
|
+
/*#__PURE__*/ z(t.Field, {
|
|
766
752
|
name: "remoteSourceType",
|
|
767
753
|
mode: "value",
|
|
768
|
-
children: (
|
|
754
|
+
children: (r) => /*#__PURE__*/ z(_, {
|
|
769
755
|
className: "mb-1",
|
|
770
|
-
children: /*#__PURE__*/ z(
|
|
756
|
+
children: /*#__PURE__*/ z(D, {
|
|
771
757
|
name: "remoteSourceType",
|
|
772
|
-
label:
|
|
773
|
-
selected:
|
|
774
|
-
onChange: (
|
|
775
|
-
let
|
|
776
|
-
|
|
758
|
+
label: i._({ id: "I5kZVK" }),
|
|
759
|
+
selected: r.state.value,
|
|
760
|
+
onChange: (e) => {
|
|
761
|
+
let n = String(e);
|
|
762
|
+
r.handleChange(n), n !== "security_group" && t.setFieldValue("ethertype", "IPv4");
|
|
777
763
|
},
|
|
778
|
-
disabled:
|
|
764
|
+
disabled: n,
|
|
779
765
|
children: /*#__PURE__*/ B("div", {
|
|
780
766
|
className: "flex gap-4",
|
|
781
|
-
children: [/*#__PURE__*/ z(
|
|
767
|
+
children: [/*#__PURE__*/ z(e, {
|
|
782
768
|
value: "cidr",
|
|
783
|
-
label:
|
|
784
|
-
}), /*#__PURE__*/ z(
|
|
769
|
+
label: i._({ id: "4uXhtt" })
|
|
770
|
+
}), /*#__PURE__*/ z(e, {
|
|
785
771
|
value: "security_group",
|
|
786
|
-
label:
|
|
772
|
+
label: i._({ id: "bwhBhT" })
|
|
787
773
|
})]
|
|
788
774
|
})
|
|
789
775
|
})
|
|
790
776
|
})
|
|
791
777
|
}),
|
|
792
|
-
/*#__PURE__*/ z(
|
|
778
|
+
/*#__PURE__*/ z(t.Field, {
|
|
793
779
|
name: "remoteSourceType",
|
|
794
|
-
children: (
|
|
780
|
+
children: (e) => e.state.value === "cidr" ? /*#__PURE__*/ z(t.Field, {
|
|
795
781
|
name: "remoteCidr",
|
|
796
|
-
children: (
|
|
782
|
+
children: (e) => /*#__PURE__*/ z(t.Field, {
|
|
797
783
|
name: "ethertype",
|
|
798
|
-
children: (
|
|
784
|
+
children: (t) => /*#__PURE__*/ z(_, {
|
|
799
785
|
className: "mb-6",
|
|
800
|
-
children: /*#__PURE__*/ z(
|
|
786
|
+
children: /*#__PURE__*/ z(v, {
|
|
801
787
|
id: "remoteCidr",
|
|
802
788
|
name: "remoteCidr",
|
|
803
|
-
label:
|
|
804
|
-
value:
|
|
805
|
-
onChange: (
|
|
806
|
-
errortext:
|
|
807
|
-
placeholder:
|
|
808
|
-
disabled:
|
|
789
|
+
label: i._({ id: "vmYyLY" }),
|
|
790
|
+
value: e.state.value,
|
|
791
|
+
onChange: (t) => e.handleChange(t.target.value),
|
|
792
|
+
errortext: e.state.meta.errors[0]?.message,
|
|
793
|
+
placeholder: t.state.value === "IPv4" ? se : ce,
|
|
794
|
+
disabled: n
|
|
809
795
|
})
|
|
810
796
|
})
|
|
811
797
|
})
|
|
812
798
|
}) : null
|
|
813
799
|
}),
|
|
814
|
-
/*#__PURE__*/ z(
|
|
800
|
+
/*#__PURE__*/ z(t.Field, {
|
|
815
801
|
name: "remoteSourceType",
|
|
816
|
-
children: (
|
|
802
|
+
children: (e) => e.state.value === "security_group" ? /*#__PURE__*/ z(t.Field, {
|
|
817
803
|
name: "remoteSecurityGroupId",
|
|
818
|
-
children: (e) => /*#__PURE__*/ z(
|
|
804
|
+
children: (e) => /*#__PURE__*/ z(_, {
|
|
819
805
|
className: "mb-6",
|
|
820
|
-
children: /*#__PURE__*/ B(
|
|
806
|
+
children: /*#__PURE__*/ B(S, {
|
|
821
807
|
id: "remoteSecurityGroupId",
|
|
822
|
-
label:
|
|
808
|
+
label: i._({ id: "i9TIyi" }),
|
|
823
809
|
value: e.state.value,
|
|
824
810
|
onChange: (t) => e.handleChange(String(t)),
|
|
825
811
|
errortext: e.state.meta.errors[0]?.message,
|
|
826
|
-
disabled:
|
|
827
|
-
children: [/*#__PURE__*/ z(
|
|
812
|
+
disabled: n,
|
|
813
|
+
children: [/*#__PURE__*/ z(o, {
|
|
828
814
|
value: "",
|
|
829
|
-
label:
|
|
830
|
-
}),
|
|
815
|
+
label: i._({ id: "ZvIpwi" })
|
|
816
|
+
}), r.map((e) => /*#__PURE__*/ z(o, {
|
|
831
817
|
value: e.id,
|
|
832
818
|
label: e.name || e.id
|
|
833
819
|
}, e.id))]
|
|
@@ -839,13 +825,13 @@ function ve({ form: e, disabled: t = !1, availableSecurityGroups: n }) {
|
|
|
839
825
|
}
|
|
840
826
|
//#endregion
|
|
841
827
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/DescriptionSection.tsx
|
|
842
|
-
function
|
|
843
|
-
let { i18n: n, _: r } =
|
|
828
|
+
function be({ form: e, disabled: t = !1 }) {
|
|
829
|
+
let { i18n: n, _: r } = J();
|
|
844
830
|
return /*#__PURE__*/ z(e.Field, {
|
|
845
831
|
name: "description",
|
|
846
|
-
children: (e) => /*#__PURE__*/ z(
|
|
832
|
+
children: (e) => /*#__PURE__*/ z(_, {
|
|
847
833
|
className: "mb-0",
|
|
848
|
-
children: /*#__PURE__*/ z(
|
|
834
|
+
children: /*#__PURE__*/ z(h, {
|
|
849
835
|
id: "description",
|
|
850
836
|
name: "description",
|
|
851
837
|
label: n._({ id: "Nu4oKW" }),
|
|
@@ -860,12 +846,12 @@ function ye({ form: e, disabled: t = !1 }) {
|
|
|
860
846
|
}
|
|
861
847
|
//#endregion
|
|
862
848
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/AddRuleModal.tsx
|
|
863
|
-
var
|
|
864
|
-
let { i18n:
|
|
865
|
-
defaultValues:
|
|
866
|
-
validators: { onSubmit:
|
|
849
|
+
var xe = ({ securityGroupId: e, open: t, onClose: n, onCreate: a, isLoading: o = !1, error: l = null, availableSecurityGroups: u = [] }) => {
|
|
850
|
+
let { i18n: f, _: p } = J(), h = X({
|
|
851
|
+
defaultValues: de,
|
|
852
|
+
validators: { onSubmit: ue },
|
|
867
853
|
onSubmit: async ({ value: t }) => {
|
|
868
|
-
if (
|
|
854
|
+
if (o) return;
|
|
869
855
|
let n = {
|
|
870
856
|
security_group_id: e,
|
|
871
857
|
direction: t.direction,
|
|
@@ -878,93 +864,93 @@ var be = ({ securityGroupId: e, open: n, onClose: r, onCreate: o, isLoading: s =
|
|
|
878
864
|
};
|
|
879
865
|
if ((t.protocol === "tcp" || t.protocol === "udp") && t.portFrom) {
|
|
880
866
|
let e = parseInt(t.portFrom, 10);
|
|
881
|
-
n.port_range_min = e, t.portTo ?
|
|
867
|
+
n.port_range_min = e, n.port_range_max = t.portTo ? parseInt(t.portTo, 10) : e;
|
|
882
868
|
}
|
|
883
|
-
(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
|
|
869
|
+
(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 a(n), _();
|
|
884
870
|
}
|
|
885
|
-
}),
|
|
886
|
-
|
|
871
|
+
}), _ = () => {
|
|
872
|
+
h.reset(), n();
|
|
887
873
|
};
|
|
888
|
-
return /*#__PURE__*/ B(
|
|
889
|
-
open:
|
|
890
|
-
onCancel:
|
|
874
|
+
return /*#__PURE__*/ B(d, {
|
|
875
|
+
open: t,
|
|
876
|
+
onCancel: _,
|
|
891
877
|
size: "large",
|
|
892
|
-
title:
|
|
893
|
-
modalFooter: /*#__PURE__*/ z(
|
|
878
|
+
title: f._({ id: "b2BLBa" }),
|
|
879
|
+
modalFooter: /*#__PURE__*/ z(c, {
|
|
894
880
|
className: "flex justify-end",
|
|
895
|
-
children: /*#__PURE__*/ z(
|
|
881
|
+
children: /*#__PURE__*/ z(h.Subscribe, { children: (e) => {
|
|
896
882
|
let t = !!e.values.ruleType;
|
|
897
|
-
return /*#__PURE__*/ B(
|
|
883
|
+
return /*#__PURE__*/ B(s, { children: [/*#__PURE__*/ z(m, {
|
|
898
884
|
variant: "default",
|
|
899
|
-
onClick:
|
|
900
|
-
disabled:
|
|
901
|
-
children: /*#__PURE__*/ z(
|
|
902
|
-
}), /*#__PURE__*/ z(
|
|
885
|
+
onClick: _,
|
|
886
|
+
disabled: o || e.isSubmitting,
|
|
887
|
+
children: /*#__PURE__*/ z(q, { id: "dEgA5A" })
|
|
888
|
+
}), /*#__PURE__*/ z(m, {
|
|
903
889
|
variant: "primary",
|
|
904
890
|
type: "button",
|
|
905
|
-
onClick: () =>
|
|
906
|
-
disabled:
|
|
891
|
+
onClick: () => h.handleSubmit(),
|
|
892
|
+
disabled: o || e.isSubmitting || !t,
|
|
907
893
|
"data-testid": "add-rule-button",
|
|
908
|
-
children: e.isSubmitting ||
|
|
894
|
+
children: e.isSubmitting || o ? /*#__PURE__*/ z(r, { size: "small" }) : /*#__PURE__*/ z(q, { id: "bmQLn5" })
|
|
909
895
|
})] });
|
|
910
896
|
} })
|
|
911
897
|
}),
|
|
912
898
|
children: [
|
|
913
|
-
|
|
899
|
+
l && /*#__PURE__*/ z(i, {
|
|
914
900
|
dismissible: !1,
|
|
915
901
|
variant: "error",
|
|
916
902
|
className: "mb-4",
|
|
917
|
-
children:
|
|
903
|
+
children: l
|
|
918
904
|
}),
|
|
919
|
-
|
|
905
|
+
o && /*#__PURE__*/ B("div", {
|
|
920
906
|
className: "mb-4 flex items-center justify-center gap-2",
|
|
921
|
-
children: [/*#__PURE__*/ z(
|
|
907
|
+
children: [/*#__PURE__*/ z(r, { variant: "primary" }), /*#__PURE__*/ z("span", {
|
|
922
908
|
className: "text-theme-secondary text-sm",
|
|
923
|
-
children: /*#__PURE__*/ z(
|
|
909
|
+
children: /*#__PURE__*/ z(q, { id: "gU7JFm" })
|
|
924
910
|
})]
|
|
925
911
|
}),
|
|
926
|
-
/*#__PURE__*/ z(
|
|
912
|
+
/*#__PURE__*/ z(g, {
|
|
927
913
|
className: "mb-6",
|
|
928
914
|
onSubmit: (e) => {
|
|
929
|
-
e.preventDefault(),
|
|
915
|
+
e.preventDefault(), h.handleSubmit();
|
|
930
916
|
},
|
|
931
|
-
children: /*#__PURE__*/ B(
|
|
917
|
+
children: /*#__PURE__*/ B(x, {
|
|
932
918
|
className: "mb-6",
|
|
933
|
-
children: [/*#__PURE__*/ z(
|
|
934
|
-
form:
|
|
935
|
-
disabled:
|
|
936
|
-
}), /*#__PURE__*/ z(
|
|
919
|
+
children: [/*#__PURE__*/ z(pe, {
|
|
920
|
+
form: h,
|
|
921
|
+
disabled: o
|
|
922
|
+
}), /*#__PURE__*/ z(h.Subscribe, { children: (e) => {
|
|
937
923
|
if (!e.values.ruleType) return null;
|
|
938
924
|
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";
|
|
939
925
|
return /*#__PURE__*/ B(R, { children: [
|
|
940
|
-
/*#__PURE__*/ z(
|
|
941
|
-
form:
|
|
942
|
-
disabled:
|
|
926
|
+
/*#__PURE__*/ z(me, {
|
|
927
|
+
form: h,
|
|
928
|
+
disabled: o
|
|
943
929
|
}),
|
|
944
|
-
e.values.ruleType === "other-protocol" && /*#__PURE__*/ z(
|
|
945
|
-
form:
|
|
946
|
-
disabled:
|
|
930
|
+
e.values.ruleType === "other-protocol" && /*#__PURE__*/ z(ge, {
|
|
931
|
+
form: h,
|
|
932
|
+
disabled: o
|
|
947
933
|
}),
|
|
948
|
-
t && /*#__PURE__*/ z(
|
|
949
|
-
form:
|
|
950
|
-
disabled:
|
|
934
|
+
t && /*#__PURE__*/ z(_e, {
|
|
935
|
+
form: h,
|
|
936
|
+
disabled: o
|
|
951
937
|
}),
|
|
952
|
-
n && /*#__PURE__*/ z(
|
|
953
|
-
form:
|
|
954
|
-
disabled:
|
|
938
|
+
n && /*#__PURE__*/ z(ve, {
|
|
939
|
+
form: h,
|
|
940
|
+
disabled: o
|
|
955
941
|
}),
|
|
956
|
-
/*#__PURE__*/ z(
|
|
957
|
-
form:
|
|
958
|
-
disabled:
|
|
959
|
-
availableSecurityGroups:
|
|
942
|
+
/*#__PURE__*/ z(ye, {
|
|
943
|
+
form: h,
|
|
944
|
+
disabled: o,
|
|
945
|
+
availableSecurityGroups: u
|
|
960
946
|
}),
|
|
961
|
-
e.values.remoteSourceType === "security_group" && /*#__PURE__*/ z(
|
|
962
|
-
form:
|
|
963
|
-
disabled:
|
|
947
|
+
e.values.remoteSourceType === "security_group" && /*#__PURE__*/ z(he, {
|
|
948
|
+
form: h,
|
|
949
|
+
disabled: o
|
|
964
950
|
}),
|
|
965
|
-
/*#__PURE__*/ z(
|
|
966
|
-
form:
|
|
967
|
-
disabled:
|
|
951
|
+
/*#__PURE__*/ z(be, {
|
|
952
|
+
form: h,
|
|
953
|
+
disabled: o
|
|
968
954
|
})
|
|
969
955
|
] });
|
|
970
956
|
} })]
|
|
@@ -975,24 +961,24 @@ var be = ({ securityGroupId: e, open: n, onClose: r, onCreate: o, isLoading: s =
|
|
|
975
961
|
};
|
|
976
962
|
//#endregion
|
|
977
963
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/SecurityGroupRulesTable.tsx
|
|
978
|
-
function
|
|
979
|
-
let { i18n:
|
|
980
|
-
|
|
964
|
+
function Se({ rules: e, totalRulesCount: r, onDeleteRule: i, isDeletingRule: a, deleteError: o, searchTerm: s = "", onSearchChange: c, sortSettings: l, onSortChange: d, filterSettings: h, onFilterChange: g, securityGroupId: _, onCreateRule: v, isCreatingRule: y = !1, createRuleError: x = null, availableSecurityGroups: S = [], canCreateRule: C, canDeleteRule: D }) {
|
|
965
|
+
let { i18n: O, _: k } = J(), [A, M] = G(null), [I, L] = N(), [V, U] = G(s), K = W(void 0);
|
|
966
|
+
H(() => () => clearTimeout(K.current), []);
|
|
981
967
|
let Y = (e) => {
|
|
982
|
-
|
|
968
|
+
M(e);
|
|
983
969
|
}, X = (e) => {
|
|
984
|
-
|
|
985
|
-
},
|
|
986
|
-
|
|
970
|
+
i(e);
|
|
971
|
+
}, Z = () => {
|
|
972
|
+
a || M(null);
|
|
987
973
|
};
|
|
988
|
-
|
|
989
|
-
!
|
|
990
|
-
}, [
|
|
991
|
-
let
|
|
974
|
+
H(() => {
|
|
975
|
+
!a && !o && M(null);
|
|
976
|
+
}, [a, o]);
|
|
977
|
+
let te = (e) => {
|
|
992
978
|
if (e.protocol === "icmp" || e.protocol === "ipv6-icmp") {
|
|
993
979
|
if (e.port_range_min !== null && e.port_range_max !== null) {
|
|
994
980
|
let t = e.port_range_min, n = e.port_range_max;
|
|
995
|
-
return
|
|
981
|
+
return O._({
|
|
996
982
|
id: "0p+s6m",
|
|
997
983
|
values: {
|
|
998
984
|
typeValue: t,
|
|
@@ -1000,252 +986,255 @@ function xe({ rules: t, totalRulesCount: i, onDeleteRule: a, isDeletingRule: s,
|
|
|
1000
986
|
}
|
|
1001
987
|
});
|
|
1002
988
|
}
|
|
1003
|
-
return
|
|
989
|
+
return O._({ id: "eKC+EC" });
|
|
1004
990
|
}
|
|
1005
|
-
return e.port_range_min === null || e.port_range_max === null ?
|
|
1006
|
-
}, Q =
|
|
991
|
+
return e.port_range_min === null || e.port_range_max === null ? O._({ id: "eKC+EC" }) : e.port_range_min === e.port_range_max ? String(e.port_range_min) : `${e.port_range_min}-${e.port_range_max}`;
|
|
992
|
+
}, Q = e.length, $ = r;
|
|
1007
993
|
return /*#__PURE__*/ B(R, { children: [
|
|
1008
|
-
/*#__PURE__*/ B(
|
|
994
|
+
/*#__PURE__*/ B(f, {
|
|
1009
995
|
direction: "vertical",
|
|
1010
996
|
gap: "4",
|
|
1011
997
|
children: [
|
|
1012
|
-
/*#__PURE__*/ B(
|
|
998
|
+
/*#__PURE__*/ B(f, {
|
|
1013
999
|
distribution: "between",
|
|
1014
1000
|
alignment: "center",
|
|
1015
1001
|
gap: "2",
|
|
1016
1002
|
className: "pb-2",
|
|
1017
1003
|
children: [/*#__PURE__*/ z("span", {
|
|
1018
1004
|
className: "theme-color-text-light text-sm",
|
|
1019
|
-
children: $ !== void 0 && Q !== $ ? /*#__PURE__*/ z(
|
|
1005
|
+
children: $ !== void 0 && Q !== $ ? /*#__PURE__*/ z(q, {
|
|
1020
1006
|
id: "xuVMLX",
|
|
1021
1007
|
values: {
|
|
1022
1008
|
rulesLength: Q,
|
|
1023
1009
|
totalCount: $
|
|
1024
1010
|
}
|
|
1025
|
-
}) : /*#__PURE__*/ z(
|
|
1011
|
+
}) : /*#__PURE__*/ z(q, {
|
|
1026
1012
|
id: "UHciG3",
|
|
1027
1013
|
values: { rulesLength: Q }
|
|
1028
1014
|
})
|
|
1029
|
-
}), /*#__PURE__*/ B(
|
|
1015
|
+
}), /*#__PURE__*/ B(f, {
|
|
1030
1016
|
gap: "2",
|
|
1031
|
-
children: [
|
|
1032
|
-
options:
|
|
1033
|
-
sortBy:
|
|
1034
|
-
sortDirection:
|
|
1035
|
-
|
|
1036
|
-
|
|
1017
|
+
children: [l && d && /*#__PURE__*/ z(j, {
|
|
1018
|
+
options: l.options,
|
|
1019
|
+
sortBy: l.sortBy,
|
|
1020
|
+
sortDirection: l.sortDirection ?? "asc",
|
|
1021
|
+
selectClassName: "min-w-40",
|
|
1022
|
+
onSortByChange: (e) => d({
|
|
1023
|
+
...l,
|
|
1037
1024
|
sortBy: e,
|
|
1038
|
-
sortDirection:
|
|
1025
|
+
sortDirection: l.sortDirection
|
|
1039
1026
|
}),
|
|
1040
|
-
onSortDirectionChange: (e) =>
|
|
1041
|
-
...
|
|
1027
|
+
onSortDirectionChange: (e) => d({
|
|
1028
|
+
...l,
|
|
1042
1029
|
sortDirection: e
|
|
1043
1030
|
})
|
|
1044
|
-
}),
|
|
1031
|
+
}), C && v && /*#__PURE__*/ z(m, {
|
|
1045
1032
|
variant: "primary",
|
|
1046
1033
|
icon: "addCircle",
|
|
1047
|
-
onClick:
|
|
1034
|
+
onClick: L,
|
|
1048
1035
|
className: "whitespace-nowrap",
|
|
1049
|
-
children: /*#__PURE__*/ z(
|
|
1036
|
+
children: /*#__PURE__*/ z(q, { id: "O8tK4v" })
|
|
1050
1037
|
})]
|
|
1051
1038
|
})]
|
|
1052
1039
|
}),
|
|
1053
|
-
(
|
|
1040
|
+
(h || c) && /*#__PURE__*/ z(ee, { children: /*#__PURE__*/ B(f, {
|
|
1054
1041
|
direction: "vertical",
|
|
1055
1042
|
gap: "2",
|
|
1056
|
-
children: [/*#__PURE__*/ B(
|
|
1043
|
+
children: [/*#__PURE__*/ B(f, {
|
|
1057
1044
|
distribution: "between",
|
|
1058
1045
|
alignment: "center",
|
|
1059
|
-
children: [
|
|
1060
|
-
filters:
|
|
1046
|
+
children: [h && g && /*#__PURE__*/ z(F, {
|
|
1047
|
+
filters: h.filters,
|
|
1048
|
+
selectClassName: "sm:min-w-40",
|
|
1049
|
+
comboboxClassName: "sm:min-w-40",
|
|
1061
1050
|
onChange: (e) => {
|
|
1062
|
-
if ((
|
|
1063
|
-
let t =
|
|
1064
|
-
|
|
1065
|
-
...
|
|
1051
|
+
if ((h.selectedFilters || []).some((t) => t.name === e.name && t.value === e.value)) return;
|
|
1052
|
+
let t = h.filters.find((t) => t.filterName === e.name)?.supportsMultiValue ? [...h.selectedFilters || [], e] : [...(h.selectedFilters || []).filter((t) => t.name !== e.name), e];
|
|
1053
|
+
g({
|
|
1054
|
+
...h,
|
|
1066
1055
|
selectedFilters: t
|
|
1067
1056
|
});
|
|
1068
1057
|
}
|
|
1069
|
-
}),
|
|
1070
|
-
placeholder:
|
|
1058
|
+
}), c && /*#__PURE__*/ z(E, {
|
|
1059
|
+
placeholder: O._({ id: "HMV+cw" }),
|
|
1071
1060
|
"data-testid": "searchbar",
|
|
1072
|
-
value:
|
|
1061
|
+
value: V,
|
|
1073
1062
|
onInput: (e) => {
|
|
1074
1063
|
let t = e.currentTarget.value;
|
|
1075
|
-
|
|
1064
|
+
U(t), clearTimeout(K.current), K.current = window.setTimeout(() => c(t), 500);
|
|
1076
1065
|
},
|
|
1077
1066
|
onSearch: (e) => {
|
|
1078
|
-
clearTimeout(
|
|
1067
|
+
clearTimeout(K.current), c(typeof e == "string" ? e : "");
|
|
1079
1068
|
},
|
|
1080
1069
|
onClear: () => {
|
|
1081
|
-
clearTimeout(
|
|
1070
|
+
clearTimeout(K.current), U(""), c("");
|
|
1082
1071
|
}
|
|
1083
1072
|
})]
|
|
1084
|
-
}),
|
|
1085
|
-
selectedFilters:
|
|
1086
|
-
onDelete: (e) =>
|
|
1087
|
-
...
|
|
1088
|
-
selectedFilters: (
|
|
1073
|
+
}), h?.selectedFilters && h.selectedFilters.length > 0 && /*#__PURE__*/ z(P, {
|
|
1074
|
+
selectedFilters: h.selectedFilters,
|
|
1075
|
+
onDelete: (e) => g?.({
|
|
1076
|
+
...h,
|
|
1077
|
+
selectedFilters: (h.selectedFilters || []).filter((t) => t.name !== e.name || t.value !== e.value)
|
|
1089
1078
|
}),
|
|
1090
|
-
onClear: () =>
|
|
1091
|
-
...
|
|
1079
|
+
onClear: () => g?.({
|
|
1080
|
+
...h,
|
|
1092
1081
|
selectedFilters: []
|
|
1093
1082
|
})
|
|
1094
1083
|
})]
|
|
1095
1084
|
}) }),
|
|
1096
|
-
|
|
1085
|
+
e.length === 0 ? /*#__PURE__*/ z(q, { id: "nnxwBn" }) : /*#__PURE__*/ B(w, {
|
|
1097
1086
|
columns: D ? 6 : 5,
|
|
1098
1087
|
className: "security-group-rules-table",
|
|
1099
1088
|
children: [/*#__PURE__*/ B(n, { children: [
|
|
1100
|
-
/*#__PURE__*/ z(
|
|
1101
|
-
/*#__PURE__*/ z(
|
|
1102
|
-
/*#__PURE__*/ z(
|
|
1103
|
-
/*#__PURE__*/ z(
|
|
1104
|
-
/*#__PURE__*/ z(
|
|
1105
|
-
D && /*#__PURE__*/ z(
|
|
1106
|
-
] }),
|
|
1107
|
-
"data-testid": `rule-row-${
|
|
1089
|
+
/*#__PURE__*/ z(t, { children: O._({ id: "MRB7nI" }) }),
|
|
1090
|
+
/*#__PURE__*/ z(t, { children: O._({ id: "Nu4oKW" }) }),
|
|
1091
|
+
/*#__PURE__*/ z(t, { children: O._({ id: "yp0UjB" }) }),
|
|
1092
|
+
/*#__PURE__*/ z(t, { children: O._({ id: "6+OdGi" }) }),
|
|
1093
|
+
/*#__PURE__*/ z(t, { children: O._({ id: "6jAi8c" }) }),
|
|
1094
|
+
D && /*#__PURE__*/ z(t, { children: O._({ id: "7L01XJ" }) })
|
|
1095
|
+
] }), e.map((e) => /*#__PURE__*/ B(n, {
|
|
1096
|
+
"data-testid": `rule-row-${e.id}`,
|
|
1108
1097
|
children: [
|
|
1109
|
-
/*#__PURE__*/ z(
|
|
1110
|
-
/*#__PURE__*/ z(
|
|
1111
|
-
/*#__PURE__*/ z(
|
|
1112
|
-
/*#__PURE__*/ z(
|
|
1113
|
-
/*#__PURE__*/ z(
|
|
1114
|
-
D && /*#__PURE__*/ z(
|
|
1098
|
+
/*#__PURE__*/ z(T, { children: e.direction || O._({ id: "h47p9L" }) }),
|
|
1099
|
+
/*#__PURE__*/ z(T, { children: e.description || O._({ id: "h47p9L" }) }),
|
|
1100
|
+
/*#__PURE__*/ z(T, { children: e.ethertype }),
|
|
1101
|
+
/*#__PURE__*/ z(T, { children: e.protocol || O._({ id: "eKC+EC" }) }),
|
|
1102
|
+
/*#__PURE__*/ z(T, { children: te(e) }),
|
|
1103
|
+
D && /*#__PURE__*/ z(T, {
|
|
1115
1104
|
onClick: (e) => e.stopPropagation(),
|
|
1116
1105
|
className: "items-end justify-end pr-0",
|
|
1117
|
-
children: /*#__PURE__*/ z(
|
|
1118
|
-
label:
|
|
1119
|
-
onClick: () => Y(
|
|
1106
|
+
children: /*#__PURE__*/ z(b, { children: /*#__PURE__*/ z(p, { children: /*#__PURE__*/ z(u, {
|
|
1107
|
+
label: O._({ id: "cnGeoo" }),
|
|
1108
|
+
onClick: () => Y(e)
|
|
1120
1109
|
}) }) })
|
|
1121
1110
|
})
|
|
1122
1111
|
]
|
|
1123
|
-
},
|
|
1112
|
+
}, e.id))]
|
|
1124
1113
|
})
|
|
1125
1114
|
]
|
|
1126
1115
|
}),
|
|
1127
1116
|
D && /*#__PURE__*/ z(ne, {
|
|
1128
|
-
rule:
|
|
1129
|
-
open: !!
|
|
1130
|
-
onClose:
|
|
1117
|
+
rule: A,
|
|
1118
|
+
open: !!A,
|
|
1119
|
+
onClose: Z,
|
|
1131
1120
|
onConfirm: X,
|
|
1132
|
-
isLoading:
|
|
1133
|
-
error:
|
|
1121
|
+
isLoading: a,
|
|
1122
|
+
error: o
|
|
1134
1123
|
}),
|
|
1135
|
-
|
|
1136
|
-
securityGroupId:
|
|
1137
|
-
open:
|
|
1138
|
-
onClose:
|
|
1139
|
-
onCreate:
|
|
1140
|
-
isLoading:
|
|
1141
|
-
error:
|
|
1142
|
-
availableSecurityGroups:
|
|
1124
|
+
C && _ && v && I && /*#__PURE__*/ z(xe, {
|
|
1125
|
+
securityGroupId: _,
|
|
1126
|
+
open: I,
|
|
1127
|
+
onClose: L,
|
|
1128
|
+
onCreate: v,
|
|
1129
|
+
isLoading: y,
|
|
1130
|
+
error: x,
|
|
1131
|
+
availableSecurityGroups: S
|
|
1143
1132
|
})
|
|
1144
1133
|
] });
|
|
1145
1134
|
}
|
|
1146
1135
|
//#endregion
|
|
1147
1136
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/RBACPolicyRow.tsx
|
|
1148
|
-
function
|
|
1149
|
-
let { i18n:
|
|
1137
|
+
function Ce({ policy: e, onDelete: t, canDelete: r }) {
|
|
1138
|
+
let { i18n: i, _: a } = J();
|
|
1150
1139
|
return /*#__PURE__*/ B(n, { children: [
|
|
1151
|
-
/*#__PURE__*/ z(
|
|
1152
|
-
/*#__PURE__*/ z(
|
|
1153
|
-
/*#__PURE__*/ z(
|
|
1140
|
+
/*#__PURE__*/ z(T, { children: e.target_tenant }),
|
|
1141
|
+
/*#__PURE__*/ z(T, { children: e.action }),
|
|
1142
|
+
/*#__PURE__*/ z(T, {
|
|
1154
1143
|
onClick: (e) => e.stopPropagation(),
|
|
1155
1144
|
className: "items-end justify-end pr-0",
|
|
1156
|
-
children:
|
|
1157
|
-
label:
|
|
1158
|
-
onClick:
|
|
1145
|
+
children: r && /*#__PURE__*/ z(b, { children: /*#__PURE__*/ z(p, { children: /*#__PURE__*/ z(u, {
|
|
1146
|
+
label: i._({ id: "t/YqKh" }),
|
|
1147
|
+
onClick: t
|
|
1159
1148
|
}) }) })
|
|
1160
1149
|
})
|
|
1161
1150
|
] });
|
|
1162
1151
|
}
|
|
1163
1152
|
//#endregion
|
|
1164
1153
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRBACPolicyModal.tsx
|
|
1165
|
-
var
|
|
1166
|
-
function
|
|
1167
|
-
return
|
|
1154
|
+
var we = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, Te = /^[0-9a-f]{32}$/i;
|
|
1155
|
+
function Ee(e) {
|
|
1156
|
+
return we.test(e) || Te.test(e);
|
|
1168
1157
|
}
|
|
1169
|
-
function
|
|
1170
|
-
let { i18n:
|
|
1171
|
-
|
|
1172
|
-
project_id:
|
|
1173
|
-
securityGroupId:
|
|
1174
|
-
}),
|
|
1175
|
-
project_id:
|
|
1176
|
-
securityGroupId:
|
|
1177
|
-
}),
|
|
1178
|
-
} }),
|
|
1158
|
+
function De({ isOpen: e, onClose: t, securityGroupId: n }) {
|
|
1159
|
+
let { i18n: r, _: a } = J(), o = O.useUtils(), s = A(), [c, l] = G(!1), u = Y.object({ targetTenant: Y.string().min(1, r._({ id: "1RwosK" })).refine(Ee, { message: r._({ id: "CunRry" }) }) }), f = O.network.rbacPolicy.create.useMutation({ onSuccess: () => {
|
|
1160
|
+
o.network.rbacPolicy.list.invalidate({
|
|
1161
|
+
project_id: s,
|
|
1162
|
+
securityGroupId: n
|
|
1163
|
+
}), o.network.securityGroup.getById.invalidate({
|
|
1164
|
+
project_id: s,
|
|
1165
|
+
securityGroupId: n
|
|
1166
|
+
}), m();
|
|
1167
|
+
} }), p = X({
|
|
1179
1168
|
defaultValues: { targetTenant: "" },
|
|
1180
|
-
validators: { onSubmit:
|
|
1169
|
+
validators: { onSubmit: u },
|
|
1181
1170
|
onSubmit: async ({ value: e }) => {
|
|
1182
|
-
|
|
1183
|
-
project_id:
|
|
1184
|
-
securityGroupId:
|
|
1171
|
+
f.isPending || f.mutate({
|
|
1172
|
+
project_id: s,
|
|
1173
|
+
securityGroupId: n,
|
|
1185
1174
|
targetTenant: e.targetTenant.trim()
|
|
1186
1175
|
});
|
|
1187
1176
|
}
|
|
1188
|
-
}),
|
|
1189
|
-
|
|
1190
|
-
},
|
|
1191
|
-
|
|
1177
|
+
}), m = () => {
|
|
1178
|
+
p.reset(), f.reset(), l(!1), t();
|
|
1179
|
+
}, h = async () => {
|
|
1180
|
+
l(!0), await p.handleSubmit();
|
|
1192
1181
|
};
|
|
1193
|
-
return /*#__PURE__*/ B(
|
|
1182
|
+
return /*#__PURE__*/ B(d, {
|
|
1194
1183
|
open: e,
|
|
1195
|
-
onCancel:
|
|
1196
|
-
title:
|
|
1184
|
+
onCancel: m,
|
|
1185
|
+
title: r._({ id: "vmRPFm" }),
|
|
1197
1186
|
size: "large",
|
|
1198
|
-
onConfirm:
|
|
1199
|
-
cancelButtonLabel:
|
|
1200
|
-
confirmButtonLabel:
|
|
1201
|
-
disableConfirmButton:
|
|
1187
|
+
onConfirm: h,
|
|
1188
|
+
cancelButtonLabel: r._({ id: "dEgA5A" }),
|
|
1189
|
+
confirmButtonLabel: r._({ id: "Z8lGw6" }),
|
|
1190
|
+
disableConfirmButton: f.isPending,
|
|
1202
1191
|
children: [
|
|
1203
|
-
|
|
1192
|
+
f.error && /*#__PURE__*/ z(i, {
|
|
1204
1193
|
variant: "error",
|
|
1205
1194
|
className: "mb-4",
|
|
1206
1195
|
children: (() => {
|
|
1207
|
-
let e =
|
|
1208
|
-
return e.includes("conflict") || e.includes("409") ?
|
|
1196
|
+
let e = f.error.message.toLowerCase();
|
|
1197
|
+
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" }) : f.error.message;
|
|
1209
1198
|
})()
|
|
1210
1199
|
}),
|
|
1211
1200
|
/*#__PURE__*/ z("p", {
|
|
1212
1201
|
className: "mb-4",
|
|
1213
|
-
children: /*#__PURE__*/ z(
|
|
1202
|
+
children: /*#__PURE__*/ z(q, { id: "cjEOmc" })
|
|
1214
1203
|
}),
|
|
1215
|
-
/*#__PURE__*/ z(
|
|
1204
|
+
/*#__PURE__*/ z(g, {
|
|
1216
1205
|
className: "mb-0",
|
|
1217
1206
|
onSubmit: (e) => {
|
|
1218
|
-
e.preventDefault(),
|
|
1207
|
+
e.preventDefault(), h();
|
|
1219
1208
|
},
|
|
1220
|
-
children: /*#__PURE__*/ z(
|
|
1209
|
+
children: /*#__PURE__*/ z(x, { children: /*#__PURE__*/ z(p.Field, {
|
|
1221
1210
|
name: "targetTenant",
|
|
1222
1211
|
validators: {
|
|
1223
1212
|
onBlur: ({ value: e }) => {
|
|
1224
1213
|
let t = e.trim();
|
|
1225
|
-
if (!t) return
|
|
1226
|
-
if (!
|
|
1214
|
+
if (!t) return r._({ id: "1RwosK" });
|
|
1215
|
+
if (!Ee(t)) return r._({ id: "CunRry" });
|
|
1227
1216
|
},
|
|
1228
1217
|
onChange: ({ value: e }) => {
|
|
1229
|
-
if (!
|
|
1218
|
+
if (!c) return;
|
|
1230
1219
|
let t = e.trim();
|
|
1231
|
-
if (!t) return
|
|
1232
|
-
if (!
|
|
1220
|
+
if (!t) return r._({ id: "1RwosK" });
|
|
1221
|
+
if (!Ee(t)) return r._({ id: "CunRry" });
|
|
1233
1222
|
}
|
|
1234
1223
|
},
|
|
1235
1224
|
children: (e) => {
|
|
1236
|
-
let t = (e.state.meta.isTouched ||
|
|
1237
|
-
return /*#__PURE__*/ z(
|
|
1225
|
+
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;
|
|
1226
|
+
return /*#__PURE__*/ z(v, {
|
|
1238
1227
|
id: e.name,
|
|
1239
1228
|
name: e.name,
|
|
1240
|
-
label:
|
|
1229
|
+
label: r._({ id: "WzVwU0" }),
|
|
1241
1230
|
value: e.state.value,
|
|
1242
1231
|
onChange: (t) => e.handleChange(t.target.value),
|
|
1243
1232
|
onBlur: e.handleBlur,
|
|
1244
|
-
placeholder:
|
|
1233
|
+
placeholder: r._({ id: "he4q+i" }),
|
|
1245
1234
|
required: !0,
|
|
1246
|
-
helptext:
|
|
1247
|
-
disabled:
|
|
1248
|
-
errortext:
|
|
1235
|
+
helptext: r._({ id: "PkfPsB" }),
|
|
1236
|
+
disabled: f.isPending,
|
|
1237
|
+
errortext: i,
|
|
1249
1238
|
invalid: t
|
|
1250
1239
|
});
|
|
1251
1240
|
}
|
|
@@ -1256,80 +1245,80 @@ function Ee({ isOpen: e, onClose: n, securityGroupId: r }) {
|
|
|
1256
1245
|
}
|
|
1257
1246
|
//#endregion
|
|
1258
1247
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/DeleteRBACPolicyDialog.tsx
|
|
1259
|
-
function
|
|
1260
|
-
let { i18n:
|
|
1248
|
+
function Oe({ policy: e, open: t, onClose: n, onConfirm: r, isLoading: a, error: o }) {
|
|
1249
|
+
let { i18n: s, _: c } = J(), l = Y.object({ confirmText: Y.string().refine((e) => e === "remove", { message: s._({ id: "SVLToM" }) }) }), u = X({
|
|
1261
1250
|
defaultValues: { confirmText: "" },
|
|
1262
|
-
validators: { onSubmit:
|
|
1251
|
+
validators: { onSubmit: l },
|
|
1263
1252
|
onSubmit: async () => {
|
|
1264
|
-
|
|
1253
|
+
a || (r(e.id), p());
|
|
1265
1254
|
}
|
|
1266
|
-
}), f =
|
|
1267
|
-
|
|
1255
|
+
}), f = Z(u.store, (e) => e.isSubmitting || e.values.confirmText !== "remove"), p = () => {
|
|
1256
|
+
u.reset(), n();
|
|
1268
1257
|
};
|
|
1269
|
-
return /*#__PURE__*/ z(
|
|
1270
|
-
open:
|
|
1258
|
+
return /*#__PURE__*/ z(d, {
|
|
1259
|
+
open: t,
|
|
1271
1260
|
onCancel: p,
|
|
1272
1261
|
size: "small",
|
|
1273
|
-
title:
|
|
1274
|
-
onConfirm:
|
|
1275
|
-
cancelButtonLabel:
|
|
1276
|
-
confirmButtonLabel:
|
|
1277
|
-
disableConfirmButton:
|
|
1262
|
+
title: s._({ id: "Dt5W9T" }),
|
|
1263
|
+
onConfirm: u.handleSubmit,
|
|
1264
|
+
cancelButtonLabel: s._({ id: "dEgA5A" }),
|
|
1265
|
+
confirmButtonLabel: a ? s._({ id: "M5RhXF" }) : s._({ id: "qh5W8q" }),
|
|
1266
|
+
disableConfirmButton: a || f,
|
|
1278
1267
|
children: /*#__PURE__*/ B("div", { children: [
|
|
1279
|
-
|
|
1268
|
+
o && /*#__PURE__*/ z(i, {
|
|
1280
1269
|
dismissible: !1,
|
|
1281
1270
|
variant: "error",
|
|
1282
1271
|
className: "mt-4",
|
|
1283
|
-
children:
|
|
1272
|
+
children: o
|
|
1284
1273
|
}),
|
|
1285
|
-
/*#__PURE__*/ z(
|
|
1274
|
+
/*#__PURE__*/ z(q, { id: "BMTd81" }),
|
|
1286
1275
|
/*#__PURE__*/ B("div", {
|
|
1287
1276
|
className: "bg-theme-background-lvl-1 mt-4 mb-4 rounded p-4",
|
|
1288
1277
|
children: [/*#__PURE__*/ z("p", {
|
|
1289
1278
|
className: "mb-2 font-semibold",
|
|
1290
|
-
children: /*#__PURE__*/ z(
|
|
1279
|
+
children: /*#__PURE__*/ z(q, { id: "nLvo6K" })
|
|
1291
1280
|
}), /*#__PURE__*/ B("ul", {
|
|
1292
1281
|
className: "list-inside list-disc space-y-1 text-sm",
|
|
1293
1282
|
children: [
|
|
1294
1283
|
/*#__PURE__*/ B("li", { children: [
|
|
1295
|
-
/*#__PURE__*/ z(
|
|
1284
|
+
/*#__PURE__*/ z(q, { id: "WzVwU0" }),
|
|
1296
1285
|
": ",
|
|
1297
1286
|
e.target_tenant
|
|
1298
1287
|
] }),
|
|
1299
1288
|
/*#__PURE__*/ B("li", { children: [
|
|
1300
|
-
/*#__PURE__*/ z(
|
|
1289
|
+
/*#__PURE__*/ z(q, { id: "bwRvnp" }),
|
|
1301
1290
|
": ",
|
|
1302
1291
|
e.action
|
|
1303
1292
|
] }),
|
|
1304
1293
|
/*#__PURE__*/ B("li", { children: [
|
|
1305
|
-
/*#__PURE__*/ z(
|
|
1294
|
+
/*#__PURE__*/ z(q, { id: "UGhVPl" }),
|
|
1306
1295
|
": ",
|
|
1307
1296
|
e.object_type
|
|
1308
1297
|
] })
|
|
1309
1298
|
]
|
|
1310
1299
|
})]
|
|
1311
1300
|
}),
|
|
1312
|
-
!
|
|
1301
|
+
!a && /*#__PURE__*/ z(g, {
|
|
1313
1302
|
className: "mt-4 mb-0",
|
|
1314
1303
|
onSubmit: (e) => {
|
|
1315
|
-
e.preventDefault(),
|
|
1304
|
+
e.preventDefault(), u.handleSubmit();
|
|
1316
1305
|
},
|
|
1317
|
-
children: /*#__PURE__*/ B(
|
|
1306
|
+
children: /*#__PURE__*/ B(x, { children: [/*#__PURE__*/ z("p", {
|
|
1318
1307
|
className: "mb-2 text-sm",
|
|
1319
|
-
children: /*#__PURE__*/ z(
|
|
1308
|
+
children: /*#__PURE__*/ z(q, {
|
|
1320
1309
|
id: "Enpdmy",
|
|
1321
1310
|
components: { 0: /*#__PURE__*/ z("strong", {}) }
|
|
1322
1311
|
})
|
|
1323
|
-
}), /*#__PURE__*/ z(
|
|
1312
|
+
}), /*#__PURE__*/ z(u.Field, {
|
|
1324
1313
|
name: "confirmText",
|
|
1325
|
-
children: (e) => /*#__PURE__*/ z(
|
|
1314
|
+
children: (e) => /*#__PURE__*/ z(v, {
|
|
1326
1315
|
id: e.name,
|
|
1327
1316
|
name: e.name,
|
|
1328
1317
|
value: e.state.value,
|
|
1329
1318
|
onChange: (t) => e.handleChange(t.target.value),
|
|
1330
|
-
placeholder:
|
|
1319
|
+
placeholder: s._({ id: "tasfos" }),
|
|
1331
1320
|
autoComplete: "off",
|
|
1332
|
-
disabled:
|
|
1321
|
+
disabled: a,
|
|
1333
1322
|
"data-testid": "remove-policy-confirmation-input"
|
|
1334
1323
|
})
|
|
1335
1324
|
})] })
|
|
@@ -1339,141 +1328,141 @@ function De({ policy: e, open: n, onClose: r, onConfirm: a, isLoading: o, error:
|
|
|
1339
1328
|
}
|
|
1340
1329
|
//#endregion
|
|
1341
1330
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/SecurityGroupRBACPolicies.tsx
|
|
1342
|
-
function
|
|
1343
|
-
let
|
|
1344
|
-
|
|
1345
|
-
let { data:
|
|
1346
|
-
project_id:
|
|
1331
|
+
function ke({ securityGroupId: e, canManageAccess: a }) {
|
|
1332
|
+
let o = O.useUtils(), { i18n: s, _: c } = J(), l = A(), [u, d] = N(), [p, h] = G(null), [g, _] = G(""), [v, y] = G(""), b = W(void 0);
|
|
1333
|
+
H(() => () => clearTimeout(b.current), []);
|
|
1334
|
+
let { data: x, isPending: S, isError: C, error: T } = O.network.rbacPolicy.list.useQuery({
|
|
1335
|
+
project_id: l,
|
|
1347
1336
|
securityGroupId: e
|
|
1348
|
-
}, { refetchOnWindowFocus: !1 }), D =
|
|
1349
|
-
|
|
1350
|
-
project_id:
|
|
1337
|
+
}, { refetchOnWindowFocus: !1 }), D = O.network.rbacPolicy.delete.useMutation({ onSuccess: () => {
|
|
1338
|
+
o.network.rbacPolicy.list.invalidate({
|
|
1339
|
+
project_id: l,
|
|
1351
1340
|
securityGroupId: e
|
|
1352
|
-
}),
|
|
1353
|
-
project_id:
|
|
1341
|
+
}), o.network.securityGroup.getById.invalidate({
|
|
1342
|
+
project_id: l,
|
|
1354
1343
|
securityGroupId: e
|
|
1355
1344
|
});
|
|
1356
|
-
} }),
|
|
1345
|
+
} }), k = (e) => {
|
|
1357
1346
|
h(e);
|
|
1358
|
-
},
|
|
1347
|
+
}, j = (e) => {
|
|
1359
1348
|
D.mutate({
|
|
1360
|
-
project_id:
|
|
1349
|
+
project_id: l,
|
|
1361
1350
|
policyId: e
|
|
1362
1351
|
});
|
|
1363
|
-
},
|
|
1352
|
+
}, M = () => {
|
|
1364
1353
|
D.isPending || h(null);
|
|
1365
1354
|
};
|
|
1366
|
-
|
|
1355
|
+
H(() => {
|
|
1367
1356
|
!D.isPending && !D.error && D.isSuccess && h(null);
|
|
1368
1357
|
}, [
|
|
1369
1358
|
D.isPending,
|
|
1370
1359
|
D.error,
|
|
1371
1360
|
D.isSuccess
|
|
1372
1361
|
]);
|
|
1373
|
-
let
|
|
1374
|
-
if (!
|
|
1375
|
-
if (!g) return
|
|
1362
|
+
let P = U(() => {
|
|
1363
|
+
if (!x) return [];
|
|
1364
|
+
if (!g) return x;
|
|
1376
1365
|
let e = g.toLowerCase();
|
|
1377
|
-
return
|
|
1378
|
-
}, [
|
|
1379
|
-
if (
|
|
1366
|
+
return x.filter((t) => t.target_tenant?.toLowerCase().includes(e) || t.action?.toLowerCase().includes(e));
|
|
1367
|
+
}, [x, g]);
|
|
1368
|
+
if (S) return /*#__PURE__*/ z(f, {
|
|
1380
1369
|
distribution: "center",
|
|
1381
1370
|
alignment: "center",
|
|
1382
1371
|
className: "py-8",
|
|
1383
|
-
children: /*#__PURE__*/ z(
|
|
1372
|
+
children: /*#__PURE__*/ z(r, { variant: "primary" })
|
|
1384
1373
|
});
|
|
1385
|
-
if (
|
|
1374
|
+
if (C) return /*#__PURE__*/ z(i, {
|
|
1386
1375
|
variant: "error",
|
|
1387
1376
|
className: "mb-4",
|
|
1388
1377
|
children: T.message
|
|
1389
1378
|
});
|
|
1390
|
-
let
|
|
1379
|
+
let F = x?.length || 0, I = P.length;
|
|
1391
1380
|
return /*#__PURE__*/ B(R, { children: [
|
|
1392
|
-
/*#__PURE__*/ B(
|
|
1381
|
+
/*#__PURE__*/ B(f, {
|
|
1393
1382
|
direction: "vertical",
|
|
1394
1383
|
gap: "4",
|
|
1395
1384
|
children: [
|
|
1396
|
-
/*#__PURE__*/ B(
|
|
1385
|
+
/*#__PURE__*/ B(f, {
|
|
1397
1386
|
distribution: "between",
|
|
1398
1387
|
alignment: "center",
|
|
1399
1388
|
gap: "2",
|
|
1400
1389
|
className: "pb-2",
|
|
1401
1390
|
children: [/*#__PURE__*/ z("span", {
|
|
1402
1391
|
className: "theme-color-text-light text-sm",
|
|
1403
|
-
children:
|
|
1392
|
+
children: F === I ? /*#__PURE__*/ z(q, {
|
|
1404
1393
|
id: "xx2KP5",
|
|
1405
|
-
values: { totalCount:
|
|
1406
|
-
}) : /*#__PURE__*/ z(
|
|
1394
|
+
values: { totalCount: F }
|
|
1395
|
+
}) : /*#__PURE__*/ z(q, {
|
|
1407
1396
|
id: "VcWhM0",
|
|
1408
1397
|
values: {
|
|
1409
|
-
filteredCount:
|
|
1410
|
-
totalCount:
|
|
1398
|
+
filteredCount: I,
|
|
1399
|
+
totalCount: F
|
|
1411
1400
|
}
|
|
1412
1401
|
})
|
|
1413
|
-
}),
|
|
1402
|
+
}), a && /*#__PURE__*/ z(m, {
|
|
1414
1403
|
variant: "primary",
|
|
1415
1404
|
icon: "addCircle",
|
|
1416
|
-
onClick:
|
|
1405
|
+
onClick: d,
|
|
1417
1406
|
className: "whitespace-nowrap",
|
|
1418
|
-
children: /*#__PURE__*/ z(
|
|
1407
|
+
children: /*#__PURE__*/ z(q, { id: "vmRPFm" })
|
|
1419
1408
|
})]
|
|
1420
1409
|
}),
|
|
1421
|
-
/*#__PURE__*/ z(
|
|
1410
|
+
/*#__PURE__*/ z(ee, { children: /*#__PURE__*/ z(f, {
|
|
1422
1411
|
distribution: "between",
|
|
1423
1412
|
alignment: "center",
|
|
1424
|
-
children: /*#__PURE__*/ z(
|
|
1413
|
+
children: /*#__PURE__*/ z(E, {
|
|
1425
1414
|
placeholder: s._({ id: "mlxk2U" }),
|
|
1426
1415
|
"data-testid": "searchbar",
|
|
1427
1416
|
value: v,
|
|
1428
1417
|
onInput: (e) => {
|
|
1429
1418
|
let t = e.currentTarget.value;
|
|
1430
|
-
y(t), clearTimeout(
|
|
1419
|
+
y(t), clearTimeout(b.current), b.current = window.setTimeout(() => _(t), 500);
|
|
1431
1420
|
},
|
|
1432
1421
|
onSearch: (e) => {
|
|
1433
|
-
clearTimeout(
|
|
1422
|
+
clearTimeout(b.current), _(typeof e == "string" ? e : "");
|
|
1434
1423
|
},
|
|
1435
1424
|
onClear: () => {
|
|
1436
|
-
clearTimeout(
|
|
1425
|
+
clearTimeout(b.current), y(""), _("");
|
|
1437
1426
|
}
|
|
1438
1427
|
})
|
|
1439
1428
|
}) }),
|
|
1440
|
-
|
|
1429
|
+
I === 0 ? g ? /*#__PURE__*/ z(q, { id: "qxxo7y" }) : /*#__PURE__*/ z(q, { id: "Dia2Ue" }) : /*#__PURE__*/ B(w, {
|
|
1441
1430
|
columns: 3,
|
|
1442
1431
|
children: [/*#__PURE__*/ B(n, { children: [
|
|
1443
|
-
/*#__PURE__*/ z(
|
|
1444
|
-
/*#__PURE__*/ z(
|
|
1445
|
-
/*#__PURE__*/ z(
|
|
1446
|
-
] }),
|
|
1432
|
+
/*#__PURE__*/ z(t, { children: /*#__PURE__*/ z(q, { id: "WzVwU0" }) }),
|
|
1433
|
+
/*#__PURE__*/ z(t, { children: /*#__PURE__*/ z(q, { id: "bwRvnp" }) }),
|
|
1434
|
+
/*#__PURE__*/ z(t, { children: /*#__PURE__*/ z(q, { id: "7L01XJ" }) })
|
|
1435
|
+
] }), P.map((e) => /*#__PURE__*/ z(Ce, {
|
|
1447
1436
|
policy: e,
|
|
1448
|
-
onDelete: () =>
|
|
1449
|
-
canDelete:
|
|
1437
|
+
onDelete: () => k(e),
|
|
1438
|
+
canDelete: a
|
|
1450
1439
|
}, e.id))]
|
|
1451
1440
|
})
|
|
1452
1441
|
]
|
|
1453
1442
|
}),
|
|
1454
|
-
!!p && /*#__PURE__*/ z(
|
|
1443
|
+
!!p && /*#__PURE__*/ z(Oe, {
|
|
1455
1444
|
policy: p,
|
|
1456
1445
|
open: !!p,
|
|
1457
|
-
onClose:
|
|
1458
|
-
onConfirm:
|
|
1446
|
+
onClose: M,
|
|
1447
|
+
onConfirm: j,
|
|
1459
1448
|
isLoading: D.isPending,
|
|
1460
1449
|
error: D.error?.message || null
|
|
1461
1450
|
}),
|
|
1462
|
-
|
|
1463
|
-
isOpen:
|
|
1464
|
-
onClose:
|
|
1451
|
+
u && /*#__PURE__*/ z(De, {
|
|
1452
|
+
isOpen: u,
|
|
1453
|
+
onClose: d,
|
|
1465
1454
|
securityGroupId: e
|
|
1466
1455
|
})
|
|
1467
1456
|
] });
|
|
1468
1457
|
}
|
|
1469
1458
|
//#endregion
|
|
1470
1459
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/SecurityGroupDetailsView.tsx
|
|
1471
|
-
function
|
|
1472
|
-
let [m, h] =
|
|
1473
|
-
return /*#__PURE__*/ z(
|
|
1460
|
+
function Ae({ securityGroup: e, filteredAndSortedRules: t, onEdit: n, onDeleteRule: r, isDeletingRule: i = !1, deleteRuleError: a = null, filterControls: o, onCreateRule: s, isCreatingRule: c = !1, createRuleError: l = null, availableSecurityGroups: u = [], currentProjectId: d, permissions: p }) {
|
|
1461
|
+
let [m, h] = G("rules"), g = e.project_id === d && p.canViewRBAC;
|
|
1462
|
+
return /*#__PURE__*/ z(y, {
|
|
1474
1463
|
px: !1,
|
|
1475
1464
|
py: !0,
|
|
1476
|
-
children: /*#__PURE__*/ B(
|
|
1465
|
+
children: /*#__PURE__*/ B(f, {
|
|
1477
1466
|
direction: "vertical",
|
|
1478
1467
|
gap: "4",
|
|
1479
1468
|
children: [
|
|
@@ -1481,19 +1470,19 @@ function ke({ securityGroup: e, filteredAndSortedRules: t, onEdit: n, onDeleteRu
|
|
|
1481
1470
|
name: e.name,
|
|
1482
1471
|
id: e.id
|
|
1483
1472
|
}),
|
|
1484
|
-
/*#__PURE__*/ z(
|
|
1473
|
+
/*#__PURE__*/ z(Q, {
|
|
1485
1474
|
securityGroup: e,
|
|
1486
1475
|
onEdit: n,
|
|
1487
1476
|
canUpdate: p.canUpdate
|
|
1488
1477
|
}),
|
|
1489
|
-
/*#__PURE__*/ z(
|
|
1478
|
+
/*#__PURE__*/ z($, {
|
|
1490
1479
|
activeTab: m,
|
|
1491
1480
|
onTabChange: h,
|
|
1492
1481
|
showRBACTab: g
|
|
1493
1482
|
}),
|
|
1494
1483
|
/*#__PURE__*/ B("div", {
|
|
1495
1484
|
className: "mt-6",
|
|
1496
|
-
children: [m === "rules" && /*#__PURE__*/ z(
|
|
1485
|
+
children: [m === "rules" && /*#__PURE__*/ z(Se, {
|
|
1497
1486
|
rules: t,
|
|
1498
1487
|
totalRulesCount: e.security_group_rules?.length,
|
|
1499
1488
|
onDeleteRule: r,
|
|
@@ -1512,7 +1501,7 @@ function ke({ securityGroup: e, filteredAndSortedRules: t, onEdit: n, onDeleteRu
|
|
|
1512
1501
|
availableSecurityGroups: u,
|
|
1513
1502
|
canCreateRule: p.canCreateRule,
|
|
1514
1503
|
canDeleteRule: p.canDeleteRule
|
|
1515
|
-
}), m === "rbac" && /*#__PURE__*/ z(
|
|
1504
|
+
}), m === "rbac" && /*#__PURE__*/ z(ke, {
|
|
1516
1505
|
securityGroupId: e.id,
|
|
1517
1506
|
canManageAccess: p.canManageAccess
|
|
1518
1507
|
})]
|
|
@@ -1523,16 +1512,16 @@ function ke({ securityGroup: e, filteredAndSortedRules: t, onEdit: n, onDeleteRu
|
|
|
1523
1512
|
}
|
|
1524
1513
|
//#endregion
|
|
1525
1514
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-hooks/useSecurityGroupDetails.ts
|
|
1526
|
-
function
|
|
1527
|
-
let [n, r] =
|
|
1515
|
+
function je({ securityGroupId: e, filterControls: t }) {
|
|
1516
|
+
let [n, r] = G(!1), i = A(), a = O.useUtils(), o = O.network.securityGroup.getById.useQuery({
|
|
1528
1517
|
project_id: i,
|
|
1529
1518
|
securityGroupId: e
|
|
1530
1519
|
}, { placeholderData: () => a.network.securityGroup.getById.getData({
|
|
1531
1520
|
project_id: i,
|
|
1532
1521
|
securityGroupId: e
|
|
1533
|
-
}) }), s =
|
|
1522
|
+
}) }), s = U(() => {
|
|
1534
1523
|
let e = o.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;
|
|
1535
|
-
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
|
|
1524
|
+
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) {
|
|
1536
1525
|
let n = t.searchTerm.toLowerCase();
|
|
1537
1526
|
e = e.filter((e) => e.description?.toLowerCase().includes(n) || e.protocol?.toLowerCase().includes(n) || e.ethertype?.toLowerCase().includes(n));
|
|
1538
1527
|
}
|
|
@@ -1544,17 +1533,17 @@ function Ae({ securityGroupId: e, filterControls: t }) {
|
|
|
1544
1533
|
});
|
|
1545
1534
|
}
|
|
1546
1535
|
return e;
|
|
1547
|
-
}, [o.data?.security_group_rules, t]), c =
|
|
1536
|
+
}, [o.data?.security_group_rules, t]), c = O.network.securityGroup.update.useMutation({ onSuccess: () => {
|
|
1548
1537
|
a.network.securityGroup.getById.invalidate({
|
|
1549
1538
|
project_id: i,
|
|
1550
1539
|
securityGroupId: e
|
|
1551
1540
|
}), a.network.securityGroup.list.invalidate(), r(!1);
|
|
1552
|
-
} }), l =
|
|
1541
|
+
} }), l = O.network.securityGroupRule.delete.useMutation({ onSuccess: () => {
|
|
1553
1542
|
a.network.securityGroup.getById.invalidate({
|
|
1554
1543
|
project_id: i,
|
|
1555
1544
|
securityGroupId: e
|
|
1556
1545
|
}), a.network.securityGroup.list.invalidate();
|
|
1557
|
-
} }), u =
|
|
1546
|
+
} }), u = O.network.securityGroupRule.create.useMutation({ onSuccess: () => {
|
|
1558
1547
|
a.network.securityGroup.getById.invalidate({
|
|
1559
1548
|
project_id: i,
|
|
1560
1549
|
securityGroupId: e
|
|
@@ -1601,42 +1590,71 @@ function Ae({ securityGroupId: e, filterControls: t }) {
|
|
|
1601
1590
|
};
|
|
1602
1591
|
}
|
|
1603
1592
|
//#endregion
|
|
1593
|
+
//#region src/client/utils/useListWithFiltering.ts
|
|
1594
|
+
function Me({ defaultSortKey: e, defaultSortDir: t, sortOptions: n, filterSettings: r }) {
|
|
1595
|
+
let [i, a] = G(""), o = (e) => {
|
|
1596
|
+
let t = typeof e == "string" ? e : "";
|
|
1597
|
+
V(() => a(t));
|
|
1598
|
+
}, [s, c] = G({
|
|
1599
|
+
options: n,
|
|
1600
|
+
sortBy: e,
|
|
1601
|
+
sortDirection: t
|
|
1602
|
+
}), l = (n) => {
|
|
1603
|
+
let r = {
|
|
1604
|
+
options: n.options ?? s.options,
|
|
1605
|
+
sortBy: n.sortBy?.toString() || e,
|
|
1606
|
+
sortDirection: n.sortDirection || t
|
|
1607
|
+
};
|
|
1608
|
+
c(r);
|
|
1609
|
+
}, [u, d] = G(r);
|
|
1610
|
+
return {
|
|
1611
|
+
searchTerm: i,
|
|
1612
|
+
sortSettings: s,
|
|
1613
|
+
filterSettings: u,
|
|
1614
|
+
handleSearchChange: o,
|
|
1615
|
+
handleSortChange: l,
|
|
1616
|
+
handleFilterChange: (e) => {
|
|
1617
|
+
V(() => d(e));
|
|
1618
|
+
}
|
|
1619
|
+
};
|
|
1620
|
+
}
|
|
1621
|
+
//#endregion
|
|
1604
1622
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/index.tsx?tsr-split=component
|
|
1605
|
-
function
|
|
1606
|
-
let { securityGroupId: e } =
|
|
1623
|
+
function Ne() {
|
|
1624
|
+
let { securityGroupId: e } = k.useParams(), { trpcClient: t } = k.useRouteContext(), n = A(), i = K(), { i18n: o, _: s } = J();
|
|
1607
1625
|
if (!t) throw Error("trpcClient is not available in route context");
|
|
1608
|
-
let { permissions: c, isLoading:
|
|
1626
|
+
let { permissions: c, isLoading: u, isError: d } = L(n), { searchTerm: p, sortSettings: h, filterSettings: g, handleSearchChange: _, handleSortChange: v, handleFilterChange: y } = Me({
|
|
1609
1627
|
defaultSortKey: "direction",
|
|
1610
1628
|
defaultSortDir: "asc",
|
|
1611
1629
|
sortOptions: [
|
|
1612
1630
|
{
|
|
1613
|
-
label:
|
|
1631
|
+
label: o._({ id: "MRB7nI" }),
|
|
1614
1632
|
value: "direction"
|
|
1615
1633
|
},
|
|
1616
1634
|
{
|
|
1617
|
-
label:
|
|
1635
|
+
label: o._({ id: "6+OdGi" }),
|
|
1618
1636
|
value: "protocol"
|
|
1619
1637
|
},
|
|
1620
1638
|
{
|
|
1621
|
-
label:
|
|
1639
|
+
label: o._({ id: "Nu4oKW" }),
|
|
1622
1640
|
value: "description"
|
|
1623
1641
|
}
|
|
1624
1642
|
],
|
|
1625
1643
|
filterSettings: { filters: [
|
|
1626
1644
|
{
|
|
1627
|
-
displayName:
|
|
1645
|
+
displayName: o._({ id: "MRB7nI" }),
|
|
1628
1646
|
filterName: "direction",
|
|
1629
1647
|
values: ["ingress", "egress"],
|
|
1630
1648
|
supportsMultiValue: !1
|
|
1631
1649
|
},
|
|
1632
1650
|
{
|
|
1633
|
-
displayName:
|
|
1651
|
+
displayName: o._({ id: "yp0UjB" }),
|
|
1634
1652
|
filterName: "ethertype",
|
|
1635
1653
|
values: ["IPv4", "IPv6"],
|
|
1636
1654
|
supportsMultiValue: !1
|
|
1637
1655
|
},
|
|
1638
1656
|
{
|
|
1639
|
-
displayName:
|
|
1657
|
+
displayName: o._({ id: "6+OdGi" }),
|
|
1640
1658
|
filterName: "protocol",
|
|
1641
1659
|
values: [
|
|
1642
1660
|
"tcp",
|
|
@@ -1647,37 +1665,37 @@ function je() {
|
|
|
1647
1665
|
supportsMultiValue: !1
|
|
1648
1666
|
}
|
|
1649
1667
|
] }
|
|
1650
|
-
}),
|
|
1651
|
-
searchTerm:
|
|
1652
|
-
onSearchChange:
|
|
1653
|
-
sortSettings:
|
|
1654
|
-
onSortChange:
|
|
1655
|
-
filterSettings:
|
|
1656
|
-
onFilterChange:
|
|
1657
|
-
}, { securityGroup:
|
|
1668
|
+
}), b = {
|
|
1669
|
+
searchTerm: p,
|
|
1670
|
+
onSearchChange: _,
|
|
1671
|
+
sortSettings: h,
|
|
1672
|
+
onSortChange: v,
|
|
1673
|
+
filterSettings: g,
|
|
1674
|
+
onFilterChange: y
|
|
1675
|
+
}, { securityGroup: x, filteredAndSortedRules: S, isLoading: w, isError: T, error: ee, isUpdating: E, updateError: D, isDeletingRule: j, deleteRuleError: M, isCreatingRule: N, createRuleError: P, editModalOpen: F, handleEdit: R, handleCloseEditModal: V, handleUpdate: H, handleDeleteRule: W, handleCreateRule: G } = je({
|
|
1658
1676
|
securityGroupId: e,
|
|
1659
|
-
filterControls:
|
|
1660
|
-
}), { data:
|
|
1677
|
+
filterControls: b
|
|
1678
|
+
}), { data: Y } = O.network.securityGroup.list.useQuery({ project_id: n }), X = U(() => (Y || []).filter((t) => t.id !== e).map((e) => ({
|
|
1661
1679
|
id: e.id,
|
|
1662
1680
|
name: e.name || e.id
|
|
1663
|
-
})), [
|
|
1664
|
-
|
|
1681
|
+
})), [Y, e]), Z = () => {
|
|
1682
|
+
i({
|
|
1665
1683
|
to: "/projects/$projectId/network/securitygroups",
|
|
1666
1684
|
params: { projectId: n }
|
|
1667
1685
|
});
|
|
1668
1686
|
};
|
|
1669
|
-
if (
|
|
1687
|
+
if (u) return /*#__PURE__*/ B(f, {
|
|
1670
1688
|
className: "fixed inset-0",
|
|
1671
1689
|
distribution: "center",
|
|
1672
1690
|
alignment: "center",
|
|
1673
1691
|
direction: "vertical",
|
|
1674
|
-
children: [/*#__PURE__*/ z(
|
|
1692
|
+
children: [/*#__PURE__*/ z(r, {
|
|
1675
1693
|
variant: "primary",
|
|
1676
1694
|
size: "large",
|
|
1677
1695
|
className: "mb-2"
|
|
1678
|
-
}), /*#__PURE__*/ z(
|
|
1696
|
+
}), /*#__PURE__*/ z(q, { id: "EpWoJ9" })]
|
|
1679
1697
|
});
|
|
1680
|
-
let
|
|
1698
|
+
let te = d ? {
|
|
1681
1699
|
canView: !1,
|
|
1682
1700
|
canCreate: !1,
|
|
1683
1701
|
canUpdate: !1,
|
|
@@ -1687,20 +1705,20 @@ function je() {
|
|
|
1687
1705
|
canManageAccess: !1,
|
|
1688
1706
|
canViewRBAC: !1
|
|
1689
1707
|
} : c;
|
|
1690
|
-
if (
|
|
1708
|
+
if (w) return /*#__PURE__*/ B(f, {
|
|
1691
1709
|
className: "fixed inset-0",
|
|
1692
1710
|
distribution: "center",
|
|
1693
1711
|
alignment: "center",
|
|
1694
1712
|
direction: "vertical",
|
|
1695
|
-
children: [/*#__PURE__*/ z(
|
|
1713
|
+
children: [/*#__PURE__*/ z(r, {
|
|
1696
1714
|
variant: "primary",
|
|
1697
1715
|
size: "large",
|
|
1698
1716
|
className: "mb-2"
|
|
1699
|
-
}), /*#__PURE__*/ z(
|
|
1717
|
+
}), /*#__PURE__*/ z(q, { id: "3x7Sws" })]
|
|
1700
1718
|
});
|
|
1701
|
-
if (
|
|
1702
|
-
let e =
|
|
1703
|
-
return /*#__PURE__*/ B(
|
|
1719
|
+
if (T) {
|
|
1720
|
+
let e = ee?.message || "Unknown error";
|
|
1721
|
+
return /*#__PURE__*/ B(f, {
|
|
1704
1722
|
className: "fixed inset-0",
|
|
1705
1723
|
distribution: "center",
|
|
1706
1724
|
alignment: "center",
|
|
@@ -1709,59 +1727,59 @@ function je() {
|
|
|
1709
1727
|
children: [
|
|
1710
1728
|
/*#__PURE__*/ z("p", {
|
|
1711
1729
|
className: "text-theme-error font-semibold",
|
|
1712
|
-
children: /*#__PURE__*/ z(
|
|
1730
|
+
children: /*#__PURE__*/ z(q, { id: "FjPnAE" })
|
|
1713
1731
|
}),
|
|
1714
1732
|
/*#__PURE__*/ z("p", {
|
|
1715
1733
|
className: "text-theme-highest",
|
|
1716
1734
|
children: e
|
|
1717
1735
|
}),
|
|
1718
|
-
/*#__PURE__*/ z(
|
|
1736
|
+
/*#__PURE__*/ z(m, {
|
|
1719
1737
|
onClick: Z,
|
|
1720
1738
|
variant: "primary",
|
|
1721
|
-
children: /*#__PURE__*/ z(
|
|
1739
|
+
children: /*#__PURE__*/ z(q, { id: "U9q4M7" })
|
|
1722
1740
|
})
|
|
1723
1741
|
]
|
|
1724
1742
|
});
|
|
1725
1743
|
}
|
|
1726
|
-
return
|
|
1744
|
+
return x ? /*#__PURE__*/ B(f, {
|
|
1727
1745
|
direction: "vertical",
|
|
1728
1746
|
children: [
|
|
1729
|
-
/*#__PURE__*/ z(
|
|
1730
|
-
/*#__PURE__*/ B(
|
|
1747
|
+
/*#__PURE__*/ z(C, { children: x.name || x.id }),
|
|
1748
|
+
/*#__PURE__*/ B(a, {
|
|
1731
1749
|
className: "my-6",
|
|
1732
|
-
children: [/*#__PURE__*/ z(
|
|
1750
|
+
children: [/*#__PURE__*/ z(l, {
|
|
1733
1751
|
onClick: Z,
|
|
1734
|
-
label:
|
|
1735
|
-
}), /*#__PURE__*/ z(
|
|
1752
|
+
label: o._({ id: "4opp4r" })
|
|
1753
|
+
}), /*#__PURE__*/ z(l, {
|
|
1736
1754
|
active: !0,
|
|
1737
|
-
label:
|
|
1755
|
+
label: x.id
|
|
1738
1756
|
})]
|
|
1739
1757
|
}),
|
|
1740
|
-
/*#__PURE__*/ z(
|
|
1741
|
-
securityGroup:
|
|
1742
|
-
filteredAndSortedRules:
|
|
1743
|
-
onEdit:
|
|
1744
|
-
onDeleteRule:
|
|
1745
|
-
isDeletingRule:
|
|
1746
|
-
deleteRuleError:
|
|
1747
|
-
filterControls:
|
|
1748
|
-
onCreateRule:
|
|
1749
|
-
isCreatingRule:
|
|
1750
|
-
createRuleError:
|
|
1751
|
-
availableSecurityGroups:
|
|
1758
|
+
/*#__PURE__*/ z(Ae, {
|
|
1759
|
+
securityGroup: x,
|
|
1760
|
+
filteredAndSortedRules: S,
|
|
1761
|
+
onEdit: R,
|
|
1762
|
+
onDeleteRule: W,
|
|
1763
|
+
isDeletingRule: j,
|
|
1764
|
+
deleteRuleError: M,
|
|
1765
|
+
filterControls: b,
|
|
1766
|
+
onCreateRule: G,
|
|
1767
|
+
isCreatingRule: N,
|
|
1768
|
+
createRuleError: P,
|
|
1769
|
+
availableSecurityGroups: X,
|
|
1752
1770
|
currentProjectId: n,
|
|
1753
|
-
permissions:
|
|
1771
|
+
permissions: te
|
|
1754
1772
|
}),
|
|
1755
|
-
/*#__PURE__*/ z(
|
|
1756
|
-
securityGroup:
|
|
1757
|
-
open:
|
|
1758
|
-
onClose:
|
|
1759
|
-
onUpdate:
|
|
1760
|
-
isLoading:
|
|
1773
|
+
/*#__PURE__*/ z(I, {
|
|
1774
|
+
securityGroup: x,
|
|
1775
|
+
open: F,
|
|
1776
|
+
onClose: V,
|
|
1777
|
+
onUpdate: H,
|
|
1778
|
+
isLoading: E,
|
|
1761
1779
|
error: D
|
|
1762
1780
|
})
|
|
1763
1781
|
]
|
|
1764
|
-
}) : /*#__PURE__*/ B(
|
|
1782
|
+
}) : /*#__PURE__*/ B(f, {
|
|
1765
1783
|
className: "fixed inset-0",
|
|
1766
1784
|
distribution: "center",
|
|
1767
1785
|
alignment: "center",
|
|
@@ -1769,15 +1787,15 @@ function je() {
|
|
|
1769
1787
|
gap: "5",
|
|
1770
1788
|
children: [/*#__PURE__*/ z("p", {
|
|
1771
1789
|
className: "text-theme-secondary",
|
|
1772
|
-
children: /*#__PURE__*/ z(
|
|
1773
|
-
}), /*#__PURE__*/ z(
|
|
1790
|
+
children: /*#__PURE__*/ z(q, { id: "Zw8Q49" })
|
|
1791
|
+
}), /*#__PURE__*/ z(m, {
|
|
1774
1792
|
onClick: Z,
|
|
1775
1793
|
variant: "primary",
|
|
1776
|
-
children: /*#__PURE__*/ z(
|
|
1794
|
+
children: /*#__PURE__*/ z(q, { id: "U9q4M7" })
|
|
1777
1795
|
})]
|
|
1778
1796
|
});
|
|
1779
1797
|
}
|
|
1780
1798
|
//#endregion
|
|
1781
|
-
export {
|
|
1799
|
+
export { Ne as component };
|
|
1782
1800
|
|
|
1783
|
-
//# sourceMappingURL=_securityGroupId-
|
|
1801
|
+
//# sourceMappingURL=_securityGroupId-DZ4D4WwB.mjs.map
|