[pve-devel] [PATCH manager v2 01/29] add proxmox-widget-toolkit to pve gui

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Dec 19 08:54:53 CET 2017


From: Dominik Csapak <d.csapak at proxmox.com>

we will use components from proxmox-widget-toolkit rather than
directly from pve-manager

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 PVE/Service/pveproxy.pm | 3 +++
 debian/control          | 1 +
 www/index.html.tpl      | 8 ++++++++
 3 files changed, 12 insertions(+)

diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm
index ec1eb9a5..adcb4610 100755
--- a/PVE/Service/pveproxy.pm
+++ b/PVE/Service/pveproxy.pm
@@ -113,6 +113,9 @@ sub init {
 	    '/favicon.ico' => {
 		file => "$basedirs->{manager}/images/favicon.ico",
 	    },
+	    '/proxmoxlib.js' => {
+		file => "/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js",
+	    },
 	},
 	dirs => $dirs,
     };
diff --git a/debian/control b/debian/control
index c7d5a717..c5469c50 100644
--- a/debian/control
+++ b/debian/control
@@ -55,6 +55,7 @@ Depends: apt-transport-https,
          novnc-pve,
          perl (>= 5.10.0-19),
          postfix | mail-transport-agent,
+         proxmox-widget-toolkit (>= 1.0-8),
          pve-cluster (>= 5.0-17),
          pve-container,
          pve-docs,
diff --git a/www/index.html.tpl b/www/index.html.tpl
index 6bbdea18..c4f4602a 100644
--- a/www/index.html.tpl
+++ b/www/index.html.tpl
@@ -23,6 +23,14 @@
     <script type="text/javascript" src="/pve2/ext6/ext-all.js"></script>
     <script type="text/javascript" src="/pve2/ext6/charts.js"></script>
     [% END %]
+    <script type="text/javascript">
+    Proxmox = {
+	Setup: { auth_cookie_name: 'PVEAuthCookie' },
+	UserName: '[% username %]',
+	CSRFPreventionToken: '[% token %]'
+    };
+    </script>
+    <script type="text/javascript" src="/proxmoxlib.js"></script>
     <script type="text/javascript" src="/pve2/js/pvemanagerlib.js?ver=[% version %]"></script>
     <script type="text/javascript" src="/pve2/ext6/locale/locale-[% lang %].js"></script>
 
-- 
2.11.0





More information about the pve-devel mailing list