Enhancements for the reports webapp:

In case you do not know about the Galaxy reports, make any changes you want to reports_wsgi.ini.sample and copy it to reports_wsgi.ini ( you'll have to do this anyway since there are changes in this change set )...

...then start them up with:

sh run_reports.sh

There is more work necessary, but this is a good start.  This is such a huge overhaul, that I'm sure there will be some issues.  Let me know and I'll fix them!

Here are the current fixes:

1) Use grids for rendering pages whose queries return lots of rows.

2) By using grids, we can:
 a) search for jobs whose state or tool id match a standard search filter
b) search for a specific job id using the advanced search filter
c) filter on job.state in the Advanced Search window
d) sort on id, state, tool_id or create_time in the grid
e) eliminate many of the complex old-style SQL select commands

3) Eliminate all unnecessary templates due to the use of grids, and move remaining templates to the proper loation

4) Eliminate the duplicated static files and use those from the Galaxy webapp
This commit is contained in:
Greg Von Kuster
2010-05-28 16:30:16 -04:00
parent c222bcb215
commit e79bf72fbe
68 changed files with 1243 additions and 7597 deletions
@@ -1,12 +0,0 @@
"""Contains functionality needed in every webapp interface"""
import os, time, logging
# Pieces of Galaxy to make global in every controller
from galaxy import web, util
log = logging.getLogger( __name__ )
class BaseController( object ):
"""Base class for Galaxy webapp application controllers."""
def __init__( self, app ):
"""Initialize an interface for application 'app'"""
self.app = app
+2 -1
View File
@@ -25,7 +25,8 @@ def add_controllers( webapp, app ):
Search for controllers in the 'galaxy.webapps.controllers' module and add
them to the webapp.
"""
from galaxy.webapps.reports.base.controller import BaseController
from galaxy.web.base.controller import BaseController
from galaxy.web.base.controller import ControllerUnavailable
import galaxy.webapps.reports.controllers
controller_dir = galaxy.webapps.reports.controllers.__path__[0]
for fname in os.listdir( controller_dir ):
+7 -5
View File
@@ -29,13 +29,15 @@ class Configuration( object ):
self.use_remote_user = string_as_bool( kwargs.get( "use_remote_user", "False" ) )
self.require_login = string_as_bool( kwargs.get( "require_login", "False" ) )
self.template_path = resolve_path( kwargs.get( "template_path", "templates" ), self.root )
self.template_cache = resolve_path( kwargs.get( "template_cache_path", "database/reports/compiled_templates" ), self.root )
self.template_cache = resolve_path( kwargs.get( "template_cache_path", "database/compiled_templates/reports" ), self.root )
self.sendmail_path = kwargs.get('sendmail_path',"/usr/sbin/sendmail")
self.log_actions = string_as_bool( kwargs.get( 'log_actions', 'False' ) )
self.brand = kwargs.get( 'brand', None )
self.wiki_url = kwargs.get( 'wiki_url', "http://g2.trac.bx.psu.edu/" )
self.bugs_email = kwargs.get( 'bugs_email', "mailto:galaxy-bugs@bx.psu.edu" )
self.blog_url = kwargs.get( 'blog_url', "http://g2.trac.bx.psu.edu/blog" )
self.screencasts_url = kwargs.get( 'screencasts_url', "http://g2.trac.bx.psu.edu/wiki/ScreenCasts" )
self.wiki_url = kwargs.get( 'wiki_url', 'http://bitbucket.org/galaxy/galaxy-central/wiki/Home' )
self.bugs_email = kwargs.get( 'bugs_email', None )
self.blog_url = kwargs.get( 'blog_url', None )
self.screencasts_url = kwargs.get( 'screencasts_url', None )
self.log_events = False
self.cookie_path = kwargs.get( "cookie_path", "/" )
#Parse global_conf
global_conf = kwargs.get( 'global_conf', None )
+386 -385
View File
@@ -1,69 +1,239 @@
import operator, os, socket
import calendar, operator, os, socket
from datetime import *
from time import mktime, strftime, localtime
import calendar
from galaxy.webapps.reports.base.controller import *
import galaxy.model
from galaxy.web.base.controller import *
from galaxy import model, util
from galaxy.web.framework.helpers import time_ago, iff, grids
from galaxy.model.orm import *
import pkg_resources
pkg_resources.require( "SQLAlchemy >= 0.4" )
import sqlalchemy as sa
import logging
log = logging.getLogger( __name__ )
class Jobs( BaseController ):
@web.expose
def today_all( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
monitor_email = params.get( 'monitor_email', 'monitor@bx.psu.edu' )
year, month, day = map( int, datetime.utcnow().strftime( "%Y-%m-%d" ).split( "-" ) )
class SpecifiedDateListGrid( grids.Grid ):
class JobIdColumn( grids.IntegerColumn ):
def get_value( self, trans, grid, job ):
return job.id
class StateColumn( grids.TextColumn ):
def get_value( self, trans, grid, job ):
return job.state
class ToolColumn( grids.TextColumn ):
def get_value( self, trans, grid, job ):
return job.tool_id
class CreateTimeColumn( grids.TextColumn ):
def get_value( self, trans, grid, job ):
return job.create_time
class UserColumn( grids.TextColumn ):
def get_value( self, trans, grid, job ):
if job.history:
if job.history.user:
return job.history.user.email
return 'anonymous'
# TODO: handle libraries...
return 'no history'
# Grid definition
use_async = False
model_class = model.Job
title = "Jobs By Date"
template='/webapps/reports/grid.mako'
default_sort_key = "id"
columns = [
JobIdColumn( "Id",
key="id",
model_class=model.Job,
link=( lambda item: dict( operation="job_info", id=item.id, webapp="reports" ) ),
attach_popup=False,
filterable="advanced" ),
StateColumn( "State",
key="state",
model_class=model.Job,
attach_popup=False ),
ToolColumn( "Tool Id",
key="tool_id",
model_class=model.Job,
link=( lambda item: dict( operation="tool_per_month", id=item.id, webapp="reports" ) ),
attach_popup=False ),
CreateTimeColumn( "create_time",
key="create_time",
model_class=model.Job,
attach_popup=False ),
UserColumn( "user",
# Can't sort on this column since it is not a column in self.model_class
model_class=model.User,
link=( lambda item: dict( operation="user_per_month", id=item.id, webapp="reports" ) ),
attach_popup=False ),
grids.StateColumn( "All", key="state", model_class=model.Job, visible=False, filterable="advanced" )
]
columns.append( grids.MulticolFilterColumn( "Search",
cols_to_filter=[ columns[1], columns[2] ],
key="free-text-search",
visible=False,
filterable="standard" ) )
standard_filters = []
default_filter = { 'specified_date' : 'All' }
num_rows_per_page = 50
preserve_state = False
use_paging = True
def build_initial_query( self, trans, **kwd ):
specified_date = kwd.get( 'specified_date', 'All' )
if specified_date == 'All':
return trans.sa_session.query( self.model_class )
year, month, day = map( int, specified_date.split( "-" ) )
start_date = date( year, month, day )
end_date = start_date + timedelta( days=1 )
day_label = start_date.strftime( "%A" )
month_label = start_date.strftime( "%B" )
year_label = start_date.strftime( "%Y" )
day_of_month = start_date.strftime( "%d" )
q = sa.select( ( sa.func.date( galaxy.model.Job.table.c.create_time ).label( 'date' ),
sa.func.sum( sa.case( [( galaxy.model.User.table.c.email == monitor_email, 1 )], else_=0 ) ).label( 'monitor_jobs' ),
sa.func.count( galaxy.model.Job.table.c.id ).label( 'total_jobs' ) ),
whereclause = sa.and_( galaxy.model.Job.table.c.create_time >= start_date,
galaxy.model.Job.table.c.create_time < end_date ),
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
galaxy.model.History.table ).outerjoin( galaxy.model.User.table ) ],
group_by = [ 'date' ] )
jobs = []
for row in q.execute():
jobs.append( ( row.date.strftime( "%A" ),
row.date,
row.total_jobs - row.monitor_jobs,
row.monitor_jobs,
row.total_jobs,
row.date.strftime( "%d" ) ) )
return trans.fill_template( 'jobs_today_all.mako',
day_label=day_label,
month_label=month_label,
year_label=year_label,
day_of_month=day_of_month,
month=month,
jobs=jobs,
msg=msg )
return trans.sa_session.query( self.model_class ).filter( and_( self.model_class.table.c.create_time >= start_date,
self.model_class.table.c.create_time < end_date ) )
class SpecifiedDateInErrorListGrid( SpecifiedDateListGrid ):
def build_initial_query( self, trans, **kwd ):
specified_date = kwd.get( 'specified_date', 'All' )
if specified_date == 'All':
return trans.sa_session.query( self.model_class ).filter( self.model_class.table.c.state == model.Job.states.ERROR )
year, month, day = map( int, specified_date.split( "-" ) )
start_date = date( year, month, day )
end_date = start_date + timedelta( days=1 )
return trans.sa_session.query( self.model_class ).filter( and_( self.model_class.table.c.state == model.Job.states.ERROR,
self.model_class.table.c.create_time >= start_date,
self.model_class.table.c.create_time < end_date ) )
class AllUnfinishedListGrid( SpecifiedDateListGrid ):
def build_initial_query( self, trans, **kwd ):
specified_date = kwd.get( 'specified_date', 'All' )
if specified_date == 'All':
return trans.sa_session.query( self.model_class ).filter( not_( or_( model.Job.table.c.state == model.Job.states.OK,
model.Job.table.c.state == model.Job.states.ERROR,
model.Job.table.c.state == model.Job.states.DELETED ) ) )
year, month, day = map( int, specified_date.split( "-" ) )
start_date = date( year, month, day )
end_date = start_date + timedelta( days=1 )
return trans.sa_session.query( self.model_class ).filter( and_( not_( or_( model.Job.table.c.state == model.Job.states.OK,
model.Job.table.c.state == model.Job.states.ERROR,
model.Job.table.c.state == model.Job.states.DELETED ) ),
self.model_class.table.c.create_time >= start_date,
self.model_class.table.c.create_time < end_date ) )
class UserForMonthListGrid( SpecifiedDateListGrid ):
def build_initial_query( self, trans, **kwd ):
email = util.restore_text( kwd.get( 'email', '' ) )
year, month = map( int, kwd.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
return trans.sa_session.query( model.Job ) \
.join( model.GalaxySession ) \
.join( model.User ) \
.filter( 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,
model.Job.table.c.create_time >= start_date,
model.Job.table.c.create_time < end_date ) ) \
.order_by( desc( model.Job.table.c.create_time ) )
class ToolForMonthListGrid( SpecifiedDateListGrid ):
def build_initial_query( self, trans, **kwd ):
tool_id = util.restore_text( kwd.get( 'tool_id', '' ) )
year, month = map( int, kwd.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
return trans.sa_session.query( model.Job ) \
.filter( and_( model.Job.table.c.tool_id == tool_id,
model.Job.table.c.create_time >= start_date,
model.Job.table.c.create_time < end_date ) ) \
.order_by( desc( model.Job.table.c.create_time ) )
class Jobs( BaseController ):
specified_date_list_grid = SpecifiedDateListGrid()
specified_date_in_error_list_grid = SpecifiedDateInErrorListGrid()
all_unfinished_list_grid = AllUnfinishedListGrid()
user_for_month_list_grid = UserForMonthListGrid()
tool_for_month_list_grid = ToolForMonthListGrid()
@web.expose
def specified_date( self, trans, **kwd ):
if 'operation' in kwd:
operation = kwd['operation'].lower()
if operation == "job_info":
return trans.response.send_redirect( web.url_for( controller='jobs',
action='job_info',
**kwd ) )
if operation == "tool_per_month":
# The received id is the job id, so we need to get the id of the user
# that submitted the job.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'tool_id' ] = job.tool_id
return trans.response.send_redirect( web.url_for( controller='jobs',
action='tool_per_month',
**kwd ) )
if operation == "user_per_month":
# The received id is the job id, so we need to get the id of the user
# that submitted the job.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'email' ] = None # For anonymous users
if job.history:
if job.history.user:
email = job.history.user.email
kwd[ 'email' ] = email
# TODO: handle libraries
return trans.response.send_redirect( web.url_for( controller='jobs',
action='user_per_month',
**kwd ) )
return self.specified_date_list_grid( trans, **kwd )
@web.expose
def today_all( self, trans, **kwd ):
kwd[ 'specified_date' ] = datetime.utcnow().strftime( "%Y-%m-%d" )
return self.specified_date( trans, **kwd )
@web.expose
def specified_date_in_error( self, trans, **kwd ):
if 'operation' in kwd:
operation = kwd['operation'].lower()
if operation == "job_info":
return trans.response.send_redirect( web.url_for( controller='jobs',
action='job_info',
**kwd ) )
if operation == "tool_per_month":
# The received id is the job id, so we need to get the id of the user
# that submitted the job.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'tool_id' ] = job.tool_id
return trans.response.send_redirect( web.url_for( controller='jobs',
action='tool_per_month',
**kwd ) )
if operation == "user_per_month":
# The received id is the job id, so we need to get the id of the user
# that submitted the job.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'email' ] = None # For anonymous users
if job.history:
if job.history.user:
email = job.history.user.email
kwd[ 'email' ] = email
# TODO: handle libraries
return trans.response.send_redirect( web.url_for( controller='jobs',
action='user_per_month',
**kwd ) )
return self.specified_date_in_error_list_grid( trans, **kwd )
@web.expose
def specified_month_all( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
message = ''
monitor_email = params.get( 'monitor_email', 'monitor@bx.psu.edu' )
year, month = map( int, params.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
month_label = start_date.strftime( "%B" )
year_label = start_date.strftime( "%Y" )
q = sa.select( ( sa.func.date( galaxy.model.Job.table.c.create_time ).label( 'date' ),
sa.func.sum( sa.case( [( galaxy.model.User.table.c.email == monitor_email, 1 )], else_=0 ) ).label( 'monitor_jobs' ),
sa.func.count( galaxy.model.Job.table.c.id ).label( 'total_jobs' ) ),
whereclause = sa.and_( galaxy.model.Job.table.c.create_time >= start_date,
galaxy.model.Job.table.c.create_time < end_date ),
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
galaxy.model.History.table ).outerjoin( galaxy.model.User.table ) ],
q = sa.select( ( sa.func.date( model.Job.table.c.create_time ).label( 'date' ),
sa.func.sum( sa.case( [ ( model.User.table.c.email == monitor_email, 1 ) ], else_=0 ) ).label( 'monitor_jobs' ),
sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ),
whereclause = sa.and_( model.Job.table.c.create_time >= start_date,
model.Job.table.c.create_time < end_date ),
from_obj = [ sa.outerjoin( model.Job.table,
model.History.table ).outerjoin( model.User.table ) ],
group_by = [ 'date' ],
order_by = [ sa.desc( 'date' ) ] )
jobs = []
@@ -74,28 +244,28 @@ class Jobs( BaseController ):
row.monitor_jobs,
row.total_jobs,
row.date.strftime( "%d" ) ) )
return trans.fill_template( 'jobs_specified_month_all.mako',
return trans.fill_template( '/webapps/reports/jobs_specified_month_all.mako',
month_label=month_label,
year_label=year_label,
month=month,
jobs=jobs,
msg=msg )
message=message )
@web.expose
def specified_month_in_error( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
message = ''
year, month = map( int, params.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
month_label = start_date.strftime( "%B" )
year_label = start_date.strftime( "%Y" )
q = sa.select( ( sa.func.date( galaxy.model.Job.table.c.create_time ).label( 'date' ),
sa.func.count( galaxy.model.Job.table.c.id ).label( 'total_jobs' ) ),
whereclause = sa.and_( galaxy.model.Job.table.c.state == 'error',
galaxy.model.Job.table.c.create_time >= start_date,
galaxy.model.Job.table.c.create_time < end_date ),
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
galaxy.model.History.table ).outerjoin( galaxy.model.User.table ) ],
q = 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.state == 'error',
model.Job.table.c.create_time >= start_date,
model.Job.table.c.create_time < end_date ),
from_obj = [ sa.outerjoin( model.Job.table,
model.History.table ).outerjoin( model.User.table ) ],
group_by = [ 'date' ],
order_by = [ sa.desc( 'date' ) ] )
jobs = []
@@ -104,189 +274,55 @@ class Jobs( BaseController ):
row.date,
row.total_jobs,
row.date.strftime( "%d" ) ) )
return trans.fill_template( 'jobs_specified_month_in_error.mako',
return trans.fill_template( '/webapps/reports/jobs_specified_month_in_error.mako',
month_label=month_label,
year_label=year_label,
month=month,
jobs=jobs,
msg=msg )
@web.expose
def specified_date_in_error( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
year, month, day = map( int, params.get( 'specified_date', datetime.utcnow().strftime( "%Y-%m-%d" ) ).split( "-" ) )
start_date = date( year, month, day )
end_date = start_date + timedelta( days=1 )
day_label = start_date.strftime( "%A" )
month_label = start_date.strftime( "%B" )
year_label = start_date.strftime( "%Y" )
day_of_month = start_date.strftime( "%d" )
q = sa.select( ( galaxy.model.Job.table.c.id,
galaxy.model.Job.table.c.state,
galaxy.model.Job.table.c.create_time,
galaxy.model.Job.table.c.update_time,
galaxy.model.Job.table.c.tool_id,
galaxy.model.Job.table.c.command_line,
galaxy.model.Job.table.c.stderr,
galaxy.model.Job.table.c.session_id,
( galaxy.model.Job.table.c.traceback ).label( 'stack_trace' ),
galaxy.model.Job.table.c.info,
( galaxy.model.User.table.c.email ).label( 'user_email' ),
galaxy.model.GalaxySession.table.c.remote_addr ),
whereclause = sa.and_( galaxy.model.Job.table.c.state == 'error',
galaxy.model.Job.table.c.create_time >= start_date,
galaxy.model.Job.table.c.create_time < end_date ),
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
galaxy.model.History.table ) \
.outerjoin( galaxy.model.User.table ) \
.outerjoin( galaxy.model.GalaxySession.table,
galaxy.model.Job.table.c.session_id == galaxy.model.GalaxySession.table.c.id ) ],
order_by = [ sa.desc( galaxy.model.Job.table.c.id ) ] )
jobs = []
for row in q.execute():
remote_host = row.remote_addr
if row.remote_addr:
try:
remote_host = socket.gethostbyaddr( row.remote_addr )[0]
except:
pass
jobs.append( ( row.state,
row.id,
row.create_time,
row.update_time,
row.session_id,
row.tool_id,
row.user_email,
remote_host,
row.command_line,
row.stderr,
row.stack_trace,
row.info ) )
return trans.fill_template( 'jobs_specified_date_in_error.mako',
specified_date=start_date,
day_label=day_label,
month_label=month_label,
year_label=year_label,
day_of_month=day_of_month,
jobs=jobs,
msg=msg )
@web.expose
def specified_date_all( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
monitor_email = params.get( 'monitor_email', 'monitor@bx.psu.edu' )
year, month, day = map( int, params.get( 'specified_date', datetime.utcnow().strftime( "%Y-%m-%d" ) ).split( "-" ) )
start_date = date( year, month, day )
end_date = start_date + timedelta( days=1 )
day_label = start_date.strftime( "%A" )
month_label = start_date.strftime( "%B" )
year_label = start_date.strftime( "%Y" )
day_of_month = start_date.strftime( "%d" )
q = sa.select( ( galaxy.model.Job.table.c.id,
galaxy.model.Job.table.c.state,
galaxy.model.Job.table.c.create_time,
galaxy.model.Job.table.c.update_time,
galaxy.model.Job.table.c.tool_id,
galaxy.model.Job.table.c.command_line,
galaxy.model.Job.table.c.stderr,
galaxy.model.Job.table.c.session_id,
( galaxy.model.Job.table.c.traceback ).label( 'stack_trace' ),
galaxy.model.Job.table.c.info,
( galaxy.model.User.table.c.email ).label( 'user_email' ),
galaxy.model.GalaxySession.table.c.remote_addr ),
whereclause = sa.and_( galaxy.model.Job.table.c.create_time >= start_date,
galaxy.model.Job.table.c.create_time < end_date ),
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
galaxy.model.History.table ) \
.outerjoin( galaxy.model.User.table ) \
.outerjoin( galaxy.model.GalaxySession.table,
galaxy.model.Job.table.c.session_id == galaxy.model.GalaxySession.table.c.id ) ],
order_by = [ sa.desc( galaxy.model.Job.table.c.id ) ] )
jobs = []
for row in q.execute():
remote_host = row.remote_addr
if row.remote_addr:
try:
remote_host = socket.gethostbyaddr( row.remote_addr )[0]
except:
pass
jobs.append( ( row.state,
row.id,
row.create_time,
row.update_time,
row.session_id,
row.tool_id,
row.user_email,
remote_host,
row.command_line,
row.stderr,
row.stack_trace,
row.info ) )
return trans.fill_template( 'jobs_specified_date_all.mako',
specified_date=start_date,
day_label=day_label,
month_label=month_label,
year_label=year_label,
day_of_month=day_of_month,
jobs=jobs,
msg=msg )
message=message )
@web.expose
def all_unfinished( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
jobs = []
q = sa.select( ( galaxy.model.Job.table.c.id,
galaxy.model.Job.table.c.state,
galaxy.model.Job.table.c.create_time,
galaxy.model.Job.table.c.update_time,
galaxy.model.Job.table.c.tool_id,
galaxy.model.Job.table.c.command_line,
galaxy.model.Job.table.c.stderr,
galaxy.model.Job.table.c.session_id,
( galaxy.model.Job.table.c.traceback ).label( 'stack_trace' ),
galaxy.model.Job.table.c.info,
( galaxy.model.User.table.c.email ).label( 'user_email' ),
galaxy.model.GalaxySession.table.c.remote_addr ),
whereclause = sa.not_( sa.or_( galaxy.model.Job.table.c.state == 'ok',
galaxy.model.Job.table.c.state == 'error',
galaxy.model.Job.table.c.state == 'deleted' ) ),
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
galaxy.model.History.table ) \
.outerjoin( galaxy.model.User.table ) \
.outerjoin( galaxy.model.GalaxySession.table,
galaxy.model.Job.table.c.session_id == galaxy.model.GalaxySession.table.c.id ) ],
order_by = [ sa.desc( galaxy.model.Job.table.c.id ) ] )
for row in q.execute():
remote_host = row.remote_addr
if row.remote_addr:
try:
remote_host = socket.gethostbyaddr( row.remote_addr )[0]
except:
pass
jobs.append( ( row.state,
row.id,
row.create_time,
row.update_time,
row.session_id,
row.tool_id,
row.user_email,
remote_host,
row.command_line,
row.stderr,
row.stack_trace,
row.info ) )
return trans.fill_template( 'jobs_all_unfinished.mako', jobs=jobs, msg=msg )
if 'operation' in kwd:
operation = kwd['operation'].lower()
if operation == "job_info":
return trans.response.send_redirect( web.url_for( controller='jobs',
action='job_info',
**kwd ) )
if operation == "tool_per_month":
# The received id is the job id, so we need to get the id of the user
# that submitted the job.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'tool_id' ] = job.tool_id
return trans.response.send_redirect( web.url_for( controller='jobs',
action='tool_per_month',
**kwd ) )
if operation == "user_per_month":
# The received id is the job id, so we need to get the id of the user
# that submitted the job.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'email' ] = None # For anonymous users
if job.history:
if job.history.user:
email = job.history.user.email
kwd[ 'email' ] = email
# TODO: handle libraries
return trans.response.send_redirect( web.url_for( controller='jobs',
action='user_per_month',
**kwd ) )
return self.all_unfinished_list_grid( trans, **kwd )
@web.expose
def per_month_all( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
message = ''
monitor_email = params.get( 'monitor_email', 'monitor@bx.psu.edu' )
q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( galaxy.model.Job.table.c.create_time ) ).label( 'date' ),
sa.func.sum( sa.case( [( galaxy.model.User.table.c.email == monitor_email, 1 )], else_=0 ) ).label( 'monitor_jobs' ),
sa.func.count( galaxy.model.Job.table.c.id ).label( 'total_jobs' ) ),
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
galaxy.model.History.table ).outerjoin( galaxy.model.User.table ) ],
group_by = [ sa.func.date_trunc( 'month', sa.func.date( galaxy.model.Job.table.c.create_time ) ) ],
q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ).label( 'date' ),
sa.func.sum( sa.case( [( model.User.table.c.email == monitor_email, 1 )], else_=0 ) ).label( 'monitor_jobs' ),
sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ),
from_obj = [ sa.outerjoin( model.Job.table,
model.History.table ).outerjoin( model.User.table ) ],
group_by = [ sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ) ],
order_by = [ sa.desc( 'date' ) ] )
jobs = []
for row in q.execute():
@@ -296,16 +332,16 @@ class Jobs( BaseController ):
row.total_jobs,
row.date.strftime( "%B" ),
row.date.strftime( "%Y" ) ) )
return trans.fill_template( 'jobs_per_month_all.mako', jobs=jobs, msg=msg )
return trans.fill_template( '/webapps/reports/jobs_per_month_all.mako', jobs=jobs, message=message )
@web.expose
def per_month_in_error( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( galaxy.model.Job.table.c.create_time ) ).label( 'date' ),
sa.func.count( galaxy.model.Job.table.c.id ).label( 'total_jobs' ) ),
whereclause = galaxy.model.Job.table.c.state == 'error',
from_obj = [ galaxy.model.Job.table ],
group_by = [ sa.func.date_trunc( 'month', sa.func.date( galaxy.model.Job.table.c.create_time ) ) ],
message = ''
q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ).label( 'date' ),
sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ),
whereclause = model.Job.table.c.state == 'error',
from_obj = [ model.Job.table ],
group_by = [ sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ) ],
order_by = [ sa.desc( 'date' ) ] )
jobs = []
for row in q.execute():
@@ -313,36 +349,36 @@ class Jobs( BaseController ):
row.total_jobs,
row.date.strftime( "%B" ),
row.date.strftime( "%Y" ) ) )
return trans.fill_template( 'jobs_per_month_in_error.mako', jobs=jobs, msg=msg )
return trans.fill_template( '/webapps/reports/jobs_per_month_in_error.mako', jobs=jobs, message=message )
@web.expose
def per_user( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
message = ''
jobs = []
q = sa.select( ( galaxy.model.User.table.c.email.label( 'user_email' ),
sa.func.count( galaxy.model.Job.table.c.id ).label( 'total_jobs' ) ),
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
galaxy.model.GalaxySession.table ).outerjoin( galaxy.model.User.table ) ],
q = sa.select( ( model.User.table.c.email.label( 'user_email' ),
sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ),
from_obj = [ sa.outerjoin( model.Job.table,
model.GalaxySession.table ).outerjoin( model.User.table ) ],
group_by = [ 'user_email' ],
order_by = [ sa.desc( 'total_jobs' ), 'user_email' ] )
for row in q.execute():
jobs.append( ( row.user_email,
row.total_jobs ) )
return trans.fill_template( 'jobs_per_user.mako', jobs=jobs, msg=msg )
return trans.fill_template( '/webapps/reports/jobs_per_user.mako', jobs=jobs, message=message )
@web.expose
def user_per_month( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
email = params.get( 'email', None )
if email is not None:
# The @ char has been converted to an 'X'
email = email.replace( 'X', '@' )
q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( galaxy.model.Job.table.c.create_time ) ).label( 'date' ),
sa.func.count( galaxy.model.Job.table.c.id ).label( 'total_jobs' ) ),
whereclause = galaxy.model.User.table.c.email == email,
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
galaxy.model.GalaxySession.table ).outerjoin( galaxy.model.User.table ) ],
group_by = [ sa.func.date_trunc( 'month', sa.func.date( galaxy.model.Job.table.c.create_time ) ) ],
message = ''
email = util.restore_text( params.get( 'email', '' ) )
q = sa.select( ( sa.func.date_trunc( 'month', 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.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.GalaxySession.table ).join( model.User.table ) ],
group_by = [ sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ) ],
order_by = [ sa.desc( 'date' ) ] )
jobs = []
for row in q.execute():
@@ -350,92 +386,65 @@ class Jobs( BaseController ):
row.total_jobs,
row.date.strftime( "%B" ),
row.date.strftime( "%Y" ) ) )
return trans.fill_template( 'jobs_user_per_month.mako', email=email, jobs=jobs, msg=msg )
return trans.fill_template( '/webapps/reports/jobs_user_per_month.mako',
email=util.sanitize_text( email ),
jobs=jobs, message=message )
@web.expose
def user_for_month( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
email = params.get( 'email', None )
if email is not None:
# The @ char has been converted to an 'X'
email = email.replace( 'X', '@' )
year, month = map( int, params.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
month_label = start_date.strftime( "%B" )
year_label = start_date.strftime( "%Y" )
jobs = []
q = sa.select( ( galaxy.model.Job.table.c.id,
galaxy.model.Job.table.c.state,
galaxy.model.Job.table.c.create_time,
galaxy.model.Job.table.c.update_time,
galaxy.model.Job.table.c.tool_id,
galaxy.model.Job.table.c.command_line,
galaxy.model.Job.table.c.stderr,
galaxy.model.Job.table.c.session_id,
( galaxy.model.Job.table.c.traceback ).label( 'stack_trace' ),
galaxy.model.Job.table.c.info,
( galaxy.model.User.table.c.email ).label( 'user_email' ),
galaxy.model.GalaxySession.table.c.remote_addr ),
whereclause = sa.and_( galaxy.model.User.table.c.email == email,
galaxy.model.Job.table.c.create_time >= start_date,
galaxy.model.Job.table.c.create_time < end_date ),
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
galaxy.model.History.table ) \
.outerjoin( galaxy.model.User.table ) \
.outerjoin( galaxy.model.GalaxySession.table,
galaxy.model.Job.table.c.session_id == galaxy.model.GalaxySession.table.c.id ) ],
order_by = [ sa.desc( galaxy.model.Job.table.c.id ) ] )
for row in q.execute():
remote_host = row.remote_addr
if row.remote_addr:
try:
remote_host = socket.gethostbyaddr( row.remote_addr )[0]
except:
pass
jobs.append( ( row.state,
row.id,
row.create_time,
row.update_time,
row.session_id,
row.tool_id,
row.user_email,
remote_host,
row.command_line,
row.stderr,
row.stack_trace,
row.info ) )
return trans.fill_template( 'jobs_user_for_month.mako',
email=email,
month=month,
month_label=month_label,
year_label=year_label,
jobs=jobs,
msg=msg )
if 'operation' in kwd:
operation = kwd['operation'].lower()
if operation == "job_info":
return trans.response.send_redirect( web.url_for( controller='jobs',
action='job_info',
**kwd ) )
if operation == "tool_per_month":
# The received id is the job id, so we need to get the id of the user
# that submitted the job.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'tool_id' ] = job.tool_id
return trans.response.send_redirect( web.url_for( controller='jobs',
action='tool_per_month',
**kwd ) )
if operation == "user_per_month":
# The received id is the job id, so we need to get the id of the user
# that submitted the job.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'email' ] = None # For anonymous users
if job.history:
if job.history.user:
email = job.history.user.email
kwd[ 'email' ] = email
# TODO: handle libraries
return trans.response.send_redirect( web.url_for( controller='jobs',
action='user_per_month',
**kwd ) )
return self.user_for_month_list_grid( trans, **kwd )
@web.expose
def per_tool( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
message = ''
jobs = []
q = sa.select( ( galaxy.model.Job.table.c.tool_id.label( 'tool_id' ),
sa.func.count( galaxy.model.Job.table.c.id ).label( 'total_jobs' ) ),
from_obj = [ galaxy.model.Job.table ],
q = sa.select( ( model.Job.table.c.tool_id.label( 'tool_id' ),
sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ),
from_obj = [ model.Job.table ],
group_by = [ 'tool_id' ],
order_by = [ 'tool_id' ] )
for row in q.execute():
jobs.append( ( row.tool_id,
row.total_jobs ) )
return trans.fill_template( 'jobs_per_tool.mako', jobs=jobs, msg=msg )
return trans.fill_template( '/webapps/reports/jobs_per_tool.mako', jobs=jobs, message=message )
@web.expose
def tool_per_month( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
message = ''
tool_id = params.get( 'tool_id', 'Add a column1' )
q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( galaxy.model.Job.table.c.create_time ) ).label( 'date' ),
sa.func.count( galaxy.model.Job.table.c.id ).label( 'total_jobs' ) ),
whereclause = galaxy.model.Job.table.c.tool_id == tool_id,
from_obj = [ galaxy.model.Job.table ],
group_by = [ sa.func.date_trunc( 'month', sa.func.date( galaxy.model.Job.table.c.create_time ) ) ],
q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ).label( 'date' ),
sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ),
whereclause = model.Job.table.c.tool_id == tool_id,
from_obj = [ model.Job.table ],
group_by = [ sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ) ],
order_by = [ sa.desc( 'date' ) ] )
jobs = []
for row in q.execute():
@@ -443,71 +452,58 @@ class Jobs( BaseController ):
row.total_jobs,
row.date.strftime( "%B" ),
row.date.strftime( "%Y" ) ) )
return trans.fill_template( 'jobs_tool_per_month.mako', tool_id=tool_id, jobs=jobs, msg=msg )
return trans.fill_template( '/webapps/reports/jobs_tool_per_month.mako', tool_id=tool_id, jobs=jobs, message=message )
@web.expose
def tool_for_month( self, trans, **kwd ):
if 'operation' in kwd:
operation = kwd['operation'].lower()
if operation == "job_info":
return trans.response.send_redirect( web.url_for( controller='jobs',
action='job_info',
**kwd ) )
if operation == "tool_per_month":
# The received id is the job id, so we need to get the id of the user
# that submitted the job.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'tool_id' ] = job.tool_id
return trans.response.send_redirect( web.url_for( controller='jobs',
action='tool_per_month',
**kwd ) )
if operation == "user_per_month":
# The received id is the job id, so we need to get the id of the user
# that submitted the job.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'email' ] = None # For anonymous users
if job.history:
if job.history.user:
email = job.history.user.email
kwd[ 'email' ] = email
# TODO: handle libraries
return trans.response.send_redirect( web.url_for( controller='jobs',
action='user_per_month',
**kwd ) )
return self.tool_for_month_list_grid( trans, **kwd )
@web.expose
def job_info( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
tool_id = params.get( 'tool_id', 'Add a column1' )
year, month = map( int, params.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
month_label = start_date.strftime( "%B" )
year_label = start_date.strftime( "%Y" )
jobs = []
q = sa.select( ( galaxy.model.Job.table.c.id,
galaxy.model.Job.table.c.state,
galaxy.model.Job.table.c.create_time,
galaxy.model.Job.table.c.update_time,
galaxy.model.Job.table.c.tool_id,
galaxy.model.Job.table.c.command_line,
galaxy.model.Job.table.c.stderr,
galaxy.model.Job.table.c.session_id,
( galaxy.model.Job.table.c.traceback ).label( 'stack_trace' ),
galaxy.model.Job.table.c.info,
( galaxy.model.User.table.c.email ).label( 'user_email' ),
galaxy.model.GalaxySession.table.c.remote_addr ),
whereclause = sa.and_( galaxy.model.Job.table.c.tool_id == tool_id,
galaxy.model.Job.table.c.create_time >= start_date,
galaxy.model.Job.table.c.create_time < end_date ),
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
galaxy.model.History.table ) \
.outerjoin( galaxy.model.User.table ) \
.outerjoin( galaxy.model.GalaxySession.table,
galaxy.model.Job.table.c.session_id == galaxy.model.GalaxySession.table.c.id ) ],
order_by = [ sa.desc( galaxy.model.Job.table.c.id ) ] )
for row in q.execute():
remote_host = row.remote_addr
if row.remote_addr:
try:
remote_host = socket.gethostbyaddr( row.remote_addr )[0]
except:
pass
jobs.append( ( row.state,
row.id,
row.create_time,
row.update_time,
row.session_id,
row.tool_id,
row.user_email,
remote_host,
row.command_line,
row.stderr,
row.stack_trace,
row.info ) )
return trans.fill_template( 'jobs_tool_for_month.mako',
tool_id=tool_id,
month=month,
month_label=month_label,
year_label=year_label,
jobs=jobs,
msg=msg )
message = ''
job_id = trans.security.decode_id( kwd.get( 'id', '' ) )
job_info = trans.sa_session.query( model.Job.table.join( model.GalaxySession.table ).join( model.User.table ) ) \
.filter( and_( model.Job.table.c.id == job_id,
model.Job.table.c.session_id == model.GalaxySession.table.c.id,
model.GalaxySession.table.c.user_id == model.User.table.c.id ) ) \
.one()
# TODO: for some reason the job_info.id is not the same as job_id in the template, so we need to pass job_id
# This needs to be fixed ASAP!
return trans.fill_template( '/webapps/reports/job_info.mako', job_id=job_id, job_info=job_info, message=message )
@web.expose
def per_domain( self, trans, **kwd ):
# TODO: rewrite using alchemy
params = util.Params( kwd )
msg = ''
engine = galaxy.model.mapping.metadata.engine
message = ''
engine = model.mapping.metadata.engine
jobs = []
s = """
SELECT
@@ -542,4 +538,9 @@ class Jobs( BaseController ):
job_rows = engine.text( s ).execute().fetchall()
for job in job_rows:
jobs.append( ( job.domain, job.total_jobs ) )
return trans.fill_template( 'jobs_per_domain.mako', jobs=jobs, msg=msg )
return trans.fill_template( '/webapps/reports/jobs_per_domain.mako', jobs=jobs, message=message )
## ---- Utility methods -------------------------------------------------------
def get_job( trans, id ):
return trans.sa_session.query( trans.model.Job ).get( trans.security.decode_id( id ) )
+2 -18
View File
@@ -1,24 +1,8 @@
import sys, os, operator, string, shutil, re, socket, urllib, time
from galaxy import web
from cgi import escape, FieldStorage
from galaxy.webapps.reports.base.controller import *
from galaxy.web.base.controller import *
import logging
log = logging.getLogger( __name__ )
class Report( BaseController ):
@web.expose
def index( self, trans, **kwd ):
return trans.fill_template( 'index.mako' )
@web.expose
def masthead( self, trans ):
brand = trans.app.config.get( "brand", "" )
if brand:
brand ="<span class='brand'>/%s</span>" % brand
wiki_url = trans.app.config.get( "wiki_url", "http://bitbucket.org/galaxy/galaxy-central/wiki/Home" )
bugs_email = trans.app.config.get( "bugs_email", "mailto:galaxy-bugs@bx.psu.edu" )
screencasts_url = trans.app.config.get( "screencasts_url", "http://galaxycast.org" )
return trans.fill_template( "masthead.mako",
brand=brand,
wiki_url=wiki_url,
bugs_email=bugs_email,
screencasts_url=screencasts_url )
return trans.fill_template( '/webapps/reports/index.mako' )
@@ -1,10 +1,12 @@
import operator, os
from datetime import datetime, timedelta
from galaxy.webapps.reports.base.controller import *
import pkg_resources
pkg_resources.require( "SQLAlchemy >= 0.4" )
from sqlalchemy.orm import eagerload
from sqlalchemy import desc
from galaxy.web.base.controller import *
#import pkg_resources
#pkg_resources.require( "SQLAlchemy >= 0.4" )
#from sqlalchemy.orm import eagerload
#from sqlalchemy import desc
from galaxy import model
from galaxy.model.orm import *
import logging
log = logging.getLogger( __name__ )
@@ -12,32 +14,28 @@ class System( BaseController ):
@web.expose
def index( self, trans, **kwd ):
params = util.Params( kwd )
msg = ''
message = ''
if params.userless_histories_days:
userless_histories_days = params.userless_histories_days
else:
userless_histories_days = '60'
if params.deleted_histories_days:
deleted_histories_days = params.deleted_histories_days
else:
deleted_histories_days = '60'
if params.deleted_datasets_days:
deleted_datasets_days = params.deleted_datasets_days
else:
deleted_datasets_days = '60'
file_path, disk_usage, datasets, file_size_str = self.disk_usage( trans, **kwd )
if 'action' in kwd:
if kwd['action'] == "userless_histories":
userless_histories_days, msg = self.userless_histories( **kwd )
userless_histories_days, message = self.userless_histories( trans, **kwd )
elif kwd['action'] == "deleted_histories":
deleted_histories_days, msg = self.deleted_histories( **kwd )
deleted_histories_days, message = self.deleted_histories( trans, **kwd )
elif kwd['action'] == "deleted_datasets":
deleted_datasets_days, msg = self.deleted_datasets( **kwd )
return trans.fill_template( 'system.mako',
deleted_datasets_days, message = self.deleted_datasets( trans, **kwd )
return trans.fill_template( '/webapps/reports/system.mako',
file_path=file_path,
disk_usage=disk_usage,
datasets=datasets,
@@ -45,49 +43,54 @@ class System( BaseController ):
userless_histories_days=userless_histories_days,
deleted_histories_days=deleted_histories_days,
deleted_datasets_days=deleted_datasets_days,
msg=msg )
message=message )
def userless_histories( self, **kwd ):
def userless_histories( self, trans, **kwd ):
"""The number of userless histories and associated datasets that have not been updated for the specified number of days."""
params = util.Params( kwd )
msg = ''
message = ''
if params.userless_histories_days:
userless_histories_days = int( params.userless_histories_days )
cutoff_time = datetime.utcnow() - timedelta( days=userless_histories_days )
history_count = 0
dataset_count = 0
h = self.app.model.History
where = ( h.table.c.user_id==None ) & ( h.table.c.deleted=='f' ) & ( h.table.c.update_time < cutoff_time )
histories = h.query().filter( where ).options( eagerload( 'datasets' ) )
#h = self.app.model.History
#where = ( h.table.c.user_id==None ) & ( h.table.c.deleted=='f' ) & ( h.table.c.update_time < cutoff_time )
#histories = h.query().filter( where ).options( eagerload( 'datasets' ) )
for history in histories:
#for history in histories:
for history in trans.sa_session.query( model.History ) \
.filter( and_( model.History.table.c.user_id == None,
model.History.table.c.deleted == True,
model.History.table.c.update_time < cutoff_time ) ):
for dataset in history.datasets:
if not dataset.deleted:
dataset_count += 1
history_count += 1
msg = "%d userless histories ( including a total of %d datasets ) have not been updated for at least %d days." %( history_count, dataset_count, userless_histories_days )
message = "%d userless histories ( including a total of %d datasets ) have not been updated for at least %d days." %( history_count, dataset_count, userless_histories_days )
else:
msg = "Enter the number of days."
return str( userless_histories_days ), msg
message = "Enter the number of days."
return str( userless_histories_days ), message
def deleted_histories( self, **kwd ):
def deleted_histories( self, trans, **kwd ):
"""
The number of histories that were deleted more than the specified number of days ago, but have not yet been purged.
Also included is the number of datasets associated with the histories.
"""
params = util.Params( kwd )
msg = ''
message = ''
if params.deleted_histories_days:
deleted_histories_days = int( params.deleted_histories_days )
cutoff_time = datetime.utcnow() - timedelta( days=deleted_histories_days )
history_count = 0
dataset_count = 0
disk_space = 0
h = self.app.model.History
d = self.app.model.Dataset
where = ( h.table.c.deleted=='t' ) & ( h.table.c.purged=='f' ) & ( h.table.c.update_time < cutoff_time )
histories = h.query().filter( where ).options( eagerload( 'datasets' ) )
histories = trans.sa_session.query( model.History ) \
.filter( and_( model.History.table.c.deleted == True,
model.History.table.c.purged == False,
model.History.table.c.update_time < cutoff_time ) ) \
.options( eagerload( 'datasets' ) )
for history in histories:
for hda in history.datasets:
if not hda.dataset.purged:
@@ -97,42 +100,39 @@ class System( BaseController ):
except:
pass
history_count += 1
msg = "%d histories ( including a total of %d datasets ) were deleted more than %d days ago, but have not yet been purged. Disk space: " %( history_count, dataset_count, deleted_histories_days ) + str( disk_space )
message = "%d histories ( including a total of %d datasets ) were deleted more than %d days ago, but have not yet been purged. Disk space: " %( history_count, dataset_count, deleted_histories_days ) + str( disk_space )
else:
msg = "Enter the number of days."
return str( deleted_histories_days ), msg
message = "Enter the number of days."
return str( deleted_histories_days ), message
def deleted_datasets( self, **kwd ):
def deleted_datasets( self, trans, **kwd ):
"""The number of datasets that were deleted more than the specified number of days ago, but have not yet been purged."""
params = util.Params( kwd )
msg = ''
message = ''
if params.deleted_datasets_days:
deleted_datasets_days = int( params.deleted_datasets_days )
cutoff_time = datetime.utcnow() - timedelta( days=deleted_datasets_days )
dataset_count = 0
disk_space = 0
d = self.app.model.Dataset
where = ( d.table.c.deleted=='t' ) & ( d.table.c.purged=='f' ) & ( d.table.c.update_time < cutoff_time )
datasets = d.query().filter( where )
for dataset in datasets:
for dataset in trans.sa_session.query( model.Dataset ) \
.filter( and_( model.Dataset.table.c.deleted == True,
model.Dataset.table.c.purged == False,
model.Dataset.table.c.update_time < cutoff_time ) ):
dataset_count += 1
try:
disk_space += dataset.file_size
except:
pass
msg = str( dataset_count ) + " datasets were deleted more than " + str( deleted_datasets_days ) + \
message = str( dataset_count ) + " datasets were deleted more than " + str( deleted_datasets_days ) + \
" days ago, but have not yet been purged, disk space: " + str( disk_space ) + "."
else:
msg = "Enter the number of days."
return str( deleted_datasets_days ), msg
message = "Enter the number of days."
return str( deleted_datasets_days ), message
def get_disk_usage( self, file_path ):
df_cmd = 'df -h ' + file_path
is_sym_link = os.path.islink( file_path )
file_system = disk_size = disk_used = disk_avail = disk_cap_pct = mount = None
df_file = os.popen( df_cmd )
while True:
df_line = df_file.readline()
df_line = df_line.strip()
@@ -159,22 +159,17 @@ class System( BaseController ):
break # EOF
df_file.close()
return ( file_system, disk_size, disk_used, disk_avail, disk_cap_pct, mount )
@web.expose
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
file_size_str = nice_size( min_file_size )
hda = trans.model.HistoryDatasetAssociation
d = trans.model.Dataset
datasets = []
where = ( d.table.c.file_size > min_file_size )
dataset_rows = d.query().filter( where ).order_by( desc( d.table.c.file_size ) )
for dataset in dataset_rows:
history_dataset_assoc = hda.filter_by( dataset_id=dataset.id ).order_by( desc( hda.table.c.history_id ) ).all()[0]
datasets.append( ( dataset.id, str( dataset.update_time )[0:10], history_dataset_assoc.history_id, dataset.deleted, dataset.file_size ) )
for dataset in trans.sa_session.query( model.Dataset ) \
.filter( model.Dataset.table.c.file_size > min_file_size ) \
.order_by( desc( model.Dataset.table.c.file_size ) ):
datasets.append( ( dataset.id, str( dataset.update_time )[0:10], dataset.history.history_id, dataset.deleted, dataset.file_size ) )
return file_path, disk_usage, datasets, file_size_str
def nice_size( size ):
@@ -191,4 +186,3 @@ def nice_size( size ):
out = "%.1f %s" % ( size, word )
return out
return '??? bytes'
+14 -19
View File
@@ -1,7 +1,7 @@
from datetime import *
from time import strftime
import calendar, operator
from galaxy.webapps.reports.base.controller import *
from galaxy.web.base.controller import *
import galaxy.model
from galaxy.model.orm import *
import pkg_resources
@@ -12,20 +12,15 @@ log = logging.getLogger( __name__ )
class Users( BaseController ):
@web.expose
def index( self, trans, **kwd ):
params = util.Params( kwd )
msg = params.get( 'msg', '' )
return trans.fill_template( 'users.mako', msg=msg )
@web.expose
def registered_users( self, trans, **kwd ):
params = util.Params( kwd )
msg = params.get( 'msg', '' )
message = params.get( 'message', '' )
num_users = trans.sa_session.query( galaxy.model.User ).count()
return trans.fill_template( 'registered_users.mako', num_users=num_users, msg=msg )
return trans.fill_template( '/webapps/reports/registered_users.mako', num_users=num_users, message=message )
@web.expose
def registered_users_per_month( self, trans, **kwd ):
params = util.Params( kwd )
msg = params.get( 'msg', '' )
message = params.get( 'message', '' )
q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( galaxy.model.User.table.c.create_time ) ).label( 'date' ),
sa.func.count( galaxy.model.User.table.c.id ).label( 'num_users' ) ),
from_obj = [ galaxy.model.User.table ],
@@ -37,11 +32,11 @@ class Users( BaseController ):
row.num_users,
row.date.strftime( "%B" ),
row.date.strftime( "%Y" ) ) )
return trans.fill_template( 'registered_users_per_month.mako', users=users, msg=msg )
return trans.fill_template( '/webapps/reports/registered_users_per_month.mako', users=users, message=message )
@web.expose
def specified_month( self, trans, **kwd ):
params = util.Params( kwd )
msg = params.get( 'msg', '' )
message = params.get( 'message', '' )
year, month = map( int, params.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
@@ -60,16 +55,16 @@ class Users( BaseController ):
row.date.strftime( "%d" ),
row.num_users,
row.date.strftime( "%A" ) ) )
return trans.fill_template( 'registered_users_specified_month.mako',
return trans.fill_template( '/webapps/reports/registered_users_specified_month.mako',
month_label=month_label,
year_label=year_label,
month=month,
users=users,
msg=msg )
message=message )
@web.expose
def specified_date( self, trans, **kwd ):
params = util.Params( kwd )
msg = params.get( 'msg', '' )
message = params.get( 'message', '' )
year, month, day = map( int, params.get( 'specified_date', datetime.utcnow().strftime( "%Y-%m-%d" ) ).split( "-" ) )
start_date = date( year, month, day )
end_date = start_date + timedelta( days=1 )
@@ -86,18 +81,18 @@ class Users( BaseController ):
users = []
for row in q.execute():
users.append( ( row.email ) )
return trans.fill_template( 'registered_users_specified_date.mako',
return trans.fill_template( '/webapps/reports/registered_users_specified_date.mako',
specified_date=start_date,
day_label=day_label,
month_label=month_label,
year_label=year_label,
day_of_month=day_of_month,
users=users,
msg=msg )
message=message )
@web.expose
def last_access_date( self, trans, **kwd ):
params = util.Params( kwd )
msg = params.get( 'msg', '' )
message = params.get( 'message', '' )
not_logged_in_for_days = params.get( 'not_logged_in_for_days', 90 )
if not not_logged_in_for_days:
not_logged_in_for_days = 0
@@ -115,7 +110,7 @@ class Users( BaseController ):
# The user has never logged in
users.append( ( user.email, "never logged in" ) )
users = sorted( users, key=operator.itemgetter( 1 ), reverse=True )
return trans.fill_template( 'users_last_access_date.mako',
return trans.fill_template( '/webapps/reports/users_last_access_date.mako',
users=users,
not_logged_in_for_days=not_logged_in_for_days,
msg=msg )
message=message )
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 961 B

