2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 01:06:04 +00:00

92_FileLog: att logtype text:linesInTheFile (Forum #133932)

git-svn-id: https://svn.fhem.de/fhem/trunk@27743 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2023-07-10 09:44:35 +00:00
parent 4fd153f8a6
commit 6904be6d4c

View File

@ -591,6 +591,15 @@ FileLog_fhemwebFn($$$$)
}
my ($lt, $name) = split(":", $ln);
$name = $lt if(!$name);
if($ln eq "text:linesInTheFile") {
my $path = qx(dirname $defs{$d}{currentlogfile});
chomp $path;
my $filename = "$path/$f";
my ($err, @content) =
FileRead( {(FileName => $filename, ForceType => "FILE" )} );
$name = "$lt (".scalar(@content).")";
@content = ();
}
$ret .= FW_pH("$FW_ME/FileLog_logWrapper&dev=$d&type=$lt&file=$f",
"<div class=\"dval\">$name</div>", 1, "dval", 1);
}