diff --git a/www/MainView.js b/www/MainView.js index 97afe487..edff93f4 100644 --- a/www/MainView.js +++ b/www/MainView.js @@ -56,8 +56,7 @@ Ext.define('PBS.MainView', { xtype: 'proxmoxlogo' }, { - //xtype: 'versioninfo' - html: "version" + xtype: 'versioninfo' }, { flex: 1 diff --git a/www/Makefile b/www/Makefile index 270b1ccb..7260e1e9 100644 --- a/www/Makefile +++ b/www/Makefile @@ -1,5 +1,6 @@ JSSRC= \ Logo.js \ + VersionInfo.js \ Application.js \ MainView.js diff --git a/www/VersionInfo.js b/www/VersionInfo.js new file mode 100644 index 00000000..0112825c --- /dev/null +++ b/www/VersionInfo.js @@ -0,0 +1,33 @@ +/*global Proxmox*/ +Ext.define('PBS.view.main.VersionInfo',{ + extend: 'Ext.Component', + xtype: 'versioninfo', + + makeApiCall: true, + + data: { + version: false + }, + + tpl: [ + 'Backup Server', + '', + ' {version}-{release}', + '' + ], + + initComponent: function() { + var me = this; + me.callParent(); + + if (me.makeApiCall) { + Proxmox.Utils.API2Request({ + url: '/version', + method: 'GET', + success: function(response) { + me.update(response.result.data); + } + }); + } + } +});