home page layout

This commit is contained in:
Vomitblood 2024-11-10 23:59:51 +08:00
parent 5bc0c898b3
commit 1f1a667a02
4 changed files with 142 additions and 11 deletions

16
README Normal file
View file

@ -0,0 +1,16 @@
# cspj application
## attacks
1. sql injection
2. xss
3. command injection
4. file inclusion attacks
5. csrf
6. directory traversal
7. insecure deserialization
8. session hijacking
9. xml external entity injection
10. sever side request forgery
11. broken authentication and session management
12. clickjacking

View file

@ -1,6 +1,18 @@
import { Box, TextField, useTheme } from "@mui/material"; import {
Box,
Button,
Container,
Grid2,
Input,
Switch,
TextField,
Typography,
useTheme,
} from "@mui/material";
import { HeaderBar } from "../HeaderBar/HeaderBar"; import { HeaderBar } from "../HeaderBar/HeaderBar";
import { LoadingButton } from "@mui/lab"; import { AttackItem } from "../Home/AttackItem";
import Link from "next/link";
export const Layout = () => { export const Layout = () => {
// contexts // contexts
@ -16,20 +28,89 @@ export const Layout = () => {
}} }}
> >
<HeaderBar /> <HeaderBar />
<Box <Container
maxWidth="lg"
sx={{ sx={{
justifyContent: "center",
display: "flex", display: "flex",
flexDirection: "column",
flexGrow: 1, flexGrow: 1,
overflow: "auto", overflow: "auto",
p: 1, p: 1,
}} }}
> >
<Box> {/* main content goes here buddy */}
{/* main content goes here buddy */} <Box
<LoadingButton id="asdfbutton">asdf</LoadingButton> sx={{
<TextField id="asdf" name="asdf"></TextField> mb: 2,
}}
>
<Box
sx={{
alignItems: "center",
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
}}
>
<Typography
sx={{
mb: 2,
}}
variant="h3"
>
CSPJ Application Attacks
</Typography>
<Box>
Secured version
<Switch />
</Box>
</Box>
<Box
sx={{
alignItems: "center",
display: "flex",
flexDirection: "row",
}}
>
{/*
TODO: implmenent simple ping server to check if the user entered a valid backend url
debounce when typing
update textfield color based on the response
*/}
<TextField fullWidth label="Paste your backend URL here" />
</Box>
<Button href="https://github.com/cspj-nyp/cspj-application">
Need help getting started?
</Button>
</Box> </Box>
</Box> <Grid2 container spacing={2}>
<Grid2 size={3}>
<AttackItem attackName="SQL Injection" />
</Grid2>
<Grid2 size={3}>
<AttackItem attackName="Cross Site Scripting" />
</Grid2>
<Grid2 size={3}>
<AttackItem attackName="Command Injection" />
</Grid2>
<Grid2 size={3}>
<AttackItem attackName="File Inclusion Attacks" />
</Grid2>
<Grid2 size={3}>
<AttackItem attackName="CSRF" />
</Grid2>
<Grid2 size={3}>
<AttackItem attackName="Directory Traversal" />
</Grid2>
<Grid2 size={3}>
<AttackItem attackName="Insecure Desrialization" />
</Grid2>
<Grid2 size={3}>
<AttackItem attackName="Session Hijacking" />
</Grid2>
</Grid2>
</Container>
</Box> </Box>
); );
}; };

View file

@ -0,0 +1,37 @@
import {
Card,
CardActionArea,
CardContent,
Typography,
useTheme,
} from "@mui/material";
import { FC } from "react";
type AttackItemProps = {
attackName: string;
};
export const AttackItem: FC<AttackItemProps> = ({ attackName }) => {
// contexts
const theme = useTheme();
return (
<Card
sx={{
backgroundColor: theme.palette.background.default,
borderRadius: "8px",
}}
variant="outlined"
>
<CardActionArea
onClick={() => {
console.log("clicked");
}}
>
<CardContent>
<Typography component="div">{attackName}</Typography>
</CardContent>
</CardActionArea>
</Card>
);
};

View file

@ -62,11 +62,8 @@ export const UserThemeProvider: FC<UserThemeProviderProps> = ({ children }) => {
}, },
}; };
// font family settings
// TODO: figure out how to bundle fonts in tauri
const fontFamily = "GoogleSans"; const fontFamily = "GoogleSans";
// font scaling settings
const fontSize = 14; const fontSize = 14;
const userTheme = createTheme({ const userTheme = createTheme({