some changes
This commit is contained in:
parent
aff563a939
commit
d8f3ce4fa3
3 changed files with 74 additions and 37 deletions
|
@ -2,16 +2,19 @@
|
|||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Zentrales Caddy-Dashboard</title>
|
||||
<title>Caddy Dashboard</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script>
|
||||
function toggleServer(id) {
|
||||
let section = document.getElementById("server-" + id);
|
||||
section.classList.toggle("hidden");
|
||||
function toggleSearch() {
|
||||
let searchBar = document.getElementById("search-box");
|
||||
searchBar.classList.toggle("hidden");
|
||||
if (!searchBar.classList.contains("hidden")) {
|
||||
searchBar.focus();
|
||||
}
|
||||
}
|
||||
|
||||
function filterEntries() {
|
||||
let query = document.getElementById("search").value.toLowerCase();
|
||||
let query = document.getElementById("search-box").value.toLowerCase();
|
||||
let rows = document.querySelectorAll("tbody tr");
|
||||
rows.forEach(row => {
|
||||
let domain = row.dataset.domain.toLowerCase();
|
||||
|
@ -30,44 +33,71 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function checkStatus(domain, element) {
|
||||
fetch(`/status/${domain}`)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status === "offline") {
|
||||
element.innerHTML = "🔴 Offline";
|
||||
element.classList.add("text-red-500");
|
||||
} else {
|
||||
element.innerHTML = "🟢 Online";
|
||||
element.classList.add("text-green-500");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("keydown", function(event) {
|
||||
if (event.key === "/") {
|
||||
event.preventDefault();
|
||||
toggleSearch();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="bg-gray-900 text-gray-100">
|
||||
<header class="bg-indigo-700 text-white p-4 text-center">
|
||||
<h1 class="text-2xl font-bold">Zentrales Caddy-Dashboard</h1>
|
||||
|
||||
<header class="bg-indigo-700 text-white p-6 text-center">
|
||||
<h1 class="text-3xl font-bold">Caddy Dashboard</h1>
|
||||
<p class="text-cyan-300">Übersicht über alle aktiven Proxy-Server</p>
|
||||
<button onclick="toggleSearch()" class="bg-cyan-500 hover:bg-cyan-400 text-white px-4 py-2 rounded mt-3">🔍 Suche</button>
|
||||
</header>
|
||||
|
||||
<div class="container mx-auto p-6">
|
||||
<input type="text" id="search" class="w-full p-2 mb-4 text-gray-900 rounded-md" placeholder="🔍 Suche nach einer Subdomain..." onkeyup="filterEntries()">
|
||||
<input type="text" id="search-box" class="hidden w-full p-2 mb-4 text-gray-900 rounded-md" placeholder="🔍 Suche nach einer Subdomain..." onkeyup="filterEntries()">
|
||||
|
||||
{% for server, entries in proxies.items() %}
|
||||
<div id="server-box-{{ server }}" class="bg-gray-800 p-4 rounded-md mb-6">
|
||||
<div class="flex justify-between">
|
||||
<button onclick="toggleServer('{{ server }}')" class="text-lg font-semibold text-indigo-400">
|
||||
{{ server }}
|
||||
</button>
|
||||
<div id="server-box-{{ server }}" class="bg-gray-800 p-4 rounded-md shadow-md mb-6">
|
||||
<div class="flex justify-between items-center">
|
||||
<h2 class="text-xl font-semibold text-indigo-400">{{ server }}</h2>
|
||||
<button onclick="deleteServer('{{ server }}')" class="bg-red-500 text-white px-3 py-1 rounded-md">🗑️ Löschen</button>
|
||||
</div>
|
||||
<div id="server-{{ server }}" class="mt-2 hidden">
|
||||
<table class="w-full mt-3">
|
||||
<thead>
|
||||
<tr class="text-cyan-400">
|
||||
<th class="text-left p-2">Domain</th>
|
||||
<th class="text-left p-2">Ziel</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for domain, target in entries.items() %}
|
||||
<tr data-domain="{{ domain }}">
|
||||
<td class="p-2"><a href="https://{{ domain }}" target="_blank" class="text-indigo-400">{{ domain }}</a></td>
|
||||
<td class="p-2">{{ target }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table class="w-full mt-3 border-collapse border border-gray-700">
|
||||
<thead>
|
||||
<tr class="text-cyan-400 bg-gray-700">
|
||||
<th class="text-left p-3">Domain</th>
|
||||
<th class="text-left p-3">Ziel</th>
|
||||
<th class="text-left p-3">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for domain, target in entries.items() %}
|
||||
<tr data-domain="{{ domain }}">
|
||||
<td class="p-3 border border-gray-700">
|
||||
<a href="https://{{ domain }}" target="_blank" class="text-indigo-400 hover:text-indigo-300">{{ domain }}</a>
|
||||
</td>
|
||||
<td class="p-3 border border-gray-700">{{ target }}</td>
|
||||
<td class="p-3 border border-gray-700">
|
||||
<button onclick="checkStatus('{{ domain }}', this)" class="bg-cyan-500 text-white px-3 py-1 rounded-md">🔄 Prüfen</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue