mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
add two_weeks filter to dashbaord job graph api view
This commit is contained in:
@@ -8,7 +8,7 @@ The `period` of the data can be adjusted with:
|
|||||||
|
|
||||||
?period=month
|
?period=month
|
||||||
|
|
||||||
Where `month` can be replaced with `week`, or `day`. `month` is the default.
|
Where `month` can be replaced with `week`, `two_weeks`, or `day`. `month` is the default.
|
||||||
|
|
||||||
The type of job can be filtered with:
|
The type of job can be filtered with:
|
||||||
|
|
||||||
|
|||||||
@@ -316,6 +316,9 @@ class DashboardJobsGraphView(APIView):
|
|||||||
if period == 'month':
|
if period == 'month':
|
||||||
end_date = start_date - dateutil.relativedelta.relativedelta(months=1)
|
end_date = start_date - dateutil.relativedelta.relativedelta(months=1)
|
||||||
interval = 'days'
|
interval = 'days'
|
||||||
|
elif period == 'two_weeks':
|
||||||
|
end_date = start_date - dateutil.relativedelta.relativedelta(weeks=2)
|
||||||
|
interval = 'days'
|
||||||
elif period == 'week':
|
elif period == 'week':
|
||||||
end_date = start_date - dateutil.relativedelta.relativedelta(weeks=1)
|
end_date = start_date - dateutil.relativedelta.relativedelta(weeks=1)
|
||||||
interval = 'days'
|
interval = 'days'
|
||||||
|
|||||||
Reference in New Issue
Block a user