Skip to content

Commit

Permalink
Merge pull request #1 from crocofied/next
Browse files Browse the repository at this point in the history
Update v.0.0.2-ALPHA
  • Loading branch information
crocofied authored Oct 5, 2024
2 parents 92a5f94 + a930508 commit 60eaea4
Show file tree
Hide file tree
Showing 25 changed files with 647 additions and 423 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VITE_API_URL=http://<YOUR_SERVER_IP>:5000
VITE_API_URL=http://<YOUR_SERVER_IP>:5000
CLIENT_URL=http://<YOUR_SERVER_IP>:3000
4 changes: 3 additions & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
<link rel="icon" href="/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AdminData</title>
<!-- Comment if development -->
<script src="/env-config.js"></script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
</html>
Binary file modified client/public/Cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 60 additions & 38 deletions client/src/common/components/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,69 @@
import { Link } from "react-router-dom";
import { useEffect, useState } from "react";
import axios from "axios";
import { FaHome, FaSyncAlt} from 'react-icons/fa';
import { IoSettingsSharp} from 'react-icons/io5';
import { MdOutlineLogout} from 'react-icons/md';
import { makePostRequest } from '../utils/api';


function Navbar() {
const [updateAvailable, setUpdateAvailable] = useState(false);
const [updateVersion, setUpdateVersion] = useState("");
useEffect(() => {
makePostRequest("/update_check")
.then(response => {
if (response.data.message === "Update available") {
setUpdateAvailable(true);
setUpdateVersion(response.data.latest);
}
});
}, []);
return (
<div className="navbar bg-base-200 shadow-xl w-24 h-screen border-r border-gray-800">
<div className="container mx-auto flex flex-col justify-between h-full pt-3">
<div className="flex-none">
<ul className="menu menu-vertical px-1">
<li>
<Link to="/dashboard" className="bg-base-300 text-white px-4 py-4 rounded-2xl mb-4">
<svg className="w-full h-auto max-w-xs" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 6V15H6V11C6 9.89543 6.89543 9 8 9C9.10457 9 10 9.89543 10 11V15H15V6L8 0L1 6Z" fill="#ffffff"/>
</svg>
</Link>
<Link to="/settings" className="bg-base-300 text-white px-4 py-4 rounded-2xl">
<svg className="w-full h-auto max-w-xs" viewBox="0 0 24 24" fill="#ffffff" xmlns="http://www.w3.org/2000/svg">
<path fillRule="evenodd" clipRule="evenodd" d="M14.2788 2.15224C13.9085 2 13.439 2 12.5 2C11.561 2 11.0915 2 10.7212 2.15224C10.2274 2.35523 9.83509 2.74458 9.63056 3.23463C9.53719 3.45834 9.50065 3.7185 9.48635 4.09799C9.46534 4.65568 9.17716 5.17189 8.69017 5.45093C8.20318 5.72996 7.60864 5.71954 7.11149 5.45876C6.77318 5.2813 6.52789 5.18262 6.28599 5.15102C5.75609 5.08178 5.22018 5.22429 4.79616 5.5472C4.47814 5.78938 4.24339 6.1929 3.7739 6.99993C3.30441 7.80697 3.06967 8.21048 3.01735 8.60491C2.94758 9.1308 3.09118 9.66266 3.41655 10.0835C3.56506 10.2756 3.77377 10.437 4.0977 10.639C4.57391 10.936 4.88032 11.4419 4.88029 12C4.88026 12.5581 4.57386 13.0639 4.0977 13.3608C3.77372 13.5629 3.56497 13.7244 3.41645 13.9165C3.09108 14.3373 2.94749 14.8691 3.01725 15.395C3.06957 15.7894 3.30432 16.193 3.7738 17C4.24329 17.807 4.47804 18.2106 4.79606 18.4527C5.22008 18.7756 5.75599 18.9181 6.28589 18.8489C6.52778 18.8173 6.77305 18.7186 7.11133 18.5412C7.60852 18.2804 8.2031 18.27 8.69012 18.549C9.17714 18.8281 9.46533 19.3443 9.48635 19.9021C9.50065 20.2815 9.53719 20.5417 9.63056 20.7654C9.83509 21.2554 10.2274 21.6448 10.7212 21.8478C11.0915 22 11.561 22 12.5 22C13.439 22 13.9085 22 14.2788 21.8478C14.7726 21.6448 15.1649 21.2554 15.3694 20.7654C15.4628 20.5417 15.4994 20.2815 15.5137 19.902C15.5347 19.3443 15.8228 18.8281 16.3098 18.549C16.7968 18.2699 17.3914 18.2804 17.8886 18.5412C18.2269 18.7186 18.4721 18.8172 18.714 18.8488C19.2439 18.9181 19.7798 18.7756 20.2038 18.4527C20.5219 18.2105 20.7566 17.807 21.2261 16.9999C21.6956 16.1929 21.9303 15.7894 21.9827 15.395C22.0524 14.8691 21.9088 14.3372 21.5835 13.9164C21.4349 13.7243 21.2262 13.5628 20.9022 13.3608C20.4261 13.0639 20.1197 12.558 20.1197 11.9999C20.1197 11.4418 20.4261 10.9361 20.9022 10.6392C21.2263 10.4371 21.435 10.2757 21.5836 10.0835C21.9089 9.66273 22.0525 9.13087 21.9828 8.60497C21.9304 8.21055 21.6957 7.80703 21.2262 7C20.7567 6.19297 20.522 5.78945 20.2039 5.54727C19.7799 5.22436 19.244 5.08185 18.7141 5.15109C18.4722 5.18269 18.2269 5.28136 17.8887 5.4588C17.3915 5.71959 16.7969 5.73002 16.3099 5.45096C15.8229 5.17191 15.5347 4.65566 15.5136 4.09794C15.4993 3.71848 15.4628 3.45833 15.3694 3.23463C15.1649 2.74458 14.7726 2.35523 14.2788 2.15224ZM12.5 15C14.1695 15 15.5228 13.6569 15.5228 12C15.5228 10.3431 14.1695 9 12.5 9C10.8305 9 9.47716 10.3431 9.47716 12C9.47716 13.6569 10.8305 15 12.5 15Z" fill="#ffffff"/>
</svg>
</Link>
</li>
</ul>
<>
<div className="navbar bg-base-200 shadow-xl w-24 h-screen border-r border-gray-800">
<div className="container mx-auto flex flex-col justify-between h-full pt-3">
<div className="flex-none">
<ul className="menu menu-vertical px-1">
<li>
<Link to="/dashboard" className="bg-base-300 text-white p-2 rounded-2xl mb-4 flex items-center justify-center w-16 h-16">
<FaHome className="w-10 h-10" />
</Link>
<Link to="/settings" className="bg-base-300 text-white p-2 rounded-2xl mb-4 flex items-center justify-center w-16 h-16">
<IoSettingsSharp className="w-10 h-10" />
</Link>
</li>
</ul>
</div>
<div className="flex-none">
<ul className="menu menu-vertical px-1">
{updateAvailable && (
<li>
<button onClick={() => document.getElementById('update_modal').showModal()} className="bg-base-300 text-white p-2 rounded-2xl mb-4 flex items-center justify-center w-16 h-16">
<FaSyncAlt className="w-10 h-10" />
</button>
</li>
)}
<li>
<Link to="/logout" className="bg-base-300 text-white p-2 rounded-2xl mb-4 flex items-center justify-center w-16 h-16">
<MdOutlineLogout className="w-10 h-10" />
</Link>
</li>
</ul>
</div>
</div>
<div className="flex-none">
<ul className="menu menu-vertical px-1">
<li><Link to="/logout" className="bg-base-300 text-white px-4 py-4 rounded-2xl">
<svg className="w-full h-auto max-w-xs" fill="#ffffff" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink"
width="800px" height="800px" viewBox="0 0 96.943 96.943"
xmlSpace="preserve">
<g>
<g>
<path d="M61.168,83.92H11.364V13.025H61.17c1.104,0,2-0.896,2-2V3.66c0-1.104-0.896-2-2-2H2c-1.104,0-2,0.896-2,2v89.623
c0,1.104,0.896,2,2,2h59.168c1.105,0,2-0.896,2-2V85.92C63.168,84.814,62.274,83.92,61.168,83.92z"/>
<path d="M96.355,47.058l-26.922-26.92c-0.75-0.751-2.078-0.75-2.828,0l-6.387,6.388c-0.781,0.781-0.781,2.047,0,2.828
l12.16,12.162H19.737c-1.104,0-2,0.896-2,2v9.912c0,1.104,0.896,2,2,2h52.644L60.221,67.59c-0.781,0.781-0.781,2.047,0,2.828
l6.387,6.389c0.375,0.375,0.885,0.586,1.414,0.586c0.531,0,1.039-0.211,1.414-0.586l26.922-26.92
c0.375-0.375,0.586-0.885,0.586-1.414C96.943,47.941,96.73,47.433,96.355,47.058z"/>
</g>
</g>
</svg>
</Link></li>
</ul>
</div>

<dialog id="update_modal" className="modal">
<form method="dialog" className="modal-box">
<h3 className="font-bold text-lg">Update Available</h3>
<p className="py-4">A new version ({updateVersion}) is available. If you want to update, please follow the <a href="https://www.admindata.xyz/update.html" className="link" target="_blank">Update Instructions</a>.</p>
<div className="modal-action">
<button className="btn" onClick={() => document.getElementById('update_modal').close()}>Close</button>
</div>
</div>
</div>
</form>
</dialog>
</>
);
}

Expand Down
28 changes: 0 additions & 28 deletions client/src/common/components/SessionChecker.jsx

This file was deleted.

Loading

0 comments on commit 60eaea4

Please sign in to comment.