diff --git a/fhem/CHANGED b/fhem/CHANGED index f4526fff3..f5186790b 100644 --- a/fhem/CHANGED +++ b/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, diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 5525e4023..b2828032b 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -2474,8 +2474,6 @@ FW_FlushInform($) my $c = $hash->{CD}; print $c $hash->{INFORMBUF}; $hash->{INFORMBUF}=""; - - CommandDelete(undef, $name); } ################### diff --git a/fhem/www/pgm2/darkfloorplanstyle.css b/fhem/www/pgm2/darkfloorplanstyle.css index b82169230..2dc00626c 100644 --- a/fhem/www/pgm2/darkfloorplanstyle.css +++ b/fhem/www/pgm2/darkfloorplanstyle.css @@ -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; } diff --git a/fhem/www/pgm2/darkstyle.css b/fhem/www/pgm2/darkstyle.css index 066ce1d2d..9e0ce66e9 100644 --- a/fhem/www/pgm2/darkstyle.css +++ b/fhem/www/pgm2/darkstyle.css @@ -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; } diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index 711a9af59..b7601f903 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -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("&"); diff --git a/fhem/www/pgm2/floorplanstyle.css b/fhem/www/pgm2/floorplanstyle.css index b2c6caf89..32da26825 100644 --- a/fhem/www/pgm2/floorplanstyle.css +++ b/fhem/www/pgm2/floorplanstyle.css @@ -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; } diff --git a/fhem/www/pgm2/smallscreenstyle.css b/fhem/www/pgm2/smallscreenstyle.css index 9d9d5a367..20ff56626 100644 --- a/fhem/www/pgm2/smallscreenstyle.css +++ b/fhem/www/pgm2/smallscreenstyle.css @@ -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; } diff --git a/fhem/www/pgm2/style.css b/fhem/www/pgm2/style.css index c08ec46d0..7f72b28cb 100644 --- a/fhem/www/pgm2/style.css +++ b/fhem/www/pgm2/style.css @@ -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; } diff --git a/fhem/www/pgm2/touchpadstyle.css b/fhem/www/pgm2/touchpadstyle.css index 22bab15a4..4f0ac271c 100644 --- a/fhem/www/pgm2/touchpadstyle.css +++ b/fhem/www/pgm2/touchpadstyle.css @@ -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; }