add ServerStatus.js GUI with Reboot and Shutdown buttons
This commit is contained in:
parent
ed751dc2ab
commit
ecb53af6d9
@ -16,6 +16,7 @@ JSSRC= \
|
|||||||
DataStoreConfig.js \
|
DataStoreConfig.js \
|
||||||
DataStoreStatus.js \
|
DataStoreStatus.js \
|
||||||
DataStoreContent.js \
|
DataStoreContent.js \
|
||||||
|
ServerStatus.js \
|
||||||
ServerAdministration.js \
|
ServerAdministration.js \
|
||||||
Dashboard.js \
|
Dashboard.js \
|
||||||
NavigationTree.js \
|
NavigationTree.js \
|
||||||
|
@ -18,10 +18,10 @@ Ext.define('PBS.ServerAdministration', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
items: [
|
items: [
|
||||||
// {
|
{
|
||||||
// xtype: 'pbsServerStatus',
|
xtype: 'pbsServerStatus',
|
||||||
// itemId: 'status'
|
itemId: 'status'
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
xtype: 'proxmoxNodeServiceView',
|
xtype: 'proxmoxNodeServiceView',
|
||||||
title: gettext('Services'),
|
title: gettext('Services'),
|
||||||
|
49
www/ServerStatus.js
Normal file
49
www/ServerStatus.js
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
Ext.define('PBS.ServerStatus', {
|
||||||
|
extend: 'Ext.panel.Panel',
|
||||||
|
alias: 'widget.pbsServerStatus',
|
||||||
|
|
||||||
|
title: gettext('ServerStatus'),
|
||||||
|
|
||||||
|
html: "Add Something usefule here ?",
|
||||||
|
|
||||||
|
initComponent: function() {
|
||||||
|
var me = this;
|
||||||
|
|
||||||
|
var node_command = function(cmd) {
|
||||||
|
Proxmox.Utils.API2Request({
|
||||||
|
params: { command: cmd },
|
||||||
|
url: '/nodes/localhost/status',
|
||||||
|
method: 'POST',
|
||||||
|
waitMsgTarget: me,
|
||||||
|
failure: function(response, opts) {
|
||||||
|
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var restartBtn = Ext.create('Proxmox.button.Button', {
|
||||||
|
text: gettext('Reboot'),
|
||||||
|
dangerous: true,
|
||||||
|
confirmMsg: gettext("Reboot backup server?"),
|
||||||
|
handler: function() {
|
||||||
|
node_command('reboot');
|
||||||
|
},
|
||||||
|
iconCls: 'fa fa-undo'
|
||||||
|
});
|
||||||
|
|
||||||
|
var shutdownBtn = Ext.create('Proxmox.button.Button', {
|
||||||
|
text: gettext('Shutdown'),
|
||||||
|
dangerous: true,
|
||||||
|
confirmMsg: gettext("Shutdown backup server?"),
|
||||||
|
handler: function() {
|
||||||
|
node_command('shutdown');
|
||||||
|
},
|
||||||
|
iconCls: 'fa fa-power-off'
|
||||||
|
});
|
||||||
|
|
||||||
|
me.tbar = [ restartBtn, shutdownBtn ];
|
||||||
|
|
||||||
|
me.callParent();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user