mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 00:26:03 +00:00
FHEMWEB: save displays a message, connect_err renamed to errmsg
git-svn-id: https://svn.fhem.de/fhem/trunk@4891 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c156cac8a2
commit
26e27b5ff7
@ -1257,7 +1257,7 @@ CommandSave($$)
|
|||||||
foreach my $fh (values %fh) {
|
foreach my $fh (values %fh) {
|
||||||
close($fh) if($fh ne "1");
|
close($fh) if($fh ne "1");
|
||||||
}
|
}
|
||||||
return ($ret ? $ret : undef);
|
return ($ret ? $ret : "Wrote configuration to $param");
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
|
@ -8,7 +8,7 @@ div#logo { position: fixed; z-index:12000; top:3px; left:5px; float:left; wid
|
|||||||
#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
|
#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
|
||||||
#hdr { position: fixed; z-index: 1000; float: left; clear: both; height:32px; width: 100%; -webkit-box-sizing: border-box; moz-box-sizing: border-box; box-sizing: border-box; background:black; background-image: linear-gradient(#333333,#222222); }
|
#hdr { position: fixed; z-index: 1000; float: left; clear: both; height:32px; width: 100%; -webkit-box-sizing: border-box; moz-box-sizing: border-box; box-sizing: border-box; background:black; background-image: linear-gradient(#333333,#222222); }
|
||||||
#content { width:70%; float:right; margin-top:60px; }
|
#content { width:70%; float:right; margin-top:60px; }
|
||||||
#connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
#errmsg { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||||
table { margin: 0; padding: 0; border-spacing: 0px; border-collapse:separate; }
|
table { margin: 0; padding: 0; border-spacing: 0px; border-collapse:separate; }
|
||||||
td, th { font-family: Arial, sans-serif; font-size:11px; line-height:13px; vertical-align:middle; }
|
td, th { font-family: Arial, sans-serif; font-size:11px; line-height:13px; vertical-align:middle; }
|
||||||
th { font-weight:bold; font-size:12px; text-align:left; }
|
th { font-weight:bold; font-size:12px; text-align:left; }
|
||||||
|
@ -6,13 +6,11 @@ function
|
|||||||
consUpdate()
|
consUpdate()
|
||||||
{
|
{
|
||||||
if(consConn.readyState == 4) {
|
if(consConn.readyState == 4) {
|
||||||
var errdiv = document.createElement('div');
|
FW_errmsg("Connection lost, trying a reconnect every 5 seconds.");
|
||||||
errdiv.innerHTML = "Connection lost, reconnecting in 5 seconds...";
|
setTimeout(consFill, 5000);
|
||||||
errdiv.setAttribute("id","connect_err");
|
|
||||||
document.body.appendChild(errdiv);
|
|
||||||
setTimeout("consFill()", 5000);
|
|
||||||
return; // some problem connecting
|
return; // some problem connecting
|
||||||
}
|
}
|
||||||
|
|
||||||
if(consConn.readyState != 3)
|
if(consConn.readyState != 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -26,12 +24,8 @@ consUpdate()
|
|||||||
function
|
function
|
||||||
consFill()
|
consFill()
|
||||||
{
|
{
|
||||||
var errdiv = document.getElementById("connect_err");
|
FW_errmsg("");
|
||||||
if(errdiv)
|
|
||||||
document.body.removeChild(errdiv);
|
|
||||||
|
|
||||||
consConn = new XMLHttpRequest();
|
consConn = new XMLHttpRequest();
|
||||||
// Needed when using multiple FF windows
|
|
||||||
var query = document.location.pathname+"?XHR=1"+
|
var query = document.location.pathname+"?XHR=1"+
|
||||||
"&inform=type=raw;filter=.*"+
|
"&inform=type=raw;filter=.*"+
|
||||||
"×tamp="+new Date().getTime();
|
"×tamp="+new Date().getTime();
|
||||||
|
@ -13,7 +13,7 @@ body[id~=Media] { background-color: #A5A5A5; font-family:Arial, Helvetica, s
|
|||||||
box-shadow:5px 5px 5px #000; margin-bottom: 10px;}
|
box-shadow:5px 5px 5px #000; margin-bottom: 10px;}
|
||||||
#content { position:absolute; top:50px; left:180px; bottom:10px; right:10px; text-align:center}
|
#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; }
|
#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; }
|
#errmsg { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||||
|
|
||||||
a { color:#CCCCCC; text-decoration:none;}
|
a { color:#CCCCCC; text-decoration:none;}
|
||||||
td {padding-left: 3px; padding-right: 3px; padding-top: 3px; padding-bottom: 3px;}
|
td {padding-left: 3px; padding-right: 3px; padding-top: 3px; padding-bottom: 3px;}
|
||||||
|
@ -6,7 +6,7 @@ body { background-color: #444444; background-image:url(../images/default/fhe
|
|||||||
#menu { position:absolute; top: 2px; left:65px; }
|
#menu { position:absolute; top: 2px; left:65px; }
|
||||||
#hdr { position:absolute; top:40px; left:65px; }
|
#hdr { position:absolute; top:40px; left:65px; }
|
||||||
#content { position:absolute; top:75px; left: 0px; right: 0px;}
|
#content { position:absolute; top:75px; left: 0px; right: 0px;}
|
||||||
#connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:0px; z-index: 10; }
|
#errmsg { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:0px; z-index: 10; }
|
||||||
|
|
||||||
a { color: #CCCCCC; text-decoration: none;}
|
a { color: #CCCCCC; text-decoration: none;}
|
||||||
a:hover { color: #ffffff; }
|
a:hover { color: #ffffff; }
|
||||||
|
@ -7,7 +7,7 @@ body { background-color: #444444; background-image:url(../images/default/fhe
|
|||||||
#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
|
#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
|
||||||
#hdr { position:absolute; top:10px; left:180px; }
|
#hdr { position:absolute; top:10px; left:180px; }
|
||||||
#content { position:absolute; top:50px; left:180px; bottom:20px; right:10px; }
|
#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; }
|
#errmsg { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||||
|
|
||||||
a { color: #CCCCCC; text-decoration: none;}
|
a { color: #CCCCCC; text-decoration: none;}
|
||||||
a:hover { color: #ffffff; }
|
a:hover { color: #ffffff; }
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/* Author: Volker */
|
/* Author: Volker */
|
||||||
.background { fill:none; fill-opacity:0.0; }
|
|
||||||
|
|
||||||
text { font-family:Arial, Helvetica, sans-serif; font-size:12px; fill:#CCCCCC;}
|
text { font-family:Arial, Helvetica, sans-serif; font-size:12px; fill:#CCCCCC;}
|
||||||
text.title {font-family:Arial, Helvetica, sans-serif; font-size:16px; fill:#CCCCCC;}
|
text.title {font-family:Arial, Helvetica, sans-serif; font-size:16px; fill:#CCCCCC;}
|
||||||
text.copy { text-decoration:underline; stroke:none; fill:blue;}
|
text.copy { text-decoration:underline; stroke:none; fill:blue;}
|
||||||
|
@ -10,22 +10,44 @@ FW_cmd(arg) /* see also FW_devState */
|
|||||||
var req = new XMLHttpRequest();
|
var req = new XMLHttpRequest();
|
||||||
req.open("GET", arg, true);
|
req.open("GET", arg, true);
|
||||||
req.send(null);
|
req.send(null);
|
||||||
|
req.onreadystatechange = function(){
|
||||||
|
if(req.readyState == 4)
|
||||||
|
FW_errmsg(req.responseText, 5000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function
|
||||||
|
FW_errmsg(txt, timeout)
|
||||||
|
{
|
||||||
|
var errmsg = document.getElementById("errmsg");
|
||||||
|
if(!errmsg) {
|
||||||
|
if(txt == "")
|
||||||
|
return;
|
||||||
|
errmsg = document.createElement('div');
|
||||||
|
errmsg.setAttribute("id","errmsg");
|
||||||
|
document.body.appendChild(errmsg);
|
||||||
|
}
|
||||||
|
if(txt == "") {
|
||||||
|
document.body.removeChild(errmsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
errmsg.innerHTML = txt;
|
||||||
|
if(timeout)
|
||||||
|
setTimeout("FW_errmsg('')", timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
function
|
function
|
||||||
FW_doUpdate()
|
FW_doUpdate()
|
||||||
{
|
{
|
||||||
if(FW_pollConn.readyState == 4 && !FW_leaving) {
|
if(FW_pollConn.readyState == 4 && !FW_leaving) {
|
||||||
var errdiv = document.createElement('div');
|
FW_errmsg("Connection lost, trying a reconnect every 5 seconds.", 4900);
|
||||||
errdiv.innerHTML = "Connection lost, reconnecting in 5 seconds...";
|
setTimeout(FW_longpoll, 5000);
|
||||||
errdiv.setAttribute("id","connect_err");
|
|
||||||
document.body.appendChild(errdiv);
|
|
||||||
setTimeout("FW_longpoll()", 5000);
|
|
||||||
return; // some problem connecting
|
return; // some problem connecting
|
||||||
}
|
}
|
||||||
|
|
||||||
if(FW_pollConn.readyState != 3)
|
if(FW_pollConn.readyState != 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var lines = FW_pollConn.responseText.split("\n");
|
var lines = FW_pollConn.responseText.split("\n");
|
||||||
//Pop the last (maybe empty) line after the last "\n"
|
//Pop the last (maybe empty) line after the last "\n"
|
||||||
//We wait until it is complete, i.e. terminated by "\n"
|
//We wait until it is complete, i.e. terminated by "\n"
|
||||||
@ -76,12 +98,7 @@ FW_doUpdate()
|
|||||||
function
|
function
|
||||||
FW_longpoll()
|
FW_longpoll()
|
||||||
{
|
{
|
||||||
var errdiv = document.getElementById("connect_err");
|
|
||||||
if(errdiv)
|
|
||||||
document.body.removeChild(errdiv);
|
|
||||||
|
|
||||||
FW_curLine = 0;
|
FW_curLine = 0;
|
||||||
|
|
||||||
FW_pollConn = new XMLHttpRequest();
|
FW_pollConn = new XMLHttpRequest();
|
||||||
|
|
||||||
var filter = document.body.getAttribute("longpollfilter");
|
var filter = document.body.getAttribute("longpollfilter");
|
||||||
@ -131,7 +148,7 @@ FW_replaceLinks()
|
|||||||
for(var i1=0; i1< elArr.length; i1++) {
|
for(var i1=0; i1< elArr.length; i1++) {
|
||||||
var a = elArr[i1];
|
var a = elArr[i1];
|
||||||
var ma = a.getAttribute("href").match(/^(.*\?)(cmd[^=]*=.*)$/);
|
var ma = a.getAttribute("href").match(/^(.*\?)(cmd[^=]*=.*)$/);
|
||||||
if(ma == null || ma.length == 0 || ma[2].match(/=(style|save)/))
|
if(ma == null || ma.length == 0 || !ma[2].match(/=(save|set)/))
|
||||||
continue;
|
continue;
|
||||||
a.removeAttribute("href");
|
a.removeAttribute("href");
|
||||||
a.setAttribute("onclick", "FW_cmd('"+ma[1]+"XHR=1&"+ma[2]+"')");
|
a.setAttribute("onclick", "FW_cmd('"+ma[1]+"XHR=1&"+ma[2]+"')");
|
||||||
|
@ -19,7 +19,7 @@ body[id~=Media] { background-color: #A5A5A5;
|
|||||||
table a:hover {font-weight:bold;}
|
table a:hover {font-weight:bold;}
|
||||||
#hdr { position:absolute; top:10px; left:180px; border:1px solid gray; }
|
#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}
|
#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; }
|
#errmsg { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||||
a { color: #278727; }
|
a { color: #278727; }
|
||||||
img { border-style: none; }
|
img { border-style: none; }
|
||||||
table { -moz-border-radius:8px; border-radius:8px; }
|
table { -moz-border-radius:8px; border-radius:8px; }
|
||||||
|
@ -19,7 +19,7 @@ body[id~=Media] { background-color: #A5A5A5;
|
|||||||
table a:hover {font-weight:bold;}
|
table a:hover {font-weight:bold;}
|
||||||
#hdr { position:absolute; top:10px; left:180px; border:1px solid gray; }
|
#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}
|
#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; }
|
#errmsg { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||||
a { color: #278727; }
|
a { color: #278727; }
|
||||||
img { border-style: none; }
|
img { border-style: none; }
|
||||||
table { -moz-border-radius:8px; border-radius:8px; }
|
table { -moz-border-radius:8px; border-radius:8px; }
|
||||||
|
@ -19,7 +19,7 @@ body[id~=Media] { background-color: #A5A5A5;
|
|||||||
table a:hover {font-weight:bold;}
|
table a:hover {font-weight:bold;}
|
||||||
#hdr { position:absolute; top:10px; left:180px; border:1px solid gray; }
|
#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}
|
#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; }
|
#errmsg { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||||
a { color: #278727; }
|
a { color: #278727; }
|
||||||
img { border-style: none; }
|
img { border-style: none; }
|
||||||
table { -moz-border-radius:8px; border-radius:8px; }
|
table { -moz-border-radius:8px; border-radius:8px; }
|
||||||
|
@ -15,7 +15,7 @@ select { font-family:Helvetica; font-weight:300; font-size:16px;}
|
|||||||
#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
|
#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
|
||||||
#hdr { position:absolute; top:40px; left:65px; }
|
#hdr { position:absolute; top:40px; left:65px; }
|
||||||
#content { position:absolute; top:85px; left: 0px; right: 0px;}
|
#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; }
|
#errmsg { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:0px; z-index: 10; }
|
||||||
|
|
||||||
.devType { padding-top:10px; font-size:16px;}
|
.devType { padding-top:10px; font-size:16px;}
|
||||||
a { color: #151515; }
|
a { color: #151515; }
|
||||||
|
@ -23,7 +23,7 @@ select { font-family:Helvetica; font-weight:300; font-size:16px; }
|
|||||||
#content { position:absolute; top:50px; left:250px; bottom:20px; right:20px;
|
#content { position:absolute; top:50px; left:250px; bottom:20px; right:20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#connect_err { background-color: #e5e5e5; color: #151515; text-align: center; padding-top: 25%; font-size: 350%; font-weight: bold;
|
#errmsg { background-color: #e5e5e5; color: #151515; text-align: center; padding-top: 25%; font-size: 350%; font-weight: bold;
|
||||||
position:fixed; top:0px; left:0px; z-index: 10; width:100%; height: 100%; opacity: 0.7;
|
position:fixed; top:0px; left:0px; z-index: 10; width:100%; height: 100%; opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/* Author: Volker Edit: fhainz */
|
/* Author: Volker Edit: fhainz */
|
||||||
.background { fill:none; fill-opacity:0.0; }
|
|
||||||
|
|
||||||
text { font-family: Helvetica; font-weight:300; font-size:12px; fill:#343434;}
|
text { font-family: Helvetica; font-weight:300; font-size:12px; fill:#343434;}
|
||||||
text.title {font-family: Helvetica; font-weight:300; font-size:16px; fill:#343434;}
|
text.title {font-family: Helvetica; font-weight:300; font-size:16px; fill:#343434;}
|
||||||
text.copy { text-decoration:underline; stroke:none; fill:blue;}
|
text.copy { text-decoration:underline; stroke:none; fill:blue;}
|
||||||
|
@ -19,7 +19,7 @@ body[id~=Media] { background-color: #A5A5A5;
|
|||||||
table a:hover {font-weight:bold;}
|
table a:hover {font-weight:bold;}
|
||||||
#hdr { position:absolute; top:10px; left:180px; border:1px solid gray; }
|
#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}
|
#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; }
|
#errmsg { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
|
||||||
a { color: #278727; }
|
a { color: #278727; }
|
||||||
img { border-style: none; }
|
img { border-style: none; }
|
||||||
table { -moz-border-radius:8px; border-radius:8px; }
|
table { -moz-border-radius:8px; border-radius:8px; }
|
||||||
|
@ -12,7 +12,7 @@ select { font-family:Arial, sans-serif; font-size:16px;}
|
|||||||
#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
|
#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
|
||||||
#hdr { position:absolute; top:40px; left:65px; }
|
#hdr { position:absolute; top:40px; left:65px; }
|
||||||
#content { position:absolute; top:85px; left: 0px; right: 0px;}
|
#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; }
|
#errmsg { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:0px; z-index: 10; }
|
||||||
|
|
||||||
.devType { padding-top:10px; font-size:12px;}
|
.devType { padding-top:10px; font-size:12px;}
|
||||||
a { color: #278727; }
|
a { color: #278727; }
|
||||||
@ -79,3 +79,4 @@ svg { height:32px; width:32px; fill:#278727; }
|
|||||||
g.on { fill:red; }
|
g.on { fill:red; }
|
||||||
|
|
||||||
.changed { color:red; }
|
.changed { color:red; }
|
||||||
|
#cloudfree { display:none; }
|
||||||
|
@ -15,7 +15,7 @@ select { font-family:Arial, sans-serif; font-size:16px; }
|
|||||||
#hdr { position:absolute; top:10px; left:180px; }
|
#hdr { position:absolute; top:10px; left:180px; }
|
||||||
#content { position:absolute; top:50px; left:180px; bottom:20px; right:10px; }
|
#content { position:absolute; top:50px; left:180px; bottom:20px; right:10px; }
|
||||||
|
|
||||||
#connect_err { background-color: #000000; color: #FFFFFF;
|
#errmsg { background-color: #000000; color: #FFFFFF;
|
||||||
position:absolute; top:0px; left:40px; z-index: 10; }
|
position:absolute; top:0px; left:40px; z-index: 10; }
|
||||||
.devType { padding-top:20px; }
|
.devType { padding-top:20px; }
|
||||||
a { color: #278727; }
|
a { color: #278727; }
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
.background { fill:none; fill-opacity:0.0; }
|
|
||||||
|
|
||||||
text { font-family:Times; font-size:12px; }
|
text { font-family:Times; font-size:12px; }
|
||||||
text.title { font-size:16px; }
|
text.title { font-size:16px; }
|
||||||
text.copy { text-decoration:underline; stroke:none; fill:blue; }
|
text.copy { text-decoration:underline; stroke:none; fill:blue; }
|
||||||
|
@ -12,7 +12,7 @@ select { font-family:Arial, sans-serif; font-size:18px}
|
|||||||
#hdr { position:absolute; top:10px; left:160px; }
|
#hdr { position:absolute; top:10px; left:160px; }
|
||||||
#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
|
#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
|
||||||
#content { position:absolute; top:50px; left:160px; bottom:20px; right:10px; }
|
#content { position:absolute; top:50px; left:160px; bottom:20px; right:10px; }
|
||||||
#connect_err { background-color:#000000; color:#FFFFFF;
|
#errmsg { background-color:#000000; color:#FFFFFF;
|
||||||
position:absolute; top:0px; left:40px; z-index: 10; }
|
position:absolute; top:0px; left:40px; z-index: 10; }
|
||||||
|
|
||||||
.devType { padding-top:20px; }
|
.devType { padding-top:20px; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user