I'm kind of stuck with a problem. (Apart from the obvious)
Here is part of the flow and the list generation:
[{"id":"1deb29d5.dfb98e","type":"ui_button","z":"a3bd09a.b852978","name":"Generate reboot history list","group":"9630e6fb.2f4208","order":1,"width":"4","height":"1","passthru":false,"label":"Generate","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"date","topic":"","x":370,"y":150,"wires":[["88ec09d0.6e1c28"]]},{"id":"88ec09d0.6e1c28","type":"exec","z":"a3bd09a.b852978","command":"cat /media/pi/9020-9C27/logs/*","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Cat","x":470,"y":210,"wires":[["17917965.d43657"],[],[]]},{"id":"17917965.d43657","type":"split","z":"a3bd09a.b852978","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":630,"y":200,"wires":[["f8e85ffb.27a12"]]},{"id":"f8e85ffb.27a12","type":"switch","z":"a3bd09a.b852978","name":"","property":"payload","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":250,"wires":[["8d28b379.4fc7b","80f6579c.fcf2e8"]]},{"id":"80f6579c.fcf2e8","type":"ui_template","z":"a3bd09a.b852978","group":"9630e6fb.2f4208","name":"Reboot history","order":0,"width":"8","height":"6","format":"<table id=\"table\" border=\"1\">\n <tr>\n <th>Reboot times</th> \n </tr>\n <tbody>\n <tr ng-repeat=\"row in msg.payload track by $index\">\n <td class=\"text\" >{{row}}</td>\n </tr>\n </tbody>\n</table>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":840,"y":380,"wires":[[]]},{"id":"9630e6fb.2f4208","type":"ui_group","z":"","name":"Reboot history","tab":"22b3809f.04cca","order":1,"disp":true,"width":"8","collapse":false},{"id":"22b3809f.04cca","type":"ui_tab","z":"","name":"History","icon":"dashboard","order":6,"disabled":false,"hidden":false}]
The problem is that the list is backwards to read.
I'm wanting the most recent at the top, rather than the bottom.
As it is, when the list is presented the scroll is at the top of the window and I have to scroll down to see the latest line.
Though that is how things usually are laid out (like in books) it would be nicer if the latest was at the top.
I have another version which does similar and it too is the wrong way around.
I could reverse list the file with tac
, rather than cat
but from memory it doesn't fix the problem.
I shall check again later today but I am just putting the question out there because if I am wrong in thinking that tac
will work, it is better the question is out there now rather than in 8 hours time.