diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-01-13 15:05:58 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-01-13 15:06:05 +0100 |
commit | 7ec0fe0237570367de259b69bd71a8add7fa10b9 (patch) | |
tree | 707732ade3df3aacb62f3b0d91463d2a70339963 /server/sonar-web/src/main/js/apps/update-center/header-view.js | |
parent | bdadbd0391944ec43d2bee8d499a99e6b0057bb7 (diff) | |
download | sonarqube-7ec0fe0237570367de259b69bd71a8add7fa10b9.tar.gz sonarqube-7ec0fe0237570367de259b69bd71a8add7fa10b9.zip |
SONAR-1976 Administrators should be able to request a server restart from web console
Diffstat (limited to 'server/sonar-web/src/main/js/apps/update-center/header-view.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/update-center/header-view.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/update-center/header-view.js b/server/sonar-web/src/main/js/apps/update-center/header-view.js index 4d2672f4f85..0ed3a8f8962 100644 --- a/server/sonar-web/src/main/js/apps/update-center/header-view.js +++ b/server/sonar-web/src/main/js/apps/update-center/header-view.js @@ -20,6 +20,7 @@ import _ from 'underscore'; import Marionette from 'backbone.marionette'; import Template from './templates/update-center-header.hbs'; +import { restartAndWait } from '../../api/system'; export default Marionette.ItemView.extend({ template: Template, @@ -29,17 +30,31 @@ export default Marionette.ItemView.extend({ }, events: { + 'click .js-restart': 'restart', 'click .js-cancel-all': 'cancelAll' }, - cancelAll: function () { + initialize () { + this.restarting = false; + }, + + restart () { + this.restarting = true; + this.render(); + restartAndWait().then(() => { + document.location.reload(true); + }); + }, + + cancelAll () { this.collection.cancelAll(); }, - serializeData: function () { + serializeData () { return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { installing: this.collection._installedCount, - uninstalling: this.collection._uninstalledCount + uninstalling: this.collection._uninstalledCount, + restarting: this.restarting }); } }); |