|
@ -559,31 +559,26 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function setTime() { |
|
|
function setTime() { |
|
|
var date = new Date(); |
|
|
var date = new Date() |
|
|
var obj = new Object(); |
|
|
var obj = {cmd: "set_time", token: "*", val: parseInt(date.getTime() / 1000)} |
|
|
obj.cmd = "set_time"; |
|
|
getAjax("/api/setup", apiCbNtp, "POST", JSON.stringify(obj)) |
|
|
obj.val = parseInt(date.getTime() / 1000); |
|
|
setTimeout(function() {getAjax('/api/index', apiCbNtp2)}, 2000) |
|
|
getAjax("/api/setup", apiCbNtp, "POST", JSON.stringify(obj)); |
|
|
|
|
|
setTimeout(function() {getAjax('/api/index', apiCbNtp2)}, 2000); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function scan() { |
|
|
function scan() { |
|
|
var obj = new Object(); |
|
|
var obj = {cmd: "scan_wifi", token: "*"} |
|
|
obj.cmd = "scan_wifi"; |
|
|
|
|
|
getAjax("/api/setup", apiCbWifi, "POST", JSON.stringify(obj)); |
|
|
getAjax("/api/setup", apiCbWifi, "POST", JSON.stringify(obj)); |
|
|
setTimeout(function() {getAjax('/api/setup/networks', listNetworks)}, 5000); |
|
|
setTimeout(function() {getAjax('/api/setup/networks', listNetworks)}, 5000); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function syncTime() { |
|
|
function syncTime() { |
|
|
var obj = new Object(); |
|
|
var obj = {cmd: "sync_ntp", token: "*"} |
|
|
obj.cmd = "sync_ntp"; |
|
|
getAjax("/api/setup", apiCbNtp, "POST", JSON.stringify(obj)) |
|
|
getAjax("/api/setup", apiCbNtp, "POST", JSON.stringify(obj)); |
|
|
setTimeout(function() {getAjax('/api/index', apiCbNtp2)}, 2000) |
|
|
setTimeout(function() {getAjax('/api/index', apiCbNtp2)}, 2000); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function sendDiscoveryConfig() { |
|
|
function sendDiscoveryConfig() { |
|
|
var obj = new Object(); |
|
|
var obj = {cmd: "discovery_cfg", token: "*"} |
|
|
obj.cmd = "discovery_cfg"; |
|
|
|
|
|
getAjax("/api/setup", apiCbMqtt, "POST", JSON.stringify(obj)); |
|
|
getAjax("/api/setup", apiCbMqtt, "POST", JSON.stringify(obj)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -837,8 +832,9 @@ |
|
|
|
|
|
|
|
|
function ivSave() { |
|
|
function ivSave() { |
|
|
var o = new Object(); |
|
|
var o = new Object(); |
|
|
o.cmd = "save_iv"; |
|
|
o.cmd = "save_iv" |
|
|
o.id = obj.id; |
|
|
o.token = "*" |
|
|
|
|
|
o.id = obj.id |
|
|
o.ser = parseInt(document.getElementsByName("ser")[0].value, 16); |
|
|
o.ser = parseInt(document.getElementsByName("ser")[0].value, 16); |
|
|
o.name = document.getElementsByName("name")[0].value; |
|
|
o.name = document.getElementsByName("name")[0].value; |
|
|
o.en = document.getElementsByName("enable")[0].checked; |
|
|
o.en = document.getElementsByName("enable")[0].checked; |
|
|