From d49ab1a53e1cb5915c6e1a4542326b68146197f5 Mon Sep 17 00:00:00 2001 From: lllllllillllllillll Date: Sat, 16 Dec 2023 16:59:51 -0800 Subject: [PATCH 01/31] auth middleware, pm2, fixed missing session data --- CHANGELOG.md | 5 ++++ Dockerfile | 5 +++- README.md | 9 ++++--- app.js | 2 ++ controllers/auth.js | 16 +++++++++--- docker-compose.yaml | 3 ++- package-lock.json | 55 +++++++++++++++++++++++++++++++++++++++ package.json | 1 + routes/index.js | 55 ++++++++++++++++++++++----------------- views/partials/footer.ejs | 2 +- 10 files changed, 119 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 207d4a7..7f701eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v0.09 (dev) +* Added authentication middleware to router. +* Added gzip compression. +* Added PM2 to dockerfile. + ## v0.08 (Dec 15th 2023) * Updates to compose file and instructions from [steveiliop56](https://github.com/steveiliop56) * Added SECRET field to compose file as a basic security measure. diff --git a/Dockerfile b/Dockerfile index 23c58c9..f962484 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,19 +2,22 @@ FROM node:21-alpine +ENV NODE_ENV=production WORKDIR /app +RUN npm install pm2 -g RUN --mount=type=bind,source=package.json,target=package.json \ --mount=type=bind,source=package-lock.json,target=package-lock.json \ --mount=type=cache,target=/root/.npm \ npm ci --omit=dev + USER root COPY . . EXPOSE 8000 -CMD node app.js \ No newline at end of file +CMD ["pm2-runtime", "app.js"] diff --git a/README.md b/README.md index 7ba807c..1f5376b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # DweebUI DweebUI is a simple Docker web interface created using Javascript, Node.JS, and Express. -Pre-Pre-Pre-Pre-Pre Alpha v0.08 ( :fire: Experimental. Don't install on any servers you care about :fire: ) +Pre-Pre-Pre-Pre-Pre Alpha v0.09 ( :fire: Experimental. Don't install on any servers you care about :fire: ) [![GitHub Stars](https://img.shields.io/github/stars/lllllllillllllillll/DweebUI)](https://github.com/lllllllillllllillll) [![GitHub Activity](https://img.shields.io/github/commit-activity/y/lllllllillllllillll/DweebUI)](https://github.com/lllllllillllllillll) @@ -45,7 +45,7 @@ services: dweebui: container_name: dweebui - image: lllllllillllllillll/dweebui:v0.08 + image: lllllllillllllillll/dweebui:v0.09-dev # build: # context: . environment: @@ -97,4 +97,7 @@ sudo ./setup.sh * Dockerode and dockerode-compose by Apocas: https://github.com/apocas/dockerode * UI was built using HTML and CSS elements from https://tabler.io/ * Apps template based on Portainer template provided by Lissy93: https://github.com/Lissy93/portainer-templates -* Icons from Walkxcode with some renames and additions: https://github.com/walkxcode/dashboard-icons \ No newline at end of file +* Icons from Walkxcode with some renames and additions: https://github.com/walkxcode/dashboard-icons + + +## Supporters \ No newline at end of file diff --git a/app.js b/app.js index 6635f59..bca79e3 100644 --- a/app.js +++ b/app.js @@ -2,6 +2,7 @@ const express = require("express"); const app = express(); const session = require("express-session"); +const compression = require('compression'); const PORT = process.env.PORT || 8000; // Router @@ -30,6 +31,7 @@ const sessionMiddleware = session({ // Middleware app.set('view engine', 'ejs'); app.use([ + compression(), express.static("public"), express.json(), express.urlencoded({ extended: true }), diff --git a/controllers/auth.js b/controllers/auth.js index f83cca3..a1f5fb9 100644 --- a/controllers/auth.js +++ b/controllers/auth.js @@ -29,11 +29,13 @@ exports.processLogin = async function(req,res){ // compare the password. let match = await bcrypt.compare(password,existingUser.password); if(match){ + // set the session. req.session.user = existingUser.username; req.session.UUID = existingUser.UUID; req.session.role = existingUser.role; + // Redirect to the home page. res.redirect("/"); }else{ @@ -118,10 +120,16 @@ exports.processRegister = async function(req,res){ avatar: `` }); - // set the session. - req.session.user = user.username; - req.session.UUID = user.UUID; - req.session.role = user.role; + let newUser = await User.findOne({ where: {email:email}}); + + let match = await bcrypt.compare(password,newUser.password); + if(match){ + console.log(`User session created for ${newUser.username}`) + req.session.user = newUser.username; + req.session.UUID = newUser.UUID; + req.session.role = newUser.role; + } + // Redirect to the home page. res.redirect("/"); } diff --git a/docker-compose.yaml b/docker-compose.yaml index 828837c..5a47141 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,10 +2,11 @@ version: "3.9" services: dweebui: container_name: dweebui - image: lllllllillllllillll/dweebui:v0.08 + image: lllllllillllllillll/dweebui:v0.09-dev # build: # context: . environment: + NODE_ENV: production PORT: 8000 SECRET: MrWiskers #Proxy_Manager: enabled diff --git a/package-lock.json b/package-lock.json index d552b0d..77fc3b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "bcrypt": "^5.1.0", "child_process": "^1.0.2", + "compression": "^1.7.4", "dockerode": "^4.0.0", "dockerode-compose": "^1.4.0", "ejs": "^3.1.9", @@ -496,6 +497,60 @@ "color-support": "bin.js" } }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/compression": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "dependencies": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/compression/node_modules/bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/compression/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/compression/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/compression/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", diff --git a/package.json b/package.json index 1e8b47f..65741c8 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "dependencies": { "bcrypt": "^5.1.0", "child_process": "^1.0.2", + "compression": "^1.7.4", "dockerode": "^4.0.0", "dockerode-compose": "^1.4.0", "ejs": "^3.1.9", diff --git a/routes/index.js b/routes/index.js index 0fac784..abd12ab 100644 --- a/routes/index.js +++ b/routes/index.js @@ -9,40 +9,47 @@ const { Users } = require("../controllers/users"); const { Account } = require("../controllers/account"); const { Settings } = require("../controllers/settings"); +// Authentication middleware +const authenticate = (req, res, next) => { + if (req.session && req.session.user) { + console.log("User:", req.session.user); + console.log("UUID:", req.session.UUID); + console.log("Role:", req.session.role); + console.log("Page:", req.originalUrl); + next(); + } else { + res.redirect("/login"); + } +}; // Dashboard -router.get("/", Dashboard); -router.post("/addsite", AddSite) -router.post("/removesite", RemoveSite) -router.get("/refreshsites", RefreshSites) -router.post("/disablesite", DisableSite) -router.post("/enablesite", EnableSite) +router.get("/", authenticate, Dashboard); +router.post("/addsite", authenticate, AddSite); +router.post("/removesite", authenticate, RemoveSite); +router.get("/refreshsites", authenticate, RefreshSites); +router.post("/disablesite", authenticate, DisableSite); +router.post("/enablesite", authenticate, EnableSite); // Auth -router.get("/login",Login); -router.post("/login",processLogin); +router.get("/login", Login); +router.post("/login", processLogin); router.get("/register", Register); -router.post("/register",processRegister); -router.get("/logout",Logout); +router.post("/register", processRegister); +router.get("/logout", Logout); // Apps page -router.get("/apps", Apps); -router.get("/apps/:page", Apps); -router.get("/apps/:template/:page", Apps); -router.post("/apps", searchApps); - - +router.get("/apps", authenticate, Apps); +router.get("/apps/:page", authenticate, Apps); +router.get("/apps/:template/:page", authenticate, Apps); +router.post("/apps", authenticate, searchApps); // Settings page -router.get("/settings", Settings); -router.get("/account", Account); - - - -router.post("/install", Install) -router.post("/uninstall", Uninstall) +router.get("/settings", authenticate, Settings); +router.get("/account", authenticate, Account); -router.get("/users", Users); +router.post("/install", authenticate, Install); +router.post("/uninstall", authenticate, Uninstall); +router.get("/users", authenticate, Users); module.exports = router; \ No newline at end of file diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs index 2ae8f80..8a52e05 100644 --- a/views/partials/footer.ejs +++ b/views/partials/footer.ejs @@ -24,7 +24,7 @@
  • - v0.08 + v0.09
  • From 9a065a8883ff0140b88ebc7bd45715461ee44b81 Mon Sep 17 00:00:00 2001 From: lllllllillllllillll Date: Sun, 17 Dec 2023 12:28:58 -0800 Subject: [PATCH 02/31] created pages for images, networks, and volumes --- README.md | 10 +- app.js | 7 +- controllers/images.js | 54 ++++++ controllers/networks.js | 54 ++++++ controllers/volumes.js | 54 ++++++ functions/system.js | 78 +++++++- routes/index.js | 11 +- views/pages/images.ejs | 366 ++++++++++++++++++++++++++++++++++++++ views/pages/networks.ejs | 71 ++++++++ views/pages/users.ejs | 18 +- views/pages/volumes.ejs | 71 ++++++++ views/partials/navbar.ejs | 33 ++-- 12 files changed, 784 insertions(+), 43 deletions(-) create mode 100644 controllers/images.js create mode 100644 controllers/networks.js create mode 100644 controllers/volumes.js create mode 100644 views/pages/images.ejs create mode 100644 views/pages/networks.ejs create mode 100644 views/pages/volumes.ejs diff --git a/README.md b/README.md index 1f5376b..2b72963 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # DweebUI DweebUI is a simple Docker web interface created using Javascript, Node.JS, and Express. -Pre-Pre-Pre-Pre-Pre Alpha v0.09 ( :fire: Experimental. Don't install on any servers you care about :fire: ) +v0.09 [![GitHub Stars](https://img.shields.io/github/stars/lllllllillllllillll/DweebUI)](https://github.com/lllllllillllllillll) [![GitHub Activity](https://img.shields.io/github/commit-activity/y/lllllllillllllillll/DweebUI)](https://github.com/lllllllillllllillll) @@ -9,10 +9,6 @@ Pre-Pre-Pre-Pre-Pre Alpha v0.09 ( :fire: Experimental. Don't install on any serv [![GitHub License](https://img.shields.io/github/license/lllllllillllllillll/DweebUI)](https://github.com/lllllllillllllillll/DweebUI/blob/main/LICENSE) -* This is a personal project that I decided to share. I'm sure it has plenty of bugs and mistakes. -* I haven't used Github very much and I'm still new to Javascript. -* I probably should have waited a lot longer to share this :| - @@ -100,4 +96,6 @@ sudo ./setup.sh * Icons from Walkxcode with some renames and additions: https://github.com/walkxcode/dashboard-icons -## Supporters \ No newline at end of file +## Supporters + +* MM (Patreon) \ No newline at end of file diff --git a/app.js b/app.js index bca79e3..dbbef8c 100644 --- a/app.js +++ b/app.js @@ -9,7 +9,7 @@ const PORT = process.env.PORT || 8000; const routes = require("./routes"); // Functions and variables -const { serverStats, containerList, containerStats, containerAction, containerLogs, hiddenContainers } = require('./functions/system'); +const { serverStats, containerList, containerStats, containerAction, containerLogs, hiddenContainers, dockerImages, dockerVolumes, dockerNetworks } = require('./functions/system'); let sentList, clicked; app.locals.site_list = ''; @@ -58,6 +58,11 @@ io.on('connection', (socket) => { if (sentList != null) { socket.emit('cards', sentList); } if((app.locals.install != '') && (app.locals.install != null)){ socket.emit('install', app.locals.install); } + + console.log(`Imags: ${dockerImages()}`); + console.log(`Volumes: ${dockerVolumes()}`); + console.log(`Networks: ${dockerNetworks()}`); + // Send server metrics let ServerStats = setInterval(async () => { socket.emit('metrics', await serverStats()); diff --git a/controllers/images.js b/controllers/images.js new file mode 100644 index 0000000..ff2dbbf --- /dev/null +++ b/controllers/images.js @@ -0,0 +1,54 @@ +const User = require('../database/UserModel'); + +exports.Users = async function(req, res) { + if (req.session.role == "admin") { + + // Get the user. + let user = await User.findOne({ where: { UUID: req.session.UUID }}); + let user_list = ` + + + ID + Avatar + Name + Username + Email + UUID + Role + Status + Actions + ` + + let users = await User.findAll(); + users.forEach((account) => { + full_name = account.first_name + ' ' + account.last_name; + user_info = ` + + + ${user.id} + ${account.avatar} + ${full_name} + ${account.username} + ${account.email} + ${account.UUID} + ${account.role} + Active + Edit + ` + + user_list += user_info; + }); + + // Render the home page + res.render("pages/users", { + name: user.first_name + ' ' + user.last_name, + role: user.role, + avatar: user.avatar, + isLoggedIn: true, + user_list: user_list + }); + } else { + // Redirect to the login page + res.redirect("/login"); + } +} \ No newline at end of file diff --git a/controllers/networks.js b/controllers/networks.js new file mode 100644 index 0000000..ff2dbbf --- /dev/null +++ b/controllers/networks.js @@ -0,0 +1,54 @@ +const User = require('../database/UserModel'); + +exports.Users = async function(req, res) { + if (req.session.role == "admin") { + + // Get the user. + let user = await User.findOne({ where: { UUID: req.session.UUID }}); + let user_list = ` + + + ID + Avatar + Name + Username + Email + UUID + Role + Status + Actions + ` + + let users = await User.findAll(); + users.forEach((account) => { + full_name = account.first_name + ' ' + account.last_name; + user_info = ` + + + ${user.id} + ${account.avatar} + ${full_name} + ${account.username} + ${account.email} + ${account.UUID} + ${account.role} + Active + Edit + ` + + user_list += user_info; + }); + + // Render the home page + res.render("pages/users", { + name: user.first_name + ' ' + user.last_name, + role: user.role, + avatar: user.avatar, + isLoggedIn: true, + user_list: user_list + }); + } else { + // Redirect to the login page + res.redirect("/login"); + } +} \ No newline at end of file diff --git a/controllers/volumes.js b/controllers/volumes.js new file mode 100644 index 0000000..ff2dbbf --- /dev/null +++ b/controllers/volumes.js @@ -0,0 +1,54 @@ +const User = require('../database/UserModel'); + +exports.Users = async function(req, res) { + if (req.session.role == "admin") { + + // Get the user. + let user = await User.findOne({ where: { UUID: req.session.UUID }}); + let user_list = ` + + + ID + Avatar + Name + Username + Email + UUID + Role + Status + Actions + ` + + let users = await User.findAll(); + users.forEach((account) => { + full_name = account.first_name + ' ' + account.last_name; + user_info = ` + + + ${user.id} + ${account.avatar} + ${full_name} + ${account.username} + ${account.email} + ${account.UUID} + ${account.role} + Active + Edit + ` + + user_list += user_info; + }); + + // Render the home page + res.render("pages/users", { + name: user.first_name + ' ' + user.last_name, + role: user.role, + avatar: user.avatar, + isLoggedIn: true, + user_list: user_list + }); + } else { + // Redirect to the login page + res.redirect("/login"); + } +} \ No newline at end of file diff --git a/functions/system.js b/functions/system.js index 3e12d55..04aa434 100644 --- a/functions/system.js +++ b/functions/system.js @@ -312,4 +312,80 @@ module.exports.containerLogs = function (data) { }); }); }); -}; \ No newline at end of file +}; + + + +module.exports.dockerImages = async function () { + let image_list = ''; + + const data = await docker.listImages(); + + return data; + + // for (const image of data) { + + // let imageVersion = image.RepoTags[0].split('/'); + // let service = imageVersion[imageVersion.length - 1].split(':')[0]; + + // let image_info = { + // name: image.RepoTags[0], + // service: service, + // id: image.Id, + // size: image.Size, + // style: "Compact" + // } + + // let dockerCard = dashCard(image_info); + + // image_list += dockerCard; + // } + + // return image_list; +} + + +module.exports.dockerVolumes = async function () { + let volume_list = ''; + + const data = await docker.listVolumes(); + + return data; + + // for (const volume of data.Volumes) { + + // let volume_info = { + // name: volume.Name, + // style: "Compact" + // } + + // let dockerCard = dashCard(volume_info); + + // volume_list += dockerCard; + // } + + // return volume_list; +} + + +module.exports.dockerNetworks = async function () { + let network_list = ''; + + const data = await docker.listNetworks(); + + return data; + + // for (const network of data) { + + // let network_info = { + // name: network.Name, + // style: "Compact" + // } + + // let dockerCard = dashCard(network_info); + + // network_list += dockerCard; + // } + + // return network_list; +} \ No newline at end of file diff --git a/routes/index.js b/routes/index.js index abd12ab..55b671f 100644 --- a/routes/index.js +++ b/routes/index.js @@ -5,6 +5,10 @@ const { Dashboard, AddSite, RemoveSite, RefreshSites, DisableSite, EnableSite } const { Login, processLogin, Logout, Register, processRegister } = require("../controllers/auth"); const { Apps, searchApps, Install, Uninstall } = require("../controllers/apps"); +const { Images } = require("../controllers/images"); +const { Volumes } = require("../controllers/volumes"); +const { Networks } = require("../controllers/networks"); + const { Users } = require("../controllers/users"); const { Account } = require("../controllers/account"); const { Settings } = require("../controllers/settings"); @@ -12,10 +16,7 @@ const { Settings } = require("../controllers/settings"); // Authentication middleware const authenticate = (req, res, next) => { if (req.session && req.session.user) { - console.log("User:", req.session.user); - console.log("UUID:", req.session.UUID); - console.log("Role:", req.session.role); - console.log("Page:", req.originalUrl); + console.log(`User ${req.session.user} [${req.session.role} : ${req.session.UUID}] accessed ${req.originalUrl}`) next(); } else { res.redirect("/login"); @@ -30,6 +31,8 @@ router.get("/refreshsites", authenticate, RefreshSites); router.post("/disablesite", authenticate, DisableSite); router.post("/enablesite", authenticate, EnableSite); +router.get("/images", authenticate, Images); + // Auth router.get("/login", Login); router.post("/login", processLogin); diff --git a/views/pages/images.ejs b/views/pages/images.ejs new file mode 100644 index 0000000..c17cfb9 --- /dev/null +++ b/views/pages/images.ejs @@ -0,0 +1,366 @@ + + + + + + + Images + + + + + + +
    + + + <%- include('../partials/navbar.ejs') %> + +
    + + + +
    +
    + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Steel VengeanceCedar Point, United StatesRMC Hybrid100,0%August 05, 202174 +
    +
    30%
    +
    +
    +
    + 30% Complete +
    +
    +
    +
    +
    Fury 325Carowinds, United StatesB&M Giga, Hyper, Steel99,3%January 01, 201949 +
    +
    48%
    +
    +
    +
    + 48% Complete +
    +
    +
    +
    +
    WildfireKolmården SwedenRMC Twister, Wooden, Terrain99,3%December 28, 20188 +
    +
    9%
    +
    +
    +
    + 9% Complete +
    +
    +
    +
    +
    Lightning RodDollywood, United StatesRMC Wooden99,1%November 11, 2020104 +
    +
    98%
    +
    +
    +
    + 98% Complete +
    +
    +
    +
    +
    MaverickCedar Point, United StatesIntamin Rocket, Steel99,1%November 14, 202186 +
    +
    46%
    +
    +
    +
    + 46% Complete +
    +
    +
    +
    +
    El ToroSix Flags Great Adventure, United StatesIntamin Twister, Wooden99,0%February 11, 2021130 +
    +
    29%
    +
    +
    +
    + 29% Complete +
    +
    +
    +
    +
    Twisted ColossusSix Flags Magic Mountain, United StatesRMC Hybrid98,9%November 02, 201930 +
    +
    57%
    +
    +
    +
    + 57% Complete +
    +
    +
    +
    +
    Eejanaika newFuji-Q Highland, JapanS&S Power 4th Dimension, Steel98,6%March 14, 2021162 +
    +
    91%
    +
    +
    +
    + 91% Complete +
    +
    +
    +
    +
    Wicked CycloneSix Flags New England, United StatesRMC Hybrid98,2%October 03, 2019174 +
    +
    3%
    +
    +
    +
    + 3% Complete +
    +
    +
    +
    +
    ShambhalaPort Aventura, SpainB&M Hyper, Steel98,2%September 07, 2018111 +
    +
    24%
    +
    +
    +
    + 24% Complete +
    +
    +
    +
    +
    TaronPhantasialand, GermanyIntamin Sit Down, Steel98,2%November 24, 2018130 +
    +
    48%
    +
    +
    +
    + 48% Complete +
    +
    +
    +
    +
    Expedition Ge ForceHoliday Park, GermanyIntamin Megacoaster, Steel98,2%July 06, 2019157 +
    +
    57%
    +
    +
    +
    + 57% Complete +
    +
    +
    +
    +
    Storm ChaserKentucky Kingdom, United StatesRMC Steel97,9%September 03, 201943 +
    +
    42%
    +
    +
    +
    + 42% Complete +
    +
    +
    +
    +
    HelixLiseberg, SwedenMack Looper, Steel, Terrain97,9%April 26, 2018151 +
    +
    54%
    +
    +
    +
    + 54% Complete +
    +
    +
    +
    +
    Outlaw RunSilver Dollar City, United StatesRMC Hybrid96,6%May 31, 2019131 +
    +
    64%
    +
    +
    +
    + 64% Complete +
    +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    + <%- include('../partials/footer.ejs') %> +
    +
    + + + + + + \ No newline at end of file diff --git a/views/pages/networks.ejs b/views/pages/networks.ejs new file mode 100644 index 0000000..b927d16 --- /dev/null +++ b/views/pages/networks.ejs @@ -0,0 +1,71 @@ + + + + + + + Users + + + + + + +
    + + + <%- include('../partials/navbar.ejs') %> + +
    + + + +
    +
    +
    + +
    +
    +
    + + + + <%- user_list %> + + +
    +
    +
    +
    + + +
    +
    +
    + <%- include('../partials/footer.ejs') %> +
    +
    + + + + + + \ No newline at end of file diff --git a/views/pages/users.ejs b/views/pages/users.ejs index de2474f..b927d16 100644 --- a/views/pages/users.ejs +++ b/views/pages/users.ejs @@ -1,19 +1,10 @@ - Users - + + + +
    + + + <%- include('../partials/navbar.ejs') %> + +
    + + + +
    +
    +
    + +
    +
    +
    + + + + <%- user_list %> + + +
    +
    +
    +
    + + +
    +
    +
    + <%- include('../partials/footer.ejs') %> +
    +
    + + + + + + \ No newline at end of file diff --git a/views/partials/navbar.ejs b/views/partials/navbar.ejs index 73178a5..82cdfdc 100644 --- a/views/partials/navbar.ejs +++ b/views/partials/navbar.ejs @@ -185,25 +185,25 @@ @@ -221,26 +221,25 @@ - From 837c21fdb8ad7bd99b2531ff6544ac872bfdd798 Mon Sep 17 00:00:00 2001 From: lllllllillllllillll Date: Sun, 17 Dec 2023 12:41:13 -0800 Subject: [PATCH 03/31] fixed test page. --- controllers/images.js | 4 ++-- views/partials/navbar.ejs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/images.js b/controllers/images.js index ff2dbbf..1c82544 100644 --- a/controllers/images.js +++ b/controllers/images.js @@ -1,6 +1,6 @@ const User = require('../database/UserModel'); -exports.Users = async function(req, res) { +exports.Images = async function(req, res) { if (req.session.role == "admin") { // Get the user. @@ -40,7 +40,7 @@ exports.Users = async function(req, res) { }); // Render the home page - res.render("pages/users", { + res.render("pages/images", { name: user.first_name + ' ' + user.last_name, role: user.role, avatar: user.avatar, diff --git a/views/partials/navbar.ejs b/views/partials/navbar.ejs index 82cdfdc..0438029 100644 --- a/views/partials/navbar.ejs +++ b/views/partials/navbar.ejs @@ -173,7 +173,7 @@
    + + + + \ No newline at end of file diff --git a/views/pages/networks.ejs b/views/pages/networks.ejs index b927d16..57cdb45 100644 --- a/views/pages/networks.ejs +++ b/views/pages/networks.ejs @@ -4,7 +4,7 @@ - Users + Networks + @import url('fonts/inter.css'); + :root { + --tblr-font-sans-serif: 'Inter Var', -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif; + } + body { + font-feature-settings: "cv03", "cv04", "cv11"; + } + - +
    - <%- include('../partials/navbar.ejs') %> + <%- include('navbar.ejs') %>
    - <%- include('../partials/footer.ejs') %> + <%- include('footer.ejs') %> - - + + \ No newline at end of file diff --git a/views/pages/apps.ejs b/views/apps.ejs similarity index 92% rename from views/pages/apps.ejs rename to views/apps.ejs index 206c2e5..596b34c 100644 --- a/views/pages/apps.ejs +++ b/views/apps.ejs @@ -4,10 +4,10 @@ - Apps list. + DweebUI - Apps - - + + - +
    - <%- include('../partials/navbar.ejs') %> + <%- include('navbar.ejs') %>
    @@ -99,13 +99,13 @@
    - <%- include('../partials/footer.ejs') %> + <%- include('footer.ejs') %> - - + + \ No newline at end of file diff --git a/views/dashboard.ejs b/views/dashboard.ejs new file mode 100644 index 0000000..b76e34a --- /dev/null +++ b/views/dashboard.ejs @@ -0,0 +1,1093 @@ + + + + + + + DweebUI - Dashboard + + + + + + +
    + + <%- include('navbar.ejs') %> +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + + + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    + + <%- include('footer.ejs') %> + +
    +
    + + + + + + + + + + + + + + diff --git a/views/partials/footer.ejs b/views/footer.ejs similarity index 99% rename from views/partials/footer.ejs rename to views/footer.ejs index 8a52e05..cdd7dc2 100644 --- a/views/partials/footer.ejs +++ b/views/footer.ejs @@ -24,7 +24,7 @@
  • - v0.09 + v0.10
  • diff --git a/views/images.ejs b/views/images.ejs new file mode 100644 index 0000000..a893c58 --- /dev/null +++ b/views/images.ejs @@ -0,0 +1,226 @@ + + + + + + + DweebUI - Images + + + + + +
    + + <%- include('navbar.ejs') %> +
    + + + +
    +
    +
    + +
    +
    +
    +

    Docker Images

    + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Caddy2f148ddb6662b4245ef4ced637e928eaf67a8a1941572d69627652253e779366LatestIn useAugust 05, 202169.27 MBDetails
    clamav/clamavc447f9c713058cdb915c5becbef004a678cd7b8d6f5d70ec53479ba7687c3375LatestIn useJanuary 01, 2019546.22 MBDetails
    linuxserver/code-serveraf09184f86e955b33bef7634862430f54899cc9ca5e492d1530451caa1d99dc0LatestUnusedDecember 28, 201863.91 MBDetails
    +
    + + +
    +
    + +
    +
    +
    + + <%- include('footer.ejs') %> + +
    +
    + + + + + + + + + + + + + \ No newline at end of file diff --git a/views/pages/login.ejs b/views/login.ejs similarity index 54% rename from views/pages/login.ejs rename to views/login.ejs index 4d67cca..b5069ff 100644 --- a/views/pages/login.ejs +++ b/views/login.ejs @@ -6,24 +6,24 @@ DweebUI - Login - - + + - +
    - +
    @@ -36,31 +36,28 @@
    <% } %> -
    +
    - - - - -
    -
    +
    + + Forgot password +
    -
    - Don't have account yet? Sign up +
    + Don't have account? Register
    - - + + \ No newline at end of file diff --git a/views/partials/navbar.ejs b/views/navbar.ejs similarity index 90% rename from views/partials/navbar.ejs rename to views/navbar.ejs index 0438029..9ded793 100644 --- a/views/partials/navbar.ejs +++ b/views/navbar.ejs @@ -1,14 +1,13 @@