caddydb/templates/dashboard.html

286 lines
12 KiB
HTML

<!doctype html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Caddy Dashboard</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
<style>
body {
background-color: #0f0f0f;
background-image:
radial-gradient(circle at 25% 25%,
rgba(40, 40, 40, 0.05) 0%,
transparent 50%),
radial-gradient(circle at 75% 75%,
rgba(40, 40, 40, 0.05) 0%,
transparent 50%);
}
.bg-grid {
background-size: 50px 50px;
background-image:
linear-gradient(to right,
rgba(40, 40, 40, 0.05) 1px,
transparent 1px),
linear-gradient(to bottom,
rgba(40, 40, 40, 0.05) 1px,
transparent 1px);
}
.card {
transition: all 0.2s ease;
}
.card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
</style>
</head>
<body class="text-gray-200 min-h-screen bg-grid">
<!-- Minimal header -->
<header class="py-4 px-6 bg-black/50 backdrop-blur-sm border-b border-gray-800/50">
<div class="container mx-auto flex justify-between items-center">
<h1 class="text-xl font-medium tracking-tight text-white">
Caddy Dashboard
</h1>
<div class="flex items-center gap-3">
<a href="/caddy"
class="text-sm px-3 py-1.5 bg-zinc-800 hover:bg-zinc-700 border border-zinc-700 rounded-md transition-colors">
<i class="fas fa-server text-xs mr-1.5"></i>Caddy
</a>
<a href="/nginx"
class="text-sm px-3 py-1.5 bg-zinc-800 hover:bg-zinc-700 border border-zinc-700 rounded-md transition-colors">
<i class="fas fa-server text-xs mr-1.5"></i>Nginx
</a>
</div>
</div>
</header>
<div class="container mx-auto p-4 md:p-6">
<!-- Overview Stats -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-8">
<div class="card bg-zinc-900 border border-zinc-800 rounded-lg p-5">
<div class="flex items-center">
<div class="w-12 h-12 flex items-center justify-center bg-blue-500/10 text-blue-400 rounded-lg mr-4">
<i class="fas fa-server text-xl"></i>
</div>
<div>
<p class="text-sm text-gray-500">Caddy Servers</p>
<h3 class="text-xl font-medium text-white">{{ caddy_count }}</h3>
</div>
</div>
</div>
<div class="card bg-zinc-900 border border-zinc-800 rounded-lg p-5">
<div class="flex items-center">
<div class="w-12 h-12 flex items-center justify-center bg-green-500/10 text-green-400 rounded-lg mr-4">
<i class="fas fa-server text-xl"></i>
</div>
<div>
<p class="text-sm text-gray-500">Nginx Servers</p>
<h3 class="text-xl font-medium text-white">{{ nginx_count }}</h3>
</div>
</div>
</div>
<div class="card bg-zinc-900 border border-zinc-800 rounded-lg p-5">
<div class="flex items-center">
<div class="w-12 h-12 flex items-center justify-center bg-purple-500/10 text-purple-400 rounded-lg mr-4">
<i class="fas fa-globe text-xl"></i>
</div>
<div>
<p class="text-sm text-gray-500">Total Domains</p>
<h3 class="text-xl font-medium text-white">{{ domain_count }}</h3>
</div>
</div>
</div>
<div class="card bg-zinc-900 border border-zinc-800 rounded-lg p-5">
<div class="flex items-center">
<div class="w-12 h-12 flex items-center justify-center bg-amber-500/10 text-amber-400 rounded-lg mr-4">
<i class="fas fa-clock text-xl"></i>
</div>
<div>
<p class="text-sm text-gray-500">Last Update</p>
<h3 class="text-sm font-medium text-white">{{ last_update }}</h3>
</div>
</div>
</div>
</div>
<!-- Server Selection Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<a href="/caddy" class="card bg-zinc-900 border border-zinc-800 rounded-lg p-6 hover:border-blue-500/50">
<div class="flex items-center mb-4">
<div class="w-14 h-14 flex items-center justify-center bg-blue-500/10 text-blue-400 rounded-lg mr-5">
<i class="fas fa-server text-2xl"></i>
</div>
<div>
<h3 class="text-xl font-medium text-white">
Caddy Server Dashboard
</h3>
<p class="text-sm text-gray-500 mt-1">
View all Caddy reverse proxy configurations
</p>
</div>
</div>
<div class="flex justify-between items-center mt-2">
<span class="text-xs text-gray-500">{{ caddy_count }} servers</span>
<span class="text-blue-400 text-sm">View <i class="fas fa-arrow-right ml-1"></i></span>
</div>
</a>
<a href="/nginx" class="card bg-zinc-900 border border-zinc-800 rounded-lg p-6 hover:border-green-500/50">
<div class="flex items-center mb-4">
<div class="w-14 h-14 flex items-center justify-center bg-green-500/10 text-green-400 rounded-lg mr-5">
<i class="fas fa-server text-2xl"></i>
</div>
<div>
<h3 class="text-xl font-medium text-white">
Nginx Server Dashboard
</h3>
<p class="text-sm text-gray-500 mt-1">
View all Nginx proxy configurations
</p>
</div>
</div>
<div class="flex justify-between items-center mt-2">
<span class="text-xs text-gray-500">{{ nginx_count }} servers</span>
<span class="text-green-400 text-sm">View <i class="fas fa-arrow-right ml-1"></i></span>
</div>
</a>
</div>
<!-- Recent Domains List -->
<div class="card bg-zinc-900 border border-zinc-800 rounded-lg overflow-hidden mb-6">
<div class="px-6 py-4 border-b border-zinc-800">
<h3 class="text-lg font-medium text-white">Active Domains</h3>
<p class="text-xs text-gray-500 mt-1">
All configured domains across servers
</p>
</div>
<div class="divide-y divide-zinc-800">
{% if caddy_proxies %}
<p>Caddy</p>
{% for item in caddy_proxies[:20] %}
<div class="px-6 py-3 flex items-center justify-between hover:bg-zinc-800/30">
<div class="flex items-center">
<div
class="w-8 h-8 flex-shrink-0 flex items-center justify-center rounded-full {% if item.server_type == 'caddy' %}bg-blue-500/10 text-blue-400{% else %}bg-green-500/10 text-green-400{% endif %} mr-3">
<i class="fas fa-globe text-xs"></i>
</div>
<div>
<a href="https://{{ item.domain }}" target="_blank"
class="text-sm font-medium text-white hover:text-blue-400 transition-colors">
{{ item.domain }}
</a>
<p class="text-xs text-gray-500">{{ item.server }}</p>
</div>
</div>
<div class="flex items-center">
<span class="text-xs text-gray-500 font-mono mr-4">{{ item.target }}</span>
<a href="/{% if item.server_type == 'caddy' %}caddy{% else %}nginx{% endif %}"
class="text-xs px-2 py-1 rounded bg-zinc-800 hover:bg-zinc-700 transition-colors">
{{ item.server_type }}
</a>
</div>
</div>
{% endfor %} {% else %}
<div class="px-6 py-4 text-gray-500 text-center">
<p>No caddy-domains configured yet</p>
</div>
{% endif %}
</div>
<div class="divide-y divide-zinc-800">
{% if nginx_proxies %}
<p>Nginx</p>
{% for item in nginx_proxies[:20] %}
<div class="px-6 py-3 flex items-center justify-between hover:bg-zinc-800/30">
<div class="flex items-center">
<div
class="w-8 h-8 flex-shrink-0 flex items-center justify-center rounded-full {% if item.server_type == 'caddy' %}bg-blue-500/10 text-blue-400{% else %}bg-green-500/10 text-green-400{% endif %} mr-3">
<i class="fas fa-globe text-xs"></i>
</div>
<div>
<a href="https://{{ item.domain }}" target="_blank"
class="text-sm font-medium text-white hover:text-blue-400 transition-colors">
{{ item.domain }}
</a>
<p class="text-xs text-gray-500">{{ item.server }}</p>
</div>
</div>
<div class="flex items-center">
<span class="text-xs text-gray-500 font-mono mr-4">{{ item.target }}</span>
<a href="/{% if item.server_type == 'caddy' %}caddy{% else %}nginx{% endif %}"
class="text-xs px-2 py-1 rounded bg-zinc-800 hover:bg-zinc-700 transition-colors">
{{ item.server_type }}
</a>
</div>
</div>
{% endfor %} {% else %}
<div class="px-6 py-4 text-gray-500 text-center">
<p>No nginx-domains configured yet</p>
</div>
{% endif %}
</div>
<!-- <div class="divide-y divide-zinc-800"> -->
<!-- {% if domain_list %} -->
<!-- {% for item in domain_list[:20] %} -->
<!-- <div class="px-6 py-3 flex items-center justify-between hover:bg-zinc-800/30"> -->
<!-- <div class="flex items-center"> -->
<!-- <div -->
<!-- class="w-8 h-8 flex-shrink-0 flex items-center justify-center rounded-full -->
<!-- {% if item.server_type == 'caddy' %}bg-blue-500/10 text-blue-400{% else %}bg-green-500/10 text-green-400{% endif %} mr-3"> -->
<!-- <i class="fas fa-globe text-xs"></i> -->
<!-- </div> -->
<!-- <div> -->
<!-- <a href="https://{{ item.domain }}" target="_blank" -->
<!-- class="text-sm font-medium text-white hover:text-blue-400 transition-colors"> -->
<!-- {{ item.domain }} -->
<!-- </a> -->
<!-- <p class="text-xs text-gray-500">{{ item.server }}</p> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="flex items-center"> -->
<!-- <span class="text-xs text-gray-500 font-mono mr-4">{{ item.target }}</span> -->
<!-- <a href="/{% if item.server_type == 'caddy' %}caddy{% else %}nginx{% endif %}" -->
<!-- class="text-xs px-2 py-1 rounded bg-zinc-800 hover:bg-zinc-700 transition-colors"> -->
<!-- {{ item.server_type }} -->
<!-- </a> -->
<!-- </div> -->
<!-- </div> -->
<!-- {% endfor %} -->
<!-- {% else %} -->
<!-- <div class="px-6 py-4 text-gray-500 text-center"> -->
<!-- <p>No domains configured yet</p> -->
<!-- </div> -->
<!-- {% endif %} -->
<!-- </div> -->
{% if domain_list|length > 20 %}
<div class="px-6 py-3 border-t border-zinc-800 text-center">
<a href="/caddy" class="text-sm text-gray-500 hover:text-white transition-colors">
View all {{ domain_list|length }} domains
<i class="fas fa-arrow-right ml-1"></i>
</a>
</div>
{% endif %}
</div>
</div>
<footer class="py-4 mt-12 border-t border-zinc-900">
<div class="container mx-auto px-4 text-center text-xs text-gray-600">
Caddy Dashboard • Supports both Caddy and Nginx configurations
</div>
</footer>
</body>
</html>