alerts stats on alerts page
This commit is contained in:
@@ -4323,6 +4323,11 @@ def alerts_view(request,userid=0):
|
||||
r = getrequestrower(request,userid=userid)
|
||||
|
||||
alerts = Alert.objects.filter(rower=r).order_by('next_run')
|
||||
|
||||
stats = []
|
||||
|
||||
for alert in alerts:
|
||||
stats.append(alert_get_stats(alert))
|
||||
|
||||
breadcrumbs = [
|
||||
{
|
||||
@@ -4340,6 +4345,7 @@ def alerts_view(request,userid=0):
|
||||
'breadcrumbs':breadcrumbs,
|
||||
'alerts':alerts,
|
||||
'rower':r,
|
||||
'stats':stats,
|
||||
})
|
||||
|
||||
# alert create view
|
||||
@@ -4443,6 +4449,11 @@ def alert_report_view(request,id=0,userid=0,nperiod=0):
|
||||
|
||||
stats = alert_get_stats(alert,nperiod=nperiod)
|
||||
|
||||
if request.is_ajax():
|
||||
return JSONResponse({
|
||||
"stats":stats,
|
||||
})
|
||||
|
||||
breadcrumbs = [
|
||||
{
|
||||
'url':'/rowers/analysis',
|
||||
|
||||
Reference in New Issue
Block a user