FreedomBox/plinth/templates/app-logs.html
Sunil Mohan Adapa e82d959c85
views: Add a menu entry and view for showing logs of an app
Tests:

- View logs menu entry is shown only for apps with daemons. It is now shown for
others such as Backups. It does not add menu for apps such as power.

- View logs entry for Date & Time shows show logs for multiple units. View logs
entry for Nextcloud shows many units.

- The textarea occupies full width. It is not editable. It is always scrolled to
the bottom. Control-A and Control-C selects all the text in it. It is re-sizable
vertically.

- The header shows unit name and unit description correctly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2025-09-18 16:35:23 +03:00

43 lines
1.2 KiB
HTML

{% extends "base.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% block content %}
<h2>{% trans "Logs" %}: {{ app_info.name }}</h2>
<p>
{% blocktrans trimmed %}
These are the last lines of the logs for services involved in this app.
If you want to report a bug, please use the <a
href="https://salsa.debian.org/freedombox-team/freedombox/issues">bug
tracker</a> and attach this log to the bug report.
{% endblocktrans %}
</p>
<div class="alert alert-warning d-flex align-items-center">
<div class="me-2">
<span class="fa fa-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden">{% trans "Caution:" %}</span>
</div>
<div>
{% blocktrans trimmed %}
Please remove any personal information from the log before submitting
the bug report.
{% endblocktrans %}
</div>
</div>
{% for component in logs %}
<section id="logs-section-{{ component.unit }}">
<h3>{{ component.unit }}: {{ component.description }}</h3>
<p>
<textarea class="log" readonly rows="10">{{ component.logs }}</textarea>
</p>
</section>
{% endfor %}
{% endblock %}