Commit 8dd1f6f1 authored by Donald Chen's avatar Donald Chen
Browse files

only append port when not 80 for node-red url

parent 302c0806
......@@ -25,8 +25,8 @@
<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 <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>
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">Node-RED</font> web interface here:
<a href="http://params_node_red_url">http://params_node_red_url</a>
<br><br>
</div>
</div>
......
......@@ -251,7 +251,6 @@ function submitForm(params, res, req) {
//hostname is in format: [serial_num].rigadogateway.com, we just want [serial_num].
var node_red_url = hostname.split(".", 1);
var node_red_port = NODE_RED_PORT.toString().trim();
//html response
var res_str;
......@@ -274,6 +273,12 @@ function submitForm(params, res, req) {
node_red_url = node_red_url + ".local";
}
//append the port if not port 80
if(NODE_RED_PORT !== 80) {
node_red_url = node_red_url + ":" + NODE_RED_PORT.toString().trim();
}
//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");
......@@ -282,8 +287,7 @@ function submitForm(params, res, req) {
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);
res_str = res_str.replace(/params_node_red_url/g, node_red_url);
//send the html response
res.end(res_str);
......
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