diff --git a/cogs/web/static/configuration.css b/cogs/web/static/configuration.css new file mode 100644 index 0000000..fca533e --- /dev/null +++ b/cogs/web/static/configuration.css @@ -0,0 +1,88 @@ +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/cogs/web/static/dashboard.css b/cogs/web/static/dashboard.css new file mode 100644 index 0000000..b92a2c9 --- /dev/null +++ b/cogs/web/static/dashboard.css @@ -0,0 +1,88 @@ +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/cogs/web/static/index.css b/cogs/web/static/index.css new file mode 100644 index 0000000..9ac95ae --- /dev/null +++ b/cogs/web/static/index.css @@ -0,0 +1,61 @@ +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/cogs/web/static/js/configuration.js b/cogs/web/static/js/configuration.js new file mode 100644 index 0000000..4aa072e --- /dev/null +++ b/cogs/web/static/js/configuration.js @@ -0,0 +1,66 @@ +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/cogs/web/static/plugins.css b/cogs/web/static/plugins.css new file mode 100644 index 0000000..fca533e --- /dev/null +++ b/cogs/web/static/plugins.css @@ -0,0 +1,88 @@ +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/cogs/web/templates/configuration.html b/cogs/web/templates/configuration.html new file mode 100644 index 0000000..c416904 --- /dev/null +++ b/cogs/web/templates/configuration.html @@ -0,0 +1,47 @@ + + + + + MEE2 Configuration + + + + + + +
+

MEE2 Configuration

+
+
+ +
+
+ + +
+ + +
+ + +
+ +
+
+
+ + + \ No newline at end of file diff --git a/cogs/web/templates/dashboard.html b/cogs/web/templates/dashboard.html new file mode 100644 index 0000000..8913275 --- /dev/null +++ b/cogs/web/templates/dashboard.html @@ -0,0 +1,54 @@ + + + + + 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/cogs/web/templates/index.html b/cogs/web/templates/index.html new file mode 100644 index 0000000..5413691 --- /dev/null +++ b/cogs/web/templates/index.html @@ -0,0 +1,34 @@ + + + + + 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/cogs/web/templates/plugins.html b/cogs/web/templates/plugins.html new file mode 100644 index 0000000..970ce15 --- /dev/null +++ b/cogs/web/templates/plugins.html @@ -0,0 +1,54 @@ + + + + + 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