diff --git a/share/jupyter/hub/static/js/admin.js b/share/jupyter/hub/static/js/admin.js index 30b22a38..cb5c9cc6 100644 --- a/share/jupyter/hub/static/js/admin.js +++ b/share/jupyter/hub/static/js/admin.js @@ -178,6 +178,15 @@ require(["jquery", "bootstrap", "moment", "jhapi", "utils"], function ($, bs, mo }); }); + $("#stop-all-servers").click(function () { + $("#stop-all-servers-dialog").modal(); + }); + + $("#stop-all-servers-dialog").find(".stop-all-button").click(function () { + // stop all clicks all the active stop buttons + $('.stop-server').not('.hidden').click(); + }); + $("#shutdown-hub").click(function () { var dialog = $("#shutdown-hub-dialog"); dialog.find("input[type=checkbox]").prop("checked", true); diff --git a/share/jupyter/hub/templates/admin.html b/share/jupyter/hub/templates/admin.html index 5e7878fe..592bc536 100644 --- a/share/jupyter/hub/templates/admin.html +++ b/share/jupyter/hub/templates/admin.html @@ -32,8 +32,9 @@ - Add User - Shutdown Hub + Add Users + Stop All + Shutdown Hub {% for u in users %} @@ -71,6 +72,10 @@ 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('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: @@ -108,7 +113,7 @@ {{ user_modal('Edit User') }} -{{ user_modal('Add User', multi=True) }} +{{ user_modal('Add Users', multi=True) }} {% endblock %}