{# Shared Jinja2 macros for the Hassette Web UI #} {# Status badge for apps/instances #} {% macro status_badge(status, size="", block_reason="") %} {% if status == "running" %} running {% elif status == "failed" %} failed {% elif status == "stopped" %} stopped {% elif status == "disabled" %} disabled {% elif status == "blocked" %} blocked {% else %} {{ status }} {% endif %} {% endmacro %} {# Action buttons for starting/stopping/reloading apps #} {% macro action_buttons(app_key, status, after_action="location.reload()", show_labels=true) %}
{% if status == "running" %} {% elif status in ["failed", "stopped"] %} {% endif %}
{% endmacro %} {# Log table Alpine.js component #} {% macro log_table(show_app_column, app_key="", max_height="600px", app_keys=None) %} {% if app_key %}
{% else %}
{% endif %}
{% if show_app_column and app_keys is not none %}
{% endif %}
{% if show_app_column %} Loading... {% endif %}
{% if show_app_column %} {% endif %}
Level Timestamp App Message
{% endmacro %} {# Job execution status badge #} {% macro job_status_badge(status) %} {% if status == "success" %} success {% elif status == "error" %} error {% else %} {{ status }} {% endif %} {% endmacro %}