Commit bc07959d authored by Franco Fichtner's avatar Franco Fichtner

wizard: rework modelling and UX

PR: https://github.com/opnsense/core/issues/1359

(cherry picked from commit fc3fcf8a)
(cherry picked from commit 53bf7022)
(cherry picked from commit 597adf4f)
(cherry picked from commit bf1e663a)
(cherry picked from commit d63442d5)
(cherry picked from commit 9073176f)
(cherry picked from commit 6ba6098b)
(cherry picked from commit 367d2e20)
(cherry picked from commit 7b6ab769)
(cherry picked from commit 1f3458ec)
(cherry picked from commit 540f537a)
(cherry picked from commit 4f3239c7)
parent cc1007ad
......@@ -920,7 +920,7 @@
/usr/local/sbin/ppp-uptime.sh
/usr/local/sbin/prefixes.php
/usr/local/wizard/openvpn.xml
/usr/local/wizard/setup.xml
/usr/local/wizard/system.xml
/usr/local/www/carp_status.php
/usr/local/www/crash_reporter.php
/usr/local/www/csrf.inc
......
......@@ -43,6 +43,11 @@ global $config;
$config = parse_config(true);
if (count($argv) > 1 && is_numeric($argv[1])) {
// starting delayed.
sleep($argv[1]);
}
log_error("rc.reload_all: Reloading web GUI.");
system_webgui_configure(true);
......@@ -61,7 +66,6 @@ services_dyndns_configure('', true);
system_cron_configure(true);
mwexec_bg('/usr/local/etc/rc.sshd');
mwexec_bg('/usr/local/etc/rc.restart_webgui');
if (function_exists('plugins_configure')) {
log_error("rc.reload_all: Reloading all plugin settings.");
......
<menu>
<Lobby order="10" cssClass="fa fa-laptop">
<Dashboard order="0" url="/index.php" cssClass="fa fa-dashboard fa-fw">
<Args url="/index.php*" visibility="hidden"/>
<Root url="/" visibility="hidden"/>
</Dashboard>
<License order="1" url="/license.php" cssClass="fa fa-balance-scale fa-fw"/>
......@@ -71,8 +72,8 @@
</Tunables>
</Settings>
<LogFile order="150" VisibleName="Log File" url="/diag_logs.php" cssClass="fa fa-eye fa-fw"/>
<Wizard order="140" url="/wizard.php" cssClass="fa fa-magic fa-fw">
<Step url="/wizard.php*" visibility="hidden"/>
<Wizard order="140" url="/wizard.php?xml=system" cssClass="fa fa-magic fa-fw">
<Step url="/wizard.php?xml=system*" visibility="hidden"/>
</Wizard>
<Access order="10" cssClass="fa fa-users fa-fw">
<Users order="10" url="/system_usermanager.php">
......@@ -283,6 +284,7 @@
<OpenVPN cssClass="fa fa-lock fa-fw" order="20">
<Servers order="10" url="/vpn_openvpn_server.php">
<Edit url="/vpn_openvpn_server.php?*" visibility="hidden"/>
<Step url="/wizard.php?xml=openvpn*" visibility="hidden"/>
</Servers>
<Clients order="20" url="/vpn_openvpn_client.php">
<Edit url="/vpn_openvpn_client.php?*" visibility="hidden"/>
......
......@@ -449,12 +449,12 @@
<pattern>interfaces_wireless.php*</pattern>
</patterns>
</page-interfaces-wireless>
<page-pfsensewizardsubsystem>
<name>Wizard subsystem</name>
<page-wizard-system>
<name>System Setup Wizard</name>
<patterns>
<pattern>wizard.php*</pattern>
<pattern>wizard.php?xml=system*</pattern>
</patterns>
</page-pfsensewizardsubsystem>
</page-wizard-system>
<page-services-dhcprelay>
<name>Services: DHCP Relay</name>
<patterns>
......@@ -936,6 +936,7 @@
<name>VPN: OpenVPN: Server</name>
<patterns>
<pattern>vpn_openvpn_server.php*</pattern>
<pattern>wizard.php?xml=openvpn*</pattern>
</patterns>
</page-openvpn-server>
<page-xmlrpclibrary>
......
[reload|restart.all]
[reload.delay]
command:/usr/local/etc/rc.reload_all 2
parameters:
type:script
message:Reloading all (delayed)
[reload.all]
command:/usr/local/etc/rc.reload_all
parameters:
type:script
......
<?xml version="1.0" encoding="utf-8" ?>
<opnsensewizard>
<wizard>
<copyright>
/*
Copyright (C) 2014 Deciso B.V.
......@@ -32,9 +32,7 @@
<totalsteps>12</totalsteps>
<step>
<id>1</id>
<title>OpenVPN Wizard: Authentication Type Selection</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>Authentication Type Selection</title>
<fields>
<field>
<type>listtopic</type>
......@@ -70,9 +68,7 @@
</step>
<step>
<id>2</id>
<title>OpenVPN Wizard: LDAP Server Selection</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>LDAP Server Selection</title>
<fields>
<field>
<type>listtopic</type>
......@@ -105,9 +101,7 @@
</step>
<step>
<id>3</id>
<title>OpenVPN Wizard: Add LDAP Server</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>Add LDAP Server</title>
<fields>
<field>
<type>listtopic</type>
......@@ -231,9 +225,7 @@
</step>
<step>
<id>4</id>
<title>OpenVPN Wizard: RADIUS Server Selection</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>RADIUS Server Selection</title>
<fields>
<field>
<type>listtopic</type>
......@@ -266,9 +258,7 @@
</step>
<step>
<id>5</id>
<title>OpenVPN Wizard: Add RADIUS Server</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>Add RADIUS Server</title>
<fields>
<field>
<type>listtopic</type>
......@@ -314,9 +304,7 @@
</step>
<step>
<id>6</id>
<title>OpenVPN Wizard: Certificate Authority Selection</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>Certificate Authority Selection</title>
<fields>
<field>
<name>Choose a Certificate Authority (CA)</name>
......@@ -342,9 +330,7 @@
</step>
<step>
<id>7</id>
<title>OpenVPN Wizard: Add Certificate Authority</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>Add Certificate Authority</title>
<fields>
<field>
<name>Create a New Certificate Authority (CA) Certificate</name>
......@@ -443,9 +429,7 @@
</step>
<step>
<id>8</id>
<title>OpenVPN Wizard: Server Certificate Selection</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>Server Certificate Selection</title>
<fields>
<field>
<name>Choose a Server Certificate</name>
......@@ -471,9 +455,7 @@
</step>
<step>
<id>9</id>
<title>OpenVPN Wizard: Add a Server Certificate</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>Add a Server Certificate</title>
<fields>
<field>
<name>Create a New Server Certificate</name>
......@@ -572,9 +554,7 @@
</step>
<step>
<id>10</id>
<title>OpenVPN Wizard: Server Setup</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>Server Setup</title>
<fields>
<field>
<type>listtopic</type>
......@@ -906,9 +886,7 @@
</step>
<step>
<id>11</id>
<title>OpenVPN Wizard: Firewall Rule Configuration</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>Firewall Rule Configuration</title>
<fields>
<field>
<type>listtopic</type>
......@@ -948,14 +926,8 @@
</step>
<step>
<id>12</id>
<title>OpenVPN Wizard: Finished!</title>
<description>OpenVPN Remote Access Server Setup Wizard</description>
<disableheader>on</disableheader>
<title>Finished!</title>
<fields>
<field>
<type>listtopic</type>
<name>Configuration Complete!</name>
</field>
<field>
<type>text</type>
<description>Your configuration is now complete.</description>
......@@ -967,4 +939,4 @@
</fields>
<stepsubmitphpaction>step12_submitphpaction();</stepsubmitphpaction>
</step>
</opnsensewizard>
</wizard>
<?xml version="1.0" encoding="utf-8" ?>
<opnsensewizard>
<wizard>
<copyright>
/*
Copyright (C) 2014 Deciso B.V.
......@@ -31,10 +31,12 @@
<totalsteps>9</totalsteps>
<step>
<id>1</id>
<title>OPNsense Setup Wizard</title>
<disableheader>true</disableheader>
<description>This wizard will guide you through the initial configuration of OPNsense.&lt;br/&gt;&lt;br/&gt; The wizard may be stopped at any time by clicking the logo image at the top of the screen.</description>
<title>General Setup</title>
<fields>
<field>
<type>text</type>
<description>This wizard will guide you through the initial system configuration. The wizard may be stopped at any time by clicking the logo image at the top of the screen.</description>
</field>
<field>
<name>Next</name>
<type>submit</type>
......@@ -50,7 +52,6 @@
<step>
<id>2</id>
<title>General Information</title>
<description>On this screen you will set the general OPNsense parameters.</description>
<fields>
<field>
<name>Hostname</name>
......@@ -134,7 +135,6 @@
<step>
<id>3</id>
<title>Time Server Information</title>
<description>Please enter the time, date and time zone.</description>
<fields>
<field>
<name>Time server hostname</name>
......@@ -167,7 +167,6 @@
<id>4</id>
<disableallfieldsbydefault>true</disableallfieldsbydefault>
<title>Configure WAN Interface</title>
<description>On this screen we will configure the Wide Area Network information.</description>
<javascriptafterformdisplay>
var selectedItem = 0;
if(jQuery('#ipaddress').val() == 'dhcp') {
......@@ -544,8 +543,7 @@
</step>
<step>
<id>6</id>
<title>Set Admin WebGUI Password</title>
<description>On this screen we will set the admin password, which is used to access the WebGUI and also SSH services if you wish to enable them.</description>
<title>Set Admin Web GUI Password</title>
<fields>
<field>
<name>Admin Password</name>
......@@ -576,10 +574,12 @@
</step>
<step>
<id>7</id>
<title>Reload configuration</title>
<disableheader>true</disableheader>
<description>Click 'Reload' to reload OPNsense with new changes.</description>
<title>Reload Configuration</title>
<fields>
<field>
<type>text</type>
<description>Click 'Reload' to reload to apply the changes.</description>
</field>
<field>
<name>Reload</name>
<type>submit</type>
......@@ -629,28 +629,21 @@
<step>
<id>8</id>
<title>Reload in progress</title>
<description>
A reload is now in progress. Please wait. &lt;p&gt;
&lt;meta http-equiv="refresh" content="5; url=wizard.php?xml=setup&amp;stepid=8" &gt;
&lt;p&gt;
The wizard will redirect to the next step once the reload is completed.
</description>
<fields>
<field>
<type>text</type>
<description>A reload is now in progress. The wizard will redirect you to the dashboard once the reload is completed.</description>
</field>
<field>
<type>refresh</type>
<time>5</time>
<page>index.php?wizard_done</page>
</field>
</fields>
<stepafterformdisplay>
<![CDATA[
configd_run('service reload all', true);
configd_run('service reload delay', true);
]]>
</stepafterformdisplay>
</step>
<step>
<id>9</id>
<title>Wizard completed.</title>
<description>
<![CDATA[
Congratulations! OPNsense is now configured.<p/>
Please consider donating to the project to help us with our overhead costs.<p/>
See <a target='_new' href='https://opnsense.org/'>OPNsense.org</a> to donate or purchase services offered by the OPNsense team.<p/>
Click <a href='$myurl'>here</a> to continue on to OPNsense web GUI.
]]>
</description>
</step>
</opnsensewizard>
</wizard>
......@@ -29,34 +29,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/* Determine automated help URL. Should output the page name and
parameters separately */
$uri_split = "";
preg_match("/\/(.*)\?(.*)/", $_SERVER["REQUEST_URI"], $uri_split);
/* If there was no match, there were no parameters, just grab the filename
Otherwise, use the matched filename from above. */
if (empty($uri_split[0])) {
$pagename = ltrim($_SERVER["REQUEST_URI"], '/');
} else {
$pagename = $uri_split[1];
}
/* If the page name is still empty, the user must have requested / (index.php) */
if (empty($pagename)) {
$pagename = "index.php";
}
/* If the filename is wizard.php, reparse looking for the .xml filename */
if ($pagename == 'wizard.php') {
$param_split = explode('&', $uri_split[2]);
foreach ($param_split as $param) {
if (substr($param, 0, 4) == "xml=") {
$xmlfile = explode('=', $param);
$pagename = $xmlfile[1];
}
}
}
$aclObj = new \OPNsense\Core\ACL();
/* display a top alert bar if need be */
......
......@@ -15,18 +15,18 @@ function system_get_language_code() {
// link menu system
$menu = new OPNsense\Base\Menu\MenuSystem();
/* XXX generating breadcrumbs requires getItems() call */
$menuSystem = $menu->getItems($_SERVER['REQUEST_URI']);
$menuBreadcrumbs = $menu->getBreadcrumbs();
/* XXX workaround for dashboard */
if (!isset($menuBreadcrumbs)) {
/* XXX generating breadcrumbs requires getItems() call */
$menuBreadcrumbs = $menu->getBreadcrumbs();
if (isset($extraBreadcrumb)) {
$menuBreadcrumbs[] = array('name' => $extraBreadcrumb);
}
$themename = htmlspecialchars(get_current_theme());
$themename = html_safe(get_current_theme());
$pagetitle = gentitle(array_reverse($menuBreadcrumbs), ' | ');
$pagetitle .= sprintf(' | %s.%s', $config['system']['hostname'], $config['system']['domain']);
$pagetitle .= html_safe(sprintf(' | %s.%s', $config['system']['hostname'], $config['system']['domain']));
?><!doctype html>
<!--[if IE 8 ]><html lang="<?=system_get_language_code();?>" class="ie ie8 lte9 lte8 no-js"><![endif]-->
......
......@@ -100,7 +100,9 @@ include("head.inc");
include("fbegin.inc");?>
<?php
if (isset($config['trigger_initial_wizard'])) :?>
?>
<?php
if (isset($config['trigger_initial_wizard']) || isset($_GET['wizard_done'])): ?>
<script type="text/javascript">
$( document ).ready(function() {
$(".page-content-head:first").hide();
......@@ -108,7 +110,14 @@ include("fbegin.inc");?>
</script>
<header class="page-content-head">
<div class="container-fluid">
<?php
if (isset($config['trigger_initial_wizard'])): ?>
<h1><?= gettext("Starting initial configuration!") ?></h1>
<?php
else: ?>
<h1><?= gettext("Finished initial configuration!") ?></h1>
<?php
endif ?>
</div>
</header>
<section class="page-content-main">
......@@ -121,10 +130,18 @@ include("fbegin.inc");?>
<br />
<div class="content-box-main">
<?php
echo sprintf(gettext("Welcome to %s!"), $g['product_name']) . "<p>\n";
echo gettext("One moment while we start the initial setup wizard.") . "<p>\n";
echo gettext("Embedded platform users: Please be patient, the wizard takes a little longer to run than the normal GUI.") . "<p>\n";
echo gettext("To bypass the wizard, click on the logo in the upper left corner.") . "\n";
if (isset($config['trigger_initial_wizard'])) {
echo '<p>' . sprintf(gettext('Welcome to %s!'), $g['product_name']) . "</p>\n";
echo '<p>' . gettext('One moment while we start the initial setup wizard.') . "</p>\n";
echo '<p class="__nomb">' . gettext('To bypass the wizard, click on the logo in the upper left corner.') . "</p>\n";
} else {
echo '<p>' . sprintf(gettext('Congratulations! %s is now configured.'), $g['product_name']) . "</p>\n";
echo '<p>' . sprintf(gettext(
'Please consider donating to the project to help us with our overhead costs. ' .
'See %sour website%s to donate or purchase available %s support services.'),
'<a target="_new" href="' . $g['product_website'] . '">', '</a>', $g['product_name']) . "</p>\n";
echo '<p class="__nomb">' . sprintf(gettext('Click to %scontinue to the dashboard%s.'), '<a href="/">', '</a>') . "</p>\n";
}
?>
</div>
<div>
......@@ -133,7 +150,11 @@ include("fbegin.inc");?>
</div>
</div>
</section>
<meta http-equiv="refresh" content="3;url=wizard.php">
<?php
if (isset($config['trigger_initial_wizard'])): ?>
<meta http-equiv="refresh" content="5;url=/wizard.php?xml=system">
<?php
endif ?>
<?php
// normal dashboard
else:?>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment