{% extends "admin/base_site.html" %} {% load i18n static django_cachex_admin %} {% block extrastyle %} {{ block.super }} {% endblock %} {% block bodyclass %}{{ block.super }} app-django_cachex model-cache change-form{% endblock %} {% block breadcrumbs %} {% url "admin:index" as index_href %} {% url "admin:django_cachex_cache_changelist" as cache_list_href %} {% cachex_breadcrumbs _("Home") index_href _("Caches") cache_list_href cache_name %} {% endblock %} {% block object-tools %}{% include "admin/django_cachex/cache/_object_tools.html" %}{% endblock %} {% block content %} {% cachex_tools_in_header as tools_in_header %} {% if not tools_in_header %}{% include "admin/django_cachex/cache/_object_tools.html" %}{% endif %}
{% if cache_obj.support_level != "cachex" %}

{% trans "Limited backend" %}

{% blocktrans %}This backend doesn't expose a key-listing API, so the django-cachex admin can only display its configuration. Browsing, type detection, TTL inspection, and edits aren't available.{% endblocktrans %}

{% if cache_obj.cachex_upgrade_hint %}

{% blocktrans with hint=cache_obj.cachex_upgrade_hint %}Switch BACKEND to {{ hint }} for the full admin experience.{% endblocktrans %}

{% endif %}
{% endif %} {% if info_data %}

{% trans "Configuration" %}

{% trans "Backend" %} {{ info_data.backend }}
{% trans "Location" %} {{ info_data.location|default:"-" }}
{% trans "Key Prefix" %} {{ info_data.key_prefix|default:"-" }}
{% trans "Version" %} {{ info_data.version }}
{% trans "Support" %} {{ cache_obj.support_level }}
{% if info_data.server_rows %}

{% trans "Server" %}

{% for row in info_data.server_rows %} {% endfor %}
{{ row.label }}{{ row.value }}
{% endif %} {% if info_data.memory_rows %}

{% trans "Memory" %}

{% for row in info_data.memory_rows %} {% endfor %}
{{ row.label }}{{ row.value }}
{% endif %} {% if info_data.clients_rows %}

{% trans "Clients" %}

{% for row in info_data.clients_rows %} {% endfor %}
{{ row.label }}{{ row.value }}
{% endif %} {% if info_data.stats_rows %}

{% trans "Statistics" %}

{% for row in info_data.stats_rows %} {% endfor %}
{{ row.label }}{{ row.value }}
{% endif %} {% if info_data.keyspace %}

{% trans "Keyspace" %}

{% for db_name, db_stats in info_data.keyspace.items %}

{{ db_name }}

{% if db_stats.keys is not None %}
{% trans "Keys" %} {{ db_stats.keys }}
{% endif %} {% if db_stats.expires is not None %}
{% trans "Expires" %} {{ db_stats.expires }}
{% endif %} {% if db_stats.avg_ttl is not None %}
{% trans "Avg TTL" %} {{ db_stats.avg_ttl }}ms
{% endif %}
{% endfor %}
{% endif %} {% if raw_info_json %}

{% trans "Raw Info" %}

{% endif %} {% endif %} {% if slowlog_data %}

{% trans "Slow Log" %}

{% if slowlog_data.error %}

{% blocktrans with error=slowlog_data.error %}The slow log could not be read: {{ error }}{% endblocktrans %}

{% elif slowlog_data.entries %}
{% for entry in slowlog_data.entries %} {% endfor %}
{% trans "ID" %} {% trans "Time" %} {% trans "Duration" %} {% trans "Command" %} {% trans "Client" %}
{{ entry.id }} {% if entry.timestamp %} {{ entry.timestamp|date:"Y-m-d H:i:s" }} {% else %} - {% endif %} {% if entry.duration_us >= 1000000 %} {{ entry.duration_us|floatformat:0 }} µs ({{ entry.duration_s|floatformat:1 }}s) {% elif entry.duration_us >= 1000 %} {{ entry.duration_us }} µs ({{ entry.duration_ms|floatformat:1 }}ms) {% else %} {{ entry.duration_us }} µs {% endif %} {% for arg in entry.command %}{{ arg }} {% endfor %} {% if entry.client %}{{ entry.client }}{% endif %} {% if entry.client_name %}
{{ entry.client_name }}{% endif %}
{% else %}

{% trans "No slow queries recorded." %}

{% endif %}
{% endif %} {% if show_danger_zone %}

{% trans "Danger Zone" %}

{% trans "Clear all versions" %}

{% trans "Delete all keys for this cache across every version. More destructive than the regular clear which only removes the current version." %}

{% csrf_token %}
{% trans "Flush database" %}

{% trans "Execute FLUSHDB. Removes every key on the primary you're connected to (single-node only; flushing a cluster requires per-node FLUSHDB). Affects all keys on that primary, not just those belonging to this cache." %}

{% csrf_token %}
{% endif %}
{% trans "Back" %}
{% endblock %}