{# select or count over the threads or the queues of every addressed server. The columns are dynamic here, unlike the registry's fixed five: the thread table is 26 wide and a statement projects what it wants, so the row loop reads values by attribute rather than naming them. That is the same access the row matcher and the export use, which is what keeps a derived column rendering exactly as it filters. #}
{{ t("threads.badge." ~ outcome.kind) }} {% if outcome.verb == "count" %} {{ t("results.hits") }}: {{ outcome.total }} {% else %} {{ t("results.rows", n=outcome.total) }} {% if outcome.truncated %}({{ t("results.rows_shown", n=outcome.rows|length) }}){% endif %} {% endif %} {% if outcome.servers %} {{ t("threads.servers", n=outcome.servers|length) }}: {{ outcome.servers|join(", ") }} {% endif %}
{% for failure in outcome.errors %} {% endfor %} {% if outcome.verb == "count" %}
{{ outcome.total }}
{{ t("results.hits") }}
{% if outcome.counts|length > 1 %} {% endif %}
{% elif not outcome.rows %}
{{ t("results.empty") }}
{% else %}
{% if outcome.kind == "threads" %} {% endif %} {% for column in outcome.columns %} {{ t("threads." ~ outcome.kind ~ ".column." ~ column) }} {% endfor %} {% for row in outcome.rows %} {% if outcome.kind == "threads" %} {% endif %} {% for column in outcome.columns %} {# attr reaches fields and derived properties alike, which is the same access the matcher and the export use. #} {% set value = row|attr(column) %} {% if column == "server" %} {# host:port is the identity a condition and an on clause use; the machine's own name rides along muted. #} {% elif column == "running" %} {# The state of the row, as the job call monitor draws one: a play sign while a job is on the thread, a check once it is done. Danger rather than the monitor's info colour because here a running job is the thing you came looking for. #} {% elif column == "idle" %} {% elif value is none %} {# A running job has no stop time and an unused thread has no times at all, so a null is an ordinary value here. #} {% elif column in outcome.numeric %} {% elif column in outcome.stamps %} {% else %} {% endif %} {% endfor %} {% endfor %}
{{ t("results.actions") }}
{# Both statements are prefilled and never run from the table, the way the registry's edit button works. The break button is offered for every thread that has ever run a job, not only one running right now: a snapshot is a moment and the statement is written for later, so tying the button to that moment made it unreachable in practice. A running row pins the job number it saw; a finished row leaves it out, so the runner reads whatever the thread is doing when the statement is actually run. A thread that has never been used gets no button, because there is nothing to name. #} {# The harmless read first, the destructive request second, so the stack is what the hand reaches for by default. #} {% if not row.idle %} {% endif %} {{ value }} {% if row.computer %}ยท {{ row.computer }}{% endif %} {% if value %} {{ t("threads.state_running") }} {% elif row.idle %} {# A plain hyphen, not a minus icon: the glyph reads as a dash and dashes of that shape are not used here. Same mark every empty cell in this table already shows. #} - {{ t("threads.state_unused") }} {% else %} {{ t("threads.state_done") }} {% endif %} {% if value %} {# Muted rather than the success colour: a thread nobody has used is neither good nor bad. #} {{ t("threads.yes") }} {% else %} - {{ t("threads.no") }} {% endif %} -{{ value|round(1) if value is float else value }}{{ value.strftime("%Y-%m-%d %H:%M:%S.") }}{{ "%03d"|format(value.microsecond // 1000) }}{{ value }}
{% endif %}