[pve-devel] [PATCH 06/18] add versioninfo component

Dominik Csapak d.csapak at proxmox.com
Tue Apr 4 13:48:46 CEST 2017


this gets the current version from the api and displays it

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 js/VersionInfo.js | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 js/VersionInfo.js

diff --git a/js/VersionInfo.js b/js/VersionInfo.js
new file mode 100644
index 0000000..22e062f
--- /dev/null
+++ b/js/VersionInfo.js
@@ -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);
+		}
+	    });
+	}
+    }
+});
-- 
2.11.0





More information about the pve-devel mailing list