mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Fix blacklists dark mode
This commit is contained in:
@@ -22,10 +22,10 @@
|
||||
|
||||
<!-- Error Message -->
|
||||
@if($error)
|
||||
<div class="mb-6 p-4 bg-red-50 border border-red-200 rounded-lg">
|
||||
<div class="mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg">
|
||||
<div class="flex">
|
||||
<i class="fa fa-exclamation-triangle text-red-500 mr-3"></i>
|
||||
<p class="text-red-800">{{ $error }}</p>
|
||||
<i class="fa fa-exclamation-triangle text-red-500 dark:text-red-400 mr-3"></i>
|
||||
<p class="text-red-800 dark:text-red-300">{{ $error }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@@ -42,11 +42,11 @@
|
||||
<input type="text"
|
||||
id="groupname"
|
||||
name="groupname"
|
||||
class="pl-10 w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
||||
class="pl-10 w-full px-4 py-2 border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
||||
value="{{ htmlspecialchars($regex->groupname ?? '') }}"
|
||||
required>
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-500">
|
||||
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
||||
<i class="fa fa-info-circle mr-1"></i>The full name of a valid newsgroup. (Wildcard in the format 'alt.binaries.*')
|
||||
</p>
|
||||
</div>
|
||||
@@ -62,11 +62,11 @@
|
||||
</div>
|
||||
<textarea id="regex"
|
||||
name="regex"
|
||||
class="pl-10 w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 font-mono text-sm"
|
||||
class="pl-10 w-full px-4 py-2 border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 font-mono text-sm"
|
||||
rows="4"
|
||||
required>{{ htmlspecialchars($regex->regex ?? '') }}</textarea>
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-500">
|
||||
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
||||
<i class="fa fa-info-circle mr-1"></i>The regex to be applied. (Note: Beginning and Ending / are already included)
|
||||
</p>
|
||||
</div>
|
||||
@@ -82,10 +82,10 @@
|
||||
</div>
|
||||
<textarea id="description"
|
||||
name="description"
|
||||
class="pl-10 w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
||||
class="pl-10 w-full px-4 py-2 border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
||||
rows="3">{{ htmlspecialchars($regex->description ?? '') }}</textarea>
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-500">
|
||||
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
||||
<i class="fa fa-info-circle mr-1"></i>A description for this regex
|
||||
</p>
|
||||
</div>
|
||||
@@ -104,13 +104,13 @@
|
||||
value="{{ $id }}"
|
||||
class="w-4 h-4 text-blue-600 dark:text-blue-400 border-gray-300 dark:border-gray-600 focus:ring-blue-500"
|
||||
{{ ($regex->msgcol ?? 1) == $id ? 'checked' : '' }}>
|
||||
<label for="msgcol{{ $id }}" class="ml-3 text-sm text-gray-700">
|
||||
<label for="msgcol{{ $id }}" class="ml-3 text-sm text-gray-700 dark:text-gray-300">
|
||||
{{ $msgcol_names[$i] }}
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-500">
|
||||
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
||||
<i class="fa fa-info-circle mr-1"></i>Which field in the message to apply the black/white list to.
|
||||
</p>
|
||||
</div>
|
||||
@@ -129,13 +129,13 @@
|
||||
value="{{ $id }}"
|
||||
class="w-4 h-4 text-blue-600 dark:text-blue-400 border-gray-300 dark:border-gray-600 focus:ring-blue-500"
|
||||
{{ ($regex->status ?? 1) == $id ? 'checked' : '' }}>
|
||||
<label for="status{{ $id }}" class="ml-3 text-sm text-gray-700">
|
||||
<label for="status{{ $id }}" class="ml-3 text-sm text-gray-700 dark:text-gray-300">
|
||||
{{ $status_names[$i] }}
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-500">
|
||||
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
||||
<i class="fa fa-info-circle mr-1"></i>Only active regexes are applied during the release process.
|
||||
</p>
|
||||
</div>
|
||||
@@ -154,25 +154,25 @@
|
||||
value="{{ $id }}"
|
||||
class="w-4 h-4 text-blue-600 dark:text-blue-400 border-gray-300 dark:border-gray-600 focus:ring-blue-500"
|
||||
{{ ($regex->optype ?? 1) == $id ? 'checked' : '' }}>
|
||||
<label for="optype{{ $id }}" class="ml-3 text-sm text-gray-700">
|
||||
<label for="optype{{ $id }}" class="ml-3 text-sm text-gray-700 dark:text-gray-300">
|
||||
{{ $optype_names[$i] }}
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-500">
|
||||
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
||||
<i class="fa fa-info-circle mr-1"></i>Black will exclude all messages for a group which match this regex. White will include only those which match.
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Footer -->
|
||||
<div class="px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50">
|
||||
<div class="px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700">
|
||||
<div class="flex justify-between">
|
||||
<a href="{{ url('/admin/binaryblacklist-list') }}" class="px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-300">
|
||||
<a href="{{ url('/admin/binaryblacklist-list') }}" class="px-4 py-2 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-300 dark:hover:bg-gray-500">
|
||||
<i class="fa fa-times mr-2"></i>Cancel
|
||||
</a>
|
||||
<button type="submit" form="blacklistForm" class="px-4 py-2 bg-green-600 dark:bg-green-700 text-white rounded-lg hover:bg-green-700">
|
||||
<button type="submit" form="blacklistForm" class="px-4 py-2 bg-green-600 dark:bg-green-700 text-white rounded-lg hover:bg-green-700 dark:hover:bg-green-800">
|
||||
<i class="fa fa-save mr-2"></i>Save Changes
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -4,25 +4,25 @@
|
||||
<div class="max-w-full px-4 py-6">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm">
|
||||
<!-- Header -->
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700">
|
||||
<div class="flex justify-between items-center">
|
||||
<h1 class="text-2xl font-semibold text-gray-800">
|
||||
<h1 class="text-2xl font-semibold text-gray-800 dark:text-gray-100">
|
||||
<i class="fa fa-ban mr-2"></i>{{ $title ?? 'Binary Black/White List' }}
|
||||
</h1>
|
||||
<a href="{{ url('/admin/binaryblacklist-edit') }}" class="px-4 py-2 bg-blue-600 dark:bg-blue-700 text-white rounded-lg hover:bg-blue-700">
|
||||
<a href="{{ url('/admin/binaryblacklist-edit') }}" class="px-4 py-2 bg-blue-600 dark:bg-blue-700 text-white rounded-lg hover:bg-blue-700 dark:hover:bg-blue-800">
|
||||
<i class="fa fa-plus mr-2"></i>Add New Blacklist
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Info Alert -->
|
||||
<div class="px-6 py-4 bg-blue-50 border-b border-blue-100">
|
||||
<div class="px-6 py-4 bg-blue-50 dark:bg-blue-900/20 border-b border-blue-100 dark:border-blue-800">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<i class="fa fa-info-circle text-blue-500 text-2xl"></i>
|
||||
<i class="fa fa-info-circle text-blue-500 dark:text-blue-400 text-2xl"></i>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<p class="text-sm text-blue-700">
|
||||
<p class="text-sm text-blue-700 dark:text-blue-300">
|
||||
Binaries can be prevented from being added to the index if they match a regex in the blacklist.
|
||||
They can also be included only if they match a regex (whitelist).
|
||||
<strong>Click Edit or on the blacklist to enable/disable.</strong>
|
||||
@@ -37,65 +37,65 @@
|
||||
<!-- Table -->
|
||||
@if(count($binlist) > 0)
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
||||
<thead class="bg-gray-50 dark:bg-gray-700">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider w-16">ID</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Group</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Description</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider w-20">Type</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider w-24">Field</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider w-20">Status</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Regex</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider w-36">Last Activity</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider w-28">Actions</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-16">ID</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Group</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Description</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-20">Type</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-24">Field</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-20">Status</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Regex</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-36">Last Activity</th>
|
||||
<th class="px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-28">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200">
|
||||
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
|
||||
@foreach($binlist as $bin)
|
||||
<tr id="row-{{ $bin->id }}" class="hover:bg-gray-50">
|
||||
<td class="px-6 py-4 whitespace-nowrap text-center text-sm font-semibold text-gray-900">{{ $bin->id }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
<tr id="row-{{ $bin->id }}" class="hover:bg-gray-50 dark:hover:bg-gray-700">
|
||||
<td class="px-6 py-4 whitespace-nowrap text-center text-sm font-semibold text-gray-900 dark:text-gray-100">{{ $bin->id }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100">
|
||||
<span class="inline-block truncate max-w-[150px]" title="{{ $bin->groupname }}">
|
||||
{{ str_replace('alt.binaries', 'a.b', $bin->groupname) }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">
|
||||
<td class="px-6 py-4 text-sm text-gray-500 dark:text-gray-300">
|
||||
<span class="inline-block truncate max-w-[180px]" title="{{ $bin->description }}">
|
||||
{{ $bin->description }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-center">
|
||||
@if($bin->optype == 1)
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Black</span>
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-300">Black</span>
|
||||
@else
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">White</span>
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300">White</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-center">
|
||||
@if($bin->msgcol == 1)
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">Subject</span>
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300">Subject</span>
|
||||
@elseif($bin->msgcol == 2)
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">Poster</span>
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300">Poster</span>
|
||||
@else
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 dark:bg-gray-800 text-gray-800">MessageID</span>
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-300">MessageID</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-center">
|
||||
@if($bin->status == 1)
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Active</span>
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300">Active</span>
|
||||
@else
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Disabled</span>
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-300">Disabled</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm">
|
||||
<div class="max-w-[200px] break-words">
|
||||
<a href="{{ url('/admin/binaryblacklist-edit?id=' . $bin->id) }}" class="text-blue-600 dark:text-blue-400 hover:text-blue-900" title="{{ htmlspecialchars($bin->regex) }}">
|
||||
<code class="bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded text-xs break-all">{{ htmlspecialchars($bin->regex) }}</code>
|
||||
<a href="{{ url('/admin/binaryblacklist-edit?id=' . $bin->id) }}" class="text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300" title="{{ htmlspecialchars($bin->regex) }}">
|
||||
<code class="bg-gray-100 dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-2 py-1 rounded text-xs break-all">{{ htmlspecialchars($bin->regex) }}</code>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-center text-sm text-gray-500">
|
||||
<td class="px-6 py-4 whitespace-nowrap text-center text-sm text-gray-500 dark:text-gray-400">
|
||||
@if($bin->last_activity)
|
||||
<span title="{{ $bin->last_activity }}">
|
||||
<i class="fa fa-clock-o mr-1 text-gray-400"></i>{{ $bin->last_activity }}
|
||||
@@ -107,12 +107,12 @@
|
||||
<td class="px-6 py-4 whitespace-nowrap text-center text-sm font-medium">
|
||||
<div class="flex gap-2 justify-center">
|
||||
<a href="{{ url('/admin/binaryblacklist-edit?id=' . $bin->id) }}"
|
||||
class="text-blue-600 dark:text-blue-400 hover:text-blue-900"
|
||||
class="text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300"
|
||||
title="Edit this blacklist">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
<button type="button"
|
||||
class="text-red-600 hover:text-red-900"
|
||||
class="text-red-600 dark:text-red-400 hover:text-red-900 dark:hover:text-red-300"
|
||||
onclick="if(confirm('Are you sure? This will delete the blacklist from this list.')) { ajax_binaryblacklist_delete({{ $bin->id }}) }"
|
||||
title="Delete this blacklist">
|
||||
<i class="fa fa-trash"></i>
|
||||
@@ -126,9 +126,9 @@
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<div class="px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50">
|
||||
<div class="px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700">
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="text-sm text-gray-600">Total entries: {{ count($binlist) }}</span>
|
||||
<span class="text-sm text-gray-600 dark:text-gray-300">Total entries: {{ count($binlist) }}</span>
|
||||
<a href="{{ url('/admin/binaryblacklist-edit') }}" class="px-4 py-2 bg-blue-600 dark:bg-blue-700 text-white rounded-lg hover:bg-blue-700 dark:hover:bg-blue-800 text-sm">
|
||||
<i class="fa fa-plus mr-2"></i>Add New Blacklist
|
||||
</a>
|
||||
@@ -136,10 +136,10 @@
|
||||
</div>
|
||||
@else
|
||||
<div class="px-6 py-12 text-center">
|
||||
<i class="fa fa-ban text-gray-400 text-5xl mb-4"></i>
|
||||
<i class="fa fa-ban text-gray-400 dark:text-gray-500 text-5xl mb-4"></i>
|
||||
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-2">No blacklist entries found</h3>
|
||||
<p class="text-gray-500 mb-4">Get started by adding your first blacklist entry.</p>
|
||||
<a href="{{ url('/admin/binaryblacklist-edit') }}" class="inline-flex items-center px-4 py-2 bg-blue-600 dark:bg-blue-700 text-white rounded-lg hover:bg-blue-700">
|
||||
<p class="text-gray-500 dark:text-gray-400 mb-4">Get started by adding your first blacklist entry.</p>
|
||||
<a href="{{ url('/admin/binaryblacklist-edit') }}" class="inline-flex items-center px-4 py-2 bg-blue-600 dark:bg-blue-700 text-white rounded-lg hover:bg-blue-700 dark:hover:bg-blue-800">
|
||||
<i class="fa fa-plus mr-2"></i>Add New Blacklist
|
||||
</a>
|
||||
</div>
|
||||
@@ -176,8 +176,8 @@ function ajax_binaryblacklist_delete(id) {
|
||||
|
||||
function showMessage(message, type = 'success') {
|
||||
const messageDiv = document.getElementById('message');
|
||||
const bgColor = type === 'success' ? 'bg-green-50 border-green-200' : 'bg-red-50 border-red-200';
|
||||
const textColor = type === 'success' ? 'text-green-800' : 'text-red-800';
|
||||
const bgColor = type === 'success' ? 'bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800' : 'bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800';
|
||||
const textColor = type === 'success' ? 'text-green-800 dark:text-green-300' : 'text-red-800 dark:text-red-300';
|
||||
const icon = type === 'success' ? 'check-circle' : 'exclamation-circle';
|
||||
|
||||
messageDiv.innerHTML = `
|
||||
|
||||
Reference in New Issue
Block a user