2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +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:
rudolfkoenig 2022-01-20 19:44:28 +00:00
parent 29637784ef
commit 8e141d3c59
3 changed files with 28 additions and 0 deletions

View File

@ -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) {

View File

@ -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});

View File

@ -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