diff options
author | RĂ©mi Duraffort <remi.duraffort@linaro.org> | 2017-12-05 17:32:08 +0100 |
---|---|---|
committer | Neil Williams <neil.williams@linaro.org> | 2017-12-21 10:37:34 +0000 |
commit | 6114d0f9bf2e298223c1be58054a68b1634baa69 (patch) | |
tree | cb618095097a909bc9cb2069677fe64f95be4757 /lava_scheduler_app/templates/lava_scheduler_app | |
parent | 320cb918c391cbfb7be41dd02d1d64221b994239 (diff) |
Rewrite from scratch the job scheduler
This patch is made of two parts:
1/ changing the Device and TestJob state machine
2/ rewrite of the TestJob scheduler
Tests for the scheduler and the state machine are still missing.
Change-Id: I80f55c0ba89f978875ab079d2bf595a3c963017b
Diffstat (limited to 'lava_scheduler_app/templates/lava_scheduler_app')
10 files changed, 59 insertions, 459 deletions
diff --git a/lava_scheduler_app/templates/lava_scheduler_app/_device_base.html b/lava_scheduler_app/templates/lava_scheduler_app/_device_base.html index e934ae330..92fca24a3 100644 --- a/lava_scheduler_app/templates/lava_scheduler_app/_device_base.html +++ b/lava_scheduler_app/templates/lava_scheduler_app/_device_base.html @@ -61,26 +61,35 @@ </div> <div class="col-md-4"> <dl class="dl-horizontal"> - <dt>Status</dt> + <dt>State</dt> + <dd>{{ device.get_state_display }}</dd> + <dt>Health</dt> <dd> - {% if transition %}<abbr title="{{ transition }}">{% endif %} - {% if device.status == device.OFFLINE or device.status == device.OFFLINING %} - <span class="label label-warning">{{ device.get_status_display }}</span> - {% elif device.status == device.IDLE or device.status == device.RUNNING or device.status == device.RESERVED %} - <span class="label label-success">{{ device.get_status_display }}</span> - {% else %} - <span class="label label-danger">{{ device.get_status_display }}</span> - {% endif %} - {% if transition %}</abbr>{% endif %} + {% if can_admin %} + <div class="dropdown"> + {% endif %} + {% if device.health == device.HEALTH_GOOD %} + <span class="label label-success"> + {% elif device.health == device.HEALTH_UNKNOWN or device.health == device.HEALTH_LOOPING %} + <span class="label label-warning"> + {% else %} + <span class="label label-danger"> + {% endif %} + {{ device.get_health_display }} + </span> + {% if can_admin %} + <span class="glyphicon glyphicon-pencil" id="device_health_menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"></span> + <ul class="dropdown-menu" aria-labelledby="device_health_menu"> + {% if device.health != device.HEALTH_GOOD %}<li><a href="{% url 'lava.scheduler.device.good' device.pk %}">Good</a></li>{% endif %} + {% if device.health != device.HEALTH_UNKNOWN %}<li><a href="{% url 'lava.scheduler.device.unknown' device.pk %}">Unknown</a></li>{% endif %} + {% if device.health != device.HEALTH_LOOPING %}<li><a href="{% url 'lava.scheduler.device.looping' device.pk %}">Looping</a></li>{% endif %} + <li role="separator" class="divider"></li> + {% if device.health != device.HEALTH_MAINTENANCE %}<li><a href="{% url 'lava.scheduler.device.maintenance' device.pk %}">Maintenance</a></li>{% endif %} + {% if device.health != device.HEALTH_RETIRED %}<li><a href="{% url 'lava.scheduler.device.retired' device.pk %}">Retired</a></li>{% endif %} + </ul> + </div> + {% endif %} </dd> - <dt>Health</dt> - {% if device.health_status == device.HEALTH_PASS %} - <dd class="text-success">Pass</dd> - {% elif device.health_status == device.HEALTH_FAIL %} - <dd class="text-danger">Fail</dd> - {% else %} - <dd class="text-warning">{{ device.get_health_status_display }}</dd> - {% endif %} <dt>Worker</dt> <dd><a href="{{ device.worker_host.get_absolute_url }}">{{ device.worker_host.hostname }}</a></dd> <dt>Device dictionary</dt> @@ -107,398 +116,11 @@ </div> </div> -{% if show_maintenance or cancel_looping or show_online or show_forcehealthcheck or edit_description or show_pool %} -<div class="row"> - <div class="col-md-6"> - <h4 class="modal-header">Actions</h4> - <div class="row"> - <div class="col-md-6"> -{% if show_maintenance %} - <div class="btn-group btn-group-justified"> - <div class="btn-group"> - <button class="btn btn-primary" data-toggle="modal" data-target="#maintenanceDialog">Maintenance</button> - <div class="modal fade" id="maintenanceDialog" tabindex="-1" role="dialog" aria-labelledby="maintenanceDialoglabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title" id="maintenanceDialoglabel">Reason for offlining</h4> - </div> - <div class="modal-body"> - <form method="post" action="{% url 'lava.scheduler.device.maintenance' device.pk %}"> - <div id="maintenance-container" class="form-group has-error has-feedback"> - <p>a reason must be specified:</p> - <input id="maintenance-reason" name="reason"/> - {% csrf_token %} - <div id="maintenance-feedback"> - </div> - </div> - <dl class="dl-horizontal"> - {% if device.current_job %} - <div class="form-group"> - <input type="checkbox" name="notify" value="{{user.email}}">notify {{ user.email }} when job {{ device.current_job.id }} is complete. - </div> - {% endif %} - <div class="form-group"> - <div id="maintenance-submit"> - </div> - </div> - </dl> - </form> - </div> - </div> - </div> - </div> - </div> - </div> -{% endif %} -{% if cancel_looping and can_admin %} - <div class="btn-group btn-group-justified"> - <div class="btn-group"> - <button class="btn btn-warning" data-toggle="modal" data-target="#stoploopingDialog">Cancel Looping mode</button> - <div class="modal fade" id="stoploopingDialog" tabindex="-1" role="dialog" aria-labelledby="stoploopingDialoglabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title" id="stoploopingDialoglabel">Reason for stopping looping mode</h4> - </div> - <div class="modal-body"> - <form method="post" action="{% url 'lava.scheduler.device.maintenance' device.pk %}"> - <div id="stoplooping-container" class="form-group has-error has-feedback"> - <p>A reason must be specified:</p> - <input id="stoplooping-reason" name="reason"/> - {% csrf_token %} - <div id="stoplooping-feedback"> - </div> - </div> - <dl class="dl-horizontal"> - <div class="form-group"> - <div id="stoplooping-submit"> - </div> - </div> - </dl> - </form> - </div> - </div> - </div> - </div> - </div> - </div> -{% endif %} -{% if show_online %} - <div class="btn-group btn-group-justified"> - <div class="btn-group"> - <button class="btn btn-primary" data-toggle="modal" data-target="#onlineDialog">Put online</button> - <div class="modal fade" id="onlineDialog" tabindex="-1" role="dialog" aria-labelledby="onlineDialoglabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title" id="onlineDialoglabel">Reason for onlining</h4> - </div> - <div class="modal-body"> - <form method="post" action="{% url 'lava.scheduler.device.online' device.pk %}"> - <div id="online-container" class="form-group has-error has-feedback"> - <p>A reason must be specified:</p> - <input id="online-reason" name="reason"/> - {% csrf_token %} - <input type="checkbox" name="skiphealthcheck" value="True"/> Skip manual health check <abbr - title="An automatic health check may still run if one is already due.">(?)</abbr> - <div id="online-feedback"> - </div> - </div> - <dl class="dl-horizontal"> - <div class="form-group"> - <div id="online-submit"> - </div> - </div> - </dl> - </form> - </div> - </div> - </div> - </div> - </div> - </div> - {% if device.status == device.OFFLINE %} - <div class="btn-group btn-group-justified"> - <div class="btn-group"> - <button class="btn btn-warning" data-toggle="modal" data-target="#loopingDialog">Looping mode</button> - <div class="modal fade" id="loopingDialog" tabindex="-1" role="dialog" aria-labelledby="loopingDialoglabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title" id="loopingDialoglabel">Reason for looping health checks</h4> - </div> - <div class="modal-body"> - <form method="post" action="{% url 'lava.scheduler.device.looping' device.pk %}"> - <div id="looping-container" class="form-group has-error has-feedback"> - <p>A reason must be specified:</p> - <input id="looping-reason" name="reason"/> - {% csrf_token %} - <div id="looping-feedback"> - </div> - </div> - <dl class="dl-horizontal"> - <div class="form-group"> - <div id="looping-submit"> - </div> - </div> - </dl> - </form> - </div> - </div> - </div> - </div> - </div> - </div> - {% endif %} -{% endif %} -{% if show_forcehealthcheck %} - <div class="btn-group btn-group-justified"> - <div class="btn-group"> - <form method="POST" action="{% url 'lava.scheduler.device.forcehealthcheck' device.pk %}"> - {% csrf_token %} - <button class="btn btn-info" id="forcehealthcheck-button">Force Health Check</button> - </form> - </div> - </div> -{% endif %} - </div> - - <div class="col-md-6"> - {% if user.is_authenticated and user.is_superuser %} - <div class="btn-group btn-group-justified"> - <div class="btn-group"> - <a href="{% url 'admin:lava_scheduler_app_device_change' device.pk %}" class="btn btn-danger" title="Admin this device - {{ device.hostname }}"> - Admin this device - </a> - </div> - </div> - {% endif %} -{% if edit_description %} - <div class="btn-group btn-group-justified"> - <div class="btn-group"> - <button class="btn btn-default" data-toggle="modal" data-target="#descriptionDialog">Edit description</button> - <div class="modal fade" id="descriptionDialog" tabindex="-1" role="dialog" aria-labelledby="descriptionDialoglabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title" id="descriptionDialoglabel">Edit device description</h4> - </div> - <div class="modal-body"> - <form method="post" action="{% url 'lava.scheduler.device.edit_description' device.pk %}"> - <div id="description-container" class="form-group"> - <p>An empty description will clear the existing content</p> - <input id="device-description" name="desc" value="{{ device.get_description }}"/> - {% csrf_token %} - </div> - <dl class="dl-horizontal"> - <div class="form-group"> - <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> - <button type="submit" class="btn btn-success">Set</button> - </div> - </dl> - </form> - </div> - </div> - </div> - </div> - </div> - </div> -{% endif %} -{% if show_restrict %} - <div class="btn-group btn-group-justified"> - <div class="btn-group"> - <button class="btn btn-danger" data-toggle="modal" data-target="#restrictDialog">Restrict submission</button> - <div class="modal fade" id="restrictDialog" tabindex="-1" role="dialog" aria-labelledby="restrictDialoglabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title" id="restrictDialoglabel">Reasons for restricting {{ device.hostname }}</h4> - </div> - <div class="modal-body"> - <form method="post" action="{% url 'lava.scheduler.device.restrict_device' device.pk %}"> - <div id="restrict-container" class="form-group has-error has-feedback"> - <p>A reason must be specified:</p> - <input id="restrict-reason" name="reason"/> - {% csrf_token %} - <div id="restrict-feedback"> - </div> - </div> - <dl class="dl-horizontal"> - <div class="form-group"> - <div id="restrict-submit"> - </div> - </div> - </dl> - </form> - </div> - </div> - </div> - </div> - </div> - </div> -{% endif %} -{% if show_pool %} - <div class="btn-group btn-group-justified"> - <div class="btn-group"> - <button class="btn btn-danger" data-toggle="modal" data-target="#poolDialog">Return {{ device.hostname }} to the pool</button> - <div class="modal fade" id="poolDialog" tabindex="-1" role="dialog" aria-labelledby="poolDialoglabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> - <h4 class="modal-title" id="poolDialoglabel">Reasons for returning {{ device.hostname }} to the pool</h4> - </div> - <div class="modal-body"> - <form method="post" action="{% url 'lava.scheduler.device.derestrict_device' device.pk %}"> - <div id="derestrict-container" class="form-group has-error has-feedback"> - <p>A reason must be specified:</p> - <input id="derestrict-reason" name="reason"/> - {% csrf_token %} - <div id="derestrict-feedback"> - </div> - </div> - <dl class="dl-horizontal"> - {% if device.current_job %} - <div class="form-group"> - <input type="checkbox" name="notify" value="{{user.email}}">Notify {{ user.email }} when job {{ device.current_job.id }} is complete. - </div> - {% endif %} - <div class="form-group"> - <div id="derestrict-submit"> - </div> - </div> - </dl> - </form> - </div> - </div> - </div> - </div> - </div> - </div> -{% endif %} - </div> - - </div> - </div> -</div> -{% endif %} - {% block content_columns %} {% endblock %} -<h3>Status transitions</h3> - {% render_table transition_table %} - {% endblock %} {% block scripts %} -<script type="text/javascript" src="{{ STATIC_URL }}lava_scheduler_app/js/jquery.details.min.js"></script> -<script type="text/javascript" src="{{ STATIC_URL }}lava_scheduler_app/js/jquery.jeditable.min.js"></script> <script type="text/javascript" src="{{ STATIC_URL }}lava_scheduler_app/js/tables.min.js"></script> - -<script> - $(document).ready( - function() { - {% if show_maintenance %} - $("#maintenance-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>'); - {% endif %} - {% if show_online %} - $("#online-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>'); - {% endif %} - {% if show_restrict %} - $("#restrict-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>'); - {% endif %} - {% if show_pool %} - $("#derestrict-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>'); - {% endif %} - }); - {% if show_maintenance %} - $("#maintenance-container").keydown( - function(e) { - if (document.getElementById("maintenance-reason").value!=""){ - $("#maintenance-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>') - $("#maintenance-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' + - '<button type="submit" class="btn btn-primary">Put {{ device.hostname }} offline</button>'); - } else { - $("#maintenance-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span> ') - $("#maintenance-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>') - } - } - ) - $("#stoplooping-container").keydown( - function(e) { - if (document.getElementById("stoplooping-reason").value!="") { - $("#stoplooping-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>') - $("#stoplooping-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' + - '<button type="submit" class="btn btn-primary">Cancel looping mode</button>'); - } else { - $("#stoplooping-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span> ') - $("#stoplooping-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>') - } - } - ) - {% endif %} - {% if show_online %} - $("#online-container").keydown( - function(e) { - if (document.getElementById("online-reason").value!=""){ - $("#online-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>') - $("#online-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' + - '<button type="submit" class="btn btn-primary">Put {{ device.hostname }} online</button>'); - } else { - $("#online-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span> ') - $("#online-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>') - } - } - ) - $("#looping-container").keydown( - function(e) { - if (document.getElementById("looping-reason").value!="") { - $("#looping-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>') - $("#looping-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' + - '<button type="submit" class="btn btn-primary">Put {{ device.hostname }} into looping mode</button>'); - } else { - $("#looping-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span> ') - $("#looping-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>') - } - } - ) - {% endif %} - {% if show_restrict %} - $("#restrict-container").keydown( - function(e) { - if (document.getElementById("restrict-reason").value!=""){ - $("#restrict-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>') - $("#restrict-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' + - '<button type="submit" class="btn btn-primary">Restrict {{ device.hostname }} </button>'); - } else { - $("#restrict-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span> ') - $("#restrict-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>') - } - } - ) - {% endif %} - {% if show_pool %} - $("#derestrict-container").keydown( - function(e) { - if (document.getElementById("derestrict-reason").value!=""){ - $("#derestrict-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>') - $("#derestrict-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' + - '<button type="submit" class="btn btn-primary">Return {{ device.hostname }} to the pool</button>'); - } else { - $("#derestrict-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span> ') - $("#derestrict-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>') - } - } - ) - {% endif %} -</script> - {% endblock %} diff --git a/lava_scheduler_app/templates/lava_scheduler_app/_device_refresh.html b/lava_scheduler_app/templates/lava_scheduler_app/_device_refresh.html index c4dd3eab5..001377772 100644 --- a/lava_scheduler_app/templates/lava_scheduler_app/_device_refresh.html +++ b/lava_scheduler_app/templates/lava_scheduler_app/_device_refresh.html @@ -5,11 +5,7 @@ href="{% url 'lava.scheduler.device_report' job.actual_device.pk %}">(reports)</a></dd> {% endif %} - {% if job.requested_device %} - <dt>Type</dt> - <dd><a href="{{ job.requested_device.device_type.get_absolute_url }}">{{ job.requested_device.device_type }}</a> <a - href="{% url 'lava.scheduler.device_type_report' job.requested_device.device_type %}">(reports)</a></dd> - {% elif job.requested_device_type %} + {% if job.requested_device_type %} <dt>Requested type</dt> <dd><a href="{{ job.requested_device_type.get_absolute_url }}">{{ job.requested_device_type }}</a> <a href="{% url 'lava.scheduler.device_type_report' job.requested_device_type %}">(reports)</a></dd> diff --git a/lava_scheduler_app/templates/lava_scheduler_app/allworkers.html b/lava_scheduler_app/templates/lava_scheduler_app/allworkers.html index d0c7deb2c..3845275b2 100644 --- a/lava_scheduler_app/templates/lava_scheduler_app/allworkers.html +++ b/lava_scheduler_app/templates/lava_scheduler_app/allworkers.html @@ -7,6 +7,9 @@ {% render_table worker_table %} +<h2>Transitions</h2> +{% render_table worker_log_table %} + {% endblock %} {% block scripts %} diff --git a/lava_scheduler_app/templates/lava_scheduler_app/device.html b/lava_scheduler_app/templates/lava_scheduler_app/device.html index 5529e731f..910fe3628 100644 --- a/lava_scheduler_app/templates/lava_scheduler_app/device.html +++ b/lava_scheduler_app/templates/lava_scheduler_app/device.html @@ -27,7 +27,9 @@ {% block content_columns %} <hr/> <h3>Recent jobs on {{ device.hostname }}</h3> -<div id="recent_job"> {% render_table recent_job_table %} -</div> + +<h3>Transitions</h3> + {% render_table device_log_table %} + {% endblock %} diff --git a/lava_scheduler_app/templates/lava_scheduler_app/device_health_history_log.html b/lava_scheduler_app/templates/lava_scheduler_app/device_health_history_log.html deleted file mode 100644 index e606b581c..000000000 --- a/lava_scheduler_app/templates/lava_scheduler_app/device_health_history_log.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends "layouts/content.html" %} - -{% load django_tables2 %} -{% load i18n %} - -{% block content %} - -<h2>Health History Log for {{ device.hostname }}</h2> - -<div id="device_health_history_log"> -{% render_table healthhistory_table %} -</div> - -{% endblock %} - -{% block scripts %} -<script type="text/javascript" src="{{ STATIC_URL }}lava_scheduler_app/js/tables.min.js"></script> -{% endblock %} - diff --git a/lava_scheduler_app/templates/lava_scheduler_app/device_reports.html b/lava_scheduler_app/templates/lava_scheduler_app/device_reports.html index 2e505f6d1..e2166b9e0 100644 --- a/lava_scheduler_app/templates/lava_scheduler_app/device_reports.html +++ b/lava_scheduler_app/templates/lava_scheduler_app/device_reports.html @@ -11,9 +11,7 @@ {% endblock styles %} {% block content %} -<h2 class="modal-header">Health Job Summary for {{ device.hostname }} <a -class="btn btn-xs btn-info" href="{% url 'lava.scheduler.device_health_history_log' device.hostname %}" -title="History of health changes"><span class="glyphicon glyphicon-heart"></span> history log</a></h2> +<h2>Health Job Summary for {{ device.hostname }}</h2> <div class="row"> <div class="col-md-5"> diff --git a/lava_scheduler_app/templates/lava_scheduler_app/job_definition.html b/lava_scheduler_app/templates/lava_scheduler_app/job_definition.html index 8ab3b411e..d1a28f818 100644 --- a/lava_scheduler_app/templates/lava_scheduler_app/job_definition.html +++ b/lava_scheduler_app/templates/lava_scheduler_app/job_definition.html @@ -30,11 +30,7 @@ href="{% url 'lava.scheduler.device_report' job.actual_device.pk %}">(reports)</a></dd> {% endif %} - {% if job.requested_device %} - <dt>Type</dt> - <dd><a href="{{ job.requested_device.device_type.get_absolute_url }}">{{ job.requested_device.device_type }}</a> <a - href="{% url 'lava.scheduler.device_type_report' job.requested_device.device_type %}">(reports)</a></dd> - {% elif job.requested_device_type %} + {% if job.requested_device_type %} <dt>Requested type</dt> <dd><a href="{{ job.requested_device_type.get_absolute_url }}">{{ job.requested_device_type }}</a> <a href="{% url 'lava.scheduler.device_type_report' job.requested_device_type %}">(reports)</a></dd> {% endif %} diff --git a/lava_scheduler_app/templates/lava_scheduler_app/job_pipeline.html b/lava_scheduler_app/templates/lava_scheduler_app/job_pipeline.html index d7f19a164..90b1b20e2 100644 --- a/lava_scheduler_app/templates/lava_scheduler_app/job_pipeline.html +++ b/lava_scheduler_app/templates/lava_scheduler_app/job_pipeline.html @@ -145,12 +145,16 @@ <div class="col-md-6"> <dl class="dl-horizontal"> <dt>#{{ job.sub_id|default:job.id }}</dt> - {% if job.status <= job.RUNNING %} - <dd><span id="jobstatus">{{ job.get_status_display }}</span> - {% elif job.status == job.COMPLETE %} - <dd><span class="label label-success">Complete</span> + {% if job.state != job.STATE_FINISHED %} + <dd><span id="jobstatus">{{ job.get_state_display }}</span> + {% elif job.health == job.HEALTH_UNKNOWN %} + <dd><span class="label label-default">{{ job.get_health_display }}</span> + {% elif job.health == job.HEALTH_COMPLETE %} + <dd><span class="label label-success">{{ job.get_health_display }}</span> + {% elif job.health == job.HEALTH_INCOMPLETE %} + <dd><span class="label label-danger">{{ job.get_health_display }}</span> {% else %} - <dd><span class="label label-danger">{{ job.get_status_display }}</span> + <dd><span class="label label-warning">{{ job.get_health_display }}</span> {% endif %} {% if job.is_multinode %} <div class="btn-group"> @@ -160,7 +164,7 @@ {% if subjob.id == job.id %} <li class="disabled"><a href=".">#{{ subjob.sub_id }} ({{ subjob.device_role }})</a></li> {% else %} - <li><a href="{% url 'lava.scheduler.job.detail' subjob.sub_id %}">#{{ subjob.sub_id }} ({{ subjob.device_role }}): <span id="subjob_{{ subjob.id }}">{{ subjob.get_status_display }}</span></a></li> + <li><a href="{% url 'lava.scheduler.job.detail' subjob.sub_id %}">#{{ subjob.sub_id }} ({{ subjob.device_role }}): <span id="subjob_{{ subjob.id }}">{{ subjob.get_state_display }}</span></a></li> {% endif %} {% endfor %} </ul> @@ -177,7 +181,7 @@ <dt>Started</dt> <dd id="started" title="{{ job.start_time }}">{% if job.start_time %}{{ job.start_time|naturaltime }}{% else %}...{% endif %}</dd> <dt>Duration</dt> - {% if job.status <= job.RUNNING %} + {% if job.state != job.STATE_FINISHED %} <dd id="duration">...</dd> {% else %} <dd id="duration" title="{{ job.duration }}">{{ job.end_time|timeuntil:job.start_time }}</dd> @@ -330,13 +334,13 @@ <code class="{{ line.lvl }} bg-{{ line.lvl }}" id="{% if act_id %}action_{{ act_id }}{% else %}L{{ forloop.counter0 }}{% endif %}" title="{{ line.dt }}">{{ line.msg|udecode }}</code> {% endif %} {% endfor %} - {% if job.status <= job.RUNNING or job.status == job.CANCELING %} + {% if job.state != job.STATE_FINISHED %} <img id="log-messages" src="{{ STATIC_URL }}lava_scheduler_app/images/ajax-loader.gif" /> {% endif %} </div> {% if not size_warning %} <p class="pull-right"><a href="#top"><span class="glyphicon glyphicon-fast-backward"></span> Top of page</a></p> - {% if job.status >= job.RUNNING %} + {% if job.state == job.STATE_FINISHED %} <p><a href="/static/docs/v2/debugging.html">Please read the triage guidelines</a> for help on debugging failures in the test job, test definitions or in individual test cases.</p> {% endif %} {% endif %} @@ -692,13 +696,13 @@ }) }); - {% if job.status > job.RUNNING and job.status != job.CANCELING %} + {% if job.state == job.STATE_FINISHED %} // Add the links only for non-running jobs anchors.options.placement = 'left'; anchors.add('code'); {% endif %} -{% if job.status <= job.RUNNING or job.status == job.CANCELING %} +{% if job.state != job.STATE_FINISHED %} // Add a timer for the log updates pollTimer = setTimeout(poll, 5000); {% endif %} @@ -716,13 +720,13 @@ success: function(data, success, xhr) { $('#actual_device').html(data['actual_device']); $('#started').html(data['started']); - $('#jobstatus').html(data['job_status']); + $('#jobstatus').html(data['job_state']); $('#duration').html(data['duration']); for(var i = 0; i < data['subjobs'].length; i++) { var d = data['subjobs'][i]; $('#subjob_' + d[0]).html(d[1]); } - if ('X-JobStatus' in data) { + if ('X-JobState' in data) { $('#cancel').css('display', 'none'); poll_status = 0; } diff --git a/lava_scheduler_app/templates/lava_scheduler_app/multinode_job_definition.html b/lava_scheduler_app/templates/lava_scheduler_app/multinode_job_definition.html index d43064cd3..333d9e875 100644 --- a/lava_scheduler_app/templates/lava_scheduler_app/multinode_job_definition.html +++ b/lava_scheduler_app/templates/lava_scheduler_app/multinode_job_definition.html @@ -26,10 +26,7 @@ <dd><a href="{{ job.actual_device.get_absolute_url }}">{{ job.actual_device.hostname }}</a> <a href="{% url 'lava.scheduler.device_report' job.actual_device.pk %}">(reports)</a></dd> {% endif %} - {% if job.requested_device %} - <dt>Type</dt> - <dd><a href="{{ job.requested_device.device_type.get_absolute_url }}">{{ job.requested_device.device_type }}</a> <a href="{% url 'lava.scheduler.device_type_report' job.requested_device.device_type %}">(reports)</a></dd> - {% elif job.requested_device_type %} + {% if job.requested_device_type %} <dt>Requested type</dt> <dd><a href="{{ job.requested_device_type.get_absolute_url }}">{{ job.requested_device_type }}</a> <a href="{% url 'lava.scheduler.device_type_report' job.requested_device_type %}">(reports)</a></dd> {% endif %} diff --git a/lava_scheduler_app/templates/lava_scheduler_app/worker.html b/lava_scheduler_app/templates/lava_scheduler_app/worker.html index 653b48c2d..40ae2836b 100644 --- a/lava_scheduler_app/templates/lava_scheduler_app/worker.html +++ b/lava_scheduler_app/templates/lava_scheduler_app/worker.html @@ -75,11 +75,12 @@ </div> </div> -<h3 class="modal-header">Devices Attached</h3> -{% block content_columns %} +<hr/> +<h3>Devices Attached</h3> {% render_table worker_device_table %} -{% endblock %} +<h3>Transitions</h3> +{% render_table worker_log_table %} {% endblock %} |