Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
Update header.ejs
Browse files Browse the repository at this point in the history
  • Loading branch information
jojobingsa authored Aug 9, 2022
1 parent 0050066 commit 1ddd39b
Showing 1 changed file with 1 addition and 211 deletions.
212 changes: 1 addition & 211 deletions themes/default/parts/header.ejs
Original file line number Diff line number Diff line change
@@ -1,211 +1 @@


<div class="main-content" id="panel">
<nav class="navbar navbar-top navbar-expand navbar-dark bg-primary border-bottom">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<% if (settings.api.client.coins.enabled == true) { %>
<button type="button" class="btn btn-default">
<span>Your coins</span>
<span class="badge badge-primary"><%= coins %></span>
</button>
<% } %>
<% if (req.session.newaccount || req.session.password) { %>
<% if (req.session.newaccount) { %>
<div class="alert alert-default alert-dismissible fade show" role="alert">
<span class="alert-icon"><i class="fas fa-plus-circle"></i></span>
<span class="alert-text"><strong>Congratulations!</strong> A new account has been created for
you on the Pterodactyl Panel</span>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<% } %>
<% if (req.session.password) { %>
<div class="alert alert-success">
<span>Your <% if (!req.session.newaccount) { %>new <% } %>password is
<code><%= req.session.password %></code>! Make sure to keep this password in a safe
place</span>
</div>
<div class="alert alert-default alert-dismissible fade show" role="alert">
<span class="alert-icon"><i class="ni ni-like-2"></i></span>
<span class="alert-text"><strong><%= req.session.password %></strong> is the password to your
pterodactyl account.</span>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<% } %>
<% } %>
<!-- Navbar links -->
<ul class="navbar-nav align-items-center ml-md-auto ">
<li class="nav-item d-xl-none">
<!-- Sidenav toggler -->
<div class="pr-3 sidenav-toggler sidenav-toggler-dark" data-action="sidenav-pin"
data-target="#sidenav-main">
<div class="sidenav-toggler-inner">
<i class="sidenav-toggler-line"></i>
<i class="sidenav-toggler-line"></i>
<i class="sidenav-toggler-line"></i>
</div>
</div>
</li>
<li class="nav-item d-sm-none">
<a class="nav-link" href="#" data-action="search-show" data-target="#navbar-search-main">
<i class="ni ni-zoom-split-in"></i>
</a>
</li>
</ul>
<ul class="navbar-nav align-items-center ml-auto ml-md-0 ">
<li class="nav-item dropdown">
<a class="nav-link pr-0" href="#" role="button" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
<div class="media align-items-center">
<span class="avatar avatar-sm rounded-circle">
<img alt="Avatar"
src="https://cdn.discordapp.com/avatars/<%= req.session.userinfo.id%>/<%= req.session.userinfo.avatar%>.jpg?size=1024">
</span>
<div class="media-body ml-2 d-none d-lg-block">
<span
class="mb-0 text-sm font-weight-bold"><%= req.session.userinfo.username%>#<%= req.session.userinfo.discriminator %></span>
</div>
</div>
</a>
<div class="dropdown-menu dropdown-menu-right ">
<a href="/logout" class="dropdown-item">
<i class="ni ni-user-run"></i>
<span>Logout</span>
</a>
</div>
</li>
</ul>
</div>
</div>
</nav>
<!-- Header -->
<!-- Header -->
<div class="header bg-primary pb-6">
<div class="container-fluid">
<div class="header-body">
<div class="row align-items-center py-4">
<div class="col-lg-6 col-7">
<h6 class="h2 text-white d-inline-block mb-0">Welcome <%= req.session.userinfo.username%>!
</h6>
</div>
<div class="col-lg-6 col-5 text-right">
<a href="<%= settings.pterodactyl.domain %>" class="btn btn-sm btn-neutral">Panel</a>
<a href="/servers/new" class="btn btn-sm btn-neutral">New Server</a>
</div>
</div>
<%
let ram = 0;
let disk = 0;
let cpu = 0;
let servers = pterodactyl.relationships.servers.data.length;
for (let i = 0, len = pterodactyl.relationships.servers.data.length; i < len; i++) {
ram = ram + (typeof pterodactyl.relationships.servers.data[i].attributes.limits.memory == "number" ? pterodactyl.relationships.servers.data[i].attributes.limits.memory : 0);
disk = disk + (typeof pterodactyl.relationships.servers.data[i].attributes.limits.disk == "number" ? pterodactyl.relationships.servers.data[i].attributes.limits.disk : 0);
cpu = cpu + (typeof pterodactyl.relationships.servers.data[i].attributes.limits.cpu == "number" ? pterodactyl.relationships.servers.data[i].attributes.limits.cpu : 0);
}
%>
<div class="row">
<div class="col-xl-3 col-md-6">
<div class="card card-stats">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">Disk</h5>
<span class="h2 font-weight-bold mb-0"><%= disk %>MB /
<%= (packages ? packages.disk : 0) + extraresources.disk %>MB</span>
</div>
<div class="col-auto">
<div
class="icon icon-shape bg-gradient-red text-white rounded-circle shadow">
<i class="fas fa-hdd"></i>
</div>
</div>
</div>
<p class="mt-3 mb-0 text-sm">
<span class="text-success mr-2">Fetched</span>
<span class="text-nowrap">from <strong>API</strong></span>
</p>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card card-stats">
<!-- Card body -->
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">Memory</h5>
<span class="h2 font-weight-bold mb-0"><%= ram %>MB /
<%= (packages ? packages.ram : 0) + extraresources.ram %>MB</span>
</div>
<div class="col-auto">
<div
class="icon icon-shape bg-gradient-orange text-white rounded-circle shadow">
<i class="fas fa-memory"></i>
</div>
</div>
</div>
<p class="mt-3 mb-0 text-sm">
<span class="text-success mr-2">Fetched</span>
<span class="text-nowrap">from <strong>API</strong></span>
</p>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card card-stats">
<!-- Card body -->
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">CPU</h5>
<span class="h2 font-weight-bold mb-0"><%= cpu %>% /
<%= (packages ? packages.cpu : 0) + extraresources.cpu %>%</span>
</div>
<div class="col-auto">
<div
class="icon icon-shape bg-gradient-green text-white rounded-circle shadow">
<i class="fas fa-microchip"></i>
</div>
</div>
</div>
<p class="mt-3 mb-0 text-sm">
<span class="text-success mr-2">Fetched</span>
<span class="text-nowrap">from <strong>API</strong></span>
</p>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card card-stats">
<!-- Card body -->
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">Servers</h5>
<span class="h2 font-weight-bold mb-0"><%= servers %> /
<%= (packages ? packages.servers : 0) + extraresources.servers %>
server<%= (packages ? packages.servers : 0) + extraresources.servers == 1 ? "" : "s" %></span>
</div>
<div class="col-auto">
<div
class="icon icon-shape bg-gradient-info text-white rounded-circle shadow">
<i class="fas fa-server"></i>
</div>
</div>
</div>
<p class="mt-3 mb-0 text-sm">
<span class="text-success mr-2">Fetched</span>
<span class="text-nowrap">from <strong>API</strong></span>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div><div/>

0 comments on commit 1ddd39b

Please sign in to comment.