Fixed update timeout definition

pull/123/head
Hieromon Ikasamo 6 years ago
parent b58967cf1f
commit 40aa33bc8d
  1. 4
      src/AutoConnectDefs.h
  2. 2
      src/AutoConnectUpdatePage.h

@ -200,6 +200,10 @@
// Explicitly avoiding unused warning with token handler of PageBuilder
#define AC_UNUSED(expr) do { (void)(expr); } while (0)
// Numeric to string deployment
#define AUTOCONNECT_STRING_DEPLOY(n) _AUTOCONNECT_STRING_DEPLOY(n)
#define _AUTOCONNECT_STRING_DEPLOY(s) #s
// Generates a template that determines whether the class owns the
// specified member function.
// The purpose of this macro is to avoid the use of invalid member

@ -37,7 +37,7 @@ const AutoConnectUpdate::ACElementProp_t AutoConnectUpdate::_elmProgress[] PROGM
{ AC_Text, "status", nullptr, nullptr },
{ AC_Element, "c5", "<script type=\"text/javascript\">var ws;function rd(){location.href=\"" AUTOCONNECT_URI_UPDATE_RESULT "\"}window.onload=function(){(ws=new WebSocket(\"", nullptr },
{ AC_Element, "wsurl", nullptr, nullptr },
{ AC_Element, "c6", "\")).onopen=function(){ws.onmessage=function(e){var o=e.data.split(\",\");if(\"#s\"==o[0]){window.setTimeout(rd," AUTOCONNECT_UPDATE_DURATION ");var n=document.getElementById(\"ld\");n&&(n.className=\"loader\")}else\"#e\"==o[0]?ws.close():\"#p\"==o[0]&&incr(o[1])}},ws.onerror=function(e){console.log(\"WS err(\"+e.code+\") \"+e.reason),1==ws.readyState&&(document.getElementById(\"status\").textContent=\"WebSocket \"+e.type)},ws.onclose=function(e){rd()}};", nullptr },
{ AC_Element, "c6", "\")).onopen=function(){ws.onmessage=function(e){var o=e.data.split(\",\");if(\"#s\"==o[0]){window.setTimeout(rd," AUTOCONNECT_STRING_DEPLOY(AUTOCONNECT_UPDATE_DURATION) ");var n=document.getElementById(\"ld\");n&&(n.className=\"loader\")}else\"#e\"==o[0]?ws.close():\"#p\"==o[0]&&incr(o[1])}},ws.onerror=function(e){console.log(\"WS err(\"+e.code+\") \"+e.reason),1==ws.readyState&&(document.getElementById(\"status\").textContent=\"WebSocket \"+e.type)},ws.onclose=function(e){rd()}};", nullptr },
{ AC_Element, "inprogress_meter", "function incr(e){var t=e.split(\":\"),r=document.getElementById(\"progress\").getElementsByTagName(\"meter\");r[0].setAttribute(\"value\",t[0]),r[0].setAttribute(\"max\",t[1])}", nullptr },
{ AC_Element, "inprogress_loader", "function incr(pv){}", nullptr },
{ AC_Element, "c7", "</script>", nullptr },

Loading…
Cancel
Save