Updated sessions,notifications

This commit is contained in:
2025-12-06 08:09:31 +00:00
parent a15ced34c0
commit d34e9284e2
17 changed files with 352 additions and 108 deletions

View File

@@ -1,32 +1,34 @@
{{ define "content" }}
<h1 class="text-2xl mb-4">URL Lists</h1>
<form method="POST" class="mb-4">
<input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
<input type="hidden" name="action" value="add">
<input type="text" name="url" placeholder="Add URL" class="p-2 bg-gray-700 rounded">
<button type="submit" class="bg-blue-600 p-2 rounded">Add</button>
</form>
<ul class="space-y-2">
{{ with .PageData }}
{{ range $i, $url := .URLs }}
<li class="flex justify-between bg-gray-800 p-2 rounded">
{{ $url }}
<div>
<form method="POST" class="inline">
<input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}">
<input type="hidden" name="action" value="toggle">
<input type="hidden" name="index" value="{{ $i }}">
<button type="submit" class="bg-yellow-600 p-1 rounded">Toggle</button>
</form>
<form method="POST" class="inline">
<input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}">
<input type="hidden" name="action" value="remove">
<input type="hidden" name="index" value="{{ $i }}">
<button type="submit" class="bg-red-600 p-1 rounded">Remove</button>
</form>
<div class="max-w-4xl mx-auto">
<h1 class="text-3xl font-bold mb-6">URL Lists</h1>
<form method="POST" class="mb-6 bg-gray-800 p-4 rounded">
<input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
<input type="hidden" name="action" value="add">
<div class="flex gap-2">
<input type="text" name="url" placeholder="Add URL (e.g., https://example.com/blocklist.txt)" class="flex-1 p-2 bg-gray-700 rounded text-white placeholder-gray-400">
<button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white font-bold px-4 py-2 rounded transition">Add</button>
</div>
</li>
{{ end }}
{{ end }}
</ul>
</form>
<ul class="space-y-2">
{{ range $i, $url := .PageData.URLs }}
<li class="flex justify-between items-center bg-gray-800 p-3 rounded">
<span class="text-sm text-gray-300 break-all">{{ $url }}</span>
<div class="flex gap-2 ml-4">
<form method="POST" class="inline">
<input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}">
<input type="hidden" name="action" value="toggle">
<input type="hidden" name="index" value="{{ $i }}">
<button type="submit" class="bg-yellow-600 hover:bg-yellow-700 text-white font-bold px-3 py-1 rounded text-sm transition">Toggle</button>
</form>
<form method="POST" class="inline">
<input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}">
<input type="hidden" name="action" value="remove">
<input type="hidden" name="index" value="{{ $i }}">
<button type="submit" class="bg-red-600 hover:bg-red-700 text-white font-bold px-3 py-1 rounded text-sm transition">Remove</button>
</form>
</div>
</li>
{{ end }}
</ul>
</div>
{{ end }}