Skip to content

Commit

Permalink
v1.1
Browse files Browse the repository at this point in the history
newest version of TFC-Plex
  • Loading branch information
privt00 committed Dec 26, 2023
1 parent 6ad7fbe commit 871b672
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 13 deletions.
4 changes: 2 additions & 2 deletions settings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "1.0",
"version": "1.1",
"defaulttheme": "default",
"name": "TFC-Plex",
"letter": "T",
"motd": "best hosting ever!",
"icon": "https://cdn.tfc-plex.de/img/tfc.png",
"discord": "https://discord.gg/V5qMdrWV",
"background": "",

"hostid": "",

"claiming": {
"enabled": false,
Expand Down
61 changes: 61 additions & 0 deletions themes/default/admin-verify.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">
<%- include('./components/head') %>
<body>
<div class="container-scroller">
<%- include('./components/adminsidebar') %>
<div class="container-fluid page-body-wrapper">
<%- include('./components/topnav') %>
<div class="main-panel">
<div style="background-color: #111319" class="content-wrapper">
<h2>Verify The Host</h2>
<p class="text-gray">Verify your Hosting to get access of more features and more security.</p>

<div id="verificationResult1"></div>

<script>
// Annahme: settings.hostid und settings.name sind die zu überprüfende Host-ID und der Name
var hostIdToCheck = "<%= settings.hostid %>";
var nameToCheck = "<%= settings.name %>";
// URL, von der die JSON-Daten geladen werden sollen
var apiUrl = 'https://tfc-plex.de/api/verifydhosts.json';
// Funktion zum Laden der JSON-Daten von der URL
async function fetchVerifiedHosts() {
try {
var response = await fetch(apiUrl);
var data = await response.json();
return data.verifiedHosts;
} catch (error) {
console.error('Fehler beim Laden der Daten:', error);
return [];
}
}
// Überprüfe, ob die Host-ID und der Name in den verifizierten Hosts enthalten sind
fetchVerifiedHosts().then(function(verifiedHosts) {
var isHostIdVerified = verifiedHosts.some(host => host.hostId === hostIdToCheck && host.name === nameToCheck);
var resultMessage = isHostIdVerified
? "Host with ID " + hostIdToCheck + " and Name " + nameToCheck + " is Verifyd <i class='text-success fa-regular fa-badge-check'></i>"
: "Your Host with ID " + hostIdToCheck + " and Name " + nameToCheck + " is not verified. You can verify it at the <a href='https://discord.gg/ag4ZZN68Vm' target='_blank'>Discord</a>.";
// Zeige das Ergebnis in der Div-Variable an
document.getElementById('verificationResult1').innerHTML = resultMessage;
});
</script>

</div>
<%- include('./components/footer') %>
</div>
</div>
</div>
<script src="/assets/vendors/select2/select2.min.js"></script>
<script src="/assets/vendors/typeahead.js/typeahead.bundle.min.js"></script>
<%- include('./components/scripts') %>
<script src="/assets/js/file-upload.js"></script>
<script src="/assets/js/typeahead.js"></script>
<script src="/assets/js/select2.js"></script>

</body>
</html>
11 changes: 9 additions & 2 deletions themes/default/components/adminsidebar.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nav class="sidebar sidebar-offcanvas" id="sidebar">
<div style="background: rgba(0, 0, 0, 0.97);" class="sidebar-brand-wrapper d-none d-lg-flex align-items-center justify-content-center fixed-top">
<div style="background: #0b0b0f;" class="sidebar-brand-wrapper d-none d-lg-flex align-items-center justify-content-center fixed-top">
<a style="color: white" class="sidebar-brand brand-logo" href="/dashboard"><%= extra.home.name %> Admin</a>
</div>
<ul class="nav">
Expand Down Expand Up @@ -31,8 +31,15 @@
<span class="menu-title">Coupons</span>
</a>
</li>

<li class="nav-item menu-items">
<a class="nav-link" onClick="window.location.href='../admin/reghost';">
<span class="menu-title">Register you Host</span>
</a>
</li>

<li class="nav-item nav-category">
<span class="nav-link text-white"><h4>Miscellaneous</h4></span>
<span class="nav-link text-white"><h4>Others</h4></span>
</li>
<li class="nav-item menu-items">
<a class="nav-link" href="../dashboard">
Expand Down
7 changes: 5 additions & 2 deletions themes/default/components/sidebar.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<nav class="sidebar sidebar-offcanvas" id="sidebar">
<div style="background: #0b0b0f;" class="sidebar-brand-wrapper d-none d-lg-flex align-items-center justify-content-center fixed-top">
<img src="<%= settings.icon %>" style="margin-left: 20px" width="64px" alt=" ">
<a style="color: white" class="sidebar-brand brand-logo" href="/dashboard"><%= settings.name %></a>
<a style="color: white" class="sidebar-brand brand-logo" href="/dashboard">
<%= settings.name %>

</a>
</div>
<ul class="nav">
<li class="nav-item nav-category">
Expand Down Expand Up @@ -75,7 +78,7 @@
</a>
</li>
<li class="nav-item menu-items">
<a class="nav-link" href="../panel">
<a class="nav-link" href="../tos">
<span class="menu-title"><i class="fa-regular fa-book-section text-danger"></i> Tos</span>
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions themes/default/components/status.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<div class="col-9">
<h6 class="card-title text-muted mb-0">Cpu</h6>
<div class="d-flex align-items-center align-self-start">
<h3 class="mb-0"><%= cpu/100 %> / <%= packages.cpu/100 + extraresources.cpu/100 %> </h3>
<h3 class="mb-0"><%= cpu/100 %> / <%= (packages.cpu/100 + extraresources.cpu/100) %> </h3>
</div>
<div class="d-flex align-items-center align-self-start">
<div class="progress w-100 mt-3 rounded">
<div class=" progress-bar bg-gradient-success" role="progressbar" style="width: <%= (cpu / (packages.cpu + extraresources.cpu)) * 100 %>%;" aria-valuenow="<%= (cpu / (packages.cpu + extraresources.cpu)) * 100 %>"
aria-valuemin="0" aria-valuemax="100"></div>
</div>
<h4 class="mb-0 ml-2 mt-3"><%= (cpu / (packages.cpu + extraresources.cpu)) * 100 %>%</h4>
<h4 class="mb-0 ml-2 mt-3"><%= (cpu / (packages.cpu + extraresources.cpu) * 100).toFixed(2) %>%</h4>
</div>
</div>
</div>
Expand Down
41 changes: 40 additions & 1 deletion themes/default/components/topnav.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


<nav style="background: #0b0b0f;" class="navbar p-0 fixed-top d-flex flex-row" xmlns="http://www.w3.org/1999/html">

<div class="navbar-brand-wrapper d-flex d-lg-none align-items-center justify-content-center">
Expand All @@ -11,6 +13,7 @@
<button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
<span class="mdi mdi-menu"></span>
</button>
<div id="verificationResult" class="align-self-center" style="display: inline-block; font-size: 30px;"></div>
<ul class="navbar-nav navbar-nav-right">
<li class="nav-item dropdown">
<a class="nav-link" id="profileDropdown" href="#" data-toggle="dropdown">
Expand Down Expand Up @@ -68,4 +71,40 @@
<span class="mdi mdi-format-line-spacing"></span>
</button>
</div>
</nav>
</nav>





<script>
// Annahme: settings.hostid und settings.name sind die zu überprüfende Host-ID und der Name
var hostIdToCheck = "<%= settings.hostid %>";
var nameToCheck = "<%= settings.name %>";
// URL, von der die JSON-Daten geladen werden sollen
var apiUrl = 'https://tfc-plex.de/api/verifydhosts.json';
// Funktion zum Laden der JSON-Daten von der URL
async function fetchVerifiedHosts() {
try {
var response = await fetch(apiUrl);
var data = await response.json();
return data.verifiedHosts;
} catch (error) {
console.error('Fehler beim Laden der Daten:', error);
return [];
}
}
// Überprüfe, ob die Host-ID und der Name in den verifizierten Hosts enthalten sind
fetchVerifiedHosts().then(function(verifiedHosts) {
var isHostIdVerified = verifiedHosts.some(host => host.hostId === hostIdToCheck && host.name === nameToCheck);
var resultMessage = isHostIdVerified
? "<i class='text-success fa-regular fa-badge-check fa-x3'></i"
: "<i class='text-danger fa-x3 fa-regular fa-circle-xmark'></i>This host is not verified";
// Zeige das Ergebnis in der Div-Variable an
document.getElementById('verificationResult').innerHTML = resultMessage;
});
</script>
3 changes: 2 additions & 1 deletion themes/default/dashboard.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@
<% } %>
</div>
<hr>
<% } %>
<% } %>
</div>
</div>
</div>
</div>
</div>

