commit/galaxy-central: natefoo: Reports: Add a per-user disk usage report.
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/0d6106a6941f/ changeset: 0d6106a6941f user: natefoo date: 2011-08-16 16:40:10 summary: Reports: Add a per-user disk usage report. affected #: 3 files (827 bytes) --- a/lib/galaxy/webapps/reports/controllers/users.py Mon Aug 15 16:12:12 2011 -0400 +++ b/lib/galaxy/webapps/reports/controllers/users.py Tue Aug 16 10:40:10 2011 -0400 @@ -116,3 +116,16 @@ users=users, not_logged_in_for_days=not_logged_in_for_days, message=message ) + + @web.expose + def user_disk_usage( self, trans, **kwd ): + message = util.restore_text( kwd.get( 'message', '' ) ) + user_cutoff = int( kwd.get( 'user_cutoff', 0 ) ) + # disk_usage isn't indexed + users = sorted( trans.sa_session.query( galaxy.model.User ).all(), key=operator.attrgetter( 'disk_usage' ), reverse=True ) + if user_cutoff: + users = users[:user_cutoff] + return trans.fill_template( '/webapps/reports/users_user_disk_usage.mako', + users=users, + user_cutoff=user_cutoff, + message=message ) --- a/templates/webapps/reports/index.mako Mon Aug 15 16:12:12 2011 -0400 +++ b/templates/webapps/reports/index.mako Tue Aug 16 10:40:10 2011 -0400 @@ -87,6 +87,7 @@ <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 class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='users', action='user_disk_usage' )}">User disk usage</a></div></div></div><div class="toolSectionPad"></div> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket