diff --git a/lib/galaxy/webapps/reports/controllers/jobs.py b/lib/galaxy/webapps/reports/controllers/jobs.py index de3edcb1ead..848d38829f0 100644 --- a/lib/galaxy/webapps/reports/controllers/jobs.py +++ b/lib/galaxy/webapps/reports/controllers/jobs.py @@ -1,3 +1,4 @@ +from __future__ import print_function import calendar from collections import namedtuple from datetime import datetime, date, timedelta @@ -7,6 +8,7 @@ from galaxy.web.framework.helpers import grids from galaxy.model.orm import and_, not_, or_ import pkg_resources pkg_resources.require( "SQLAlchemy >= 0.4" ) +import re import sqlalchemy as sa from galaxy.webapps.reports.controllers.query import ReportQueryBuilder @@ -271,6 +273,7 @@ class Jobs( BaseUIController, ReportQueryBuilder ): month_label = start_date.strftime( "%B" ) year_label = start_date.strftime( "%Y" ) + # Use to make the page table month_jobs = sa.select( ( sa.func.date( model.Job.table.c.create_time ).label( 'date' ), sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ), whereclause=sa.and_( model.Job.table.c.user_id != monitor_user_id, @@ -280,13 +283,32 @@ class Jobs( BaseUIController, ReportQueryBuilder ): group_by=[ 'date' ], order_by=[ _order ] ) + # Use to make trendline + all_jobs = sa.select( ( model.Job.table.c.create_time.label('date'), model.Job.table.c.id.label('id') ), + whereclause=sa.and_( model.Job.table.c.user_id != monitor_user_id, + model.Job.table.c.create_time >= start_date, + model.Job.table.c.create_time < end_date ) ) + + trend = [0] * 24 jobs = [] for row in month_jobs.execute(): - jobs.append( ( row.date.strftime( "%A" ), - row.date.strftime( "%d" ), + trend = [0] * 24 + + row_dayname = row.date.strftime( "%A" ) + row_day = row.date.strftime( "%d" ) + + for job in all_jobs.execute(): + if row_day == job.date.strftime( "%d" ): + hour = int( job.date.strftime( "%-H" ) ) - 1 + trend[hour] += 1 + + jobs.append( ( row_dayname, + row_day, row.total_jobs, - row.date + row.date, + trend ) ) + return trans.fill_template( '/webapps/reports/jobs_specified_month_all.mako', order=order, arrow=arrow, @@ -334,12 +356,33 @@ class Jobs( BaseUIController, ReportQueryBuilder ): group_by=[ 'date' ], order_by=[ _order ] ) + # Use to make trendline + all_jobs_in_error = sa.select( ( model.Job.table.c.create_time.label('date'), model.Job.table.c.id.label('id') ), + whereclause=sa.and_( model.Job.table.c.user_id != monitor_user_id, + model.Job.table.c.state == 'error', + model.Job.table.c.create_time >= start_date, + model.Job.table.c.create_time < end_date ) ) + + trend = [0] * 24 jobs = [] for row in month_jobs_in_error.execute(): - jobs.append( ( row.date.strftime( "%A" ), - row.date, + trend = [0] * 24 + + row_dayname = row.date.strftime( "%A" ) + row_day = row.date.strftime( "%d" ) + + for job in all_jobs_in_error.execute(): + if row_day == job.date.strftime( "%d" ): + hour = int( job.date.strftime( "%-H" ) ) - 1 + trend[hour] += 1 + + jobs.append( ( row_dayname, + row_day, row.total_jobs, - row.date.strftime( "%d" ) ) ) + row.date, + trend + ) ) + return trans.fill_template( '/webapps/reports/jobs_specified_month_in_error.mako', order=order, arrow=arrow, @@ -369,26 +412,52 @@ class Jobs( BaseUIController, ReportQueryBuilder ): # In case we don't know which is the monitor user we will query for all jobs monitor_user_id = get_monitor_id( trans, monitor_email ) + # Use to make the page table jobs_by_month = sa.select( ( self.select_month( model.Job.table.c.create_time ).label( 'date' ), - sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ), + sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ), whereclause=model.Job.table.c.user_id != monitor_user_id, from_obj=[ model.Job.table ], group_by=self.group_by_month( model.Job.table.c.create_time ), order_by=[ _order ] ) + # Use to make sparkline + all_jobs = sa.select( ( self.select_month(model.Job.table.c.create_time).label('date'), model.Job.table.c.id.label('id') ) ) + + trends = dict() + for job in all_jobs.execute(): + job_day = int(job.date.strftime("%-d")) - 1 + job_month = int(job.date.strftime("%-m")) + job_month_name = job.date.strftime("%B") + job_year = job.date.strftime("%Y") + key = str( job_month_name + job_year) + + try: + trends[key][job_day] += 1 + except KeyError: + job_year = int(job_year) + wday, day_range = calendar.monthrange(job_year, job_month) + trends[key] = [0] * day_range + trends[key][job_day] += 1 + jobs = [] for row in jobs_by_month.execute(): + month = int(row.date.strftime("%-m")) + month_name = row.date.strftime("%B") + year = int(row.date.strftime("%Y")) + wday, day_range = calendar.monthrange(year, month) + jobs.append( ( row.date.strftime( "%Y-%m" ), row.total_jobs, - row.date.strftime( "%B" ), - row.date.strftime( "%y" ) + month_name, + year ) ) return trans.fill_template( '/webapps/reports/jobs_per_month_all.mako', order=order, arrow=arrow, sort_id=sort_id, + trends=trends, jobs=jobs, is_user_jobs_only=monitor_user_id, message=message ) @@ -411,6 +480,7 @@ class Jobs( BaseUIController, ReportQueryBuilder ): # In case we don't know which is the monitor user we will query for all jobs monitor_user_id = get_monitor_id( trans, monitor_email ) + # Use to make the page table jobs_in_error_by_month = sa.select( ( self.select_month( model.Job.table.c.create_time ).label( 'date' ), sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ), whereclause=sa.and_( model.Job.table.c.state == 'error', @@ -419,12 +489,40 @@ class Jobs( BaseUIController, ReportQueryBuilder ): group_by=self.group_by_month( model.Job.table.c.create_time ), order_by=[ _order ] ) + # Use to make trendline + all_jobs = sa.select( ( self.select_month(model.Job.table.c.create_time).label('date'), model.Job.table.c.id.label('id') ), + whereclause=sa.and_( model.Job.table.c.state == 'error', + model.Job.table.c.user_id != monitor_user_id )) + + trends = dict() + for job in all_jobs.execute(): + job_day = int(job.date.strftime("%-d")) - 1 + job_month = int(job.date.strftime("%-m")) + job_month_name = job.date.strftime("%B") + job_year = job.date.strftime("%Y") + key = str( job_month_name + job_year) + + try: + trends[key][job_day] += 1 + except KeyError: + job_year = int(job_year) + wday, day_range = calendar.monthrange(job_year, job_month) + trends[key] = [0] * day_range + trends[key][job_day] += 1 + jobs = [] for row in jobs_in_error_by_month.execute(): - jobs.append( ( row.date.strftime( "%Y-%m" ), - row.total_jobs, - row.date.strftime( "%B" ), - row.date.strftime( "%y" ) ) ) + month = int(row.date.strftime("%-m")) + month_name = row.date.strftime("%B") + year = int(row.date.strftime("%Y")) + wday, day_range = calendar.monthrange(year, month) + + jobs.append( ( + row.date.strftime( "%Y-%m" ), + row.total_jobs, + month_name, + year + ) ) return trans.fill_template( '/webapps/reports/jobs_per_month_in_error.mako', order=order, arrow=arrow, @@ -443,6 +541,7 @@ class Jobs( BaseUIController, ReportQueryBuilder ): order = specs.order arrow = specs.arrow _order = specs.exc_order + day_limit = 50 jobs = [] jobs_per_user = sa.select( ( model.User.table.c.email.label( 'user_email' ), @@ -450,6 +549,28 @@ class Jobs( BaseUIController, ReportQueryBuilder ): from_obj=[ sa.outerjoin( model.Job.table, model.User.table ) ], group_by=[ 'user_email' ], order_by=[ _order ] ) + + all_jobs_per_user = sa.select( ( self.select_month( model.Job.table.c.create_time ).label( 'date' ), + model.Job.table.c.id.label( 'id' ), + model.User.table.c.email.label( 'user_email' ) ), + from_obj=[ sa.outerjoin( model.Job.table, model.User.table ) ] ) + + currday = datetime.today().date() + trends = dict() + for job in all_jobs_per_user.execute(): + curr_user = re.sub(r'\W+', '', job.user_email) + try: + day = currday - job.date + day = day.days + if day < day_limit: + trends[curr_user][day] += 1 + except KeyError: + trends[curr_user] = [0] * day_limit + day = currday - job.date + day = day.days + if day < day_limit: + trends[curr_user][day] += 1 + for row in jobs_per_user.execute(): if ( row.user_email is None ): jobs.append( ( 'Anonymous', @@ -459,10 +580,13 @@ class Jobs( BaseUIController, ReportQueryBuilder ): else: jobs.append( ( row.user_email, row.total_jobs ) ) + return trans.fill_template( '/webapps/reports/jobs_per_user.mako', order=order, arrow=arrow, sort_id=sort_id, + day_limit=day_limit, + trends=trends, jobs=jobs, message=message ) @@ -477,6 +601,7 @@ class Jobs( BaseUIController, ReportQueryBuilder ): order = specs.order arrow = specs.arrow _order = specs.exc_order + q = sa.select( ( self.select_month( model.Job.table.c.create_time ).label( 'date' ), sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ), whereclause=sa.and_( model.Job.table.c.session_id == model.GalaxySession.table.c.id, @@ -485,6 +610,30 @@ class Jobs( BaseUIController, ReportQueryBuilder ): from_obj=[ sa.join( model.Job.table, model.User.table ) ], group_by=self.group_by_month( model.Job.table.c.create_time ), order_by=[ _order ] ) + + all_jobs_per_user = sa.select( ( model.Job.table.c.create_time.label( 'date' ), + model.Job.table.c.id.label( 'job_id' ) ), + whereclause=sa.and_( model.Job.table.c.session_id == model.GalaxySession.table.c.id, + model.GalaxySession.table.c.user_id == model.User.table.c.id, + model.User.table.c.email == email), + from_obj=[ sa.join( model.Job.table, model.User.table ) ] ) + + trends = dict() + for job in all_jobs_per_user.execute(): + job_day = int(job.date.strftime("%-d")) - 1 + job_month = int(job.date.strftime("%-m")) + job_month_name = job.date.strftime("%B") + job_year = job.date.strftime("%Y") + key = str( job_month_name + job_year) + + try: + trends[key][job_day] += 1 + except KeyError: + job_year = int(job_year) + wday, day_range = calendar.monthrange(job_year, job_month) + trends[key] = [0] * day_range + trends[key][job_day] += 1 + jobs = [] for row in q.execute(): jobs.append( ( row.date.strftime( "%Y-%m" ), @@ -496,6 +645,7 @@ class Jobs( BaseUIController, ReportQueryBuilder ): arrow=arrow, sort_id=sort_id, id=kwd.get('id'), + trends=trends, email=util.sanitize_text( email ), jobs=jobs, message=message ) @@ -510,6 +660,8 @@ class Jobs( BaseUIController, ReportQueryBuilder ): order = specs.order arrow = specs.arrow _order = specs.exc_order + day_limit = 50 + # In case we don't know which is the monitor user we will query for all jobs monitor_user_id = get_monitor_id( trans, monitor_email ) @@ -520,13 +672,38 @@ class Jobs( BaseUIController, ReportQueryBuilder ): from_obj=[ model.Job.table ], group_by=[ 'tool_id' ], order_by=[ _order ] ) + + all_jobs_per_tool = sa.select( ( self.select_month( model.Job.table.c.create_time ).label( 'date' ), + model.Job.table.c.id.label( 'id' ), + model.Job.table.c.tool_id.label( 'tool_id' ) ), + from_obj=[ model.Job.table ] ) + + currday = datetime.today().date() + trends = dict() + for job in all_jobs_per_tool.execute(): + curr_tool = re.sub(r'\W+', '', job.tool_id) + try: + day = currday - job.date + day = day.days + if day < day_limit: + trends[curr_tool][day] += 1 + except KeyError: + trends[curr_tool] = [0] * day_limit + day = currday - job.date + day = day.days + if day < day_limit: + trends[curr_tool][day] += 1 + for row in q.execute(): jobs.append( ( row.tool_id, row.total_jobs ) ) + return trans.fill_template( '/webapps/reports/jobs_per_tool.mako', order=order, arrow=arrow, sort_id=sort_id, + day_limit=day_limit, + trends=trends, jobs=jobs, message=message, is_user_jobs_only=monitor_user_id) @@ -545,6 +722,7 @@ class Jobs( BaseUIController, ReportQueryBuilder ): order = specs.order arrow = specs.arrow _order = specs.exc_order + day_limit = 50 # In case we don't know which is the monitor user we will query for all jobs monitor_user_id = get_monitor_id( trans, monitor_email ) @@ -555,6 +733,31 @@ class Jobs( BaseUIController, ReportQueryBuilder ): from_obj=[ model.Job.table ], group_by=[ 'tool_id' ], order_by=[ _order ] ) + + all_jobs_per_tool_errors = sa.select( ( self.select_month( model.Job.table.c.create_time ).label( 'date' ), + model.Job.table.c.id.label( 'id' ), + model.Job.table.c.tool_id.label( 'tool_id' ) ), + whereclause=sa.and_( model.Job.table.c.state == 'error', + model.Job.table.c.user_id != monitor_user_id ), + from_obj=[ model.Job.table ] + ) + + currday = datetime.today().date() + trends = dict() + for job in all_jobs_per_tool_errors.execute(): + curr_tool = re.sub(r'\W+', '', job.tool_id) + try: + day = currday - job.date + day = day.days + if day < day_limit: + trends[curr_tool][day] += 1 + except KeyError: + trends[curr_tool] = [0] * day_limit + day = currday - job.date + day = day.days + if day < day_limit: + trends[curr_tool][day] += 1 + jobs = [] for row in jobs_in_error_per_tool.execute(): jobs.append( ( row.total_jobs, row.tool_id ) ) @@ -562,6 +765,8 @@ class Jobs( BaseUIController, ReportQueryBuilder ): order=order, arrow=arrow, sort_id=sort_id, + day_limit=day_limit, + trends=trends, jobs=jobs, message=message, is_user_jobs_only=monitor_user_id ) @@ -589,6 +794,28 @@ class Jobs( BaseUIController, ReportQueryBuilder ): from_obj=[ model.Job.table ], group_by=self.group_by_month( model.Job.table.c.create_time ), order_by=[ _order ] ) + + # Use to make sparkline + all_jobs_for_tool = sa.select( ( self.select_month(model.Job.table.c.create_time).label('date'), model.Job.table.c.id.label('id') ), + whereclause=sa.and_( model.Job.table.c.tool_id == tool_id, + model.Job.table.c.user_id != monitor_user_id ), + from_obj=[ model.Job.table ] ) + trends = dict() + for job in all_jobs_for_tool.execute(): + job_day = int(job.date.strftime("%-d")) - 1 + job_month = int(job.date.strftime("%-m")) + job_month_name = job.date.strftime("%B") + job_year = job.date.strftime("%Y") + key = str( job_month_name + job_year) + + try: + trends[key][job_day] += 1 + except KeyError: + job_year = int(job_year) + wday, day_range = calendar.monthrange(job_year, job_month) + trends[key] = [0] * day_range + trends[key][job_day] += 1 + jobs = [] for row in q.execute(): jobs.append( ( row.date.strftime( "%Y-%m" ), @@ -601,6 +828,7 @@ class Jobs( BaseUIController, ReportQueryBuilder ): sort_id=sort_id, specified_date=specified_date, tool_id=tool_id, + trends=trends, jobs=jobs, message=message, is_user_jobs_only=monitor_user_id ) diff --git a/templates/base.mako b/templates/base.mako index dba96d2d483..0752855bd95 100644 --- a/templates/base.mako +++ b/templates/base.mako @@ -48,6 +48,7 @@ "libs/jquery/jquery", "libs/jquery/jquery.migrate", "libs/jquery/select2", + "libs/jquery.sparklines", "libs/bootstrap", "libs/underscore", "libs/backbone/backbone", diff --git a/templates/webapps/reports/jobs_errors_per_tool.mako b/templates/webapps/reports/jobs_errors_per_tool.mako index 6977be38960..6ce25222959 100644 --- a/templates/webapps/reports/jobs_errors_per_tool.mako +++ b/templates/webapps/reports/jobs_errors_per_tool.mako @@ -1,18 +1,26 @@ <%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> +<%namespace file="/spark_base.mako" import="jqs_style, make_sparkline" /> <%namespace file="/sorting_base.mako" import="get_sort_url, get_css" /> +<%! + import re +%> %if message: ${render_msg( message, 'done' )} %endif +${jqs_style()} ${get_css()}