<%- include('./components/footer') %>

Expand Down
7 changes: 5 additions & 2 deletions themes/default/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"credits": "credits.ejs",
"lv": "lv.ejs",
"shop": "buycoins.ejs",
"tos": "tos.ejs"
"tos": "tos.ejs",
"admin/reghost": "admin-verify.ejs"
},
"mustbeloggedin": [
"/dashboard",
Expand All @@ -73,7 +74,9 @@
"/coins",
"/lv",
"/shop",
"/earn"
"/earn",
"/redeem",
"/servers"
],
"mustbeadmin": [
"/admin",
Expand Down
3 changes: 2 additions & 1 deletion themes/default/servers.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<i class="mdi mdi-dots-horizontal"></i>
</button>
<div class="dropdown-menu bg-dark text-white" aria-labelledby="serverActionsDropdown<%= i %>">
<a class="dropdown-item text-white" href="/servers/delete?id=<%= pterodactyl.relationships.servers.data[i].attributes.id %>">Delete</a>
<a class="dropdown-item text-white" href="/delete?id=<%= pterodactyl.relationships.servers.data[i].attributes.id %>">Delete</a>
<a class="dropdown-item text-white" href="/servers/edit?id=<%= pterodactyl.relationships.servers.data[i].attributes.id %>">Edit</a>
<a class="dropdown-item text-white" href="<%= settings.pterodactyl.domain %>/server/<%= pterodactyl.relationships.servers.data[i].attributes.identifier %>" target="_blank">Control</a>
</div>
Expand Down Expand Up @@ -99,6 +99,7 @@
<% } %>
</div>
</div>

<%- include('./components/footer') %>
</div>
</div>
Expand Down

0 comments on commit 871b672

Please sign in to comment.