@cobaltcore-dev/aurora 1.0.0 → 1.1.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 +2 -1
- package/dist/client/AuroraApp.d.ts +25 -0
- package/dist/client/{AuthProvider-5TyZKZkx.mjs → AuthProvider-BS5OVv8n.mjs} +2 -2
- package/dist/client/AuthProvider-BS5OVv8n.mjs.map +1 -0
- package/dist/client/{ContentHeader-D64NtKvo.mjs → ContentHeader-BHMUzd9H.mjs} +16 -16
- package/dist/client/{ContentHeader-D64NtKvo.mjs.map → ContentHeader-BHMUzd9H.mjs.map} +1 -1
- package/dist/client/{DeleteFlavorModal-C2K43ABZ.mjs → DeleteFlavorModal-BP83t9zX.mjs} +283 -294
- package/dist/client/DeleteFlavorModal-BP83t9zX.mjs.map +1 -0
- package/dist/client/{FiltersInput-Bw8TFfwb.mjs → FiltersInput-B8CNBg1L.mjs} +23 -23
- package/dist/client/{FiltersInput-Bw8TFfwb.mjs.map → FiltersInput-B8CNBg1L.mjs.map} +1 -1
- package/dist/client/{FloatingIpActionModals-BfEDfYg9.mjs → FloatingIpActionModals-BraiJWBi.mjs} +48 -48
- package/dist/client/{FloatingIpActionModals-BfEDfYg9.mjs.map → FloatingIpActionModals-BraiJWBi.mjs.map} +1 -1
- package/dist/client/ImageToastNotifications-BXMHJaIH.mjs +1131 -0
- package/dist/client/ImageToastNotifications-BXMHJaIH.mjs.map +1 -0
- package/dist/client/{RouteError-B-NPGIv7.mjs → RouteError-hAF8_jbe.mjs} +2 -2
- package/dist/client/{RouteError-B-NPGIv7.mjs.map → RouteError-hAF8_jbe.mjs.map} +1 -1
- package/dist/client/{SortInput-DysAXpB3.mjs → SortInput-Cqs2poV3.mjs} +7 -7
- package/dist/client/{SortInput-DysAXpB3.mjs.map → SortInput-Cqs2poV3.mjs.map} +1 -1
- package/dist/client/{StatusError-DX-GvLjq.mjs → StatusError-C5KodQOq.mjs} +4 -4
- package/dist/client/{StatusError-DX-GvLjq.mjs.map → StatusError-C5KodQOq.mjs.map} +1 -1
- package/dist/client/{TwoColumnDescriptionList-B3xunXmz.mjs → TwoColumnDescriptionList-DiDx3PnH.mjs} +6 -6
- package/dist/client/{TwoColumnDescriptionList-B3xunXmz.mjs.map → TwoColumnDescriptionList-DiDx3PnH.mjs.map} +1 -1
- package/dist/client/{_auth-R5H2yKFf.mjs → _auth-DJ9wHZaj.mjs} +2 -2
- package/dist/client/{_auth-R5H2yKFf.mjs.map → _auth-DJ9wHZaj.mjs.map} +1 -1
- package/dist/client/{_flavorId-Zj7LNL-R.mjs → _flavorId-BN_qessZ.mjs} +2 -2
- package/dist/client/{_flavorId-Zj7LNL-R.mjs.map → _flavorId-BN_qessZ.mjs.map} +1 -1
- package/dist/client/{_flavorId-Dit5mM8I.mjs → _flavorId-CJjEB_Ao.mjs} +34 -34
- package/dist/client/{_flavorId-Dit5mM8I.mjs.map → _flavorId-CJjEB_Ao.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-DCQQpNO-.mjs → _floatingIpId-CwDGHkWm.mjs} +2 -2
- package/dist/client/{_floatingIpId-DCQQpNO-.mjs.map → _floatingIpId-CwDGHkWm.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-B0MCoqE3.mjs → _floatingIpId-foMIwbE4.mjs} +23 -23
- package/dist/client/{_floatingIpId-B0MCoqE3.mjs.map → _floatingIpId-foMIwbE4.mjs.map} +1 -1
- package/dist/client/_imageId-BtJ7GmYB.mjs +558 -0
- package/dist/client/{_imageId-CZYzBAVx.mjs.map → _imageId-BtJ7GmYB.mjs.map} +1 -1
- package/dist/client/{_projectId-DhSWowQo.mjs → _projectId-BmtCuzJu.mjs} +4 -4
- package/dist/client/{_projectId-DhSWowQo.mjs.map → _projectId-BmtCuzJu.mjs.map} +1 -1
- package/dist/client/_projectId-Byt3GQDW.mjs +99 -0
- package/dist/client/_projectId-Byt3GQDW.mjs.map +1 -0
- package/dist/client/_projectId-NYk1IN_a.mjs +291 -0
- package/dist/client/_projectId-NYk1IN_a.mjs.map +1 -0
- package/dist/client/{_projectId-D2pFfYIs.mjs → _projectId-QueiFczy.mjs} +3 -3
- package/dist/client/{_projectId-D2pFfYIs.mjs.map → _projectId-QueiFczy.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-Mj8NJT2-.mjs → _securityGroupId-BcbkRhsN.mjs} +2 -2
- package/dist/client/{_securityGroupId-Mj8NJT2-.mjs.map → _securityGroupId-BcbkRhsN.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-DZ4D4WwB.mjs → _securityGroupId-pPtJsCoe.mjs} +438 -442
- package/dist/client/{_securityGroupId-DZ4D4WwB.mjs.map → _securityGroupId-pPtJsCoe.mjs.map} +1 -1
- package/dist/client/_storageType-BmqrU06i.mjs +2202 -0
- package/dist/client/_storageType-BmqrU06i.mjs.map +1 -0
- package/dist/client/{about-WLyShNgE.mjs → about-_73VmpTB.mjs} +2 -2
- package/dist/client/{about-WLyShNgE.mjs.map → about-_73VmpTB.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-EbwGRLLf.mjs} +2 -2
- package/dist/client/{aurora-IMO9HhqJ.mjs.map → aurora-EbwGRLLf.mjs.map} +1 -1
- package/dist/client/{build-DnD-T35u.mjs → build-C_4vRMCq.mjs} +2233 -2662
- package/dist/client/{build-DnD-T35u.mjs.map → build-C_4vRMCq.mjs.map} +1 -1
- package/dist/client/{flavors-Cp0LEGOH.mjs → flavors-CiHCYrtZ.mjs} +2 -2
- package/dist/client/{flavors-Cp0LEGOH.mjs.map → flavors-CiHCYrtZ.mjs.map} +1 -1
- package/dist/client/{flavors-CwMbDRHm2.mjs → flavors-DY-bDc8l.mjs} +164 -164
- package/dist/client/flavors-DY-bDc8l.mjs.map +1 -0
- package/dist/client/{floatingips-ICwo-rV_.mjs → floatingips-Ci4jHkaG.mjs} +177 -177
- package/dist/client/{floatingips-ICwo-rV_.mjs.map → floatingips-Ci4jHkaG.mjs.map} +1 -1
- package/dist/client/{hooks-CrriowRk.mjs → hooks-LutR2Yg3.mjs} +2 -2
- package/dist/client/{hooks-CrriowRk.mjs.map → hooks-LutR2Yg3.mjs.map} +1 -1
- package/dist/client/images-91U7tr9Y2.mjs +1976 -0
- package/dist/client/images-91U7tr9Y2.mjs.map +1 -0
- package/dist/client/{images-DWiM_72I.mjs → images-CS4kZQyu.mjs} +2 -2
- package/dist/client/{images-DWiM_72I.mjs.map → images-CS4kZQyu.mjs.map} +1 -1
- package/dist/client/index.d.ts +4 -1
- package/dist/client/index.js +444 -586
- 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-DeK2WD5K.mjs → objects-C3azvW8m.mjs} +2019 -2023
- package/dist/client/{objects-DeK2WD5K.mjs.map → objects-C3azvW8m.mjs.map} +1 -1
- package/dist/client/{objects-DI1-tnKr.mjs → objects-CM265S6b.mjs} +2 -2
- package/dist/client/{objects-DI1-tnKr.mjs.map → objects-CM265S6b.mjs.map} +1 -1
- package/dist/client/{objects-D2MKUCxc.mjs → objects-EE9Cd1wI.mjs} +2 -2
- package/dist/client/{objects-D2MKUCxc.mjs.map → objects-EE9Cd1wI.mjs.map} +1 -1
- package/dist/client/{routeInfo-CdTRlSxv.mjs → routeInfo-DXqB2HCf.mjs} +3 -3
- package/dist/client/routeInfo-DXqB2HCf.mjs.map +1 -0
- package/dist/client/router.d.ts +2 -1
- package/dist/client/{routes-DOJr5onJ.mjs → routes-CBd8CCuM.mjs} +13 -13
- package/dist/client/{routes-DOJr5onJ.mjs.map → routes-CBd8CCuM.mjs.map} +1 -1
- package/dist/client/{routes-B05u5bk4.mjs → routes-CdDm-hhO.mjs} +2 -2
- package/dist/client/{routes-B05u5bk4.mjs.map → routes-CdDm-hhO.mjs.map} +1 -1
- package/dist/client/{securitygroups-Be2Qgmew.mjs → securitygroups-Bd_uV4S9.mjs} +198 -198
- package/dist/client/{securitygroups-Be2Qgmew.mjs.map → securitygroups-Bd_uV4S9.mjs.map} +1 -1
- package/dist/client/{securitygroups-_7SYN2jN.mjs → securitygroups-Byte-iSp.mjs} +2 -2
- package/dist/client/{securitygroups-_7SYN2jN.mjs.map → securitygroups-Byte-iSp.mjs.map} +1 -1
- 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 +18 -367
- package/dist/client/{useSecurityGroupPermissions-qPwm4mFt.mjs → useSecurityGroupPermissions-C29mzb3b.mjs} +15 -15
- package/dist/client/{useSecurityGroupPermissions-qPwm4mFt.mjs.map → useSecurityGroupPermissions-C29mzb3b.mjs.map} +1 -1
- package/dist/server/index.d.ts +43 -369
- package/dist/server/index.js +71 -276
- package/package.json +1 -3
- package/dist/client/AuthProvider-5TyZKZkx.mjs.map +0 -1
- 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/ImageToastNotifications-C0Tluzq-.mjs +0 -1125
- package/dist/client/ImageToastNotifications-C0Tluzq-.mjs.map +0 -1
- package/dist/client/_imageId-CZYzBAVx.mjs +0 -558
- 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/_storageType-C-9bNkmZ.mjs +0 -2211
- package/dist/client/_storageType-C-9bNkmZ.mjs.map +0 -1
- package/dist/client/flavors-CwMbDRHm2.mjs.map +0 -1
- package/dist/client/images-DOGZmr3D.mjs +0 -1937
- package/dist/client/images-DOGZmr3D.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.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import "./hooks-
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as
|
|
1
|
+
import { A as e, C as t, F as n, I as r, J as i, L as a, N as o, O as s, Q as c, S as l, T as u, W as d, X as f, a as p, g as m, h, j as g, l as _, m as v, nt as y, o as b, p as x, q as S, st as C, t as w, tt as T, ut as E, v as D, x as O } from "./build-C_4vRMCq.mjs";
|
|
2
|
+
import { a as k } from "./trpcClient-D7gpR7YG.mjs";
|
|
3
|
+
import { t as A } from "./_securityGroupId-BcbkRhsN.mjs";
|
|
4
|
+
import { t as j } from "./useProjectId-DBc5lpoU.mjs";
|
|
5
|
+
import { t as M } from "./SortInput-Cqs2poV3.mjs";
|
|
6
|
+
import "./hooks-LutR2Yg3.mjs";
|
|
7
|
+
import { t as N } from "./TwoColumnDescriptionList-DiDx3PnH.mjs";
|
|
8
|
+
import { t as P } from "./useModal-DCs1OJh7.mjs";
|
|
9
|
+
import { n as F, t as I } from "./FiltersInput-B8CNBg1L.mjs";
|
|
10
|
+
import { n as L, t as ee } from "./useSecurityGroupPermissions-C29mzb3b.mjs";
|
|
11
11
|
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
12
12
|
import { startTransition as V, useEffect as H, useMemo as U, useRef as W, useState as G } from "react";
|
|
13
13
|
import { useNavigate as K } from "@tanstack/react-router";
|
|
@@ -18,7 +18,7 @@ import { useForm as X, useStore as Z } from "@tanstack/react-form";
|
|
|
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(y, { children: `'${e || t}' Details` }), /*#__PURE__*/ z("p", {
|
|
22
22
|
className: "text-theme-secondary mt-2 text-sm",
|
|
23
23
|
children: /*#__PURE__*/ z(q, { id: "kIuDMT" })
|
|
24
24
|
})]
|
|
@@ -59,13 +59,13 @@ function Q({ securityGroup: e, onEdit: t, canUpdate: n }) {
|
|
|
59
59
|
];
|
|
60
60
|
return /*#__PURE__*/ B(R, { children: [/*#__PURE__*/ z("div", {
|
|
61
61
|
className: "mb-4 flex flex-row-reverse",
|
|
62
|
-
children: t && n && /*#__PURE__*/ z(
|
|
62
|
+
children: t && n && /*#__PURE__*/ z(p, {
|
|
63
63
|
variant: "primary",
|
|
64
64
|
onClick: t,
|
|
65
65
|
disabled: !n,
|
|
66
66
|
children: /*#__PURE__*/ z(q, { id: "ePK91l" })
|
|
67
67
|
})
|
|
68
|
-
}), /*#__PURE__*/ z(
|
|
68
|
+
}), /*#__PURE__*/ z(N, { items: a })] });
|
|
69
69
|
}
|
|
70
70
|
//#endregion
|
|
71
71
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/SecurityGroupTabs.tsx
|
|
@@ -90,38 +90,38 @@ function $({ activeTab: e, onTabChange: t, showRBACTab: n = !0 }) {
|
|
|
90
90
|
}
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/DeleteRuleDialog.tsx
|
|
93
|
-
function ne({ rule: e, open: t, onClose:
|
|
94
|
-
let { i18n: l, _: u } = J(), [
|
|
95
|
-
e &&
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
}, _ =
|
|
99
|
-
return e ? /*#__PURE__*/ z(
|
|
93
|
+
function ne({ rule: e, open: t, onClose: r, onConfirm: a, isLoading: s, error: c }) {
|
|
94
|
+
let { i18n: l, _: u } = J(), [d, f] = G(""), m = () => {
|
|
95
|
+
e && d === "delete" && a(e.id);
|
|
96
|
+
}, h = () => {
|
|
97
|
+
f(""), r();
|
|
98
|
+
}, _ = d !== "delete" || s;
|
|
99
|
+
return e ? /*#__PURE__*/ z(i, {
|
|
100
100
|
open: t,
|
|
101
|
-
onCancel:
|
|
101
|
+
onCancel: h,
|
|
102
102
|
size: "small",
|
|
103
103
|
title: l._({ id: "TM93nK" }),
|
|
104
|
-
modalFooter: /*#__PURE__*/ z(
|
|
104
|
+
modalFooter: /*#__PURE__*/ z(o, {
|
|
105
105
|
className: "flex justify-end",
|
|
106
|
-
children: /*#__PURE__*/ B(
|
|
106
|
+
children: /*#__PURE__*/ B(g, { children: [/*#__PURE__*/ z(p, {
|
|
107
107
|
variant: "default",
|
|
108
|
-
onClick:
|
|
109
|
-
disabled:
|
|
108
|
+
onClick: h,
|
|
109
|
+
disabled: s,
|
|
110
110
|
children: /*#__PURE__*/ z(q, { id: "dEgA5A" })
|
|
111
|
-
}), /*#__PURE__*/ z(
|
|
111
|
+
}), /*#__PURE__*/ z(p, {
|
|
112
112
|
variant: "primary-danger",
|
|
113
|
-
onClick:
|
|
113
|
+
onClick: m,
|
|
114
114
|
disabled: _,
|
|
115
115
|
"data-testid": "confirm-delete-rule-button",
|
|
116
|
-
children:
|
|
116
|
+
children: s ? /*#__PURE__*/ z(q, { id: "EF2EU9" }) : /*#__PURE__*/ z(q, { id: "lN3xvy" })
|
|
117
117
|
})] })
|
|
118
118
|
}),
|
|
119
119
|
children: /*#__PURE__*/ B("div", { children: [
|
|
120
|
-
|
|
120
|
+
c && /*#__PURE__*/ z(n, {
|
|
121
121
|
dismissible: !1,
|
|
122
122
|
variant: "error",
|
|
123
123
|
className: "mt-4",
|
|
124
|
-
children:
|
|
124
|
+
children: c
|
|
125
125
|
}),
|
|
126
126
|
/*#__PURE__*/ z(q, { id: "CMVP7y" }),
|
|
127
127
|
/*#__PURE__*/ B("div", {
|
|
@@ -180,11 +180,11 @@ function ne({ rule: e, open: t, onClose: n, onConfirm: r, isLoading: a, error: o
|
|
|
180
180
|
components: { 0: /*#__PURE__*/ z("strong", {}) }
|
|
181
181
|
})
|
|
182
182
|
}), /*#__PURE__*/ z(v, {
|
|
183
|
-
value:
|
|
184
|
-
onChange: (e) =>
|
|
183
|
+
value: d,
|
|
184
|
+
onChange: (e) => f(e.target.value),
|
|
185
185
|
placeholder: l._({ id: "HNlEFZ" }),
|
|
186
186
|
autoComplete: "off",
|
|
187
|
-
disabled:
|
|
187
|
+
disabled: s,
|
|
188
188
|
"data-testid": "delete-rule-confirmation-input"
|
|
189
189
|
})]
|
|
190
190
|
})
|
|
@@ -278,47 +278,45 @@ var se = "0.0.0.0/0", ce = "::/0", le = "other-protocol", ue = Y.object({
|
|
|
278
278
|
code: Y.ZodIssueCode.custom,
|
|
279
279
|
message: "Protocol is required",
|
|
280
280
|
path: ["protocol"]
|
|
281
|
-
}), a) {
|
|
282
|
-
|
|
281
|
+
}), a) if (!e.portFrom) t.addIssue({
|
|
282
|
+
code: Y.ZodIssueCode.custom,
|
|
283
|
+
message: "Port (from) is required",
|
|
284
|
+
path: ["portFrom"]
|
|
285
|
+
});
|
|
286
|
+
else {
|
|
287
|
+
let n = parseInt(e.portFrom, 10);
|
|
288
|
+
if (isNaN(n)) t.addIssue({
|
|
283
289
|
code: Y.ZodIssueCode.custom,
|
|
284
|
-
message: "Port
|
|
290
|
+
message: "Port must be a valid number",
|
|
285
291
|
path: ["portFrom"]
|
|
286
292
|
});
|
|
287
|
-
else {
|
|
288
|
-
let
|
|
289
|
-
if (isNaN(
|
|
293
|
+
else if (e.portTo) {
|
|
294
|
+
let r = parseInt(e.portTo, 10);
|
|
295
|
+
if (isNaN(r)) t.addIssue({
|
|
290
296
|
code: Y.ZodIssueCode.custom,
|
|
291
297
|
message: "Port must be a valid number",
|
|
298
|
+
path: ["portTo"]
|
|
299
|
+
});
|
|
300
|
+
else if (n >= r) t.addIssue({
|
|
301
|
+
code: Y.ZodIssueCode.custom,
|
|
302
|
+
message: "\"Port (from)\" must be less than \"Port (to)\"",
|
|
292
303
|
path: ["portFrom"]
|
|
293
304
|
});
|
|
294
|
-
else
|
|
295
|
-
let
|
|
296
|
-
|
|
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({
|
|
305
|
+
else {
|
|
306
|
+
let i = ie(n, r, e.protocol);
|
|
307
|
+
i.valid || t.addIssue({
|
|
317
308
|
code: Y.ZodIssueCode.custom,
|
|
318
|
-
message:
|
|
309
|
+
message: i.error || "Invalid port range",
|
|
319
310
|
path: ["portFrom"]
|
|
320
311
|
});
|
|
321
312
|
}
|
|
313
|
+
} else {
|
|
314
|
+
let r = ie(n, n, e.protocol);
|
|
315
|
+
r.valid || t.addIssue({
|
|
316
|
+
code: Y.ZodIssueCode.custom,
|
|
317
|
+
message: r.error || "Invalid port",
|
|
318
|
+
path: ["portFrom"]
|
|
319
|
+
});
|
|
322
320
|
}
|
|
323
321
|
}
|
|
324
322
|
if (r) {
|
|
@@ -348,20 +346,18 @@ var se = "0.0.0.0/0", ce = "::/0", le = "other-protocol", ue = Y.object({
|
|
|
348
346
|
}));
|
|
349
347
|
}
|
|
350
348
|
}
|
|
351
|
-
if (e.remoteSourceType === "cidr" && e.remoteCidr) {
|
|
352
|
-
|
|
349
|
+
if (e.remoteSourceType === "cidr" && e.remoteCidr) if (!oe(e.remoteCidr)) t.addIssue({
|
|
350
|
+
code: Y.ZodIssueCode.custom,
|
|
351
|
+
message: "Invalid CIDR format. Examples: 0.0.0.0/0 (IPv4) or ::/0 (IPv6)",
|
|
352
|
+
path: ["remoteCidr"]
|
|
353
|
+
});
|
|
354
|
+
else {
|
|
355
|
+
let n = re(e.remoteCidr);
|
|
356
|
+
n && n !== e.ethertype && t.addIssue({
|
|
353
357
|
code: Y.ZodIssueCode.custom,
|
|
354
|
-
message:
|
|
358
|
+
message: `CIDR family (${n}) must match Ethertype (${e.ethertype})`,
|
|
355
359
|
path: ["remoteCidr"]
|
|
356
360
|
});
|
|
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
|
-
}
|
|
365
361
|
}
|
|
366
362
|
}), de = {
|
|
367
363
|
ruleType: "",
|
|
@@ -535,30 +531,30 @@ var se = "0.0.0.0/0", ce = "::/0", le = "other-protocol", ue = Y.object({
|
|
|
535
531
|
//#endregion
|
|
536
532
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/RuleTypeSection.tsx
|
|
537
533
|
function pe({ form: e, disabled: t = !1 }) {
|
|
538
|
-
let { i18n: n, _:
|
|
534
|
+
let { i18n: n, _: i } = J();
|
|
539
535
|
return /*#__PURE__*/ z(e.Field, {
|
|
540
536
|
name: "ruleType",
|
|
541
537
|
mode: "value",
|
|
542
|
-
children: (
|
|
538
|
+
children: (i) => /*#__PURE__*/ z(h, {
|
|
543
539
|
className: "mb-6",
|
|
544
|
-
children: /*#__PURE__*/ z(
|
|
540
|
+
children: /*#__PURE__*/ z(T, {
|
|
545
541
|
id: "ruleType",
|
|
546
542
|
label: n._({ id: "YuGQWb" }),
|
|
547
|
-
value:
|
|
543
|
+
value: i.state.value,
|
|
548
544
|
onChange: (t) => {
|
|
549
545
|
let n = String(t || "");
|
|
550
|
-
if (
|
|
546
|
+
if (i.handleChange(n), !n) {
|
|
551
547
|
e.setFieldValue("protocol", null), e.setFieldValue("portFrom", ""), e.setFieldValue("portTo", ""), e.setFieldValue("icmpType", ""), e.setFieldValue("icmpCode", "");
|
|
552
548
|
return;
|
|
553
549
|
}
|
|
554
|
-
let
|
|
555
|
-
|
|
550
|
+
let r = fe.find((e) => e.value === n);
|
|
551
|
+
r && (e.setFieldValue("protocol", r.protocol), (r.protocol === "tcp" || r.protocol === "udp") && r.portRangeMin !== null && r.portRangeMax !== null ? (e.setFieldValue("portFrom", String(r.portRangeMin)), e.setFieldValue("portTo", String(r.portRangeMax))) : (e.setFieldValue("portFrom", ""), e.setFieldValue("portTo", "")), r.protocol !== "icmp" && r.protocol !== "ipv6-icmp" && (e.setFieldValue("icmpType", ""), e.setFieldValue("icmpCode", "")));
|
|
556
552
|
},
|
|
557
553
|
disabled: t,
|
|
558
|
-
children: fe.map((e) => e.value === "" ? /*#__PURE__*/ z(
|
|
554
|
+
children: fe.map((e) => e.value === "" ? /*#__PURE__*/ z(r, {
|
|
559
555
|
value: e.value,
|
|
560
556
|
label: n._({ id: "eh/k36" })
|
|
561
|
-
}, e.value) : /*#__PURE__*/ z(
|
|
557
|
+
}, e.value) : /*#__PURE__*/ z(r, {
|
|
562
558
|
value: e.value,
|
|
563
559
|
label: e.label
|
|
564
560
|
}, e.value))
|
|
@@ -568,47 +564,47 @@ function pe({ form: e, disabled: t = !1 }) {
|
|
|
568
564
|
}
|
|
569
565
|
//#endregion
|
|
570
566
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/DirectionEthertypeSection.tsx
|
|
571
|
-
function me({ form:
|
|
572
|
-
let { i18n:
|
|
573
|
-
return /*#__PURE__*/ z(
|
|
567
|
+
function me({ form: e, disabled: t = !1 }) {
|
|
568
|
+
let { i18n: n, _: r } = J();
|
|
569
|
+
return /*#__PURE__*/ z(e.Field, {
|
|
574
570
|
name: "direction",
|
|
575
|
-
children: (
|
|
571
|
+
children: (e) => /*#__PURE__*/ z(h, { children: /*#__PURE__*/ z(D, {
|
|
576
572
|
name: "direction",
|
|
577
|
-
label:
|
|
578
|
-
selected:
|
|
579
|
-
onChange: (
|
|
573
|
+
label: n._({ id: "MRB7nI" }),
|
|
574
|
+
selected: e.state.value,
|
|
575
|
+
onChange: (t) => e.handleChange(String(t)),
|
|
580
576
|
required: !0,
|
|
581
|
-
disabled:
|
|
577
|
+
disabled: t,
|
|
582
578
|
children: /*#__PURE__*/ B("div", {
|
|
583
579
|
className: "flex gap-4",
|
|
584
|
-
children: [/*#__PURE__*/ z(
|
|
580
|
+
children: [/*#__PURE__*/ z(c, {
|
|
585
581
|
value: "ingress",
|
|
586
|
-
label:
|
|
587
|
-
}), /*#__PURE__*/ z(
|
|
582
|
+
label: n._({ id: "fzfAAa" })
|
|
583
|
+
}), /*#__PURE__*/ z(c, {
|
|
588
584
|
value: "egress",
|
|
589
|
-
label:
|
|
585
|
+
label: n._({ id: "nETBrc" })
|
|
590
586
|
})]
|
|
591
587
|
})
|
|
592
588
|
}) })
|
|
593
589
|
});
|
|
594
590
|
}
|
|
595
|
-
function he({ form:
|
|
596
|
-
let { i18n:
|
|
597
|
-
return /*#__PURE__*/ z(
|
|
591
|
+
function he({ form: e, disabled: t = !1 }) {
|
|
592
|
+
let { i18n: n, _: r } = J();
|
|
593
|
+
return /*#__PURE__*/ z(e.Field, {
|
|
598
594
|
name: "ethertype",
|
|
599
|
-
children: (
|
|
595
|
+
children: (e) => /*#__PURE__*/ z(h, { children: /*#__PURE__*/ z(D, {
|
|
600
596
|
name: "ethertype",
|
|
601
|
-
label:
|
|
602
|
-
selected:
|
|
603
|
-
onChange: (
|
|
597
|
+
label: n._({ id: "16085O" }),
|
|
598
|
+
selected: e.state.value,
|
|
599
|
+
onChange: (t) => e.handleChange(String(t)),
|
|
604
600
|
required: !0,
|
|
605
|
-
disabled:
|
|
601
|
+
disabled: t,
|
|
606
602
|
children: /*#__PURE__*/ B("div", {
|
|
607
603
|
className: "flex gap-4",
|
|
608
|
-
children: [/*#__PURE__*/ z(
|
|
604
|
+
children: [/*#__PURE__*/ z(c, {
|
|
609
605
|
value: "IPv4",
|
|
610
606
|
label: "IPv4"
|
|
611
|
-
}), /*#__PURE__*/ z(
|
|
607
|
+
}), /*#__PURE__*/ z(c, {
|
|
612
608
|
value: "IPv6",
|
|
613
609
|
label: "IPv6"
|
|
614
610
|
})]
|
|
@@ -622,7 +618,7 @@ function ge({ form: e, disabled: t = !1 }) {
|
|
|
622
618
|
let { i18n: n, _: r } = J();
|
|
623
619
|
return /*#__PURE__*/ z(e.Field, {
|
|
624
620
|
name: "protocol",
|
|
625
|
-
children: (e) => /*#__PURE__*/ z(
|
|
621
|
+
children: (e) => /*#__PURE__*/ z(h, {
|
|
626
622
|
className: "mb-6",
|
|
627
623
|
children: /*#__PURE__*/ z(v, {
|
|
628
624
|
id: "protocol",
|
|
@@ -641,7 +637,7 @@ function ge({ form: e, disabled: t = !1 }) {
|
|
|
641
637
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/PortRangeSection.tsx
|
|
642
638
|
function _e({ form: e, disabled: t = !1 }) {
|
|
643
639
|
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(
|
|
640
|
+
return /*#__PURE__*/ B(h, {
|
|
645
641
|
className: "mb-6",
|
|
646
642
|
children: [
|
|
647
643
|
/*#__PURE__*/ B("div", {
|
|
@@ -705,7 +701,7 @@ function _e({ form: e, disabled: t = !1 }) {
|
|
|
705
701
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/IcmpSection.tsx
|
|
706
702
|
function ve({ form: e, disabled: t = !1 }) {
|
|
707
703
|
let { i18n: n, _: r } = J();
|
|
708
|
-
return /*#__PURE__*/ z(
|
|
704
|
+
return /*#__PURE__*/ z(h, {
|
|
709
705
|
className: "mb-6",
|
|
710
706
|
children: /*#__PURE__*/ B("div", {
|
|
711
707
|
className: "flex w-full gap-4",
|
|
@@ -745,29 +741,29 @@ function ve({ form: e, disabled: t = !1 }) {
|
|
|
745
741
|
}
|
|
746
742
|
//#endregion
|
|
747
743
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/sections/RemoteSourceSection.tsx
|
|
748
|
-
function ye({ form:
|
|
744
|
+
function ye({ form: e, disabled: t = !1, availableSecurityGroups: n }) {
|
|
749
745
|
let { i18n: i, _: a } = J();
|
|
750
746
|
return /*#__PURE__*/ B(R, { children: [
|
|
751
|
-
/*#__PURE__*/ z(
|
|
747
|
+
/*#__PURE__*/ z(e.Field, {
|
|
752
748
|
name: "remoteSourceType",
|
|
753
749
|
mode: "value",
|
|
754
|
-
children: (
|
|
750
|
+
children: (n) => /*#__PURE__*/ z(h, {
|
|
755
751
|
className: "mb-1",
|
|
756
752
|
children: /*#__PURE__*/ z(D, {
|
|
757
753
|
name: "remoteSourceType",
|
|
758
754
|
label: i._({ id: "I5kZVK" }),
|
|
759
|
-
selected:
|
|
760
|
-
onChange: (
|
|
761
|
-
let
|
|
762
|
-
|
|
755
|
+
selected: n.state.value,
|
|
756
|
+
onChange: (t) => {
|
|
757
|
+
let r = String(t);
|
|
758
|
+
n.handleChange(r), r !== "security_group" && e.setFieldValue("ethertype", "IPv4");
|
|
763
759
|
},
|
|
764
|
-
disabled:
|
|
760
|
+
disabled: t,
|
|
765
761
|
children: /*#__PURE__*/ B("div", {
|
|
766
762
|
className: "flex gap-4",
|
|
767
|
-
children: [/*#__PURE__*/ z(
|
|
763
|
+
children: [/*#__PURE__*/ z(c, {
|
|
768
764
|
value: "cidr",
|
|
769
765
|
label: i._({ id: "4uXhtt" })
|
|
770
|
-
}), /*#__PURE__*/ z(
|
|
766
|
+
}), /*#__PURE__*/ z(c, {
|
|
771
767
|
value: "security_group",
|
|
772
768
|
label: i._({ id: "bwhBhT" })
|
|
773
769
|
})]
|
|
@@ -775,45 +771,45 @@ function ye({ form: t, disabled: n = !1, availableSecurityGroups: r }) {
|
|
|
775
771
|
})
|
|
776
772
|
})
|
|
777
773
|
}),
|
|
778
|
-
/*#__PURE__*/ z(
|
|
774
|
+
/*#__PURE__*/ z(e.Field, {
|
|
779
775
|
name: "remoteSourceType",
|
|
780
|
-
children: (
|
|
776
|
+
children: (n) => n.state.value === "cidr" ? /*#__PURE__*/ z(e.Field, {
|
|
781
777
|
name: "remoteCidr",
|
|
782
|
-
children: (
|
|
778
|
+
children: (n) => /*#__PURE__*/ z(e.Field, {
|
|
783
779
|
name: "ethertype",
|
|
784
|
-
children: (
|
|
780
|
+
children: (e) => /*#__PURE__*/ z(h, {
|
|
785
781
|
className: "mb-6",
|
|
786
782
|
children: /*#__PURE__*/ z(v, {
|
|
787
783
|
id: "remoteCidr",
|
|
788
784
|
name: "remoteCidr",
|
|
789
785
|
label: i._({ id: "vmYyLY" }),
|
|
790
|
-
value:
|
|
791
|
-
onChange: (
|
|
792
|
-
errortext:
|
|
793
|
-
placeholder:
|
|
794
|
-
disabled:
|
|
786
|
+
value: n.state.value,
|
|
787
|
+
onChange: (e) => n.handleChange(e.target.value),
|
|
788
|
+
errortext: n.state.meta.errors[0]?.message,
|
|
789
|
+
placeholder: e.state.value === "IPv4" ? se : ce,
|
|
790
|
+
disabled: t
|
|
795
791
|
})
|
|
796
792
|
})
|
|
797
793
|
})
|
|
798
794
|
}) : null
|
|
799
795
|
}),
|
|
800
|
-
/*#__PURE__*/ z(
|
|
796
|
+
/*#__PURE__*/ z(e.Field, {
|
|
801
797
|
name: "remoteSourceType",
|
|
802
|
-
children: (
|
|
798
|
+
children: (a) => a.state.value === "security_group" ? /*#__PURE__*/ z(e.Field, {
|
|
803
799
|
name: "remoteSecurityGroupId",
|
|
804
|
-
children: (e) => /*#__PURE__*/ z(
|
|
800
|
+
children: (e) => /*#__PURE__*/ z(h, {
|
|
805
801
|
className: "mb-6",
|
|
806
|
-
children: /*#__PURE__*/ B(
|
|
802
|
+
children: /*#__PURE__*/ B(T, {
|
|
807
803
|
id: "remoteSecurityGroupId",
|
|
808
804
|
label: i._({ id: "i9TIyi" }),
|
|
809
805
|
value: e.state.value,
|
|
810
806
|
onChange: (t) => e.handleChange(String(t)),
|
|
811
807
|
errortext: e.state.meta.errors[0]?.message,
|
|
812
|
-
disabled:
|
|
813
|
-
children: [/*#__PURE__*/ z(
|
|
808
|
+
disabled: t,
|
|
809
|
+
children: [/*#__PURE__*/ z(r, {
|
|
814
810
|
value: "",
|
|
815
811
|
label: i._({ id: "ZvIpwi" })
|
|
816
|
-
}),
|
|
812
|
+
}), n.map((e) => /*#__PURE__*/ z(r, {
|
|
817
813
|
value: e.id,
|
|
818
814
|
label: e.name || e.id
|
|
819
815
|
}, e.id))]
|
|
@@ -829,9 +825,9 @@ function be({ form: e, disabled: t = !1 }) {
|
|
|
829
825
|
let { i18n: n, _: r } = J();
|
|
830
826
|
return /*#__PURE__*/ z(e.Field, {
|
|
831
827
|
name: "description",
|
|
832
|
-
children: (e) => /*#__PURE__*/ z(
|
|
828
|
+
children: (e) => /*#__PURE__*/ z(h, {
|
|
833
829
|
className: "mb-0",
|
|
834
|
-
children: /*#__PURE__*/ z(
|
|
830
|
+
children: /*#__PURE__*/ z(C, {
|
|
835
831
|
id: "description",
|
|
836
832
|
name: "description",
|
|
837
833
|
label: n._({ id: "Nu4oKW" }),
|
|
@@ -846,12 +842,12 @@ function be({ form: e, disabled: t = !1 }) {
|
|
|
846
842
|
}
|
|
847
843
|
//#endregion
|
|
848
844
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/AddRuleModal/AddRuleModal.tsx
|
|
849
|
-
var xe = ({ securityGroupId: e, open: t, onClose:
|
|
850
|
-
let { i18n:
|
|
845
|
+
var xe = ({ securityGroupId: e, open: t, onClose: r, onCreate: a, isLoading: s = !1, error: c = null, availableSecurityGroups: l = [] }) => {
|
|
846
|
+
let { i18n: u, _: f } = J(), m = X({
|
|
851
847
|
defaultValues: de,
|
|
852
848
|
validators: { onSubmit: ue },
|
|
853
849
|
onSubmit: async ({ value: t }) => {
|
|
854
|
-
if (
|
|
850
|
+
if (s) return;
|
|
855
851
|
let n = {
|
|
856
852
|
security_group_id: e,
|
|
857
853
|
direction: t.direction,
|
|
@@ -866,91 +862,91 @@ var xe = ({ securityGroupId: e, open: t, onClose: n, onCreate: a, isLoading: o =
|
|
|
866
862
|
let e = parseInt(t.portFrom, 10);
|
|
867
863
|
n.port_range_min = e, n.port_range_max = t.portTo ? parseInt(t.portTo, 10) : e;
|
|
868
864
|
}
|
|
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),
|
|
865
|
+
(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), h();
|
|
870
866
|
}
|
|
871
|
-
}),
|
|
872
|
-
|
|
867
|
+
}), h = () => {
|
|
868
|
+
m.reset(), r();
|
|
873
869
|
};
|
|
874
|
-
return /*#__PURE__*/ B(
|
|
870
|
+
return /*#__PURE__*/ B(i, {
|
|
875
871
|
open: t,
|
|
876
|
-
onCancel:
|
|
872
|
+
onCancel: h,
|
|
877
873
|
size: "large",
|
|
878
|
-
title:
|
|
879
|
-
modalFooter: /*#__PURE__*/ z(
|
|
874
|
+
title: u._({ id: "b2BLBa" }),
|
|
875
|
+
modalFooter: /*#__PURE__*/ z(o, {
|
|
880
876
|
className: "flex justify-end",
|
|
881
|
-
children: /*#__PURE__*/ z(
|
|
877
|
+
children: /*#__PURE__*/ z(m.Subscribe, { children: (e) => {
|
|
882
878
|
let t = !!e.values.ruleType;
|
|
883
|
-
return /*#__PURE__*/ B(
|
|
879
|
+
return /*#__PURE__*/ B(g, { children: [/*#__PURE__*/ z(p, {
|
|
884
880
|
variant: "default",
|
|
885
|
-
onClick:
|
|
886
|
-
disabled:
|
|
881
|
+
onClick: h,
|
|
882
|
+
disabled: s || e.isSubmitting,
|
|
887
883
|
children: /*#__PURE__*/ z(q, { id: "dEgA5A" })
|
|
888
|
-
}), /*#__PURE__*/ z(
|
|
884
|
+
}), /*#__PURE__*/ z(p, {
|
|
889
885
|
variant: "primary",
|
|
890
886
|
type: "button",
|
|
891
|
-
onClick: () =>
|
|
892
|
-
disabled:
|
|
887
|
+
onClick: () => m.handleSubmit(),
|
|
888
|
+
disabled: s || e.isSubmitting || !t,
|
|
893
889
|
"data-testid": "add-rule-button",
|
|
894
|
-
children: e.isSubmitting ||
|
|
890
|
+
children: e.isSubmitting || s ? /*#__PURE__*/ z(d, { size: "small" }) : /*#__PURE__*/ z(q, { id: "bmQLn5" })
|
|
895
891
|
})] });
|
|
896
892
|
} })
|
|
897
893
|
}),
|
|
898
894
|
children: [
|
|
899
|
-
|
|
895
|
+
c && /*#__PURE__*/ z(n, {
|
|
900
896
|
dismissible: !1,
|
|
901
897
|
variant: "error",
|
|
902
898
|
className: "mb-4",
|
|
903
|
-
children:
|
|
899
|
+
children: c
|
|
904
900
|
}),
|
|
905
|
-
|
|
901
|
+
s && /*#__PURE__*/ B("div", {
|
|
906
902
|
className: "mb-4 flex items-center justify-center gap-2",
|
|
907
|
-
children: [/*#__PURE__*/ z(
|
|
903
|
+
children: [/*#__PURE__*/ z(d, { variant: "primary" }), /*#__PURE__*/ z("span", {
|
|
908
904
|
className: "text-theme-secondary text-sm",
|
|
909
905
|
children: /*#__PURE__*/ z(q, { id: "gU7JFm" })
|
|
910
906
|
})]
|
|
911
907
|
}),
|
|
912
|
-
/*#__PURE__*/ z(
|
|
908
|
+
/*#__PURE__*/ z(E, {
|
|
913
909
|
className: "mb-6",
|
|
914
910
|
onSubmit: (e) => {
|
|
915
|
-
e.preventDefault(),
|
|
911
|
+
e.preventDefault(), m.handleSubmit();
|
|
916
912
|
},
|
|
917
913
|
children: /*#__PURE__*/ B(x, {
|
|
918
914
|
className: "mb-6",
|
|
919
915
|
children: [/*#__PURE__*/ z(pe, {
|
|
920
|
-
form:
|
|
921
|
-
disabled:
|
|
922
|
-
}), /*#__PURE__*/ z(
|
|
916
|
+
form: m,
|
|
917
|
+
disabled: s
|
|
918
|
+
}), /*#__PURE__*/ z(m.Subscribe, { children: (e) => {
|
|
923
919
|
if (!e.values.ruleType) return null;
|
|
924
920
|
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";
|
|
925
921
|
return /*#__PURE__*/ B(R, { children: [
|
|
926
922
|
/*#__PURE__*/ z(me, {
|
|
927
|
-
form:
|
|
928
|
-
disabled:
|
|
923
|
+
form: m,
|
|
924
|
+
disabled: s
|
|
929
925
|
}),
|
|
930
926
|
e.values.ruleType === "other-protocol" && /*#__PURE__*/ z(ge, {
|
|
931
|
-
form:
|
|
932
|
-
disabled:
|
|
927
|
+
form: m,
|
|
928
|
+
disabled: s
|
|
933
929
|
}),
|
|
934
930
|
t && /*#__PURE__*/ z(_e, {
|
|
935
|
-
form:
|
|
936
|
-
disabled:
|
|
931
|
+
form: m,
|
|
932
|
+
disabled: s
|
|
937
933
|
}),
|
|
938
934
|
n && /*#__PURE__*/ z(ve, {
|
|
939
|
-
form:
|
|
940
|
-
disabled:
|
|
935
|
+
form: m,
|
|
936
|
+
disabled: s
|
|
941
937
|
}),
|
|
942
938
|
/*#__PURE__*/ z(ye, {
|
|
943
|
-
form:
|
|
944
|
-
disabled:
|
|
945
|
-
availableSecurityGroups:
|
|
939
|
+
form: m,
|
|
940
|
+
disabled: s,
|
|
941
|
+
availableSecurityGroups: l
|
|
946
942
|
}),
|
|
947
943
|
e.values.remoteSourceType === "security_group" && /*#__PURE__*/ z(he, {
|
|
948
|
-
form:
|
|
949
|
-
disabled:
|
|
944
|
+
form: m,
|
|
945
|
+
disabled: s
|
|
950
946
|
}),
|
|
951
947
|
/*#__PURE__*/ z(be, {
|
|
952
|
-
form:
|
|
953
|
-
disabled:
|
|
948
|
+
form: m,
|
|
949
|
+
disabled: s
|
|
954
950
|
})
|
|
955
951
|
] });
|
|
956
952
|
} })]
|
|
@@ -961,24 +957,24 @@ var xe = ({ securityGroupId: e, open: t, onClose: n, onCreate: a, isLoading: o =
|
|
|
961
957
|
};
|
|
962
958
|
//#endregion
|
|
963
959
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/SecurityGroupRulesTable.tsx
|
|
964
|
-
function Se({ rules: e, totalRulesCount:
|
|
965
|
-
let { i18n:
|
|
960
|
+
function Se({ rules: e, totalRulesCount: n, onDeleteRule: r, isDeletingRule: i, deleteError: a, searchTerm: o = "", onSearchChange: c, sortSettings: d, onSortChange: h, filterSettings: g, onFilterChange: v, securityGroupId: y, onCreateRule: x, isCreatingRule: S = !1, createRuleError: C = null, availableSecurityGroups: T = [], canCreateRule: E, canDeleteRule: D }) {
|
|
961
|
+
let { i18n: k, _: A } = J(), [j, N] = G(null), [L, ee] = P(), [V, U] = G(o), K = W(void 0);
|
|
966
962
|
H(() => () => clearTimeout(K.current), []);
|
|
967
963
|
let Y = (e) => {
|
|
968
|
-
|
|
964
|
+
N(e);
|
|
969
965
|
}, X = (e) => {
|
|
970
|
-
|
|
966
|
+
r(e);
|
|
971
967
|
}, Z = () => {
|
|
972
|
-
|
|
968
|
+
i || N(null);
|
|
973
969
|
};
|
|
974
970
|
H(() => {
|
|
975
|
-
!
|
|
976
|
-
}, [
|
|
971
|
+
!i && !a && N(null);
|
|
972
|
+
}, [i, a]);
|
|
977
973
|
let te = (e) => {
|
|
978
974
|
if (e.protocol === "icmp" || e.protocol === "ipv6-icmp") {
|
|
979
975
|
if (e.port_range_min !== null && e.port_range_max !== null) {
|
|
980
976
|
let t = e.port_range_min, n = e.port_range_max;
|
|
981
|
-
return
|
|
977
|
+
return k._({
|
|
982
978
|
id: "0p+s6m",
|
|
983
979
|
values: {
|
|
984
980
|
typeValue: t,
|
|
@@ -986,10 +982,10 @@ function Se({ rules: e, totalRulesCount: r, onDeleteRule: i, isDeletingRule: a,
|
|
|
986
982
|
}
|
|
987
983
|
});
|
|
988
984
|
}
|
|
989
|
-
return
|
|
985
|
+
return k._({ id: "eKC+EC" });
|
|
990
986
|
}
|
|
991
|
-
return e.port_range_min === null || e.port_range_max === null ?
|
|
992
|
-
}, Q = e.length, $ =
|
|
987
|
+
return e.port_range_min === null || e.port_range_max === null ? k._({ id: "eKC+EC" }) : e.port_range_min === e.port_range_max ? String(e.port_range_min) : `${e.port_range_min}-${e.port_range_max}`;
|
|
988
|
+
}, Q = e.length, $ = n;
|
|
993
989
|
return /*#__PURE__*/ B(R, { children: [
|
|
994
990
|
/*#__PURE__*/ B(f, {
|
|
995
991
|
direction: "vertical",
|
|
@@ -1014,49 +1010,49 @@ function Se({ rules: e, totalRulesCount: r, onDeleteRule: i, isDeletingRule: a,
|
|
|
1014
1010
|
})
|
|
1015
1011
|
}), /*#__PURE__*/ B(f, {
|
|
1016
1012
|
gap: "2",
|
|
1017
|
-
children: [
|
|
1018
|
-
options:
|
|
1019
|
-
sortBy:
|
|
1020
|
-
sortDirection:
|
|
1013
|
+
children: [d && h && /*#__PURE__*/ z(M, {
|
|
1014
|
+
options: d.options,
|
|
1015
|
+
sortBy: d.sortBy,
|
|
1016
|
+
sortDirection: d.sortDirection ?? "asc",
|
|
1021
1017
|
selectClassName: "min-w-40",
|
|
1022
|
-
onSortByChange: (e) =>
|
|
1023
|
-
...
|
|
1018
|
+
onSortByChange: (e) => h({
|
|
1019
|
+
...d,
|
|
1024
1020
|
sortBy: e,
|
|
1025
|
-
sortDirection:
|
|
1021
|
+
sortDirection: d.sortDirection
|
|
1026
1022
|
}),
|
|
1027
|
-
onSortDirectionChange: (e) =>
|
|
1028
|
-
...
|
|
1023
|
+
onSortDirectionChange: (e) => h({
|
|
1024
|
+
...d,
|
|
1029
1025
|
sortDirection: e
|
|
1030
1026
|
})
|
|
1031
|
-
}),
|
|
1027
|
+
}), E && x && /*#__PURE__*/ z(p, {
|
|
1032
1028
|
variant: "primary",
|
|
1033
1029
|
icon: "addCircle",
|
|
1034
|
-
onClick:
|
|
1030
|
+
onClick: ee,
|
|
1035
1031
|
className: "whitespace-nowrap",
|
|
1036
1032
|
children: /*#__PURE__*/ z(q, { id: "O8tK4v" })
|
|
1037
1033
|
})]
|
|
1038
1034
|
})]
|
|
1039
1035
|
}),
|
|
1040
|
-
(
|
|
1036
|
+
(g || c) && /*#__PURE__*/ z(_, { children: /*#__PURE__*/ B(f, {
|
|
1041
1037
|
direction: "vertical",
|
|
1042
1038
|
gap: "2",
|
|
1043
1039
|
children: [/*#__PURE__*/ B(f, {
|
|
1044
1040
|
distribution: "between",
|
|
1045
1041
|
alignment: "center",
|
|
1046
|
-
children: [
|
|
1047
|
-
filters:
|
|
1042
|
+
children: [g && v && /*#__PURE__*/ z(I, {
|
|
1043
|
+
filters: g.filters,
|
|
1048
1044
|
selectClassName: "sm:min-w-40",
|
|
1049
1045
|
comboboxClassName: "sm:min-w-40",
|
|
1050
1046
|
onChange: (e) => {
|
|
1051
|
-
if ((
|
|
1052
|
-
let t =
|
|
1053
|
-
|
|
1054
|
-
...
|
|
1047
|
+
if ((g.selectedFilters || []).some((t) => t.name === e.name && t.value === e.value)) return;
|
|
1048
|
+
let t = g.filters.find((t) => t.filterName === e.name)?.supportsMultiValue ? [...g.selectedFilters || [], e] : [...(g.selectedFilters || []).filter((t) => t.name !== e.name), e];
|
|
1049
|
+
v({
|
|
1050
|
+
...g,
|
|
1055
1051
|
selectedFilters: t
|
|
1056
1052
|
});
|
|
1057
1053
|
}
|
|
1058
|
-
}), c && /*#__PURE__*/ z(
|
|
1059
|
-
placeholder:
|
|
1054
|
+
}), c && /*#__PURE__*/ z(t, {
|
|
1055
|
+
placeholder: k._({ id: "HMV+cw" }),
|
|
1060
1056
|
"data-testid": "searchbar",
|
|
1061
1057
|
value: V,
|
|
1062
1058
|
onInput: (e) => {
|
|
@@ -1070,41 +1066,41 @@ function Se({ rules: e, totalRulesCount: r, onDeleteRule: i, isDeletingRule: a,
|
|
|
1070
1066
|
clearTimeout(K.current), U(""), c("");
|
|
1071
1067
|
}
|
|
1072
1068
|
})]
|
|
1073
|
-
}),
|
|
1074
|
-
selectedFilters:
|
|
1075
|
-
onDelete: (e) =>
|
|
1076
|
-
...
|
|
1077
|
-
selectedFilters: (
|
|
1069
|
+
}), g?.selectedFilters && g.selectedFilters.length > 0 && /*#__PURE__*/ z(F, {
|
|
1070
|
+
selectedFilters: g.selectedFilters,
|
|
1071
|
+
onDelete: (e) => v?.({
|
|
1072
|
+
...g,
|
|
1073
|
+
selectedFilters: (g.selectedFilters || []).filter((t) => t.name !== e.name || t.value !== e.value)
|
|
1078
1074
|
}),
|
|
1079
|
-
onClear: () =>
|
|
1080
|
-
...
|
|
1075
|
+
onClear: () => v?.({
|
|
1076
|
+
...g,
|
|
1081
1077
|
selectedFilters: []
|
|
1082
1078
|
})
|
|
1083
1079
|
})]
|
|
1084
1080
|
}) }),
|
|
1085
|
-
e.length === 0 ? /*#__PURE__*/ z(q, { id: "nnxwBn" }) : /*#__PURE__*/ B(
|
|
1081
|
+
e.length === 0 ? /*#__PURE__*/ z(q, { id: "nnxwBn" }) : /*#__PURE__*/ B(b, {
|
|
1086
1082
|
columns: D ? 6 : 5,
|
|
1087
1083
|
className: "security-group-rules-table",
|
|
1088
|
-
children: [/*#__PURE__*/ B(
|
|
1089
|
-
/*#__PURE__*/ z(
|
|
1090
|
-
/*#__PURE__*/ z(
|
|
1091
|
-
/*#__PURE__*/ z(
|
|
1092
|
-
/*#__PURE__*/ z(
|
|
1093
|
-
/*#__PURE__*/ z(
|
|
1094
|
-
D && /*#__PURE__*/ z(
|
|
1095
|
-
] }), e.map((e) => /*#__PURE__*/ B(
|
|
1084
|
+
children: [/*#__PURE__*/ B(u, { children: [
|
|
1085
|
+
/*#__PURE__*/ z(l, { children: k._({ id: "MRB7nI" }) }),
|
|
1086
|
+
/*#__PURE__*/ z(l, { children: k._({ id: "Nu4oKW" }) }),
|
|
1087
|
+
/*#__PURE__*/ z(l, { children: k._({ id: "yp0UjB" }) }),
|
|
1088
|
+
/*#__PURE__*/ z(l, { children: k._({ id: "6+OdGi" }) }),
|
|
1089
|
+
/*#__PURE__*/ z(l, { children: k._({ id: "6jAi8c" }) }),
|
|
1090
|
+
D && /*#__PURE__*/ z(l, { children: k._({ id: "7L01XJ" }) })
|
|
1091
|
+
] }), e.map((e) => /*#__PURE__*/ B(u, {
|
|
1096
1092
|
"data-testid": `rule-row-${e.id}`,
|
|
1097
1093
|
children: [
|
|
1098
|
-
/*#__PURE__*/ z(
|
|
1099
|
-
/*#__PURE__*/ z(
|
|
1100
|
-
/*#__PURE__*/ z(
|
|
1101
|
-
/*#__PURE__*/ z(
|
|
1102
|
-
/*#__PURE__*/ z(
|
|
1103
|
-
D && /*#__PURE__*/ z(
|
|
1094
|
+
/*#__PURE__*/ z(w, { children: e.direction || k._({ id: "h47p9L" }) }),
|
|
1095
|
+
/*#__PURE__*/ z(w, { children: e.description || k._({ id: "h47p9L" }) }),
|
|
1096
|
+
/*#__PURE__*/ z(w, { children: e.ethertype }),
|
|
1097
|
+
/*#__PURE__*/ z(w, { children: e.protocol || k._({ id: "eKC+EC" }) }),
|
|
1098
|
+
/*#__PURE__*/ z(w, { children: te(e) }),
|
|
1099
|
+
D && /*#__PURE__*/ z(w, {
|
|
1104
1100
|
onClick: (e) => e.stopPropagation(),
|
|
1105
1101
|
className: "items-end justify-end pr-0",
|
|
1106
|
-
children: /*#__PURE__*/ z(
|
|
1107
|
-
label:
|
|
1102
|
+
children: /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(m, { children: /*#__PURE__*/ z(O, {
|
|
1103
|
+
label: k._({ id: "cnGeoo" }),
|
|
1108
1104
|
onClick: () => Y(e)
|
|
1109
1105
|
}) }) })
|
|
1110
1106
|
})
|
|
@@ -1114,36 +1110,36 @@ function Se({ rules: e, totalRulesCount: r, onDeleteRule: i, isDeletingRule: a,
|
|
|
1114
1110
|
]
|
|
1115
1111
|
}),
|
|
1116
1112
|
D && /*#__PURE__*/ z(ne, {
|
|
1117
|
-
rule:
|
|
1118
|
-
open: !!
|
|
1113
|
+
rule: j,
|
|
1114
|
+
open: !!j,
|
|
1119
1115
|
onClose: Z,
|
|
1120
1116
|
onConfirm: X,
|
|
1121
|
-
isLoading:
|
|
1122
|
-
error:
|
|
1117
|
+
isLoading: i,
|
|
1118
|
+
error: a
|
|
1123
1119
|
}),
|
|
1124
|
-
|
|
1125
|
-
securityGroupId:
|
|
1126
|
-
open:
|
|
1127
|
-
onClose:
|
|
1128
|
-
onCreate:
|
|
1129
|
-
isLoading:
|
|
1130
|
-
error:
|
|
1131
|
-
availableSecurityGroups:
|
|
1120
|
+
E && y && x && L && /*#__PURE__*/ z(xe, {
|
|
1121
|
+
securityGroupId: y,
|
|
1122
|
+
open: L,
|
|
1123
|
+
onClose: ee,
|
|
1124
|
+
onCreate: x,
|
|
1125
|
+
isLoading: S,
|
|
1126
|
+
error: C,
|
|
1127
|
+
availableSecurityGroups: T
|
|
1132
1128
|
})
|
|
1133
1129
|
] });
|
|
1134
1130
|
}
|
|
1135
1131
|
//#endregion
|
|
1136
1132
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/RBACPolicyRow.tsx
|
|
1137
|
-
function Ce({ policy: e, onDelete: t, canDelete:
|
|
1138
|
-
let { i18n:
|
|
1139
|
-
return /*#__PURE__*/ B(
|
|
1140
|
-
/*#__PURE__*/ z(
|
|
1141
|
-
/*#__PURE__*/ z(
|
|
1142
|
-
/*#__PURE__*/ z(
|
|
1133
|
+
function Ce({ policy: e, onDelete: t, canDelete: n }) {
|
|
1134
|
+
let { i18n: r, _: i } = J();
|
|
1135
|
+
return /*#__PURE__*/ B(u, { children: [
|
|
1136
|
+
/*#__PURE__*/ z(w, { children: e.target_tenant }),
|
|
1137
|
+
/*#__PURE__*/ z(w, { children: e.action }),
|
|
1138
|
+
/*#__PURE__*/ z(w, {
|
|
1143
1139
|
onClick: (e) => e.stopPropagation(),
|
|
1144
1140
|
className: "items-end justify-end pr-0",
|
|
1145
|
-
children:
|
|
1146
|
-
label:
|
|
1141
|
+
children: n && /*#__PURE__*/ z(s, { children: /*#__PURE__*/ z(m, { children: /*#__PURE__*/ z(O, {
|
|
1142
|
+
label: r._({ id: "t/YqKh" }),
|
|
1147
1143
|
onClick: t
|
|
1148
1144
|
}) }) })
|
|
1149
1145
|
})
|
|
@@ -1155,53 +1151,53 @@ var we = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, Te =
|
|
|
1155
1151
|
function Ee(e) {
|
|
1156
1152
|
return we.test(e) || Te.test(e);
|
|
1157
1153
|
}
|
|
1158
|
-
function De({ isOpen: e, onClose: t, securityGroupId:
|
|
1159
|
-
let { i18n:
|
|
1160
|
-
|
|
1161
|
-
project_id:
|
|
1162
|
-
securityGroupId:
|
|
1163
|
-
}),
|
|
1164
|
-
project_id:
|
|
1165
|
-
securityGroupId:
|
|
1154
|
+
function De({ isOpen: e, onClose: t, securityGroupId: r }) {
|
|
1155
|
+
let { i18n: a, _: o } = J(), s = k.useUtils(), c = j(), [l, u] = G(!1), d = Y.object({ targetTenant: Y.string().min(1, a._({ id: "1RwosK" })).refine(Ee, { message: a._({ id: "CunRry" }) }) }), f = k.network.rbacPolicy.create.useMutation({ onSuccess: () => {
|
|
1156
|
+
s.network.rbacPolicy.list.invalidate({
|
|
1157
|
+
project_id: c,
|
|
1158
|
+
securityGroupId: r
|
|
1159
|
+
}), s.network.securityGroup.getById.invalidate({
|
|
1160
|
+
project_id: c,
|
|
1161
|
+
securityGroupId: r
|
|
1166
1162
|
}), m();
|
|
1167
1163
|
} }), p = X({
|
|
1168
1164
|
defaultValues: { targetTenant: "" },
|
|
1169
|
-
validators: { onSubmit:
|
|
1165
|
+
validators: { onSubmit: d },
|
|
1170
1166
|
onSubmit: async ({ value: e }) => {
|
|
1171
1167
|
f.isPending || f.mutate({
|
|
1172
|
-
project_id:
|
|
1173
|
-
securityGroupId:
|
|
1168
|
+
project_id: c,
|
|
1169
|
+
securityGroupId: r,
|
|
1174
1170
|
targetTenant: e.targetTenant.trim()
|
|
1175
1171
|
});
|
|
1176
1172
|
}
|
|
1177
1173
|
}), m = () => {
|
|
1178
|
-
p.reset(), f.reset(),
|
|
1174
|
+
p.reset(), f.reset(), u(!1), t();
|
|
1179
1175
|
}, h = async () => {
|
|
1180
|
-
|
|
1176
|
+
u(!0), await p.handleSubmit();
|
|
1181
1177
|
};
|
|
1182
|
-
return /*#__PURE__*/ B(
|
|
1178
|
+
return /*#__PURE__*/ B(i, {
|
|
1183
1179
|
open: e,
|
|
1184
1180
|
onCancel: m,
|
|
1185
|
-
title:
|
|
1181
|
+
title: a._({ id: "vmRPFm" }),
|
|
1186
1182
|
size: "large",
|
|
1187
1183
|
onConfirm: h,
|
|
1188
|
-
cancelButtonLabel:
|
|
1189
|
-
confirmButtonLabel:
|
|
1184
|
+
cancelButtonLabel: a._({ id: "dEgA5A" }),
|
|
1185
|
+
confirmButtonLabel: a._({ id: "Z8lGw6" }),
|
|
1190
1186
|
disableConfirmButton: f.isPending,
|
|
1191
1187
|
children: [
|
|
1192
|
-
f.error && /*#__PURE__*/ z(
|
|
1188
|
+
f.error && /*#__PURE__*/ z(n, {
|
|
1193
1189
|
variant: "error",
|
|
1194
1190
|
className: "mb-4",
|
|
1195
1191
|
children: (() => {
|
|
1196
1192
|
let e = f.error.message.toLowerCase();
|
|
1197
|
-
return e.includes("conflict") || e.includes("409") ?
|
|
1193
|
+
return e.includes("conflict") || e.includes("409") ? a._({ id: "rbuO5A" }) : e.includes("not found") || e.includes("404") ? a._({ id: "FwSyEp" }) : e.includes("forbidden") || e.includes("403") ? a._({ id: "kqJVBO" }) : f.error.message;
|
|
1198
1194
|
})()
|
|
1199
1195
|
}),
|
|
1200
1196
|
/*#__PURE__*/ z("p", {
|
|
1201
1197
|
className: "mb-4",
|
|
1202
1198
|
children: /*#__PURE__*/ z(q, { id: "cjEOmc" })
|
|
1203
1199
|
}),
|
|
1204
|
-
/*#__PURE__*/ z(
|
|
1200
|
+
/*#__PURE__*/ z(E, {
|
|
1205
1201
|
className: "mb-0",
|
|
1206
1202
|
onSubmit: (e) => {
|
|
1207
1203
|
e.preventDefault(), h();
|
|
@@ -1211,30 +1207,30 @@ function De({ isOpen: e, onClose: t, securityGroupId: n }) {
|
|
|
1211
1207
|
validators: {
|
|
1212
1208
|
onBlur: ({ value: e }) => {
|
|
1213
1209
|
let t = e.trim();
|
|
1214
|
-
if (!t) return
|
|
1215
|
-
if (!Ee(t)) return
|
|
1210
|
+
if (!t) return a._({ id: "1RwosK" });
|
|
1211
|
+
if (!Ee(t)) return a._({ id: "CunRry" });
|
|
1216
1212
|
},
|
|
1217
1213
|
onChange: ({ value: e }) => {
|
|
1218
|
-
if (!
|
|
1214
|
+
if (!l) return;
|
|
1219
1215
|
let t = e.trim();
|
|
1220
|
-
if (!t) return
|
|
1221
|
-
if (!Ee(t)) return
|
|
1216
|
+
if (!t) return a._({ id: "1RwosK" });
|
|
1217
|
+
if (!Ee(t)) return a._({ id: "CunRry" });
|
|
1222
1218
|
}
|
|
1223
1219
|
},
|
|
1224
1220
|
children: (e) => {
|
|
1225
|
-
let t = (e.state.meta.isTouched ||
|
|
1221
|
+
let t = (e.state.meta.isTouched || l) && e.state.meta.errors.length > 0, n = e.state.meta.errors[0], r = t ? typeof n == "string" ? n : n?.message : void 0;
|
|
1226
1222
|
return /*#__PURE__*/ z(v, {
|
|
1227
1223
|
id: e.name,
|
|
1228
1224
|
name: e.name,
|
|
1229
|
-
label:
|
|
1225
|
+
label: a._({ id: "WzVwU0" }),
|
|
1230
1226
|
value: e.state.value,
|
|
1231
1227
|
onChange: (t) => e.handleChange(t.target.value),
|
|
1232
1228
|
onBlur: e.handleBlur,
|
|
1233
|
-
placeholder:
|
|
1229
|
+
placeholder: a._({ id: "he4q+i" }),
|
|
1234
1230
|
required: !0,
|
|
1235
|
-
helptext:
|
|
1231
|
+
helptext: a._({ id: "PkfPsB" }),
|
|
1236
1232
|
disabled: f.isPending,
|
|
1237
|
-
errortext:
|
|
1233
|
+
errortext: r,
|
|
1238
1234
|
invalid: t
|
|
1239
1235
|
});
|
|
1240
1236
|
}
|
|
@@ -1245,31 +1241,31 @@ function De({ isOpen: e, onClose: t, securityGroupId: n }) {
|
|
|
1245
1241
|
}
|
|
1246
1242
|
//#endregion
|
|
1247
1243
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-modals/DeleteRBACPolicyDialog.tsx
|
|
1248
|
-
function Oe({ policy: e, open: t, onClose:
|
|
1249
|
-
let { i18n:
|
|
1244
|
+
function Oe({ policy: e, open: t, onClose: r, onConfirm: a, isLoading: o, error: s }) {
|
|
1245
|
+
let { i18n: c, _: l } = J(), u = Y.object({ confirmText: Y.string().refine((e) => e === "remove", { message: c._({ id: "SVLToM" }) }) }), d = X({
|
|
1250
1246
|
defaultValues: { confirmText: "" },
|
|
1251
|
-
validators: { onSubmit:
|
|
1247
|
+
validators: { onSubmit: u },
|
|
1252
1248
|
onSubmit: async () => {
|
|
1253
|
-
|
|
1249
|
+
o || (a(e.id), p());
|
|
1254
1250
|
}
|
|
1255
|
-
}), f = Z(
|
|
1256
|
-
|
|
1251
|
+
}), f = Z(d.store, (e) => e.isSubmitting || e.values.confirmText !== "remove"), p = () => {
|
|
1252
|
+
d.reset(), r();
|
|
1257
1253
|
};
|
|
1258
|
-
return /*#__PURE__*/ z(
|
|
1254
|
+
return /*#__PURE__*/ z(i, {
|
|
1259
1255
|
open: t,
|
|
1260
1256
|
onCancel: p,
|
|
1261
1257
|
size: "small",
|
|
1262
|
-
title:
|
|
1263
|
-
onConfirm:
|
|
1264
|
-
cancelButtonLabel:
|
|
1265
|
-
confirmButtonLabel:
|
|
1266
|
-
disableConfirmButton:
|
|
1258
|
+
title: c._({ id: "Dt5W9T" }),
|
|
1259
|
+
onConfirm: d.handleSubmit,
|
|
1260
|
+
cancelButtonLabel: c._({ id: "dEgA5A" }),
|
|
1261
|
+
confirmButtonLabel: o ? c._({ id: "M5RhXF" }) : c._({ id: "qh5W8q" }),
|
|
1262
|
+
disableConfirmButton: o || f,
|
|
1267
1263
|
children: /*#__PURE__*/ B("div", { children: [
|
|
1268
|
-
|
|
1264
|
+
s && /*#__PURE__*/ z(n, {
|
|
1269
1265
|
dismissible: !1,
|
|
1270
1266
|
variant: "error",
|
|
1271
1267
|
className: "mt-4",
|
|
1272
|
-
children:
|
|
1268
|
+
children: s
|
|
1273
1269
|
}),
|
|
1274
1270
|
/*#__PURE__*/ z(q, { id: "BMTd81" }),
|
|
1275
1271
|
/*#__PURE__*/ B("div", {
|
|
@@ -1298,10 +1294,10 @@ function Oe({ policy: e, open: t, onClose: n, onConfirm: r, isLoading: a, error:
|
|
|
1298
1294
|
]
|
|
1299
1295
|
})]
|
|
1300
1296
|
}),
|
|
1301
|
-
!
|
|
1297
|
+
!o && /*#__PURE__*/ z(E, {
|
|
1302
1298
|
className: "mt-4 mb-0",
|
|
1303
1299
|
onSubmit: (e) => {
|
|
1304
|
-
e.preventDefault(),
|
|
1300
|
+
e.preventDefault(), d.handleSubmit();
|
|
1305
1301
|
},
|
|
1306
1302
|
children: /*#__PURE__*/ B(x, { children: [/*#__PURE__*/ z("p", {
|
|
1307
1303
|
className: "mb-2 text-sm",
|
|
@@ -1309,16 +1305,16 @@ function Oe({ policy: e, open: t, onClose: n, onConfirm: r, isLoading: a, error:
|
|
|
1309
1305
|
id: "Enpdmy",
|
|
1310
1306
|
components: { 0: /*#__PURE__*/ z("strong", {}) }
|
|
1311
1307
|
})
|
|
1312
|
-
}), /*#__PURE__*/ z(
|
|
1308
|
+
}), /*#__PURE__*/ z(d.Field, {
|
|
1313
1309
|
name: "confirmText",
|
|
1314
1310
|
children: (e) => /*#__PURE__*/ z(v, {
|
|
1315
1311
|
id: e.name,
|
|
1316
1312
|
name: e.name,
|
|
1317
1313
|
value: e.state.value,
|
|
1318
1314
|
onChange: (t) => e.handleChange(t.target.value),
|
|
1319
|
-
placeholder:
|
|
1315
|
+
placeholder: c._({ id: "tasfos" }),
|
|
1320
1316
|
autoComplete: "off",
|
|
1321
|
-
disabled:
|
|
1317
|
+
disabled: o,
|
|
1322
1318
|
"data-testid": "remove-policy-confirmation-input"
|
|
1323
1319
|
})
|
|
1324
1320
|
})] })
|
|
@@ -1328,55 +1324,55 @@ function Oe({ policy: e, open: t, onClose: n, onConfirm: r, isLoading: a, error:
|
|
|
1328
1324
|
}
|
|
1329
1325
|
//#endregion
|
|
1330
1326
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/-details/SecurityGroupRBACPolicies.tsx
|
|
1331
|
-
function ke({ securityGroupId: e, canManageAccess:
|
|
1332
|
-
let
|
|
1333
|
-
H(() => () => clearTimeout(
|
|
1334
|
-
let { data:
|
|
1335
|
-
project_id:
|
|
1327
|
+
function ke({ securityGroupId: e, canManageAccess: r }) {
|
|
1328
|
+
let i = k.useUtils(), { i18n: a, _: o } = J(), s = j(), [c, m] = P(), [h, g] = G(null), [v, y] = G(""), [x, S] = G(""), C = W(void 0);
|
|
1329
|
+
H(() => () => clearTimeout(C.current), []);
|
|
1330
|
+
let { data: w, isPending: T, isError: E, error: D } = k.network.rbacPolicy.list.useQuery({
|
|
1331
|
+
project_id: s,
|
|
1336
1332
|
securityGroupId: e
|
|
1337
|
-
}, { refetchOnWindowFocus: !1 }),
|
|
1338
|
-
|
|
1339
|
-
project_id:
|
|
1333
|
+
}, { refetchOnWindowFocus: !1 }), O = k.network.rbacPolicy.delete.useMutation({ onSuccess: () => {
|
|
1334
|
+
i.network.rbacPolicy.list.invalidate({
|
|
1335
|
+
project_id: s,
|
|
1340
1336
|
securityGroupId: e
|
|
1341
|
-
}),
|
|
1342
|
-
project_id:
|
|
1337
|
+
}), i.network.securityGroup.getById.invalidate({
|
|
1338
|
+
project_id: s,
|
|
1343
1339
|
securityGroupId: e
|
|
1344
1340
|
});
|
|
1345
|
-
} }),
|
|
1346
|
-
|
|
1347
|
-
},
|
|
1348
|
-
|
|
1349
|
-
project_id:
|
|
1341
|
+
} }), A = (e) => {
|
|
1342
|
+
g(e);
|
|
1343
|
+
}, M = (e) => {
|
|
1344
|
+
O.mutate({
|
|
1345
|
+
project_id: s,
|
|
1350
1346
|
policyId: e
|
|
1351
1347
|
});
|
|
1352
|
-
},
|
|
1353
|
-
|
|
1348
|
+
}, N = () => {
|
|
1349
|
+
O.isPending || g(null);
|
|
1354
1350
|
};
|
|
1355
1351
|
H(() => {
|
|
1356
|
-
!
|
|
1352
|
+
!O.isPending && !O.error && O.isSuccess && g(null);
|
|
1357
1353
|
}, [
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1354
|
+
O.isPending,
|
|
1355
|
+
O.error,
|
|
1356
|
+
O.isSuccess
|
|
1361
1357
|
]);
|
|
1362
|
-
let
|
|
1363
|
-
if (!
|
|
1364
|
-
if (!
|
|
1365
|
-
let e =
|
|
1366
|
-
return
|
|
1367
|
-
}, [
|
|
1368
|
-
if (
|
|
1358
|
+
let F = U(() => {
|
|
1359
|
+
if (!w) return [];
|
|
1360
|
+
if (!v) return w;
|
|
1361
|
+
let e = v.toLowerCase();
|
|
1362
|
+
return w.filter((t) => t.target_tenant?.toLowerCase().includes(e) || t.action?.toLowerCase().includes(e));
|
|
1363
|
+
}, [w, v]);
|
|
1364
|
+
if (T) return /*#__PURE__*/ z(f, {
|
|
1369
1365
|
distribution: "center",
|
|
1370
1366
|
alignment: "center",
|
|
1371
1367
|
className: "py-8",
|
|
1372
|
-
children: /*#__PURE__*/ z(
|
|
1368
|
+
children: /*#__PURE__*/ z(d, { variant: "primary" })
|
|
1373
1369
|
});
|
|
1374
|
-
if (
|
|
1370
|
+
if (E) return /*#__PURE__*/ z(n, {
|
|
1375
1371
|
variant: "error",
|
|
1376
1372
|
className: "mb-4",
|
|
1377
|
-
children:
|
|
1373
|
+
children: D.message
|
|
1378
1374
|
});
|
|
1379
|
-
let
|
|
1375
|
+
let I = w?.length || 0, L = F.length;
|
|
1380
1376
|
return /*#__PURE__*/ B(R, { children: [
|
|
1381
1377
|
/*#__PURE__*/ B(f, {
|
|
1382
1378
|
direction: "vertical",
|
|
@@ -1389,77 +1385,77 @@ function ke({ securityGroupId: e, canManageAccess: a }) {
|
|
|
1389
1385
|
className: "pb-2",
|
|
1390
1386
|
children: [/*#__PURE__*/ z("span", {
|
|
1391
1387
|
className: "theme-color-text-light text-sm",
|
|
1392
|
-
children:
|
|
1388
|
+
children: I === L ? /*#__PURE__*/ z(q, {
|
|
1393
1389
|
id: "xx2KP5",
|
|
1394
|
-
values: { totalCount:
|
|
1390
|
+
values: { totalCount: I }
|
|
1395
1391
|
}) : /*#__PURE__*/ z(q, {
|
|
1396
1392
|
id: "VcWhM0",
|
|
1397
1393
|
values: {
|
|
1398
|
-
filteredCount:
|
|
1399
|
-
totalCount:
|
|
1394
|
+
filteredCount: L,
|
|
1395
|
+
totalCount: I
|
|
1400
1396
|
}
|
|
1401
1397
|
})
|
|
1402
|
-
}),
|
|
1398
|
+
}), r && /*#__PURE__*/ z(p, {
|
|
1403
1399
|
variant: "primary",
|
|
1404
1400
|
icon: "addCircle",
|
|
1405
|
-
onClick:
|
|
1401
|
+
onClick: m,
|
|
1406
1402
|
className: "whitespace-nowrap",
|
|
1407
1403
|
children: /*#__PURE__*/ z(q, { id: "vmRPFm" })
|
|
1408
1404
|
})]
|
|
1409
1405
|
}),
|
|
1410
|
-
/*#__PURE__*/ z(
|
|
1406
|
+
/*#__PURE__*/ z(_, { children: /*#__PURE__*/ z(f, {
|
|
1411
1407
|
distribution: "between",
|
|
1412
1408
|
alignment: "center",
|
|
1413
|
-
children: /*#__PURE__*/ z(
|
|
1414
|
-
placeholder:
|
|
1409
|
+
children: /*#__PURE__*/ z(t, {
|
|
1410
|
+
placeholder: a._({ id: "mlxk2U" }),
|
|
1415
1411
|
"data-testid": "searchbar",
|
|
1416
|
-
value:
|
|
1412
|
+
value: x,
|
|
1417
1413
|
onInput: (e) => {
|
|
1418
1414
|
let t = e.currentTarget.value;
|
|
1419
|
-
|
|
1415
|
+
S(t), clearTimeout(C.current), C.current = window.setTimeout(() => y(t), 500);
|
|
1420
1416
|
},
|
|
1421
1417
|
onSearch: (e) => {
|
|
1422
|
-
clearTimeout(
|
|
1418
|
+
clearTimeout(C.current), y(typeof e == "string" ? e : "");
|
|
1423
1419
|
},
|
|
1424
1420
|
onClear: () => {
|
|
1425
|
-
clearTimeout(
|
|
1421
|
+
clearTimeout(C.current), S(""), y("");
|
|
1426
1422
|
}
|
|
1427
1423
|
})
|
|
1428
1424
|
}) }),
|
|
1429
|
-
|
|
1425
|
+
L === 0 ? v ? /*#__PURE__*/ z(q, { id: "qxxo7y" }) : /*#__PURE__*/ z(q, { id: "Dia2Ue" }) : /*#__PURE__*/ B(b, {
|
|
1430
1426
|
columns: 3,
|
|
1431
|
-
children: [/*#__PURE__*/ B(
|
|
1432
|
-
/*#__PURE__*/ z(
|
|
1433
|
-
/*#__PURE__*/ z(
|
|
1434
|
-
/*#__PURE__*/ z(
|
|
1435
|
-
] }),
|
|
1427
|
+
children: [/*#__PURE__*/ B(u, { children: [
|
|
1428
|
+
/*#__PURE__*/ z(l, { children: /*#__PURE__*/ z(q, { id: "WzVwU0" }) }),
|
|
1429
|
+
/*#__PURE__*/ z(l, { children: /*#__PURE__*/ z(q, { id: "bwRvnp" }) }),
|
|
1430
|
+
/*#__PURE__*/ z(l, { children: /*#__PURE__*/ z(q, { id: "7L01XJ" }) })
|
|
1431
|
+
] }), F.map((e) => /*#__PURE__*/ z(Ce, {
|
|
1436
1432
|
policy: e,
|
|
1437
|
-
onDelete: () =>
|
|
1438
|
-
canDelete:
|
|
1433
|
+
onDelete: () => A(e),
|
|
1434
|
+
canDelete: r
|
|
1439
1435
|
}, e.id))]
|
|
1440
1436
|
})
|
|
1441
1437
|
]
|
|
1442
1438
|
}),
|
|
1443
|
-
!!
|
|
1444
|
-
policy:
|
|
1445
|
-
open: !!
|
|
1446
|
-
onClose:
|
|
1447
|
-
onConfirm:
|
|
1448
|
-
isLoading:
|
|
1449
|
-
error:
|
|
1439
|
+
!!h && /*#__PURE__*/ z(Oe, {
|
|
1440
|
+
policy: h,
|
|
1441
|
+
open: !!h,
|
|
1442
|
+
onClose: N,
|
|
1443
|
+
onConfirm: M,
|
|
1444
|
+
isLoading: O.isPending,
|
|
1445
|
+
error: O.error?.message || null
|
|
1450
1446
|
}),
|
|
1451
|
-
|
|
1452
|
-
isOpen:
|
|
1453
|
-
onClose:
|
|
1447
|
+
c && /*#__PURE__*/ z(De, {
|
|
1448
|
+
isOpen: c,
|
|
1449
|
+
onClose: m,
|
|
1454
1450
|
securityGroupId: e
|
|
1455
1451
|
})
|
|
1456
1452
|
] });
|
|
1457
1453
|
}
|
|
1458
1454
|
//#endregion
|
|
1459
1455
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-components/SecurityGroupDetailsView.tsx
|
|
1460
|
-
function Ae({ securityGroup:
|
|
1461
|
-
let [
|
|
1462
|
-
return /*#__PURE__*/ z(
|
|
1456
|
+
function Ae({ securityGroup: t, filteredAndSortedRules: n, onEdit: r, onDeleteRule: i, isDeletingRule: a = !1, deleteRuleError: o = null, filterControls: s, onCreateRule: c, isCreatingRule: l = !1, createRuleError: u = null, availableSecurityGroups: d = [], currentProjectId: p, permissions: m }) {
|
|
1457
|
+
let [h, g] = G("rules"), _ = t.project_id === p && m.canViewRBAC;
|
|
1458
|
+
return /*#__PURE__*/ z(e, {
|
|
1463
1459
|
px: !1,
|
|
1464
1460
|
py: !0,
|
|
1465
1461
|
children: /*#__PURE__*/ B(f, {
|
|
@@ -1467,43 +1463,43 @@ function Ae({ securityGroup: e, filteredAndSortedRules: t, onEdit: n, onDeleteRu
|
|
|
1467
1463
|
gap: "4",
|
|
1468
1464
|
children: [
|
|
1469
1465
|
/*#__PURE__*/ z(te, {
|
|
1470
|
-
name:
|
|
1471
|
-
id:
|
|
1466
|
+
name: t.name,
|
|
1467
|
+
id: t.id
|
|
1472
1468
|
}),
|
|
1473
1469
|
/*#__PURE__*/ z(Q, {
|
|
1474
|
-
securityGroup:
|
|
1475
|
-
onEdit:
|
|
1476
|
-
canUpdate:
|
|
1470
|
+
securityGroup: t,
|
|
1471
|
+
onEdit: r,
|
|
1472
|
+
canUpdate: m.canUpdate
|
|
1477
1473
|
}),
|
|
1478
1474
|
/*#__PURE__*/ z($, {
|
|
1479
|
-
activeTab:
|
|
1480
|
-
onTabChange:
|
|
1481
|
-
showRBACTab:
|
|
1475
|
+
activeTab: h,
|
|
1476
|
+
onTabChange: g,
|
|
1477
|
+
showRBACTab: _
|
|
1482
1478
|
}),
|
|
1483
1479
|
/*#__PURE__*/ B("div", {
|
|
1484
1480
|
className: "mt-6",
|
|
1485
|
-
children: [
|
|
1486
|
-
rules:
|
|
1487
|
-
totalRulesCount:
|
|
1488
|
-
onDeleteRule:
|
|
1489
|
-
isDeletingRule:
|
|
1490
|
-
deleteError:
|
|
1491
|
-
searchTerm:
|
|
1492
|
-
onSearchChange:
|
|
1493
|
-
sortSettings:
|
|
1494
|
-
onSortChange:
|
|
1495
|
-
filterSettings:
|
|
1496
|
-
onFilterChange:
|
|
1497
|
-
securityGroupId:
|
|
1498
|
-
onCreateRule:
|
|
1499
|
-
isCreatingRule:
|
|
1500
|
-
createRuleError:
|
|
1501
|
-
availableSecurityGroups:
|
|
1502
|
-
canCreateRule:
|
|
1503
|
-
canDeleteRule:
|
|
1504
|
-
}),
|
|
1505
|
-
securityGroupId:
|
|
1506
|
-
canManageAccess:
|
|
1481
|
+
children: [h === "rules" && /*#__PURE__*/ z(Se, {
|
|
1482
|
+
rules: n,
|
|
1483
|
+
totalRulesCount: t.security_group_rules?.length,
|
|
1484
|
+
onDeleteRule: i,
|
|
1485
|
+
isDeletingRule: a,
|
|
1486
|
+
deleteError: o,
|
|
1487
|
+
searchTerm: s.searchTerm,
|
|
1488
|
+
onSearchChange: s.onSearchChange,
|
|
1489
|
+
sortSettings: s.sortSettings,
|
|
1490
|
+
onSortChange: s.onSortChange,
|
|
1491
|
+
filterSettings: s.filterSettings,
|
|
1492
|
+
onFilterChange: s.onFilterChange,
|
|
1493
|
+
securityGroupId: t.id,
|
|
1494
|
+
onCreateRule: m.canCreateRule ? c : void 0,
|
|
1495
|
+
isCreatingRule: l,
|
|
1496
|
+
createRuleError: u,
|
|
1497
|
+
availableSecurityGroups: d,
|
|
1498
|
+
canCreateRule: m.canCreateRule,
|
|
1499
|
+
canDeleteRule: m.canDeleteRule
|
|
1500
|
+
}), h === "rbac" && /*#__PURE__*/ z(ke, {
|
|
1501
|
+
securityGroupId: t.id,
|
|
1502
|
+
canManageAccess: m.canManageAccess
|
|
1507
1503
|
})]
|
|
1508
1504
|
})
|
|
1509
1505
|
]
|
|
@@ -1513,7 +1509,7 @@ function Ae({ securityGroup: e, filteredAndSortedRules: t, onEdit: n, onDeleteRu
|
|
|
1513
1509
|
//#endregion
|
|
1514
1510
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/-hooks/useSecurityGroupDetails.ts
|
|
1515
1511
|
function je({ securityGroupId: e, filterControls: t }) {
|
|
1516
|
-
let [n, r] = G(!1), i =
|
|
1512
|
+
let [n, r] = G(!1), i = j(), a = k.useUtils(), o = k.network.securityGroup.getById.useQuery({
|
|
1517
1513
|
project_id: i,
|
|
1518
1514
|
securityGroupId: e
|
|
1519
1515
|
}, { placeholderData: () => a.network.securityGroup.getById.getData({
|
|
@@ -1533,17 +1529,17 @@ function je({ securityGroupId: e, filterControls: t }) {
|
|
|
1533
1529
|
});
|
|
1534
1530
|
}
|
|
1535
1531
|
return e;
|
|
1536
|
-
}, [o.data?.security_group_rules, t]), c =
|
|
1532
|
+
}, [o.data?.security_group_rules, t]), c = k.network.securityGroup.update.useMutation({ onSuccess: () => {
|
|
1537
1533
|
a.network.securityGroup.getById.invalidate({
|
|
1538
1534
|
project_id: i,
|
|
1539
1535
|
securityGroupId: e
|
|
1540
1536
|
}), a.network.securityGroup.list.invalidate(), r(!1);
|
|
1541
|
-
} }), l =
|
|
1537
|
+
} }), l = k.network.securityGroupRule.delete.useMutation({ onSuccess: () => {
|
|
1542
1538
|
a.network.securityGroup.getById.invalidate({
|
|
1543
1539
|
project_id: i,
|
|
1544
1540
|
securityGroupId: e
|
|
1545
1541
|
}), a.network.securityGroup.list.invalidate();
|
|
1546
|
-
} }), u =
|
|
1542
|
+
} }), u = k.network.securityGroupRule.create.useMutation({ onSuccess: () => {
|
|
1547
1543
|
a.network.securityGroup.getById.invalidate({
|
|
1548
1544
|
project_id: i,
|
|
1549
1545
|
securityGroupId: e
|
|
@@ -1621,40 +1617,40 @@ function Me({ defaultSortKey: e, defaultSortDir: t, sortOptions: n, filterSettin
|
|
|
1621
1617
|
//#endregion
|
|
1622
1618
|
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/index.tsx?tsr-split=component
|
|
1623
1619
|
function Ne() {
|
|
1624
|
-
let { securityGroupId: e } =
|
|
1620
|
+
let { securityGroupId: e } = A.useParams(), { trpcClient: t } = A.useRouteContext(), n = j(), r = K(), { i18n: i, _: o } = J();
|
|
1625
1621
|
if (!t) throw Error("trpcClient is not available in route context");
|
|
1626
|
-
let { permissions:
|
|
1622
|
+
let { permissions: s, isLoading: c, isError: l } = ee(n), { searchTerm: u, sortSettings: m, filterSettings: h, handleSearchChange: g, handleSortChange: _, handleFilterChange: v } = Me({
|
|
1627
1623
|
defaultSortKey: "direction",
|
|
1628
1624
|
defaultSortDir: "asc",
|
|
1629
1625
|
sortOptions: [
|
|
1630
1626
|
{
|
|
1631
|
-
label:
|
|
1627
|
+
label: i._({ id: "MRB7nI" }),
|
|
1632
1628
|
value: "direction"
|
|
1633
1629
|
},
|
|
1634
1630
|
{
|
|
1635
|
-
label:
|
|
1631
|
+
label: i._({ id: "6+OdGi" }),
|
|
1636
1632
|
value: "protocol"
|
|
1637
1633
|
},
|
|
1638
1634
|
{
|
|
1639
|
-
label:
|
|
1635
|
+
label: i._({ id: "Nu4oKW" }),
|
|
1640
1636
|
value: "description"
|
|
1641
1637
|
}
|
|
1642
1638
|
],
|
|
1643
1639
|
filterSettings: { filters: [
|
|
1644
1640
|
{
|
|
1645
|
-
displayName:
|
|
1641
|
+
displayName: i._({ id: "MRB7nI" }),
|
|
1646
1642
|
filterName: "direction",
|
|
1647
1643
|
values: ["ingress", "egress"],
|
|
1648
1644
|
supportsMultiValue: !1
|
|
1649
1645
|
},
|
|
1650
1646
|
{
|
|
1651
|
-
displayName:
|
|
1647
|
+
displayName: i._({ id: "yp0UjB" }),
|
|
1652
1648
|
filterName: "ethertype",
|
|
1653
1649
|
values: ["IPv4", "IPv6"],
|
|
1654
1650
|
supportsMultiValue: !1
|
|
1655
1651
|
},
|
|
1656
1652
|
{
|
|
1657
|
-
displayName:
|
|
1653
|
+
displayName: i._({ id: "6+OdGi" }),
|
|
1658
1654
|
filterName: "protocol",
|
|
1659
1655
|
values: [
|
|
1660
1656
|
"tcp",
|
|
@@ -1666,36 +1662,36 @@ function Ne() {
|
|
|
1666
1662
|
}
|
|
1667
1663
|
] }
|
|
1668
1664
|
}), b = {
|
|
1669
|
-
searchTerm:
|
|
1670
|
-
onSearchChange:
|
|
1671
|
-
sortSettings:
|
|
1672
|
-
onSortChange:
|
|
1673
|
-
filterSettings:
|
|
1674
|
-
onFilterChange:
|
|
1675
|
-
}, { securityGroup: x, filteredAndSortedRules:
|
|
1665
|
+
searchTerm: u,
|
|
1666
|
+
onSearchChange: g,
|
|
1667
|
+
sortSettings: m,
|
|
1668
|
+
onSortChange: _,
|
|
1669
|
+
filterSettings: h,
|
|
1670
|
+
onFilterChange: v
|
|
1671
|
+
}, { securityGroup: x, filteredAndSortedRules: C, isLoading: w, isError: T, error: E, isUpdating: D, updateError: O, isDeletingRule: M, deleteRuleError: N, isCreatingRule: P, createRuleError: F, editModalOpen: I, handleEdit: R, handleCloseEditModal: V, handleUpdate: H, handleDeleteRule: W, handleCreateRule: G } = je({
|
|
1676
1672
|
securityGroupId: e,
|
|
1677
1673
|
filterControls: b
|
|
1678
|
-
}), { data: Y } =
|
|
1674
|
+
}), { data: Y } = k.network.securityGroup.list.useQuery({ project_id: n }), X = U(() => (Y || []).filter((t) => t.id !== e).map((e) => ({
|
|
1679
1675
|
id: e.id,
|
|
1680
1676
|
name: e.name || e.id
|
|
1681
1677
|
})), [Y, e]), Z = () => {
|
|
1682
|
-
|
|
1678
|
+
r({
|
|
1683
1679
|
to: "/projects/$projectId/network/securitygroups",
|
|
1684
1680
|
params: { projectId: n }
|
|
1685
1681
|
});
|
|
1686
1682
|
};
|
|
1687
|
-
if (
|
|
1683
|
+
if (c) return /*#__PURE__*/ B(f, {
|
|
1688
1684
|
className: "fixed inset-0",
|
|
1689
1685
|
distribution: "center",
|
|
1690
1686
|
alignment: "center",
|
|
1691
1687
|
direction: "vertical",
|
|
1692
|
-
children: [/*#__PURE__*/ z(
|
|
1688
|
+
children: [/*#__PURE__*/ z(d, {
|
|
1693
1689
|
variant: "primary",
|
|
1694
1690
|
size: "large",
|
|
1695
1691
|
className: "mb-2"
|
|
1696
1692
|
}), /*#__PURE__*/ z(q, { id: "EpWoJ9" })]
|
|
1697
1693
|
});
|
|
1698
|
-
let te =
|
|
1694
|
+
let te = l ? {
|
|
1699
1695
|
canView: !1,
|
|
1700
1696
|
canCreate: !1,
|
|
1701
1697
|
canUpdate: !1,
|
|
@@ -1704,20 +1700,20 @@ function Ne() {
|
|
|
1704
1700
|
canDeleteRule: !1,
|
|
1705
1701
|
canManageAccess: !1,
|
|
1706
1702
|
canViewRBAC: !1
|
|
1707
|
-
} :
|
|
1703
|
+
} : s;
|
|
1708
1704
|
if (w) return /*#__PURE__*/ B(f, {
|
|
1709
1705
|
className: "fixed inset-0",
|
|
1710
1706
|
distribution: "center",
|
|
1711
1707
|
alignment: "center",
|
|
1712
1708
|
direction: "vertical",
|
|
1713
|
-
children: [/*#__PURE__*/ z(
|
|
1709
|
+
children: [/*#__PURE__*/ z(d, {
|
|
1714
1710
|
variant: "primary",
|
|
1715
1711
|
size: "large",
|
|
1716
1712
|
className: "mb-2"
|
|
1717
1713
|
}), /*#__PURE__*/ z(q, { id: "3x7Sws" })]
|
|
1718
1714
|
});
|
|
1719
1715
|
if (T) {
|
|
1720
|
-
let e =
|
|
1716
|
+
let e = E?.message || "Unknown error";
|
|
1721
1717
|
return /*#__PURE__*/ B(f, {
|
|
1722
1718
|
className: "fixed inset-0",
|
|
1723
1719
|
distribution: "center",
|
|
@@ -1733,7 +1729,7 @@ function Ne() {
|
|
|
1733
1729
|
className: "text-theme-highest",
|
|
1734
1730
|
children: e
|
|
1735
1731
|
}),
|
|
1736
|
-
/*#__PURE__*/ z(
|
|
1732
|
+
/*#__PURE__*/ z(p, {
|
|
1737
1733
|
onClick: Z,
|
|
1738
1734
|
variant: "primary",
|
|
1739
1735
|
children: /*#__PURE__*/ z(q, { id: "U9q4M7" })
|
|
@@ -1744,39 +1740,39 @@ function Ne() {
|
|
|
1744
1740
|
return x ? /*#__PURE__*/ B(f, {
|
|
1745
1741
|
direction: "vertical",
|
|
1746
1742
|
children: [
|
|
1747
|
-
/*#__PURE__*/ z(
|
|
1748
|
-
/*#__PURE__*/ B(
|
|
1743
|
+
/*#__PURE__*/ z(y, { children: x.name || x.id }),
|
|
1744
|
+
/*#__PURE__*/ B(S, {
|
|
1749
1745
|
className: "my-6",
|
|
1750
|
-
children: [/*#__PURE__*/ z(
|
|
1746
|
+
children: [/*#__PURE__*/ z(a, {
|
|
1751
1747
|
onClick: Z,
|
|
1752
|
-
label:
|
|
1753
|
-
}), /*#__PURE__*/ z(
|
|
1748
|
+
label: i._({ id: "4opp4r" })
|
|
1749
|
+
}), /*#__PURE__*/ z(a, {
|
|
1754
1750
|
active: !0,
|
|
1755
1751
|
label: x.id
|
|
1756
1752
|
})]
|
|
1757
1753
|
}),
|
|
1758
1754
|
/*#__PURE__*/ z(Ae, {
|
|
1759
1755
|
securityGroup: x,
|
|
1760
|
-
filteredAndSortedRules:
|
|
1756
|
+
filteredAndSortedRules: C,
|
|
1761
1757
|
onEdit: R,
|
|
1762
1758
|
onDeleteRule: W,
|
|
1763
|
-
isDeletingRule:
|
|
1764
|
-
deleteRuleError:
|
|
1759
|
+
isDeletingRule: M,
|
|
1760
|
+
deleteRuleError: N,
|
|
1765
1761
|
filterControls: b,
|
|
1766
1762
|
onCreateRule: G,
|
|
1767
|
-
isCreatingRule:
|
|
1768
|
-
createRuleError:
|
|
1763
|
+
isCreatingRule: P,
|
|
1764
|
+
createRuleError: F,
|
|
1769
1765
|
availableSecurityGroups: X,
|
|
1770
1766
|
currentProjectId: n,
|
|
1771
1767
|
permissions: te
|
|
1772
1768
|
}),
|
|
1773
|
-
/*#__PURE__*/ z(
|
|
1769
|
+
/*#__PURE__*/ z(L, {
|
|
1774
1770
|
securityGroup: x,
|
|
1775
|
-
open:
|
|
1771
|
+
open: I,
|
|
1776
1772
|
onClose: V,
|
|
1777
1773
|
onUpdate: H,
|
|
1778
|
-
isLoading:
|
|
1779
|
-
error:
|
|
1774
|
+
isLoading: D,
|
|
1775
|
+
error: O
|
|
1780
1776
|
})
|
|
1781
1777
|
]
|
|
1782
1778
|
}) : /*#__PURE__*/ B(f, {
|
|
@@ -1788,7 +1784,7 @@ function Ne() {
|
|
|
1788
1784
|
children: [/*#__PURE__*/ z("p", {
|
|
1789
1785
|
className: "text-theme-secondary",
|
|
1790
1786
|
children: /*#__PURE__*/ z(q, { id: "Zw8Q49" })
|
|
1791
|
-
}), /*#__PURE__*/ z(
|
|
1787
|
+
}), /*#__PURE__*/ z(p, {
|
|
1792
1788
|
onClick: Z,
|
|
1793
1789
|
variant: "primary",
|
|
1794
1790
|
children: /*#__PURE__*/ z(q, { id: "U9q4M7" })
|
|
@@ -1798,4 +1794,4 @@ function Ne() {
|
|
|
1798
1794
|
//#endregion
|
|
1799
1795
|
export { Ne as component };
|
|
1800
1796
|
|
|
1801
|
-
//# sourceMappingURL=_securityGroupId-
|
|
1797
|
+
//# sourceMappingURL=_securityGroupId-pPtJsCoe.mjs.map
|