{% 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 %}
Add Users Start All Stop All Shutdown Hub
{{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 -%} stop server start server {%- if admin_access %} access server {%- endif %} {%- if spawner.name == '' -%} edit user {%- endif -%} {%- if spawner.name == '' -%} {#- user row -#} {%- if user.name != current_user.name -%} delete user {%- 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('Delete User', btn_class='btn-danger delete-button') %} Are you sure you want to delete user USER? This operation cannot be undone. {% endcall %} {% call modal('Stop All Servers', btn_label='Stop All', btn_class='btn-danger stop-all-button') %} Are you sure you want to stop all your users' servers? Kernels will be shutdown and unsaved data may be lost. {% endcall %} {% 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 %}