{% extends "page.html" %} {% macro th(label, key='', colspan=1) %} {{label}} {% if key %} {% endif %} {% endmacro %} {% block main %}
{% block thead %} {{ th("User (%i)" % users|length, 'name') }} {{ th("Admin", 'admin') }} {{ th("Last Seen", 'last_activity') }} {{ th("Running (%i)" % running|length, 'running', colspan=2) }} {% endblock thead %} {% for u in users %} {% block user_row scoped %} {% endblock user_row %} {% endfor %}
Add Users Start All Stop All Shutdown Hub
{{u.name}} {% if u.admin %}admin{% endif %} {%- if u.last_activity -%} {{ u.last_activity.isoformat() + 'Z' }} {%- else -%} Never {%- endif -%} stop server start server {% if admin_access %} access server {% endif %} edit {% if u.name != user.name %} delete {% endif %}
{% 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 script %} {{ super() }} {% endblock %}