DweebUI/controllers/dashboard.js
lllllllillllllillll c2c4fcca89
v0.05
* Environment Variables and Labels are now unchecked by default.
* Support for Docker volumes.
* Fixed app uninstall.
* Fixed Proxy Manager.
* Updated functions to ignore the three DweebUI containers: DweebUI, DweebCache(redis), and DweebProxy(caddy).
* Visual updates: Tabs for networks, images, and volumes. Added 'update' option in container drop-down.
* Updated main.js to prevent javascript errors.
* Fix for templates using 'set' instead of 'default' in environment variables.
* Fixes for templates with no volumes or no labels.
* New README.md.
* New screenshots.
* Automatically persists data in docker volumes if there is no bind mount.
2023-11-16 18:01:24 -08:00

23 lines
No EOL
655 B
JavaScript

const User = require('../database/UserModel');
exports.Dashboard = async function (req, res) {
if (req.session.role == "admin") {
// get user data with matching UUID from sqlite database
let user = await User.findOne({ where: { UUID: req.session.UUID } });
// Render the home page
res.render("pages/dashboard", {
name: user.first_name + ' ' + user.last_name,
role: user.role,
avatar: user.avatar,
isLoggedIn: true,
site_list: req.app.locals.site_list,
});
} else {
// Redirect to the login page
res.redirect("/login");
}
}