add Shutdown Hub button to Admin page

with dialog and checkboxes for cleaning up servers and/or proxy
This commit is contained in:
Min RK
2015-02-28 12:20:45 -08:00
parent e39388f7a2
commit d089f7433d
4 changed files with 62 additions and 18 deletions

View File

@@ -10,7 +10,7 @@ define(['jquery', 'utils'], function ($, utils) {
var default_options = {
type: 'GET',
headers: {'Content-Type': 'application/json'},
contentType: "application/json",
cache: false,
dataType : "json",
processData: false,
@@ -122,5 +122,14 @@ define(['jquery', 'utils'], function ($, utils) {
);
};
JHAPI.prototype.shutdown_hub = function (data, options) {
options = options || {};
options = update(options, {type: 'POST'});
if (data) {
options.data = JSON.stringify(data);
}
this.api_request('shutdown', options);
};
return JHAPI;
});