mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-12 16:46:35 +00:00
longpoll reconnect patch
git-svn-id: https://svn.fhem.de/fhem/trunk@2199 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1bb95df34f
commit
4bdd36c988
32
fhem/CHANGED
32
fhem/CHANGED
@ -1,27 +1,29 @@
|
||||
- SVN
|
||||
- feature: new Module 59_HCS.pm for monitoring heating valves (FHT, HM-CC-VD)
|
||||
to contral a central heating unit. I thank Benjamin for his support! (M.
|
||||
Fischer)
|
||||
to contral a central heating unit. I thank Benjamin for his
|
||||
support! (M. Fischer)
|
||||
- feature: new Module 72_FB_CALLMONITOR for receiving telephone call events
|
||||
(Markus)
|
||||
(Markus)
|
||||
- feature: new Module 71_YAMAHA_AVR.pm for controlling Yamaha AV receivers
|
||||
over network (by Markus)
|
||||
over network (by Markus)
|
||||
- feature: optional second parameter to fhem() to make it silent
|
||||
- feature: autoloading commands, XmlList/etc renamed from 99 to 98.
|
||||
- feature: FHEMWEB returns external files in chunks to save memory
|
||||
- feature: commandref.html splitted: documentation is now appended to the
|
||||
modules.
|
||||
- change: introduced readingsBulkUpdate, readingsSingleUpdate
|
||||
- change: added GPLv2 licensing information
|
||||
- bugfix: FHEMWEB slider with min > 0
|
||||
- change: FHEMWEB CORS moved to options
|
||||
- change: FHEMWEB closing old TCP connections
|
||||
- change: FHEMWEB added "Associated with" to detail-screen (Uli)
|
||||
- change: FHEMWEB added ETag headers (Matthias)
|
||||
- change: FHEMWEB devStateIcon added
|
||||
- change: 98_update.pm due a (probable) bug in perl, modules are no longer
|
||||
loading automatically. A restart is required now! (M. Fischer)
|
||||
modules.
|
||||
- change: introduced readingsBulkUpdate, readingsSingleUpdate
|
||||
- change: added GPLv2 licensing information
|
||||
- bugfix: FHEMWEB slider with min > 0
|
||||
- change: FHEMWEB CORS moved to options
|
||||
- change: FHEMWEB closing old TCP connections
|
||||
- change: FHEMWEB added "Associated with" to detail-screen (Uli)
|
||||
- change: FHEMWEB added ETag headers (Matthias)
|
||||
- change: FHEMWEB devStateIcon added
|
||||
- change: HOWTO auf deutsch (ilmtuelp0815)
|
||||
- change: 98_update.pm due a (probable) bug in perl, modules are no longer
|
||||
loading automatically. A restart is required now! (M. Fischer)
|
||||
- feature: 98_update.pm saves the statefile before an update (M. Fischer)
|
||||
- feature: FHEMWEB longpoll reconnect (Matthias)
|
||||
|
||||
- 2012-10-28 (5.3)
|
||||
- feature: added functions trim, ltrim, rtrim, UntoggleDirect,
|
||||
|
@ -2474,8 +2474,6 @@ FW_FlushInform($)
|
||||
my $c = $hash->{CD};
|
||||
print $c $hash->{INFORMBUF};
|
||||
$hash->{INFORMBUF}="";
|
||||
|
||||
CommandDelete(undef, $name);
|
||||
}
|
||||
|
||||
###################
|
||||
|
@ -15,6 +15,7 @@ body[id~=Media] { background-color: #A5A5A5; font-family:Verdana; font-size:
|
||||
box-shadow:5px 5px 5px #000; margin-bottom: 10px;}
|
||||
#content { position:absolute; top:50px; left:180px; bottom:10px; right:10px; text-align:center}
|
||||
#startcontent {position:absolute; top:20px; left:200px; text-align:left; font-size: 16px; color:gray; }
|
||||
#connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||
|
||||
a { color:#CCCCCC; }
|
||||
|
||||
|
@ -4,6 +4,7 @@ body { background-color: #444444; background-image:url(../icons/darklogo); b
|
||||
#menu { position:absolute; top:170px;left:20px; width:140px; }
|
||||
#hdr { position:absolute; top:10px; left:180px; }
|
||||
#content { position:absolute; top:50px; left:180px; bottom:20px; right:10px; }
|
||||
#connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||
|
||||
a { color: #CCCCCC; text-decoration: none;}
|
||||
a:hover { color: #ffffff; }
|
||||
|
@ -1,5 +1,7 @@
|
||||
/*************** LONGPOLL START **************/
|
||||
var FW_pollConn;
|
||||
//The number of the next line in FW_pollConn.responseText to parse
|
||||
var FW_curLine;
|
||||
|
||||
function
|
||||
FW_cmd(arg) /* see also FW_devState */
|
||||
@ -12,10 +14,22 @@ FW_cmd(arg) /* see also FW_devState */
|
||||
function
|
||||
FW_doUpdate()
|
||||
{
|
||||
if(FW_pollConn.readyState != 4 || FW_pollConn.status != 200)
|
||||
if(FW_pollConn.readyState == 4) {
|
||||
var errdiv = document.createElement('div');
|
||||
errdiv.innerHTML = "Connection lost, reconnecting in 5 seconds...";
|
||||
errdiv.setAttribute("id","connect_err");
|
||||
document.body.appendChild(errdiv);
|
||||
setTimeout("FW_longpoll()", 5000);
|
||||
return; // some problem connecting
|
||||
}
|
||||
|
||||
if(FW_pollConn.readyState != 3)
|
||||
return;
|
||||
var lines = FW_pollConn.responseText.split("\n");
|
||||
for(var i=0; i < lines.length; i++) {
|
||||
//Pop the last (maybe empty) line after the last "\n"
|
||||
//We wait until it is complete, i.e. terminated by "\n"
|
||||
lines.pop();
|
||||
for(var i=FW_curLine; i < lines.length; i++) {
|
||||
var d = lines[i].split(";", 3); // Complete arg
|
||||
if(d.length != 3)
|
||||
continue;
|
||||
@ -23,13 +37,19 @@ FW_doUpdate()
|
||||
if(el)
|
||||
el.innerHTML=d[2];
|
||||
}
|
||||
FW_pollConn.abort();
|
||||
FW_longpoll();
|
||||
//Next time, we continue at the next line
|
||||
FW_curLine = lines.length;
|
||||
}
|
||||
|
||||
function
|
||||
FW_longpoll()
|
||||
{
|
||||
var errdiv = document.getElementById("connect_err");
|
||||
if(errdiv)
|
||||
document.body.removeChild(errdiv);
|
||||
|
||||
FW_curLine = 0;
|
||||
|
||||
FW_pollConn = new XMLHttpRequest();
|
||||
var room="room=all";
|
||||
var sa = document.location.search.substring(1).split("&");
|
||||
|
@ -19,6 +19,7 @@ body[id~=Media] { background-color: #A5A5A5;
|
||||
table a:hover {font-weight:bold;}
|
||||
#hdr { position:absolute; top:10px; left:180px; border:1px solid gray; }
|
||||
#content { position:absolute; top:50px; left:180px; bottom:10px; right:10px; text-align:center}
|
||||
#connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||
a { color: #278727; }
|
||||
img { border-style: none; }
|
||||
table { -moz-border-radius:8px; border-radius:8px; }
|
||||
|
@ -9,6 +9,7 @@ select { font-family:Arial, sans-serif; font-size:16px;}
|
||||
#menu { position:absolute; top: 2px; left:65px; }
|
||||
#hdr { position:absolute; top:40px; left:65px; }
|
||||
#content { position:absolute; top:85px; left: 0px; right: 0px;}
|
||||
#connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:0px; z-index: 10; }
|
||||
|
||||
.devType { padding-top:10px; font-size:12px;}
|
||||
a { color: #278727; }
|
||||
|
@ -9,6 +9,7 @@ select { font-family:Arial, sans-serif; font-size:16px; }
|
||||
#hdr { position:absolute; top:10px; left:180px; }
|
||||
#content { position:absolute; top:50px; left:180px; bottom:20px; right:10px; }
|
||||
|
||||
#connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||
.devType { padding-top:20px; }
|
||||
a { color: #278727; }
|
||||
img { border-style: none; }
|
||||
|
@ -9,6 +9,7 @@ select { font-family:Arial, sans-serif; font-size:16px}
|
||||
#menu { position:absolute; top:152px;left:10px; width:140px; }
|
||||
#hdr { position:absolute; top:10px; left:160px; }
|
||||
#content { position:absolute; top:50px; left:160px; bottom:20px; right:10px; }
|
||||
#connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||
|
||||
.devType { padding-top:20px; }
|
||||
a { color: #278727; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user