if (loginData) {
PVE.data.ResourceStore.startUpdate();
+
+ PVE.Utils.API2Request({
+ url: '/version',
+ method: 'GET',
+ success: function(response) {
+ PVE.VersionInfo = response.result.data;
+ me.updateVersionInfo();
+ }
+ });
}
},
ui.doLayout();
},
+ updateVersionInfo: function() {
+ var me = this;
+
+ var ui = me.query('#versioninfo')[0];
+
+ if (PVE.VersionInfo) {
+ var version = PVE.VersionInfo.version + '-' + PVE.VersionInfo.release + '/' +
+ PVE.VersionInfo.repoid;
+ ui.update('<span class="x-panel-header-text">Proxmox Virtual Environment<br>' + gettext('Version') + ': ' + version + "</span>");
+ } else {
+ ui.update('<span class="x-panel-header-text">Proxmox Virtual Environment</span>');
+ }
+ ui.doLayout();
+ },
+
initComponent : function() {
var me = this;
{
minWidth: 200,
flex: 1,
- html: '<span class="x-panel-header-text">Proxmox Virtual Environment<br>' + gettext('Version') + ' ' + PVE.GUIVersion + "</span>"
+ id: 'versioninfo',
+ html: '<span class="x-panel-header-text">Proxmox Virtual Environment</span>'
},
{
pack: 'end',
use mod_perl2 '1.9922';
use Encode;
use CGI;
-use PVE::pvecfg;
use PVE::JSONSchema;
use PVE::AccessControl;
use PVE::REST;
$token = PVE::AccessControl::assemble_csrf_prevention_token($username);
}
}
-my $version = PVE::pvecfg::version_text();
+
$username = '' if !$username;
my $cgi = CGI->new($r);
my $jssrc = <<_EOJS;
if (!PVE) PVE = {};
-PVE.GUIVersion = '$version';
PVE.UserName = '$username';
PVE.CSRFPreventionToken = '$token';
_EOJS