mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-13 23:36:58 +00:00
ui: buttons: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
063997ed16
commit
f729096099
@ -33,14 +33,31 @@ Ext.define('PVE.button.ConsoleButton', {
|
||||
me.down('#xtermjs').setDisabled(!enable);
|
||||
},
|
||||
|
||||
handler: function() {
|
||||
var me = this;
|
||||
var consoles = {
|
||||
spice: me.enableSpice,
|
||||
xtermjs: me.enableXtermjs,
|
||||
};
|
||||
PVE.Utils.openDefaultConsoleWindow(consoles, me.consoleType, me.vmid,
|
||||
me.nodename, me.consoleName, me.cmd);
|
||||
handler: function() { // main, general, handler
|
||||
let me = this;
|
||||
PVE.Utils.openDefaultConsoleWindow(
|
||||
{
|
||||
spice: me.enableSpice,
|
||||
xtermjs: me.enableXtermjs,
|
||||
},
|
||||
me.consoleType,
|
||||
me.vmid,
|
||||
me.nodename,
|
||||
me.consoleName,
|
||||
me.cmd,
|
||||
);
|
||||
},
|
||||
|
||||
openConsole: function(types) { // used by split-menu buttons
|
||||
let me = this;
|
||||
PVE.Utils.openConsoleWindow(
|
||||
types,
|
||||
me.consoleType,
|
||||
me.vmid,
|
||||
me.nodename,
|
||||
me.consoleName,
|
||||
me.cmd,
|
||||
);
|
||||
},
|
||||
|
||||
menu: [
|
||||
@ -50,8 +67,8 @@ Ext.define('PVE.button.ConsoleButton', {
|
||||
iconCls: 'pve-itype-icon-novnc',
|
||||
type: 'html5',
|
||||
handler: function(button) {
|
||||
var me = this.up('button');
|
||||
PVE.Utils.openConsoleWindow(button.type, me.consoleType, me.vmid, me.nodename, me.consoleName, me.cmd);
|
||||
let view = this.up('button');
|
||||
view.openConsole(button.type);
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -61,8 +78,8 @@ Ext.define('PVE.button.ConsoleButton', {
|
||||
type: 'vv',
|
||||
iconCls: 'pve-itype-icon-virt-viewer',
|
||||
handler: function(button) {
|
||||
var me = this.up('button');
|
||||
PVE.Utils.openConsoleWindow(button.type, me.consoleType, me.vmid, me.nodename, me.consoleName, me.cmd);
|
||||
let view = this.up('button');
|
||||
view.openConsole(button.type);
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -71,14 +88,14 @@ Ext.define('PVE.button.ConsoleButton', {
|
||||
iconCls: 'pve-itype-icon-xtermjs',
|
||||
type: 'xtermjs',
|
||||
handler: function(button) {
|
||||
var me = this.up('button');
|
||||
PVE.Utils.openConsoleWindow(button.type, me.consoleType, me.vmid, me.nodename, me.consoleName, me.cmd);
|
||||
let view = this.up('button');
|
||||
view.openConsole(button.type);
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
initComponent: function() {
|
||||
var me = this;
|
||||
let me = this;
|
||||
|
||||
if (!me.nodename) {
|
||||
throw "no node name specified";
|
||||
|
@ -12,7 +12,9 @@ Ext.define('PVE.button.Split', {
|
||||
selModel: undefined,
|
||||
|
||||
// if 'false' handler will not be called (button disabled)
|
||||
enableFn: function(record) { },
|
||||
enableFn: function(record) {
|
||||
// do nothing
|
||||
},
|
||||
|
||||
// function(record) or text
|
||||
confirmMsg: false,
|
||||
|
Loading…
Reference in New Issue
Block a user