diff --git a/share/jupyter/hub/static/js/admin.js b/share/jupyter/hub/static/js/admin.js index 78ac8ef2..5ff1d978 100644 --- a/share/jupyter/hub/static/js/admin.js +++ b/share/jupyter/hub/static/js/admin.js @@ -42,6 +42,9 @@ require(["jquery", "bootstrap", "moment", "jhapi", "utils"], function ($, bs, mo $("th").map(function (i, th) { th = $(th); var col = th.data('sort'); + if (!col || col.length == 0) { + return; + } var order = th.find('i').hasClass('fa-sort-desc') ? 'asc':'desc'; th.find('a').click( function () { diff --git a/share/jupyter/hub/templates/admin.html b/share/jupyter/hub/templates/admin.html index 5fdd50ea..7e072f01 100644 --- a/share/jupyter/hub/templates/admin.html +++ b/share/jupyter/hub/templates/admin.html @@ -1,15 +1,17 @@ {% extends "page.html" %} -{% macro th(key, label, order, colspan) %} +{% macro th(label, key='', colspan=1) %} {{label}} - + {% endif %} {% endmacro %} @@ -19,10 +21,12 @@ - {{ th('name', "User (%i)" % users.count(), sort.get('name'), 1) }} - {{ th('admin', "Admin", sort.get('admin'), 1) }} - {{ th('last_activity', "Last Seen", sort.get('last_activity'), 1) }} - {{ th('running', "Running (%i)" % running.count(), sort.get('running'), 2) }} + {% block thead %} + {{ th("User (%i)" % users.count(), 'name') }} + {{ th("Admin", 'admin') }} + {{ th("Last Seen", 'last_activity') }} + {{ th("Running (%i)" % running.count(), 'running', colspan=2) }} + {% endblock thead %} @@ -33,6 +37,7 @@ {% for u in users %} + {% block user_row scoped %} @@ -49,6 +54,7 @@ delete {% endif %} + {% endblock user_row %} {% endfor %}
{{u.name}} {% if u.admin %}admin{% endif %} {{u.last_activity.isoformat() + 'Z'}}