Skip to content

Commit

Permalink
18.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninotainer committed Sep 29, 2024
1 parent b898bf8 commit 8cf6bf5
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 72 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 3 additions & 2 deletions config-example.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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]
Expand Down
23 changes: 0 additions & 23 deletions modules/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
},
}
);
}
}
};
};
Expand Down
12 changes: 6 additions & 6 deletions modules/pterodactyl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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;
Expand All @@ -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`);
}
Expand Down Expand Up @@ -408,7 +408,7 @@ module.exports.load = async function(app, db) {
);
}

res.redirect('../dashboard');
res.redirect('..');
});

// Route to clear the entire queue
Expand Down Expand Up @@ -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`);
}
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions views/auth.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<html class="h-full bg-bluey-800">
<%- include('./components/head') %>
<% if (userinfo) { %>
<script>
window.location.href = "./cp"
</script>
<% } %>
<body style="font-family: 'Whitney', sans-serif;" class="bg-bluey-800 h-full">
<div class="flex min-h-full items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
<div class="w-full max-w-md space-y-8">
Expand Down
62 changes: 31 additions & 31 deletions views/components/navigation.ejs
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
<nav class="bg-bluey-800">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-16">
<div class="flex items-center">
<div class="hidden md:block">
<div class="flex items-baseline space-x-4">
<a href="/cp/dashboard" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Dashboard</a>
<a href="/cp/servers/new" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Create</a>
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-16">
<div class="flex items-center">
<div class="hidden md:block">
<div class="flex items-baseline space-x-4">
<a href="/cp" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Dashboard</a>

<a href="/cp/servers/new" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Create</a>

<a href="/cp/account" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Account</a>
<a href="/cp/account" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Account</a>

<a href="/cp/earn" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Earn</a>
<a href="/cp/earn" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Earn</a>

<a href="/cp/store" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Store</a>
<a href="/cp/store" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Store</a>

<a href="/cp/transfer" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Transfer</a>
<% if (pterodactyl.root_admin == true) { %>
<a href="/cp/admin" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Admin</a>
<% } %>
</div>
<a href="/cp/transfer" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Transfer</a>
<% if (pterodactyl.root_admin == true) { %>
<a href="/cp/admin" class="transition ease-in-out delay-100 text-bluey-300 hover:bg-bluey-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Admin</a>
<% } %>
</div>
</div>
<div class="hidden md:block">
<div class="ml-4 flex items-center md:ml-6">
<span class="text-blue-300 mr-2 bg-blue-900/50 p-2 text-sm px-6 rounded-full"><%= coins %> Coins</span> <!-- Profile dropdown -->
<div x-data="{show: false}" x-on:click.away="show = false" class="ml-3 relative">
<div>
<button x-on:click="show = !show" type="button" class="max-w-xs bg-bluey-800 rounded-full flex items-center text-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-bluey-800 focus:ring-white" id="user-menu-button" aria-expanded="false" aria-haspopup="true">
<span class="sr-only">Open user menu</span>
<img class="h-8 w-8 rounded-full" src="https://cdn.discordapp.com/avatars/<%= req.session.userinfo.id%>/<%= req.session.userinfo.avatar%>.jpg?size=1024" alt="">
</button>
</div>
<div x-show="show" class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-bluey-700 ring-1 ring-bluey-600 ring-opacity-5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="user-menu-button" tabindex="-1">
<a href="/cp/account" class="block px-4 py-2 text-sm text-bluey-300 role="menuitem" tabindex="-1" id="user-menu-item-0">Account</a>
</div>
<div class="hidden md:block">
<div class="ml-4 flex items-center md:ml-6">
<span class="text-blue-300 mr-2 bg-blue-900/50 p-2 text-sm px-6 rounded-full"><%= coins %> Coins</span> <!-- Profile dropdown -->
<div x-data="{show: false}" x-on:click.away="show = false" class="ml-3 relative">
<div>
<button x-on:click="show = !show" type="button" class="max-w-xs bg-bluey-800 rounded-full flex items-center text-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-bluey-800 focus:ring-white" id="user-menu-button" aria-expanded="false" aria-haspopup="true">
<span class="sr-only">Open user menu</span>
<img class="h-8 w-8 rounded-full" src="https://cdn.discordapp.com/avatars/<%= req.session.userinfo.id%>/<%= req.session.userinfo.avatar%>.jpg?size=1024" alt="">
</button>
</div>
<div x-show="show" class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-bluey-700 ring-1 ring-bluey-600 ring-opacity-5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="user-menu-button" tabindex="-1">
<a href="/cp/account" class="block px-4 py-2 text-sm text-bluey-300 role="menuitem" tabindex="-1" id="user-menu-item-0">Account</a>
<a href="/cp/logout" class="block px-4 py-2 text-sm text-red-500" role="menuitem" tabindex="-1" id="user-menu-item-2">Logout</a>
</div>
<a href="/cp/logout" class="block px-4 py-2 text-sm text-red-500" role="menuitem" tabindex="-1" id="user-menu-item-2">Logout</a>
</div>
</div>
</div>
</div>
</div>
</nav>
</div>
</nav>
2 changes: 1 addition & 1 deletion views/errors/404.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<h1 class="mt-2 text-4xl font-extrabold text-white tracking-tight sm:text-5xl">Page not found</h1>
<p class="mt-2 text-base text-bluey-300">Sorry, we couldn’t find the page you’re looking for.</p>
<div class="mt-6">
<a href="/cp/dashboard" class="text-base font-medium text-blue-400 hover:text-blue-500">Go back <span aria-hidden="true"> &rarr;</span></a>
<a href="/" class="text-base font-medium text-blue-400 hover:text-blue-500">Go back <span aria-hidden="true"> &rarr;</span></a>
</div>
</div>
</div>
Expand Down
16 changes: 8 additions & 8 deletions views/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
"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",
"setplan": "/cp/admin",
"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",
Expand All @@ -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",
Expand All @@ -39,7 +39,7 @@
"cp/account": "general/profile.ejs"
},
"mustbeloggedin": [
"/cp/dashboard",
"/cp",
"/cp/servers/new",
"/cp/servers/edit",
"/cp/admin",
Expand Down

0 comments on commit 8cf6bf5

Please sign in to comment.