{#- Scheduling on the project and packet pages (docs/scheduler.md §9). Each form posts to one control (sched/control.py). -#} {% macro select(name, opts, cur, blank) -%} {%- endmacro %} {% macro packet_panel(e, wpid, sch, classes) -%} {% set base = "/p/" ~ (e.name|urlencode) ~ "/" ~ wpid %}

Scheduling

{{ sch.cls }} {{ "its own class" if sch.cls_from == "packet" else "the project's class" if sch.cls_from == "project" else "the default class" }} · size {{ sch.size }} {% if sch.next %}· runs next{% endif %} {% if sch.job %}· job {{ sch.job.id }} {{ sch.job.state|lower }}{% endif %}

{% if sch.row %}

{% if sch.row.waiting %}Waiting on: {{ sch.row.why }}{% if sch.row.clears_at %} (until {{ sch.row.clears_at }}){% endif %}{% else %}Starts next{% endif %} · #{{ sch.row.pos }} in the queue

{% endif %}
{{ select("value", classes, sch.own_cls, "the project's class") }}
{% if sch.sizes|length > 1 %}
{{ select("value", sch.sizes, sch.own_size, "the project's size") }}
{% endif %}
{% if sch.next %}{% else %}{% endif %}
{%- endmacro %} {% macro project_panel(e, sch, classes, back="") -%} {% set base = "/p/" ~ (e.name|urlencode) %}

Scheduling

{{ sch.cls }} {% if sch.size %}· size {{ sch.size }}{% endif %} · {{ sch.cores }} core{{ "s" if sch.cores != 1 }} in use{% if sch.jobs %}, {{ sch.jobs|length }} job{{ "s" if sch.jobs|length != 1 }}{% endif %} · {{ sch.queue|length }} due{% if sch.queue|selectattr("waiting")|list %}, {{ sch.queue|selectattr("waiting")|list|length }} waiting{% endif %}

{% if sch.hold %}

On hold{% if sch.hold_by %} by {{ sch.hold_by }}{% endif %}{% if sch.hold_at %} at {{ sch.hold_at }}{% endif %}{% if sch.hold_reason %}: {{ sch.hold_reason }}{% endif %}. Nothing new starts here; packets keep their state.

{% endif %}
{% if back %}{% endif %} {{ select("value", classes, sch.own_cls, "normal (default)") }}
{% if sch.sizes|length > 1 %}
{% if back %}{% endif %} {{ select("value", sch.sizes, sch.size, "the default size") }}
{% endif %}
{% if back %}{% endif %} {% if sch.hold %} {% else %}{% endif %}
{% if sch.queue %} {% for r in sch.queue %}{% endfor %}
{{ r.wpid[:8] }}{{ r['class'] }}{{ r.size }}{{ r.why }}
{% endif %}
{%- endmacro %}