Flatten
This commit is contained in:
parent
8f165d15d2
commit
c620e4bf25
264 changed files with 9983 additions and 2280 deletions
|
|
@ -1,32 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import { Grid } from "@mui/material";
|
||||
import Iframe from "react-iframe";
|
||||
|
||||
type LeafcutterWrapperProps = {
|
||||
path: string;
|
||||
};
|
||||
|
||||
export const LeafcutterWrapper: FC<LeafcutterWrapperProps> = ({ path }) => {
|
||||
const leafcutterURL = `https://lc.digiresilience.org/${path}`;
|
||||
|
||||
return (
|
||||
<Grid
|
||||
container
|
||||
spacing={0}
|
||||
sx={{ height: "100%", width: "100%" }}
|
||||
direction="column"
|
||||
>
|
||||
<Grid item sx={{ height: "100vh", width: "100%" }}>
|
||||
<Iframe
|
||||
id="leafcutter"
|
||||
url={leafcutterURL}
|
||||
width="100%"
|
||||
height="100%"
|
||||
frameBorder={0}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import { LeafcutterWrapper } from "./_components/LeafcutterWrapper";
|
||||
|
||||
type PageProps = {
|
||||
params: {
|
||||
view: string;
|
||||
};
|
||||
};
|
||||
|
||||
export default function Page({ params: { view } }: PageProps) {
|
||||
return <LeafcutterWrapper path={view} />;
|
||||
}
|
||||
30
apps/link/app/(main)/leafcutter/_components/Home.tsx
Normal file
30
apps/link/app/(main)/leafcutter/_components/Home.tsx
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
"use client";
|
||||
|
||||
import { FC, useEffect, useState } from "react";
|
||||
import { Home as HomeInternal } from "leafcutter-common";
|
||||
import { fetchLeafcutter } from "@/app/_lib/utils";
|
||||
import ClientOnly from "@/app/(main)/_components/ClientOnly";
|
||||
|
||||
export const Home: FC = () => {
|
||||
const [visualizations, setVisualizations] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
const getVisualizations = async () => {
|
||||
const visualizations = await fetchLeafcutter(
|
||||
"https://macmini.tiger-agama.ts.net:3001/api/visualizations/list",
|
||||
{},
|
||||
);
|
||||
if (visualizations) {
|
||||
setVisualizations(visualizations);
|
||||
}
|
||||
};
|
||||
|
||||
getVisualizations();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<ClientOnly>
|
||||
<HomeInternal visualizations={visualizations} />
|
||||
</ClientOnly>
|
||||
);
|
||||
};
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import { FC, PropsWithChildren } from "react";
|
||||
import { Box } from "@mui/material";
|
||||
|
||||
export const LeafcutterWrapper: FC<PropsWithChildren> = ({ children }) => {
|
||||
return <Box sx={{ p: 3 }}>{children}</Box>;
|
||||
};
|
||||
10
apps/link/app/(main)/leafcutter/about/page.tsx
Normal file
10
apps/link/app/(main)/leafcutter/about/page.tsx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { Box } from "@mui/material";
|
||||
import { About } from "leafcutter-common";
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<Box sx={{ p: 3 }}>
|
||||
<About />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
13
apps/link/app/(main)/leafcutter/create/page.tsx
Normal file
13
apps/link/app/(main)/leafcutter/create/page.tsx
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// import { getTemplates } from "app/_lib/opensearch";
|
||||
import { Create } from "leafcutter-common";
|
||||
import { Box } from "@mui/material";
|
||||
|
||||
export default async function Page() {
|
||||
const templates = []; // await getTemplates(100);
|
||||
|
||||
return (
|
||||
<Box sx={{ p: 3 }}>
|
||||
<Create templates={templates} />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
10
apps/link/app/(main)/leafcutter/faq/page.tsx
Normal file
10
apps/link/app/(main)/leafcutter/faq/page.tsx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { Box } from "@mui/material";
|
||||
import { FAQ } from "leafcutter-common";
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<Box sx={{ p: 3 }}>
|
||||
<FAQ />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
10
apps/link/app/(main)/leafcutter/login/page.tsx
Normal file
10
apps/link/app/(main)/leafcutter/login/page.tsx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { Box } from "@mui/material";
|
||||
import { FAQ } from "leafcutter-common";
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<Box sx={{ p: 3 }}>
|
||||
<FAQ />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,5 +1,10 @@
|
|||
import { redirect } from "next/navigation";
|
||||
import { Home } from "./_components/Home";
|
||||
import { LeafcutterWrapper } from "./_components/LeafcutterWrapper";
|
||||
|
||||
export default function Page() {
|
||||
redirect("/leafcutter/home");
|
||||
export default async function Page() {
|
||||
return (
|
||||
<LeafcutterWrapper>
|
||||
<Home />
|
||||
</LeafcutterWrapper>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
12
apps/link/app/(main)/leafcutter/trends/page.tsx
Normal file
12
apps/link/app/(main)/leafcutter/trends/page.tsx
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { Box } from "@mui/material";
|
||||
import { Trends } from "leafcutter-common";
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<Box sx={{ p: 3 }}>
|
||||
<Trends visualizations={[]} />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
Loading…
Add table
Add a link
Reference in a new issue