try to add parameter for localPath

This commit is contained in:
Dobromir Popov
2021-04-30 23:21:00 +03:00
parent b99b1f07d0
commit 7740770ace
9 changed files with 38 additions and 36 deletions

View File

@@ -1,7 +1,7 @@
<h2>AC Control for <% if (model.user) {model.user.username; } %></h2>
<h4 id="current">Retrieving current conditions...</h4>
<!-- class="form-inline" -->
<form id="accontrol" action="/n/accontrol" method="POST">
<form id="accontrol" action= config.localPath + "/accontrol" method="POST">
<div class="form-group ">
<input type='checkbox' name='power' <%= model.data.power|true ? "checked" : "" %> data-toggle='toggle'
data-style='android' data-on='ON' data-off='Off' />
@@ -34,7 +34,7 @@ INFO:
<%- contentFor('head') %>
<script>
const url = 'wss://iot.d-popov.com/n/ws'
const url = 'wss://iot.d-popov.com' + config.localPath + '/ws'
const connection = new WebSocket(url)
connection.onopen = (d) => {
console.log(`WebSocket error: ${d}`)
@@ -57,7 +57,7 @@ INFO:
<script>
window.onload = function () {
$.getJSON("/n/dht?e=now", function(data){
$.getJSON(config.localPath + "/dht?e=now", function(data){
if(data && data.dht){
$('#current').text( "A23 Currently is " + data.dht.temp + "°C, " + data.dht.hum +"% RH. Dew point : " + data.dht.dew + "°C" );
}else {