Skip to content

Commit

Permalink
sidebar added
Browse files Browse the repository at this point in the history
  • Loading branch information
daneedev committed May 1, 2024
1 parent 10b9ee4 commit a073c83
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const SettingsModel = require('../models/Settings');
const { sha256 } = require('js-sha256');

router.get("/", checkSetup, checkAuth, async function (req, res) {
res.render("dash.html", {hostname: (await SettingsModel.findOne({where: {key: "hostname"}})).value, username: req.user.username, gravatarhash: sha256(req.user.email), credits: req.user.credits, pterourl: (await SettingsModel.findOne({where: {key: "pterourl"}})).value})
res.render("dash.html", {hostname: (await SettingsModel.findOne({where: {key: "hostname"}})).value, username: req.user.username, gravatarhash: sha256(req.user.email), credits: req.user.credits, pterourl: (await SettingsModel.findOne({where: {key: "pterourl"}})).value, isAdmin: req.user.admin})
})

router2.get("/", checkNotSetup, function (req, res) {
Expand Down
21 changes: 18 additions & 3 deletions views/dash.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,29 @@
<div class="flex flex-row flex-grow w-screen h-max bg-red-500">
<div class="w-64 h-full flex flex-col flex-grow items-center bg-slate-700 p-2">
<form class="w-full" action="/dash">
<button class="w-full bg-slate-700 hover:bg-slate-500 duration-300 rounded-lg text-white p-2 font-bold text-left mb-2" type="submit"><i class="fa-solid fa-home"></i>&nbsp;Home</button>
<button class="w-full bg-slate-700 hover:bg-slate-500 duration-300 rounded-lg text-lg text-white p-2 text-left mb-2" type="submit"><i class="fa-solid fa-home"></i>&nbsp;&nbsp;Home</button>
</form>
<form class="w-full" action="/dash/servers">
<button class="w-full bg-slate-700 hover:bg-slate-500 duration-300 rounded-lg text-white p-2 font-bold text-left mb-2" type="submit"><i class="fa-solid fa-server"></i>&nbsp;Your servers</button>
<button class="w-full bg-slate-700 hover:bg-slate-500 duration-300 rounded-lg text-lg text-white p-2 text-left mb-2" type="submit"><i class="fa-solid fa-server"></i>&nbsp;&nbsp;Your servers</button>
</form>
<form class="w-full" action="/dash/store">
<button class="w-full bg-slate-700 hover:bg-slate-500 duration-300 rounded-lg text-white p-2 font-bold text-left mb-2" type="submit"><i class="fa-solid fa-store"></i>&nbsp;Store</button>
<button class="w-full bg-slate-700 hover:bg-slate-500 duration-300 rounded-lg text-lg text-white p-2 text-left mb-2" type="submit"><i class="fa-solid fa-store"></i>&nbsp;&nbsp;Store</button>
</form>
{% if isAdmin %}
<p class="text-slate-400 text-lg font-bold mt-2 text-center">Administration</p>
<form class="w-full" action="/admin/users">
<button class="w-full bg-slate-700 hover:bg-slate-500 duration-300 rounded-lg text-lg text-white p-2 text-left mb-2" type="submit"><i class="fa-solid fa-users"></i>&nbsp;&nbsp;Users</button>
</form>
<form class="w-full" action="/admin/servers">
<button class="w-full bg-slate-700 hover:bg-slate-500 duration-300 rounded-lg text-lg text-white p-2 text-left mb-2" type="submit"><i class="fa-solid fa-server"></i>&nbsp;&nbsp;Servers</button>
</form>
<form class="w-full" action="/admin/plans">
<button class="w-full bg-slate-700 hover:bg-slate-500 duration-300 rounded-lg text-lg text-white p-2 text-left mb-2" type="submit"><i class="fa-solid fa-plane-up"></i>&nbsp;&nbsp;Server plans</button>
</form>
<form class="w-full" action="/admin/store">
<button class="w-full bg-slate-700 hover:bg-slate-500 duration-300 rounded-lg text-lg text-white p-2 text-left mb-2" type="submit"><i class="fa-solid fa-store"></i>&nbsp;&nbsp;Store</button>
</form>
{% endif %}
</div>
<div class="w-full h-full flex flex-col items-center justify-center bg-slate-800">
{% block content %}
Expand Down

0 comments on commit a073c83

Please sign in to comment.