[pve-devel] [PATCH widget-toolkit 2/3] add PMX.image.Logo

Dominik Csapak d.csapak at proxmox.com
Fri May 15 10:19:25 CEST 2020


copied from pmg-gui, adapted to be able to set a custom url prefix
when we want to use something other than '/pve2'

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 Logo.js  | 21 +++++++++++++++++++++
 Makefile |  1 +
 2 files changed, 22 insertions(+)
 create mode 100644 Logo.js

diff --git a/Logo.js b/Logo.js
new file mode 100644
index 0000000..78d9aad
--- /dev/null
+++ b/Logo.js
@@ -0,0 +1,21 @@
+Ext.define('PMX.image.Logo', {
+    extend: 'Ext.Img',
+    xtype: 'proxmoxlogo',
+
+    height: 30,
+    width: 172,
+    src: '/images/proxmox_logo.png',
+    alt: 'Proxmox',
+    autoEl: {
+	tag: 'a',
+	href: 'https://www.proxmox.com',
+	target: '_blank',
+    },
+
+    initComponent: function() {
+	let me = this;
+	let prefix = me.prefix !== undefined ? me.prefix : '/pve2';
+	me.src = prefix + me.src;
+	me.callParent();
+    },
+});
diff --git a/Makefile b/Makefile
index 2907419..85fad6b 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,7 @@ SUBDIRS= css images
 JSSRC=					\
 	Utils.js			\
 	Toolkit.js			\
+	Logo.js				\
 	mixin/CBind.js			\
 	data/reader/JsonObject.js	\
 	data/ProxmoxProxy.js		\
-- 
2.20.1





More information about the pve-devel mailing list