parent
216dd1f932
commit
e782aa2ae2
8 changed files with 187 additions and 18 deletions
@ -1,31 +1,55 @@ |
||||
import Head from 'next/head'; |
||||
import Link from 'next/link'; |
||||
import MenuLinks from './MenuLinks'; |
||||
|
||||
export default function Layout({ children }) { |
||||
return ( |
||||
<> |
||||
|
||||
<Head> |
||||
<meta charSet="utf-8"/> |
||||
<meta name="viewport" content="width=device-width initial-scale=1"/> |
||||
<link rel="shortcut icon" href="/favicon.ico" /> |
||||
</Head> |
||||
<div className="container col-lg-6"> |
||||
<header className="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between py-3 mb-2"> |
||||
<ul className="nav col-4 mb-2 mb-md-0"> |
||||
<li><Link href="/"><a className="nav-link px-2 link-dark">Home</a></Link></li> |
||||
</ul> |
||||
<div className="col-8 text-end"> |
||||
<Link href="/login"><a className="btn btn-outline-primary me-2">Login</a></Link> |
||||
<Link href="/register"><a className="btn btn-primary">Register</a></Link> |
||||
|
||||
<div className="row h-100 p-0 m-0"> |
||||
|
||||
<div className="col-auto sidebar h-100 m-0 px-0"> |
||||
<div className="d-flex flex-column flex-shrink-0 p-3 text-bg-dark h-100 overflow-auto" style={{ width: '280px' }}> |
||||
<MenuLinks /> |
||||
</div> |
||||
</div> |
||||
|
||||
<div className="col-1 flex-fill m-0 px-0 h-100 overflow-auto"> |
||||
<div className="p-4 h-100 d-flex flex-column"> |
||||
|
||||
<Link href="/menu"> |
||||
<a className="btn btn-primary mobile-btn mb-4"> |
||||
Menu |
||||
</a> |
||||
</Link> |
||||
|
||||
{/* |
||||
<header className="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between mb-2 me-5"> |
||||
<ul className="nav col-4 mb-2 mb-md-0"> |
||||
<li><Link href="/"><a className="nav-link px-2 link-dark">Home</a></Link></li> |
||||
</ul> |
||||
<div className="col-8 text-end"> |
||||
<Link href="/login"><a className="btn btn-outline-primary me-2">Login</a></Link> |
||||
<Link href="/register"><a className="btn btn-primary">Register</a></Link> |
||||
</div> |
||||
</header> |
||||
*/} |
||||
<main>{children}</main> |
||||
<footer className="mt-auto pt-3"> |
||||
<p className="text-center text-muted"> |
||||
<a href="https://gitgud.io/fatchan/haproxy-protection/">Open Source Bot Protection</a> + <a href="https://gitgud.io/fatchan/haproxy-panel-next/">Control Panel</a> |
||||
</p> |
||||
</footer> |
||||
</div> |
||||
</header> |
||||
<main>{children}</main> |
||||
</div> |
||||
|
||||
</div> |
||||
<footer className="py-3 mt-auto"> |
||||
<p className="text-center text-muted"> |
||||
<a href="https://gitgud.io/fatchan/haproxy-protection/">Open Source Bot Protection</a> + <a href="https://gitgud.io/fatchan/haproxy-panel-next/">Control Panel</a> |
||||
</p> |
||||
</footer> |
||||
</> |
||||
) |
||||
} |
||||
|
@ -0,0 +1,108 @@ |
||||
import Image from 'next/image'; |
||||
import Link from 'next/link'; |
||||
import { withRouter } from 'next/router'; |
||||
|
||||
export default withRouter(function MenuLinks({ router }) { |
||||
return (<> |
||||
<Link href="/"> |
||||
<a className="d-flex align-items-center mb-3 mb-md-0 text-white text-decoration-none"> |
||||
<Image src="/favicon.ico" width="32" height="32" alt=" " /> |
||||
<span className="mx-2 fs-4">BasedFlare</span> |
||||
</a> |
||||
</Link> |
||||
<hr /> |
||||
<ul className="nav nav-pills flex-column mb-auto"> |
||||
<li className="nav-item"> |
||||
<Link href="/"> |
||||
<a className={router.pathname === "/" ? "nav-link active" : "nav-link"} aria-current="page"> |
||||
<i className="bi-house-door pe-none me-2" width="16" height="16" /> |
||||
Home |
||||
</a> |
||||
</Link> |
||||
</li> |
||||
<li className="nav-item"> |
||||
<Link href="/account"> |
||||
<a className={router.pathname === "/account" ? "nav-link active" : "nav-link"} aria-current="page"> |
||||
<i className="bi-person-square pe-none me-2" width="16" height="16" /> |
||||
Account |
||||
</a> |
||||
</Link> |
||||
</li> |
||||
<li className="nav-item"> |
||||
<Link href="/domains"> |
||||
<a className={router.pathname === "/domains" ? "nav-link active" : "nav-link"} aria-current="page"> |
||||
<i className="bi-card-list pe-none me-2" width="16" height="16" /> |
||||
Domains |
||||
</a> |
||||
</Link> |
||||
</li> |
||||
<li className="nav-item"> |
||||
<Link href="/map/hosts"> |
||||
<a className={router.pathname === "/map/[name]" && router.query.name === "hosts" ? "nav-link active" : "nav-link"} aria-current="page"> |
||||
<i className="bi-card-checklist pe-none me-2" width="16" height="16" /> |
||||
Active Domains |
||||
</a> |
||||
</Link> |
||||
</li> |
||||
<li className="nav-item"> |
||||
<Link href="/map/backends"> |
||||
<a className={router.pathname === "/map/[name]" && router.query.name === "backends" ? "nav-link active" : "nav-link"} aria-current="page"> |
||||
<i className="bi-hdd-network pe-none me-2" width="16" height="16" /> |
||||
Backends |
||||
</a> |
||||
</Link> |
||||
</li> |
||||
<li className="nav-item"> |
||||
<Link href="/map/ddos"> |
||||
<a className={router.pathname === "/map/[name]" && router.query.name === "ddos" ? "nav-link active" : "nav-link"} aria-current="page"> |
||||
<i className="bi-shield-check pe-none me-2" width="16" height="16" /> |
||||
Protection Rules |
||||
</a> |
||||
</Link> |
||||
</li> |
||||
<li className="nav-item"> |
||||
<Link href="/map/blocked"> |
||||
<a className={router.pathname === "/map/[name]" && router.query.name === "blocked" ? "nav-link active" : "nav-link"} aria-current="page"> |
||||
<i className="bi-person-slash pe-none me-2" width="16" height="16" /> |
||||
IP Blacklist |
||||
</a> |
||||
</Link> |
||||
</li> |
||||
<li className="nav-item"> |
||||
<Link href="/map/whitelist"> |
||||
<a className={router.pathname === "/map/[name]" && router.query.name === "whitelist" ? "nav-link active" : "nav-link"} aria-current="page"> |
||||
<i className="bi-person-check pe-none me-2" width="16" height="16" /> |
||||
IP Whitelist |
||||
</a> |
||||
</Link> |
||||
</li> |
||||
<li className="nav-item"> |
||||
<Link href="/map/maintenance"> |
||||
<a className={router.pathname === "/map/[name]" && router.query.name === "maintenance" ? "nav-link active" : "nav-link"} aria-current="page"> |
||||
<i className="bi-info-circle pe-none me-2" width="16" height="16" /> |
||||
Maintenance Mode |
||||
</a> |
||||
</Link> |
||||
</li> |
||||
</ul> |
||||
<hr className="mt-auto" /> |
||||
<ul className="nav nav-pills flex-column"> |
||||
<li className="nav-item"> |
||||
<Link href="/login"> |
||||
<a className={router.pathname === "/login" ? "nav-link active" : "nav-link"} aria-current="page"> |
||||
<i className="bi-door-open pe-none me-2" width="16" height="16" /> |
||||
Login |
||||
</a> |
||||
</Link> |
||||
</li> |
||||
<li className="nav-item"> |
||||
<Link href="/register"> |
||||
<a className={router.pathname === "/register" ? "nav-link active" : "nav-link"} aria-current="page"> |
||||
<i className="bi-person-plus pe-none me-2" width="16" height="16" /> |
||||
Register |
||||
</a> |
||||
</Link> |
||||
</li> |
||||
</ul> |
||||
</>); |
||||
}) |
@ -0,0 +1,16 @@ |
||||
import Head from 'next/head'; |
||||
import MenuLinks from '../components/MenuLinks'; |
||||
|
||||
const Menu = () => ( |
||||
<> |
||||
<Head> |
||||
<title>Menu</title> |
||||
</Head> |
||||
|
||||
<div className="bg-dark p-4"> |
||||
<MenuLinks /> |
||||
</div> |
||||
</> |
||||
); |
||||
|
||||
export default Menu; |
Loading…
Reference in new issue