Commit 6929105e authored by Dietmar Maurer's avatar Dietmar Maurer

copy button/ConsoleButton.js from manager to manager5

parent f30638db
Ext.define('PVE.button.ConsoleButton', {
extend: 'Ext.button.Split',
alias: 'widget.pveConsoleButton',
consoleType: 'shell', // one of 'shell', 'kvm', 'lxc', 'upgrade'
consoleName: undefined,
enableSpice: true,
nodename: undefined,
vmid: 0,
setEnableSpice: function(enable){
var me = this;
me.enableSpice = enable;
me.spiceMenu.setDisabled(!enable);
},
initComponent: function() {
var me = this;
if (!me.nodename) {
throw "no node name specified";
}
me.spiceMenu = Ext.create('Ext.menu.Item', {
text: 'SPICE',
iconCls: 'pve-itype-icon-virt-viewer',
handler: function() {
PVE.Utils.openConsoleWindow('vv', me.consoleType, me.vmid, me.nodename, me.consoleName);
}
});
var noVncMenu = Ext.create('Ext.menu.Item', {
text: 'noVNC',
iconCls: 'pve-itype-icon-novnc',
handler: function() {
PVE.Utils.openConsoleWindow('html5', me.consoleType, me.vmid, me.nodename, me.consoleName);
}
});
Ext.applyIf(me, { text: gettext('Console') });
Ext.apply(me, {
handler: function() {
PVE.Utils.openDefaultConsoleWindow(me.enableSpice, me.consoleType, me.vmid,
me.nodename, me.consoleName);
},
menu: new Ext.menu.Menu({
items: [ noVncMenu, me.spiceMenu ]
})
});
me.callParent();
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment