| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- {% extends "base.html" %}
- {% block content %}
- <div class="space-y-6">
- <div class="bg-white rounded-lg shadow-lg p-6">
- <div class="flex justify-between items-center mb-6">
- <h2 class="text-2xl font-bold text-gray-800">Gestión de ACLs</h2>
- <button onclick="toggleAddForm()" class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-lg transition-colors">
- <i class="fas fa-plus mr-2"></i>Agregar ACL
- </button>
- </div>
- <!-- Add ACL Form -->
- <div id="addAclForm" class="hidden bg-gray-50 p-6 rounded-lg mb-6">
- <h3 class="text-lg font-semibold mb-4">Agregar Nueva ACL</h3>
- <form method="POST" action="/admin/acls/add" class="grid grid-cols-1 md:grid-cols-3 gap-4">
- <div>
- <label class="block text-sm font-medium text-gray-700 mb-2">Nombre:</label>
- <input type="text" name="name" required class="w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
- </div>
- <div>
- <label class="block text-sm font-medium text-gray-700 mb-2">Tipo:</label>
- <select name="type" required class="w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
- <option value="src">src (IP origen)</option>
- <option value="dst">dst (IP destino)</option>
- <option value="dstdomain">dstdomain (Dominio destino)</option>
- <option value="port">port (Puerto)</option>
- <option value="time">time (Tiempo)</option>
- <option value="method">method (Método HTTP)</option>
- <option value="proxy_auth">proxy_auth (Autenticación)</option>
- <option value="maxconn">maxconn (Conexiones máximas)</option>
- </select>
- </div>
- <div>
- <label class="block text-sm font-medium text-gray-700 mb-2">Valor:</label>
- <input type="text" name="value" required class="w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500">
- </div>
- <div class="md:col-span-3 flex space-x-4">
- <button type="submit" class="bg-green-500 hover:bg-green-600 text-white px-6 py-2 rounded-lg transition-colors">
- <i class="fas fa-save mr-2"></i>Guardar ACL
- </button>
- <button type="button" onclick="toggleAddForm()" class="bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg transition-colors">
- <i class="fas fa-times mr-2"></i>Cancelar
- </button>
- </div>
- </form>
- </div>
- <!-- ACLs List -->
- <div class="overflow-x-auto">
- <table class="w-full table-auto">
- <thead class="bg-gray-50">
- <tr>
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nombre</th>
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tipo</th>
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Valor</th>
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Acciones</th>
- </tr>
- </thead>
- <tbody class="bg-white divide-y divide-gray-200">
- {% for acl in acls %}
- <tr class="hover:bg-gray-50">
- <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{{ acl.name }}</td>
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
- <span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-blue-100 text-blue-800">
- {{ acl.type }}
- </span>
- </td>
- <td class="px-6 py-4 text-sm text-gray-500 max-w-xs truncate">{{ acl.value }}</td>
- <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
- <button class="text-blue-600 hover:text-blue-900 mr-3">
- <i class="fas fa-edit"></i>
- </button>
- <button class="text-red-600 hover:text-red-900">
- <i class="fas fa-trash"></i>
- </button>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <script>
- function toggleAddForm() {
- const form = document.getElementById('addAclForm');
- form.classList.toggle('hidden');
- }
- </script>
- {% endblock %}
|