add versioninfo component

this gets the current version from the api and displays it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-04-04 13:48:46 +02:00 committed by Dietmar Maurer
parent 9e3180e7c7
commit ca6f3037f6

32
js/VersionInfo.js Normal file
View File

@ -0,0 +1,32 @@
Ext.define('PMG.view.main.VersionInfo',{
extend: 'Ext.Component',
xtype: 'versioninfo',
makeApiCall: true,
data: {
version: false
},
tpl: [
'Mail Gateway',
'<tpl if="version">',
' {version}-{release}/{repoid}',
'</tpl>'
],
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);
}
});
}
}
});