@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
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { A as e, L as t, M as n, U as r, X as i, _ as a, b as o, ct as s, q as c, w as l } from "./build-C_4vRMCq.mjs";
|
|
2
|
+
import { t as u } from "./Slot-CWb612-_.mjs";
|
|
3
|
+
import { t as d } from "./_projectId-QueiFczy.mjs";
|
|
4
|
+
import { t as f } from "./helpers-1PpYf-fC.mjs";
|
|
5
|
+
import { t as p } from "./routeInfo-DXqB2HCf.mjs";
|
|
6
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
7
|
+
import { useEffect as _, useMemo as v, useState as y } from "react";
|
|
8
|
+
import { Outlet as b, useLoaderData as x, useMatches as S, useNavigate as C, useParams as w, useRouteContext as T } from "@tanstack/react-router";
|
|
9
|
+
import { useLingui as E } from "@lingui/react";
|
|
10
|
+
import { i18n as D } from "@lingui/core";
|
|
11
|
+
//#region src/client/routes/_auth/projects/-components/SideNavBar.tsx
|
|
12
|
+
var O = ({ projectId: e, projectName: t, domainName: r, sections: i }) => {
|
|
13
|
+
let c = C(), d = S(), { provider: f } = w({ strict: !1 }), { slots: v } = T({ strict: !1 }), b = (e) => v?.serviceBadge ? /*#__PURE__*/ h(u, {
|
|
14
|
+
component: v.serviceBadge,
|
|
15
|
+
useShadowDOM: !1,
|
|
16
|
+
currentService: e
|
|
17
|
+
}) : null, x = [...d].reverse().find((e) => p(e.staticData)), E = x && p(x.staticData) ? x.staticData : void 0, D = E?.section ?? null, O = E?.service ?? null, [k, A] = y(() => Object.fromEntries(i.map((e) => [e.section, 0])));
|
|
18
|
+
return _(() => {
|
|
19
|
+
D && A((e) => ({
|
|
20
|
+
...e,
|
|
21
|
+
[D]: (e[D] || 0) + 1
|
|
22
|
+
}));
|
|
23
|
+
}, [D]), /*#__PURE__*/ h(l, {
|
|
24
|
+
ariaLabel: "Project Side Navigation",
|
|
25
|
+
children: /*#__PURE__*/ g(m, { children: [/*#__PURE__*/ h(o, { children: /*#__PURE__*/ g(m, { children: [
|
|
26
|
+
/*#__PURE__*/ h(n, {
|
|
27
|
+
onClick: () => c({
|
|
28
|
+
to: "/projects/$projectId",
|
|
29
|
+
params: { projectId: e }
|
|
30
|
+
}),
|
|
31
|
+
label: /*#__PURE__*/ g(m, { children: [r && /*#__PURE__*/ g("p", {
|
|
32
|
+
className: "text-theme-light text-xs leading-4 font-bold",
|
|
33
|
+
children: [r, " /"]
|
|
34
|
+
}), /*#__PURE__*/ h("p", {
|
|
35
|
+
className: "leading-5 font-normal",
|
|
36
|
+
children: t
|
|
37
|
+
})] })
|
|
38
|
+
}),
|
|
39
|
+
/*#__PURE__*/ h(a, { spacing: "1" }),
|
|
40
|
+
i.map(({ section: e, label: t, services: r }) => /*#__PURE__*/ h(s, {
|
|
41
|
+
label: t,
|
|
42
|
+
open: !0,
|
|
43
|
+
children: r.map((t) => {
|
|
44
|
+
let r = D === e && (D === "storage" && O === "containers" ? t.params.provider === f : O === t.service);
|
|
45
|
+
return /*#__PURE__*/ h(n, {
|
|
46
|
+
onClick: () => t.navigate(c),
|
|
47
|
+
label: /*#__PURE__*/ g("span", {
|
|
48
|
+
className: "flex items-start gap-2",
|
|
49
|
+
children: [t.label, b(t.service)]
|
|
50
|
+
}),
|
|
51
|
+
selected: r
|
|
52
|
+
}, t.service);
|
|
53
|
+
})
|
|
54
|
+
}, `${e}-${k[e]}`))
|
|
55
|
+
] }) }), v?.sideNavBanner && /*#__PURE__*/ h(u, { component: v.sideNavBanner })] })
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/client/routes/_auth/projects/-components/buildNavSections.ts
|
|
60
|
+
function k(e, t, n, r) {
|
|
61
|
+
let i = f(t), a = (e) => !n || n.includes(e), o = [...i.image?.glance && a("images") ? [{
|
|
62
|
+
service: "images",
|
|
63
|
+
label: D._({ id: "an5hVd" }),
|
|
64
|
+
navigate: (t) => t({
|
|
65
|
+
to: "/projects/$projectId/compute/images",
|
|
66
|
+
params: { projectId: e }
|
|
67
|
+
}),
|
|
68
|
+
params: { projectId: e }
|
|
69
|
+
}] : [], ...i?.compute?.nova && a("flavors") ? [{
|
|
70
|
+
service: "flavors",
|
|
71
|
+
label: D._({ id: "neiJm0" }),
|
|
72
|
+
navigate: (t) => t({
|
|
73
|
+
to: "/projects/$projectId/compute/flavors",
|
|
74
|
+
params: { projectId: e }
|
|
75
|
+
}),
|
|
76
|
+
params: { projectId: e }
|
|
77
|
+
}] : []], s = i.network ? [...a("securitygroups") ? [{
|
|
78
|
+
service: "securitygroups",
|
|
79
|
+
label: D._({ id: "4opp4r" }),
|
|
80
|
+
navigate: (t) => t({
|
|
81
|
+
to: "/projects/$projectId/network/securitygroups",
|
|
82
|
+
params: { projectId: e }
|
|
83
|
+
}),
|
|
84
|
+
params: { projectId: e }
|
|
85
|
+
}] : [], ...a("floatingips") ? [{
|
|
86
|
+
service: "floatingips",
|
|
87
|
+
label: D._({ id: "u77/s4" }),
|
|
88
|
+
navigate: (t) => t({
|
|
89
|
+
to: "/projects/$projectId/network/floatingips",
|
|
90
|
+
params: { projectId: e }
|
|
91
|
+
}),
|
|
92
|
+
params: { projectId: e }
|
|
93
|
+
}] : []] : [], c = [...i?.["object-store"]?.swift && a("containers") ? [{
|
|
94
|
+
service: "containers",
|
|
95
|
+
label: D._({ id: "+OEi73" }),
|
|
96
|
+
navigate: (t) => t({
|
|
97
|
+
to: "/projects/$projectId/storage/$provider/$storageType",
|
|
98
|
+
params: {
|
|
99
|
+
projectId: e,
|
|
100
|
+
provider: "swift",
|
|
101
|
+
storageType: "containers"
|
|
102
|
+
}
|
|
103
|
+
}),
|
|
104
|
+
params: {
|
|
105
|
+
projectId: e,
|
|
106
|
+
provider: "swift",
|
|
107
|
+
storageType: "containers"
|
|
108
|
+
}
|
|
109
|
+
}] : [], ...i?.["object-store-ceph"]?.ceph && a("ceph-containers") ? [{
|
|
110
|
+
service: "ceph-containers",
|
|
111
|
+
label: D._({ id: "KhNDX4" }),
|
|
112
|
+
navigate: (t) => t({
|
|
113
|
+
to: "/projects/$projectId/storage/$provider/$storageType",
|
|
114
|
+
params: {
|
|
115
|
+
projectId: e,
|
|
116
|
+
provider: "ceph",
|
|
117
|
+
storageType: "buckets"
|
|
118
|
+
}
|
|
119
|
+
}),
|
|
120
|
+
params: {
|
|
121
|
+
projectId: e,
|
|
122
|
+
provider: "ceph",
|
|
123
|
+
storageType: "buckets"
|
|
124
|
+
}
|
|
125
|
+
}] : []], l = /* @__PURE__ */ new Map([
|
|
126
|
+
["compute", {
|
|
127
|
+
section: "compute",
|
|
128
|
+
label: D._({ id: "rp0Bd0" }),
|
|
129
|
+
services: o
|
|
130
|
+
}],
|
|
131
|
+
["network", {
|
|
132
|
+
section: "network",
|
|
133
|
+
label: D._({ id: "OR475H" }),
|
|
134
|
+
services: s
|
|
135
|
+
}],
|
|
136
|
+
["storage", {
|
|
137
|
+
section: "storage",
|
|
138
|
+
label: D._({ id: "BrrIs8" }),
|
|
139
|
+
services: c
|
|
140
|
+
}],
|
|
141
|
+
["services", {
|
|
142
|
+
section: "services",
|
|
143
|
+
label: D._({ id: "MILoeL" }),
|
|
144
|
+
services: []
|
|
145
|
+
}]
|
|
146
|
+
]);
|
|
147
|
+
for (let t of r ?? []) i[t.serviceType]?.[t.serviceName] && (n && !n.includes(t.serviceType) || l.get("services")?.services.push({
|
|
148
|
+
service: t.serviceType,
|
|
149
|
+
label: t.label,
|
|
150
|
+
navigate: (n) => n({
|
|
151
|
+
to: t.routes.fullPath,
|
|
152
|
+
params: { projectId: e }
|
|
153
|
+
}),
|
|
154
|
+
params: { projectId: e }
|
|
155
|
+
}));
|
|
156
|
+
return [...l.values()].filter((e) => e.services.length > 0);
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/client/components/ProjectView/ProjectInfoBox.tsx
|
|
160
|
+
function A({ projectInfo: e }) {
|
|
161
|
+
let { i18n: n, _: r } = E(), i = C(), a = S(), { projectId: o } = w({ strict: !1 }), s = v(() => {
|
|
162
|
+
let t = {
|
|
163
|
+
Compute: n._({ id: "rp0Bd0" }),
|
|
164
|
+
Network: n._({ id: "OR475H" }),
|
|
165
|
+
Storage: n._({ id: "BrrIs8" }),
|
|
166
|
+
Services: n._({ id: "MILoeL" }),
|
|
167
|
+
Images: n._({ id: "an5hVd" }),
|
|
168
|
+
Flavors: n._({ id: "neiJm0" }),
|
|
169
|
+
"Security Groups": n._({ id: "4opp4r" }),
|
|
170
|
+
"Floating IPs": n._({ id: "u77/s4" })
|
|
171
|
+
}, r = (e) => e === "swift" ? n._({ id: "+OEi73" }) : e === "ceph" ? n._({ id: "KhNDX4" }) : n._({ id: "BrrIs8" }), s = [];
|
|
172
|
+
s.push({
|
|
173
|
+
icon: "home",
|
|
174
|
+
label: n._({ id: "i0qMbr" }),
|
|
175
|
+
onClick: () => i({ to: "/projects" })
|
|
176
|
+
});
|
|
177
|
+
let c = a.filter((e) => e.routeId !== "/_auth/projects/$projectId" && e.routeId.startsWith("/_auth/projects/$projectId")), l = c[c.length - 1], u = l && p(l.staticData) ? l.staticData : void 0, d = e.domain?.name ? `${e.domain.name}/${e.name}` : e.name;
|
|
178
|
+
if (!l || !u) return s.push({
|
|
179
|
+
label: d,
|
|
180
|
+
active: !0
|
|
181
|
+
}), s;
|
|
182
|
+
s.push({
|
|
183
|
+
label: d,
|
|
184
|
+
onClick: () => i({
|
|
185
|
+
to: "/projects/$projectId",
|
|
186
|
+
params: { projectId: o }
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
let f = l.params;
|
|
190
|
+
if (u.sectionCrumb?.to) {
|
|
191
|
+
let { labelKey: e, label: n, to: r } = u.sectionCrumb, a = e ? t[e] : n;
|
|
192
|
+
s.push({
|
|
193
|
+
label: a,
|
|
194
|
+
onClick: () => i({
|
|
195
|
+
to: r,
|
|
196
|
+
params: f
|
|
197
|
+
})
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
if (u.crumb) {
|
|
201
|
+
let { labelKey: e, label: n, to: a, useParamAsLabel: o } = u.crumb, d = o ? r(f[o]) : e ? t[e] : n;
|
|
202
|
+
if (u.isDetail) {
|
|
203
|
+
if (s.push({
|
|
204
|
+
label: d,
|
|
205
|
+
onClick: () => i({
|
|
206
|
+
to: a,
|
|
207
|
+
params: f
|
|
208
|
+
})
|
|
209
|
+
}), u.intermediateCrumb) {
|
|
210
|
+
let { to: e, useParamAsLabel: t, useParentTitleAsLabel: n } = u.intermediateCrumb, r = c[c.length - 2]?.meta?.find((e) => e != null && "title" in e)?.title, a = n ? r ?? (t ? f[t] : void 0) : t ? f[t] : void 0;
|
|
211
|
+
s.push(e ? {
|
|
212
|
+
label: a,
|
|
213
|
+
onClick: () => i({
|
|
214
|
+
to: e,
|
|
215
|
+
params: f
|
|
216
|
+
})
|
|
217
|
+
} : { label: a });
|
|
218
|
+
}
|
|
219
|
+
let e = l.meta?.find((e) => e != null && "title" in e)?.title;
|
|
220
|
+
e && s.push({
|
|
221
|
+
label: e,
|
|
222
|
+
active: !0
|
|
223
|
+
});
|
|
224
|
+
} else s.push(a ? {
|
|
225
|
+
label: d,
|
|
226
|
+
onClick: () => i({
|
|
227
|
+
to: a,
|
|
228
|
+
params: f
|
|
229
|
+
})
|
|
230
|
+
} : {
|
|
231
|
+
label: d,
|
|
232
|
+
active: !0
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return s;
|
|
236
|
+
}, [
|
|
237
|
+
a,
|
|
238
|
+
e,
|
|
239
|
+
o,
|
|
240
|
+
i,
|
|
241
|
+
r
|
|
242
|
+
]);
|
|
243
|
+
return /*#__PURE__*/ h(c, {
|
|
244
|
+
className: "relative z-1 mt-8 mb-4",
|
|
245
|
+
children: s.map((e, n) => /*#__PURE__*/ h(t, {
|
|
246
|
+
label: e.label,
|
|
247
|
+
icon: e.icon,
|
|
248
|
+
onClick: e.onClick,
|
|
249
|
+
active: e.active
|
|
250
|
+
}, n))
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/client/routes/_auth/projects/$projectId.tsx?tsr-split=component
|
|
255
|
+
function j() {
|
|
256
|
+
let { availableServices: t, projectId: n, crumbProject: a, crumbDomain: o } = x({ from: d.id }), { enabledServices: s, additionalProjectServices: c } = T({ strict: !1 }), l = v(() => k(n, t, s, c), [
|
|
257
|
+
n,
|
|
258
|
+
t,
|
|
259
|
+
s,
|
|
260
|
+
c
|
|
261
|
+
]);
|
|
262
|
+
return /*#__PURE__*/ h(r, {
|
|
263
|
+
embedded: !0,
|
|
264
|
+
sideNavigation: /*#__PURE__*/ h(O, {
|
|
265
|
+
sections: l,
|
|
266
|
+
projectId: n,
|
|
267
|
+
projectName: a?.name || n,
|
|
268
|
+
domainName: o?.name
|
|
269
|
+
}),
|
|
270
|
+
className: "h-min-screen",
|
|
271
|
+
children: /*#__PURE__*/ h(e, { children: /*#__PURE__*/ h(i, {
|
|
272
|
+
direction: "vertical",
|
|
273
|
+
distribution: "start",
|
|
274
|
+
alignment: "stretch",
|
|
275
|
+
className: "xl:flex-row",
|
|
276
|
+
gap: "6",
|
|
277
|
+
children: /*#__PURE__*/ g("div", {
|
|
278
|
+
className: "min-w-0 flex-1",
|
|
279
|
+
children: [/*#__PURE__*/ h(A, { projectInfo: {
|
|
280
|
+
id: n,
|
|
281
|
+
name: a?.name || n,
|
|
282
|
+
domain: a?.domain
|
|
283
|
+
} }), /*#__PURE__*/ h(b, {})]
|
|
284
|
+
})
|
|
285
|
+
}) })
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
//#endregion
|
|
289
|
+
export { j as component };
|
|
290
|
+
|
|
291
|
+
//# sourceMappingURL=_projectId-NYk1IN_a.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_projectId-NYk1IN_a.mjs","names":["useNavigate","useMatches","useParams","useRouteContext","useState","useEffect","SideNavigation","SideNavigationList","SideNavigationGroup","SideNavigationItem","Divider","isRouteInfo","Slot","SideNavBar","projectId","projectName","domainName","sections","navigate","matches","provider","strict","slots","navBadge","service","serviceBadge","component","useShadowDOM","currentService","activeMatch","reverse","find","m","staticData","activeRouteInfo","undefined","activeSection","section","activeService","forceOpenCounter","setForceOpenCounter","Object","fromEntries","map","s","prev","ariaLabel","onClick","to","params","label","p","className","spacing","services","open","item","isStorageContainers","isSelected","span","selected","sideNavBanner","getServiceIndex","buildNavSections","projectId","availableServices","enabledServices","additionalProjectServices","serviceIndex","isEnabled","service","includes","computeServices","label","t","navigate","nav","to","params","networkServices","storageServices","provider","storageType","sectionMap","Map","section","services","module","serviceType","serviceName","get","push","routes","fullPath","values","filter","s","length","Breadcrumb","BreadcrumbItem","useMatches","useNavigate","useParams","useMemo","isRouteInfo","ProjectInfoBox","projectInfo","useLingui","navigate","matches","projectId","strict","breadcrumbs","crumbLabels","Compute","t","Network","Storage","Services","Images","Flavors","resolveProviderLabel","provider","items","push","icon","label","onClick","to","projectMatches","filter","m","routeId","startsWith","deepest","length","info","staticData","undefined","combinedLabel","domain","name","active","params","sectionCrumb","labelKey","rawLabel","crumb","useParamAsLabel","resolvedLabel","isDetail","intermediateCrumb","iTo","iParam","useParentTitleAsLabel","parentMatch","parentTitle","meta","find","title","iLabel","className","map","item","index","Outlet","useLoaderData","useRouteContext","AppShell","Container","Stack","SideNavBar","buildNavSections","ProjectInfoBox","useMemo","Route","RouteComponent","availableServices","projectId","crumbProject","crumbDomain","from","id","enabledServices","additionalProjectServices","strict","sections","name","domain","component"],"sources":["../../src/client/routes/_auth/projects/-components/SideNavBar.tsx","../../src/client/routes/_auth/projects/-components/buildNavSections.ts","../../src/client/components/ProjectView/ProjectInfoBox.tsx","../../src/client/routes/_auth/projects/$projectId.tsx?tsr-split=component"],"sourcesContent":["import { useNavigate, useMatches, useParams, useRouteContext } from \"@tanstack/react-router\"\nimport { useState, useEffect } from \"react\"\nimport {\n SideNavigation,\n SideNavigationList,\n SideNavigationGroup,\n SideNavigationItem,\n Divider,\n} from \"@cloudoperators/juno-ui-components/index\"\nimport { isRouteInfo } from \"@/client/routes/routeInfo\"\nimport { Slot } from \"@/client/components/Slot\"\nimport type { NavSection } from \"./buildNavSections\"\n\ninterface SideNavBarProps {\n projectId: string\n projectName: string\n domainName?: string\n sections: NavSection[]\n}\n\nexport const SideNavBar = ({ projectId, projectName, domainName, sections }: SideNavBarProps) => {\n const navigate = useNavigate()\n const matches = useMatches()\n const { provider } = useParams({ strict: false }) as { provider?: string }\n const { slots } = useRouteContext({ strict: false })\n\n const navBadge = (service: string) => {\n if (!slots?.serviceBadge) return null\n return <Slot component={slots.serviceBadge} useShadowDOM={false} currentService={service} />\n }\n\n // Read active section/service from the deepest match that has valid RouteInfo staticData\n const activeMatch = [...matches].reverse().find((m) => isRouteInfo(m.staticData))\n const activeRouteInfo = activeMatch && isRouteInfo(activeMatch.staticData) ? activeMatch.staticData : undefined\n const activeSection = activeRouteInfo?.section ?? null\n const activeService = activeRouteInfo?.service ?? null\n\n // Track which sections should be forced open by incrementing a counter\n // This forces a remount of SideNavigationGroup since it doesn't expose onToggle\n const [forceOpenCounter, setForceOpenCounter] = useState<Record<string, number>>(() =>\n Object.fromEntries(sections.map((s) => [s.section, 0]))\n )\n\n // When navigating to a section, force it to expand by remounting\n useEffect(() => {\n if (activeSection) {\n setForceOpenCounter((prev) => ({ ...prev, [activeSection]: (prev[activeSection] || 0) + 1 }))\n }\n }, [activeSection])\n\n return (\n <SideNavigation ariaLabel=\"Project Side Navigation\">\n <>\n <SideNavigationList>\n <>\n <SideNavigationItem\n onClick={() => navigate({ to: \"/projects/$projectId\", params: { projectId } })}\n label={\n <>\n {domainName && <p className=\"text-theme-light text-xs leading-4 font-bold\">{domainName} /</p>}\n <p className=\"leading-5 font-normal\">{projectName}</p>\n </>\n }\n />\n <Divider spacing=\"1\" />\n {sections.map(({ section, label, services }) => (\n <SideNavigationGroup key={`${section}-${forceOpenCounter[section]}`} label={label} open={true}>\n {services.map((item) => {\n const isStorageContainers = activeSection === \"storage\" && activeService === \"containers\"\n const isSelected =\n activeSection === section &&\n (isStorageContainers ? item.params.provider === provider : activeService === item.service)\n\n return (\n <SideNavigationItem\n key={item.service}\n onClick={() => item.navigate(navigate)}\n label={\n <span className=\"flex items-start gap-2\">\n {item.label}\n {navBadge(item.service)}\n </span>\n }\n selected={isSelected}\n />\n )\n })}\n </SideNavigationGroup>\n ))}\n </>\n </SideNavigationList>\n {slots?.sideNavBanner && <Slot component={slots.sideNavBanner} />}\n </>\n </SideNavigation>\n )\n}\n","import { getServiceIndex } from \"@/server/Authentication/helpers\"\nimport { t } from \"@lingui/core/macro\"\nimport type { NavigateFn } from \"@tanstack/react-router\"\nimport type { AdditionalProjectService } from \"@/client/AuroraApp\"\n\nexport type NavItem = {\n service: string\n label: string\n navigate: (navigateFn: NavigateFn) => void\n params: Record<string, string>\n}\n\nexport type NavSection = {\n section: string\n label: string\n services: NavItem[]\n}\n\nexport function buildNavSections(\n projectId: string,\n availableServices: { type: string; name: string }[],\n enabledServices?: string[],\n additionalProjectServices?: AdditionalProjectService[]\n): NavSection[] {\n const serviceIndex = getServiceIndex(availableServices)\n const isEnabled = (service: string) => !enabledServices || enabledServices.includes(service)\n\n const computeServices: NavItem[] = [\n ...(serviceIndex[\"image\"]?.[\"glance\"] && isEnabled(\"images\")\n ? [\n {\n service: \"images\",\n label: t`Images`,\n navigate: (nav: NavigateFn) => nav({ to: \"/projects/$projectId/compute/images\", params: { projectId } }),\n params: { projectId },\n },\n ]\n : []),\n ...(serviceIndex?.[\"compute\"]?.[\"nova\"] && isEnabled(\"flavors\")\n ? [\n {\n service: \"flavors\",\n label: t`Flavors`,\n navigate: (nav: NavigateFn) => nav({ to: \"/projects/$projectId/compute/flavors\", params: { projectId } }),\n params: { projectId },\n },\n ]\n : []),\n ]\n\n const networkServices: NavItem[] = serviceIndex[\"network\"]\n ? [\n ...(isEnabled(\"securitygroups\")\n ? [\n {\n service: \"securitygroups\",\n label: t`Security Groups`,\n navigate: (nav: NavigateFn) =>\n nav({ to: \"/projects/$projectId/network/securitygroups\", params: { projectId } }),\n params: { projectId },\n },\n ]\n : []),\n ...(isEnabled(\"floatingips\")\n ? [\n {\n service: \"floatingips\",\n label: t`Floating IPs`,\n navigate: (nav: NavigateFn) =>\n nav({ to: \"/projects/$projectId/network/floatingips\", params: { projectId } }),\n params: { projectId },\n },\n ]\n : []),\n ]\n : []\n\n const storageServices: NavItem[] = [\n ...(serviceIndex?.[\"object-store\"]?.[\"swift\"] && isEnabled(\"containers\")\n ? [\n {\n service: \"containers\",\n label: t`Object Storage (Swift)`,\n navigate: (nav: NavigateFn) =>\n nav({\n to: \"/projects/$projectId/storage/$provider/$storageType\",\n params: { projectId, provider: \"swift\", storageType: \"containers\" },\n }),\n params: { projectId, provider: \"swift\", storageType: \"containers\" },\n },\n ]\n : []),\n ...(serviceIndex?.[\"object-store-ceph\"]?.[\"ceph\"] && isEnabled(\"ceph-containers\")\n ? [\n {\n service: \"ceph-containers\",\n label: t`Object Storage (Ceph)`,\n navigate: (nav: NavigateFn) =>\n nav({\n to: \"/projects/$projectId/storage/$provider/$storageType\",\n params: { projectId, provider: \"ceph\", storageType: \"buckets\" },\n }),\n params: { projectId, provider: \"ceph\", storageType: \"buckets\" },\n },\n ]\n : []),\n ]\n\n // Seed the section map with built-in sections\n const sectionMap = new Map<string, NavSection>([\n [\"compute\", { section: \"compute\", label: t`Compute`, services: computeServices }],\n [\"network\", { section: \"network\", label: t`Network`, services: networkServices }],\n [\"storage\", { section: \"storage\", label: t`Storage`, services: storageServices }],\n [\"services\", { section: \"services\", label: t`Services`, services: [] }],\n ])\n\n // Merge additional services: activate when the service exists in the project's catalog\n for (const module of additionalProjectServices ?? []) {\n if (!serviceIndex[module.serviceType]?.[module.serviceName]) continue\n if (enabledServices && !enabledServices.includes(module.serviceType)) continue\n\n sectionMap.get(\"services\")?.services.push({\n service: module.serviceType,\n label: module.label,\n navigate: (nav: NavigateFn) => nav({ to: module.routes.fullPath as never, params: { projectId } as never }),\n params: { projectId },\n })\n }\n\n return [...sectionMap.values()].filter((s) => s.services.length > 0)\n}\n","import { Breadcrumb, BreadcrumbItem, KnownIcons } from \"@cloudoperators/juno-ui-components\"\nimport { useMatches, useNavigate, useParams } from \"@tanstack/react-router\"\nimport { useMemo } from \"react\"\nimport { useLingui } from \"@lingui/react/macro\"\nimport { isRouteInfo, CrumbLabelKey } from \"@/client/routes/routeInfo\"\n\ninterface ProjectInfoBoxProps {\n projectInfo: {\n id: string\n name: string\n description?: string\n domain?: {\n name?: string\n }\n }\n}\n\nexport function ProjectInfoBox({ projectInfo }: ProjectInfoBoxProps) {\n const { t } = useLingui()\n const navigate = useNavigate()\n const matches = useMatches()\n const { projectId } = useParams({ strict: false }) as { projectId: string }\n\n const breadcrumbs = useMemo(() => {\n const crumbLabels: Record<CrumbLabelKey, string> = {\n Compute: t`Compute`,\n Network: t`Network`,\n Storage: t`Storage`,\n Services: t`Services`,\n Images: t`Images`,\n Flavors: t`Flavors`,\n \"Security Groups\": t`Security Groups`,\n \"Floating IPs\": t`Floating IPs`,\n }\n\n const resolveProviderLabel = (provider: string | undefined) => {\n if (provider === \"swift\") return t`Object Storage (Swift)`\n if (provider === \"ceph\") return t`Object Storage (Ceph)`\n return t`Storage`\n }\n\n const items: Array<{ label?: string; icon?: KnownIcons; onClick?: () => void; active?: boolean }> = []\n\n items.push({ icon: \"home\", label: t`Home`, onClick: () => navigate({ to: \"/projects\" }) })\n\n const projectMatches = matches.filter(\n (m) => m.routeId !== \"/_auth/projects/$projectId\" && m.routeId.startsWith(\"/_auth/projects/$projectId\")\n )\n const deepest = projectMatches[projectMatches.length - 1]\n\n const info = deepest ? (isRouteInfo(deepest.staticData) ? deepest.staticData : undefined) : undefined\n\n const combinedLabel = projectInfo.domain?.name ? `${projectInfo.domain.name}/${projectInfo.name}` : projectInfo.name\n\n if (!deepest || !info) {\n items.push({ label: combinedLabel, active: true })\n return items\n }\n\n items.push({\n label: combinedLabel,\n onClick: () => navigate({ to: \"/projects/$projectId\", params: { projectId } }),\n })\n\n const params = deepest.params as Record<string, string>\n\n if (info.sectionCrumb?.to) {\n const { labelKey, label: rawLabel, to } = info.sectionCrumb\n const label = labelKey ? crumbLabels[labelKey] : rawLabel\n items.push({ label, onClick: () => navigate({ to: to as never, params: params as never }) })\n }\n\n if (info.crumb) {\n const { labelKey, label, to, useParamAsLabel } = info.crumb\n const resolvedLabel = useParamAsLabel\n ? resolveProviderLabel(params[useParamAsLabel])\n : labelKey\n ? crumbLabels[labelKey]\n : label\n\n if (info.isDetail) {\n items.push({ label: resolvedLabel, onClick: () => navigate({ to: to as never, params: params as never }) })\n\n if (info.intermediateCrumb) {\n const { to: iTo, useParamAsLabel: iParam, useParentTitleAsLabel } = info.intermediateCrumb\n const parentMatch = projectMatches[projectMatches.length - 2]\n const parentTitle = parentMatch?.meta?.find((m) => m != null && \"title\" in m)?.title as string | undefined\n const iLabel = useParentTitleAsLabel\n ? (parentTitle ?? (iParam ? params[iParam] : undefined))\n : iParam\n ? params[iParam]\n : undefined\n items.push(\n iTo\n ? { label: iLabel, onClick: () => navigate({ to: iTo as never, params: params as never }) }\n : { label: iLabel }\n )\n }\n\n const title = deepest.meta?.find((m) => m != null && \"title\" in m)?.title as string | undefined\n if (title) items.push({ label: title, active: true })\n } else {\n items.push(\n to\n ? { label: resolvedLabel, onClick: () => navigate({ to: to as never, params: params as never }) }\n : { label: resolvedLabel, active: true }\n )\n }\n }\n\n return items\n }, [matches, projectInfo, projectId, navigate, t])\n\n return (\n <Breadcrumb className=\"relative z-1 mt-8 mb-4\">\n {breadcrumbs.map((item, index) => (\n <BreadcrumbItem key={index} label={item.label} icon={item.icon} onClick={item.onClick} active={item.active} />\n ))}\n </Breadcrumb>\n )\n}\n","import { createFileRoute, Outlet, useLoaderData, useRouteContext, useRouter } from \"@tanstack/react-router\"\nimport { AppShell, Container, Stack } from \"@cloudoperators/juno-ui-components\"\nimport { SideNavBar } from \"@/client/routes/_auth/projects/-components/SideNavBar\"\nimport { buildNavSections } from \"@/client/routes/_auth/projects/-components/buildNavSections\"\nimport { ProjectInfoBox } from \"@/client/components/ProjectView/ProjectInfoBox\"\nimport { RouteError } from \"@/client/components/Error/RouteError\"\nimport { useMemo } from \"react\"\nimport { TRPCClientError } from \"@trpc/client\"\nimport { resolveProjectScope } from \"./-components/resolveProjectScope\"\nimport { StatusError } from \"@/client/components/Error/StatusError\"\nimport { useLingui } from \"@lingui/react/macro\"\n\nexport const Route = createFileRoute(\"/_auth/projects/$projectId\")({\n component: RouteComponent,\n errorComponent: ProjectErrorComponent,\n loader: async (options) => {\n const { context, params } = options\n\n let scopeData\n\n try {\n scopeData = await context.trpcClient?.auth.setCurrentScope.mutate({\n type: \"project\",\n projectId: params.projectId || \"\",\n })\n } catch (error) {\n if (error instanceof TRPCClientError && error.data?.code === \"NOT_FOUND\") {\n scopeData = undefined\n } else {\n throw error\n }\n }\n\n const [availableServices, project] = await Promise.all([\n context.trpcClient?.auth.getAvailableServices.query(),\n context.trpcClient?.project.getProject.query({ projectId: params.projectId }).catch(() => null),\n ])\n\n const projectScopeStatus = resolveProjectScope({\n projectId: params.projectId,\n scopeProject: scopeData?.project,\n userProject: project,\n })\n\n if (projectScopeStatus === \"scope_failed\") {\n throw new Error(\"Failed to scope session to project\")\n }\n\n if (projectScopeStatus === \"not_found\") {\n const error = new Error(\"Project not found\") as Error & { statusCode?: number }\n error.statusCode = 404\n throw error\n }\n\n const accountId = scopeData?.domain?.id || \"\"\n const description = project?.description ?? null\n\n return {\n trpcClient: context.trpcClient,\n crumbDomain: { path: `/projects`, name: scopeData?.domain?.name },\n crumbProject: scopeData?.project,\n availableServices,\n accountId,\n projectId: params.projectId,\n description,\n }\n },\n})\n\nfunction RouteComponent() {\n const { availableServices, projectId, crumbProject, crumbDomain } = useLoaderData({\n from: Route.id,\n })\n const { enabledServices, additionalProjectServices } = useRouteContext({ strict: false })\n\n const sections = useMemo(\n () => buildNavSections(projectId, availableServices!, enabledServices, additionalProjectServices),\n [projectId, availableServices, enabledServices, additionalProjectServices]\n )\n\n return (\n <AppShell\n embedded\n sideNavigation={\n <SideNavBar\n sections={sections}\n projectId={projectId}\n projectName={crumbProject?.name || projectId}\n domainName={crumbDomain?.name}\n />\n }\n className=\"h-min-screen\"\n >\n <Container>\n <Stack direction=\"vertical\" distribution=\"start\" alignment=\"stretch\" className=\"xl:flex-row\" gap=\"6\">\n {/* Main content area */}\n <div className=\"min-w-0 flex-1\">\n <ProjectInfoBox\n projectInfo={{\n id: projectId,\n name: crumbProject?.name || projectId,\n domain: crumbProject?.domain,\n }}\n />\n <Outlet />\n </div>\n </Stack>\n </Container>\n </AppShell>\n )\n}\n\nfunction ProjectErrorComponent({ error }: { error: Error & { statusCode?: number } }) {\n const { t } = useLingui()\n const navigate = Route.useNavigate()\n const router = useRouter()\n\n // Handle 404 errors with a custom UI\n if (error.statusCode === 404 || error.message === \"Project not found\") {\n return (\n <StatusError\n statusCode={404}\n title={t`Project Not Found`}\n message={t`The project you are looking for doesn't exist or you don't have access to it.`}\n onHomeClick={() => {\n navigate({ to: \"/projects\" })\n }}\n onBackClick={() => {\n router.history.back()\n }}\n />\n )\n }\n\n // For all other errors, use the default RouteError component\n return <RouteError error={error} safeErrorMessage={error instanceof TRPCClientError ? error.message : undefined} />\n}\n"],"mappings":";;;;;;;;;;;AAoBA,IAAaa,KAAc,EAAEC,cAAWC,gBAAaC,eAAYC,kBAA2B;CAC1F,IAAMC,IAAWlB,EAAAA,GACXmB,IAAUlB,EAAAA,GACV,EAAEmB,gBAAalB,EAAU,EAAEmB,QAAQ,GAAM,CAAA,GACzC,EAAEC,aAAUnB,EAAgB,EAAEkB,QAAQ,GAAM,CAAA,GAE5CE,KAAYC,MACXF,GAAOG,eACL,gBAACb,GAAAA;EAAKc,WAAWJ,EAAMG;EAAcE,cAAc;EAAOC,gBAAgBJ;MADhD,MAK7BK,IAAc,CAAIV,GAAAA,CAAQ,CAAA,CAACW,QAAO,CAAA,CAAGC,MAAMC,MAAMrB,EAAYqB,EAAEC,UAAU,CAAA,GACzEC,IAAkBL,KAAelB,EAAYkB,EAAYI,UAAU,IAAIJ,EAAYI,aAAaE,KAAAA,GAChGC,IAAgBF,GAAiBG,WAAW,MAC5CC,IAAgBJ,GAAiBV,WAAW,MAI5C,CAACe,GAAkBC,KAAuBpC,QAC9CqC,OAAOC,YAAYzB,EAAS0B,KAAKC,MAAM,CAACA,EAAEP,SAAS,CAAE,CAAA,CAAA,CAAA;CAUvD,OANAhC,QAAU;EACR,AAAI+B,KACFI,GAAqBK,OAAU;GAAE,GAAGA;IAAOT,KAAiBS,EAAKT,MAAkB,KAAK;EAAE,EAAA;CAE9F,GAAG,CAACA,CAAc,CAAA,GAGhB,gBAAC9B,GAAAA;EAAewC,WAAU;EACxB,UAAA,gBAAA,GAAA,EAAA,UAAA,CACE,gBAACvC,GAAAA,EACC,UAAA,gBAAA,GAAA,EAAA,UAAA;GACE,gBAACE,GAAAA;IACCsC,eAAe7B,EAAS;KAA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AA,gBAAC,GAAA,EACC,UAAA,gBAAC,GAAA;GAAM,WAAU;GAAW,cAAa;GAAQ,WAAU;GAAU,WAAU;GAAc,KAAI;GAE/F,UAAA,gBAAC,OAAA;IAAI,WAAU;IACb,UAAA,CAAA,gBAAC,GAAA,EACC,aAAa;KACXL,IAAIJ;KACJS,MAAMR,GAAcQ,QAAQT;KAC5BU,QAAQT,GAAcS;IACxB,EAAA,CAAA,GAEF,gBAAC,GAAA,CAAA,CAAA,CAAA;;;;AAMb"}
|
|
@@ -2,8 +2,8 @@ import { createFileRoute as e, lazyRouteComponent as t } from "@tanstack/react-r
|
|
|
2
2
|
import { TRPCClientError as n } from "@trpc/client";
|
|
3
3
|
//#region src/client/routes/_auth/projects/-components/resolveProjectScope.ts
|
|
4
4
|
var r = (e) => e.scopeProject?.id === e.projectId ? "valid" : e.userProject == null || e.userProject.id === e.projectId ? "scope_failed" : "not_found", i = e("/_auth/projects/$projectId")({
|
|
5
|
-
component: t(() => import("./_projectId-
|
|
6
|
-
errorComponent: t(() => import("./_projectId-
|
|
5
|
+
component: t(() => import("./_projectId-NYk1IN_a.mjs"), "component"),
|
|
6
|
+
errorComponent: t(() => import("./_projectId-BmtCuzJu.mjs"), "errorComponent"),
|
|
7
7
|
loader: async (e) => {
|
|
8
8
|
let { context: t, params: i } = e, a;
|
|
9
9
|
try {
|
|
@@ -43,4 +43,4 @@ var r = (e) => e.scopeProject?.id === e.projectId ? "valid" : e.userProject == n
|
|
|
43
43
|
//#endregion
|
|
44
44
|
export { i as t };
|
|
45
45
|
|
|
46
|
-
//# sourceMappingURL=_projectId-
|
|
46
|
+
//# sourceMappingURL=_projectId-QueiFczy.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_projectId-
|
|
1
|
+
{"version":3,"file":"_projectId-QueiFczy.mjs","names":["resolveProjectScope","input","scopeProject","id","projectId","userProject","createFileRoute","TRPCClientError","resolveProjectScope","Route","component","lazyRouteComponent","$$splitComponentImporter","errorComponent","$$splitErrorComponentImporter","loader","options","context","params","scopeData","trpcClient","auth","setCurrentScope","mutate","type","projectId","error","data","code","undefined","availableServices","project","Promise","all","getAvailableServices","query","getProject","catch","projectScopeStatus","scopeProject","userProject","Error","statusCode","accountId","domain","id","description","crumbDomain","path","name","crumbProject"],"sources":["../../src/client/routes/_auth/projects/-components/resolveProjectScope.ts","../../src/client/routes/_auth/projects/$projectId.tsx"],"sourcesContent":["export type ProjectScopeStatus = \"valid\" | \"not_found\" | \"scope_failed\"\n\n/**\n * Determines the status of a project scope operation by comparing the requested project\n * against the successfully scoped project and the user's available projects.\n *\n * @param input - The scope resolution input\n * @param input.projectId - The project ID that was requested to be scoped\n * @param input.scopeProject - The project object returned from the scope operation (null/undefined if scope failed)\n * @param input.userProject - The project fetched by ID (null/undefined if not found or couldn't be fetched)\n *\n * @returns ProjectScopeStatus\n * - \"valid\": The scope operation succeeded and the scoped project matches the requested project ID\n * - \"not_found\": The project doesn't exist or the user doesn't have access to it (only when userProject was successfully fetched)\n * - \"scope_failed\": The project exists but the scope operation failed, OR we couldn't fetch the project record\n *\n * @example\n * // Successful scope\n * resolveProjectScope({\n * projectId: \"project-123\",\n * scopeProject: { id: \"project-123\" },\n * userProject: { id: \"project-123\" }\n * }) // returns \"valid\"\n *\n * @example\n * // Project not found (when we successfully fetched the project record)\n * resolveProjectScope({\n * projectId: \"project-999\",\n * scopeProject: undefined,\n * userProject: { id: \"project-123\" }\n * }) // returns \"not_found\"\n *\n * @example\n * // Scope operation failed for an accessible project\n * resolveProjectScope({\n * projectId: \"project-123\",\n * scopeProject: undefined,\n * userProject: { id: \"project-123\" }\n * }) // returns \"scope_failed\"\n *\n * @example\n * // Can't verify project access (userProject fetch failed)\n * resolveProjectScope({\n * projectId: \"project-123\",\n * scopeProject: undefined,\n * userProject: null\n * }) // returns \"scope_failed\"\n */\nexport const resolveProjectScope = (input: {\n projectId: string\n scopeProject: { id?: string } | null | undefined\n userProject: { id: string } | null | undefined\n}): ProjectScopeStatus => {\n if (input.scopeProject?.id === input.projectId) {\n return \"valid\"\n }\n\n // If we couldn't fetch userProject at all, we can't verify the project's existence.\n // Treat this as a scope failure rather than \"not_found\" to avoid misleading 404 errors\n // when the real issue is a backend/network failure.\n if (input.userProject == null) {\n return \"scope_failed\"\n }\n\n return input.userProject.id === input.projectId ? \"scope_failed\" : \"not_found\"\n}\n","import { createFileRoute, Outlet, useLoaderData, useRouteContext, useRouter } from \"@tanstack/react-router\"\nimport { AppShell, Container, Stack } from \"@cloudoperators/juno-ui-components\"\nimport { SideNavBar } from \"@/client/routes/_auth/projects/-components/SideNavBar\"\nimport { buildNavSections } from \"@/client/routes/_auth/projects/-components/buildNavSections\"\nimport { ProjectInfoBox } from \"@/client/components/ProjectView/ProjectInfoBox\"\nimport { RouteError } from \"@/client/components/Error/RouteError\"\nimport { useMemo } from \"react\"\nimport { TRPCClientError } from \"@trpc/client\"\nimport { resolveProjectScope } from \"./-components/resolveProjectScope\"\nimport { StatusError } from \"@/client/components/Error/StatusError\"\nimport { useLingui } from \"@lingui/react/macro\"\n\nexport const Route = createFileRoute(\"/_auth/projects/$projectId\")({\n component: RouteComponent,\n errorComponent: ProjectErrorComponent,\n loader: async (options) => {\n const { context, params } = options\n\n let scopeData\n\n try {\n scopeData = await context.trpcClient?.auth.setCurrentScope.mutate({\n type: \"project\",\n projectId: params.projectId || \"\",\n })\n } catch (error) {\n if (error instanceof TRPCClientError && error.data?.code === \"NOT_FOUND\") {\n scopeData = undefined\n } else {\n throw error\n }\n }\n\n const [availableServices, project] = await Promise.all([\n context.trpcClient?.auth.getAvailableServices.query(),\n context.trpcClient?.project.getProject.query({ projectId: params.projectId }).catch(() => null),\n ])\n\n const projectScopeStatus = resolveProjectScope({\n projectId: params.projectId,\n scopeProject: scopeData?.project,\n userProject: project,\n })\n\n if (projectScopeStatus === \"scope_failed\") {\n throw new Error(\"Failed to scope session to project\")\n }\n\n if (projectScopeStatus === \"not_found\") {\n const error = new Error(\"Project not found\") as Error & { statusCode?: number }\n error.statusCode = 404\n throw error\n }\n\n const accountId = scopeData?.domain?.id || \"\"\n const description = project?.description ?? null\n\n return {\n trpcClient: context.trpcClient,\n crumbDomain: { path: `/projects`, name: scopeData?.domain?.name },\n crumbProject: scopeData?.project,\n availableServices,\n accountId,\n projectId: params.projectId,\n description,\n }\n },\n})\n\nfunction RouteComponent() {\n const { availableServices, projectId, crumbProject, crumbDomain } = useLoaderData({\n from: Route.id,\n })\n const { enabledServices, additionalProjectServices } = useRouteContext({ strict: false })\n\n const sections = useMemo(\n () => buildNavSections(projectId, availableServices!, enabledServices, additionalProjectServices),\n [projectId, availableServices, enabledServices, additionalProjectServices]\n )\n\n return (\n <AppShell\n embedded\n sideNavigation={\n <SideNavBar\n sections={sections}\n projectId={projectId}\n projectName={crumbProject?.name || projectId}\n domainName={crumbDomain?.name}\n />\n }\n className=\"h-min-screen\"\n >\n <Container>\n <Stack direction=\"vertical\" distribution=\"start\" alignment=\"stretch\" className=\"xl:flex-row\" gap=\"6\">\n {/* Main content area */}\n <div className=\"min-w-0 flex-1\">\n <ProjectInfoBox\n projectInfo={{\n id: projectId,\n name: crumbProject?.name || projectId,\n domain: crumbProject?.domain,\n }}\n />\n <Outlet />\n </div>\n </Stack>\n </Container>\n </AppShell>\n )\n}\n\nfunction ProjectErrorComponent({ error }: { error: Error & { statusCode?: number } }) {\n const { t } = useLingui()\n const navigate = Route.useNavigate()\n const router = useRouter()\n\n // Handle 404 errors with a custom UI\n if (error.statusCode === 404 || error.message === \"Project not found\") {\n return (\n <StatusError\n statusCode={404}\n title={t`Project Not Found`}\n message={t`The project you are looking for doesn't exist or you don't have access to it.`}\n onHomeClick={() => {\n navigate({ to: \"/projects\" })\n }}\n onBackClick={() => {\n router.history.back()\n }}\n />\n )\n }\n\n // For all other errors, use the default RouteError component\n return <RouteError error={error} safeErrorMessage={error instanceof TRPCClientError ? error.message : undefined} />\n}\n"],"mappings":";;;AAgDA,IAAaA,KAAuBC,MAK9BA,E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AAA"}
|
|
@@ -20,7 +20,7 @@ var i = t("/_auth/projects/$projectId/network/securitygroups/$securityGroupId/")
|
|
|
20
20
|
return { sgTitle: n?.name || n?.id || null };
|
|
21
21
|
},
|
|
22
22
|
head: ({ loaderData: e }) => ({ meta: [{ title: e?.sgTitle ?? "Security Group" }] }),
|
|
23
|
-
component: n(() => import("./_securityGroupId-
|
|
23
|
+
component: n(() => import("./_securityGroupId-pPtJsCoe.mjs"), "component"),
|
|
24
24
|
beforeLoad: async ({ context: t, params: n }) => {
|
|
25
25
|
let { trpcClient: i } = t, a = await i?.auth.getAvailableServices.query() || [], o = e(a);
|
|
26
26
|
if (!o.network || !o.network.neutron) throw r({
|
|
@@ -32,4 +32,4 @@ var i = t("/_auth/projects/$projectId/network/securitygroups/$securityGroupId/")
|
|
|
32
32
|
//#endregion
|
|
33
33
|
export { i as t };
|
|
34
34
|
|
|
35
|
-
//# sourceMappingURL=_securityGroupId-
|
|
35
|
+
//# sourceMappingURL=_securityGroupId-BcbkRhsN.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_securityGroupId-Mj8NJT2-.mjs","names":["createFileRoute","redirect","getServiceIndex","Route","staticData","section","service","analytics","name","isDetail","sectionCrumb","labelKey","crumb","to","RouteInfo","loader","context","params","sg","trpcClient","network","securityGroup","getById","query","project_id","projectId","securityGroupId","sgTitle","id","head","loaderData","meta","title","component","lazyRouteComponent","$$splitComponentImporter","beforeLoad","availableServices","auth","getAvailableServices","serviceIndex"],"sources":["../../src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/index.tsx"],"sourcesContent":["import {\n Breadcrumb,\n BreadcrumbItem,\n Button,\n ContentHeading,\n Stack,\n Spinner,\n} from \"@cloudoperators/juno-ui-components/index\"\nimport { createFileRoute, redirect, useNavigate } from \"@tanstack/react-router\"\nimport type { RouteInfo } from \"@/client/routes/routeInfo\"\nimport { Trans, useLingui } from \"@lingui/react/macro\"\nimport { useMemo } from \"react\"\nimport { getServiceIndex } from \"@/server/Authentication/helpers\"\nimport { useProjectId } from \"@/client/hooks\"\nimport { SecurityGroupDetailsView } from \"./-components/SecurityGroupDetailsView\"\nimport { EditSecurityGroupModal } from \"../-components/-modals/EditSecurityGroupModal\"\nimport { useSecurityGroupDetails } from \"./-hooks/useSecurityGroupDetails\"\nimport { useListWithFiltering } from \"@/client/utils/useListWithFiltering\"\nimport { trpcReact } from \"@/client/trpcClient\"\nimport { useSecurityGroupPermissions } from \"../-hooks/useSecurityGroupPermissions\"\n\nexport const Route = createFileRoute(\"/_auth/projects/$projectId/network/securitygroups/$securityGroupId/\")({\n staticData: {\n section: \"network\",\n service: \"securitygroups\",\n analytics: {\n name: \"network.securitygroups.detail\",\n },\n isDetail: true,\n sectionCrumb: { labelKey: \"Network\" },\n crumb: { labelKey: \"Security Groups\", to: \"/projects/$projectId/network/securitygroups\" },\n } satisfies RouteInfo,\n loader: async ({ context, params }) => {\n const sg = await context.trpcClient?.network.securityGroup.getById.query({\n project_id: params.projectId,\n securityGroupId: params.securityGroupId,\n })\n return { sgTitle: sg?.name || sg?.id || null }\n },\n head: ({ loaderData }) => ({\n meta: [{ title: loaderData?.sgTitle ?? \"Security Group\" }],\n }),\n component: RouteComponent,\n beforeLoad: async ({ context, params }) => {\n const { trpcClient } = context\n\n const availableServices = (await trpcClient?.auth.getAvailableServices.query()) || []\n\n const serviceIndex = getServiceIndex(availableServices)\n\n // Redirect to the \"Projects Overview\" page if network service not available\n if (!serviceIndex[\"network\"]) {\n throw redirect({\n to: \"/projects/$projectId/network/securitygroups\",\n params: { projectId: params.projectId },\n })\n }\n\n if (!serviceIndex[\"network\"][\"neutron\"]) {\n // Redirect to the \"Network Services Overview\" page if the \"Neutron\" service is not available\n throw redirect({\n to: \"/projects/$projectId/network/securitygroups\",\n params: { projectId: params.projectId },\n })\n }\n },\n})\n\nfunction RouteComponent() {\n const { securityGroupId } = Route.useParams()\n const { trpcClient } = Route.useRouteContext()\n const projectId = useProjectId()\n const navigate = useNavigate()\n const { t } = useLingui()\n\n if (!trpcClient) {\n throw new Error(\"trpcClient is not available in route context\")\n }\n\n const {\n permissions,\n isLoading: isLoadingPermissions,\n isError: isPermissionsError,\n } = useSecurityGroupPermissions(projectId)\n\n // Rules filtering using the same pattern as List page\n const {\n searchTerm: rulesSearchTerm,\n sortSettings,\n filterSettings,\n handleSearchChange,\n handleSortChange,\n handleFilterChange,\n } = useListWithFiltering<\"direction\" | \"protocol\" | \"description\">({\n defaultSortKey: \"direction\",\n defaultSortDir: \"asc\",\n sortOptions: [\n { label: t`Direction`, value: \"direction\" },\n { label: t`Protocol`, value: \"protocol\" },\n { label: t`Description`, value: \"description\" },\n ],\n filterSettings: {\n filters: [\n {\n displayName: t`Direction`,\n filterName: \"direction\",\n values: [\"ingress\", \"egress\"],\n supportsMultiValue: false,\n },\n {\n displayName: t`Ethertype`,\n filterName: \"ethertype\",\n values: [\"IPv4\", \"IPv6\"],\n supportsMultiValue: false,\n },\n {\n displayName: t`Protocol`,\n filterName: \"protocol\",\n values: [\"tcp\", \"udp\", \"icmp\", \"ipv6-icmp\"],\n supportsMultiValue: false,\n },\n ],\n },\n })\n\n // Group filter controls for the hook\n const filterControls = {\n searchTerm: rulesSearchTerm,\n onSearchChange: handleSearchChange,\n sortSettings,\n onSortChange: handleSortChange,\n filterSettings,\n onFilterChange: handleFilterChange,\n }\n\n // Use custom hook for logic (now includes filtering/sorting)\n const {\n securityGroup,\n filteredAndSortedRules,\n isLoading,\n isError,\n error,\n isUpdating,\n updateError,\n isDeletingRule,\n deleteRuleError,\n isCreatingRule,\n createRuleError,\n editModalOpen,\n handleEdit,\n handleCloseEditModal,\n handleUpdate,\n handleDeleteRule,\n handleCreateRule,\n } = useSecurityGroupDetails({\n securityGroupId,\n filterControls,\n })\n\n // Fetch available security groups for the Add Rule dropdown\n const { data: securityGroups } = trpcReact.network.securityGroup.list.useQuery({ project_id: projectId })\n const availableSecurityGroups = useMemo(() => {\n return (securityGroups || [])\n .filter((sg) => sg.id !== securityGroupId) // Exclude current group\n .map((sg) => ({\n id: sg.id,\n name: sg.name || sg.id,\n }))\n }, [securityGroups, securityGroupId])\n\n const handleBack = () => {\n navigate({\n to: \"/projects/$projectId/network/securitygroups\",\n params: { projectId },\n })\n }\n\n // Handle loading permissions\n if (isLoadingPermissions) {\n return (\n <Stack className=\"fixed inset-0\" distribution=\"center\" alignment=\"center\" direction=\"vertical\">\n <Spinner variant=\"primary\" size=\"large\" className=\"mb-2\" />\n <Trans>Loading Permissions...</Trans>\n </Stack>\n )\n }\n\n // Handle permissions error - default to no permissions\n const safePermissions = isPermissionsError\n ? {\n canView: false,\n canCreate: false,\n canUpdate: false,\n canDelete: false,\n canCreateRule: false,\n canDeleteRule: false,\n canManageAccess: false,\n canViewRBAC: false,\n }\n : permissions!\n\n // Handle loading state\n if (isLoading) {\n return (\n <Stack className=\"fixed inset-0\" distribution=\"center\" alignment=\"center\" direction=\"vertical\">\n <Spinner variant=\"primary\" size=\"large\" className=\"mb-2\" />\n <Trans>Loading Security Group Details...</Trans>\n </Stack>\n )\n }\n\n // Handle error state\n if (isError) {\n const errorMessage = error?.message || \"Unknown error\"\n\n return (\n <Stack className=\"fixed inset-0\" distribution=\"center\" alignment=\"center\" direction=\"vertical\" gap=\"5\">\n <p className=\"text-theme-error font-semibold\">\n <Trans>Error loading security group</Trans>\n </p>\n <p className=\"text-theme-highest\">{errorMessage}</p>\n <Button onClick={handleBack} variant=\"primary\">\n <Trans>Back to Security Groups</Trans>\n </Button>\n </Stack>\n )\n }\n\n // Handle no data state\n if (!securityGroup) {\n return (\n <Stack className=\"fixed inset-0\" distribution=\"center\" alignment=\"center\" direction=\"vertical\" gap=\"5\">\n <p className=\"text-theme-secondary\">\n <Trans>Security group not found</Trans>\n </p>\n <Button onClick={handleBack} variant=\"primary\">\n <Trans>Back to Security Groups</Trans>\n </Button>\n </Stack>\n )\n }\n\n // Render success state\n return (\n <Stack direction=\"vertical\">\n <ContentHeading>{securityGroup.name || securityGroup.id}</ContentHeading>\n <Breadcrumb className=\"my-6\">\n <BreadcrumbItem onClick={handleBack} label={t`Security Groups`} />\n <BreadcrumbItem active label={securityGroup.id} />\n </Breadcrumb>\n\n <SecurityGroupDetailsView\n securityGroup={securityGroup}\n filteredAndSortedRules={filteredAndSortedRules}\n onEdit={handleEdit}\n onDeleteRule={handleDeleteRule}\n isDeletingRule={isDeletingRule}\n deleteRuleError={deleteRuleError}\n filterControls={filterControls}\n onCreateRule={handleCreateRule}\n isCreatingRule={isCreatingRule}\n createRuleError={createRuleError}\n availableSecurityGroups={availableSecurityGroups}\n currentProjectId={projectId}\n permissions={safePermissions}\n />\n\n <EditSecurityGroupModal\n securityGroup={securityGroup}\n open={editModalOpen}\n onClose={handleCloseEditModal}\n onUpdate={handleUpdate}\n isLoading={isUpdating}\n error={updateError}\n />\n </Stack>\n )\n}\n"],"mappings":";;AAqBA,IAAaG,IAAQH,EAAgB,qEAAA,CAAA,CAAuE;CAC1GI,YAAY;EACVC,SAAS;EACTC,SAAS;EACTC,WAAW,EACTC,MAAM,gCACR;EACAC,UAAU;EACVC,cAAc,EAAEC,UAAU,UAAU;EACpCC,OAAO;GAAED,UAAU;GAAmBE,IAAI;EAA8C;CAC1F;CACAE,QAAQ,OAAO,EAAEC,YAASC,gBAAQ;EAChC,IAAMC,IAAK,MAAMF,EAAQG,YAAYC,QAAQC,cAAcC,QAAQC,MAAM;GACvEC,YAAYP,EAAOQ;GACnBC,iBAAiBT,EAAOS;EAC1B,CAAA;EACA,OAAO,EAAEC,SAAST,GAAIV,QAAQU,GAAIU,MAAM,KAAK;CAC/C;CACAC,OAAO,EAAEC,qBAAkB,EACzBC,MAAM,CAAC,EAAEC,OAAOF,GAAYH,WAAW,iBAAiB,CAAC,EAC3D;CACAM,WAASC,mDAAA,WAAA;CACTE,YAAY,OAAO,EAAEpB,YAASC,gBAAQ;EACpC,IAAM,EAAEE,kBAAeH,GAEjBqB,IAAoB,MAAOlB,GAAYmB,KAAKC,qBAAqBhB,MAAAA,KAAY,CAAA,GAE7EiB,IAAetC,EAAgBmC,CAAAA;EAUrC,IAPI,CAACG,EAAa,WAOd,CAACA,EAAa,QAAW,SAE3B,MAAMvC,EAAS;GACbY,IAAI;GACJI,QAAQ,EAAEQ,WAAWR,EAAOQ,UAAU;EACxC,CAAA;CAEJ;AACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"_securityGroupId-BcbkRhsN.mjs","names":["createFileRoute","redirect","getServiceIndex","Route","staticData","section","service","analytics","name","isDetail","sectionCrumb","labelKey","crumb","to","RouteInfo","loader","context","params","sg","trpcClient","network","securityGroup","getById","query","project_id","projectId","securityGroupId","sgTitle","id","head","loaderData","meta","title","component","lazyRouteComponent","$$splitComponentImporter","beforeLoad","availableServices","auth","getAvailableServices","serviceIndex"],"sources":["../../src/client/routes/_auth/projects/$projectId/network/securitygroups/$securityGroupId/index.tsx"],"sourcesContent":["import {\n Breadcrumb,\n BreadcrumbItem,\n Button,\n ContentHeading,\n Stack,\n Spinner,\n} from \"@cloudoperators/juno-ui-components/index\"\nimport { createFileRoute, redirect, useNavigate } from \"@tanstack/react-router\"\nimport type { RouteInfo } from \"@/client/routes/routeInfo\"\nimport { Trans, useLingui } from \"@lingui/react/macro\"\nimport { useMemo } from \"react\"\nimport { getServiceIndex } from \"@/server/Authentication/helpers\"\nimport { useProjectId } from \"@/client/hooks\"\nimport { SecurityGroupDetailsView } from \"./-components/SecurityGroupDetailsView\"\nimport { EditSecurityGroupModal } from \"../-components/-modals/EditSecurityGroupModal\"\nimport { useSecurityGroupDetails } from \"./-hooks/useSecurityGroupDetails\"\nimport { useListWithFiltering } from \"@/client/utils/useListWithFiltering\"\nimport { trpcReact } from \"@/client/trpcClient\"\nimport { useSecurityGroupPermissions } from \"../-hooks/useSecurityGroupPermissions\"\n\nexport const Route = createFileRoute(\"/_auth/projects/$projectId/network/securitygroups/$securityGroupId/\")({\n staticData: {\n section: \"network\",\n service: \"securitygroups\",\n analytics: {\n name: \"network.securitygroups.detail\",\n },\n isDetail: true,\n sectionCrumb: { labelKey: \"Network\" },\n crumb: { labelKey: \"Security Groups\", to: \"/projects/$projectId/network/securitygroups\" },\n } satisfies RouteInfo,\n loader: async ({ context, params }) => {\n const sg = await context.trpcClient?.network.securityGroup.getById.query({\n project_id: params.projectId,\n securityGroupId: params.securityGroupId,\n })\n return { sgTitle: sg?.name || sg?.id || null }\n },\n head: ({ loaderData }) => ({\n meta: [{ title: loaderData?.sgTitle ?? \"Security Group\" }],\n }),\n component: RouteComponent,\n beforeLoad: async ({ context, params }) => {\n const { trpcClient } = context\n\n const availableServices = (await trpcClient?.auth.getAvailableServices.query()) || []\n\n const serviceIndex = getServiceIndex(availableServices)\n\n // Redirect to the \"Projects Overview\" page if network service not available\n if (!serviceIndex[\"network\"]) {\n throw redirect({\n to: \"/projects/$projectId/network/securitygroups\",\n params: { projectId: params.projectId },\n })\n }\n\n if (!serviceIndex[\"network\"][\"neutron\"]) {\n // Redirect to the \"Network Services Overview\" page if the \"Neutron\" service is not available\n throw redirect({\n to: \"/projects/$projectId/network/securitygroups\",\n params: { projectId: params.projectId },\n })\n }\n },\n})\n\nfunction RouteComponent() {\n const { securityGroupId } = Route.useParams()\n const { trpcClient } = Route.useRouteContext()\n const projectId = useProjectId()\n const navigate = useNavigate()\n const { t } = useLingui()\n\n if (!trpcClient) {\n throw new Error(\"trpcClient is not available in route context\")\n }\n\n const {\n permissions,\n isLoading: isLoadingPermissions,\n isError: isPermissionsError,\n } = useSecurityGroupPermissions(projectId)\n\n // Rules filtering using the same pattern as List page\n const {\n searchTerm: rulesSearchTerm,\n sortSettings,\n filterSettings,\n handleSearchChange,\n handleSortChange,\n handleFilterChange,\n } = useListWithFiltering<\"direction\" | \"protocol\" | \"description\">({\n defaultSortKey: \"direction\",\n defaultSortDir: \"asc\",\n sortOptions: [\n { label: t`Direction`, value: \"direction\" },\n { label: t`Protocol`, value: \"protocol\" },\n { label: t`Description`, value: \"description\" },\n ],\n filterSettings: {\n filters: [\n {\n displayName: t`Direction`,\n filterName: \"direction\",\n values: [\"ingress\", \"egress\"],\n supportsMultiValue: false,\n },\n {\n displayName: t`Ethertype`,\n filterName: \"ethertype\",\n values: [\"IPv4\", \"IPv6\"],\n supportsMultiValue: false,\n },\n {\n displayName: t`Protocol`,\n filterName: \"protocol\",\n values: [\"tcp\", \"udp\", \"icmp\", \"ipv6-icmp\"],\n supportsMultiValue: false,\n },\n ],\n },\n })\n\n // Group filter controls for the hook\n const filterControls = {\n searchTerm: rulesSearchTerm,\n onSearchChange: handleSearchChange,\n sortSettings,\n onSortChange: handleSortChange,\n filterSettings,\n onFilterChange: handleFilterChange,\n }\n\n // Use custom hook for logic (now includes filtering/sorting)\n const {\n securityGroup,\n filteredAndSortedRules,\n isLoading,\n isError,\n error,\n isUpdating,\n updateError,\n isDeletingRule,\n deleteRuleError,\n isCreatingRule,\n createRuleError,\n editModalOpen,\n handleEdit,\n handleCloseEditModal,\n handleUpdate,\n handleDeleteRule,\n handleCreateRule,\n } = useSecurityGroupDetails({\n securityGroupId,\n filterControls,\n })\n\n // Fetch available security groups for the Add Rule dropdown\n const { data: securityGroups } = trpcReact.network.securityGroup.list.useQuery({ project_id: projectId })\n const availableSecurityGroups = useMemo(() => {\n return (securityGroups || [])\n .filter((sg) => sg.id !== securityGroupId) // Exclude current group\n .map((sg) => ({\n id: sg.id,\n name: sg.name || sg.id,\n }))\n }, [securityGroups, securityGroupId])\n\n const handleBack = () => {\n navigate({\n to: \"/projects/$projectId/network/securitygroups\",\n params: { projectId },\n })\n }\n\n // Handle loading permissions\n if (isLoadingPermissions) {\n return (\n <Stack className=\"fixed inset-0\" distribution=\"center\" alignment=\"center\" direction=\"vertical\">\n <Spinner variant=\"primary\" size=\"large\" className=\"mb-2\" />\n <Trans>Loading Permissions...</Trans>\n </Stack>\n )\n }\n\n // Handle permissions error - default to no permissions\n const safePermissions = isPermissionsError\n ? {\n canView: false,\n canCreate: false,\n canUpdate: false,\n canDelete: false,\n canCreateRule: false,\n canDeleteRule: false,\n canManageAccess: false,\n canViewRBAC: false,\n }\n : permissions!\n\n // Handle loading state\n if (isLoading) {\n return (\n <Stack className=\"fixed inset-0\" distribution=\"center\" alignment=\"center\" direction=\"vertical\">\n <Spinner variant=\"primary\" size=\"large\" className=\"mb-2\" />\n <Trans>Loading Security Group Details...</Trans>\n </Stack>\n )\n }\n\n // Handle error state\n if (isError) {\n const errorMessage = error?.message || \"Unknown error\"\n\n return (\n <Stack className=\"fixed inset-0\" distribution=\"center\" alignment=\"center\" direction=\"vertical\" gap=\"5\">\n <p className=\"text-theme-error font-semibold\">\n <Trans>Error loading security group</Trans>\n </p>\n <p className=\"text-theme-highest\">{errorMessage}</p>\n <Button onClick={handleBack} variant=\"primary\">\n <Trans>Back to Security Groups</Trans>\n </Button>\n </Stack>\n )\n }\n\n // Handle no data state\n if (!securityGroup) {\n return (\n <Stack className=\"fixed inset-0\" distribution=\"center\" alignment=\"center\" direction=\"vertical\" gap=\"5\">\n <p className=\"text-theme-secondary\">\n <Trans>Security group not found</Trans>\n </p>\n <Button onClick={handleBack} variant=\"primary\">\n <Trans>Back to Security Groups</Trans>\n </Button>\n </Stack>\n )\n }\n\n // Render success state\n return (\n <Stack direction=\"vertical\">\n <ContentHeading>{securityGroup.name || securityGroup.id}</ContentHeading>\n <Breadcrumb className=\"my-6\">\n <BreadcrumbItem onClick={handleBack} label={t`Security Groups`} />\n <BreadcrumbItem active label={securityGroup.id} />\n </Breadcrumb>\n\n <SecurityGroupDetailsView\n securityGroup={securityGroup}\n filteredAndSortedRules={filteredAndSortedRules}\n onEdit={handleEdit}\n onDeleteRule={handleDeleteRule}\n isDeletingRule={isDeletingRule}\n deleteRuleError={deleteRuleError}\n filterControls={filterControls}\n onCreateRule={handleCreateRule}\n isCreatingRule={isCreatingRule}\n createRuleError={createRuleError}\n availableSecurityGroups={availableSecurityGroups}\n currentProjectId={projectId}\n permissions={safePermissions}\n />\n\n <EditSecurityGroupModal\n securityGroup={securityGroup}\n open={editModalOpen}\n onClose={handleCloseEditModal}\n onUpdate={handleUpdate}\n isLoading={isUpdating}\n error={updateError}\n />\n </Stack>\n )\n}\n"],"mappings":";;AAqBA,IAAaG,IAAQH,EAAgB,qEAAA,CAAA,CAAuE;CAC1GI,YAAY;EACVC,SAAS;EACTC,SAAS;EACTC,WAAW,EACTC,MAAM,gCACR;EACAC,UAAU;EACVC,cAAc,EAAEC,UAAU,UAAU;EACpCC,OAAO;GAAED,UAAU;GAAmBE,IAAI;EAA8C;CAC1F;CACAE,QAAQ,OAAO,EAAEC,YAASC,gBAAQ;EAChC,IAAMC,IAAK,MAAMF,EAAQG,YAAYC,QAAQC,cAAcC,QAAQC,MAAM;GACvEC,YAAYP,EAAOQ;GACnBC,iBAAiBT,EAAOS;EAC1B,CAAA;EACA,OAAO,EAAEC,SAAST,GAAIV,QAAQU,GAAIU,MAAM,KAAK;CAC/C;CACAC,OAAO,EAAEC,qBAAkB,EACzBC,MAAM,CAAC,EAAEC,OAAOF,GAAYH,WAAW,iBAAiB,CAAC,EAC3D;CACAM,WAASC,mDAAA,WAAA;CACTE,YAAY,OAAO,EAAEpB,YAASC,gBAAQ;EACpC,IAAM,EAAEE,kBAAeH,GAEjBqB,IAAoB,MAAOlB,GAAYmB,KAAKC,qBAAqBhB,MAAAA,KAAY,CAAA,GAE7EiB,IAAetC,EAAgBmC,CAAAA;EAUrC,IAPI,CAACG,EAAa,WAOd,CAACA,EAAa,QAAW,SAE3B,MAAMvC,EAAS;GACbY,IAAI;GACJI,QAAQ,EAAEQ,WAAWR,EAAOQ,UAAU;EACxC,CAAA;CAEJ;AACF,CAAA"}
|