[Toaster] [PATCH 08/20] toaster: build data Tasks table to Bootstrap 3

Michael Wood michael.g.wood at intel.com
Fri Jun 10 04:53:52 PDT 2016


On 09/06/16 14:24, Belen Barros Pena wrote:
> Make sure the tasks table and all build performance tables display
> correctly with Bootstrap 3.
>
> Signed-off-by: Belen Barros Pena <belen.barros.pena at linux.intel.com>
> ---
>   bitbake/lib/toaster/toastergui/buildtables.py      | 39 +++++++++++-----------
>   .../templates/buildinfo-toastertable.html          |  4 +--
>   2 files changed, 22 insertions(+), 21 deletions(-)
>
> diff --git a/bitbake/lib/toaster/toastergui/buildtables.py b/bitbake/lib/toaster/toastergui/buildtables.py
> index 5d00aa4..b92d405 100644
> --- a/bitbake/lib/toaster/toastergui/buildtables.py
> +++ b/bitbake/lib/toaster/toastergui/buildtables.py
> @@ -426,9 +426,7 @@ class BuildTasksTable(BuildTablesMixin):
>               '</a>'
>   
>           recipe_version_tmpl =\
> -            '<a href="{% url "recipe" extra.build.pk data.recipe.pk %}">'\
> -            '{{data.recipe.version}}'\
> -            '</a>'
> +            '{{data.recipe.version}}'

As you've removed the template we no longer need recipe_version_tmpl, it 
can just be changed to display the field as normal.


>   
>           def task_link_tmpl(val):
>               return ('<a name="task-{{data.order}}"'
> @@ -438,7 +436,13 @@ class BuildTasksTable(BuildTablesMixin):
>   
>           self.add_column(title="Order",
>                           static_data_name="order",
> -                        static_data_template=task_link_tmpl('{{data.order}}'),
> +                        static_data_template='{{data.order}}',
> +                        orderable=True)
> +
> +        self.add_column(title="Task",
> +                        static_data_name="task_name",
> +                        static_data_template=task_link_tmpl(
> +                            "{{data.task_name}}"),
>                           orderable=True)
>   
>           self.add_column(title="Recipe",
> @@ -450,31 +454,24 @@ class BuildTasksTable(BuildTablesMixin):
>                           static_data_name='recipe__version',
>                           static_data_template=recipe_version_tmpl)
>   
> -        self.add_column(title="Task",
> -                        static_data_name="task_name",
> -                        static_data_template=task_link_tmpl(
> -                            "{{data.task_name}}"),
> -                        orderable=True)
> -
>           self.add_column(title="Executed",
>                           static_data_name="task_executed",
> -                        static_data_template=task_link_tmpl(
> -                            "{{data.get_executed_display}}"),
> +                        static_data_template='{{data.get_executed_display}}',
>                           filter_name='execution_outcome',
>                           orderable=True)
>   
>           self.static_context_extra['OUTCOME_FAILED'] = Task.OUTCOME_FAILED
> -        outcome_tmpl = task_link_tmpl("{{data.outcome_text}}")
> +        outcome_tmpl = '{{data.outcome_text}}'
>           outcome_tmpl = ('%s '
>                           '{%% if data.outcome = extra.OUTCOME_FAILED %%}'
>                           '<a href="{%% url "build_artifact" extra.build.pk '
>                           '          "tasklogfile" data.pk %%}">'
> -                        ' <i class="icon-download-alt" '
> -                        '    title="Download task log file"></i>'
> +                        ' <span class="glyphicon glyphicon-download-alt get-help" '
> +                        '    title="Download task log file"></span>'
>                           '</a> {%% endif %%}'
> -                        '<i class="icon-question-sign get-help '
> +                        '<span class="glyphicon glyphicon-question-sign get-help '
>                           'hover-help" style="visibility: hidden;" '
> -                        'title="{{data.get_outcome_help}}"></i>'
> +                        'title="{{data.get_outcome_help}}"></span>'
>                           ) % outcome_tmpl
>   
>           self.add_column(title="Outcome",
> @@ -483,10 +480,11 @@ class BuildTasksTable(BuildTablesMixin):
>                           filter_name="task_outcome",
>                           orderable=True)
>   
> +        self.toggle_columns['sstate_result'] = len(self.columns)
> +
>           self.add_column(title="Cache attempt",
>                           static_data_name="sstate_result",
> -                        static_data_template=task_link_tmpl(
> -                            "{{data.sstate_text}}"),
> +                        static_data_template='{{data.sstate_text}}',
>                           filter_name="sstate_outcome",
>                           orderable=True)
>   
> @@ -542,6 +540,7 @@ class BuildTimeTable(BuildTasksTable):
>           super(BuildTimeTable, self).setup_columns(**kwargs)
>   
>           self.columns[self.toggle_columns['order']]['hidden'] = True
> +        self.columns[self.toggle_columns['sstate_result']]['hidden'] = True
>           self.columns[self.toggle_columns['elapsed_time']]['hidden'] = False
>   
>   
> @@ -556,6 +555,7 @@ class BuildCPUTimeTable(BuildTasksTable):
>           super(BuildCPUTimeTable, self).setup_columns(**kwargs)
>   
>           self.columns[self.toggle_columns['order']]['hidden'] = True
> +        self.columns[self.toggle_columns['sstate_result']]['hidden'] = True
>           self.columns[self.toggle_columns['cpu_time_sys']]['hidden'] = False
>           self.columns[self.toggle_columns['cpu_time_user']]['hidden'] = False
>   
> @@ -571,4 +571,5 @@ class BuildIOTable(BuildTasksTable):
>           super(BuildIOTable, self).setup_columns(**kwargs)
>   
>           self.columns[self.toggle_columns['order']]['hidden'] = True
> +        self.columns[self.toggle_columns['sstate_result']]['hidden'] = True
>           self.columns[self.toggle_columns['disk_io']]['hidden'] = False
> diff --git a/bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html b/bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html
> index 52cc056..eb4c656 100644
> --- a/bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html
> +++ b/bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html
> @@ -11,10 +11,10 @@
>   {% endblock %}
>   
>   {% block buildinfomain %}
> -<div class="span10">
> +<div class="col-md-10">
>   {# xhr_table_url is just the current url so leave it blank #}
>   {% with xhr_table_url='' %}
> -  <div class="page-header">
> +  <div class="page-header build-data">
>        <h1>
>          {{title}} (<span class="table-count-{{table_name}}">0</span>) </h2>
>        </h1>



More information about the toaster mailing list