{# Copied from https://github.com/InfuseAI/jupyterhub/blob/5c94e4f/share/jupyterhub/templates/admin.html #} {% extends "page.html" %} {% macro th(label, key='', colspan=1) %} {{label}} {% if key %} {% endif %} {% endmacro %} {% block main %}
{% block thead %} {{ th("User", 'name') }} {{ th("Admin", 'admin') }} {{ th("Last Activity", 'last_activity') }} {{ th("Running (%i)" % running|length, 'running', colspan=2) }} {% endblock thead %} {% for user in users %} {% for spawner in user.all_spawners() %} {% block user_row scoped %} {% endblock user_row %} {% endfor %} {% endfor %}
{{user.name}} {%- if spawner.name -%} /{{ spawner.name }} {%- endif -%} {%- if spawner.name == '' -%} {% if user.admin %}admin{% endif %} {%- endif -%} {%- if spawner.last_activity -%} {{ spawner.last_activity.isoformat() + 'Z' }} {%- else -%} Never {%- endif -%} {%- if admin_access %} Access Server {%- endif %} Stop server {%- if spawner.name == '' -%} {#- user row -#} {%- if user.name != current_user.name -%} Remove From Instance {%- endif -%} {%- else -%} {#- named spawner row -#} delete server {%- endif -%}
{% if pagination.links %} {% endif %} Displaying users {{ pagination.info.start|safe }} - {{ pagination.info.end|safe }} of {{ pagination.info.total|safe }}
{% call modal('Start All Servers', btn_label='Start All', btn_class='btn-primary start-all-button') %} Are you sure you want to start all servers? This can slam your server resources. {% endcall %} {% call modal('Shutdown Hub', btn_label='Shutdown', btn_class='btn-danger shutdown-button') %} Are you sure you want to shutdown the Hub? You can choose to leave the proxy and/or single-user servers running by unchecking the boxes below:
{% endcall %} {% macro user_modal(name, multi=False) %} {% call modal(name, btn_class='btn-primary save-button') %}
<{%- if multi -%} textarea {%- else -%} input type="text" {%- endif %} class="form-control username-input" placeholder="{%- if multi -%} usernames separated by lines{%- else -%} username {%-endif-%}"> {%- if multi -%}{%- endif -%}
{% endcall %} {% endmacro %} {{ user_modal('Edit User') }} {{ user_modal('Add Users', multi=True) }} {% endblock %} {% block footer %} {% endblock %} {% block script %} {{ super() }} {% endblock %}