From d24584f89680849f2cce83cc794b319d73dd554f Mon Sep 17 00:00:00 2001 From: Belen Barros Pena Date: Thu, 20 Feb 2014 07:06:51 +0000 Subject: bitbake: toaster: Presentation fixes for task.html Tidying up the presentation in the task.html template. The changes include: * Correct the markup for the help tooltips * Fix the help content for the outcome heading * Make sure
tags do not show for empty log file, time, cpu and disk I/O values * Eliminate an extra
for tasks with sstate attempts * Add tag to the sstate restored alert * Replace the .alert-info class with the .muted class for the no dependencies messages * Make sure the Executed heading does not inherit the .red class for failed tasks * Format time and cpu values to make sure they only show 2 decimal digits (Bitbake rev: bbc22958ab37dcd44c03420a7b8f842a1f4e51b1) Signed-off-by: Belen Barros Pena Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- .../lib/toaster/toastergui/static/css/default.css | 2 +- bitbake/lib/toaster/toastergui/templates/task.html | 36 +++++++++++++--------- .../toaster/toastergui/templatetags/projecttags.py | 6 ++-- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/css/default.css b/bitbake/lib/toaster/toastergui/static/css/default.css index 2b47aff6f9..7db156a16e 100644 --- a/bitbake/lib/toaster/toastergui/static/css/default.css +++ b/bitbake/lib/toaster/toastergui/static/css/default.css @@ -30,7 +30,7 @@ dd code, .alert code { white-space: pre-wrap; word-break: break-all; word-wrap: .tooltip code { background-color: transparent; color: #FFFFFF; font-weight: normal; border: none; font-size: 1em; } /* Style for definition lists */ -dd ul { list-style-type: none; margin-left: 0px; } +dd ul { list-style-type: none; margin: 0px; } dt, dd {line-height: 25px; } dd li { line-height: 25px; } dd p { line-height: 20px; } diff --git a/bitbake/lib/toaster/toastergui/templates/task.html b/bitbake/lib/toaster/toastergui/templates/task.html index 403bb03f68..af994fde1b 100644 --- a/bitbake/lib/toaster/toastergui/templates/task.html +++ b/bitbake/lib/toaster/toastergui/templates/task.html @@ -23,12 +23,14 @@ {%if task.task_executed %} {# executed tasks outcome #}
+ {% if task.logfile %}
- Log file + Log file
{{task.logfile}}
+ {% endif %} {# show stack trace for failed task #} {% if task.outcome == task.OUTCOME_FAILED and log_head %}

Python stack trace

@@ -47,7 +49,7 @@ Match to tasks in previous builds {% elif matching_tasks %}

Prebuilt task could be based on - +

@@ -85,7 +87,7 @@ {{match.get_executed_display}}
- {{match.get_outcome_display}} + {{match.get_outcome_display}} {{match.build.completed_on|date:"d/m/y H:i"}} @@ -103,7 +105,7 @@ {% elif task.outcome == task.OUTCOME_COVERED %}
- Task covered by + Task covered by
    @@ -114,7 +116,7 @@ {%elif task.outcome == task.OUTCOME_CACHED%}
    - Log file + Log file
    {% for t in task.get_related_setscene %} {{t.logfile}}
    {% endfor %} @@ -132,10 +134,10 @@

    {% if task.task_executed %} Executed - + {% else %} Not Executed - + {% endif %}

    @@ -146,12 +148,12 @@
    {{task.sstate_checksum}}
    -
    {% if task.sstate_result != task.SSTATE_NA %} +
    Attempting to restore output from sstate cache
    -
    +
    File searched for @@ -189,7 +191,7 @@ {% elif task.sstate_result == task.SSTATE_RESTORED %}
    - Output successfully restored from sstate cache. + Output successfully restored from sstate cache.
    {% endif %}
    @@ -221,7 +223,7 @@ {% for dep in deps %}
  • {{dep.recipe.name}}_{{dep.recipe.version}} {{dep.task_name}}
  • {% empty %} -
  • This task has no dependencies

  • +
  • This task has no dependencies
  • {% endfor %}
@@ -234,7 +236,7 @@ {% for dep in rdeps %}
  • {{dep.recipe.name}}_{{dep.recipe.version}} {{dep.task_name}}
  • {% empty %} -
  • This task has no reverse dependencies

  • +
  • This task has no reverse dependencies
  • {% endfor %}
    @@ -243,21 +245,27 @@ {%if task.task_executed %}

    Performance

    + {% if task.elapsed_time > 0.01 %}
    Time (secs)
    -
    {{task.elapsed_time|format_none_and_zero}}
    +
    {{task.elapsed_time|format_none_and_zero|floatformat:2}}
    + {% endif %} + {% if task.cpu_usage > 0 %}
    CPU usage
    -
    {{task.cpu_usage|format_none_and_zero}}
    +
    {{task.cpu_usage|format_none_and_zero|floatformat:2}}%
    + {% endif %} + {% if task.disk_io > 0 %}
    Disk I/O (ms)
    {{task.disk_io|format_none_and_zero}}
    + {% endif %}
    {%endif%} diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index 857680b350..2d339d623f 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py @@ -70,16 +70,16 @@ def sortcols(tablecols): return sorted(tablecols, key = lambda t: t['name']) @register.filter -def task_color(task_object, show_green=False): +def task_color(task_object, show_colour=False): """ Return css class depending on Task execution status and execution outcome. By default, green is not returned for executed and successful tasks; show_green argument should be True to get green color. """ if not task_object.task_executed: return 'class=muted' - elif task_object.outcome == task_object.OUTCOME_FAILED: + elif task_object.outcome == task_object.OUTCOME_FAILED and show_colour: return 'class=error' - elif task_object.outcome == task_object.OUTCOME_SUCCESS and show_green: + elif task_object.outcome == task_object.OUTCOME_SUCCESS and show_colour: return 'class=green' else: return '' -- cgit v1.2.3-54-g00ecf