mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-08-14 16:14:18 +00:00
js/ServerAdministration.js - enable upgrade button inside controller init
Because Proxmox.UserName may not be set at class load time.
This commit is contained in:
parent
7b18909823
commit
cea4e924e7
@ -8,6 +8,15 @@ Ext.define('PMG.ServerAdministration', {
|
||||
border: false,
|
||||
defaults: { border: false },
|
||||
|
||||
controller: {
|
||||
xclass: 'Ext.app.ViewController',
|
||||
|
||||
init: function(view) {
|
||||
var upgradeBtn = view.lookupReference('upgradeBtn');
|
||||
upgradeBtn.setDisabled(!(Proxmox.UserName && Proxmox.UserName === 'root@pam'));
|
||||
}
|
||||
},
|
||||
|
||||
items: [
|
||||
{
|
||||
xtype: 'pmgServerStatus',
|
||||
@ -29,7 +38,8 @@ Ext.define('PMG.ServerAdministration', {
|
||||
title: gettext('Updates'),
|
||||
upgradeBtn: {
|
||||
xtype: 'button',
|
||||
disabled: !(Proxmox.UserName && Proxmox.UserName === 'root@pam'),
|
||||
reference: 'upgradeBtn',
|
||||
disabled: true,
|
||||
text: gettext('Upgrade'),
|
||||
handler: function() {
|
||||
PMG.Utils.openVNCViewer('upgrade', Proxmox.NodeName);
|
||||
|
Loading…
Reference in New Issue
Block a user