| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <!-- Add Modal -->
- <div id="addModal" class="hidden fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-4">
- <div class="bg-white rounded-lg shadow-xl max-w-4xl w-full p-6 max-h-[90vh] overflow-y-auto">
- <h3 class="text-2xl font-bold text-gray-800 mb-4">
- <i class="fas fa-plus-circle text-blue-600 mr-2"></i>{{ _("Agregar Nueva ACL") }}
- </h3>
- <form id="addForm" method="POST" action="/admin/acls/add">
- <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
-
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
- <div>
- <label class="block text-gray-700 font-semibold mb-2">{{ _("Nombre de la ACL:") }}</label>
- <input type="text" name="name" id="addName" required
- pattern="[a-zA-Z0-9_-]+"
- placeholder="mi_acl_personalizada"
- class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent">
- <p class="text-xs text-gray-500 mt-1">{{ _("Solo letras, números, guiones y guiones bajos") }}</p>
- </div>
-
- <div>
- <label class="block text-gray-700 font-semibold mb-2">{{ _("Tipo de ACL:") }}</label>
- <select name="type" id="addType" onchange="updateAddTypeInfo()" required
- class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent">
- <option value="">{{ _("Selecciona un tipo...") }}</option>
- <optgroup label="🌐 Red / IP">
- <option value="src">{{ _("src - IP origen del cliente") }}</option>
- <option value="dst">{{ _("dst - IP destino [slow]") }}</option>
- <option value="localip">{{ _("localip - IP local de conexión") }}</option>
- <option value="src_as">{{ _("src_as - AS number origen") }}</option>
- <option value="dst_as">{{ _("dst_as - AS number destino") }}</option>
- </optgroup>
- <optgroup label="🌍 Dominios">
- <option value="dstdomain">{{ _("dstdomain - Dominio destino") }}</option>
- <option value="srcdomain">{{ _("srcdomain - Dominio origen [slow]") }}</option>
- <option value="dstdom_regex">{{ _("dstdom_regex - Regex dominio destino") }}</option>
- <option value="srcdom_regex">{{ _("srcdom_regex - Regex dominio origen [slow]") }}</option>
- </optgroup>
- <optgroup label="🔌 Puertos">
- <option value="port">{{ _("port - Puerto TCP destino") }}</option>
- <option value="localport">{{ _("localport - Puerto local") }}</option>
- <option value="myportname">{{ _("myportname - Nombre de puerto") }}</option>
- </optgroup>
- <optgroup label="🕐 Tiempo">
- <option value="time">{{ _("time - Día y hora") }}</option>
- </optgroup>
- <optgroup label="🔗 URL">
- <option value="url_regex">{{ _("url_regex - Regex en URL completa") }}</option>
- <option value="urlpath_regex">{{ _("urlpath_regex - Regex en path") }}</option>
- <option value="urllogin">{{ _("urllogin - Regex en login URL") }}</option>
- </optgroup>
- <optgroup label="⚡ Protocolo">
- <option value="proto">{{ _("proto - Protocolo (HTTP/FTP)") }}</option>
- <option value="method">{{ _("method - Método HTTP") }}</option>
- <option value="http_status">{{ _("http_status - Código HTTP") }}</option>
- </optgroup>
- <optgroup label="🔐 Autenticación">
- <option value="proxy_auth">{{ _("proxy_auth - Usuario proxy [slow]") }}</option>
- <option value="proxy_auth_regex">{{ _("proxy_auth_regex - Regex usuario [slow]") }}</option>
- <option value="ext_user">{{ _("ext_user - Usuario externo [slow]") }}</option>
- <option value="ext_user_regex">{{ _("ext_user_regex - Regex usuario ext [slow]") }}</option>
- </optgroup>
- <optgroup label="📄 Contenido">
- <option value="browser">{{ _("browser - User-Agent") }}</option>
- <option value="referer_regex">{{ _("referer_regex - Referer") }}</option>
- <option value="req_mime_type">{{ _("req_mime_type - MIME request") }}</option>
- <option value="rep_mime_type">{{ _("rep_mime_type - MIME reply") }}</option>
- <option value="req_header">{{ _("req_header - Header request") }}</option>
- <option value="rep_header">{{ _("rep_header - Header reply") }}</option>
- </optgroup>
- <optgroup label="🔒 SSL/TLS">
- <option value="ssl_error">{{ _("ssl_error - Error SSL") }}</option>
- <option value="server_cert_fingerprint">{{ _("server_cert_fingerprint - Fingerprint") }}</option>
- <option value="ssl::server_name">{{ _("ssl::server_name - SNI") }}</option>
- <option value="ssl::server_name_regex">{{ _("ssl::server_name_regex - SNI regex") }}</option>
- </optgroup>
- <optgroup label="🔧 Conexiones">
- <option value="maxconn">{{ _("maxconn - Max conexiones IP") }}</option>
- <option value="max_user_ip">{{ _("max_user_ip - Max IPs usuario") }}</option>
- </optgroup>
- <optgroup label="⚙️ Avanzado">
- <option value="external">{{ _("external - Helper externo [slow]") }}</option>
- <option value="random">{{ _("random - Probabilidad random") }}</option>
- <option value="note">{{ _("note - Anotación transacción") }}</option>
- <option value="any-of">{{ _("any-of - Grupo OR") }}</option>
- <option value="all-of">{{ _("all-of - Grupo AND") }}</option>
- </optgroup>
- </select>
- </div>
- </div>
-
- <!-- Type Info Display -->
- <div id="addTypeInfo" class="hidden mb-4 bg-blue-50 border border-blue-200 rounded-lg p-3">
- <div class="flex items-start">
- <i id="addTypeIcon" class="fas fa-info-circle text-blue-600 mt-1 mr-2"></i>
- <div class="flex-1">
- <p id="addTypeDesc" class="text-sm text-gray-700 font-medium"></p>
- <p id="addTypeExample" class="text-xs text-gray-600 mt-1 font-mono"></p>
- </div>
- </div>
- </div>
-
- <!-- Options -->
- <div class="mb-4">
- <label class="block text-gray-700 font-semibold mb-2">{{ _("Opciones (opcional):") }}</label>
- <div class="flex flex-wrap gap-2">
- <label class="flex items-center px-3 py-2 border-2 border-gray-300 rounded-lg cursor-pointer hover:border-blue-500 hover:bg-blue-50">
- <input type="checkbox" name="options[]" value="-i" class="mr-2">
- <span class="text-sm"><code>{{ _("-i") }}</code> {{ _("Case-insensitive") }}</span>
- </label>
- <label class="flex items-center px-3 py-2 border-2 border-gray-300 rounded-lg cursor-pointer hover:border-blue-500 hover:bg-blue-50">
- <input type="checkbox" name="options[]" value="-n" class="mr-2">
- <span class="text-sm"><code>{{ _("-n") }}</code> {{ _("No lookups") }}</span>
- </label>
- <label class="flex items-center px-3 py-2 border-2 border-gray-300 rounded-lg cursor-pointer hover:border-blue-500 hover:bg-blue-50">
- <input type="checkbox" name="options[]" value="-m" class="mr-2">
- <span class="text-sm"><code>{{ _("-m") }}</code> {{ _("List membership") }}</span>
- </label>
- </div>
- </div>
-
- <!-- Values -->
- <div class="mb-4">
- <label class="block text-gray-700 font-semibold mb-2">{{ _("Valores:") }}</label>
- <div id="addValuesList" class="space-y-2 mb-2">
- <!-- Values will be added dynamically -->
- </div>
- <button type="button" onclick="addValueInput('add')" class="text-blue-600 hover:text-blue-800 text-sm font-medium">
- <i class="fas fa-plus-circle mr-1"></i>{{ _("Agregar valor") }}
- </button>
- </div>
-
- <!-- Comment -->
- <div class="mb-4">
- <label class="block text-gray-700 font-semibold mb-2">{{ _("Comentario (opcional):") }}</label>
- <input type="text" name="comment" placeholder="{{ _("Descripción de esta ACL") }}"
- class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm">
- <p class="text-xs text-gray-500 mt-1">{{ _("Se agregará como comentario antes de la ACL") }}</p>
- </div>
-
- <div class="flex space-x-2 justify-end mt-6 pt-4 border-t">
- <button type="button" onclick="closeAddModal()" class="px-5 py-2 bg-gray-300 hover:bg-gray-400 text-gray-800 rounded-lg transition-colors font-medium">
- {{ _("Cancelar") }}
- </button>
- <button type="submit" class="px-5 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors font-medium">
- <i class="fas fa-save mr-2"></i>{{ _("Crear ACL") }}
- </button>
- </div>
- </form>
- </div>
- </div>
- <!-- Edit Modal -->
- <div id="editModal" class="hidden fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-4">
- <div class="bg-white rounded-lg shadow-xl max-w-4xl w-full p-6 max-h-[90vh] overflow-y-auto">
- <h3 class="text-2xl font-bold text-gray-800 mb-4">
- <i class="fas fa-edit text-blue-600 mr-2"></i>{{ _("Editar ACL") }}
- </h3>
- <form id="editForm" method="POST" action="/admin/acls/edit">
- <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
- <input type="hidden" name="id" id="editId">
-
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
- <div>
- <label class="block text-gray-700 font-semibold mb-2">{{ _("Nombre de la ACL:") }}</label>
- <input type="text" name="name" id="editName" required
- pattern="[a-zA-Z0-9_-]+"
- class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent">
- </div>
-
- <div>
- <label class="block text-gray-700 font-semibold mb-2">{{ _("Tipo de ACL:") }}</label>
- <input type="text" id="editTypeDisplay" disabled
- class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-100 text-gray-600">
- <input type="hidden" name="type" id="editType">
- <p class="text-xs text-gray-500 mt-1">{{ _("El tipo no se puede cambiar, crea una nueva ACL si necesitas otro tipo") }}</p>
- </div>
- </div>
-
- <!-- Options -->
- <div class="mb-4">
- <label class="block text-gray-700 font-semibold mb-2">{{ _("Opciones:") }}</label>
- <div class="flex flex-wrap gap-2">
- <label class="flex items-center px-3 py-2 border-2 border-gray-300 rounded-lg cursor-pointer hover:border-blue-500 hover:bg-blue-50">
- <input type="checkbox" name="options[]" value="-i" id="editOptI" class="mr-2">
- <span class="text-sm"><code>{{ _("-i") }}</code> {{ _("Case-insensitive") }}</span>
- </label>
- <label class="flex items-center px-3 py-2 border-2 border-gray-300 rounded-lg cursor-pointer hover:border-blue-500 hover:bg-blue-50">
- <input type="checkbox" name="options[]" value="-n" id="editOptN" class="mr-2">
- <span class="text-sm"><code>{{ _("-n") }}</code> {{ _("No lookups") }}</span>
- </label>
- <label class="flex items-center px-3 py-2 border-2 border-gray-300 rounded-lg cursor-pointer hover:border-blue-500 hover:bg-blue-50">
- <input type="checkbox" name="options[]" value="-m" id="editOptM" class="mr-2">
- <span class="text-sm"><code>{{ _("-m") }}</code> {{ _("List membership") }}</span>
- </label>
- </div>
- </div>
-
- <!-- Values -->
- <div class="mb-4">
- <label class="block text-gray-700 font-semibold mb-2">{{ _("Valores:") }}</label>
- <div id="editValuesList" class="space-y-2 mb-2">
- <!-- Values will be filled dynamically -->
- </div>
- <button type="button" onclick="addValueInput('edit')" class="text-blue-600 hover:text-blue-800 text-sm font-medium">
- <i class="fas fa-plus-circle mr-1"></i>{{ _("Agregar valor") }}
- </button>
- </div>
-
- <!-- Comment -->
- <div class="mb-4">
- <label class="block text-gray-700 font-semibold mb-2">{{ _("Comentario:") }}</label>
- <input type="text" name="comment" id="editComment"
- class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm">
- </div>
-
- <div class="flex space-x-2 justify-end mt-6 pt-4 border-t">
- <button type="button" onclick="closeEditModal()" class="px-5 py-2 bg-gray-300 hover:bg-gray-400 text-gray-800 rounded-lg transition-colors font-medium">
- {{ _("Cancelar") }}
- </button>
- <button type="submit" class="px-5 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors font-medium">
- <i class="fas fa-save mr-2"></i>{{ _("Guardar Cambios") }}
- </button>
- </div>
- </form>
- </div>
- </div>
|