commit e5692bca4842d3a904d7b199336603349fc908da Author: Florian Best Date: Wed Oct 22 23:36:40 2014 +0200 Bug #35654: add a reboot menu entry diff --git a/ucs-4.0-0/management/univention-management-console-frontend/umc/app.js b/ucs-4.0-0/management/univention-management-console-frontend/umc/app.js index 5ffa37b..6769e0d 100644 --- a/ucs-4.0-0/management/univention-management-console-frontend/umc/app.js +++ b/ucs-4.0-0/management/univention-management-console-frontend/umc/app.js @@ -655,6 +655,25 @@ define([ } }, + addRebootMenu: function() { + //if (!require('umc/app').getModule('lib')) { + // return; // no permissions to reboot the server + //} + try { + var libServer = require('umc/modules/lib/server'); + } catch (error) { + return; // module has not been loaded before, so we don't have permissions... cooler would be the commented out thing from above + } + this._headerMenu.addChild(new MenuItem({ + id: 'umcMenuReboot', + iconClass: 'icon24-umc-menu-reboot', + label: _('Reboot server'), + onClick: function() { + libServer.askReboot(); + } + })); + }, + setupSearchField: function() { // add an empty element to force a line break this._headerRight.addChild(new Text({ @@ -1091,6 +1110,8 @@ define([ if (tools.status('overview')) { topic.publish('/umc/startup/checks'); } + + this._header.addRebootMenu(); })); this._setupStaticGui = true;