From 8cf6bf5b2958419269195398353559f7f2401c47 Mon Sep 17 00:00:00 2001 From: Ninotainer Date: Sun, 29 Sep 2024 07:43:42 +0000 Subject: [PATCH] 18.1.3 --- LICENSE | 2 +- config-example.toml | 5 +-- modules/admin.js | 23 ------------ modules/pterodactyl.js | 12 +++---- views/auth.ejs | 5 +++ views/components/navigation.ejs | 62 ++++++++++++++++----------------- views/errors/404.ejs | 2 +- views/pages.json | 16 ++++----- 8 files changed, 55 insertions(+), 72 deletions(-) diff --git a/LICENSE b/LICENSE index faafaa2..d3dac80 100644 --- a/LICENSE +++ b/LICENSE @@ -10,6 +10,6 @@ Attribution Notice: - You must give appropriate credit to the original Plexactyl project, including a link to Plexactyl's repository or website, in any medium or format, whether digital or physical, where the Software or any derivative works are used, modified, or distributed. Copyright: -- Copyright (c) Plexactyl and SRYDEN, Inc. +- Copyright (c) Ninovium Development LLC - a subsidary of vezzura.net THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/config-example.toml b/config-example.toml index 16718e3..e4405c9 100644 --- a/config-example.toml +++ b/config-example.toml @@ -1,7 +1,7 @@ # Name and timezone name = "Plexactyl" timezone = "Europe/London" -icon = "https://avatars.githubusercontent.com/u/176057729" +icon = "https://iili.io/dZSv0JI.png" # Plexactyl release information version = "18.1.2" @@ -21,7 +21,8 @@ key = "PTERO_KEY" port = 3_000 [servers] -allocations = 5 # 5 is recommended +allocations = 5 # 5 is recommended +# This is the amount of ports people can make (1 = no extra ports as that slot will be used by main port) # Module settings (formerly API) [api.client] diff --git a/modules/admin.js b/modules/admin.js index 6be6fa9..3f5e5bd 100644 --- a/modules/admin.js +++ b/modules/admin.js @@ -894,29 +894,6 @@ module.exports.load = async function (app, db) { } ); } - } else { - if (settings.api.client.allow.renewsuspendsystem.enabled == true) return; - for ( - let i = 0, len = userinfo.attributes.relationships.servers.data.length; - i < len; - i++ - ) { - let suspendid = - userinfo.attributes.relationships.servers.data[i].attributes.id; - await fetch( - settings.pterodactyl.domain + - "/api/application/servers/" + - suspendid + - "/unsuspend", - { - method: "post", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${settings.pterodactyl.key}`, - }, - } - ); - } } }; }; diff --git a/modules/pterodactyl.js b/modules/pterodactyl.js index 8358956..162d854 100644 --- a/modules/pterodactyl.js +++ b/modules/pterodactyl.js @@ -37,7 +37,7 @@ module.exports.load = async function(app, db) { if (req.query.redirect) if (typeof req.query.redirect == "string") return res.redirect("/" + req.query.redirect); - res.redirect("/cp/dashboard"); + res.redirect("/cp"); }); app.get("/cp/create", async (req, res) => { @@ -280,7 +280,7 @@ module.exports.load = async function(app, db) { "queued server creation", `${req.session.userinfo.username} queued a new server named \`${name}\` with the following specs:\n\`\`\`Memory: ${ram} MB\nCPU: ${cpu}%\nDisk: ${disk}\nQueue Position: ${queuePosition}\`\`\`` ); - return res.redirect("/cp/dashboard?err=QUEUED"); + return res.redirect("/cp?err=QUEUED"); } let serverinfotext = await serverinfo.json(); let newpterodactylinfo = req.session.pterodactyl; @@ -291,7 +291,7 @@ module.exports.load = async function(app, db) { "created server", `${req.session.userinfo.username} created a new server named \`${name}\` with the following specs:\n\`\`\`Memory: ${ram} MB\nCPU: ${cpu}%\nDisk: ${disk}\`\`\`` ); - return res.redirect("/cp/dashboard?err=CREATED"); + return res.redirect("/cp?err=CREATED"); } else { res.redirect(`${redirectlink}?err=NOTANUMBER`); } @@ -408,7 +408,7 @@ module.exports.load = async function(app, db) { ); } - res.redirect('../dashboard'); + res.redirect('..'); }); // Route to clear the entire queue @@ -629,7 +629,7 @@ app.get("/cp/clear-queue", async (req, res) => { pterorelationshipsserverdata; let theme = indexjs.get(req); adminjs.suspend(req.session.userinfo.id); - res.redirect("/cp/dashboard?err=MODIFIED"); + res.redirect("/cp?err=MODIFIED"); } else { res.redirect(`${redirectlink}?id=${req.query.id}&err=MISSINGVARIABLE`); } @@ -684,7 +684,7 @@ app.get("/cp/clear-queue", async (req, res) => { adminjs.suspend(req.session.userinfo.id); - return res.redirect("/cp/dashboard?err=DELETED"); + return res.redirect("/cp?err=DELETED"); } else { res.redirect( theme.settings.redirect.deleteserverdisabled diff --git a/views/auth.ejs b/views/auth.ejs index 6d2e81b..fdf499a 100644 --- a/views/auth.ejs +++ b/views/auth.ejs @@ -1,5 +1,10 @@ <%- include('./components/head') %> +<% if (userinfo) { %> + +<% } %>
diff --git a/views/components/navigation.ejs b/views/components/navigation.ejs index 05b436f..a3206d8 100644 --- a/views/components/navigation.ejs +++ b/views/components/navigation.ejs @@ -1,44 +1,44 @@ \ No newline at end of file +
+ \ No newline at end of file diff --git a/views/errors/404.ejs b/views/errors/404.ejs index 5b50c0a..54b6895 100644 --- a/views/errors/404.ejs +++ b/views/errors/404.ejs @@ -10,7 +10,7 @@

