diff --git a/public/exit.html b/public/exit.html index c150731051aed5ede51b204d1d1a7c1ad116ff01..da5ed287574af537bdbf7ae023264b2c1e57e424 100755 --- a/public/exit.html +++ b/public/exit.html @@ -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> diff --git a/server.js b/server.js index d64dfeacd48e224cfa9fb28cb56b43ad32e6ef7f..a33301c55dde2b84823fd4585fca63f38d7b1303 100755 --- a/server.js +++ b/server.js @@ -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);