refactor: ETA templating engine for dashboard, shared nav/head/foot partials

This commit is contained in:
M1
2026-03-16 15:14:26 +04:00
parent 389c88e124
commit e36c239000
9 changed files with 724 additions and 10 deletions
+3
View File
@@ -0,0 +1,3 @@
<script src="/dashboard/app.js"></script>
</body>
</html>
+12
View File
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PingQL<%= it.title ? ` — ${it.title}` : '' %></title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
body { font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, monospace; background: #0a0a0a; }
</style>
</head>
<body class="bg-[#0a0a0a] text-gray-100 min-h-screen">
+16
View File
@@ -0,0 +1,16 @@
<nav class="border-b border-gray-800 px-6 py-4 flex items-center justify-between">
<a href="/dashboard/home" class="text-xl font-bold tracking-tight">Ping<span class="text-blue-400">QL</span></a>
<div class="flex items-center gap-5 text-sm text-gray-500">
<% if (it.nav === 'monitors') { %>
<span class="text-gray-300">Monitors</span>
<% } else { %>
<a href="/dashboard/home" class="hover:text-gray-300 transition-colors">Monitors</a>
<% } %>
<% if (it.nav === 'settings') { %>
<span class="text-gray-300">Settings</span>
<% } else { %>
<a href="/dashboard/settings" class="hover:text-gray-300 transition-colors">Settings</a>
<% } %>
<button onclick="logout()" class="hover:text-gray-300 transition-colors">Logout</button>
</div>
</nav>