Scroll to bottom a text in the Dashboard

Hi,

I am trying to display a custom log file in the Dashboard with the following flow:

[{"id":"2f49c88580f49880","type":"ui_template","z":"fd95058a.48e3e8","group":"c8d32031ab47f343","name":"Events Log","order":1,"width":"10","height":"7","format":"<div ng-style=\"{'margin-left':'10px'}\" id=\"events\">\n  <pre>{{msg.payload}}</pre>\n</div>\n","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","className":"","x":570,"y":1840,"wires":[[]]},{"id":"a0a16e56e3df5218","type":"inject","z":"fd95058a.48e3e8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":1840,"wires":[["a2fbd25ac7c1a0c1"]]},{"id":"a2fbd25ac7c1a0c1","type":"file in","z":"fd95058a.48e3e8","name":"LogFile","filename":"/home/boss/SaltyREST/logs/SaltyREST.log","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":380,"y":1840,"wires":[["2f49c88580f49880"]]},{"id":"c8d32031ab47f343","type":"ui_group","name":"Events Log","tab":"2e10f8bfea96ca87","order":1,"disp":true,"width":"10","collapse":false,"className":""},{"id":"2e10f8bfea96ca87","type":"ui_tab","name":"Log","icon":"dashboard","disabled":false,"hidden":false}]

I need to scroll to the bottom of the file, upon loading, so that to reach the latest log line, but I am not so familiar with templates...
Any suggestion?
Thanks

If you are wanting to see the last part of the given log file, and when you display it, that is ..... at the bottom......

Why not reverse the log file's viewing order?

Sorry, I'm not going to import the flow just now.

But I'm guessing you are doing something like:

cat logfile_name.txt (or what ever) and sending that to a text node.
Or similar.

So rather than cat, use tac.

Then the last part will be at the top.

Just a thought.

Gosh I've been using Linux shells for decades and never come across tac. Thanks!

Here is a demo I did some time ago: Where can I find (or enable) an "interactive" console in node-red? - #15 by Steve-Mcl

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.