[pve-devel] [PATCH manager 2/4] add the index.html.tpl files for the default ui and touch

Dominik Csapak d.csapak at proxmox.com
Tue Mar 7 11:18:21 CET 2017


they are mostly copied from ExtJSIndex.pm and TouchIndex.pm, and
they are prepared with the Template::Toolkit syntax

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/Makefile             |  8 +++++++-
 www/index.html.tpl       | 44 ++++++++++++++++++++++++++++++++++++++++++++
 www/touch/Makefile       |  3 ++-
 www/touch/index.html.tpl | 26 ++++++++++++++++++++++++++
 4 files changed, 79 insertions(+), 2 deletions(-)
 create mode 100644 www/index.html.tpl
 create mode 100644 www/touch/index.html.tpl

diff --git a/www/Makefile b/www/Makefile
index 2d522b2..caa387d 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -1,7 +1,13 @@
+include ../defines.mk
 SUBDIRS = images css manager6 touch mobile
 
-all: ${SUBDIRS}
+all: ${SUBDIRS} index.html.tpl
 
 %:
 	set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
 
+.PHONY: install
+install:
+	set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
+	install -m 0644 -o www-data -g www-data index.html.tpl ${WWWBASEDIR}
+
diff --git a/www/index.html.tpl b/www/index.html.tpl
new file mode 100644
index 0000000..aa87aeb
--- /dev/null
+++ b/www/index.html.tpl
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+    <title>[% nodename %] - Proxmox Virtual Environment</title>
+    <link rel="icon" sizes="128x128" href="/pve2/images/logo-128.png" />
+    <link rel="apple-touch-icon" sizes="128x128" href="/pve2/images/logo-128.png" />
+    <link rel="stylesheet" type="text/css" href="/pve2/ext6/theme-crisp/resources/theme-crisp-all.css" />
+    <link rel="stylesheet" type="text/css" href="/pve2/ext6/crisp/resources/charts-all.css" />
+    <link rel="stylesheet" type="text/css" href="/pve2/css/font-awesome.css" />
+    <link rel="stylesheet" type="text/css" href="/pve2/css/ext6-pve.css" />
+    [% IF langfile %]
+    <script type='text/javascript' src='/pve2/locale/pve-lang-[% lang %].js'></script>
+    [%- ELSE %]
+    <script type='text/javascript'>function gettext(buf) { return buf; }</script>
+    [% END %]
+    [%- IF debug %]
+    <script type="text/javascript" src="/pve2/ext6/ext-all-debug.js"></script>
+    <script type="text/javascript" src="/pve2/ext6/charts-debug.js"></script>
+    [%- ELSE %]
+    <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" src="/pve2/js/pvemanagerlib.js"></script>
+    <script type="text/javascript" src="/pve2/ext6/locale/locale-[% lang %].js"></script>
+
+    <script type="text/javascript">
+    if (typeof(PVE) === 'undefined') PVE = {};
+    PVE.UserName = '[% username %]'
+    PVE.CSRFPreventionToken = '[% token %]';
+    Ext.History.fieldid = 'x-history-field';
+    Ext.onReady(function() { Ext.create('PVE.StdWorkspace');});
+    </script>
+
+  </head>
+  <body>
+    <!-- Fields required for history management -->
+    <form id="history-form" class="x-hidden">
+    <input type="hidden" id="x-history-field"/>
+    </form>
+  </body>
+</html>
diff --git a/www/touch/Makefile b/www/touch/Makefile
index ad2b120..2291ce2 100644
--- a/www/touch/Makefile
+++ b/www/touch/Makefile
@@ -15,12 +15,13 @@ ${TOUCHDATA}: ${TOUCHSRC}
 all: ${TOUCHDATA}
 
 .PHONY: install 
-install: ${TOUCHDATA}
+install: ${TOUCHDATA} index.html.tpl
 	install -d ${WWWTOUCHDIR}
 	install -m 0644 ${TOUCHDATA} ${WWWTOUCHDIR}
 	install -d ${WWWTOUCHDIR}/resources/css
 	cp ${TOUCHDIR}/resources/css/*.css ${WWWTOUCHDIR}/resources/css
 	install -m 0644 pve.css ${WWWTOUCHDIR}/resources/css
+	install -m 0644 index.html.tpl ${WWWTOUCHDIR}
 	install -d ${WWWTOUCHDIR}/resources/themes/images
 	cp -a ${TOUCHDIR}/resources/themes/images/default ${WWWTOUCHDIR}/resources/themes/images
 	chown -R www-data:www-data ${WWWTOUCHDIR}
diff --git a/www/touch/index.html.tpl b/www/touch/index.html.tpl
new file mode 100644
index 0000000..9c80b6c
--- /dev/null
+++ b/www/touch/index.html.tpl
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>$nodename - Proxmox Virtual Environment</title>
+
+    <link rel="icon" sizes="128x128" href="/pve2/images/logo-128.png" />
+    <link rel="apple-touch-icon" sizes="128x128" href="/pve2/images/logo-128.png" />
+    <link rel="stylesheet" type="text/css" href="/pve2/touch/resources/css/sencha-touch.css" />
+    <link rel="stylesheet" type="text/css" href="/pve2/touch/resources/css/pve.css" />
+    [% IF langfile %]
+    <script type='text/javascript' src='/pve2/locale/pve-lang-[% lang %].js'></script>
+    [% ELSE %]
+    <script type="text/javascript">function gettext(buf) { return buf; }</script>
+    [% END %]
+    <script type="text/javascript" src="/pve2/touch/sencha-touch-all-debug.js"></script>
+    <script type="text/javascript" src="/pve2/touch/pvemanager-mobile.js"></script>
+    <script type="text/javascript">
+if (typeof(PVE) === 'undefined') PVE = {};
+PVE.UserName = '[% username %]'
+PVE.CSRFPreventionToken = '[% token %]';
+    </script>
+  </head>
+  <body>
+  </body>
+</html>
-- 
2.1.4





More information about the pve-devel mailing list