1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 01:19:52 +00:00

bitbake: toastergui: implement date range filters for builds

Implement the completed_on and started_on filtering for
builds.

Also separate the name of a filter ("filter" in the querystring)
from its value ("filter_value" in the querystring). This enables
filtering to be defined in the querystring more intuitively,
and also makes it easier to add other types of filter (e.g.
by day).

[YOCTO #8738]

(Bitbake rev: d47c32e88c2d4a423f4d94d49759e557f425a539)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Elliot Smith
2016-01-15 13:00:53 +02:00
committed by Richard Purdie
parent b929889cdd
commit f8d383d87f
6 changed files with 332 additions and 86 deletions
+37 -1
View File
@@ -29,7 +29,9 @@ from django.core.urlresolvers import reverse
from django.views.generic import TemplateView
import itertools
from toastergui.tablefilter import TableFilter, TableFilterActionToggle
from toastergui.tablefilter import TableFilter
from toastergui.tablefilter import TableFilterActionToggle
from toastergui.tablefilter import TableFilterActionDateRange
class ProjectFilters(object):
def __init__(self, project_layers):
@@ -1070,6 +1072,7 @@ class BuildsTable(ToasterTable):
help_text='The date and time when the build started',
hideable=True,
orderable=True,
filter_name='started_on_filter',
static_data_name='started_on',
static_data_template=started_on_template)
@@ -1077,6 +1080,7 @@ class BuildsTable(ToasterTable):
help_text='The date and time when the build finished',
hideable=False,
orderable=True,
filter_name='completed_on_filter',
static_data_name='completed_on',
static_data_template=completed_on_template)
@@ -1149,6 +1153,38 @@ class BuildsTable(ToasterTable):
outcome_filter.add_action(failed_builds_filter_action)
self.add_filter(outcome_filter)
# started on
started_on_filter = TableFilter(
'started_on_filter',
'Filter by date when build was started'
)
by_started_date_range_filter_action = TableFilterActionDateRange(
'date_range',
'Build date range',
'started_on',
QuerysetFilter()
)
started_on_filter.add_action(by_started_date_range_filter_action)
self.add_filter(started_on_filter)
# completed on
completed_on_filter = TableFilter(
'completed_on_filter',
'Filter by date when build was completed'
)
by_completed_date_range_filter_action = TableFilterActionDateRange(
'date_range',
'Build date range',
'completed_on',
QuerysetFilter()
)
completed_on_filter.add_action(by_completed_date_range_filter_action)
self.add_filter(completed_on_filter)
# failed tasks
failed_tasks_filter = TableFilter(
'failed_tasks_filter',