add VersionInfo.js

This commit is contained in:
Dietmar Maurer 2018-12-04 17:58:40 +01:00
parent 5c7a1b15c8
commit e4dc0a14ac
3 changed files with 35 additions and 2 deletions

View File

@ -56,8 +56,7 @@ Ext.define('PBS.MainView', {
xtype: 'proxmoxlogo' xtype: 'proxmoxlogo'
}, },
{ {
//xtype: 'versioninfo' xtype: 'versioninfo'
html: "version"
}, },
{ {
flex: 1 flex: 1

View File

@ -1,5 +1,6 @@
JSSRC= \ JSSRC= \
Logo.js \ Logo.js \
VersionInfo.js \
Application.js \ Application.js \
MainView.js MainView.js

33
www/VersionInfo.js Normal file
View File

@ -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',
'<tpl if="version">',
' {version}-{release}',
'</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);
}
});
}
}
});