mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-12 08:26:38 +02:00
fix webserial is now in local timezone
This commit is contained in:
parent
72219cdf17
commit
a77bea55d0
6 changed files with 27 additions and 11 deletions
|
@ -19,8 +19,10 @@ function getAjax(url, ptr, method="GET", json=null) {
|
|||
}
|
||||
function p() {
|
||||
if(xhr.readyState == 4) {
|
||||
if(null != xhr.responseText)
|
||||
ptr(JSON.parse(xhr.responseText));
|
||||
if(null != xhr.responseText) {
|
||||
if(null != ptr)
|
||||
ptr(JSON.parse(xhr.responseText));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,14 +85,19 @@
|
|||
|
||||
if(null == root) return;
|
||||
root = root.inverter;
|
||||
for(var i = 0; i < root.inverter.length; i++)
|
||||
{
|
||||
for(var i = 0; i < root.inverter.length; i++) {
|
||||
inv = root.inverter[i];
|
||||
var opt = document.createElement('option');
|
||||
opt.value = inv.id;
|
||||
opt.innerHTML = inv.name;
|
||||
select.appendChild(opt);
|
||||
}
|
||||
|
||||
// set time offset for serial console
|
||||
var obj = new Object();
|
||||
obj.cmd = "serial_utc_offset";
|
||||
obj.ts = new Date().getTimezoneOffset() * -60;
|
||||
getAjax("/api/setup", null, "POST", JSON.stringify(obj));
|
||||
}
|
||||
|
||||
document.getElementById("clear").addEventListener("click", function() {
|
||||
|
@ -133,8 +138,7 @@
|
|||
e.innerHTML = "Error: " + obj["error"];
|
||||
}
|
||||
|
||||
function get_selected_iv()
|
||||
{
|
||||
function get_selected_iv() {
|
||||
var e = document.getElementById("InvID");
|
||||
return parseInt(e.value);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue