diff --git a/lib/galaxy/webapps/reports/controllers/jobs.py b/lib/galaxy/webapps/reports/controllers/jobs.py index 7c0a16f1c53..3e6f4569cae 100644 --- a/lib/galaxy/webapps/reports/controllers/jobs.py +++ b/lib/galaxy/webapps/reports/controllers/jobs.py @@ -1,4 +1,4 @@ -import operator, os +import operator, os, socket from datetime import datetime from time import strftime from galaxy.webapps.reports.base.controller import * @@ -12,84 +12,79 @@ log = logging.getLogger( __name__ ) class Jobs( BaseController ): @web.expose - def index( self, trans, **kwd ): + def specified_month_all( self, trans, **kwd ): params = util.Params( kwd ) msg = '' - - jobs = self.current_month( trans, **kwd ) - return trans.fill_template( 'jobs_current_month.mako', jobs=jobs, msg=msg ) - - @web.expose - def current_month( self, trans, **kwd ): - month = datetime.utcnow().strftime( "%Y-%m" ) + year_month = datetime.utcnow().strftime( "%Y-%m" ) + month = params.get( 'id', year_month ) engine = galaxy.model.mapping.metadata.engine jobs = [] - + monitor_email = params.get( 'monitor_email', 'monitor@bx.psu.edu' ) s = """ - SELECT - wanted_year_month_day AS year_month_day, - num_jobs AS num_jobs, - num_jobs_to_subtract AS num_monitor_jobs, - wanted_day_label AS day_label + SELECT + wanted_year_month_day AS year_month_day, + wanted_day_of_month AS day_of_month, + num_jobs AS num_jobs, + num_jobs_to_subtract AS num_monitor_jobs, + wanted_day_label AS day_label + FROM + (SELECT + year_month_day AS year_month_day, + day_of_month AS day_of_month, + num_jobs_to_subtract AS num_jobs_to_subtract, + to_char(a_timestamp, 'Day') AS day_label FROM (SELECT - year_month_day AS year_month_day, - day_of_month AS day_of_month, - num_jobs_to_subtract AS num_jobs_to_subtract, - to_char(a_timestamp, 'Day') AS day_label + substr(job.create_time, 1, 10) AS year_month_day, + substr(job.create_time, 9, 2) AS day_of_month, + count(substr(job.create_time, 1, 10)) AS num_jobs_to_subtract, + to_timestamp(substr(job.create_time, 1, 10), 'YYYY-MM-DD+02') AS a_timestamp + FROM + job + LEFT OUTER JOIN history ON job.history_id = history.id + LEFT OUTER JOIN galaxy_user ON history.user_id = galaxy_user.id + WHERE + substr(job.create_time, 1, 7) = '%s' + AND + galaxy_user.email = '%s' + GROUP BY + substr(job.create_time, 9, 2), + substr(job.create_time, 1, 10)) AS fubar + ) AS total_fubar + FULL JOIN + (SELECT + year_month_day AS wanted_year_month_day, + day_of_month AS wanted_day_of_month, + num_jobs AS num_jobs, + to_char(a_timestamp, 'Day') AS wanted_day_label + FROM + (SELECT + foo.create_time AS year_month_day, + foo.day_of_month AS day_of_month, + count(foo.create_time) AS num_jobs, + to_timestamp(foo.create_time, 'YYYY-MM-DD+02') AS a_timestamp FROM (SELECT - substr(job.create_time, 1, 10) AS year_month_day, - substr(job.create_time, 9, 2) AS day_of_month, - count(substr(job.create_time, 1, 10)) AS num_jobs_to_subtract, - to_timestamp(substr(job.create_time, 1, 10), 'YYYY-MM-DD+02') AS a_timestamp + substr(job.create_time, 1, 10) AS create_time, + substr(job.create_time, 9, 2) AS day_of_month FROM job - LEFT OUTER JOIN history ON job.history_id = history.id - LEFT OUTER JOIN galaxy_user ON history.user_id = galaxy_user.id WHERE substr(job.create_time, 1, 7) = '%s' - AND - galaxy_user.email = 'monitor@bx.psu.edu' - GROUP BY - substr(job.create_time, 9, 2), - substr(job.create_time, 1, 10)) AS fubar - ) AS total_fubar - FULL JOIN - (SELECT - year_month_day AS wanted_year_month_day, - day_of_month AS wanted_day_of_month, - num_jobs AS num_jobs, - to_char(a_timestamp, 'Day') AS wanted_day_label - FROM - (SELECT - foo.create_time AS year_month_day, - foo.day_of_month AS day_of_month, - count(foo.create_time) AS num_jobs, - to_timestamp(foo.create_time, 'YYYY-MM-DD+02') AS a_timestamp - FROM - (SELECT - substr(job.create_time, 1, 10) AS create_time, - substr(job.create_time, 9, 2) AS day_of_month - FROM - job - WHERE - substr(job.create_time, 1, 7) = '%s' - GROUP BY - day_of_month, - job.create_time) AS foo GROUP BY day_of_month, - create_time - ORDER BY - create_time DESC) AS bar - ) AS foobar - ON - foobar.wanted_year_month_day = total_fubar.year_month_day - ORDER BY - year_month_day DESC - """ % ( month, month ) - + job.create_time) AS foo + GROUP BY + day_of_month, + create_time + ORDER BY + create_time DESC) AS bar + ) AS foobar + ON + foobar.wanted_year_month_day = total_fubar.year_month_day + ORDER BY + year_month_day DESC + """ % ( month, monitor_email, month ) job_rows = engine.text( s ).execute().fetchall() for job in job_rows: try: @@ -97,5 +92,470 @@ class Jobs( BaseController ): except: num_user_jobs = job.num_jobs jobs.append( ( job.day_label, job.year_month_day, num_user_jobs, job.num_monitor_jobs, job.num_jobs ) ) - return jobs - + return trans.fill_template( 'jobs_specified_month_all.mako', month=month, jobs=jobs, msg=msg ) + @web.expose + def specified_month_in_error( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + month = datetime.utcnow().strftime( "%Y-%m" ) + engine = galaxy.model.mapping.metadata.engine + jobs = [] + s = """ + SELECT + year_month_day AS year_month_day, + day_of_month AS day_of_month, + num_jobs AS num_jobs, + to_char(a_timestamp, 'Day') AS day_label + FROM + (SELECT + foo.create_time AS year_month_day, + foo.day_of_month AS day_of_month, + count(foo.create_time) AS num_jobs, + to_timestamp(foo.create_time, 'YYYY-MM-DD') AS a_timestamp + FROM + (SELECT + substr(create_time, 1, 10) AS create_time, + substr(create_time, 9, 2) AS day_of_month + FROM + job + WHERE + state = 'error' + AND + substr(create_time, 1, 7) = '%s' + GROUP BY + day_of_month, + create_time) AS foo + GROUP BY + day_of_month, + create_time + ORDER BY + create_time DESC) AS bar + """ % ( month ) + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + jobs.append( ( job.day_label, job.year_month_day, job.num_jobs ) ) + return trans.fill_template( 'jobs_specified_month_in_error.mako', month=month, jobs=jobs, msg=msg ) + @web.expose + def specified_date_in_error( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + engine = galaxy.model.mapping.metadata.engine + jobs = [] + today = datetime.utcnow().strftime( "%Y-%m-%d" ) + specified_date = params.get( 'id', today ) + s = """ + SELECT + job.id AS id, + job.state AS state, + substr(job.create_time, 1, 19) AS create_time, + substr(job.update_time, 1, 19) AS update_time, + job.tool_id AS tool_id, + job.command_line AS command_line, + job.stderr AS stderr, + job.session_id AS session_id, + job.traceback as stack_trace, + job.info as info, + galaxy_user.email AS user_email, + galaxy_session.remote_addr AS remote_address + FROM + job + LEFT OUTER JOIN history ON job.history_id = history.id + LEFT OUTER JOIN galaxy_user ON history.user_id = galaxy_user.id + LEFT OUTER JOIN galaxy_session ON job.session_id = galaxy_session.id + WHERE + state = 'error' + AND + substr(job.create_time, 1, 10) = '%s' + ORDER BY + job.id DESC + """ % specified_date + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + remote_host = job.remote_address + if job.remote_address: + try: + remote_host = socket.gethostbyaddr( job.remote_address )[0] + except: + pass + jobs.append( ( job.state, job.id, job.create_time, job.update_time, job.session_id, job.tool_id, job.user_email, remote_host, job.command_line, job.stderr, job.stack_trace, job.info ) ) + return trans.fill_template( 'jobs_specified_date_in_error.mako', specified_date=specified_date, jobs=jobs, msg=msg ) + @web.expose + def specified_date_all( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + engine = galaxy.model.mapping.metadata.engine + jobs = [] + today = datetime.utcnow().strftime( "%Y-%m-%d" ) + specified_date = params.get( 'id', today ) + monitor_email = params.get( 'monitor_email', 'monitor@bx.psu.edu' ) + s = """ + SELECT + job.id AS id, + job.state AS state, + substr(job.create_time, 1, 19) AS create_time, + substr(job.update_time, 1, 19) AS update_time, + job.tool_id AS tool_id, + job.command_line AS command_line, + job.stderr AS stderr, + job.session_id AS session_id, + job.traceback as stack_trace, + job.info as info, + galaxy_user.email AS user_email, + galaxy_session.remote_addr AS remote_address + FROM + job + LEFT OUTER JOIN history ON job.history_id = history.id + LEFT OUTER JOIN galaxy_user ON history.user_id = galaxy_user.id + LEFT OUTER JOIN galaxy_session ON job.session_id = galaxy_session.id + WHERE + substr(job.create_time, 1, 10) = '%s' + AND + galaxy_user.email != '%s' + ORDER BY + job.id DESC + """ % ( specified_date, monitor_email ) + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + remote_host = job.remote_address + if job.remote_address: + try: + remote_host = socket.gethostbyaddr( job.remote_address )[0] + except: + pass + jobs.append( ( job.state, job.id, job.create_time, job.update_time, job.session_id, job.tool_id, job.user_email, remote_host, job.command_line, job.stderr, job.stack_trace, job.info ) ) + return trans.fill_template( 'jobs_specified_date_all.mako', specified_date=specified_date, jobs=jobs, msg=msg ) + @web.expose + def all_unfinished( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + engine = galaxy.model.mapping.metadata.engine + jobs = [] + s = """ + SELECT + job.id AS id, + job.state AS state, + substr(job.create_time, 1, 19) AS create_time, + substr(job.update_time, 1, 19) AS update_time, + job.tool_id AS tool_id, + job.command_line AS command_line, + job.stderr AS stderr, + job.session_id AS session_id, + job.traceback as stack_trace, + job.info as info, + galaxy_user.email AS user_email, + galaxy_session.remote_addr AS remote_address + FROM + job + LEFT OUTER JOIN history ON job.history_id = history.id + LEFT OUTER JOIN galaxy_user ON history.user_id = galaxy_user.id + LEFT OUTER JOIN galaxy_session ON job.session_id = galaxy_session.id + WHERE + job.state = 'running' + OR + job.state = 'queued' + OR + job.state = 'new' + ORDER BY + job.update_time DESC + """ + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + remote_host = job.remote_address + if job.remote_address: + try: + remote_host = socket.gethostbyaddr( job.remote_address )[0] + except: + pass + jobs.append( ( job.state, job.id, job.create_time, job.update_time, job.session_id, job.tool_id, job.user_email, remote_host, job.command_line, job.stderr, job.stack_trace, job.info ) ) + return trans.fill_template( 'jobs_all_unfinished.mako', jobs=jobs, msg=msg ) + @web.expose + def per_month_all( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + engine = galaxy.model.mapping.metadata.engine + jobs = [] + monitor_email = params.get( 'monitor_email', 'monitor@bx.psu.edu' ) + s = """ + SELECT + wanted_year_month AS year_month, + num_jobs AS num_jobs, + num_monitor_jobs AS num_monitor_jobs, + wanted_month_label AS month_label, + wanted_year_label AS year_label + FROM + (SELECT + year_month AS year_month, + num_monitor_jobs AS num_monitor_jobs, + to_timestamp(year_month, 'YYYY-MM-DD+02') AS a_timestamp + FROM + (SELECT + substr(job.create_time, 1, 7) AS year_month, + count(substr(job.create_time, 1, 10)) AS num_monitor_jobs + FROM + job + LEFT OUTER JOIN history ON job.history_id = history.id + LEFT OUTER JOIN galaxy_user ON history.user_id = galaxy_user.id + WHERE + galaxy_user.email = '%s' + GROUP BY + substr(job.create_time, 1, 7) + ) AS fubar + ) AS total_fubar + FULL JOIN + (SELECT + num_jobs AS num_jobs, + wanted_year_month AS wanted_year_month, + to_char(a_timestamp, 'Month') AS wanted_month_label, + to_char(a_timestamp, 'YYYY') AS wanted_year_label + FROM + (SELECT + num_jobs AS num_jobs, + wanted_year_month AS wanted_year_month, + to_timestamp(wanted_year_month, 'YYYY-MM-DD+02' ) AS a_timestamp + FROM + (SELECT + count(id) AS num_jobs, + substr(create_time, 1, 7) AS wanted_year_month + FROM + job + GROUP BY + substr(create_time, 1, 7) + ORDER BY + substr(create_time, 1, 7) DESC) AS foo + ) AS bar + ) AS foobar + ON + foobar.wanted_year_month = total_fubar.year_month + ORDER BY + year_month DESC + """ % monitor_email + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + if job.num_jobs is None: + job.num_jobs = 0 + if job.num_monitor_jobs is None: + job.num_monitor_jobs = 0 + num_user_jobs = job.num_jobs - job.num_monitor_jobs + jobs.append( ( job.year_month, num_user_jobs, job.num_monitor_jobs, job.num_jobs, job.month_label, job.year_label ) ) + return trans.fill_template( 'jobs_per_month_all.mako', jobs=jobs, msg=msg ) + @web.expose + def per_month_in_error( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + engine = galaxy.model.mapping.metadata.engine + jobs = [] + s = """ + SELECT + count(id) AS num_jobs, + substr(create_time, 1, 7) AS year_month + FROM + job + WHERE + state = 'error' + GROUP BY + year_month + ORDER BY + year_month DESC + """ + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + jobs.append( ( job.year_month, job.num_jobs ) ) + return trans.fill_template( 'jobs_per_month_in_error.mako', jobs=jobs, msg=msg ) + @web.expose + def per_user( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + engine = galaxy.model.mapping.metadata.engine + jobs = [] + s = """ + SELECT + galaxy_user.email AS user_email, + count(job.id) AS num_jobs + FROM + job + LEFT OUTER JOIN galaxy_session ON galaxy_session.id = job.session_id + LEFT OUTER JOIN galaxy_user ON galaxy_session.user_id = galaxy_user.id + GROUP BY + user_email + ORDER BY + num_jobs DESC, + user_email + """ + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + jobs.append( ( job.user_email, job.num_jobs ) ) + return trans.fill_template( 'jobs_per_user.mako', jobs=jobs, msg=msg ) + @web.expose + def user_per_month( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + engine = galaxy.model.mapping.metadata.engine + jobs = [] + email = params.get( 'id', 'monitor@bx.psu.edu' ) + # The @ char has been converted to an 'X' + email = email.replace( 'X', '@' ) + s = """ + SELECT + num_jobs AS num_jobs, + year_month AS year_month, + to_char(a_timestamp, 'Month') AS month_label, + to_char(a_timestamp, 'YYYY') AS year_label + FROM + (SELECT + num_jobs AS num_jobs, + year_month AS year_month, + to_timestamp(year_month, 'YYYY-MM-DD') AS a_timestamp + FROM + (SELECT + count(job.id) AS num_jobs, + substr(job.create_time, 1, 7) AS year_month + FROM + job + LEFT OUTER JOIN galaxy_session ON galaxy_session.id = job.session_id + LEFT OUTER JOIN galaxy_user ON galaxy_session.user_id = galaxy_user.id + WHERE + galaxy_user.email = '%s' + GROUP BY + year_month + ORDER BY + year_month DESC) AS foo) AS bar + """ % email + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + jobs.append( ( job.year_month, job.num_jobs ) ) + return trans.fill_template( 'jobs_user_per_month.mako', email=email, jobs=jobs, msg=msg ) + @web.expose + def user_for_month( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + engine = galaxy.model.mapping.metadata.engine + jobs = [] + email = params.get( 'id', 'monitor@bx.psu.edu' ) + # The @ char has been converted to an 'X' + email = email.replace( 'X', '@' ) + year_month = datetime.utcnow().strftime( "%Y-%m" ) + month = params.get( 'month', year_month ) + s = """ + SELECT + job.id AS id, + job.state AS state, + substr(job.create_time, 1, 19) AS create_time, + substr(job.update_time, 1, 19) AS update_time, + job.tool_id AS tool_id, + job.command_line AS command_line, + job.stderr AS stderr, + job.session_id AS session_id, + job.traceback as stack_trace, + job.info as info, + galaxy_user.email AS user_email, + galaxy_session.remote_addr AS remote_address + FROM + job + LEFT OUTER JOIN history ON job.history_id = history.id + LEFT OUTER JOIN galaxy_user ON history.user_id = galaxy_user.id + LEFT OUTER JOIN galaxy_session ON job.session_id = galaxy_session.id + WHERE + galaxy_user.email = '%s' + AND + substr(job.create_time, 1, 7) = '%s' + ORDER BY + job.id DESC + """ % ( email, month ) + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + remote_host = job.remote_address + if job.remote_address: + try: + remote_host = socket.gethostbyaddr( job.remote_address )[0] + except: + pass + jobs.append( ( job.state, job.id, job.create_time, job.update_time, job.session_id, job.tool_id, job.user_email, remote_host, job.command_line, job.stderr, job.stack_trace, job.info ) ) + return trans.fill_template( 'jobs_user_for_month.mako', email=email, month=month, jobs=jobs, msg=msg ) + @web.expose + def per_tool( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + engine = galaxy.model.mapping.metadata.engine + jobs = [] + s = """ + SELECT + tool_id AS tool_id, + count(tool_id) AS times_run + FROM + job + GROUP BY tool_id + ORDER BY tool_id + """ + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + jobs.append( ( job.tool_id, job.times_run ) ) + return trans.fill_template( 'jobs_per_tool.mako', jobs=jobs, msg=msg ) + @web.expose + def tool_per_month( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + engine = galaxy.model.mapping.metadata.engine + jobs = [] + tool_id = params.get( 'id', 'Add a column1' ) + s = """ + SELECT + count(id) AS num_jobs, + substr(create_time, 1, 7) AS year_month + FROM + job + WHERE + tool_id = '%s' + GROUP BY + year_month + ORDER BY + year_month DESC + """ % tool_id + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + jobs.append( ( job.year_month, job.num_jobs ) ) + return trans.fill_template( 'jobs_tool_per_month.mako', tool_id=tool_id, jobs=jobs, msg=msg ) + @web.expose + def tool_for_month( self, trans, **kwd ): + params = util.Params( kwd ) + msg = '' + engine = galaxy.model.mapping.metadata.engine + jobs = [] + tool_id = params.get( 'id', 'Add a column1' ) + year_month = datetime.utcnow().strftime( "%Y-%m" ) + month = params.get( 'month', year_month ) + s = """ + SELECT + job.id AS id, + job.state AS state, + substr(job.create_time, 1, 19) AS create_time, + substr(job.update_time, 1, 19) AS update_time, + job.tool_id AS tool_id, + job.command_line AS command_line, + job.stderr AS stderr, + job.session_id AS session_id, + job.traceback as stack_trace, + job.info as info, + galaxy_user.email AS user_email, + galaxy_session.remote_addr AS remote_address + FROM + job + LEFT OUTER JOIN history ON job.history_id = history.id + LEFT OUTER JOIN galaxy_user ON history.user_id = galaxy_user.id + LEFT OUTER JOIN galaxy_session ON job.session_id = galaxy_session.id + WHERE + tool_id = '%s' + AND + substr(job.create_time, 1, 7) = '%s' + ORDER BY + job.id DESC + """ % ( tool_id, month ) + job_rows = engine.text( s ).execute().fetchall() + for job in job_rows: + remote_host = job.remote_address + if job.remote_address: + try: + remote_host = socket.gethostbyaddr( job.remote_address )[0] + except: + pass + jobs.append( ( job.state, job.id, job.create_time, job.update_time, job.session_id, job.tool_id, job.user_email, remote_host, job.command_line, job.stderr, job.stack_trace, job.info ) ) + return trans.fill_template( 'jobs_tool_for_month.mako', tool_id=tool_id, month=month, jobs=jobs, msg=msg ) diff --git a/lib/galaxy/webapps/reports/controllers/root.py b/lib/galaxy/webapps/reports/controllers/root.py index 043ffbb487b..c7e54ce7dfe 100644 --- a/lib/galaxy/webapps/reports/controllers/root.py +++ b/lib/galaxy/webapps/reports/controllers/root.py @@ -19,7 +19,4 @@ class Report( BaseController ): blog_url = trans.app.config.get( "blog_url", "http://g2.trac.bx.psu.edu/blog" ) screencasts_url = trans.app.config.get( "screencasts_url", "http://g2.trac.bx.psu.edu/wiki/ScreenCasts" ) return trans.fill_template( "masthead.mako", brand=brand, wiki_url=wiki_url, blog_url=blog_url,bugs_email=bugs_email, screencasts_url=screencasts_url ) - @web.expose - def main_frame( self, trans ): - return trans.fill_template( "main_frame.mako" ) diff --git a/lib/galaxy/webapps/reports/controllers/system.py b/lib/galaxy/webapps/reports/controllers/system.py index dc6d3b36b90..c15155371dc 100644 --- a/lib/galaxy/webapps/reports/controllers/system.py +++ b/lib/galaxy/webapps/reports/controllers/system.py @@ -155,7 +155,7 @@ class System( BaseController ): def disk_usage( self, trans, **kwd ): file_path = trans.app.config.file_path disk_usage = self.get_disk_usage( file_path ) - min_file_size = 2**32 # 4 Gb + min_file_size = 1000 # 4 Gb file_size_str = nice_size( min_file_size ) d = trans.model.Dataset datasets = [] diff --git a/lib/galaxy/webapps/reports/static/january_2008_style/blue/base.css b/lib/galaxy/webapps/reports/static/january_2008_style/blue/base.css index f51564fae50..548dc61ff25 100644 --- a/lib/galaxy/webapps/reports/static/january_2008_style/blue/base.css +++ b/lib/galaxy/webapps/reports/static/january_2008_style/blue/base.css @@ -59,12 +59,13 @@ div.reportParamHelp a div.reportBody { background: #FFFFFF; - background-image: url(report_body_bg.png); background-repeat: repeat-x; background-position: top; padding: 5px; padding-left: 10px; padding-right: 10px; + width: 100%; + scrolling: no; } div.reportBody div.reportTitle @@ -258,7 +259,46 @@ table.colored tr.header border-bottom: solid #d8b365 1px; font-weight: bold; } - +table.colored tr.headernew +{ + background: #add8e6; + background-repeat: repeat-x; + background-position: top; + border-bottom: solid #d8b365 1px; + font-weight: bold; +} +table.colored tr.headerqueued +{ + background: #ee82ee; + background-repeat: repeat-x; + background-position: top; + border-bottom: solid #d8b365 1px; + font-weight: bold; +} +table.colored tr.headerrunning +{ + background: #ffff00; + background-repeat: repeat-x; + background-position: top; + border-bottom: solid #d8b365 1px; + font-weight: bold; +} +table.colored tr.headererror +{ + background: #ff0000; + background-repeat: repeat-x; + background-position: top; + border-bottom: solid #d8b365 1px; + font-weight: bold; +} +table.colored tr.headerok +{ + background: #008000; + background-repeat: repeat-x; + background-position: top; + border-bottom: solid #d8b365 1px; + font-weight: bold; +} table.colored tr { background: white; diff --git a/lib/galaxy/webapps/reports/templates/base.mako b/lib/galaxy/webapps/reports/templates/base.mako deleted file mode 100644 index 5cd2a8a3c68..00000000000 --- a/lib/galaxy/webapps/reports/templates/base.mako +++ /dev/null @@ -1,27 +0,0 @@ - - - - ${self.title()} - - ${self.stylesheets()} - ${self.javascripts()} - - - ${next.body()} - - - - ## Default title - <%def name="title()"> - - ## Default stylesheets - <%def name="stylesheets()"> - - - - ## Default javascripts - <%def name="javascripts()"> - ## - \ No newline at end of file diff --git a/lib/galaxy/webapps/reports/templates/base_panels.mako b/lib/galaxy/webapps/reports/templates/base_panels.mako index a80438f5e4e..ebee4dc28f3 100644 --- a/lib/galaxy/webapps/reports/templates/base_panels.mako +++ b/lib/galaxy/webapps/reports/templates/base_panels.mako @@ -6,13 +6,15 @@ ## Default stylesheets <%def name="stylesheets()"> + ## Default javascripts <%def name="javascripts()"> @@ -22,25 +24,27 @@ ## Masthead <%def name="masthead()"> - + ## Document ${self.title()} + ${self.javascripts()} ${self.stylesheets()} - + ## Background displays first
- ## Layer iframes over backgrounds + ## Layer masthead iframe over background
${self.masthead()}
-
- ${self.center_panel()} + ## Display main report body +
+ ${self.main_body()}
## Allow other body level elements ${next.body()} diff --git a/lib/galaxy/webapps/reports/templates/index.mako b/lib/galaxy/webapps/reports/templates/index.mako index 70977e27739..28bd782a006 100644 --- a/lib/galaxy/webapps/reports/templates/index.mako +++ b/lib/galaxy/webapps/reports/templates/index.mako @@ -1,8 +1,22 @@ <%inherit file="/base_panels.mako"/> -<%def name="center_panel()"> - ## Display the reports in the middle frame - <% - center_url = h.url_for( 'main_frame' ) - %> - +<%def name="main_body()"> + ## Display the available reports +
+

Galaxy Reports

+ + + + + + + + + +
Job Information
Number of jobs per day for current month - displays days of the current month with the total number of jobs for each day
Number of jobs in error per day for current month - displays days of the current month with the total number of jobs in error for each day
All unfinished jobs - displays jobs that are currently in a "new" state, a "queued" state or a "running" state
Number of jobs per month - displays a list of months with the total number of jobs for each month
Number of jobs in error per month - displays a list of months with the total number of jobs in error for each month
Number of jobs per user - displays users sorted in descending order by the number of jobs they have submitted
Number of jobs per tool - displays tools sorted in alphabetical order by tool id and the number of jobs created by the tool
+



+ + + +
System Information
Disk space, old histories and datasets - displays history and dataset information including disk space allocation where datasets are stored
+
diff --git a/lib/galaxy/webapps/reports/templates/jobs_all_unfinished.mako b/lib/galaxy/webapps/reports/templates/jobs_all_unfinished.mako new file mode 100644 index 00000000000..f30269b2adc --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_all_unfinished.mako @@ -0,0 +1,83 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

All Unfinished Jobs

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + %for job in jobs: + <% + state = job[0] + if state == 'new': + rowdef = '' + elif state == 'queued': + rowdef = '' + elif state == 'running': + rowdef = '' + %> + ${rowdef} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %endfor + %endif +
There are no unfinished jobs
StateJob IdCreate TimeUpdate TimeSession Id
${job[0]}${job[1]}${job[2]}${job[3]}${job[4]}
ToolUser
${job[5]}${job[6]}
Remote Host
${job[7]}
Command Line
${job[8]}
Stderr
${job[9]}
Stack Trace
${job[10]}
Info
${job[11]}
 
 
+
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_per_month_all.mako b/lib/galaxy/webapps/reports/templates/jobs_per_month_all.mako new file mode 100644 index 00000000000..397b87ba27f --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_per_month_all.mako @@ -0,0 +1,39 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

Jobs Per Month

+

Click Year-Month to view the number of jobs for each day of that month

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + + + + + + + <% ctr = 0 %> + %for job in jobs: + %if ctr % 2 == 1: + + %else: + + %endif + + + + + + <% ctr += 1 %> + %endfor + %endif +
There are no jobs
Year-MonthUser JobsMonitor JobsTotal
${job[0]}${job[1]}${job[2]}${job[3]}
+
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_per_month_in_error.mako b/lib/galaxy/webapps/reports/templates/jobs_per_month_in_error.mako new file mode 100644 index 00000000000..853546eafac --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_per_month_in_error.mako @@ -0,0 +1,35 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

Jobs In Error Per Month

+

Click Year-Month to view the number of jobs in error for each day of that month

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + + + + + <% ctr = 0 %> + %for job in jobs: + %if ctr % 2 == 1: + + %else: + + %endif + + + + <% ctr += 1 %> + %endfor + %endif +
There are no jobs in error
Year-MonthJobs In Error
${job[0]}${job[1]}
+
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_per_tool.mako b/lib/galaxy/webapps/reports/templates/jobs_per_tool.mako new file mode 100644 index 00000000000..ba9c4afe207 --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_per_tool.mako @@ -0,0 +1,35 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

Jobs Per Tool

+

Click Tool Id to view jobs per month for that tool

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + + + + + <% ctr = 0 %> + %for job in jobs: + %if ctr % 2 == 1: + + %else: + + %endif + + + + <% ctr += 1 %> + %endfor + %endif +
There are no jobs
Tool idTotal Jobs
${job[0]}${job[1]}
+
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_per_user.mako b/lib/galaxy/webapps/reports/templates/jobs_per_user.mako new file mode 100644 index 00000000000..803f9756334 --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_per_user.mako @@ -0,0 +1,35 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

Jobs Per User

+

Click User to view jobs per month for that user

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + + + + + <% ctr = 0 %> + %for job in jobs: + %if ctr % 2 == 1: + + %else: + + %endif + + + + <% ctr += 1 %> + %endfor + %endif +
There are no jobs
UserTotal Jobs
${job[0]}${job[1]}
+
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_specified_date_all.mako b/lib/galaxy/webapps/reports/templates/jobs_specified_date_all.mako new file mode 100644 index 00000000000..fcbb55ba2b6 --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_specified_date_all.mako @@ -0,0 +1,87 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

All Jobs for ${specified_date}

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + %for job in jobs: + <% + state = job[0] + if state == 'new': + rowdef = '' + elif state == 'queued': + rowdef = '' + elif state == 'running': + rowdef = '' + elif state == 'error': + rowdef = '' + elif state == 'ok': + rowdef = '' + %> + ${rowdef} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %endfor + %endif +
There are no jobs for ${specified_date}
StateJob IdCreate TimeUpdate TimeSession Id
${job[0]}${job[1]}${job[2]}${job[3]}${job[4]}
ToolUser
${job[5]}${job[6]}
Remote Host
${job[7]}
Command Line
${job[8]}
Stderr
${job[9]}
Stack Trace
${job[10]}
Info
${job[11]}
 
 
+
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_specified_date_in_error.mako b/lib/galaxy/webapps/reports/templates/jobs_specified_date_in_error.mako new file mode 100644 index 00000000000..eb6967b4749 --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_specified_date_in_error.mako @@ -0,0 +1,74 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

All Jobs in Error for ${specified_date}

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + %for job in jobs: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %endfor + %endif +
There are no jobs in error for ${specified_date}
StateJob IdCreate TimeUpdate TimeSession Id
${job[0]}${job[1]}${job[2]}${job[3]}${job[4]}
ToolUser
${job[5]}${job[6]}
Remote Host
${job[7]}
Command Line
${job[8]}
Stderr
${job[9]}
Stack Trace
${job[10]}
Info
${job[11]}
 
 
+
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_current_month.mako b/lib/galaxy/webapps/reports/templates/jobs_specified_month_all.mako similarity index 54% rename from lib/galaxy/webapps/reports/templates/jobs_current_month.mako rename to lib/galaxy/webapps/reports/templates/jobs_specified_month_all.mako index f3d2827d271..0196640fbf5 100644 --- a/lib/galaxy/webapps/reports/templates/jobs_current_month.mako +++ b/lib/galaxy/webapps/reports/templates/jobs_specified_month_all.mako @@ -1,34 +1,28 @@ -<%inherit file="/base.mako"/> - - - Jobs for current month - - - - -

Jobs for Current Month

+<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

All Jobs for ${month}

+

Click Total Jobs to see jobs for that day

%if msg:
${msg}
%endif - %if len( jobs ) == 0: - + %else: - + - <% - ctr = 0 - %> + <% ctr = 0 %> %for job in jobs: - %if len( jobs ) > 2 and ctr % 2 == 1: + %if ctr % 2 == 1: %else: @@ -37,13 +31,11 @@ - + - <% - ctr += 1 - %> + <% ctr += 1 %> %endfor %endif
Jobs for Current Month
There are no jobs for the current month
There are no jobs for ${month}
Day Date User Jobs Monitor JobsTotalTotal Jobs
${job[1]} ${job[2]} ${job[3]}${job[4]}${job[4]}
- - +
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_specified_month_in_error.mako b/lib/galaxy/webapps/reports/templates/jobs_specified_month_in_error.mako new file mode 100644 index 00000000000..5bf16ccc1b2 --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_specified_month_in_error.mako @@ -0,0 +1,37 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

Jobs in Error for ${month}

+

Click Jobs in Error to view jobs in error for that day

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + + + + + + <% ctr = 0 %> + %for job in jobs: + %if ctr % 2 == 1: + + %else: + + %endif + + + + + <% ctr += 1 %> + %endfor + %endif +
There are no jobs in error for ${month}
DayDateJobs in Error
${job[0]}${job[1]}${job[2]}
+
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_tool_for_month.mako b/lib/galaxy/webapps/reports/templates/jobs_tool_for_month.mako new file mode 100644 index 00000000000..99306d6e44c --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_tool_for_month.mako @@ -0,0 +1,87 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

Jobs for tool ${tool_id} during ${month}

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + %for job in jobs: + <% + state = job[0] + if state == 'new': + rowdef = '' + elif state == 'queued': + rowdef = '' + elif state == 'running': + rowdef = '' + elif state == 'error': + rowdef = '' + elif state == 'ok': + rowdef = '' + %> + ${rowdef} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %endfor + %endif +
There are no jobs for ${tool_id} during ${month}
StateJob IdCreate TimeUpdate TimeSession Id
${job[0]}${job[1]}${job[2]}${job[3]}${job[4]}
ToolUser
${job[5]}${job[6]}
Remote Host
${job[7]}
Command Line
${job[8]}
Stderr
${job[9]}
Stack Trace
${job[10]}
Info
${job[11]}
 
 
+
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_tool_per_month.mako b/lib/galaxy/webapps/reports/templates/jobs_tool_per_month.mako new file mode 100644 index 00000000000..8a308ebbebf --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_tool_per_month.mako @@ -0,0 +1,35 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

Jobs per month for tool ${tool_id}

+

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

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + + + + + <% ctr = 0 %> + %for job in jobs: + %if ctr % 2 == 1: + + %else: + + %endif + + + + <% ctr += 1 %> + %endfor + %endif +
There are no jobs
Year-MonthTotal Jobs
${job[0]}${job[1]}
+
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_user_for_month.mako b/lib/galaxy/webapps/reports/templates/jobs_user_for_month.mako new file mode 100644 index 00000000000..fa65d9e3bdd --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_user_for_month.mako @@ -0,0 +1,87 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

Jobs for user ${email} during ${month}

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + %for job in jobs: + <% + state = job[0] + if state == 'new': + rowdef = '' + elif state == 'queued': + rowdef = '' + elif state == 'running': + rowdef = '' + elif state == 'error': + rowdef = '' + elif state == 'ok': + rowdef = '' + %> + ${rowdef} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %endfor + %endif +
There are no jobs for ${email} during ${month}
StateJob IdCreate TimeUpdate TimeSession Id
${job[0]}${job[1]}${job[2]}${job[3]}${job[4]}
ToolUser
${job[5]}${job[6]}
Remote Host
${job[7]}
Command Line
${job[8]}
Stderr
${job[9]}
Stack Trace
${job[10]}
Info
${job[11]}
 
 
+
+ diff --git a/lib/galaxy/webapps/reports/templates/jobs_user_per_month.mako b/lib/galaxy/webapps/reports/templates/jobs_user_per_month.mako new file mode 100644 index 00000000000..8176212fc81 --- /dev/null +++ b/lib/galaxy/webapps/reports/templates/jobs_user_per_month.mako @@ -0,0 +1,35 @@ +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +
+

Jobs per month for user ${email}

+

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

+ %if msg: + + +
${msg}
+ %endif + + %if len( jobs ) == 0: + + %else: + + + + + <% ctr = 0 %> + %for job in jobs: + %if ctr % 2 == 1: + + %else: + + %endif + + + + <% ctr += 1 %> + %endfor + %endif +
There are no jobs
Year-MonthTotal Jobs
${job[0]}${job[1]}
+
+ diff --git a/lib/galaxy/webapps/reports/templates/main_frame.mako b/lib/galaxy/webapps/reports/templates/main_frame.mako deleted file mode 100644 index 02edc05365c..00000000000 --- a/lib/galaxy/webapps/reports/templates/main_frame.mako +++ /dev/null @@ -1,21 +0,0 @@ -<%inherit file="/base.mako"/> - - - Galaxy Reports - - - -
-

Galaxy Reports

- - - -
Job Information
-



- - - -
System Information
-
- - diff --git a/lib/galaxy/webapps/reports/templates/masthead.mako b/lib/galaxy/webapps/reports/templates/masthead.mako index 08ccb0905ec..9c545654d46 100644 --- a/lib/galaxy/webapps/reports/templates/masthead.mako +++ b/lib/galaxy/webapps/reports/templates/masthead.mako @@ -6,7 +6,6 @@ - @@ -21,11 +20,10 @@ | screencasts | blog     - Galaxy Reports Home + Galaxy Reports Home  
- diff --git a/lib/galaxy/webapps/reports/templates/system.mako b/lib/galaxy/webapps/reports/templates/system.mako index 06a5941aba1..57fc5d4f960 100644 --- a/lib/galaxy/webapps/reports/templates/system.mako +++ b/lib/galaxy/webapps/reports/templates/system.mako @@ -1,92 +1,82 @@ -<%inherit file="/base.mako"/> - - - Galaxy System Management - - - - -

Old Histories and Datasets

- %if msg: - - -
${msg}
- %endif +<%inherit file="/base_panels.mako"/> + +<%def name="main_body()"> +

Old Histories and Datasets

+ %if msg: - - - +
-
-

- - that are not associate with a user and were last updated more than - - days ago. -

-

- - that were deleted more than - - days ago but have not yet been purged. -

-

- - that were deleted more than - - days ago but have not yet been purged. -

-
-
${msg}
-

-

Current Disk Space Where Datasets are Stored

- - + %endif +
Disk Usage for ${file_path}
+ + + +
+
+

+ + that are not associate with a user and were last updated more than + + days ago. +

+

+ + that were deleted more than + + days ago but have not yet been purged. +

+

+ + that were deleted more than + + days ago but have not yet been purged. +

+
+
+

+

Current Disk Space Where Datasets are Stored

+ + + + + + + + + + + + + + + + + %if len( datasets ) == 0: + + %else: + - - - - - + + + + + - - - - - - - - %if len( datasets ) == 0: - - %else: - - - - - - - + <% ctr = 0 %> + %for dataset in datasets: + %if ctr % 2 == 1: + + %else: + + %endif + + + + + - <% - ctr = 0 - %> - %for dataset in datasets: - %if len( datasets ) > 2 and ctr % 2 == 1: - - %else: - - %endif - - - - - - - <% - ctr += 1 - %> - %endfor - %endif -
Disk Usage for ${file_path}
File SystemDisk SizeUsedAvailablePercent Used
${disk_usage[0]}${disk_usage[1]}${disk_usage[2]}${disk_usage[3]}${disk_usage[4]}
There are no datasets larger than ${file_size_str}
${len( datasets )} largest datasets over ${file_size_str}
File SystemDisk SizeUsedAvailablePercent UsedFileLast UpdatedHistory IDDeletedSize on Disk
${disk_usage[0]}${disk_usage[1]}${disk_usage[2]}${disk_usage[3]}${disk_usage[4]}
There are no datasets larger than ${file_size_str}
${len( datasets )} largest datasets over ${file_size_str}
FileLast UpdatedHistory IDDeletedSize on Disk
dataset_${dataset[0]}.dat${dataset[1]}${dataset[2]}${dataset[3]}${dataset[4]}
dataset_${dataset[0]}.dat${dataset[1]}${dataset[2]}${dataset[3]}${dataset[4]}
- - + <% ctr += 1 %> + %endfor + %endif + +