{# SPDX-FileCopyrightText: 2026 Front Matter. SPDX-License-Identifier: MIT The commonmeta store's status (administration.StoreStatusView): the files as this process sees them, the sources' versions and updates, and whether the store is answering. Read-only; the store is written outside InvenioRDM. #} {% extends admin_base_template %} {%- macro when(value) -%} {%- if value is none -%}– {%- elif value is string -%}{{ value }} {%- else -%}{{ value.strftime("%Y-%m-%d %H:%M UTC") }} {%- endif -%} {%- endmacro -%} {%- macro number(value) -%} {%- if value is none -%}–{%- else -%}{{ "{:,}".format(value) }}{%- endif -%} {%- endmacro -%} {%- macro state(ok, good, bad) -%} {%- if ok -%} {{ good }} {%- else -%} {{ bad }} {%- endif -%} {%- endmacro -%} {%- macro file_row(label, file) -%} {{ label }} {{ file.path }} {%- if not file.exists -%} {{ _("Missing") }} {%- else -%} {{ state(file.readable, _("Readable"), _("Not readable")) }} {%- endif -%} {{ file.size | filesizeformat if file.exists else "–" }} {{ when(file.modified) if file.exists else "–" }} {%- endmacro -%} {% block admin_page_content %}
{%- if not status.configured %}

{{ _("No store is configured (PIDBOX_SQLITE_PATH).") }}

{%- else %} {%- set breaker = status.breaker %} {%- set index = status.index %} {%- if status.problems %}
{%- else %}

{{ _("The store and its search index can be read, and the store is answering.") }}

{%- endif %}

{{ _("Files") }}

{{ file_row(_("Store"), status.store) }} {{ file_row(_("Write-ahead log"), status.wal) }}
{{ _("File") }} {{ _("Path") }} {{ _("Status") }} {{ _("Size") }} {{ _("Changed") }}
{{ _("Search index") }} {{ index.path }} {%- if not index.exists -%} {{ _("Missing") }} {%- else -%} {{ state(index.readable and not index.unreadable, _("Readable"), _("Not readable")) }} {%- endif -%} {{ index.size | filesizeformat if index.size is defined else "–" }} {{ when(index.modified) if index.modified is defined else "–" }}
{%- if index.unreadable %}

{{ _("Files of the search index this site can't read:") }} {% for name in index.unreadable %}{{ name }}{{ ", " if not loop.last }}{% endfor %}

{{ _("Make them readable to all on the host, e.g. chmod 644, after the index is built.") }}

{%- endif %} {%- if status.sources is defined %}

{{ _("Sources") }}

{%- for source in status.sources %} {%- else %} {%- endfor %}
{{ _("Source") }} {{ _("Version") }} {{ _("Last download") }} {{ _("Files") }} {{ _("Records") }} {{ _("Updated to") }} {{ _("Last unavailable") }}
{{ source.name }} {{ source.version or "–" }} {{ when(source.downloaded) }} {{ number(source.files) }} {{ number(source.records) }} {{ source.updated or "–" }} {{ source.unavailable or "–" }}
{{ _("The store records no sources.") }}
{%- endif %}

{{ _("Details") }}

{%- if status.schema_version is defined %} {%- endif %} {%- for name, installed in status.packages.items() %} {%- endfor %}
{{ _("Schema version") }}{{ status.schema_version }}
{{ _("Indexed sources") }}{{ status.index_sources | join(", ") or "–" }}
{{ _("Indexed up to record") }}{{ status.index_rowid or "–" }}
{{ _("Answering") }} {{ state(breaker.available, _("Yes"), _("No")) }} {%- if breaker.consecutive_failures %} {{ _("{count} timeouts in a row").format(count=breaker.consecutive_failures) }}{% endif %}
{{ name }}{{ installed or _("Not installed") }}
{%- endif %}
{% endblock admin_page_content %}