@@ -1,284 +0,0 @@
@import url( "reset.css" );
body
{
font: 75% verdana, "Bitstream Vera Sans", geneva, arial, helvetica, helve, sans-serif;
background: $base_bg_bottom;
color: $base_text;
background-image: url(base_bg.png);
background-repeat: repeat-x;
background-position: top;
margin: 10px;
}
a:link, a:visited, a:active
{
color: $link_text;
}
h1, h2, h3, h4
{
color: $header_text;
/*text-shadow: #bbb 2px 2px 1px;*/
}
hr
{
border: none;
border-bottom: dotted $base_text 1px;
}
div.report
{
border: solid $report_border 1px;
}
div.reportTitle
{
font-weight: bold;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
background: $report_title_bg_bottom;
background-image: url(report_title_bg.png);
background-repeat: repeat-x;
background-position: top;
border-bottom: solid $report_border 1px;
}
div.reportParamHelp
{
color: #666;
}
div.reportParamHelp a
{
color: #666;
}
div.reportBody
{
background: $report_body_bg_bottom;
background-image: url(report_body_bg.png);
background-repeat: repeat-x;
background-position: top;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
}
div.reportBody div.reportTitle
{
background: transparent;
border: none;
font-weight: bold;
border-bottom: solid $report_border 1px;
margin-bottom: 5px;
}
div.reportDisabled div.reportTitle {
background: ${layout_bg};
border-color: ${layout_border};
}
div.reportDisabled {
border-color: ${layout_border};
}
div.reportHelp
{
}
div.reportHelpBody
{
width: 100%;
overflow: auto;
}
div.titleRow {
font-weight: bold;
border-bottom: dotted gray 1px;
margin-bottom: 0.5em;
padding-bottom: 0.25em;
}
div.report-row
{
margin-bottom: 1em;
}
div.report-title-row
{
margin-bottom: 0.5em;
}
div.report-row-error
{
background: $error_message_bg;
padding: 5px;
}
div.report-row label
{
font-weight: bold;
display: block;
margin-bottom: .2em;
}
/* Messages */
.errormessage, .warningmessage, .donemessage, .infomessage, .welcomeBlue, .welcomeRed
{
padding: 10px;
padding-left: 52px;
min-height: 32px;
border: 1px solid $error_message_border;
background-color: $error_message_bg;
background-image: url(error_message_icon.png);
background-repeat: no-repeat;
background-position: 10px 10px;
}
.warningmessage
{
background-image: url(warn_message_icon.png);
border-color: $warn_message_border;
background-color: $warn_message_bg;
}
.donemessage
{
background-image: url(done_message_icon.png);
border-color: $done_message_border;
background-color: $done_message_bg;
}
.infomessage
{
background-image: url(info_message_icon.png);
border-color: $info_message_border;
background-color: $info_message_bg;
}
.welcomeBlue
{
padding-left: 10px;
border-color: $info_message_border;
background-color: $info_message_bg;
background-image: none;
}
.welcomeRed
{
padding-left: 10px;
border-color: $error_message_border;
background-color: $error_message_bg;
background-image: none;
}
.errormessagesmall, .warningmessagesmall, .donemessagesmall, .infomessagesmall
{
padding: 5px;
padding-left: 25px;
min-height: 25px;
border: 1px solid $error_message_border;
background-color: $error_message_bg;
background-image: url(error_small.png);
background-repeat: no-repeat;
background-position: 5px 5px;
}
.warningmessagesmall
{
background-image: url(warn_small.png);
border-color: $warn_message_border;
background-color: $warn_message_bg;
}
.donemessagesmall
{
background-image: url(ok_small.png);
border-color: $done_message_border;
background-color: $done_message_bg;
}
.infomessagesmall
{
background-image: url(info_small.png);
border-color: $info_message_border;
background-color: $info_message_bg;
}
.ok_bgr
{
background: #AEFF5E;
border: 1px #76EC00 solid;
border-color: #66CC00 #66CC00 #66CC00 #66CC00;
}
.errormark, .warningmark, .donemark, .infomark, .err_bgr
{
padding-left: 20px;
min-height: 15px;
background: url(error_small.png) no-repeat;
}
.warningmark
{
background-image: url(warn_small.png);
}
.donemark
{
background-image: url(ok_small.png);
}
.infomark
{
background-image: url(info_small.png);
}
table.colored
{
border-top: solid $table_border 1px;
border-bottom: solid $table_border 1px;
}
table.colored td
{
padding: 5px;
}
table.colored tr.header
{
background: $table_header_bg;
background-image: url(report_title_bg.png);
background-repeat: repeat-x;
background-position: top;
border-bottom: solid $table_border 1px;
font-weight: bold;
}
table.colored tr
{
background: $table_row_bg;
}
table.colored tr.odd_row
{
background: $odd_row_bg;
}
div.debug
{
margin: 10px;
padding: 5px;
background: #FFFF99;
border: solid #FFFF33 1px;
color: black;
}
#footer {
display: none;
}
@@ -1,359 +0,0 @@
@import url( "reset.css" );
body
{
font: 75% verdana, "Bitstream Vera Sans", geneva, arial, helvetica, helve, sans-serif;
background: #FFFFFF;
color: #303030;
background-image: url(base_bg.png);
background-repeat: repeat-x;
background-position: top;
margin: 10px;
}
a:link, a:visited, a:active
{
color: #303030;
}
h1, h2, h3, h4
{
color: #023858;
/*text-shadow: #bbb 2px 2px 1px;*/
}
hr
{
border: none;
border-bottom: dotted #303030 1px;
}
div.report
{
border: solid #d8b365 1px;
}
div.reportTitle
{
font-weight: bold;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
background: #d2c099;
background-image: url(report_title_bg.png);
background-repeat: repeat-x;
background-position: top;
border-bottom: solid #d8b365 1px;
}
div.reportParamHelp
{
color: #666;
}
div.reportParamHelp a
{
color: #666;
}
div.reportBody
{
background: #FFFFFF;
background-repeat: repeat-x;
background-position: top;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
width: 100%;
scrolling: no;
}
div.reportBody div.reportTitle
{
background: transparent;
border: none;
font-weight: bold;
border-bottom: solid #d8b365 1px;
margin-bottom: 5px;
}
div.reportDisabled div.reportTitle {
background: #eee;
border-color: #999;
}
div.reportDisabled {
border-color: #999;
}
div.reportHelp
{
}
div.reportHelpBody
{
width: 100%;
overflow: auto;
}
div.titleRow {
font-weight: bold;
border-bottom: dotted gray 1px;
margin-bottom: 0.5em;
padding-bottom: 0.25em;
}
div.report-row
{
margin-bottom: 1em;
}
div.report-title-row
{
margin-bottom: 0.5em;
}
div.report-row-error
{
background: #FFCCCC;
padding: 5px;
}
div.report-row label
{
font-weight: bold;
display: block;
margin-bottom: .2em;
}
/* Messages */
.errormessage, .warningmessage, .donemessage, .infomessage, .welcomeBlue, .welcomeRed
{
padding: 10px;
padding-left: 52px;
min-height: 32px;
border: 1px solid #AA6666;
background-color: #FFCCCC;
background-image: url(error_message_icon.png);
background-repeat: no-repeat;
background-position: 10px 10px;
}
.warningmessage
{
background-image: url(warn_message_icon.png);
border-color: #AAAA66;
background-color: #FFFFCC;
}
.donemessage
{
background-image: url(done_message_icon.png);
border-color: #66AA66;
background-color: #CCFFCC;
}
.infomessage
{
background-image: url(info_message_icon.png);
border-color: #6666AA;
background-color: #CCCCFF;
}
.welcomeBlue
{
padding-left: 10px;
border-color: #6666AA;
background-color: #CCCCFF;
background-image: none;
}
.welcomeRed
{
padding-left: 10px;
border-color: #AA6666;
background-color: #FFCCCC;
background-image: none;
}
.errormessagesmall, .warningmessagesmall, .donemessagesmall, .infomessagesmall
{
padding: 5px;
padding-left: 25px;
min-height: 25px;
border: 1px solid #AA6666;
background-color: #FFCCCC;
background-image: url(error_small.png);
background-repeat: no-repeat;
background-position: 5px 5px;
}
.warningmessagesmall
{
background-image: url(warn_small.png);
border-color: #AAAA66;
background-color: #FFFFCC;
}
.donemessagesmall
{
background-image: url(ok_small.png);
border-color: #66AA66;
background-color: #CCFFCC;
}
.infomessagesmall
{
background-image: url(info_small.png);
border-color: #6666AA;
background-color: #CCCCFF;
}
.ok_bgr
{
background: #AEFF5E;
border: 1px #76EC00 solid;
border-color: #66CC00 #66CC00 #66CC00 #66CC00;
}
.errormark, .warningmark, .donemark, .infomark, .err_bgr
{
padding-left: 20px;
min-height: 15px;
background: url(error_small.png) no-repeat;
}
.warningmark
{
background-image: url(warn_small.png);
}
.donemark
{
background-image: url(ok_small.png);
}
.infomark
{
background-image: url(info_small.png);
}
table.colored
{
border-top: solid #d8b365 1px;
border-bottom: solid #d8b365 1px;
}
table.colored td
{
padding: 5px;
}
table.colored tr.header
{
background: #EBD9B2;
background-image: url(report_title_bg.png);
background-repeat: repeat-x;
background-position: top;
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.headerwaiting
{
background: #FF6600;
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.headerdeleted
{
background: #9900FF;
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.headerupload
{
background: #336699;
background-repeat: repeat-x;
background-position: top;
border-bottom: solid #d8b365 1px;
font-weight: bold;
}
table.colored tr.headerunknown
{
background: #FF6666;
background-repeat: repeat-x;
background-position: top;
border-bottom: solid #d8b365 1px;
font-weight: bold;
}
table.colored tr
{
background: white;
}
table.colored tr.odd_row
{
background: #FFFF99;
}
div.debug
{
margin: 10px;
padding: 5px;
background: #FFFF99;
border: solid #FFFF33 1px;
color: black;
}
#footer {
display: none;
}
pre {
font-size: 80%;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 B

@@ -1,26 +0,0 @@
body
{
background: #2C3143 url(masthead_bg.png) bottom;
color: #eeeeee;
padding: 0;
border: 0;
margin: 3px;
margin-right: 5px;
margin-left: 5px;
}
div.pageTitle
{
font-size: 175%;
font-weight: bold;
}
div.pageTitle a:link, div.pageTitle a:visited, div.pageTitle a:active, div.pageTitle a:hover
{
text-decoration: none;
}
a:link, a:visited, a:active
{
color: #eeeeee;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

@@ -1,62 +0,0 @@
base_text=#303030
base_bg_top=#FFFFFF
base_bg_bottom=#FFFFFF
link_text=#303030
header_text=#023858
menu_bg_top=#DADFEF
menu_bg_over=#C1C9E5
menu_bg_hatch=-
#menu_bg_hatch=#AAAAFF
# Forms
report_title_bg_top=#ebd9b2
report_title_bg_bottom=#d2c099
report_title_bg_hatch=-
report_border=#d8b365
report_body_bg=#FFFFFF
report_body_bg_top=#FFFFFF
report_body_bg_bottom=#FFFFFF
odd_row_bg=#FFFF99
# Messages
error_message_border=#AA6666
error_message_bg=#FFCCCC
warn_message_border=#AAAA66
warn_message_bg=#FFFFCC
done_message_border=#66AA66
done_message_bg=#CCFFCC
info_message_border=#6666AA
info_message_bg=#CCCCFF
# Tables
table_header_bg=#ebd9b2
table_row_bg=white
table_border=#d8b365
# Footers
footer_bg=#023858
footer_title_bg=#023858
footer_title_hatch=#000000
# History
history_error_border=#AA6666
history_error_bg=#FFCCCC
history_running_border=#AAAA66
history_running_bg=#FFFFCC
history_ok_border=#66AA66
history_ok_bg=#CCFFCC
history_queued_border=#888888
history_queued_bg=#EEEEEE
peek_table_header=#023858
# Masthead
masthead_bg=#2C3143
masthead_text=#eeeeee
masthead_bg_hatch=-
masthead_link=#eeeeee
# ---- Layout -----------------------------------------------------------------
# Overall background color (including space between panels)
layout_bg=#eee
# Line underneath masthead
layout_masthead_border=#444
# Borders around panels
layout_border=#999
# Hover color when mouse over drag bars (panel resize)
layout_hover=#AAAAEE
# Gradient for the panel title backgrounds
panel_header_bg_top=#f5f5f5
panel_header_bg_bottom=#cccccc
@@ -1,74 +0,0 @@
#!/usr/bin/env python
"""
usage: %prog width height bg_color hatch_color [color alpha stop_pos] +
"""
from __future__ import division
import sys
import cairo
assert sys.version_info[:2] >= ( 2, 4 )
def parse_css_color( color ):
if color.startswith( '#' ):
color = color[1:]
if len( color ) == 3:
r = int( color[0], 16 )
g = int( color[1], 16 )
b = int( color[2], 16 )
elif len( color ) == 6:
r = int( color[0:2], 16 )
g = int( color[2:4], 16 )
b = int( color[4:6], 16 )
else:
raise Exception( "Color should be 3 hex numbers" )
return r/256, g/256, b/256
def gradient( width, height, args ):
pat = cairo.LinearGradient(0.0, 0.0, 0.0, height)
while len( args ) > 2:
col = parse_css_color( args[0] )
alpha = float( args[1])
pos = float( args[2] )
pat.add_color_stop_rgba( pos, col[0], col[1], col[2], alpha )
args = args[3:]
return pat
def hatch( width, height, color ):
im_surf = cairo.ImageSurface( cairo.FORMAT_ARGB32, width, width )
c = cairo.Context( im_surf )
c.set_source_rgb ( *color )
c.set_line_width( 0.75 )
for i in range( 0, 2*max(height,width), 3 ):
c.move_to ( 0-10, i+10 )
c.line_to ( width+10, i - width - 10 )
c.stroke()
pat = cairo.SurfacePattern( im_surf )
pat.set_extend (cairo.EXTEND_REPEAT)
return pat
width = int( sys.argv[1] )
height = int( sys.argv[2] )
surface = cairo.ImageSurface( cairo.FORMAT_ARGB32, width, height )
c = cairo.Context( surface )
c.rectangle(0,0,width,height)
c.set_source_rgb( *parse_css_color( sys.argv[3] ) )
c.fill()
if sys.argv[4] != "-":
c.rectangle (0, 0, width, height)
c.set_source( hatch( width, height, parse_css_color( sys.argv[4] ) ) )
c.fill()
pat = cairo.LinearGradient(0.0, 0.0, 0.0, height)
pat.add_color_stop_rgba( 0, 1, 1, 1, 0 )
pat.add_color_stop_rgba( 1, 1, 1, 1, 1 )
c.rectangle (0, 0, width, height)
c.set_source( gradient( width, height, sys.argv[5:] ) )
c.fill()
surface.write_to_png( "/dev/stdout" )
@@ -1,45 +0,0 @@
#!/usr/bin/env python
import pkg_resources;
pkg_resources.require( "Cheetah" )
import sys
from Cheetah.Template import Template
import string
from subprocess import Popen, PIPE
import os.path
assert sys.version_info[:2] >= ( 2, 4 )
def run( cmd ):
return Popen( cmd, stdout=PIPE).communicate()[0]
templates = [ ( "masthead.css.tmpl", "masthead.css"),
( "base.css.tmpl", "base.css" ) ]
images = [
( "./gradient.py 9 1000 $base_bg_top - $base_bg_bottom 0 0 $base_bg_bottom 1 1", "base_bg.png" ),
( "./gradient.py 9 50 $masthead_bg $masthead_bg_hatch", "masthead_bg.png" ),
( "./gradient.py 9 30 $footer_title_bg $footer_title_hatch 000000 0 0.5 000000 1 1", "footer_title_bg.png" )
]
vars, out_dir = sys.argv[1:]
context = dict()
for line in open( vars ):
line = line.rstrip( '\r\n' )
if line and not line.startswith( '#' ):
key, value = line.split( '=' )
if value.startswith( '"' ) and value.endswith( '"' ):
value = value[1:-1]
context[key] = value
for input, output in templates:
print input ,"->", output
open( os.path.join( out_dir, output ), "w" ).write( str( Template( file=input, searchList=[context] ) ) )
for rule, output in images:
t = string.Template( rule ).substitute( context )
print t, "->", output
open( os.path.join( out_dir, output ), "w" ).write( run( t.split() ) )
@@ -1,26 +0,0 @@
body
{
background: $masthead_bg url(masthead_bg.png) bottom;
color: $masthead_text;
padding: 0;
border: 0;
margin: 3px;
margin-right: 5px;
margin-left: 5px;
}
div.pageTitle
{
font-size: 175%;
font-weight: bold;
}
div.pageTitle a:link, div.pageTitle a:visited, div.pageTitle a:active, div.pageTitle a:hover
{
text-decoration: none;
}
a:link, a:visited, a:active
{
color: $masthead_link;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,166 +0,0 @@
// =========================================================================
// ie7-recalc.js
// =========================================================================
(function() {
/* ---------------------------------------------------------------------
This allows refreshing of IE7 style rules. If you modify the DOM
you can update IE7 by calling document.recalc().
This should be the LAST module included.
--------------------------------------------------------------------- */
if (!IE7.loaded) return;
// remove all IE7 classes from an element
CLASSES = /\sie7_class\d+/g;
IE7.CSS.extend({
// store for elements that have style properties calculated
elements: {},
handlers: [],
// clear IE7 classes and styles
reset: function() {
this.removeEventHandlers();
// reset IE7 classes here
var elements = this.elements;
for (var i in elements) elements[i].runtimeStyle.cssText = "";
this.elements = {};
// reset runtimeStyle here
var elements = IE7.Rule.elements;
for (var i in elements) {
with (elements[i]) className = className.replace(CLASSES, "");
}
IE7.Rule.elements = {};
},
reload: function() {
this.rules = [];
this.getInlineStyles();
this.screen.load();
if (this.print) this.print.load();
this.refresh();
this.trash();
},
addRecalc: function(propertyName, test, handler, replacement) {
// call the ancestor method to add a wrapped recalc method
this.base(propertyName, test, function(element) {
// execute the original recalc method
handler(element);
// store a reference to this element so we can clear its style later
IE7.CSS.elements[element.uniqueID] = element;
}, replacement);
},
recalc: function() {
// clear IE7 styles and classes
this.reset();
// execute the ancestor method to perform recalculations
this.base();
},
addEventHandler: function(element, type, handler) {
element.attachEvent(type, handler);
// store the handler so it can be detached later
this.handlers.push(arguments);
},
removeEventHandlers: function() {
var handler;
while (handler = this.handlers.pop()) {
handler[0].detachEvent(handler[1], handler[2]);
}
},
getInlineStyles: function() {
// load inline styles
var styleSheets = document.getElementsByTagName("style"), styleSheet;
for (var i = styleSheets.length - 1; (styleSheet = styleSheets[i]); i--) {
if (!styleSheet.disabled && !styleSheet.ie7) {
var cssText = styleSheet.cssText || styleSheet.innerHTML;
this.styles.push(cssText);
styleSheet.cssText = cssText;
}
}
},
trash: function() {
// trash the old style sheets
var styleSheets = document.styleSheets, styleSheet, i;
for (i = 0; i < styleSheets.length; i++) {
styleSheet = styleSheets[i];
if (!styleSheet.ie7 && !styleSheet.cssText) {
styleSheet.cssText = styleSheet.cssText;
}
}
this.base();
},
getText: function(styleSheet) {
return styleSheet.cssText || this.base(styleSheet);
}
});
// remove event handlers (they eat memory)
IE7.CSS.addEventHandler(window, "onunload", function() {
IE7.CSS.removeEventHandlers();
});
// store all elements with an IE7 class assigned
IE7.Rule.elements = {};
IE7.Rule.prototype.extend({
add: function(element) {
// execute the ancestor "add" method
this.base(element);
// store a reference to this element so we can clear its classes later
IE7.Rule.elements[element.uniqueID] = element;
}
});
// store created pseudo elements
if (IE7.PseudoElement) {
IE7.PseudoElement.hash = {};
IE7.PseudoElement.prototype.extend({
create: function(target) {
var key = this.selector + ":" + target.uniqueID;
if (!IE7.PseudoElement.hash[key]) {
IE7.PseudoElement.hash[key] = true;
this.base(target);
}
}
});
}
IE7.HTML.extend({
elements: {},
addRecalc: function(selector, handler) {
// call the ancestor method to add a wrapped recalc method
this.base(selector, function(element) {
if (!this.elements[element.uniqueID]) {
// execute the original recalc method
handler(element);
// store a reference to this element so that
// it is not "fixed" again
this.elements[element.uniqueID] = element;
}
});
}
});
// allow refreshing of IE7 fixes
document.recalc = function(reload) {
if (IE7.CSS.screen) {
if (reload) IE7.CSS.reload();
IE7.recalc();
}
};
})();
@@ -1,55 +0,0 @@
## This needs to be on the first line, otherwise IE6 goes into quirks mode
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
## Default title
<%def name="title()">Galaxy Reports</%def>
## Default stylesheets
<%def name="stylesheets()">
<link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
</%def>
## Default javascripts
<%def name="javascripts()">
<!--[if lt IE 7]>
<script type='text/javascript' src="/static/scripts/IE7.js"></script>
<script type='text/javascript' src="/static/scripts/IE8.js"></script>
<script type='text/javascript' src="/static/scripts/ie7-recalc.js"></script>
<![endif]-->
</%def>
## Default late-load javascripts
<%def name="late_javascripts()">
</%def>
## Masthead
<%def name="masthead()">
<iframe name="galaxy_masthead" src="${h.url_for( '/root/masthead' )}" width="100%" height="38" frameborder="0" scrolling="no" style="margin: 0; border: 0 none; width: 100%; height: 38px; overflow: hidden;"> </iframe>
</%def>
## Document
<html lang="en">
<head>
<title>${self.title()}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
${self.javascripts()}
${self.stylesheets()}
</head>
<body>
## Background displays first
<div id="background"></div>
## Layer masthead iframe over background
<div id="masthead">
${self.masthead()}
</div>
## Display main report body
<div id="main_body">
${self.main_body()}
</div>
## Allow other body level elements
${next.body()}
</body>
## Scripts can be loaded later since they progressively add features to
## the panels, but do not change layout
${self.late_javascripts()}
</html>
@@ -1,88 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
## Display the available reports
<div class="body">
<h3 align="center">Galaxy Reports</h3>
<table align="center" width="40%" class="colored">
<tr><td><div class="reportTitle">Job Information</div></td></tr>
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='jobs', action='today_all' )}">Number of jobs today</a> - displays the total number of jobs for today
</div>
</td>
</tr>
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='jobs', action='specified_month_all' )}">Number of jobs per day for current month</a> - displays days of the current month with the total number of jobs for each day
</div>
</td>
</tr>
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='jobs', action='specified_month_in_error' )}">Number of jobs in error per day for current month</a> - displays days of the current month with the total number of jobs in error for each day
</div>
</td>
</tr>
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='jobs', action='all_unfinished' )}">All unfinished jobs</a> - displays jobs that are currently in a "new" state, a "queued" state or a "running" state
</div>
</td>
</tr>
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='jobs', action='per_month_all' )}">Number of jobs per month</a> - displays a list of months with the total number of jobs for each month
</div>
</td>
</tr>
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='jobs', action='per_month_in_error' )}">Number of jobs in error per month</a> - displays a list of months with the total number of jobs in error for each month
</div>
</td>
</tr>
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='jobs', action='per_user' )}">Number of jobs per user</a> - displays users sorted in descending order by the number of jobs they have submitted
</div>
</td>
</tr>
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='jobs', action='per_tool' )}">Number of jobs per tool</a> - displays tools sorted in alphabetical order by tool id and the number of jobs created by the tool
</div>
</td>
</tr>
</table>
<br clear="left"/><br/><br/><br/>
<table align="center" width="40%" class="colored">
<tr><td><div class="reportTitle">User Information</div></td></tr>
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='users', action='index' )}">Users</a> - displays information about registered users
</div>
</td>
</tr>
</table>
<br clear="left"/><br/><br/><br/>
<table align="center" width="40%" class="colored">
<tr><td><div class="reportTitle">System Information</div></td></tr>
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='system', action='index' )}">Disk space, old histories and datasets</a> - displays history and dataset information including disk space allocation where datasets are stored
</div>
</td>
</tr>
</table>
</div>
</%def>
@@ -1,89 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">All Unfinished Jobs</h3>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="5">There are no unfinished jobs</td></tr>
%else:
%for job in jobs:
<%
state = job[0]
if state == 'new':
rowdef = '<tr class="headernew">'
elif state == 'waiting':
rowdef = '<tr class="headerwaiting">'
elif state == 'queued':
rowdef = '<tr class="headerqueued">'
elif state == 'running':
rowdef = '<tr class="headerrunning">'
elif state == 'upload':
rowdef = '<tr class="headerupload">'
else:
rowdef = '<tr class="headerunknown">'
%>
${rowdef}
<td>State</td>
<td>Job Id</td>
<td>Create Time</td>
<td>Update Time</td>
<td>Session Id</td>
</tr>
<tr>
<td>${job[0]}</td>
<td>${job[1]}</td>
<td>${job[2]}</td>
<td>${job[3]}</td>
<td>${job[4]}</td>
</tr>
<tr class="header">
<td colspan="3">Tool</td>
<td colspan="2">User</td>
</tr>
<tr>
<td colspan="3">${job[5]}</td>
<td colspan="2">${job[6]}</td>
</tr>
<tr class="header">
<td colspan="5">Remote Host</td>
</tr>
<tr>
<td colspan="5">${job[7]}</td>
</tr>
<tr class="header">
<td colspan="5">Command Line</td>
</tr>
<tr>
<td colspan="5">${job[8]}</td>
</tr>
<tr class="header">
<td colspan="5">Stderr</td>
</tr>
<tr>
<td colspan="5"><pre>${job[9]}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Stack Trace</td>
</tr>
<tr>
<td colspan="5"><pre>${job[10]}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Info</td>
</tr>
<tr>
<td colspan="5">${job[11]}</td>
</tr>
<tr><td colspan="5">&nbsp;</td></tr>
<tr><td colspan="5">&nbsp;</td></tr>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,35 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">Jobs Per Domain</h3>
<h4 align="center">This report does not account for unauthenticated users.</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs</td></tr>
%else:
<tr class="header">
<td>Domain</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${job[0]}</td>
<td>${job[1]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,39 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">Jobs Per Month</h3>
<h4 align="center">Click Month to view the number of jobs for each day of that month</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="4">There are no jobs</td></tr>
%else:
<tr class="header">
<td>Month</td>
<td>User Jobs</td>
<td>Monitor Jobs</td>
<td>Total</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='jobs', action='specified_month_all', month=job[0], month_label=job[4].strip(), year_label=job[5] )}">${job[4]}&nbsp;${job[5]}</a></td>
<td>${job[1]}</td>
<td>${job[2]}</td>
<td>${job[3]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,35 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">Jobs In Error Per Month</h3>
<h4 align="center">Click Month to view the number of jobs in error for each day of that month</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs in the error state</td></tr>
%else:
<tr class="header">
<td>Month</td>
<td>Jobs In Error</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='jobs', action='specified_month_in_error', month=job[0], month_label=job[2].strip(), year_label=job[3] )}">${job[2]}&nbsp;${job[3]}</a></td>
<td>${job[1]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,35 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">Jobs Per Tool</h3>
<h4 align="center">Click Tool Id to view jobs per month for that tool</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs</td></tr>
%else:
<tr class="header">
<td>Tool id</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='jobs', action='tool_per_month', tool_id=job[0] )}">${job[0]}</a></td>
<td>${job[1]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,35 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">Jobs Per User</h3>
<h4 align="center">Click User to view jobs per month for that user</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs</td></tr>
%else:
<tr class="header">
<td>User</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='jobs', action='user_per_month', email=job[0] )}">${job[0]}</a></td>
<td>${job[1]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,95 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">All Jobs for ${day_label},&nbsp;${month_label}&nbsp;${day_of_month},&nbsp;${year_label}</h3>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="5">There are no jobs for ${day_label},&nbsp;${month_label}&nbsp;${day_of_month},&nbsp;${year_label}</td></tr>
%else:
%for job in jobs:
<%
state = job[0]
if state == 'new':
rowdef = '<tr class="headernew">'
elif state == 'waiting':
rowdef = '<tr class="headerwaiting">'
elif state == 'queued':
rowdef = '<tr class="headerqueued">'
elif state == 'running':
rowdef = '<tr class="headerrunning">'
elif state == 'error':
rowdef = '<tr class="headererror">'
elif state == 'deleted':
rowdef = '<tr class="headerdeleted">'
elif state == 'upload':
rowdef = '<tr class="headerupload">'
elif state == 'ok':
rowdef = '<tr class="headerok">'
else:
rowdef = '<tr class="headerunknown">'
%>
${rowdef}
<td>State</td>
<td>Job Id</td>
<td>Create Time</td>
<td>Update Time</td>
<td>Session Id</td>
</tr>
<tr>
<td>${job[0]}</td>
<td>${job[1]}</td>
<td>${job[2]}</td>
<td>${job[3]}</td>
<td>${job[4]}</td>
</tr>
<tr class="header">
<td colspan="3">Tool</td>
<td colspan="2">User</td>
</tr>
<tr>
<td colspan="3">${job[5]}</td>
<td colspan="2">${job[6]}</td>
</tr>
<tr class="header">
<td colspan="5">Remote Host</td>
</tr>
<tr>
<td colspan="5">${job[7]}</td>
</tr>
<tr class="header">
<td colspan="5">Command Line</td>
</tr>
<tr>
<td colspan="5">${job[8]}</td>
</tr>
<tr class="header">
<td colspan="5">Stderr</td>
</tr>
<tr>
<td colspan="5"><pre>${job[9]}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Stack Trace</td>
</tr>
<tr>
<td colspan="5"><pre>${job[10]}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Info</td>
</tr>
<tr>
<td colspan="5">${job[11]}</td>
</tr>
<tr><td colspan="5">&nbsp;</td></tr>
<tr><td colspan="5">&nbsp;</td></tr>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,81 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">All Jobs in Error for ${day_label},&nbsp;${month_label}&nbsp;${day_of_month},&nbsp;${year_label}</h3>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="5">There are no jobs in the error state for ${day_label},&nbsp;${month_label}&nbsp;${day_of_month},&nbsp;${year_label}</td></tr>
%else:
%for job in jobs:
<%
state = job[0]
if state == 'error':
rowdef = '<tr class="headererror">'
else:
rowdef = '<tr class="headerunknown">'
%>
${rowdef}
<td>State</td>
<td>Job Id</td>
<td>Create Time</td>
<td>Update Time</td>
<td>Session Id</td>
</tr>
<tr>
<td>${job[0]}</td>
<td>${job[1]}</td>
<td>${job[2]}</td>
<td>${job[3]}</td>
<td>${job[4]}</td>
</tr>
<tr class="header">
<td colspan="3">Tool</td>
<td colspan="2">User</td>
</tr>
<tr>
<td colspan="3">${job[5]}</td>
<td colspan="2">${job[6]}</td>
</tr>
<tr class="header">
<td colspan="5">Remote Host</td>
</tr>
<tr>
<td colspan="5">${job[7]}</td>
</tr>
<tr class="header">
<td colspan="5">Command Line</td>
</tr>
<tr>
<td colspan="5">${job[8]}</td>
</tr>
<tr class="header">
<td colspan="5">Stderr</td>
</tr>
<tr>
<td colspan="5"><pre>${job[9]}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Stack Trace</td>
</tr>
<tr>
<td colspan="5"><pre>${job[10]}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Info</td>
</tr>
<tr>
<td colspan="5">${job[11]}</td>
</tr>
<tr><td colspan="5">&nbsp;</td></tr>
<tr><td colspan="5">&nbsp;</td></tr>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,41 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">All Jobs for ${month_label}&nbsp;${year_label}</h3>
<h4 align="center">Click Total Jobs to see jobs for that day</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="5">There are no jobs for ${month_label}&nbsp;${year_label}</td></tr>
%else:
<tr class="header">
<td>Day</td>
<td>Date</td>
<td>User Jobs</td>
<td>Monitor Jobs</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${job[0]}</td>
<td>${month_label}&nbsp;${job[5]},&nbsp;${year_label}</td>
<td>${job[2]}</td>
<td>${job[3]}</td>
<td><a href="${h.url_for( controller='jobs', action='specified_date_all', specified_date=job[1], day_label=job[0], month_label=month_label, year_label=year_label, day_of_month=job[5] )}">${job[4]}</a></td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,37 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">Jobs in Error for ${month_label}&nbsp;${year_label}</h3>
<h4 align="center">Click Jobs in Error to view jobs in error for that day</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="3">There are no jobs in the error state for ${month_label}&nbsp;${year_label}</td></tr>
%else:
<tr class="header">
<td>Day</td>
<td>Date</td>
<td>Jobs in Error</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${job[0]}</td>
<td>${month_label}&nbsp;${job[3]},&nbsp;${year_label}</td>
<td><a href="${h.url_for( controller='jobs', action='specified_date_in_error', specified_date=job[1], day_label=job[0], month_label=month_label, year_label=year_label, day_of_month=job[3] )}">${job[2]}</a></td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,41 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">All Jobs for ${day_label},&nbsp;${month_label}&nbsp;${day_of_month},&nbsp;${year_label}</h3>
<h4 align="center">Click Total Jobs to see jobs for today</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="5">There are no jobs for ${day_label},&nbsp;${month_label}&nbsp;${day_of_month},&nbsp;${year_label}</td></tr>
%else:
<tr class="header">
<td>Day</td>
<td>Date</td>
<td>User Jobs</td>
<td>Monitor Jobs</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${job[0]}</td>
<td>${month_label}&nbsp;${job[5]},&nbsp;${year_label}</td>
<td>${job[2]}</td>
<td>${job[3]}</td>
<td><a href="${h.url_for( controller='jobs', action='specified_date_all', specified_date=job[1], day_label=job[0], month_label=month_label, year_label=year_label, day_of_month=job[5] )}">${job[4]}</a></td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,95 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">Jobs for tool "${tool_id}" during ${month_label}&nbsp;${year_label}</h3>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="5">There are no jobs for ${tool_id} during ${month_label}&nbsp;${year_label}</td></tr>
%else:
%for job in jobs:
<%
state = job[0]
if state == 'new':
rowdef = '<tr class="headernew">'
elif state == 'waiting':
rowdef = '<tr class="headerwaiting">'
elif state == 'queued':
rowdef = '<tr class="headerqueued">'
elif state == 'running':
rowdef = '<tr class="headerrunning">'
elif state == 'error':
rowdef = '<tr class="headererror">'
elif state == 'deleted':
rowdef = '<tr class="headerdeleted">'
elif state == 'upload':
rowdef = '<tr class="headerupload">'
elif state == 'ok':
rowdef = '<tr class="headerok">'
else:
rowdef = '<tr class="headerunknown">'
%>
${rowdef}
<td>State</td>
<td>Job Id</td>
<td>Create Time</td>
<td>Update Time</td>
<td>Session Id</td>
</tr>
<tr>
<td>${job[0]}</td>
<td>${job[1]}</td>
<td>${job[2]}</td>
<td>${job[3]}</td>
<td>${job[4]}</td>
</tr>
<tr class="header">
<td colspan="3">Tool</td>
<td colspan="2">User</td>
</tr>
<tr>
<td colspan="3">${job[5]}</td>
<td colspan="2">${job[6]}</td>
</tr>
<tr class="header">
<td colspan="5">Remote Host</td>
</tr>
<tr>
<td colspan="5">${job[7]}</td>
</tr>
<tr class="header">
<td colspan="5">Command Line</td>
</tr>
<tr>
<td colspan="5">${job[8]}</td>
</tr>
<tr class="header">
<td colspan="5">Stderr</td>
</tr>
<tr>
<td colspan="5"><pre>${job[9]}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Stack Trace</td>
</tr>
<tr>
<td colspan="5"><pre>${job[10]}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Info</td>
</tr>
<tr>
<td colspan="5">${job[11]}</td>
</tr>
<tr><td colspan="5">&nbsp;</td></tr>
<tr><td colspan="5">&nbsp;</td></tr>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,35 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">Jobs per month for tool "${tool_id}"</h3>
<h4 align="center">Click Total Jobs to see the tool's jobs for that month</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs for tool "${tool_id}"</td></tr>
%else:
<tr class="header">
<td>Month</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${job[2]}&nbsp;${job[3]}</td>
<td><a href="${h.url_for( controller='jobs', action='tool_for_month', tool_id=tool_id, month_label=job[2].strip(), year_label=job[3], month=job[0] )}">${job[1]}</a></td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,95 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">Jobs for user "${email}" during ${month_label}&nbsp;${year_label}</h3>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="5">There are no jobs for user "${email}" during ${month_label}&nbsp;${year_label}</td></tr>
%else:
%for job in jobs:
<%
state = job[0]
if state == 'new':
rowdef = '<tr class="headernew">'
elif state == 'waiting':
rowdef = '<tr class="headerwaiting">'
elif state == 'queued':
rowdef = '<tr class="headerqueued">'
elif state == 'running':
rowdef = '<tr class="headerrunning">'
elif state == 'error':
rowdef = '<tr class="headererror">'
elif state == 'deleted':
rowdef = '<tr class="headerdeleted">'
elif state == 'upload':
rowdef = '<tr class="headerupload">'
elif state == 'ok':
rowdef = '<tr class="headerok">'
else:
rowdef = '<tr class="headerunknown">'
%>
${rowdef}
<td>State</td>
<td>Job Id</td>
<td>Create Time</td>
<td>Update Time</td>
<td>Session Id</td>
</tr>
<tr>
<td>${job[0]}</td>
<td>${job[1]}</td>
<td>${job[2]}</td>
<td>${job[3]}</td>
<td>${job[4]}</td>
</tr>
<tr class="header">
<td colspan="3">Tool</td>
<td colspan="2">User</td>
</tr>
<tr>
<td colspan="3">${job[5]}</td>
<td colspan="2">${job[6]}</td>
</tr>
<tr class="header">
<td colspan="5">Remote Host</td>
</tr>
<tr>
<td colspan="5">${job[7]}</td>
</tr>
<tr class="header">
<td colspan="5">Command Line</td>
</tr>
<tr>
<td colspan="5">${job[8]}</td>
</tr>
<tr class="header">
<td colspan="5">Stderr</td>
</tr>
<tr>
<td colspan="5"><pre>${job[9]}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Stack Trace</td>
</tr>
<tr>
<td colspan="5"><pre>${job[10]}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Info</td>
</tr>
<tr>
<td colspan="5">${job[11]}</td>
</tr>
<tr><td colspan="5">&nbsp;</td></tr>
<tr><td colspan="5">&nbsp;</td></tr>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,35 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">Jobs per month for user "${email}"</h3>
<h4 align="center">Click Total Jobs to see the user's jobs for that month</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs for user "${email}"</td></tr>
%else:
<tr class="header">
<td>Month</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${job[2]}&nbsp;${job[3]}</td>
<td><a href="${h.url_for( controller='jobs', action='user_for_month', email=email, month_label=job[2].strip(), year_label=job[3], month=job[0] )}">${job[1]}</a></td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,29 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Galaxy</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
<link href="${h.url_for('/static/style/masthead.css')}" rel="stylesheet" type="text/css" />
</head>
<body class="mastheadPage">
<table width="100%" cellspacing="0" border="0">
<tr valign="middle">
<td width="26px">
<a target="_blank" href="${wiki_url}">
<img border="0" src="${h.url_for('/static/images/galaxyIcon_noText.png')}"></a>
</td>
<td align="left" valign="middle"><div class="pageTitle">Galaxy${brand}</div></td>
<td align="right" valign="middle">
Info: <a href="${bugs_email}">report bugs</a>
| <a target="_blank" href="${wiki_url}">wiki</a>
| <a target="_blank" href="${screencasts_url}">screencasts</a>
| <a target="_blank" href="${blog_url}">blog</a>
&nbsp;&nbsp;&nbsp;
<a target="_top" href="${h.url_for( controller='root', action='index' )}">Galaxy Reports Home</a>
&nbsp;
</td>
</tr>
</table>
</body>
</html>
@@ -1,21 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">Registered Users</h3>
<h4 align="center">Click Number of Registered Users to see the number of user registrations per month</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="25%" class="colored">
%if num_users == 0:
<tr><td>There are no registered users</td></tr>
%else:
<tr class="header"><td align="center">Number of Registered Users</td></tr>
<tr class="tr"><td align="center"><a href="${h.url_for( controller='users', action='registered_users_per_month' )}">${num_users}</a></td></tr>
%endif
</table>
</div>
</%def>
@@ -1,35 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">User Registrations Per Month</h3>
<h4 align="center">Click Month to view the number of user registrations for each day of that month</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="30%" class="colored">
%if len( users ) == 0:
<tr><td colspan="2">There are no registered users</td></tr>
%else:
<tr class="header">
<td>Month</td>
<td>Number of Registrations</td>
</tr>
<% ctr = 0 %>
%for user in users:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='users', action='specified_month', month=user[0], month_label=user[2].strip(), year_label=user[3] )}">${user[2]}&nbsp;${user[3]}</a></td>
<td>${user[1]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,32 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">User Registrations for ${day_label},&nbsp;${month_label}&nbsp;${day_of_month},&nbsp;${year_label}</h3>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="30%" class="colored">
%if len( users ) == 0:
<tr><td colspan="2">There are no user registrations for ${day_label},&nbsp;${month_label}&nbsp;${day_of_month},&nbsp;${year_label}</td></tr>
%else:
<tr class="header">
<td>Email</td>
</tr>
<% ctr = 0 %>
%for user in users:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${user}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,35 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<div class="reportBody">
<h3 align="center">User Registrations for ${month_label}&nbsp;${year_label}</h3>
<h4 align="center">Click Day to see user registrations for that day</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="60%" class="colored">
%if len( users ) == 0:
<tr><td colspan="2">There are no user registrations for ${month_label}&nbsp;${year_label}</td></tr>
%else:
<tr class="header">
<td>Day</td>
<td>New Registrations</td>
</tr>
<% ctr = 0 %>
%for user in users:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='users', action='specified_date', specified_date=user[0], day_label=user[3], month_label=month_label, year_label=year_label, day_of_month=user[1] )}">${user[3]},&nbsp;${month_label}&nbsp;${user[1]},&nbsp;${year_label}</a></td>
<td>${user[2]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</%def>
@@ -1,82 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<h3 align="center">Old Histories and Datasets</h3>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr>
<td>
<form method="post" action="system">
<p>
<button name="action" value="userless_histories">Number of Histories</button>
that are not associate with a user and were last updated more than
<input type="textfield" value="${userless_histories_days}" size="3" name="userless_histories_days">
days ago.
</p>
<p>
<button name="action" value="deleted_histories">Number of Histories</button>
that were deleted more than
<input type="textfield" value="${deleted_histories_days}" size="3" name="deleted_histories_days">
days ago but have not yet been purged.
</p>
<p>
<button name="action" value="deleted_datasets">Number of Datasets</button>
that were deleted more than
<input type="textfield" value="${deleted_datasets_days}" size="3" name="deleted_datasets_days">
days ago but have not yet been purged.
</p>
</form>
</td>
</tr>
</table>
<br clear="left" /><br />
<h3 align="center">Current Disk Space Where Datasets are Stored</h3>
<table align="center" width="60%" class="colored">
<tr><td colspan="5"><div class="reportTitle">Disk Usage for ${file_path}</div></td></tr>
<tr class="header">
<td>File System</td>
<td>Disk Size</td>
<td>Used</td>
<td>Available</td>
<td>Percent Used</td>
</tr>
<tr class="tr">
<td>${disk_usage[0]}</td>
<td>${disk_usage[1]}</td>
<td>${disk_usage[2]}</td>
<td>${disk_usage[3]}</td>
<td>${disk_usage[4]}</td>
</tr>
%if len( datasets ) == 0:
<tr class="header"><td colspan="5">There are no datasets larger than ${file_size_str}</td></tr>
%else:
<tr><td colspan="5"><div class="reportTitle">${len( datasets )} largest datasets over ${file_size_str}</div></td></tr>
<tr class="header">
<td>File</td>
<td>Last Updated</td>
<td>History ID</td>
<td>Deleted</td>
<td>Size on Disk</td>
</tr>
<% ctr = 0 %>
%for dataset in datasets:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>dataset_${dataset[0]}.dat</td>
<td>${dataset[1]}</td>
<td>${dataset[2]}</td>
<td>${dataset[3]}</td>
<td>${dataset[4]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</%def>
@@ -1,29 +0,0 @@
<%inherit file="/base_panels.mako"/>
<%def name="main_body()">
<h3 align="center">Registered Users</h3>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="40%" class="colored">
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='users', action='registered_users' )}">Registered Users</a> - displays the number of registered users
</div>
</td>
</tr>
</table>
<br clear="left" /><br />
<table align="center" width="40%" class="colored">
<tr>
<td>
<div class="reportBody">
<a href="${h.url_for( controller='users', action='last_access_date' )}">Date of Last Login</a> - displays users sorted by date of last login
</div>
</td>
</tr>
</table>
</%def>
+11 -16
View File
@@ -19,16 +19,13 @@ log_level = DEBUG
# Database connection
#database_file = database/universe.sqlite
# You may use a SQLAlchemy connection string to specify an external database instead
database_connection = postgres:///galaxy_test?host=/var/run/postgresql
# database_connection = postgres:///galaxy_test?user=postgres&password=postgres
# Where dataset files are saved
file_path = database/files
# Temporary storage for additional datasets, this should be shared through the cluster
new_file_path = database/tmp
# Where templates are stored
template_path = lib/galaxy/webapps/reports/templates
# Session support (beaker)
use_beaker_session = True
session_type = memory
@@ -36,19 +33,13 @@ session_data_dir = %(here)s/database/beaker_sessions
session_key = galaxysessions
session_secret = changethisinproduction
# Galaxy session security
id_secret = changethisinproductiontoo
# Configuration for debugging middleware
debug = true
# debug = true
use_lint = false
# NEVER enable this on a public site (even test or QA)
# use_interactive = true
# Force everyone to log in (disable anonymous access)
require_login = False
# path to sendmail
sendmail_path = /usr/sbin/sendmail
@@ -61,15 +52,19 @@ mailing_join_addr = galaxy-user-join@bx.psu.edu
# Profiling middleware (cProfile based)
## use_profile = True
# Mail
# smtp_server = yourserver@yourfacility.edu
# error_email_to = your_bugs@bx.psu.edu
# Use the new iframe / javascript based layout
use_new_layout = true
# Serving static files (needed if running standalone)
static_enabled = True
static_cache_time = 360
static_dir = lib/galaxy/webapps/reports/static
static_images_dir = lib/galaxy/webapps/reports/static/images
static_favicon_dir = lib/galaxy/webapps/reports/static/favicon.ico
static_scripts_dir = lib/galaxy/webapps/reports/static/scripts
static_style_dir = lib/galaxy/webapps/reports/static/january_2008_style/blue
static_dir = %(here)s/static/
static_images_dir = %(here)s/static/images
static_favicon_dir = %(here)s/static/favicon.ico
static_scripts_dir = %(here)s/static/scripts/
static_style_dir = %(here)s/static/june_2007_style/blue
@@ -0,0 +1,38 @@
<%inherit file="/base_panels.mako"/>
## Default title
<%def name="title()">Galaxy Reports</%def>
## Masthead
<%def name="masthead()">
## Tab area, fills entire width
<div style="position: absolute; top: 0; left: 0; width: 100%; text-align: center">
<table class="tab-group" border="0" cellspacing="0" style="margin: auto;">
<tr>
<%def name="tab( id, display, href, target='_parent', visible=True, extra_class='' )">
<%
cls = "tab"
if extra_class:
cls += " " + extra_class
if self.active_view == id:
cls += " active"
style = ""
if not visible:
style = "display: none;"
%>
<td class="${cls}" style="${style}"><a target="${target}" href="${href}">${display}</a></td>
</%def>
</tr>
</table>
</div>
## Logo, layered over tabs to be clickable
<div class="title" style="position: absolute; top: 0; left: 0;">
<a href="${app.config.get( 'logo_url', '/' )}">
<img border="0" src="${h.url_for('/static/images/galaxyIcon_noText.png')}" style="width: 26px; vertical-align: top;">
Galaxy Reports
%if app.config.brand:
<span class='brand'>/ ${app.config.brand}</span>
%endif
</a>
</div>
</%def>
+1
View File
@@ -0,0 +1 @@
<%inherit file="/grid_base.mako"/>
+115
View File
@@ -0,0 +1,115 @@
<%inherit file="/webapps/reports/base_panels.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%def name="init()">
<%
self.has_left_panel=True
self.has_right_panel=False
self.active_view="reports"
%>
</%def>
<%def name="stylesheets()">
${parent.stylesheets()}
## TODO: Clean up these styles and move into panel_layout.css (they are
## used here and in the editor).
<style type="text/css">
#left {
background: #C1C9E5 url(${h.url_for('/static/style/menu_bg.png')}) top repeat-x;
}
div.toolMenu {
margin: 5px;
margin-left: 10px;
margin-right: 10px;
}
div.toolSectionPad {
margin: 0;
padding: 0;
height: 5px;
font-size: 0px;
}
div.toolSectionDetailsInner {
margin-left: 5px;
margin-right: 5px;
}
div.toolSectionTitle {
padding-bottom: 0px;
font-weight: bold;
}
div.toolMenuGroupHeader {
font-weight: bold;
padding-top: 0.5em;
padding-bottom: 0.5em;
color: #333;
font-style: italic;
border-bottom: dotted #333 1px;
margin-bottom: 0.5em;
}
div.toolTitle {
padding-top: 5px;
padding-bottom: 5px;
margin-left: 16px;
margin-right: 10px;
display: list-item;
list-style: square outside;
}
a:link, a:visited, a:active
{
color: #303030;
}
</style>
</%def>
<%def name="left_panel()">
<div class="unified-panel-header" unselectable="on">
<div class='unified-panel-header-inner'>Reports</div>
</div>
<div class="page-container" style="padding: 10px;">
<div class="toolMenu">
<div class="toolSectionList">
<div class="toolSectionPad"></div>
<div class="toolSectionTitle">
<span>Jobs</span>
</div>
<div class="toolSectionBody">
<div class="toolSectionBg">
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='today_all' )}">Number of jobs today</a></div>
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='specified_month_all' )}">Number of jobs per day for current month</a></div>
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='specified_month_in_error' )}">Number of jobs in error per day for current month</a></div>
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='all_unfinished' )}">All unfinished jobs</a></div>
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_month_all' )}">Number of jobs per month</a></div>
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_month_in_error' )}">Number of jobs in error per month</a></div>
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_user' )}">Number of jobs per user</a></div>
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_tool' )}">Number of jobs per tool</a></div>
</div>
</div>
<div class="toolSectionPad"></div>
<div class="toolSectionPad"></div>
<div class="toolSectionTitle">
<span>Users</span>
</div>
<div class="toolSectionBody">
<div class="toolSectionBg">
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='users', action='registered_users' )}">Registered users</a></div>
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='users', action='last_access_date' )}">Date of last login</a></div>
</div>
</div>
<div class="toolSectionPad"></div>
<div class="toolSectionPad"></div>
<div class="toolSectionTitle">
<span>System</span>
</div>
<div class="toolSectionBody">
<div class="toolSectionBg">
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='system', action='index' )}">Disk space, old histories and datasets</a></div>
</div>
</div>
</div>
</div>
</div>
</%def>
<%def name="center_panel()">
<% center_url = h.url_for( controller='jobs', action='today_all' ) %>
<iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${center_url}"> </iframe>
</%def>
+75
View File
@@ -0,0 +1,75 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, 'done' )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">Job Information</h3>
<table align="center" class="colored">
<tr class="header">
<td>State</td>
<td>Job Id</td>
<td>Create Time</td>
<td>Update Time</td>
<td>Session Id</td>
</tr>
<tr>
<td>${job_info.state}</td>
## TODO for some reason, job_info.id is not the job.id
<td>${job_id}</td>
<td>${job_info.create_time}</td>
<td>${job_info.update_time}</td>
<td>${job_info.session_id}</td>
</tr>
<tr class="header">
<td colspan="3">Tool</td>
<td colspan="2">User</td>
</tr>
<tr>
<td colspan="3">${job_info.tool_id}</td>
<td colspan="2">
%if job_info.email:
${job_info.email}
%else:
anonymous
%endif
</td>
</tr>
<tr class="header">
<td colspan="5">Remote Host</td>
</tr>
<tr>
<td colspan="5">${job_info.remote_host}</td>
</tr>
<tr class="header">
<td colspan="5">Command Line</td>
</tr>
<tr>
<td colspan="5">${job_info.command_line}</td>
</tr>
<tr class="header">
<td colspan="5">Stderr</td>
</tr>
<tr>
<td colspan="5"><pre>${job_info.stderr}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Stack Trace</td>
</tr>
<tr>
<td colspan="5"><pre>${job_info.traceback}</pre></td>
</tr>
<tr class="header">
<td colspan="5">Info</td>
</tr>
<tr>
<td colspan="5">${job_info.info}</td>
</tr>
<tr><td colspan="5">&nbsp;</td></tr>
<tr><td colspan="5">&nbsp;</td></tr>
</table>
</div>
</div>
@@ -0,0 +1,35 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, status )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">Jobs Per Domain</h3>
<h4 align="center">This report does not account for unauthenticated users.</h4>
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs</td></tr>
%else:
<tr class="header">
<td>Domain</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${job[0]}</td>
<td>${job[1]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
@@ -0,0 +1,39 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, status )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">Jobs Per Month</h3>
<h4 align="center">Click Month to view the number of jobs for each day of that month</h4>
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="4">There are no jobs</td></tr>
%else:
<tr class="header">
<td>Month</td>
<td>User Jobs</td>
<td>Monitor Jobs</td>
<td>Total</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='jobs', action='specified_month_all', month=job[0] )}">${job[4]}&nbsp;${job[5]}</a></td>
<td>${job[1]}</td>
<td>${job[2]}</td>
<td>${job[3]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
@@ -0,0 +1,35 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, status )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">Jobs In Error Per Month</h3>
<h4 align="center">Click Month to view the number of jobs in error for each day of that month</h4>
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs in the error state</td></tr>
%else:
<tr class="header">
<td>Month</td>
<td>Jobs In Error</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='jobs', action='specified_month_in_error', month=job[0] )}">${job[2]}&nbsp;${job[3]}</a></td>
<td>${job[1]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
@@ -0,0 +1,35 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, status )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">Jobs Per Tool</h3>
<h4 align="center">Click Tool Id to view jobs per month for that tool</h4>
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs</td></tr>
%else:
<tr class="header">
<td>Tool id</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='jobs', action='tool_per_month', tool_id=job[0] )}">${job[0]}</a></td>
<td>${job[1]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
@@ -0,0 +1,35 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, status )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">Jobs Per User</h3>
<h4 align="center">Click User to view jobs per month for that user</h4>
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs</td></tr>
%else:
<tr class="header">
<td>User</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='jobs', action='user_per_month', email=job[0] )}">${job[0]}</a></td>
<td>${job[1]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
@@ -0,0 +1,41 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, status )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">All Jobs for ${month_label}&nbsp;${year_label}</h3>
<h4 align="center">Click Total Jobs to see jobs for that day</h4>
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="5">There are no jobs for ${month_label}&nbsp;${year_label}</td></tr>
%else:
<tr class="header">
<td>Day</td>
<td>Date</td>
<td>User Jobs</td>
<td>Monitor Jobs</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${job[0]}</td>
<td>${month_label}&nbsp;${job[5]},&nbsp;${year_label}</td>
<td>${job[2]}</td>
<td>${job[3]}</td>
<td><a href="${h.url_for( controller='jobs', action='specified_date', specified_date=job[1], webapp='reports' )}">${job[4]}</a></td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
@@ -0,0 +1,37 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, status )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">Jobs in Error for ${month_label}&nbsp;${year_label}</h3>
<h4 align="center">Click Jobs in Error to view jobs in error for that day</h4>
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="3">There are no jobs in the error state for ${month_label}&nbsp;${year_label}</td></tr>
%else:
<tr class="header">
<td>Day</td>
<td>Date</td>
<td>Jobs in Error</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${job[0]}</td>
<td>${month_label}&nbsp;${job[3]},&nbsp;${year_label}</td>
<td><a href="${h.url_for( controller='jobs', action='specified_date_in_error', specified_date=job[1] )}">${job[2]}</a></td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
@@ -0,0 +1,35 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, status )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">Jobs per month for tool "${tool_id}"</h3>
<h4 align="center">Click Total Jobs to see the tool's jobs for that month</h4>
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs for tool "${tool_id}"</td></tr>
%else:
<tr class="header">
<td>Month</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${job[2]}&nbsp;${job[3]}</td>
<td><a href="${h.url_for( controller='jobs', action='tool_for_month', tool_id=tool_id, month=job[0] )}">${job[1]}</a></td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
@@ -0,0 +1,37 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<% from galaxy import util %>
%if message:
${render_msg( message, status )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">Jobs per month for user "${util.restore_text( email )}"</h3>
<h4 align="center">Click Total Jobs to see the user's jobs for that month</h4>
<table align="center" width="60%" class="colored">
%if len( jobs ) == 0:
<tr><td colspan="2">There are no jobs for user "${email}"</td></tr>
%else:
<tr class="header">
<td>Month</td>
<td>Total Jobs</td>
</tr>
<% ctr = 0 %>
%for job in jobs:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${job[2]}&nbsp;${job[3]}</td>
<td><a href="${h.url_for( controller='jobs', action='user_for_month', email=email, month=job[0] )}">${job[1]}</a></td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
@@ -0,0 +1,21 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, status )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">Registered Users</h3>
<h4 align="center">Click Number of Registered Users to see the number of user registrations per month</h4>
<table align="center" class="colored">
%if num_users == 0:
<tr><td>There are no registered users</td></tr>
%else:
<tr class="header"><td align="center">Number of Registered Users</td></tr>
<tr class="tr"><td align="center"><a href="${h.url_for( controller='users', action='registered_users_per_month' )}">${num_users}</a></td></tr>
%endif
</table>
</div>
</div>
@@ -0,0 +1,35 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, 'done' )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">User Registrations Per Month</h3>
<h4 align="center">Click Month to view the number of user registrations for each day of that month</h4>
<table align="center" width="30%" class="colored">
%if len( users ) == 0:
<tr><td colspan="2">There are no registered users</td></tr>
%else:
<tr class="header">
<td>Month</td>
<td>Number of Registrations</td>
</tr>
<% ctr = 0 %>
%for user in users:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='users', action='specified_month', month=user[0], month_label=user[2].strip(), year_label=user[3] )}">${user[2]}&nbsp;${user[3]}</a></td>
<td>${user[1]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
@@ -0,0 +1,32 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, 'done' )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">User Registrations for ${day_label},&nbsp;${month_label}&nbsp;${day_of_month},&nbsp;${year_label}</h3>
<table align="center" width="30%" class="colored">
%if len( users ) == 0:
<tr><td colspan="2">There are no user registrations for ${day_label},&nbsp;${month_label}&nbsp;${day_of_month},&nbsp;${year_label}</td></tr>
%else:
<tr class="header">
<td>Email</td>
</tr>
<% ctr = 0 %>
%for user in users:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>${user}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
@@ -0,0 +1,35 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, 'done' )}
%endif
<div class="toolForm">
<div class="toolFormBody">
<h3 align="center">User Registrations for ${month_label}&nbsp;${year_label}</h3>
<h4 align="center">Click Day to see user registrations for that day</h4>
<table align="center" width="60%" class="colored">
%if len( users ) == 0:
<tr><td colspan="2">There are no user registrations for ${month_label}&nbsp;${year_label}</td></tr>
%else:
<tr class="header">
<td>Day</td>
<td>New Registrations</td>
</tr>
<% ctr = 0 %>
%for user in users:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td><a href="${h.url_for( controller='users', action='specified_date', specified_date=user[0], day_label=user[3], month_label=month_label, year_label=year_label, day_of_month=user[1] )}">${user[3]},&nbsp;${month_label}&nbsp;${user[1]},&nbsp;${year_label}</a></td>
<td>${user[2]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
</div>
+82
View File
@@ -0,0 +1,82 @@
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
%if message:
${render_msg( message, 'done' )}
%endif
<div class="toolForm">
<h3 align="center">Old Histories and Datasets</h3>
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr>
<td>
<form method="post" action="system">
<p>
<button name="action" value="userless_histories">Number of Histories</button>
that are not associate with a user and were last updated more than
<input type="textfield" value="${userless_histories_days}" size="3" name="userless_histories_days">
days ago.
</p>
<p>
<button name="action" value="deleted_histories">Number of Histories</button>
that were deleted more than
<input type="textfield" value="${deleted_histories_days}" size="3" name="deleted_histories_days">
days ago but have not yet been purged.
</p>
<p>
<button name="action" value="deleted_datasets">Number of Datasets</button>
that were deleted more than
<input type="textfield" value="${deleted_datasets_days}" size="3" name="deleted_datasets_days">
days ago but have not yet been purged.
</p>
</form>
</td>
</tr>
</table>
<br clear="left" /><br />
<h3 align="center">Current Disk Space Where Datasets are Stored</h3>
<table align="center" width="60%" class="colored">
<tr><td colspan="5"><div class="toolFormTitle">Disk Usage for ${file_path}</div></td></tr>
<tr class="header">
<td>File System</td>
<td>Disk Size</td>
<td>Used</td>
<td>Available</td>
<td>Percent Used</td>
</tr>
<tr class="tr">
<td>${disk_usage[0]}</td>
<td>${disk_usage[1]}</td>
<td>${disk_usage[2]}</td>
<td>${disk_usage[3]}</td>
<td>${disk_usage[4]}</td>
</tr>
%if len( datasets ) == 0:
<tr class="header"><td colspan="5">There are no datasets larger than ${file_size_str}</td></tr>
%else:
<tr><td colspan="5"><div class="toolFormTitle">${len( datasets )} largest datasets over ${file_size_str}</div></td></tr>
<tr class="header">
<td>File</td>
<td>Last Updated</td>
<td>History ID</td>
<td>Deleted</td>
<td>Size on Disk</td>
</tr>
<% ctr = 0 %>
%for dataset in datasets:
%if ctr % 2 == 1:
<tr class="odd_row">
%else:
<tr class="tr">
%endif
<td>dataset_${dataset[0]}.dat</td>
<td>${dataset[1]}</td>
<td>${dataset[2]}</td>
<td>${dataset[3]}</td>
<td>${dataset[4]}</td>
</tr>
<% ctr += 1 %>
%endfor
%endif
</table>
</div>
@@ -1,13 +1,13 @@
<%inherit file="/base_panels.mako"/>
<%inherit file="/base.mako"/>
<%namespace file="/message.mako" import="render_msg" />
<%def name="main_body()">
%if message:
${render_msg( message, status )}
%endif
<div class="toolForm">
<h3 align="center">Date of Last Galaxy Login</h3>
<h4 align="center">Listed in descending order by access date ( oldest date first )</h4>
%if msg:
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
<tr><td class="ok_bgr">${msg}</td></tr>
</table>
%endif
<table align="center" width="70%" class="colored" cellpadding="5" cellspacing="5">
<tr>
<td>
@@ -48,4 +48,4 @@
<tr><td>All users have logged in to Galaxy within the past ${not_logged_in_for_days} days</td></tr>
%endif
</table>
</%def>
</div>