Jobs In Error Per Tool

-
Click Tool ID to view details. Click error number to view job details.
+
+

Click Tool ID to view details. Click error number to view job details.

+

Graph goes from present to past(${day_limit} days).

+
%if len( jobs ) == 0: @@ -36,6 +44,7 @@ ${get_css()} <% ctr = 0 %> %for job in jobs: + <% key = re.sub(r'\W+', '', job[1]) %> %if ctr % 2 == 1: %else: @@ -43,6 +52,8 @@ ${get_css()} %endif + ${make_sparkline(key, trends[key], "line", "/ day")} + <% ctr += 1 %> %endfor diff --git a/templates/webapps/reports/jobs_per_month_all.mako b/templates/webapps/reports/jobs_per_month_all.mako index c8c044e96ae..0b8a08ccdca 100644 --- a/templates/webapps/reports/jobs_per_month_all.mako +++ b/templates/webapps/reports/jobs_per_month_all.mako @@ -1,11 +1,13 @@ <%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> +<%namespace file="/spark_base.mako" import="jqs_style, make_sparkline" /> <%namespace file="/sorting_base.mako" import="get_sort_url, get_css" /> %if message: ${render_msg( message, 'done' )} %endif +${jqs_style()} ${get_css()} @@ -36,6 +38,7 @@ ${get_css()} <% ctr = 0 %> %for job in jobs: + <% key = str(job[2]) + str(job[3]) %> %if ctr % 2 == 1: %else: @@ -43,6 +46,8 @@ ${get_css()} %endif + ${make_sparkline(key, trends[key], "bar", "/ day")} + <% ctr += 1 %> %endfor diff --git a/templates/webapps/reports/jobs_per_month_in_error.mako b/templates/webapps/reports/jobs_per_month_in_error.mako index b1eca3b99f1..742fd1e3d79 100644 --- a/templates/webapps/reports/jobs_per_month_in_error.mako +++ b/templates/webapps/reports/jobs_per_month_in_error.mako @@ -1,11 +1,13 @@ <%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> +<%namespace file="/spark_base.mako" import="jqs_style, make_sparkline" /> <%namespace file="/sorting_base.mako" import="get_sort_url, get_css" /> %if message: ${render_msg( message, 'done' )} %endif +${jqs_style()} ${get_css()} @@ -36,6 +38,7 @@ ${get_css()} <% ctr = 0 %> %for job in jobs: + <% key = str(job[2]) + str(job[3]) %> %if ctr % 2 == 1: %else: @@ -43,6 +46,8 @@ ${get_css()} %endif + ${make_sparkline(key, trends[key], "bar", "/ day")} + <% ctr += 1 %> %endfor diff --git a/templates/webapps/reports/jobs_per_tool.mako b/templates/webapps/reports/jobs_per_tool.mako index 90a866400d9..e6e31675f31 100644 --- a/templates/webapps/reports/jobs_per_tool.mako +++ b/templates/webapps/reports/jobs_per_tool.mako @@ -1,18 +1,25 @@ <%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> +<%namespace file="/spark_base.mako" import="jqs_style, make_sparkline" /> <%namespace file="/sorting_base.mako" import="get_sort_url, get_css" /> +<%! + import re +%> %if message: ${render_msg( message, 'done' )} %endif +${jqs_style()} ${get_css()} - +

