[pve-devel] [PATCH installer 2/2] implemented acknowledgement screen

Oguz Bektas o.bektas at proxmox.com
Mon Dec 10 12:36:27 CET 2018


this implements an acknowledgement screen as the last
install step, which shows the user what they chose
during the installation.

the html files have been modified according to the
new installation steps as well.

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 html-common/Makefile         |  1 +
 html-common/ack_template.htm | 88 ++++++++++++++++++++++++++++++++++++++++++++
 html-common/ipconf.htm       |  4 +-
 proxinstall                  | 47 ++++++++++++++++++++++-
 4 files changed, 136 insertions(+), 4 deletions(-)
 create mode 100644 html-common/ack_template.htm

diff --git a/html-common/Makefile b/html-common/Makefile
index 1e041d1..4c90c6e 100644
--- a/html-common/Makefile
+++ b/html-common/Makefile
@@ -11,6 +11,7 @@ install:
 	install -D -m 644 ipconf.htm ${DESTDIR}/var/lib/pve-installer/html/ipconf.htm
 	install -D -m 644 nohds.htm ${DESTDIR}/var/lib/pve-installer/html/nohds.htm
 	install -D -m 644 nonics.htm ${DESTDIR}/var/lib/pve-installer/html/nonics.htm
+	install -D -m 644 ack_template.htm ${DESTDIR}/var/lib/pve-installer/html/ack_template.htm
 
 .phony: clean
 clean:
diff --git a/html-common/ack_template.htm b/html-common/ack_template.htm
new file mode 100644
index 0000000..af7f20a
--- /dev/null
+++ b/html-common/ack_template.htm
@@ -0,0 +1,88 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" type="text/css" href="pve-installer.css">
+</head>
+<body>
+<center>
+<table border="0" width="800">
+<tr><td> </td></tr>
+<tr>
+  <td colspan="4" align="center" width="800">
+    <b class="htext">Summary</b>
+  </td>
+</tr>
+<tr>
+    <td colspan="2" valign="top" width="400"><br><p>
+    <table>
+      <tbody><tr><td><b>Please verify</b>
+	the displayed informations.
+	<br><br>
+	Afterwards press the <b>Install</b> button. The installer will
+	begin to partition your drive and extract the required files.
+
+
+      </td></tr>
+    </tbody></table>
+</tr>
+
+<table border="0" width="800">
+
+<tr>
+    <th>Option</th>
+    <th>Value</th>
+</tr>
+
+<tr>
+    <td>Disk:</td>
+    <td>__target_hd__</td>
+</tr>
+
+<tr>
+    <td>Country:</td>
+    <td>__country__</td>
+</tr>
+<tr>
+    <td>Timezone:</td>
+    <td>__timezone__</td>
+</tr>
+<tr>
+    <td>Keymap:</td>
+    <td>__keymap__</td>
+</tr>
+<tr>
+    <td>E-Mail:</td>
+    <td>__mailto__</td>
+</tr>
+<tr>
+    <td>Interface:</td>
+    <td>__interface__</td>
+</tr>
+<tr>
+    <td>Hostname:</td>
+    <td>__hostname__</td>
+</tr>
+<tr>
+    <td>IP:</td>
+    <td>__ip__</td>
+</tr>
+<tr>
+    <td>Netmask:</td>
+    <td>__netmask__</td>
+</tr>
+<tr>
+    <td>Gateway:</td>
+    <td>__gateway__</td>
+</tr>
+<tr>
+    <td>DNS:</td>
+    <td>__dnsserver__</td>
+</tr>
+
+</tr>
+</table>
+
+
+</tbody></table>
+</center>
+</body></html>
diff --git a/html-common/ipconf.htm b/html-common/ipconf.htm
index ba699ed..2aefa90 100644
--- a/html-common/ipconf.htm
+++ b/html-common/ipconf.htm
@@ -19,8 +19,8 @@
 	the displayed network configuration.  You will need a valid network
 	configuration to access the management interface after installation.
 	<br><br>
-	Afterwards press the <b>Install</b> button to start the installation. The
-	installer will then partition your hard disk and start copying packages.
+	Afterwards press the Next button. You will be displayed a list of the options
+	that you chose during the previous steps.
       </td></tr>
     </tbody></table>
   </p></td>
diff --git a/proxinstall b/proxinstall
index 893f292..828e5d8 100755
--- a/proxinstall
+++ b/proxinstall
@@ -227,10 +227,14 @@ my $function_options = {
 	function => \&create_password_view,
     },
     ipconf => {
-	next_button => '_Install',
 	html => 'ipconf.htm',
 	function => \&create_ipconf_view,
     },
+    ack => {
+	html => 'ack.htm',
+	next_button => '_Install',
+	function => \&create_ack_view,
+    },
     extract => {
 	next_button => '_Reboot',
 	function => \&create_extract_view,
@@ -2178,12 +2182,51 @@ sub create_ipconf_view {
 	#print "TEST $ipaddress $netmask $gateway $dnsserver\n";
 
 	$stack_number++;
-	create_extract_view();
+	create_ack_view();
     });
 
     $hostentry->grab_focus();
 }
 
+sub create_ack_view {
+
+    # Description: Function for showing the user a list of
+    # the previously chosen options during install
+
+    cleanup_view();
+
+    my $ack_template = "${proxmox_libdir}/html/ack_template.htm";
+    my $ack_html = "${proxmox_libdir}/html/$function_options->{ack}->{html}";
+    my $html_data = file_get_contents($ack_template);
+
+    my %config_values = (
+	__target_hd__ => $target_hd,
+	__country__ => $country,
+	__timezone__ => $timezone,
+	__keymap__ => $keymap,
+	__mailto__ => $mailto,
+	__interface__ => $ipconf->{ifaces}->{$ipconf->{selected}}->{name},
+	__hostname__ => $hostname,
+	__ip__ => $ipaddress,
+	__netmask__ => $netmask,
+	__gateway__ => $gateway,
+	__dnsserver__ => $dnsserver,
+    );
+
+    while ( my ($k, $v) = each %config_values) {
+	$html_data =~ s/$k/$v/g;
+    }
+
+    write_config($html_data, $ack_html);
+
+    display_html($function_options->{ack}->{html});
+
+    set_next(undef, sub {
+	$stack_number++;
+	create_extract_view();
+    });
+}
+
 sub get_device_desc {
     my ($devname, $size, $model) = @_;
 
-- 
2.11.0





More information about the pve-devel mailing list