Commit 302c0806 authored by Donald Chen's avatar Donald Chen
Browse files

cleanup logging, bold/maroon "Node-RED" on exit.html

parent e48aa94c
......@@ -25,7 +25,7 @@
<h1>Finishing Setup...</h1>
<div class='section'>
<div class="content" style="padding: 30px; padding-bottom: 0px">
Your gateway is rebooting and joining the selected WiFi network. Once complete, the LED on the top of the gateway will turn solid green. To connect to your gateway make sure your computer is on the same network. You can navigate to the Node-RED web interface here:
Your gateway is rebooting and joining the selected WiFi network. Once complete, the LED on the top of the gateway will turn solid green. To connect to your gateway make sure your computer is on the same network. You can navigate to the <font color="#800000"><b>Node-RED</b></font> web interface here:
<a href="http://params_node_red_url:params_node_red_http_port">http://params_node_red_url:params_node_red_http_port</a>
<br><br>
</div>
......
......@@ -260,7 +260,8 @@ function submitForm(params, res, req) {
hostname = ssid = params.name;
}
if (params.newwifi) { // WiFi is being configured
// WiFi is being configured
if (params.newwifi) {
res_str = fs.readFileSync(site + '/exit.html', {encoding: 'utf8'})
} else {
res_str = fs.readFileSync(site + '/exiting-without-wifi.html', {encoding: 'utf8'})
......@@ -273,25 +274,27 @@ function submitForm(params, res, req) {
node_red_url = node_red_url + ".local";
}
//replace params
res_str = res_str.replace(/params_new_wifi/g, params.newwifi ? params.newwifi : "");
res_str = res_str.replace(/params_hostname/g, hostname + ".local");
res_str = res_str.replace(/params_ssid/g, ssid);
res_str = res_str.replace(/params_curr_ssid/g, nameobj.ssid);
res_str = res_str.replace(/params_curr_hostname/g, nameobj.hostname + ".local");
//replace node-red params
res_str = res_str.replace(/params_node_red_url/g, node_red_url);
res_str = res_str.replace(/params_node_red_http_port/g, node_red_port);
//send the html response
res.end(res_str);
//wait 5s before sending the configure command so the exit page can be loaded
setTimeout( function() {
console.log("configuring gateway wifi now!");
commands.push({cmd: BIN_DIR+"/configure_gateway", args: ["--disableOneTimeSetup", "--persist"]});
// Now execute the commands serially
runCmd(0, commands);
}, 5000);
commands.push({cmd: BIN_DIR+"/configure_gateway", args: ["--disableOneTimeSetup", "--persist"]});
// Now execute the commands serially
runCmd(0, commands);
}, 5000);
});
}
......
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