mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-16 02:16:37 +02:00
fixed timezone for time sync from browser #336 (thx @DanielR92)
This commit is contained in:
parent
6bf6e357ca
commit
dbdc2ad5ab
4 changed files with 8 additions and 9 deletions
|
@ -42,9 +42,9 @@
|
|||
<select name="pwrlimcntrl" id="pwrlimcntrl">
|
||||
<option value="" selected disabled hidden>select the unit and persistence</option>
|
||||
<option value="0">absolute in Watt non persistent</option>
|
||||
<option value="1">relativ in percent non persistent</option>
|
||||
<option value="1">relative in percent non persistent</option>
|
||||
<option value="256">absolute in Watt persistent</option>
|
||||
<option value="257">relativ in percent persistent</option>
|
||||
<option value="257">relative in percent persistent</option>
|
||||
</select>
|
||||
<br/>
|
||||
<input type="button" value="Send Power Limit" class="btn" id="sendpwrlim"/>
|
||||
|
|
|
@ -135,16 +135,17 @@
|
|||
function apiCb(obj) {
|
||||
var e = document.getElementById("apiResult");
|
||||
if(obj["success"])
|
||||
e.innerHTML = "ok";
|
||||
e.innerHTML = "command excuted";
|
||||
else
|
||||
e.innerHTML = "Error: " + obj["error"];
|
||||
}
|
||||
|
||||
function setTime() {
|
||||
var date = new Date();
|
||||
var offset = date.getTimezoneOffset() * -60;
|
||||
var obj = new Object();
|
||||
obj.cmd = "set_time";
|
||||
obj.ts = parseInt(date.getTime() / 1000);
|
||||
obj.ts = parseInt(offset + (date.getTime() / 1000));
|
||||
getAjax("/api/setup", apiCb, "POST", JSON.stringify(obj));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue