Hello Jay,
I just noticed that there was a problem in the copy-paste of my app.js code, for some reason it added some funky “DISCOURSE_PLACEHOLDER_2” text where it should not be. I udated the post with the correct code, now you should see it correctly, try to see if it solves your problem!
You are correct about escaping the \ - actually its the same on my code. Again, for some reason this part was broken in my post. There was a problem a few days ago, and my first post got lost with the issue of the forum - probably when I reposted, the code from the backup was messed up and I didn’t notice. I am going to check all the code so that it is correct. Thank you for pointing out!
It seems like the RegEx rules are not working.
Item name is defined by:
"Item '(.*?)'": "itemStyle"
so it should add a span with class itemStyle around the item name.
Then itemStyle css rule defines the appearance.
If I were you I would try to inspect the HTML code to see if:
the span is applied: if not, then the problem is in the RegEx
the style is applied: if not, there’s something wrong with the css rule. Take in consideration that things like display: inline-block; may be problematic if not supported by your browser / webView.
The same basically applies for all the rest.
For the date, check if the format of the RegEx corresponds to your layout (yyyy-mm-dd hh:mm:ss.fff): \\d{4}-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d.\\d{3}
in my case corresponds to eg: 2021-01-26 14:35:25.323
Here’s an example of the output html in my Frontail:
i also interpreted your code like this and thought i cant find the error, everything seems fine.
I tried it in chrome and firefox (both on the newest version) on Win10.
Thanks for the note for inspecting, i just didnt think about that, but that revealed, that:
my html seems fine, but i got one css problem:
this negative indent just collapses the fields and when i deactivate it i get a good looking log:
it comes from the openhab_dark.css:44 and i guess i just have to overwrite
if i remember correctly the more specific/nearer instance should be taken, so it gets set to 0 and then to -288px…
but whatever… now it works and it looks beautyful.
thank you again! =)
@Schnuecks openHABian’s files for frontail were recently updates to allow for more customization. If you want, when you move to OH3 it would be awesome if you could try and integrate some of these improvements in a PR to openHABian.
Hello,
i have created a fork of frontail and added the modifications of this thread into it.
the files used are from the frontail installation of openhabian
I found the issue, you were using the latest version of mthenw’s build (4.9.2) as source. I’m running Docker on a Synology, and I need to stick ion v4.9.1 (latest version doesn’t work on some hardware)
But I quicky made the modifications on the previous version, and the result is perfect!
This problem i had before and had to modify the Dockerfile and try to find some lightweight node images that runs on arm, but now with the node buster slim it works. But glad that it work right now.
Hi @Schnuecks
Thank you!
In the meanwhile I am updating the json, css and js files to make the customization process easier.
In particular:
I moved some json rules from “words” to “wordsRegExClass”. This way it uses the RegEx to add classes, that can be styled via css, instead of hardcoding the css rules in the html. This also allows to have always the same json for all css files, and only modify the css rules to change the appearance.
I modified part of the js to add/remove the “line-selected” class instead of replacing .line with .line-selected, as it was doing before. This allows to address some rules specific for selected lines, which was not possible before.
These modifications open to a lot more customization, doable only via css. It is also easier to test because you just need to reload the page instead of having to reload the daemon and restart frontail all the time.
As soon as I finish I will update this post with all the details!
The dark theme is finished, I am updating the light theme.