Jobs Per Tool

-
Click Tool ID to view details
+
+ Click Tool ID to view details. Graph goes from present to past(${day_limit} days). +
There are no jobs in the error state.
${job[1]} ${job[0]}
${job[2]} ${job[3]} ${job[1]}
${job[2]} ${job[3]} ${job[1]}
%if len( jobs ) == 0: @@ -36,6 +43,7 @@ ${get_css()} <% ctr = 0 %> %for job in jobs: + <% key = re.sub(r'\W+', '', job[0]) %> %if ctr % 2 == 1: %else: @@ -43,6 +51,8 @@ ${get_css()} %endif + ${make_sparkline(key, trends[key], "line", "/ day")} + <% ctr += 1 %> %endfor diff --git a/templates/webapps/reports/jobs_per_user.mako b/templates/webapps/reports/jobs_per_user.mako index 4726ca9f7ab..5770d0063d3 100644 --- a/templates/webapps/reports/jobs_per_user.mako +++ b/templates/webapps/reports/jobs_per_user.mako @@ -1,18 +1,25 @@ <%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> +<%namespace file="/spark_base.mako" import="jqs_style, make_sparkline" /> <%namespace file="/sorting_base.mako" import="get_sort_url, get_css" /> +<%! + import re +%> %if message: ${render_msg( message, 'done' )} %endif +${jqs_style()} ${get_css()}

