Merge pull request #1531 from thedataincubator/start_all_button

"Start All" button on admin page
This commit is contained in:
Min RK
2017-11-27 12:52:26 +01:00
committed by GitHub
2 changed files with 24 additions and 1 deletions

View File

@@ -172,11 +172,27 @@ require(["jquery", "bootstrap", "moment", "jhapi", "utils"], function ($, bs, mo
$("#stop-all-servers-dialog").modal(); $("#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-servers-dialog").find(".stop-all-button").click(function () {
// stop all clicks all the active stop buttons // stop all clicks all the active stop buttons
$('.stop-server').not('.hidden').click(); $('.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 () { $("#shutdown-hub").click(function () {
var dialog = $("#shutdown-hub-dialog"); var dialog = $("#shutdown-hub-dialog");
dialog.find("input[type=checkbox]").prop("checked", true); dialog.find("input[type=checkbox]").prop("checked", true);

View File

@@ -33,7 +33,10 @@
<tr class="user-row add-user-row"> <tr class="user-row add-user-row">
<td colspan="12"> <td colspan="12">
<a id="add-users" role="button" class="col-xs-2 btn btn-default">Add Users</a> <a id="add-users" role="button" class="col-xs-2 btn btn-default">Add Users</a>
<a id="stop-all-servers" role="button" class="col-xs-2 col-xs-offset-5 btn btn-danger">Stop All</a> <span class="col-xs-offset-4 col-xs-3">
<a id="start-all-servers" role="button" class="btn btn-success col-xs-5 col-xs-offset-1">Start All</a>
<a id="stop-all-servers" role="button" class="btn btn-danger col-xs-5 col-xs-offset-1">Stop All</a>
</span>
<a id="shutdown-hub" role="button" class="col-xs-2 col-xs-offset-1 btn btn-danger">Shutdown Hub</a> <a id="shutdown-hub" role="button" class="col-xs-2 col-xs-offset-1 btn btn-danger">Shutdown Hub</a>
</td> </td>
</tr> </tr>
@@ -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. Are you sure you want to stop all your users' servers? Kernels will be shutdown and unsaved data may be lost.
{% endcall %} {% 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') %} {% call modal('Shutdown Hub', btn_label='Shutdown', btn_class='btn-danger shutdown-button') %}
Are you sure you want to shutdown the Hub? 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: You can choose to leave the proxy and/or single-user servers running by unchecking the boxes below: