mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
notify/FileLog: add a visual notifyRegepCheck (Forum #125381)
git-svn-id: https://svn.fhem.de/fhem/trunk@25523 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
29637784ef
commit
8e141d3c59
@ -275,6 +275,8 @@ notify_fhemwebFn($$$$)
|
||||
$ret .= "</tr>";
|
||||
}
|
||||
}
|
||||
$ret .= '<script>setTimeout(function(){if(FW_checkNotifydev)'.
|
||||
'FW_checkNotifydev("REGEXP")}, 100)</script>';
|
||||
|
||||
my @et = devspec2array("TYPE=eventTypes");
|
||||
if(!@et) {
|
||||
|
@ -566,6 +566,8 @@ FileLog_fhemwebFn($$$$)
|
||||
# DETAIL only from here on
|
||||
my $hash = $defs{$d};
|
||||
|
||||
$ret .= '<script>setTimeout(function(){if(FW_checkNotifydev)'.
|
||||
'FW_checkNotifydev("REGEXP")}, 100)</script>';
|
||||
$ret .= "<br>Regexp parts";
|
||||
$ret .= "<br><table class=\"block wide\">";
|
||||
my @ra = split(/\|/, $hash->{REGEXP});
|
||||
|
@ -2130,6 +2130,30 @@ FW_getSVG(emb)
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function
|
||||
FW_checkNotifydev(reName)
|
||||
{
|
||||
var internals={};
|
||||
$("table.internals tr td div.dname").each(function(){
|
||||
internals[$(this).html()] = this;
|
||||
});
|
||||
if(!internals[reName] || internals.NOTIFYDEV)
|
||||
return;
|
||||
$(internals[reName])
|
||||
.html(reName+" <a>(!)</a>")
|
||||
.css("cursor","pointer")
|
||||
.click(function(){
|
||||
var val = $(internals[reName]).closest("tr").find("div[informid]").text();
|
||||
FW_okDialog("Could not optimize the regexp:<ul>"+val+
|
||||
"</ul>How I tried (notifyRegexpCheck):<ul><pre></pre></ul>");
|
||||
FW_cmd(FW_root+'?cmd={notifyRegexpCheck("'+val+'")}&XHR=1',
|
||||
function(res){
|
||||
$("#FW_okDialog pre").html(res);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
=pod
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user