Jobs Per User

-
Click User to view details.
+
+ Click User to view details. Graph goes from present to past(${day_limit} days). +
There are no jobs.
${job[0]} ${job[1]}
%if len( jobs ) == 0: @@ -29,6 +36,7 @@ ${get_css()} <% ctr = 0 %> %for job in jobs: + <% key = re.sub(r'\W+', '', job[0]) %> %if ctr % 2 == 1: %else: @@ -36,6 +44,8 @@ ${get_css()} %endif + ${make_sparkline(key, trends[key], "line", "/ day")} + <% ctr += 1 %> %endfor diff --git a/templates/webapps/reports/jobs_specified_month_all.mako b/templates/webapps/reports/jobs_specified_month_all.mako index 7cfd0b1eaf8..15468ac9bb8 100644 --- a/templates/webapps/reports/jobs_specified_month_all.mako +++ b/templates/webapps/reports/jobs_specified_month_all.mako @@ -1,11 +1,13 @@ <%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> +<%namespace file="/spark_base.mako" import="jqs_style, make_sparkline" /> <%namespace file="/sorting_base.mako" import="get_sort_url, get_css" /> %if message: ${render_msg( message, 'done' )} %endif +${jqs_style()} ${get_css()} @@ -37,6 +39,7 @@ ${get_css()} <% ctr = 0 %> %for job in jobs: + <% key = job[1] %> %if ctr % 2 == 1: %else: @@ -45,6 +48,8 @@ ${get_css()} + ${make_sparkline(key, job[4], "bar", "/ hour")} + <% ctr += 1 %> %endfor diff --git a/templates/webapps/reports/jobs_specified_month_in_error.mako b/templates/webapps/reports/jobs_specified_month_in_error.mako index 3ca44979401..4501ca1bc6e 100644 --- a/templates/webapps/reports/jobs_specified_month_in_error.mako +++ b/templates/webapps/reports/jobs_specified_month_in_error.mako @@ -1,11 +1,13 @@ <%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> +<%namespace file="/spark_base.mako" import="jqs_style, make_sparkline" /> <%namespace file="/sorting_base.mako" import="get_sort_url, get_css" /> %if message: ${render_msg( message, 'done' )} %endif +${jqs_style()} ${get_css()}
@@ -36,14 +38,17 @@ ${get_css()} <% ctr = 0 %> %for job in jobs: + <% key = job[1] %> %if ctr % 2 == 1:
%else: %endif - - + + + ${make_sparkline(key, job[4], "bar", "/ hour")} + <% ctr += 1 %> %endfor diff --git a/templates/webapps/reports/jobs_tool_per_month.mako b/templates/webapps/reports/jobs_tool_per_month.mako index 916bfb661f3..8d5eea5ad78 100644 --- a/templates/webapps/reports/jobs_tool_per_month.mako +++ b/templates/webapps/reports/jobs_tool_per_month.mako @@ -1,11 +1,13 @@ <%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> +<%namespace file="/spark_base.mako" import="jqs_style, make_sparkline" /> <%namespace file="/sorting_base.mako" import="get_sort_url, get_css" /> %if message: ${render_msg( message, 'done' )} %endif +${jqs_style()} ${get_css()} @@ -13,7 +15,10 @@ ${get_css()}

