diff --git a/cogs/web/__pycache__/web.cpython-39.pyc b/cogs/web/__pycache__/web.cpython-39.pyc index 48d32dc..812facb 100644 Binary files a/cogs/web/__pycache__/web.cpython-39.pyc and b/cogs/web/__pycache__/web.cpython-39.pyc differ diff --git a/cogs/web/web.py b/cogs/web/web.py index e9ebc00..24cba8c 100644 --- a/cogs/web/web.py +++ b/cogs/web/web.py @@ -4,6 +4,8 @@ from discord.ext import commands import quart import toml import logging +from quart import render_template +from quart.helpers import make_response class WebServer(commands.Cog): def __init__(self, bot): diff --git a/main.py b/main.py index a8536d2..00d9236 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,5 @@ -import discord, flask, os, quart, sys, toml, time, datetime, logging -from quart import render_template -from quart.helpers import make_response +import discord, os, sys, toml, time, datetime, logging + from discord.ext import commands diff --git a/static/configuration.css b/static/configuration.css deleted file mode 100644 index fca533e..0000000 --- a/static/configuration.css +++ /dev/null @@ -1,88 +0,0 @@ -body { - font-family: Arial, sans-serif; - margin: 0; - padding: 0; - background-color: #2c3e50; - color: #fff; -} - -.logo { - width: 25; - height: 25; -} - -header { - background-color: #3e4982; - color: #fff; - padding: 20px; - text-align: center; -} - -header h1 { - margin: 0; -} - -.container { - display: flex; -} - -table { - font-family: Arial, Helvetica, sans-serif; - border-collapse: collapse; - width: 100%; -} - -table td, -#status th { - border: 1px solid #ddd; - padding: 8px; -} - -table tr:nth-child(even) { - background-color: #1c567d; -} - -table tr:hover { - background-color: #2980b9; -} - -table th { - padding-top: 12px; - padding-bottom: 12px; - text-align: left; - background-color: #04AA6D; - color: white; -} - -nav { - background-color: #34495e; - width: 200px; - padding: 20px; - text-align: center; -} - -nav ul { - list-style: none; - margin: 0; - padding: 0; -} - -nav li a { - color: #fff; - text-decoration: none; - padding: 10px 0; - display: block; -} - -nav li a:hover { - background-color: #2980b9; -} - -.selected { - background-color: #2980b9; -} - -main { - padding: 20px; - flex-grow: 1; -} \ No newline at end of file diff --git a/static/dashboard.css b/static/dashboard.css deleted file mode 100644 index b92a2c9..0000000 --- a/static/dashboard.css +++ /dev/null @@ -1,88 +0,0 @@ -body { - font-family: Arial, sans-serif; - margin: 0; - padding: 0; - background-color: #2c3e50; - color: #fff; -} - -.logo { - width: 25; - height: 25; -} - -header { - background-color: #3e4982; - color: #fff; - padding: 20px; - text-align: center; -} - -header h1 { - margin: 0; -} - -.container { - display: flex; -} - -table { - font-family: Arial, Helvetica, sans-serif; - border-collapse: collapse; - width: 100%; -} - -table td, -#status th { - border: 1px solid #ddd; - padding: 8px; -} - -table tr:nth-child(even) { - background-color: #1c567d; -} - -table tr:hover { - background-color: #2980b9; -} - -table th { - padding-top: 12px; - padding-bottom: 12px; - text-align: left; - background-color: #04AA6D; - color: white; -} - -nav { - background-color: #34495e; - width: 200px; - padding: 20px; - text-align: center; -} - -nav ul { - list-style: none; - margin: 0; - padding: 0; -} - -nav li a { - color: #fff; - text-decoration: none; - padding: 10px 0; - display: block; -} - -nav li a:hover { - background-color: #2980b9; -} - -.selected { - background-color: #2980b9; -} - -main { - padding: 20px; - flex-grow: 1; -} diff --git a/static/index.css b/static/index.css deleted file mode 100644 index 9ac95ae..0000000 --- a/static/index.css +++ /dev/null @@ -1,61 +0,0 @@ -body { - font-family: Arial, sans-serif; - margin: 0; - padding: 0; - background-color: #2c3e50; - color: #fff; -} -.selected { - background-color: #2980b9; -} -.logo { - width: 25; - height: 25; -} - -header { - background-color: #3e4982; - color: #fff; - padding: 20px; - text-align: center; -} - -header h1 { - margin: 0; -} - -.container { - display: flex; -} - -nav { - background-color: #34495e; - width: 200px; - padding: 20px; - text-align: center; -} - -nav ul { - list-style: none; - margin: 0; - padding: 0; -} - -nav li a { - color: #fff; - text-decoration: none; - padding: 10px 0; - display: block; -} - -nav li a:hover { - background-color: #2980b9; -} - -main { - padding: 20px; - flex-grow: 1; -} - - - diff --git a/static/js/configuration.js b/static/js/configuration.js deleted file mode 100644 index 4aa072e..0000000 --- a/static/js/configuration.js +++ /dev/null @@ -1,66 +0,0 @@ -const form = document.querySelector("form"); -const tokenInput = form.querySelector("#token"); -const nameInput = form.querySelector("#name"); -const statusSelect = form.querySelector("#status"); - -// set the token input as password field -tokenInput.setAttribute("type", "password"); - -// function to get the config values from the server -const getConfigValues = async () => { - try { - const tokenResponse = await fetch('/api/token'); - const tokenValue = await tokenResponse.text(); - tokenInput.value = tokenValue; - - const nameResponse = await fetch('/api/name'); - const nameValue = await nameResponse.text(); - nameInput.value = nameValue; - - const statusResponse = await fetch('/api/status'); - const statusValue = await statusResponse.text(); - statusSelect.value = statusValue; - } catch (error) { - console.error(error); - } -} - -getConfigValues(); - -form.addEventListener("submit", async (event) => { - event.preventDefault(); - const token = tokenInput.value; - const name = nameInput.value; - const status = statusSelect.value; - - try { - // send POST request to /api/token endpoint with token as the body - if (token !== '') { - await fetch('/api/token', { - method: 'POST', - body: token - }); - } - - - // send POST request to /api/name endpoint with name as the body - if (name !== '') { - await fetch('/api/name', { - method: 'POST', - body: name - }); - } - - - // send POST request to /api/status endpoint with status as the body - if (status !== '') { - await fetch('/api/status', { - method: 'POST', - body: status - }); - } - - } catch (error) { - console.error(error); - } -}); \ No newline at end of file diff --git a/static/plugins.css b/static/plugins.css deleted file mode 100644 index fca533e..0000000 --- a/static/plugins.css +++ /dev/null @@ -1,88 +0,0 @@ -body { - font-family: Arial, sans-serif; - margin: 0; - padding: 0; - background-color: #2c3e50; - color: #fff; -} - -.logo { - width: 25; - height: 25; -} - -header { - background-color: #3e4982; - color: #fff; - padding: 20px; - text-align: center; -} - -header h1 { - margin: 0; -} - -.container { - display: flex; -} - -table { - font-family: Arial, Helvetica, sans-serif; - border-collapse: collapse; - width: 100%; -} - -table td, -#status th { - border: 1px solid #ddd; - padding: 8px; -} - -table tr:nth-child(even) { - background-color: #1c567d; -} - -table tr:hover { - background-color: #2980b9; -} - -table th { - padding-top: 12px; - padding-bottom: 12px; - text-align: left; - background-color: #04AA6D; - color: white; -} - -nav { - background-color: #34495e; - width: 200px; - padding: 20px; - text-align: center; -} - -nav ul { - list-style: none; - margin: 0; - padding: 0; -} - -nav li a { - color: #fff; - text-decoration: none; - padding: 10px 0; - display: block; -} - -nav li a:hover { - background-color: #2980b9; -} - -.selected { - background-color: #2980b9; -} - -main { - padding: 20px; - flex-grow: 1; -} \ No newline at end of file diff --git a/templates/configuration.html b/templates/configuration.html deleted file mode 100644 index c416904..0000000 --- a/templates/configuration.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - MEE2 Configuration - - - - - - -
-

MEE2 Configuration

-
-
- -
-
- - -
- - -
- - -
- -
-
-
- - - \ No newline at end of file diff --git a/templates/dashboard.html b/templates/dashboard.html deleted file mode 100644 index 8913275..0000000 --- a/templates/dashboard.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - MEE2 Dashboard - - - - - -
-

MEE2 - Admin Dashboard

-
-
- -
-

This is the admin dashboard. Here you can see important thing like the uptime, hits per minute, cogs status etc..

- - - - - - - - - - - - - - - - - - - - - -
ModuleStatusModule link
Uptime1 Year/api/uptime
Hits Per Minute10/api/hpm
Plugin - FivemOnline/plugins/fivem
-
- -
- - - diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index 5413691..0000000 --- a/templates/index.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - MEE2 Index - - - - - - -
-

MEE2

-
-
- -
-

Welcome to the MEE2 index page.

-

This bot is designed to help you with various tasks and make your life easier

-

Here you can find information about the bot's features, plugins, configuration, and support. All this info is public. If you want you can turn it off in the settings page.

-
-
- - - diff --git a/templates/plugins.html b/templates/plugins.html deleted file mode 100644 index 970ce15..0000000 --- a/templates/plugins.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - MEE2 Plugins - - - - - -
-

MEE2 - Plugins

-
-
- -
-

This is the plugin page here you can disable/enable the individual cogs.

- - - - - - - - - - - - - - - - - - - - - -
PluginStatusPlugin link
Uptime1 Year/api/uptime
Hits Per Minute10/api/hpm
Plugin - FivemOnline/plugins/fivem
-
- -
- - - \ No newline at end of file