From 43820371105b0776602067661e4ca3dd17b95327 Mon Sep 17 00:00:00 2001 From: Christian Moscardi Date: Fri, 10 Nov 2017 11:51:29 -0500 Subject: [PATCH 1/2] start all button --- share/jupyter/hub/static/js/admin.js | 16 ++++++++++++++++ share/jupyter/hub/templates/admin.html | 9 ++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) 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 38855b29..4991ce0e 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: From 760a640c6a7e5d1bbba2b9b506118e408cd046a2 Mon Sep 17 00:00:00 2001 From: Christian Moscardi Date: Fri, 17 Nov 2017 19:19:13 -0500 Subject: [PATCH 2/2] alternate, horizontal layout --- share/jupyter/hub/templates/admin.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/jupyter/hub/templates/admin.html b/share/jupyter/hub/templates/admin.html index 4991ce0e..7d3b5034 100644 --- a/share/jupyter/hub/templates/admin.html +++ b/share/jupyter/hub/templates/admin.html @@ -33,9 +33,9 @@ Add Users - - Start All - Stop All + + Start All + Stop All Shutdown Hub