Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 3992dce

Browse files
Gimleuxqvalentin
andauthored
Feature/file images (#25)
* Added colors * Added File Icons * Added Last changes * Added Size * removed not needed css classes Co-authored-by: qvalentin <[email protected]>
1 parent f7e9301 commit 3992dce

File tree

15 files changed

+656
-263
lines changed

15 files changed

+656
-263
lines changed

webapp_frontend/src/background/api/filesystem.ts

Lines changed: 440 additions & 0 deletions
Large diffs are not rendered by default.

webapp_frontend/src/background/api/filesystem.tsx

Lines changed: 0 additions & 236 deletions
This file was deleted.
File renamed without changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export function formatBytes(bytes:number, decimals:number = 2):string {
2+
if (bytes === 0) return '0 Bytes';
3+
4+
const k:number = 1024;
5+
const dm:number = decimals < 0 ? 0 : decimals;
6+
const sizes:string[] = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
7+
8+
const i:number = Math.floor(Math.log(bytes) / Math.log(k));
9+
10+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
11+
}
File renamed without changes.

webapp_frontend/src/components/App.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ function App(props: Props): ReactElement {
5555
<BrowserRouter>
5656
<TopBanner/>
5757
<Header/>
58-
<main role='main' className={"flex-shrink-0 flex-grow-1"}>
59-
<Router/>
60-
</main>
61-
<footer className='footer mt-auto py-3 bg-dark text-white'>
62-
<Footer/>
63-
</footer>
58+
<div>
59+
<main role='main' className={"flex-shrink-0 flex-grow-1"}>
60+
<Router/>
61+
</main>
62+
</div>
63+
<Footer/>
6464
<PermanentAssets/>
6565
</BrowserRouter>
6666
</div>

webapp_frontend/src/components/basicElements/Footer.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ import github from "super-tiny-icons/images/svg/github.svg"
44

55
export default function Footer(): ReactElement {
66
return (
7-
<Container>
8-
<div className="d-flex flex-column justify-content-center">
9-
<a href={"https://github.com/filefighter"} className="align-self-center"><img src={github} alt={"github logo"} width={"50px"}/></a>
10-
<span className="align-self-center mt-2" >Made by</span>
7+
<footer className='footer mt-auto py-3 text-white'>
8+
<Container className="d-flex flex-column justify-content-center bg-primary p-1">
9+
<a href={"https://github.com/filefighter"} className="align-self-center"><img src={github}
10+
alt={"github logo"}
11+
width={"50px"}/></a>
12+
<span className="align-self-center mt-2">Made by</span>
1113
<div className="d-flex justify-content-around">
1214
<span>Gimleux</span>
1315
<span>Open-Schnick</span>
1416
<span>qvalentin</span>
1517
</div>
16-
</div>
17-
</Container>
18+
</Container>
19+
</footer>
1820
);
1921
}
2022

webapp_frontend/src/components/basicElements/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function Header(): ReactElement {
5555
return (
5656
<header>
5757
<div className="container">
58-
<Navbar bg="dark" expand="lg" sticky="top">
58+
<Navbar bg="primary" expand="lg" sticky="top">
5959
<NavbarBrand href="/start" onClick={(event: any) => {redirect(history, "/", event);}}>
6060
<img src={logo} className="d-inline-block align-top" alt="Logo" height="30px" width="auto"/>
6161
FileFighter

webapp_frontend/src/components/basicElements/TopBanner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React, {ReactElement} from "react";
22

33
export function TopBanner():ReactElement {
44
return(
5-
<div className="d-flex justify-content-center">
5+
<div className="d-flex justify-content-center bg-dark text-yellow p-1">
66
Black Lives Matter
77
</div>
88
)
9-
}
9+
}

webapp_frontend/src/components/pages/Health.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ export default function Health() {
5151

5252

5353
<div>
54-
{/*<Button className={"mt-3 mb-2 float-right"} onClick={() => updateVariables()}>Refresh</Button>*/}
55-
<Table striped bordered hover variant="dark">
54+
<Table striped bordered hover>
5655
<thead>
5756
<tr>
5857
<th>Backend information</th>

0 commit comments

Comments
 (0)