- /plugins/syslog/sources/<id>: the lines newest first, loading as you scroll, filtered by severity and worse, app, text and time, with day dividers and times to the second in the reader's zone. - The Syslog page links each source and shows its lines in the last hour. - A Syslog panel on a host's page and an SNMP device's: the newest lines of the sources bound to it or at its address. - MCP: list_syslog_sources and search_syslog (source, host, text, severity and worse, app, range, paging by next_before). - Shared: escape_like moves to steward/core/like.py and cut_middle to the MCP shaping module, replacing four inline copies; |when takes seconds=. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
1.6 KiB
HTML
31 lines
1.6 KiB
HTML
{# plugins/syslog/templates/syslog/panel.html — the syslog panel on a host's
|
|
or an SNMP device's page: the newest lines of the sources that map to it,
|
|
each linking to its source's page (#6000). #}
|
|
{% from "syslog/_tone.html" import tone %}
|
|
<div class="card">
|
|
<div style="display:flex;align-items:baseline;justify-content:space-between;margin-bottom:0.6rem;gap:1rem;flex-wrap:wrap;">
|
|
<h3 class="section-title" style="margin-bottom:0;">Syslog</h3>
|
|
<span class="field-hint">
|
|
{%- for s in sources %}{% if not loop.first %} · {% endif %}<a href="/plugins/syslog/sources/{{ s.id }}">{{ s.name }}</a>{% endfor -%}
|
|
</span>
|
|
</div>
|
|
{% if not lines %}
|
|
<p class="field-hint" style="margin:0;">No lines in the last day.</p>
|
|
{% else %}
|
|
<table class="table" style="font-size:0.8rem;">
|
|
<thead><tr><th class="nowrap">Received ({{ tz_label() }})</th>{% if sources|length > 1 %}<th>Source</th>{% endif %}<th>Severity</th><th>App</th><th>Message</th></tr></thead>
|
|
<tbody>
|
|
{% for ln in lines %}
|
|
<tr>
|
|
<td class="nowrap">{{ ln.received_at|when(seconds=true) }}</td>
|
|
{% if sources|length > 1 %}<td class="nowrap"><a href="/plugins/syslog/sources/{{ ln.source_id }}">{{ ln.source }}</a></td>{% endif %}
|
|
<td class="nowrap"><span class="{{ tone(ln.level) }}">{{ ln.severity }}</span></td>
|
|
<td class="nowrap">{{ ln.app or "—" }}</td>
|
|
<td class="mono" style="max-width:32rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" title="{{ ln.message }}">{{ ln.message }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endif %}
|
|
</div>
|