diff --git a/share/jupyter/hub/static/js/admin.js b/share/jupyter/hub/static/js/admin.js index 448674e6..4dc6eced 100644 --- a/share/jupyter/hub/static/js/admin.js +++ b/share/jupyter/hub/static/js/admin.js @@ -172,11 +172,27 @@ require(["jquery", "bootstrap", "moment", "jhapi", "utils"], function ($, bs, mo $("#stop-all-servers-dialog").modal(); }); + $("#start-all-servers").click(function () { + $("#start-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(); }); + function start(el) { + return function(){ + $(el).click(); + } + } + + $("#start-all-servers-dialog").find(".start-all-button").click(function () { + $('.start-server').not('.hidden').each(function(i){ + setTimeout(start(this), i * 500); + }); + }); + $("#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 0d00ad4a..6cf24e0b 100644 --- a/share/jupyter/hub/templates/admin.html +++ b/share/jupyter/hub/templates/admin.html @@ -33,7 +33,10 @@ Add Users - Stop All + + Start All + Stop All + Shutdown Hub @@ -76,6 +79,10 @@ 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-success 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: