[pve-devel] [PATCH v2 installer 2/2] implemented acknowledgement screen
Oguz Bektas
o.bektas at proxmox.com
Tue Dec 11 11:36:46 CET 2018
this implements an acknowledgement screen as the last step, which
shows the user what they chose during the previous steps.
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 | 101 +++++++++++++++++++++++++++++++++++++++++++
html-common/ipconf.htm | 4 +-
proxinstall | 45 ++++++++++++++++++-
4 files changed, 147 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..6236ed1
--- /dev/null
+++ b/html-common/ack_template.htm
@@ -0,0 +1,101 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" type="text/css" href="pve-installer.css">
+<style type="text/css">
+ #summary td, tr {
+ padding: 3px;
+ }
+ #summary tr:nth-child(even){ background-color: #f2f2f2; }
+ #summary tr:hover { background-color: #ddd; }
+ #summary th {
+ padding-top: 5px;
+ padding-bottom: 5px;
+ padding-left: 5px;
+ text-align: left;
+ background-color: #e57000;
+ color: white;
+ }
+</style>
+</head>
+<body>
+<center>
+<table border="0" width="800" style="margin-top: 10pt;">
+<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 id="summary" border="0" width="800">
+<tbody>
+<tr>
+ <th width="25%">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..a33a600 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 shown 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 5aece6b..58a2be2 100755
--- a/proxinstall
+++ b/proxinstall
@@ -216,11 +216,16 @@ my @steps = (
},
{
step => 'ipconf',
- next_button => '_Install',
html => 'ipconf.htm',
function => \&create_ipconf_view,
},
{
+ step => 'ack',
+ html => 'ack.htm',
+ next_button => '_Install',
+ function => \&create_ack_view,
+ },
+ {
step => 'extract',
next_button => '_Reboot',
function => \&create_extract_view,
@@ -2164,12 +2169,48 @@ sub create_ipconf_view {
#print "TEST $ipaddress $netmask $gateway $dnsserver\n";
$step_number++;
- create_extract_view();
+ create_ack_view();
});
$hostentry->grab_focus();
}
+sub create_ack_view {
+
+ cleanup_view();
+
+ my $ack_template = "${proxmox_libdir}/html/ack_template.htm";
+ my $ack_html = "${proxmox_libdir}/html/$steps[$step_number]->{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();
+
+ set_next(undef, sub {
+ $step_number++;
+ create_extract_view();
+ });
+}
+
sub get_device_desc {
my ($devname, $size, $model) = @_;
--
2.11.0
More information about the pve-devel
mailing list