@cobaltcore-dev/aurora 0.21.0 → 0.23.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/{AuthProvider-p1e1DuKU.mjs → AuthProvider-CQ6Yppoh.mjs} +2 -2
- package/dist/client/{AuthProvider-p1e1DuKU.mjs.map → AuthProvider-CQ6Yppoh.mjs.map} +1 -1
- package/dist/client/{BucketToastNotifications-BGd2wVmh.mjs → BucketToastNotifications-BhPi4WWw.mjs} +3 -3
- package/dist/client/{BucketToastNotifications-BGd2wVmh.mjs.map → BucketToastNotifications-BhPi4WWw.mjs.map} +1 -1
- package/dist/client/{ContentHeader-CIAzorGI.mjs → ContentHeader-9KZdhOoA.mjs} +4 -3
- package/dist/client/{ContentHeader-CIAzorGI.mjs.map → ContentHeader-9KZdhOoA.mjs.map} +1 -1
- package/dist/client/{DeleteFlavorModal-lFMExcq_.mjs → DeleteFlavorModal-Be2qZo4w.mjs} +2 -2
- package/dist/client/{DeleteFlavorModal-lFMExcq_.mjs.map → DeleteFlavorModal-Be2qZo4w.mjs.map} +1 -1
- package/dist/client/{DeletePcaModal-Dg9dej-H.mjs → DeletePcaModal-CIFsGWyj.mjs} +4 -4
- package/dist/client/{DeletePcaModal-Dg9dej-H.mjs.map → DeletePcaModal-CIFsGWyj.mjs.map} +1 -1
- package/dist/client/{DetailsInfo-DwCo9P1o.mjs → DetailsInfo-CHVD7d-W.mjs} +3 -3
- package/dist/client/{DetailsInfo-DwCo9P1o.mjs.map → DetailsInfo-CHVD7d-W.mjs.map} +1 -1
- package/dist/client/{FiltersInput-cOaaRpcQ.mjs → FiltersInput-DqT08Ib-.mjs} +2 -2
- package/dist/client/{FiltersInput-cOaaRpcQ.mjs.map → FiltersInput-DqT08Ib-.mjs.map} +1 -1
- package/dist/client/{FloatingIpActionModals-CDF8LVtX.mjs → FloatingIpActionModals-BcceUHcg.mjs} +4 -4
- package/dist/client/{FloatingIpActionModals-CDF8LVtX.mjs.map → FloatingIpActionModals-BcceUHcg.mjs.map} +1 -1
- package/dist/client/{ImageToastNotifications-Dzq6jNTm.mjs → ImageToastNotifications-BGyX2J6j.mjs} +5 -5
- package/dist/client/ImageToastNotifications-BGyX2J6j.mjs.map +1 -0
- package/dist/client/{RouteError-BmZRk_ss.mjs → RouteError-Rm08PcxN.mjs} +2 -2
- package/dist/client/{RouteError-BmZRk_ss.mjs.map → RouteError-Rm08PcxN.mjs.map} +1 -1
- package/dist/client/Slot-CWb612-_.mjs +28 -0
- package/dist/client/Slot-CWb612-_.mjs.map +1 -0
- package/dist/client/{SortInput-DjaEHvcO.mjs → SortInput-D_q_jDfe.mjs} +2 -2
- package/dist/client/{SortInput-DjaEHvcO.mjs.map → SortInput-D_q_jDfe.mjs.map} +1 -1
- package/dist/client/{StatusError-CLB026fg.mjs → StatusError-2ZU1gFpu.mjs} +2 -2
- package/dist/client/{StatusError-CLB026fg.mjs.map → StatusError-2ZU1gFpu.mjs.map} +1 -1
- package/dist/client/{_auth-Dut7CaMR.mjs → _auth-D5_QNUos.mjs} +2 -2
- package/dist/client/{_auth-Dut7CaMR.mjs.map → _auth-D5_QNUos.mjs.map} +1 -1
- package/dist/client/{_flavorId-Cu1nWwOq.mjs → _flavorId-BsmqS9hP.mjs} +7 -7
- package/dist/client/{_flavorId-Cu1nWwOq.mjs.map → _flavorId-BsmqS9hP.mjs.map} +1 -1
- package/dist/client/{_flavorId-BsIWL0XK.mjs → _flavorId-CFmkmg2Y.mjs} +2 -2
- package/dist/client/{_flavorId-BsIWL0XK.mjs.map → _flavorId-CFmkmg2Y.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-B_M3gyMA.mjs → _floatingIpId-Bb9ZEJ6b.mjs} +6 -6
- package/dist/client/{_floatingIpId-B_M3gyMA.mjs.map → _floatingIpId-Bb9ZEJ6b.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-8-UPUV8M.mjs → _floatingIpId-Dzh6_JCI.mjs} +2 -2
- package/dist/client/{_floatingIpId-8-UPUV8M.mjs.map → _floatingIpId-Dzh6_JCI.mjs.map} +1 -1
- package/dist/client/{_imageId-D1Z0xIco.mjs → _imageId-C3As7sHE.mjs} +5 -5
- package/dist/client/{_imageId-D1Z0xIco.mjs.map → _imageId-C3As7sHE.mjs.map} +1 -1
- package/dist/client/{_pcaId-BcwGho7g.mjs → _pcaId-n0q0aDb6.mjs} +6 -6
- package/dist/client/{_pcaId-BcwGho7g.mjs.map → _pcaId-n0q0aDb6.mjs.map} +1 -1
- package/dist/client/{_projectId-DJLjspKf.mjs → _projectId-BuBIFdgG.mjs} +25 -24
- package/dist/client/{_projectId-DJLjspKf.mjs.map → _projectId-BuBIFdgG.mjs.map} +1 -1
- package/dist/client/{_projectId-B4ScifQf.mjs → _projectId-CAQkJHZ4.mjs} +3 -3
- package/dist/client/{_projectId-B4ScifQf.mjs.map → _projectId-CAQkJHZ4.mjs.map} +1 -1
- package/dist/client/_projectId-D-b7paXE.mjs +29 -0
- package/dist/client/_projectId-D-b7paXE.mjs.map +1 -0
- package/dist/client/{_projectId-CYq4KZXB.mjs → _projectId-DNZsNxJw.mjs} +4 -4
- package/dist/client/{_projectId-CYq4KZXB.mjs.map → _projectId-DNZsNxJw.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-B5-gJe1u.mjs → _securityGroupId-DFdNKa2l.mjs} +641 -504
- package/dist/client/_securityGroupId-DFdNKa2l.mjs.map +1 -0
- package/dist/client/{_securityGroupId-fPJWtDPU.mjs → _securityGroupId-DRkY3Gt6.mjs} +2 -2
- package/dist/client/_securityGroupId-DRkY3Gt6.mjs.map +1 -0
- package/dist/client/{_storageType-BkhbKG_G.mjs → _storageType-BKfQcpgp.mjs} +2 -2
- package/dist/client/{_storageType-BkhbKG_G.mjs.map → _storageType-BKfQcpgp.mjs.map} +1 -1
- package/dist/client/{_storageType-ByLL106s.mjs → _storageType-sMj9NEJz.mjs} +7 -7
- package/dist/client/{_storageType-ByLL106s.mjs.map → _storageType-sMj9NEJz.mjs.map} +1 -1
- package/dist/client/{about-B4sGnxeW.mjs → about-C8tTrQaW.mjs} +2 -2
- package/dist/client/{about-B4sGnxeW.mjs.map → about-C8tTrQaW.mjs.map} +1 -1
- package/dist/client/assets/objectDownload.worker-BAc5Au4B.js.map +1 -0
- package/dist/client/{aurora-Dp_NPGe8.mjs → aurora-jyvXcI4T.mjs} +2 -2
- package/dist/client/{aurora-Dp_NPGe8.mjs.map → aurora-jyvXcI4T.mjs.map} +1 -1
- package/dist/client/{build-DgeVmENN.mjs → build-CRLQyqu2.mjs} +2616 -3346
- package/dist/client/{build-DgeVmENN.mjs.map → build-CRLQyqu2.mjs.map} +1 -1
- package/dist/client/{flavors-CT1bHP61.mjs → flavors-BfTXqmoD.mjs} +6 -6
- package/dist/client/{flavors-CT1bHP61.mjs.map → flavors-BfTXqmoD.mjs.map} +1 -1
- package/dist/client/{flavors-q1j-y3e-.mjs → flavors-Dy-2mRGv.mjs} +2 -2
- package/dist/client/{flavors-q1j-y3e-.mjs.map → flavors-Dy-2mRGv.mjs.map} +1 -1
- package/dist/client/floatingips-zhNK6Xxn.mjs +562 -0
- package/dist/client/floatingips-zhNK6Xxn.mjs.map +1 -0
- package/dist/client/{hooks-D0wGUhRF.mjs → hooks-Bw3sHHOg.mjs} +2 -2
- package/dist/client/{hooks-D0wGUhRF.mjs.map → hooks-Bw3sHHOg.mjs.map} +1 -1
- package/dist/client/{images-CPYewah0.mjs → images-DPKUXryV.mjs} +2 -2
- package/dist/client/{images-CPYewah0.mjs.map → images-DPKUXryV.mjs.map} +1 -1
- package/dist/client/{images-BklcxYWi.mjs → images-DhZnqUG_.mjs} +29 -29
- package/dist/client/images-DhZnqUG_.mjs.map +1 -0
- package/dist/client/images-NBf2bV43.mjs.map +1 -1
- package/dist/client/index.js +301 -309
- package/dist/client/index.js.map +1 -1
- package/dist/client/{objects-DvIxpzGI.mjs → objects-BG1saVLZ.mjs} +1153 -862
- package/dist/client/objects-BG1saVLZ.mjs.map +1 -0
- package/dist/client/{objects-CEBrL7k-.mjs → objects-Dahys529.mjs} +2 -2
- package/dist/client/{objects-CEBrL7k-.mjs.map → objects-Dahys529.mjs.map} +1 -1
- package/dist/client/{pca-Ddk0YfgK.mjs → pca-B60iWWfG.mjs} +7 -7
- package/dist/client/{pca-Ddk0YfgK.mjs.map → pca-B60iWWfG.mjs.map} +1 -1
- package/dist/client/{pca-BAuZA0K3.mjs → pca-D0kKxHp4.mjs} +2 -2
- package/dist/client/{pca-BAuZA0K3.mjs.map → pca-D0kKxHp4.mjs.map} +1 -1
- package/dist/client/projects-yiK0HGSA.mjs.map +1 -1
- package/dist/client/routeInfo-CdTRlSxv.mjs +32 -0
- package/dist/client/routeInfo-CdTRlSxv.mjs.map +1 -0
- package/dist/client/{routes-BzBTVAjK.mjs → routes-BOf-GDMM.mjs} +41 -34
- package/dist/client/routes-BOf-GDMM.mjs.map +1 -0
- package/dist/client/{routes-DsisKFfG.mjs → routes-CtfnI-aY.mjs} +2 -2
- package/dist/client/routes-CtfnI-aY.mjs.map +1 -0
- package/dist/client/securitygroups-B8aLyFK7.mjs +17 -0
- package/dist/client/securitygroups-B8aLyFK7.mjs.map +1 -0
- package/dist/client/securitygroups-DRhFle2O.mjs +589 -0
- package/dist/client/securitygroups-DRhFle2O.mjs.map +1 -0
- package/dist/client/trpcClient-Di56hpVv.mjs +71 -0
- package/dist/client/trpcClient-Di56hpVv.mjs.map +1 -0
- package/dist/client/trpcClient.d.ts +40 -4
- package/dist/client/useListWithFiltering-aPTUNRaW.mjs +32 -0
- package/dist/client/useListWithFiltering-aPTUNRaW.mjs.map +1 -0
- package/dist/client/useSecurityGroupPermissions-BPS1ibWq.mjs +161 -0
- package/dist/client/useSecurityGroupPermissions-BPS1ibWq.mjs.map +1 -0
- package/dist/server/index.d.ts +56 -53
- package/dist/server/index.js +297 -20
- package/package.json +15 -15
- package/dist/client/EditSecurityGroupModal-BGPXglju.mjs +0 -137
- package/dist/client/EditSecurityGroupModal-BGPXglju.mjs.map +0 -1
- package/dist/client/ImageToastNotifications-Dzq6jNTm.mjs.map +0 -1
- package/dist/client/_projectId-DxgPaiA7.mjs +0 -25
- package/dist/client/_projectId-DxgPaiA7.mjs.map +0 -1
- package/dist/client/_securityGroupId-B5-gJe1u.mjs.map +0 -1
- package/dist/client/_securityGroupId-fPJWtDPU.mjs.map +0 -1
- package/dist/client/buildFilterParams-DoZzMKX9.mjs +0 -15
- package/dist/client/buildFilterParams-DoZzMKX9.mjs.map +0 -1
- package/dist/client/floatingips-DC5OrR8h.mjs +0 -434
- package/dist/client/floatingips-DC5OrR8h.mjs.map +0 -1
- package/dist/client/images-B5ktfqg6.mjs +0 -8
- package/dist/client/images-B5ktfqg6.mjs.map +0 -1
- package/dist/client/images-BklcxYWi.mjs.map +0 -1
- package/dist/client/objects-DvIxpzGI.mjs.map +0 -1
- package/dist/client/projects-DvSiI5Vg.mjs +0 -12
- package/dist/client/projects-DvSiI5Vg.mjs.map +0 -1
- package/dist/client/routeInfo-Ct5r4Gen.mjs +0 -56
- package/dist/client/routeInfo-Ct5r4Gen.mjs.map +0 -1
- package/dist/client/routes-BzBTVAjK.mjs.map +0 -1
- package/dist/client/routes-DsisKFfG.mjs.map +0 -1
- package/dist/client/securitygroups-JMvcJLpb.mjs +0 -440
- package/dist/client/securitygroups-JMvcJLpb.mjs.map +0 -1
- package/dist/client/trpcClient-BxcNKnhv.mjs +0 -65
- package/dist/client/trpcClient-BxcNKnhv.mjs.map +0 -1
- package/dist/client/useListWithFiltering-BuhE81I6.mjs +0 -157
- package/dist/client/useListWithFiltering-BuhE81I6.mjs.map +0 -1
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./RouteError-BmZRk_ss.mjs";
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { TRPCClientError as n } from "@trpc/client";
|
|
4
|
-
//#region src/client/routes/_auth/projects/index.tsx?tsr-split=errorComponent
|
|
5
|
-
var r = ({ error: r }) => /*#__PURE__*/ t(e, {
|
|
6
|
-
error: r,
|
|
7
|
-
safeErrorMessage: r instanceof n ? r.message : void 0
|
|
8
|
-
});
|
|
9
|
-
//#endregion
|
|
10
|
-
export { r as errorComponent };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=projects-DvSiI5Vg.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projects-DvSiI5Vg.mjs","names":["RouteError","TRPCClientError","Route","ProjectsContentProps","search","SplitErrorComponent","error","message","undefined","errorComponent"],"sources":["../../src/client/routes/_auth/projects/index.tsx?tsr-split=errorComponent"],"sourcesContent":["import { Suspense } from \"react\"\nimport { ErrorBoundary } from \"react-error-boundary\"\nimport { createFileRoute, useRouteContext } from \"@tanstack/react-router\"\nimport { ProjectsOverviewNavBar } from \"@/client/routes/_auth/projects/-components/ProjectOverviewNavBar\"\nimport { ProjectCardView } from \"@/client/routes/_auth/projects/-components/ProjectCardView\"\nimport { RouteError } from \"@/client/components/Error/RouteError\"\nimport { TRPCClientError } from \"@trpc/client\"\nimport { Container, ContentHeading, Spinner, Stack } from \"@cloudoperators/juno-ui-components\"\nimport { Trans } from \"@lingui/react/macro\"\nimport { z } from \"zod\"\nimport { Slot } from \"@/client/components/Slot\"\nimport { trpcReact } from \"@/client/trpcClient\"\nimport type { RouteInfo } from \"@/client/routes/routeInfo\"\n\nconst searchSchema = z.object({\n search: z.string().optional(),\n})\n\nexport const Route = createFileRoute(\"/_auth/projects/\")({\n staticData: {\n analytics: {\n name: \"projects.list\",\n },\n } satisfies RouteInfo,\n component: ProjectsOverview,\n errorComponent: ({ error }) => (\n <RouteError error={error} safeErrorMessage={error instanceof TRPCClientError ? error.message : undefined} />\n ),\n notFoundComponent: () => {\n return <p>Projects not found</p>\n },\n validateSearch: searchSchema,\n})\n\ninterface ProjectsContentProps {\n search: string\n}\n\nfunction ProjectsContent({ search }: ProjectsContentProps) {\n const [allProjects] = trpcReact.project.getAuthProjects.useSuspenseQuery()\n\n const normalizedSearch = search.trim().toLowerCase()\n const projects =\n allProjects && normalizedSearch\n ? allProjects.filter(\n (project) =>\n project.name?.toLowerCase().includes(normalizedSearch) ||\n project.description?.toLowerCase().includes(normalizedSearch)\n )\n : allProjects\n\n return <ProjectCardView projects={projects} />\n}\n\nexport function ProjectsOverview() {\n const { search = \"\" } = Route.useSearch()\n const navigate = Route.useNavigate()\n const { slots } = useRouteContext({ strict: false })\n\n const handleSearch = (value: string) => {\n navigate({ search: (prev) => ({ ...prev, search: value || undefined }), replace: true })\n }\n\n return (\n <Container py>\n <ContentHeading className=\"pb-4\">\n <Trans>Projects</Trans>\n </ContentHeading>\n {slots?.projectsBanner && (\n <ErrorBoundary fallbackRender={() => null}>\n <Suspense fallback={null}>\n <Slot component={slots.projectsBanner} useShadowDOM={false} />\n </Suspense>\n </ErrorBoundary>\n )}\n <ProjectsOverviewNavBar searchTerm={search} onSearch={handleSearch} />\n <div className=\"pt-5\">\n <ErrorBoundary\n fallbackRender={({ error }) => (\n <RouteError error={error} safeErrorMessage={error instanceof TRPCClientError ? error.message : undefined} />\n )}\n >\n <Suspense\n fallback={\n <Stack distribution=\"center\" alignment=\"center\" direction=\"vertical\" className=\"py-12\">\n <Spinner variant=\"primary\" size=\"large\" />\n </Stack>\n }\n >\n <ProjectsContent search={search} />\n </Suspense>\n </ErrorBoundary>\n </div>\n </Container>\n )\n}\n"],"mappings":";;;;AAoCC,IAAAK,KAXkB,EAAEC,eACjB,gBAAC,GAAA;CAAkBA;CAAO,kBAAkBA,aAAiBL,IAAkBK,EAAMC,UAAUC,KAAAA"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect as t, useRef as n, useState as r } from "react";
|
|
3
|
-
import { createPortal as i } from "react-dom";
|
|
4
|
-
import { useRouteContext as a } from "@tanstack/react-router";
|
|
5
|
-
import { z as o } from "zod";
|
|
6
|
-
//#region src/client/components/Slot.tsx
|
|
7
|
-
function s({ children: a }) {
|
|
8
|
-
let o = n(null), [s, c] = r(null);
|
|
9
|
-
return t(() => {
|
|
10
|
-
o.current && c(o.current.shadowRoot ?? o.current.attachShadow({ mode: "open" }));
|
|
11
|
-
}, []), /*#__PURE__*/ e("div", {
|
|
12
|
-
ref: o,
|
|
13
|
-
style: { display: "contents" },
|
|
14
|
-
children: s && /*#__PURE__*/ i(a, s)
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function c({ component: t, useShadowDOM: n = !0, currentService: r }) {
|
|
18
|
-
let { trpcClient: i } = a({ strict: !1 });
|
|
19
|
-
if (!i) return null;
|
|
20
|
-
let o = /*#__PURE__*/ e(t, { auroraContext: {
|
|
21
|
-
client: i,
|
|
22
|
-
currentService: r
|
|
23
|
-
} });
|
|
24
|
-
return n ? /*#__PURE__*/ e(s, { children: o }) : o;
|
|
25
|
-
}
|
|
26
|
-
var l = o.object({
|
|
27
|
-
labelKey: o.enum([
|
|
28
|
-
"Compute",
|
|
29
|
-
"Network",
|
|
30
|
-
"Storage",
|
|
31
|
-
"Services",
|
|
32
|
-
"Images",
|
|
33
|
-
"Flavors",
|
|
34
|
-
"Security Groups",
|
|
35
|
-
"Floating IPs",
|
|
36
|
-
"PCA (Clavis)"
|
|
37
|
-
]).optional(),
|
|
38
|
-
to: o.string().optional(),
|
|
39
|
-
useParamAsLabel: o.string().optional(),
|
|
40
|
-
useParentTitleAsLabel: o.boolean().optional()
|
|
41
|
-
}), u = o.object({ name: o.string() }), d = o.object({
|
|
42
|
-
section: o.string().optional(),
|
|
43
|
-
service: o.string().optional(),
|
|
44
|
-
isDetail: o.boolean().optional(),
|
|
45
|
-
crumb: l.optional(),
|
|
46
|
-
sectionCrumb: l.optional(),
|
|
47
|
-
intermediateCrumb: l.optional(),
|
|
48
|
-
analytics: u.optional()
|
|
49
|
-
});
|
|
50
|
-
function f(e) {
|
|
51
|
-
return d.safeParse(e).success;
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
export { c as n, f as t };
|
|
55
|
-
|
|
56
|
-
//# sourceMappingURL=routeInfo-Ct5r4Gen.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routeInfo-Ct5r4Gen.mjs","names":["useRef","useState","useEffect","createPortal","useRouteContext","SlotShadowRoot","children","ref","root","setRoot","current","shadowRoot","attachShadow","mode","div","style","display","Slot","component","Component","useShadowDOM","currentService","trpcClient","strict","content","auroraContext","client","z","CRUMB_LABEL_KEYS","CrumbSchema","object","labelKey","enum","optional","to","string","useParamAsLabel","useParentTitleAsLabel","boolean","AnalyticsSchema","name","RouteInfoSchema","section","service","isDetail","crumb","sectionCrumb","intermediateCrumb","analytics","isRouteInfo","data","safeParse","success"],"sources":["../../src/client/components/Slot.tsx","../../src/client/routes/routeInfo.ts"],"sourcesContent":["import { useRef, useState, useEffect, type ReactNode, type FC } from \"react\"\nimport { createPortal } from \"react-dom\"\nimport { useRouteContext } from \"@tanstack/react-router\"\nimport type { SlotProps } from \"../AuroraApp\"\n\nfunction SlotShadowRoot({ children }: { children: ReactNode }) {\n const ref = useRef<HTMLDivElement>(null)\n const [root, setRoot] = useState<ShadowRoot | null>(null)\n\n useEffect(() => {\n if (!ref.current) return\n setRoot(ref.current.shadowRoot ?? ref.current.attachShadow({ mode: \"open\" }))\n }, [])\n\n return (\n <div ref={ref} style={{ display: \"contents\" }}>\n {root && createPortal(children, root)}\n </div>\n )\n}\n\nexport function Slot({\n component: Component,\n useShadowDOM = true,\n currentService,\n}: {\n component: FC<SlotProps>\n useShadowDOM?: boolean\n currentService?: string\n}) {\n const { trpcClient } = useRouteContext({ strict: false })\n\n if (!trpcClient) return null\n\n const content = <Component auroraContext={{ client: trpcClient, currentService }} />\n\n if (!useShadowDOM) {\n return content\n }\n\n return <SlotShadowRoot>{content}</SlotShadowRoot>\n}\n","import { z } from \"zod\"\n\nexport const CRUMB_LABEL_KEYS = [\n \"Compute\",\n \"Network\",\n \"Storage\",\n \"Services\",\n \"Images\",\n \"Flavors\",\n \"Security Groups\",\n \"Floating IPs\",\n \"PCA (Clavis)\",\n] as const\n\nexport type CrumbLabelKey = (typeof CRUMB_LABEL_KEYS)[number]\n\nconst CrumbSchema = z.object({\n labelKey: z.enum(CRUMB_LABEL_KEYS).optional(),\n to: z.string().optional(),\n useParamAsLabel: z.string().optional(),\n useParentTitleAsLabel: z.boolean().optional(),\n})\n\nconst AnalyticsSchema = z.object({\n name: z.string(),\n})\n\nconst RouteInfoSchema = z.object({\n section: z.string().optional(),\n service: z.string().optional(),\n isDetail: z.boolean().optional(),\n crumb: CrumbSchema.optional(),\n sectionCrumb: CrumbSchema.optional(),\n intermediateCrumb: CrumbSchema.optional(),\n analytics: AnalyticsSchema.optional(),\n})\n\nexport type Crumb = z.infer<typeof CrumbSchema>\nexport type Analytics = z.infer<typeof AnalyticsSchema>\nexport type RouteInfo = z.infer<typeof RouteInfoSchema>\n\nexport function isRouteInfo(data: unknown): data is RouteInfo {\n return RouteInfoSchema.safeParse(data).success\n}\n"],"mappings":";;;;;;AAKA,SAASK,EAAe,EAAEC,eAAmC;CAC3D,IAAMC,IAAMP,EAAuB,IAAA,GAC7B,CAACQ,GAAMC,KAAWR,EAA4B,IAAA;CAOpD,OALAC,QAAU;EACHK,EAAIG,WACTD,EAAQF,EAAIG,QAAQC,cAAcJ,EAAIG,QAAQE,aAAa,EAAEC,MAAM,OAAO,CAAA,CAAA;CAC5E,GAAG,CAAA,CAAE,GAGH,gBAACC,OAAAA;EAASP;EAAKQ,OAAO,EAAEC,SAAS,WAAW;YACzCR,KAAQL,gBAAaG,GAAUE,CAAAA;;AAGtC;AAEA,SAAgBS,EAAK,EACnBC,WAAWC,GACXC,kBAAe,IACfC,qBAKD;CACC,IAAM,EAAEC,kBAAelB,EAAgB,EAAEmB,QAAQ,GAAM,CAAA;CAEvD,IAAI,CAACD,GAAY,OAAO;CAExB,IAAME,IAAU,gBAACL,GAAAA,EAAUM,eAAe;EAAEC,QAAQJ;EAAYD;CAAe,EAAA,CAAA;CAM/E,OAJKD,IAIE,gBAACf,GAAAA,EAAAA,UAAgBmB,EAAAA,CAAAA,IAHfA;AAIX;ACzBA,IAAMK,IAAcF,EAAEG,OAAO;CAC3BC,UAAUJ,EAAEK,KAAKJ;EAdjB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAMiBA,CAAAA,EAAkBK,SAAQ;CAC3CC,IAAIP,EAAEQ,OAAM,EAAGF,SAAQ;CACvBG,iBAAiBT,EAAEQ,OAAM,EAAGF,SAAQ;CACpCI,uBAAuBV,EAAEW,QAAO,EAAGL,SAAQ;AAC7C,CAAA,GAEMM,IAAkBZ,EAAEG,OAAO,EAC/BU,MAAMb,EAAEQ,OAAM,EAChB,CAAA,GAEMM,IAAkBd,EAAEG,OAAO;CAC/BY,SAASf,EAAEQ,OAAM,EAAGF,SAAQ;CAC5BU,SAAShB,EAAEQ,OAAM,EAAGF,SAAQ;CAC5BW,UAAUjB,EAAEW,QAAO,EAAGL,SAAQ;CAC9BY,OAAOhB,EAAYI,SAAQ;CAC3Ba,cAAcjB,EAAYI,SAAQ;CAClCc,mBAAmBlB,EAAYI,SAAQ;CACvCe,WAAWT,EAAgBN,SAAQ;AACrC,CAAA;AAMA,SAAgBgB,EAAYC,GAAa;CACvC,OAAOT,EAAgBU,UAAUD,CAAAA,EAAME;AACzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routes-BzBTVAjK.mjs","names":["ContentHeading","Message","Button","FormRow","TextInput","useAuth","LoginForm","isLoading","error","loginError","login","div","className","p","form","onSubmit","e","preventDefault","formData","FormData","currentTarget","domain","String","get","user","password","text","variant","id","name","label","autoComplete","required","type","disabled","useNavigate","Stack","Spinner","useEffect","LoginForm","useAuth","isSafeRedirect","path","startsWith","Route","LandingPage","isLoading","isAuthenticated","redirect","searchRedirect","useSearch","navigate","target","to","replace","component"],"sources":["../../src/client/components/Auth/LoginForm.tsx","../../src/client/routes/index.tsx?tsr-split=component"],"sourcesContent":["import { ContentHeading, Message, Button, FormRow, TextInput } from \"@cloudoperators/juno-ui-components\"\nimport { Trans } from \"@lingui/react/macro\"\nimport { useAuth } from \"../../store/AuthProvider\"\n\nexport function LoginForm() {\n const { isLoading, error: loginError, login } = useAuth()\n\n return (\n <div className=\"mt-8 flex justify-center\">\n <div className=\"border-theme-light relative w-full max-w-md rounded-lg border p-6 shadow-lg\">\n <ContentHeading className=\"text-center\">\n <Trans>Login to Your Account</Trans>\n </ContentHeading>\n <p className=\"mb-6 text-center\">\n <Trans>Enter your credentials to access your account</Trans>\n </p>\n\n <form\n className=\"space-y-5\"\n onSubmit={(e) => {\n e.preventDefault()\n const formData = new FormData(e.currentTarget)\n login({\n domain: String(formData.get(\"domain\") ?? \"\"),\n user: String(formData.get(\"user\") ?? \"\"),\n password: String(formData.get(\"password\") ?? \"\"),\n })\n }}\n >\n {loginError && <Message text={loginError} variant=\"error\" />}\n <FormRow>\n <TextInput id=\"domain\" name=\"domain\" label=\"Domain\" autoComplete=\"domain\" required />\n </FormRow>\n <FormRow>\n <TextInput id=\"user\" name=\"user\" label=\"User\" autoComplete=\"user\" required />\n </FormRow>\n <FormRow>\n <TextInput\n id=\"password\"\n name=\"password\"\n type=\"password\"\n label=\"Password\"\n autoComplete=\"password\"\n required\n />\n </FormRow>\n\n <Button type=\"submit\" variant=\"primary\" className=\"mt-2 w-full\" disabled={isLoading}>\n {isLoading ? <Trans>Loading...</Trans> : <Trans>Sign In</Trans>}\n </Button>\n </form>\n </div>\n </div>\n )\n}\n","import { createFileRoute, useNavigate } from \"@tanstack/react-router\"\nimport { Stack, Spinner } from \"@cloudoperators/juno-ui-components\"\nimport { z } from \"zod\"\nimport { useEffect } from \"react\"\nimport { LoginForm } from \"../components/Auth/LoginForm\"\nimport { useAuth } from \"../store/AuthProvider\"\n\nfunction isSafeRedirect(path: unknown): path is string {\n return typeof path === \"string\" && path.startsWith(\"/\") && !path.startsWith(\"//\")\n}\n\nexport const Route = createFileRoute(\"/\")({\n validateSearch: z.object({\n redirect: z.string().optional().catch(\"\"),\n }),\n component: LandingPage,\n})\n\nfunction LandingPage() {\n const { isLoading, isAuthenticated } = useAuth()\n const { redirect: searchRedirect } = Route.useSearch()\n const navigate = useNavigate()\n\n // Redirect when authenticated\n useEffect(() => {\n if (isAuthenticated && !isLoading) {\n const target = isSafeRedirect(searchRedirect) ? searchRedirect : \"/projects\"\n navigate({ to: target, replace: true })\n }\n }, [isAuthenticated, isLoading, navigate, searchRedirect])\n\n if (isLoading) {\n return (\n <Stack className=\"fixed inset-0\" distribution=\"center\" alignment=\"center\">\n <div className=\"absolute inset-0 backdrop-blur-sm\" />\n <Spinner variant=\"primary\" size=\"large\" />\n </Stack>\n )\n }\n\n if (!isAuthenticated) {\n return <LoginForm />\n }\n\n // Redirecting...\n return null\n}\n"],"mappings":";;;;;;;;AAIA,SAAgBM,IAAAA;CACd,IAAM,EAAEC,cAAWC,OAAOC,GAAYC,aAAUL,EAAAA;CAEhD,OACE,gBAACM,OAAAA;EAAIC,WAAU;YACb,gBAACD,OAAAA;GAAIC,WAAU;;IACb,gBAACZ,GAAAA;KAAeY,WAAU;eACxB,gBAAA,GAAA,EAAA,IAAA,SAAA,CAAA;;IAEF,gBAACC,KAAAA;KAAED,WAAU;eACX,gBAAA,GAAA,EAAA,IAAA,SAAA,CAAA;;IAGF,gBAACE,QAAAA;KACCF,WAAU;KACVG,WAAWC,MAAAA;MACTA,EAAEC,eAAc;MAChB,IAAMC,IAAW,IAAIC,SAASH,EAAEI,aAAa;MAC7CV,EAAM;OACJW,QAAQC,OAAOJ,EAASK,IAAI,QAAA,KAAa,EAAA;OACzCC,MAAMF,OAAOJ,EAASK,IAAI,MAAA,KAAW,EAAA;OACrCE,UAAUH,OAAOJ,EAASK,IAAI,UAAA,KAAe,EAAA;MAC/C,CAAA;KACF;;MAECd,KAAc,gBAACR,GAAAA;OAAQyB,MAAMjB;OAAYkB,SAAQ;;MAClD,gBAACxB,GAAAA,EAAAA,UACC,gBAACC,GAAAA;OAAUwB,IAAG;OAASC,MAAK;OAASC,OAAM;OAASC,cAAa;OAASC,UAAQ;;MAEpF,gBAAC7B,GAAAA,EAAAA,UACC,gBAACC,GAAAA;OAAUwB,IAAG;OAAOC,MAAK;OAAOC,OAAM;OAAOC,cAAa;OAAOC,UAAQ;;MAE5E,gBAAC7B,GAAAA,EAAAA,UACC,gBAACC,GAAAA;OACCwB,IAAG;OACHC,MAAK;OACLI,MAAK;OACLH,OAAM;OACNC,cAAa;OACbC,UAAQ;;MAIZ,gBAAC9B,GAAAA;OAAO+B,MAAK;OAASN,SAAQ;OAAUf,WAAU;OAAcsB,UAAU3B;iBACvEA,IAAY,gBAAA,GAAA,EAAA,IAAA,SAAA,CAAA,IAA4B,gBAAA,GAAA,EAAA,IAAA,SAAA,CAAA;;;;;;;AAMrD;;;AC/CA,SAASkC,EAAeC,GAAa;CACnC,OAAO,OAAOA,KAAS,YAAYA,EAAKC,WAAW,GAAA,KAAQ,CAACD,EAAKC,WAAW,IAAA;AAC9E;AASA,SAASE,IAAAA;CACP,IAAM,EAAEC,cAAWC,uBAAoBP,EAAAA,GACjC,EAAEQ,UAAUC,MAAmBL,EAAMM,UAAS,GAC9CC,IAAWhB,EAAAA;CAwBjB,OArBAG,QAAU;EACR,AAAIS,KAAmB,CAACD,KAEtBK,EAAS;GAAEE,IADIZ,EAAeQ,CAAAA,IAAkBA,IAAiB;GAC1CK,SAAS;EAAK,CAAA;CAEzC,GAAG;EAACP;EAAiBD;EAAWK;EAAUF;EAAe,GAErDH,IAEA,gBAAC,GAAA;EAAM,WAAU;EAAgB,cAAa;EAAS,WAAU;aAC/D,gBAAC,OAAA,EAAI,WAAU,oCAAA,CAAA,GACf,gBAAC,GAAA;GAAQ,SAAQ;GAAU,MAAK;;MAKjCC,IAKE,OAJE,gBAAC,GAAA,CAAA,CAAA;AAKZ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routes-DsisKFfG.mjs","names":["createFileRoute","z","Route","validateSearch","object","redirect","string","optional","catch","component","lazyRouteComponent","$$splitComponentImporter"],"sources":["../../src/client/routes/index.tsx"],"sourcesContent":["import { createFileRoute, useNavigate } from \"@tanstack/react-router\"\nimport { Stack, Spinner } from \"@cloudoperators/juno-ui-components\"\nimport { z } from \"zod\"\nimport { useEffect } from \"react\"\nimport { LoginForm } from \"../components/Auth/LoginForm\"\nimport { useAuth } from \"../store/AuthProvider\"\n\nfunction isSafeRedirect(path: unknown): path is string {\n return typeof path === \"string\" && path.startsWith(\"/\") && !path.startsWith(\"//\")\n}\n\nexport const Route = createFileRoute(\"/\")({\n validateSearch: z.object({\n redirect: z.string().optional().catch(\"\"),\n }),\n component: LandingPage,\n})\n\nfunction LandingPage() {\n const { isLoading, isAuthenticated } = useAuth()\n const { redirect: searchRedirect } = Route.useSearch()\n const navigate = useNavigate()\n\n // Redirect when authenticated\n useEffect(() => {\n if (isAuthenticated && !isLoading) {\n const target = isSafeRedirect(searchRedirect) ? searchRedirect : \"/projects\"\n navigate({ to: target, replace: true })\n }\n }, [isAuthenticated, isLoading, navigate, searchRedirect])\n\n if (isLoading) {\n return (\n <Stack className=\"fixed inset-0\" distribution=\"center\" alignment=\"center\">\n <div className=\"absolute inset-0 backdrop-blur-sm\" />\n <Spinner variant=\"primary\" size=\"large\" />\n </Stack>\n )\n }\n\n if (!isAuthenticated) {\n return <LoginForm />\n }\n\n // Redirecting...\n return null\n}\n"],"mappings":";;AAWA,IAAaE,IAAQF,EAAgB,GAAA,EAAK;CACxCG,gBAAgBF,EAAEG,OAAO,EACvBC,UAAUJ,EAAEK,OAAM,EAAGC,SAAQ,EAAGC,MAAM,EAAA,EACxC,CAAA;CACAC,WAASC,yCAAA,WAAA;AACX,CAAA"}
|
|
@@ -1,440 +0,0 @@
|
|
|
1
|
-
import { A as e, B as t, E as n, G as r, H as i, K as a, P as o, R as s, U as c, Y as l, at as u, c as d, et as f, g as p, lt as m, o as h, r as g, rt as _, tt as v, ut as y, y as b } from "./build-DgeVmENN.mjs";
|
|
2
|
-
import { r as x } from "./trpcClient-BxcNKnhv.mjs";
|
|
3
|
-
import { t as S } from "./useProjectId-DBc5lpoU.mjs";
|
|
4
|
-
import "./hooks-D0wGUhRF.mjs";
|
|
5
|
-
import { n as C, t as w } from "./useListWithFiltering-BuhE81I6.mjs";
|
|
6
|
-
import { t as T } from "./buildFilterParams-DoZzMKX9.mjs";
|
|
7
|
-
import { t as E } from "./EditSecurityGroupModal-BGPXglju.mjs";
|
|
8
|
-
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
9
|
-
import { useEffect as A, useRef as j, useState as M } from "react";
|
|
10
|
-
import { useNavigate as N } from "@tanstack/react-router";
|
|
11
|
-
import { Trans as P, useLingui as F } from "@lingui/react";
|
|
12
|
-
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/-components/-modals/DeleteSecurityGroupDialog.tsx
|
|
13
|
-
var I = ({ isOpen: e, onClose: n, securityGroup: r, onDelete: i, isDeleting: a = !1, error: o = null }) => {
|
|
14
|
-
let { i18n: s, _: l } = F(), [u, d] = M(""), f = s._({ id: "HNlEFZ" }), m = u.toLowerCase() === f.toLowerCase(), h = r.name || r.id, _ = (e) => {
|
|
15
|
-
e.preventDefault(), m && !a && i(r.id);
|
|
16
|
-
}, v = () => {
|
|
17
|
-
d(""), n();
|
|
18
|
-
};
|
|
19
|
-
return /*#__PURE__*/ O(g, {
|
|
20
|
-
open: e,
|
|
21
|
-
onCancel: v,
|
|
22
|
-
size: "small",
|
|
23
|
-
title: s._({
|
|
24
|
-
id: "Y+2SDm",
|
|
25
|
-
values: { securityGroupName: h }
|
|
26
|
-
}),
|
|
27
|
-
modalFooter: /*#__PURE__*/ O(p, {
|
|
28
|
-
className: "flex justify-end",
|
|
29
|
-
children: /*#__PURE__*/ k(y, { children: [/*#__PURE__*/ O(b, {
|
|
30
|
-
variant: "default",
|
|
31
|
-
onClick: v,
|
|
32
|
-
disabled: a,
|
|
33
|
-
children: /*#__PURE__*/ O(P, { id: "dEgA5A" })
|
|
34
|
-
}), /*#__PURE__*/ O(b, {
|
|
35
|
-
variant: "primary-danger",
|
|
36
|
-
onClick: _,
|
|
37
|
-
disabled: !m || a,
|
|
38
|
-
"data-testid": "confirm-delete-button",
|
|
39
|
-
children: a ? /*#__PURE__*/ O(P, { id: "EF2EU9" }) : /*#__PURE__*/ O(P, { id: "cnGeoo" })
|
|
40
|
-
})] })
|
|
41
|
-
}),
|
|
42
|
-
children: /*#__PURE__*/ k("div", { children: [
|
|
43
|
-
o && /*#__PURE__*/ O(t, {
|
|
44
|
-
dismissible: !1,
|
|
45
|
-
variant: "error",
|
|
46
|
-
className: "mt-4",
|
|
47
|
-
children: o
|
|
48
|
-
}),
|
|
49
|
-
/*#__PURE__*/ O(P, { id: "Qb+14I" }),
|
|
50
|
-
/*#__PURE__*/ k("div", {
|
|
51
|
-
className: "mt-4",
|
|
52
|
-
children: [/*#__PURE__*/ O("p", {
|
|
53
|
-
className: "mb-2 text-sm",
|
|
54
|
-
children: /*#__PURE__*/ O(P, {
|
|
55
|
-
id: "hLp49h",
|
|
56
|
-
values: { deleteWord: f },
|
|
57
|
-
components: { 0: /*#__PURE__*/ O("strong", {}) }
|
|
58
|
-
})
|
|
59
|
-
}), /*#__PURE__*/ O(c, {
|
|
60
|
-
id: "confirmation",
|
|
61
|
-
name: "confirmation",
|
|
62
|
-
value: u,
|
|
63
|
-
onChange: (e) => d(e.target.value),
|
|
64
|
-
placeholder: f,
|
|
65
|
-
disabled: a,
|
|
66
|
-
autoComplete: "off",
|
|
67
|
-
"data-testid": "delete-confirmation-input"
|
|
68
|
-
})]
|
|
69
|
-
})
|
|
70
|
-
] })
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/-components/SecurityGroupTableRow.tsx
|
|
75
|
-
function L({ securityGroup: t, permissions: i, onEdit: a, onDelete: o, onViewDetails: s, isReadOnly: c = !1 }) {
|
|
76
|
-
let { i18n: l, _: d } = F(), f = ({ value: e }) => /*#__PURE__*/ O("span", { children: e ? l._({ id: "l75CjT" }) : l._({ id: "1UzENP" }) }), p = () => {
|
|
77
|
-
s && s(t);
|
|
78
|
-
};
|
|
79
|
-
return /*#__PURE__*/ k(n, {
|
|
80
|
-
"data-testid": `security-group-row-${t.id}`,
|
|
81
|
-
onClick: p,
|
|
82
|
-
className: "hover:bg-theme-background-lvl-2 cursor-pointer",
|
|
83
|
-
children: [
|
|
84
|
-
/*#__PURE__*/ O(r, { children: /*#__PURE__*/ k("div", { children: [/*#__PURE__*/ O("p", {
|
|
85
|
-
className: "text-md",
|
|
86
|
-
children: t.name
|
|
87
|
-
}), /*#__PURE__*/ O("p", {
|
|
88
|
-
className: "text-theme-light text-xs",
|
|
89
|
-
children: t.id
|
|
90
|
-
})] }) }),
|
|
91
|
-
/*#__PURE__*/ O(r, { children: t.description || l._({ id: "h47p9L" }) }),
|
|
92
|
-
/*#__PURE__*/ k(r, { children: [/*#__PURE__*/ O(f, { value: t.shared }), t.shared && /*#__PURE__*/ k("p", { children: [
|
|
93
|
-
/*#__PURE__*/ O(P, { id: "LtI9AS" }),
|
|
94
|
-
": ",
|
|
95
|
-
/*#__PURE__*/ O("span", {
|
|
96
|
-
className: "text-theme-light text-xs",
|
|
97
|
-
children: t.project_id
|
|
98
|
-
})
|
|
99
|
-
] })] }),
|
|
100
|
-
/*#__PURE__*/ O(r, { children: /*#__PURE__*/ O(f, { value: t.stateful }) }),
|
|
101
|
-
/*#__PURE__*/ O(r, {
|
|
102
|
-
onClick: (e) => e.stopPropagation(),
|
|
103
|
-
className: "items-end justify-end pr-0",
|
|
104
|
-
children: /*#__PURE__*/ O(_, { children: /*#__PURE__*/ k(e, { children: [
|
|
105
|
-
/*#__PURE__*/ O(u, {
|
|
106
|
-
label: l._({ id: "v0hPHE" }),
|
|
107
|
-
onClick: () => p()
|
|
108
|
-
}),
|
|
109
|
-
i.canUpdate && !c && /*#__PURE__*/ O(u, {
|
|
110
|
-
label: l._({ id: "ePK91l" }),
|
|
111
|
-
onClick: () => a(t)
|
|
112
|
-
}),
|
|
113
|
-
i.canDelete && !c && /*#__PURE__*/ O(u, {
|
|
114
|
-
label: l._({ id: "cnGeoo" }),
|
|
115
|
-
onClick: () => o(t)
|
|
116
|
-
})
|
|
117
|
-
] }) })
|
|
118
|
-
})
|
|
119
|
-
]
|
|
120
|
-
}, t.id);
|
|
121
|
-
}
|
|
122
|
-
//#endregion
|
|
123
|
-
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/-components/SecurityGroupListContainer.tsx
|
|
124
|
-
var R = ({ securityGroups: e, isLoading: t, isError: r, error: i, permissions: c, onDeleteSecurityGroup: l, isDeletingSecurityGroup: u = !1, deleteError: d = null, onUpdateSecurityGroup: f, isUpdatingSecurityGroup: p = !1, updateError: m = null, currentProjectId: h }) => {
|
|
125
|
-
let { i18n: g, _ } = F(), y = N(), b = S(), [x, C] = M(null), [w, T] = M(!1), [R, z] = M(!1), B = j(!1), V = j(!1), H = (e) => {
|
|
126
|
-
C(e), T(!0);
|
|
127
|
-
}, U = (e) => {
|
|
128
|
-
C(e), z(!0);
|
|
129
|
-
}, W = (e) => {
|
|
130
|
-
y({
|
|
131
|
-
to: "/projects/$projectId/network/securitygroups/$securityGroupId",
|
|
132
|
-
params: {
|
|
133
|
-
projectId: b,
|
|
134
|
-
securityGroupId: e.id
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
}, G = () => {
|
|
138
|
-
C(null), T(!1);
|
|
139
|
-
}, K = () => {
|
|
140
|
-
C(null), z(!1);
|
|
141
|
-
};
|
|
142
|
-
return A(() => {
|
|
143
|
-
B.current && !u && R && !d && K(), B.current = u;
|
|
144
|
-
}, [
|
|
145
|
-
u,
|
|
146
|
-
d,
|
|
147
|
-
R
|
|
148
|
-
]), A(() => {
|
|
149
|
-
V.current && !p && w && !m && G(), V.current = p;
|
|
150
|
-
}, [
|
|
151
|
-
p,
|
|
152
|
-
m,
|
|
153
|
-
w
|
|
154
|
-
]), t ? /*#__PURE__*/ k(v, {
|
|
155
|
-
className: "py-8",
|
|
156
|
-
distribution: "center",
|
|
157
|
-
alignment: "center",
|
|
158
|
-
direction: "vertical",
|
|
159
|
-
children: [/*#__PURE__*/ O(a, {
|
|
160
|
-
variant: "primary",
|
|
161
|
-
size: "large",
|
|
162
|
-
className: "mb-2"
|
|
163
|
-
}), /*#__PURE__*/ O(P, { id: "Z3FXyt" })]
|
|
164
|
-
}) : r ? /*#__PURE__*/ O(v, {
|
|
165
|
-
className: "py-8",
|
|
166
|
-
distribution: "center",
|
|
167
|
-
alignment: "center",
|
|
168
|
-
direction: "vertical",
|
|
169
|
-
children: i?.message ?? g._({ id: "Wca9WC" })
|
|
170
|
-
}) : e.length === 0 ? /*#__PURE__*/ O(P, { id: "SfW/3r" }) : /*#__PURE__*/ k(D, { children: [/*#__PURE__*/ k(o, {
|
|
171
|
-
columns: 5,
|
|
172
|
-
children: [/*#__PURE__*/ O(n, { children: [
|
|
173
|
-
g._({ id: "6YtxFj" }),
|
|
174
|
-
g._({ id: "Nu4oKW" }),
|
|
175
|
-
g._({ id: "0Gd0NU" }),
|
|
176
|
-
g._({ id: "Jim5X9" }),
|
|
177
|
-
""
|
|
178
|
-
].map((e) => /*#__PURE__*/ O(s, { children: e }, e)) }), e.map((e) => /*#__PURE__*/ O(L, {
|
|
179
|
-
securityGroup: e,
|
|
180
|
-
permissions: c,
|
|
181
|
-
onEdit: H,
|
|
182
|
-
onDelete: U,
|
|
183
|
-
onViewDetails: W,
|
|
184
|
-
isReadOnly: !!(h && e.project_id && e.project_id !== h)
|
|
185
|
-
}, e.id))]
|
|
186
|
-
}), x && /*#__PURE__*/ k(D, { children: [/*#__PURE__*/ O(E, {
|
|
187
|
-
securityGroup: x,
|
|
188
|
-
open: w,
|
|
189
|
-
onClose: G,
|
|
190
|
-
onUpdate: async (e, t) => {
|
|
191
|
-
f && await f(e, t);
|
|
192
|
-
},
|
|
193
|
-
isLoading: p,
|
|
194
|
-
error: m
|
|
195
|
-
}), /*#__PURE__*/ O(I, {
|
|
196
|
-
securityGroup: x,
|
|
197
|
-
isOpen: R,
|
|
198
|
-
onClose: K,
|
|
199
|
-
onDelete: (e) => {
|
|
200
|
-
l && l(e);
|
|
201
|
-
},
|
|
202
|
-
isDeleting: u,
|
|
203
|
-
error: d
|
|
204
|
-
})] })] });
|
|
205
|
-
}, z = {
|
|
206
|
-
name: "",
|
|
207
|
-
description: "",
|
|
208
|
-
stateful: !0
|
|
209
|
-
}, B = ({ isOpen: e, onClose: n, onCreate: r, isLoading: o = !1, error: s = null }) => {
|
|
210
|
-
let { i18n: l, _: u } = F(), [_, v] = M({ ...z }), [x, S] = M({}), C = (e) => {
|
|
211
|
-
let { name: t, value: n, type: r } = e.target, i = e.target.checked;
|
|
212
|
-
v((e) => ({
|
|
213
|
-
...e,
|
|
214
|
-
[t]: r === "checkbox" ? i : n
|
|
215
|
-
})), x[t] && S((e) => {
|
|
216
|
-
let n = { ...e };
|
|
217
|
-
return delete n[t], n;
|
|
218
|
-
});
|
|
219
|
-
}, w = () => {
|
|
220
|
-
let e = {};
|
|
221
|
-
return (!_.name || _.name.trim() === "") && (e.name = l._({ id: "lN/Z9n" })), S(e), Object.keys(e).length === 0;
|
|
222
|
-
}, T = async (e) => {
|
|
223
|
-
e.preventDefault(), w() && (await r({
|
|
224
|
-
name: _.name.trim(),
|
|
225
|
-
description: _.description.trim() || void 0,
|
|
226
|
-
stateful: _.stateful
|
|
227
|
-
}), E());
|
|
228
|
-
}, E = () => {
|
|
229
|
-
v({ ...z }), S({}), n();
|
|
230
|
-
};
|
|
231
|
-
return /*#__PURE__*/ k(g, {
|
|
232
|
-
open: e,
|
|
233
|
-
onCancel: E,
|
|
234
|
-
size: "large",
|
|
235
|
-
title: l._({ id: "YjAOtb" }),
|
|
236
|
-
modalFooter: /*#__PURE__*/ O(p, {
|
|
237
|
-
className: "flex justify-end",
|
|
238
|
-
children: /*#__PURE__*/ k(y, { children: [/*#__PURE__*/ O(b, {
|
|
239
|
-
variant: "default",
|
|
240
|
-
onClick: E,
|
|
241
|
-
disabled: o,
|
|
242
|
-
children: /*#__PURE__*/ O(P, { id: "dEgA5A" })
|
|
243
|
-
}), /*#__PURE__*/ O(b, {
|
|
244
|
-
variant: "primary",
|
|
245
|
-
onClick: (e) => {
|
|
246
|
-
T(e);
|
|
247
|
-
},
|
|
248
|
-
disabled: o,
|
|
249
|
-
"data-testid": "create-security-group-button",
|
|
250
|
-
children: o ? /*#__PURE__*/ O(a, { size: "small" }) : /*#__PURE__*/ O(P, { id: "YjAOtb" })
|
|
251
|
-
})] })
|
|
252
|
-
}),
|
|
253
|
-
children: [
|
|
254
|
-
s && /*#__PURE__*/ O(t, {
|
|
255
|
-
dismissible: !1,
|
|
256
|
-
variant: "error",
|
|
257
|
-
className: "mb-4",
|
|
258
|
-
children: s
|
|
259
|
-
}),
|
|
260
|
-
o && /*#__PURE__*/ k("div", {
|
|
261
|
-
className: "mb-4 flex items-center justify-center gap-2",
|
|
262
|
-
children: [/*#__PURE__*/ O(a, { variant: "primary" }), /*#__PURE__*/ O("span", {
|
|
263
|
-
className: "text-theme-high text-sm",
|
|
264
|
-
children: /*#__PURE__*/ O(P, { id: "Km4AGG" })
|
|
265
|
-
})]
|
|
266
|
-
}),
|
|
267
|
-
!o && /*#__PURE__*/ O(h, {
|
|
268
|
-
className: "mb-6",
|
|
269
|
-
children: /*#__PURE__*/ k(i, {
|
|
270
|
-
className: "mb-6",
|
|
271
|
-
children: [
|
|
272
|
-
/*#__PURE__*/ O(d, {
|
|
273
|
-
className: "mb-6",
|
|
274
|
-
children: /*#__PURE__*/ O(c, {
|
|
275
|
-
id: "name",
|
|
276
|
-
name: "name",
|
|
277
|
-
label: l._({ id: "6YtxFj" }),
|
|
278
|
-
value: _.name,
|
|
279
|
-
onChange: C,
|
|
280
|
-
required: !0,
|
|
281
|
-
errortext: x.name,
|
|
282
|
-
placeholder: l._({ id: "Ac6dy9" }),
|
|
283
|
-
disabled: o
|
|
284
|
-
})
|
|
285
|
-
}),
|
|
286
|
-
/*#__PURE__*/ O(d, {
|
|
287
|
-
className: "mb-6",
|
|
288
|
-
children: /*#__PURE__*/ O(f, {
|
|
289
|
-
id: "description",
|
|
290
|
-
name: "description",
|
|
291
|
-
label: l._({ id: "Nu4oKW" }),
|
|
292
|
-
value: _.description,
|
|
293
|
-
onChange: C,
|
|
294
|
-
placeholder: l._({ id: "Nu4oKW" }),
|
|
295
|
-
disabled: o,
|
|
296
|
-
rows: 3
|
|
297
|
-
})
|
|
298
|
-
}),
|
|
299
|
-
/*#__PURE__*/ O(d, {
|
|
300
|
-
className: "mb-0",
|
|
301
|
-
children: /*#__PURE__*/ O(m, {
|
|
302
|
-
id: "stateful",
|
|
303
|
-
name: "stateful",
|
|
304
|
-
label: l._({ id: "Jim5X9" }),
|
|
305
|
-
checked: _.stateful,
|
|
306
|
-
onChange: C,
|
|
307
|
-
disabled: o
|
|
308
|
-
})
|
|
309
|
-
})
|
|
310
|
-
]
|
|
311
|
-
})
|
|
312
|
-
})
|
|
313
|
-
]
|
|
314
|
-
});
|
|
315
|
-
}, V = {
|
|
316
|
-
TRUE: "true",
|
|
317
|
-
FALSE: "false"
|
|
318
|
-
}, H = () => {
|
|
319
|
-
let { i18n: e, _: t } = F(), n = N(), r = S(), [i, a] = M(!1), [o, s] = M(null), [c, l] = M(null), [u, d] = M(null), { searchTerm: f, sortSettings: p, filterSettings: m, handleSearchChange: h, handleSortChange: g, handleFilterChange: _ } = w({
|
|
320
|
-
defaultSortKey: "name",
|
|
321
|
-
defaultSortDir: "asc",
|
|
322
|
-
sortOptions: [{
|
|
323
|
-
label: e._({ id: "6YtxFj" }),
|
|
324
|
-
value: "name"
|
|
325
|
-
}, {
|
|
326
|
-
label: e._({ id: "podzPY" }),
|
|
327
|
-
value: "project_id"
|
|
328
|
-
}],
|
|
329
|
-
filterSettings: { filters: [{
|
|
330
|
-
displayName: e._({ id: "0Gd0NU" }),
|
|
331
|
-
filterName: "shared",
|
|
332
|
-
values: Object.values(V),
|
|
333
|
-
supportsMultiValue: !1
|
|
334
|
-
}] }
|
|
335
|
-
}), v = x.useUtils(), y = {
|
|
336
|
-
canCreate: !0,
|
|
337
|
-
canUpdate: !0,
|
|
338
|
-
canDelete: !0,
|
|
339
|
-
canManageAccess: !0
|
|
340
|
-
}, { data: E = [], isLoading: D, isError: A, error: j } = x.network.securityGroup.list.useQuery({
|
|
341
|
-
project_id: r || "",
|
|
342
|
-
sort_key: p.sortBy,
|
|
343
|
-
sort_dir: p.sortDirection,
|
|
344
|
-
...T(m),
|
|
345
|
-
...f ? { searchTerm: f } : {}
|
|
346
|
-
}, { enabled: !!r }), I = x.network.securityGroup.create.useMutation({
|
|
347
|
-
onSuccess: (e) => {
|
|
348
|
-
v.network.securityGroup.list.invalidate(), l(null), n({
|
|
349
|
-
to: "/projects/$projectId/network/securitygroups/$securityGroupId",
|
|
350
|
-
params: {
|
|
351
|
-
projectId: r,
|
|
352
|
-
securityGroupId: e.id
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
},
|
|
356
|
-
onError: (t) => {
|
|
357
|
-
l(t.message || e._({ id: "o6M6l0" }));
|
|
358
|
-
}
|
|
359
|
-
}), L = x.network.securityGroup.deleteById.useMutation({
|
|
360
|
-
onSuccess: () => {
|
|
361
|
-
v.network.securityGroup.list.invalidate(), s(null);
|
|
362
|
-
},
|
|
363
|
-
onError: (t) => {
|
|
364
|
-
s(t.message || e._({ id: "d0pLfy" }));
|
|
365
|
-
}
|
|
366
|
-
}), z = x.network.securityGroup.update.useMutation({
|
|
367
|
-
onSuccess: () => {
|
|
368
|
-
v.network.securityGroup.list.invalidate(), d(null);
|
|
369
|
-
},
|
|
370
|
-
onError: (t) => {
|
|
371
|
-
d(t.message || e._({ id: "jPxavx" }));
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
return /*#__PURE__*/ k("div", {
|
|
375
|
-
className: "relative",
|
|
376
|
-
children: [
|
|
377
|
-
/*#__PURE__*/ O(C, {
|
|
378
|
-
sortSettings: p,
|
|
379
|
-
filterSettings: m,
|
|
380
|
-
searchTerm: f,
|
|
381
|
-
onSort: g,
|
|
382
|
-
onFilter: _,
|
|
383
|
-
onSearch: h,
|
|
384
|
-
actions: y.canCreate && /*#__PURE__*/ O(b, {
|
|
385
|
-
onClick: () => a(!0),
|
|
386
|
-
variant: "primary",
|
|
387
|
-
children: /*#__PURE__*/ O(P, { id: "YjAOtb" })
|
|
388
|
-
})
|
|
389
|
-
}),
|
|
390
|
-
/*#__PURE__*/ O(R, {
|
|
391
|
-
securityGroups: E,
|
|
392
|
-
isLoading: D,
|
|
393
|
-
isError: A,
|
|
394
|
-
error: j,
|
|
395
|
-
permissions: y,
|
|
396
|
-
onCreateClick: () => a(!0),
|
|
397
|
-
onDeleteSecurityGroup: (e) => {
|
|
398
|
-
s(null), L.mutate({
|
|
399
|
-
project_id: r,
|
|
400
|
-
securityGroupId: e
|
|
401
|
-
});
|
|
402
|
-
},
|
|
403
|
-
isDeletingSecurityGroup: L.isPending,
|
|
404
|
-
deleteError: o,
|
|
405
|
-
onUpdateSecurityGroup: async (e, t) => {
|
|
406
|
-
d(null), await z.mutateAsync({
|
|
407
|
-
project_id: r,
|
|
408
|
-
securityGroupId: e,
|
|
409
|
-
...t
|
|
410
|
-
});
|
|
411
|
-
},
|
|
412
|
-
isUpdatingSecurityGroup: z.isPending,
|
|
413
|
-
updateError: u,
|
|
414
|
-
currentProjectId: r
|
|
415
|
-
}),
|
|
416
|
-
/*#__PURE__*/ O(B, {
|
|
417
|
-
isOpen: i,
|
|
418
|
-
onClose: () => a(!1),
|
|
419
|
-
onCreate: async (e) => {
|
|
420
|
-
l(null), await I.mutateAsync({
|
|
421
|
-
project_id: r,
|
|
422
|
-
...e
|
|
423
|
-
});
|
|
424
|
-
},
|
|
425
|
-
isLoading: I.isPending,
|
|
426
|
-
error: c
|
|
427
|
-
})
|
|
428
|
-
]
|
|
429
|
-
});
|
|
430
|
-
};
|
|
431
|
-
//#endregion
|
|
432
|
-
//#region src/client/routes/_auth/projects/$projectId/network/securitygroups/index.tsx?tsr-split=component
|
|
433
|
-
function U() {
|
|
434
|
-
let { i18n: e, _: t } = F();
|
|
435
|
-
return /*#__PURE__*/ k(D, { children: [/*#__PURE__*/ O(l, { children: e._({ id: "4opp4r" }) }), /*#__PURE__*/ O(H, {})] });
|
|
436
|
-
}
|
|
437
|
-
//#endregion
|
|
438
|
-
export { U as component };
|
|
439
|
-
|
|
440
|
-
//# sourceMappingURL=securitygroups-JMvcJLpb.mjs.map
|