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