Prometheus gains a "Widget templates" tab beside Targets. It lists the built-in templates and an admin's own, any that no longer pass the checker first. A template opens as its YAML beside a live preview drawn over a chosen target exactly as the dashboard widget draws it (routes.draw, now shared by both). An admin writes or pastes a new one, reads a .yaml upload into the editor to look over, duplicates any template under a free name, edits and deletes their own; anyone can export the YAML. Built-in templates are read-only. Custom templates are rows in prometheus_widget_templates (migration prometheus_002_templates), kept in backups, keyed "custom:<id>" so a rename keeps its widgets. Saving needs a template that passes the checker and a name no other template has. Create, update and delete are audited and link to the template. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 lines
427 B
HTML
8 lines
427 B
HTML
{# The Prometheus section's tabs: its targets, and the widget templates the
|
|
dashboard widget draws with (#5692). Call in the section_tabs block. #}
|
|
{% from "_macros.html" import section_tabs %}
|
|
{% macro prometheus_tabs(active) -%}
|
|
{{ section_tabs([("targets", "Targets", "/plugins/prometheus/"),
|
|
("templates", "Widget templates", "/plugins/prometheus/templates/")], active, "Prometheus") }}
|
|
{%- endmacro %}
|