Page not found

Sorry, we couldn’t find the page you’re looking for.

diff --git a/views/pages.json b/views/pages.json index 2d859d4..13332a7 100644 --- a/views/pages.json +++ b/views/pages.json @@ -2,11 +2,11 @@ "index": "auth.ejs", "notfound": "errors/404.ejs", "redirect": { - "callback": "/cp/dashboard", + "callback": "/cp", "failedcallback": "/", "logout": "/", - "deleteserver": "/cp/dashboard", - "createserver": "/cp/dashboard", + "deleteserver": "/cp", + "createserver": "/cp", "failedcreateserver": "/cp/servers/new", "modifyserver": "/cp/servers/edit", "failedmodifyserver": "/cp/servers/edit", @@ -14,9 +14,9 @@ "failedsetplan": "/cp/admin", "getip": "/cp/admin", "failedgetip": "/cp/admin", - "createserverdisabled": "/cp/dashboard?err=disabled", - "modifyserverdisabled": "/cp/dashboard?err=disabled", - "deleteserverdisabled": "/cp/dashboard?err=disabled", + "createserverdisabled": "/cp?err=disabled", + "modifyserverdisabled": "/cp?err=disabled", + "deleteserverdisabled": "/cp?err=disabled", "setresources": "/cp/admin", "failedsetresources": "/cp/admin", "setcoins": "/cp/admin", @@ -29,7 +29,7 @@ "removeaccountsuccess": "/cp/admin" }, "pages": { - "cp/dashboard": "general/dashboard.ejs", + "cp": "general/dashboard.ejs", "cp/servers/new": "servers/create.ejs", "cp/servers/edit": "servers/edit.ejs", "cp/admin": "admin/index.ejs", @@ -39,7 +39,7 @@ "cp/account": "general/profile.ejs" }, "mustbeloggedin": [ - "/cp/dashboard", + "/cp", "/cp/servers/new", "/cp/servers/edit", "/cp/admin",