Jobs per month for tool "${tool_id}"

-
Click Jobs to view details
+
+

Click Jobs to view details.

+

Graph goes from first of the month to the last

+
There are no jobs.
${job[0]} ${job[1]}
${job[0]} ${month_label} ${job[1]}, ${year_label} ${job[2]}
${job[0]}${month_label} ${job[3]}, ${year_label}${job[2]}${month_label} ${job[1]}, ${year_label}${job[2]}
%if len( jobs ) == 0: @@ -37,6 +42,7 @@ ${get_css()} <% ctr = 0 %> %for job in jobs: + <% key = job[2] + job[3] %> %if ctr % 2 == 1: %else: @@ -44,6 +50,8 @@ ${get_css()} %endif + ${make_sparkline(key, trends[key], "line", "/ day")} + <% ctr += 1 %> %endfor diff --git a/templates/webapps/reports/jobs_user_per_month.mako b/templates/webapps/reports/jobs_user_per_month.mako index 7acbd73b0d5..d18d8c5235c 100644 --- a/templates/webapps/reports/jobs_user_per_month.mako +++ b/templates/webapps/reports/jobs_user_per_month.mako @@ -1,5 +1,6 @@ <%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> +<%namespace file="/spark_base.mako" import="jqs_style, make_sparkline" /> <%namespace file="/sorting_base.mako" import="get_sort_url, get_css" /> <% from galaxy import util %> @@ -7,7 +8,8 @@ %if message: ${render_msg( message, 'done' )} %endif - + +${jqs_style()} ${get_css()} <% @@ -18,7 +20,10 @@ ${get_css()}

Jobs per month for user "${_email}"

-

Click Total Jobs to see the user's jobs for that month

+

+

Click Total Jobs to see the user's jobs for that month

+

Graph goes from first of the month to the last

+

There are no jobs for tool "${tool_id}"
${job[2]} ${job[3]} ${job[1]}
%if len( jobs ) == 0: @@ -35,6 +40,7 @@ ${get_css()} <% ctr = 0 %> %for job in jobs: + <% key = job[2] + job[3] %> %if ctr % 2 == 1: %else: @@ -42,6 +48,8 @@ ${get_css()} %endif + ${make_sparkline(key, trends[key], "line", "/ day")} + <% ctr += 1 %> %endfor
There are no jobs for user "${ _email }"
${job[2]} ${job[3]} ${job[1]}