Admin protetto, dashboard KPI e aggiornamenti sito marketing.

Login admin con cambio password, metriche server (CPU/RAM/disco/banda), grafici e statistiche streaming; sezione piani ridimensionata.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-26 18:18:47 +02:00
parent 3d3420cc4a
commit 3a5649f482
26 changed files with 983 additions and 55 deletions

View File

@@ -3,30 +3,31 @@
<head>
<title>Match Live TV Admin</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root { --red: #FF2D2D; --bg: #0A0A0A; --card: #1E1E1E; --text: #fff; }
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 1rem 2rem; }
a { color: var(--red); }
header { border-bottom: 1px solid #333; padding-bottom: 1rem; margin-bottom: 2rem; }
h1 span { color: var(--red); }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 8px; overflow: hidden; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #333; }
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.8rem; }
.live { background: var(--red); }
.ended { background: #555; }
nav a { margin-right: 1rem; }
</style>
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" href="/admin.css?v=1">
<% if controller_name == "dashboard" %>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js" crossorigin="anonymous"></script>
<script src="/admin-dashboard.js?v=1" defer></script>
<% end %>
</head>
<body>
<header>
<body class="<%= content_for?(:body_class) ? yield(:body_class) : 'admin-body' %>">
<header class="admin-header">
<h1>MATCH <span>LIVE</span> TV — Admin</h1>
<nav>
<%= link_to "Dashboard", admin_root_path %>
<%= link_to "Teams", admin_teams_path %>
<%= link_to "Sessions", admin_sessions_path %>
<nav class="admin-nav">
<% if admin_logged_in? %>
<%= link_to "Dashboard", admin_root_path, class: ("active" if controller_name == "dashboard") %>
<%= link_to "Teams", admin_teams_path, class: ("active" if controller_name == "teams") %>
<%= link_to "Sessions", admin_sessions_path, class: ("active" if controller_name == "sessions") %>
<%= link_to "Password", edit_admin_password_path %>
<%= button_to "Esci", admin_logout_path, method: :delete %>
<% end %>
</nav>
</header>
<%= yield %>
<main class="admin-main">
<% if flash[:notice] %><div class="admin-flash"><%= flash[:notice] %></div><% end %>
<% if flash[:alert] %><div class="admin-flash"><%= flash[:alert] %></div><% end %>
<%= yield %>
</main>
</body>
</html>