try to add parameter for localPath
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user