mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-08-15 11:24:32 +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,
|
border: false,
|
||||||
defaults: { 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: [
|
items: [
|
||||||
{
|
{
|
||||||
xtype: 'pmgServerStatus',
|
xtype: 'pmgServerStatus',
|
||||||
@ -29,7 +38,8 @@ Ext.define('PMG.ServerAdministration', {
|
|||||||
title: gettext('Updates'),
|
title: gettext('Updates'),
|
||||||
upgradeBtn: {
|
upgradeBtn: {
|
||||||
xtype: 'button',
|
xtype: 'button',
|
||||||
disabled: !(Proxmox.UserName && Proxmox.UserName === 'root@pam'),
|
reference: 'upgradeBtn',
|
||||||
|
disabled: true,
|
||||||
text: gettext('Upgrade'),
|
text: gettext('Upgrade'),
|
||||||
handler: function() {
|
handler: function() {
|
||||||
PMG.Utils.openVNCViewer('upgrade', Proxmox.NodeName);
|
PMG.Utils.openVNCViewer('upgrade', Proxmox.NodeName);
|
||||||
|
Loading…
Reference in New Issue
Block a user