updated logo. removed comments.

This commit is contained in:
lllllllillllllillll 2024-01-14 02:23:14 -08:00
parent 81a98d3f5d
commit e6ad8dff72
10 changed files with 61 additions and 67 deletions

1
.gitignore vendored
View file

@ -5,5 +5,4 @@
test
.dockerignore
.gitignore
appdata
docker-compose.yaml

View file

@ -13,7 +13,7 @@ Alpha v0.20 ( :fire: Experimental :fire: )
* This is a personal project I started to get more familiar with Javascript and Node.js.
* Some UI elements are placeholders.
* Please submit issues and post discussions so I know what features to focus on.
* Please post issues and discussions so I know what bugs and features to focus on.
* I probably should have waited a lot longer to share this :|
<a href="https://raw.githubusercontent.com/lllllllillllllillll/DweebUI/main/screenshots/dashboard1.png"><img src="https://raw.githubusercontent.com/lllllllillllllillll/DweebUI/main/screenshots/dashboard1.png" width="25%"/></a>

View file

@ -76,9 +76,7 @@ export const submitLogin = async function(req,res){
export const Logout = function(req,res){
const sessionId = req.session.id;
req.session.destroy(() => {
io.to(sessionId).disconnectSockets();
res.redirect("/login");
});
}

View file

@ -4,7 +4,7 @@ import { execSync } from "child_process";
import { docker } from "../server.js";
import DockerodeCompose from "dockerode-compose";
import { Syslog } from "../database/models.js";
import { containerCard } from "../components/containerCard.js";
// This entire page hurts to look at.
export const Install = async (req, res) => {
@ -177,7 +177,7 @@ export const Install = async (req, res) => {
(async () => {
await compose.pull();
await compose.up();
const syslog = await Syslog.create({
user: req.session.user,
email: null,
@ -185,10 +185,17 @@ export const Install = async (req, res) => {
message: `${name} installed successfully`,
ip: req.socket.remoteAddress
});
})();
} catch { console.log('error running compose file')}
} catch {
const syslog = await Syslog.create({
user: req.session.user,
email: null,
event: "App Installation",
message: `${name} installation failed`,
ip: req.socket.remoteAddress
});
}
}

View file

@ -7,11 +7,9 @@ export const Uninstall = async (req, res) => {
let { confirm, service_name } = req.body;
if (confirm == 'Yes') {
console.log(`Uninstalling ${service_name}`);
var containerName = docker.getContainer(`${service_name}`);
try {
await containerName.stop();
console.log(`Stopped ${service_name} container`);
} catch {
console.log(`Error stopping ${service_name} container`);
}
@ -29,7 +27,13 @@ export const Uninstall = async (req, res) => {
} catch {
console.log(`Error removing ${service_name} container`);
const syslog = await Syslog.create({
user: req.session.user,
email: null,
event: "App Removal",
message: `${service_name} uninstallation failed`,
ip: req.socket.remoteAddress
});
}
}
res.redirect('/');

View file

@ -132,20 +132,6 @@ socket.on('containerStats', (data) => {
});
// socket.on('install', (data) => {
// dockerCards.insertAdjacentHTML("afterend", data);
// });
// let containerLogs;
// function viewLogs(button) {
// if (button.name != 'refresh') {
// containerLogs = button.name;
// }
// socket.emit('logs', {container: containerLogs});
// }
socket.on('logs', (data) => {
logViewer.innerHTML = `<pre>${data}</pre>`;
});

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 413 B

View file

@ -22,6 +22,7 @@ let [cpu, ram, tx, rx, disk] = [0, 0, 0, 0, 0];
let [hidden, clicked, dockerEvents] = ['', false, ''];
let metricsInterval, cardsInterval, graphsInterval;
let cardList = '';
app.locals.installCard = '';
const statsArray = {};
// Socket.io admin ui

View file

@ -1,49 +1,47 @@
<header class="navbar navbar-expand-md d-print-none">
<script>
var themeStorageKey = "tablerTheme";
var defaultTheme = "dark";
var selectedTheme;
<script>
var themeStorageKey = "tablerTheme";
var defaultTheme = "light";
var selectedTheme;
(function (factory) {
typeof define === 'function' && define.amd ? define(factory) :
factory();
})((function () {
'use strict';
(function (factory) {
typeof define === 'function' && define.amd ? define(factory) :
factory();
})((function () {
'use strict';
var params = new Proxy(new URLSearchParams(window.location.search), {
get: function get(searchParams, prop) {
return searchParams.get(prop);
}
});
if (!!params.theme) {
localStorage.setItem(themeStorageKey, params.theme);
selectedTheme = params.theme;
} else {
var storedTheme = localStorage.getItem(themeStorageKey);
selectedTheme = storedTheme ? storedTheme : defaultTheme;
var params = new Proxy(new URLSearchParams(window.location.search), {
get: function get(searchParams, prop) {
return searchParams.get(prop);
}
});
if (selectedTheme === 'dark') {
document.body.setAttribute("data-bs-theme", selectedTheme);
} else {
document.body.removeAttribute("data-bs-theme");
}
}));
function toggleTheme(button) {
if (button.value == 'dark-theme') {
document.body.setAttribute("data-bs-theme", 'dark');
localStorage.setItem(themeStorageKey, 'dark');
}
else if (button.value == 'light-theme') {
document.body.removeAttribute("data-bs-theme");
localStorage.setItem(themeStorageKey, 'light');
}
if (!!params.theme) {
localStorage.setItem(themeStorageKey, params.theme);
selectedTheme = params.theme;
} else {
var storedTheme = localStorage.getItem(themeStorageKey);
selectedTheme = storedTheme ? storedTheme : defaultTheme;
}
</script>
if (selectedTheme === 'dark') {
document.body.setAttribute("data-bs-theme", selectedTheme);
} else {
document.body.removeAttribute("data-bs-theme");
}
}));
function toggleTheme(button) {
if (button.value == 'dark-theme') {
document.body.setAttribute("data-bs-theme", 'dark');
localStorage.setItem(themeStorageKey, 'dark');
}
else if (button.value == 'light-theme') {
document.body.removeAttribute("data-bs-theme");
localStorage.setItem(themeStorageKey, 'light');
}
}
</script>
<header class="navbar navbar-expand-md d-print-none">
<div class="container-xl">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-menu"
aria-controls="navbar-menu" aria-expanded="false" aria-label="Toggle navigation">