mirror of
https://github.com/MrUnknownDE/utools.git
synced 2026-04-06 00:32:04 +02:00
352 lines
15 KiB
HTML
352 lines
15 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>IP Subnetz Rechner - uTools</title> <!-- Titel angepasst -->
|
|
<!-- Tailwind CSS Play CDN -->
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<!-- Eigene Styles (für Navigation etc., wie in index.html) -->
|
|
<style>
|
|
/* Einfacher Lade-Spinner (Tailwind animiert) */
|
|
.loader {
|
|
border: 4px solid rgba(168, 85, 247, 0.1);
|
|
/* Lila sehr transparent */
|
|
border-left-color: #d8b4fe;
|
|
/* Helleres Lila */
|
|
border-radius: 50%;
|
|
width: 24px;
|
|
height: 24px;
|
|
animation: spin 1s linear infinite;
|
|
}
|
|
|
|
@keyframes spin {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
/* Glassmorphism Utilities */
|
|
.glass-panel {
|
|
background: rgba(17, 24, 39, 0.7);
|
|
backdrop-filter: blur(12px);
|
|
-webkit-backdrop-filter: blur(12px);
|
|
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.glass-card {
|
|
background: rgba(31, 41, 55, 0.6);
|
|
backdrop-filter: blur(8px);
|
|
-webkit-backdrop-filter: blur(8px);
|
|
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
|
}
|
|
|
|
.glass-card:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
/* Animations */
|
|
@keyframes fadeIn {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(10px);
|
|
}
|
|
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
.fade-in {
|
|
animation: fadeIn 0.5s ease-out forwards;
|
|
}
|
|
|
|
/* Navigations-Styling */
|
|
nav ul {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
nav a {
|
|
color: #d1d5db;
|
|
text-decoration: none;
|
|
padding: 0.5rem 1rem;
|
|
border-radius: 0.5rem;
|
|
transition: all 0.2s ease;
|
|
position: relative;
|
|
overflow: hidden;
|
|
background: rgba(255, 255, 255, 0.03);
|
|
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
nav a:hover {
|
|
color: #fff;
|
|
background: rgba(168, 85, 247, 0.2);
|
|
border-color: rgba(168, 85, 247, 0.4);
|
|
box-shadow: 0 0 15px rgba(168, 85, 247, 0.1);
|
|
}
|
|
|
|
nav a.active-link {
|
|
background: rgba(168, 85, 247, 0.3);
|
|
color: #fff;
|
|
border-color: #a855f7;
|
|
}
|
|
|
|
header {
|
|
background: rgba(31, 41, 55, 0.4);
|
|
backdrop-filter: blur(10px);
|
|
padding: 1.5rem;
|
|
margin-bottom: 2rem;
|
|
border-radius: 1rem;
|
|
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 1rem;
|
|
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
@media (min-width: 768px) {
|
|
header {
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
}
|
|
}
|
|
|
|
header h1 {
|
|
background-clip: text;
|
|
}
|
|
|
|
.text-gradient {
|
|
background: linear-gradient(to right, #c084fc, #e879f9);
|
|
-webkit-background-clip: text;
|
|
background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
}
|
|
|
|
.hidden {
|
|
display: none !important;
|
|
}
|
|
|
|
/* Custom Scrollbar */
|
|
::-webkit-scrollbar {
|
|
width: 8px;
|
|
height: 8px;
|
|
}
|
|
|
|
::-webkit-scrollbar-track {
|
|
background: rgba(31, 41, 55, 0.5);
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
background: #4b5563;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb:hover {
|
|
background: #6b7280;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body
|
|
class="bg-gray-950 text-gray-100 font-sans p-4 md:p-8 min-h-screen bg-[url('https://tailwindcss.com/_next/static/media/hero-dark.939eb757.png')] bg-cover bg-center bg-fixed selection:bg-purple-500 selection:text-white">
|
|
|
|
<header class="glass-panel">
|
|
<h1>uTools <span class="text-sm font-normal text-gray-400 opacity-75 tracking-wider uppercase ml-2">Network
|
|
Suite</span></h1>
|
|
<nav>
|
|
<ul>
|
|
<li><a href="/">IP Info & Tools</a></li>
|
|
<li><a href="/subnet" class="active-link">Subnetz Rechner</a></li>
|
|
<li><a href="/dns">DNS Lookup</a></li>
|
|
<li><a href="/whois">WHOIS Lookup</a></li>
|
|
<li><a href="/mac">MAC Lookup</a></li>
|
|
<li><a href="/asn">ASN Lookup</a></li>
|
|
</ul>
|
|
</nav>
|
|
</header>
|
|
|
|
<div
|
|
class="container mx-auto max-w-5xl glass-panel rounded-xl shadow-2xl p-6 md:p-8 backdrop-blur-xl border border-gray-800/50">
|
|
|
|
<h2 class="text-3xl font-bold mb-8 text-center text-gradient glitch-text">IP Subnetz Rechner</h2>
|
|
|
|
<form id="subnet-form" class="mb-8 glass-card p-6 rounded-xl">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
|
|
<div>
|
|
<label for="ip-address"
|
|
class="block text-gray-400 text-sm font-bold mb-2 uppercase tracking-wide">IP Adresse:</label>
|
|
<input type="text" id="ip-address" name="ip-address" placeholder="z.B. 192.168.1.1" required
|
|
class="w-full px-4 py-3 bg-gray-900/50 border border-gray-700/50 rounded-lg text-gray-200 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent font-mono transition-all">
|
|
</div>
|
|
<div>
|
|
<label for="cidr" class="block text-gray-400 text-sm font-bold mb-2 uppercase tracking-wide">CIDR /
|
|
Maske:</label>
|
|
<input type="text" id="cidr" name="cidr" placeholder="z.B. 24 oder 255.255.255.0" required
|
|
class="w-full px-4 py-3 bg-gray-900/50 border border-gray-700/50 rounded-lg text-gray-200 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent font-mono transition-all">
|
|
</div>
|
|
</div>
|
|
|
|
<button type="submit"
|
|
class="w-full bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-500 hover:to-pink-500 text-white font-bold py-3 px-6 rounded-lg shadow-lg hover:shadow-purple-500/25 transition-all duration-200 ease-in-out transform hover:-translate-y-0.5">
|
|
Berechnen
|
|
</button>
|
|
</form>
|
|
|
|
<div id="results" class="glass-card rounded-xl p-6 hidden fade-in"> <!-- Ergebnisse initial verstecken -->
|
|
<h3
|
|
class="text-xl font-bold text-purple-300 border-b border-purple-500/30 pb-2 mb-4 flex items-center gap-2">
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
|
|
stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
</svg>
|
|
Ergebnisse:
|
|
</h3>
|
|
<div class="space-y-3 text-sm">
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2 border-b border-gray-700/50 pb-2">
|
|
<span class="text-gray-400">Netzwerkadresse:</span>
|
|
<span id="network-address" class="font-mono text-white font-semibold">-</span>
|
|
</div>
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2 border-b border-gray-700/50 pb-2">
|
|
<span class="text-gray-400">Broadcast-Adresse:</span>
|
|
<span id="broadcast-address" class="font-mono text-purple-400 font-semibold">-</span>
|
|
</div>
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2 border-b border-gray-700/50 pb-2">
|
|
<span class="text-gray-400">Subnetzmaske:</span>
|
|
<span id="subnet-mask" class="font-mono text-gray-300">-</span>
|
|
</div>
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2 border-b border-gray-700/50 pb-2">
|
|
<span class="text-gray-400">Anzahl der Hosts:</span>
|
|
<span id="host-count" class="font-mono text-green-400 font-bold">-</span>
|
|
</div>
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2 border-b border-gray-700/50 pb-2">
|
|
<span class="text-gray-400">Erste Host-Adresse:</span>
|
|
<span id="first-host" class="font-mono text-blue-300">-</span>
|
|
</div>
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
|
<span class="text-gray-400">Letzte Host-Adresse:</span>
|
|
<span id="last-host" class="font-mono text-blue-300">-</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Beispiel-Subnetze -->
|
|
<div id="examples" class="glass-card rounded-xl p-6 mt-8">
|
|
<h3 class="text-lg font-bold text-gray-400 uppercase tracking-wider border-b border-gray-700/50 pb-2 mb-4">
|
|
Beispiel-Subnetze (Private Adressbereiche)</h3>
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full text-sm text-left text-gray-400">
|
|
<thead class="text-xs uppercase bg-gray-800/50 text-gray-200">
|
|
<tr>
|
|
<th scope="col" class="px-6 py-3">Bereich</th>
|
|
<th scope="col" class="px-6 py-3">CIDR</th>
|
|
<th scope="col" class="px-6 py-3">Subnetzmaske</th>
|
|
<th scope="col" class="px-6 py-3">Beschreibung</th>
|
|
<th scope="col" class="px-6 py-3">Aktion</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-700/50">
|
|
<tr class="hover:bg-gray-700/30 transition-colors">
|
|
<td class="px-6 py-4 font-mono text-white">192.168.0.0 - 192.168.255.255</td>
|
|
<td class="px-6 py-4 font-mono">/16 (Gesamt)</td>
|
|
<td class="px-6 py-4 font-mono">255.255.0.0</td>
|
|
<td class="px-6 py-4">Klasse C (oft als /24 genutzt)</td>
|
|
<td class="px-6 py-4"><span
|
|
class="example-link text-purple-400 hover:text-purple-300 cursor-pointer underline"
|
|
data-ip="192.168.1.1" data-cidr="24">Beispiel /24</span></td>
|
|
</tr>
|
|
<tr class="hover:bg-gray-700/30 transition-colors">
|
|
<td class="px-6 py-4 font-mono text-white">172.16.0.0 - 172.31.255.255</td>
|
|
<td class="px-6 py-4 font-mono">/12 (Gesamt)</td>
|
|
<td class="px-6 py-4 font-mono">255.240.0.0</td>
|
|
<td class="px-6 py-4">Klasse B</td>
|
|
<td class="px-6 py-4"><span
|
|
class="example-link text-purple-400 hover:text-purple-300 cursor-pointer underline"
|
|
data-ip="172.16.10.5" data-cidr="16">Beispiel /16</span></td>
|
|
</tr>
|
|
<tr class="hover:bg-gray-700/30 transition-colors">
|
|
<td class="px-6 py-4 font-mono text-white">10.0.0.0 - 10.255.255.255</td>
|
|
<td class="px-6 py-4 font-mono">/8 (Gesamt)</td>
|
|
<td class="px-6 py-4 font-mono">255.0.0.0</td>
|
|
<td class="px-6 py-4">Klasse A</td>
|
|
<td class="px-6 py-4"><span
|
|
class="example-link text-purple-400 hover:text-purple-300 cursor-pointer underline"
|
|
data-ip="10.0.50.100" data-cidr="8">Beispiel /8</span></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p class="mt-4 text-xs text-gray-500 italic">Klicken Sie auf "Beispiel", um die Felder oben auszufüllen und
|
|
die Berechnung zu starten.</p>
|
|
</div>
|
|
|
|
<!-- Globaler Fehlerbereich -->
|
|
<div id="global-error"
|
|
class="mt-6 p-4 bg-red-900/50 border border-red-500/50 text-red-100 rounded-lg hidden backdrop-blur shadow-lg">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<footer class="mt-12 pt-6 border-t border-gray-700/30 text-center text-xs text-gray-500">
|
|
<p>© 2025 <a href="https://mrunk.de"
|
|
class="text-purple-400 hover:text-purple-300 transition-colors">MrUnknownDE</a></p>
|
|
<p class="mt-1">Version: <span id="commit-sha" class="font-mono text-gray-400">loading...</span></p>
|
|
<!-- Footer mit Version hinzugefügt -->
|
|
</footer>
|
|
|
|
<!-- Nur das Skript für den Rechner laden -->
|
|
<script src="subnet-calculator.js"></script>
|
|
<script>
|
|
// Kleine Ergänzung, um die Beispiel-Links klickbar zu machen und Version zu laden
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
// Beispiel-Links
|
|
document.querySelectorAll('.example-link').forEach(link => {
|
|
link.addEventListener('click', (event) => {
|
|
const ip = event.target.getAttribute('data-ip');
|
|
const cidr = event.target.getAttribute('data-cidr');
|
|
document.getElementById('ip-address').value = ip;
|
|
document.getElementById('cidr').value = cidr;
|
|
// Berechnung direkt auslösen
|
|
document.getElementById('subnet-form').dispatchEvent(new Event('submit', { bubbles: true, cancelable: true }));
|
|
window.scrollTo({ top: 0, behavior: 'smooth' }); // Nach oben scrollen
|
|
});
|
|
});
|
|
|
|
// Version laden (gemeinsame Funktion)
|
|
const commitShaEl = document.getElementById('commit-sha');
|
|
const globalErrorEl = document.getElementById('global-error');
|
|
const API_BASE_URL = '/api'; // Muss hier definiert sein, wenn nicht global
|
|
|
|
async function fetchVersionInfo() {
|
|
try {
|
|
const response = await fetch(`${API_BASE_URL}/version`);
|
|
if (!response.ok) throw new Error(`Network response: ${response.statusText} (${response.status})`);
|
|
const data = await response.json();
|
|
if (commitShaEl) {
|
|
commitShaEl.textContent = data.commitSha || 'unknown';
|
|
}
|
|
} catch (error) {
|
|
console.error('Failed to fetch version info:', error);
|
|
if (commitShaEl) commitShaEl.textContent = 'error';
|
|
if (globalErrorEl) { // Zeige Fehler global an, wenn Element existiert
|
|
globalErrorEl.textContent = `Error loading version: ${error.message}`;
|
|
globalErrorEl.classList.remove('hidden');
|
|
}
|
|
}
|
|
}
|
|
fetchVersionInfo();
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html> |