184 lines
11 KiB
Django/Jinja
184 lines
11 KiB
Django/Jinja
<div>
|
|
<div class="flex flex-col">
|
|
<div class="overflow-x-auto">
|
|
<div class="inline-block min-w-full align-middle">
|
|
<div class="overflow-hidden shadow">
|
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-600">
|
|
<thead class="bg-gray-50 dark:bg-gray-700">
|
|
<tr>
|
|
|
|
<th scope="col" class="p-4 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-white">
|
|
Timestamp
|
|
</th>
|
|
<th scope="col" class="p-4 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-white">
|
|
<a id="filterSubsystem" data-dropdown-toggle="filterSubsystemsDropdown" class="whitespace-nowrap inline-flex items-center font-medium text-gray-500 hover:underline">
|
|
Subsystem <svg class="w-[12px] h-[12px] text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
|
<path fill-rule="evenodd" d="M18.425 10.271C19.499 8.967 18.57 7 16.88 7H7.12c-1.69 0-2.618 1.967-1.544 3.271l4.881 5.927a2 2 0 0 0 3.088 0l4.88-5.927Z" clip-rule="evenodd"/>
|
|
</svg>
|
|
|
|
</a>
|
|
<div id="filterSubsystemsDropdown" class="z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-44 dark:bg-gray-700 dark:divide-gray-600">
|
|
<div class="py-2">
|
|
<a href="?" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">All</a>
|
|
</div>
|
|
<ul class="py-2 text-sm text-gray-700 dark:text-gray-200" aria-labelledby="filterSubsystem">
|
|
<li>
|
|
<a href="?subsystem=admin" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">Admin</a>
|
|
</li>
|
|
<li>
|
|
<a href="?subsystem=sshd" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">Ssh Server</a>
|
|
</li>
|
|
|
|
<li>
|
|
<a href="?subsystem=backend" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">Backend</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
</th>
|
|
<th scope="col" class="p-4 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-white">
|
|
<a id="filterOperation" data-dropdown-toggle="filterOperationsDropdown" class="whitespace-nowrap inline-flex items-center font-medium text-gray-500 hover:underline">
|
|
Operation <svg class="w-[12px] h-[12px] text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
|
<path fill-rule="evenodd" d="M18.425 10.271C19.499 8.967 18.57 7 16.88 7H7.12c-1.69 0-2.618 1.967-1.544 3.271l4.881 5.927a2 2 0 0 0 3.088 0l4.88-5.927Z" clip-rule="evenodd"/>
|
|
</svg>
|
|
</a>
|
|
<div id="filterOperationsDropdown" class="z-10 hidden bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-44 dark:bg-gray-700 dark:divide-gray-600">
|
|
<div class="py-2">
|
|
<a href="?" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">All</a>
|
|
</div>
|
|
<ul class="py-2 text-sm text-gray-700 dark:text-gray-200" aria-labelledby="filterSubsystem">
|
|
{% for operation in operations %}
|
|
<li>
|
|
<a href="?operation={{ operation }}" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">{{ operation }}</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
</th>
|
|
<th scope="col" class="p-4 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-white">
|
|
Client
|
|
</th>
|
|
<th scope="col" class="p-4 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-white">
|
|
Secret
|
|
</th>
|
|
<th scope="col" class="p-4 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-white">
|
|
Message
|
|
</th>
|
|
<th scope="col" class="p-4 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-white">
|
|
Origin
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="bg-white dark:bg-gray-800">
|
|
|
|
{% for entry in entries | list %}
|
|
<tr
|
|
class="{{ loop.cycle('', 'bg-gray-50 dark:bg-gray-700 ') }}hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
id="entry-{{ entry.id }}"
|
|
>
|
|
|
|
<td class="p-4 text-sm font-normal text-gray-900 whitespace-nowrap dark:text-white">
|
|
<p>{{ entry.timestamp }}<button data-popover-target="popover-audit-entry-{{ entry.id }}" data-popover-placement="bottom-end" type="button"><svg class="w-4 h-4 ms-2 text-gray-400 hover:text-gray-500" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg><span class="sr-only">Show information</span></button></p>
|
|
|
|
<div data-popover id="popover-audit-entry-{{entry.id}}" role="tooltip" class="absolute z-10 invisible inline-block text-sm text-gray-500 transition-opacity duration-300 bg-white border border-gray-200 rounded-lg shadow-xs opacity-0 w-80 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400">
|
|
<dl class="max-w-md text-gray-900 divide-y divide-gray-200 dark:text-white dark:divide-gray-700 px-2 py-2">
|
|
<div class="flex flex-col pb-3">
|
|
<dt class="mb-1 text-gray-500 md:text-xs dark:text-gray-400">ID</dt>
|
|
<dd class="text-xs font-semibold">{{ entry.id }}</dd>
|
|
</div>
|
|
<div class="flex flex-col pb-3">
|
|
<dt class="mb-1 text-gray-500 md:text-xs dark:text-gray-400">Subsystem</dt>
|
|
<dd class="text-xs font-semibold">{{ entry.subsystem }}</dd>
|
|
</div>
|
|
|
|
<div class="flex flex-col pb-3">
|
|
<dt class="mb-1 text-gray-500 md:text-xs dark:text-gray-400">Timestamp</dt>
|
|
<dd class="text-xs font-semibold">{{ entry.timestamp }}</dd>
|
|
</div>
|
|
<div class="flex flex-col pb-3">
|
|
<dt class="mb-1 text-gray-500 md:text-xs dark:text-gray-400">Operation</dt>
|
|
<dd class="text-xs font-semibold">{{ entry.operation }}</dd>
|
|
</div>
|
|
<div class="flex flex-col pb-3">
|
|
<dt class="mb-1 text-gray-500 md:text-xs dark:text-gray-400">Client ID</dt>
|
|
<dd class="text-xs font-semibold">{{ entry.client_id }}</dd>
|
|
</div>
|
|
<div class="flex flex-col pb-3">
|
|
<dt class="mb-1 text-gray-500 md:text-xs dark:text-gray-400">Client Name</dt>
|
|
<dd class="text-xs font-semibold">{{ entry.client_name }}</dd>
|
|
</div>
|
|
<div class="flex flex-col pb-3">
|
|
<dt class="mb-1 text-gray-500 md:text-xs dark:text-gray-400">Secret ID</dt>
|
|
<dd class="text-xs font-semibold">{{ entry.secret_id }}</dd>
|
|
</div>
|
|
<div class="flex flex-col pb-3">
|
|
<dt class="mb-1 text-gray-500 md:text-xs dark:text-gray-400">Secret Name</dt>
|
|
<dd class="text-xs font-semibold">{{ entry.secret_name }}</dd>
|
|
</div>
|
|
<div class="flex flex-col pb-3">
|
|
<dt class="mb-1 text-gray-500 md:text-xs dark:text-gray-400">Message</dt>
|
|
<dd class="text-xs font-semibold">{{ entry.message }}</dd>
|
|
</div>
|
|
<div class="flex flex-col pb-3">
|
|
<dt class="mb-1 text-gray-500 md:text-xs dark:text-gray-400">Origin</dt>
|
|
<dd class="text-xs font-semibold">{{ entry.origin }}</dd>
|
|
</div>
|
|
{% if entry.data %}
|
|
{% for key, value in entry.data.items() %}
|
|
<div class="flex flex-col pb-3">
|
|
<dt class="mb-1 text-gray-500 md:text-xs dark:text-gray-400">{{ key | capitalize }}</dt>
|
|
<dd class="text-xs font-semibold">{{ value }}</dd>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
</dl>
|
|
</div>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
<td class="p-4 text-sm font-normal text-gray-900 whitespace-nowrap dark:text-white">
|
|
{{ entry.subsystem }}
|
|
</td>
|
|
|
|
<td class="p-4 text-sm font-normal text-gray-900 whitespace-nowrap dark:text-white">
|
|
{{ entry.operation }}
|
|
</td>
|
|
|
|
<td class="p-4 text-sm font-normal text-gray-900 whitespace-nowrap dark:text-white">
|
|
|
|
{% if entry.client_name %}
|
|
<abbr title="{{ entry.client_id }}">{{ entry.client_name }}</abbr>
|
|
{% endif %}
|
|
</td>
|
|
|
|
<td class="p-4 text-sm font-normal text-gray-900 whitespace-nowrap dark:text-white">
|
|
{% if entry.secret_name %}
|
|
<abbr title="{{ entry.secret_id }}">{{ entry.secret_name }}</abbr>
|
|
{% endif %}
|
|
</td>
|
|
<td
|
|
class="p-4 text-sm font-normal text-gray-500 whitespace-nowrap dark:text-gray-400"
|
|
>
|
|
{{ entry.message }}
|
|
</td>
|
|
<td
|
|
class="p-4 text-sm font-normal text-gray-500 whitespace-nowrap dark:text-gray-400"
|
|
>
|
|
{{ entry.origin }}
|
|
</td>
|
|
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% include 'audit/pagination.html.j2' %}
|
|
</div>
|