mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-30 10:34:21 +00:00
69 lines
2.6 KiB
Django/Jinja
69 lines
2.6 KiB
Django/Jinja
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}DarkflameServer{% endblock %}</title>
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
|
|
<link href="https://cdn.datatables.net/v/bs5/jq-3.7.0/dt-2.3.7/b-3.2.6/fh-4.0.6/sc-2.4.3/datatables.min.css" rel="stylesheet" integrity="sha384-XMNDGLb5fN9IqhIrVXOAtGKcz4KCr+JSHXGZ1TDXQPDukbEAfmLPjHdCXhgK93fv" crossorigin="anonymous">
|
|
<link rel="stylesheet" href="/css/dashboard.css">
|
|
{% block css %}{% endblock %}
|
|
</head>
|
|
<body class="d-flex bg-dark text-white">
|
|
{% if username and username != "" %}
|
|
{% include "header.jinja2" %}
|
|
{% endif %}
|
|
|
|
<div class="container-fluid py-3">
|
|
{% block content_before %}{% endblock %}
|
|
{% block content %}{% endblock %}
|
|
{% block content_after %}{% endblock %}
|
|
</div>
|
|
|
|
<footer class="mt-5 pt-5 border-top border-secondary text-center pb-3">
|
|
{% block footer %}
|
|
<p class="text-muted small">DarkflameServer Dashboard © 2024</p>
|
|
{% endblock %}
|
|
</footer>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
|
|
<script src="https://cdn.datatables.net/v/bs5/jq-3.7.0/dt-2.3.7/b-3.2.6/fh-4.0.6/sc-2.4.3/datatables.min.js" integrity="sha384-BPUXtS4tH3onFfu5m+dPbFfpLOXQwSWGwrsNWxOAAwqqJx6tJHhFkGF6uitrmEui" crossorigin="anonymous"></script>
|
|
<script>
|
|
// Global logout function (available on all pages)
|
|
function deleteCookie(name) {
|
|
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; SameSite=Strict`;
|
|
}
|
|
|
|
function logout() {
|
|
deleteCookie('dashboardToken');
|
|
deleteCookie('gmLevel');
|
|
localStorage.removeItem('dashboardToken');
|
|
window.location.href = '/login';
|
|
}
|
|
|
|
// Setup logout button
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const logoutBtn = document.getElementById('logoutBtn');
|
|
if (logoutBtn) {
|
|
logoutBtn.addEventListener('click', (e) => {
|
|
e.preventDefault();
|
|
logout();
|
|
});
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<!-- Load dashboard.js only on dashboard pages (not on login) -->
|
|
<script>
|
|
const isLoginPage = document.querySelector('.login-container') !== null;
|
|
if (!isLoginPage) {
|
|
const script = document.createElement('script');
|
|
script.src = '/js/dashboard.js';
|
|
document.head.appendChild(script);
|
|
}
|
|
</script>
|
|
|
|
{% block scripts %}{% endblock %}
|
|
</body>
|
|
</html>
|