Git Product home page Git Product logo

frontail_aem's Introduction

Frontail for openHAB

Streaming openHAB logs to the browser

This is a fork from the official Frontail. It is intended to work especially with openHAB log files.

Features

  • Ability to use Regular Expressions in the highlighting rules definition
  • Use of html classes (instead of inline css rules) to define the appearance in a separate css file
  • Custom highlighting rules, intended for openHAB
  • New theming function, allowing to switch between light and dark mode in the same page (instead of having to choose among the two)
  • Use of HTML Web Storage API to remember the last used theme

Look & Feel

Light Theme

Dark Theme

Installation

Note It can be that the paths differ with you, depending on the system version. Please adjust accordingly.

We install the necessary applications:

sudo apt-get install nodejs
sudo apt-get install npm

Then the frontail itself:

sudo npm i frontail -g

Get (linux-specific) frontail installation folder:

echo "$(npm list -g | head -n 1)/node_modules/frontail"

Copy modified files to frontail

Copy modified files from this repo to the frontail installations dir, i.e.: /usr/lib/node_modules/frontail/

Let's create a new system service:

cd /etc/systemd/system/
sudo nano frontail.service

And in the editor that opens, paste the following script:

#!/bin/sh -

[Unit]
Description=Frontail

[Service]
ExecStart=/usr/lib/node_modules/frontail/bin/frontail --disable-usage-stats --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab_AEM.json --theme openhab_AEM --lines 2000 --number 200 /var/log/openhab/openhab.log /var/log/openhab/events.log /var/log/openhab/zwave.log
Restart=always
User=openhab
Group=openhab

[Install]
WantedBy=multi-user.target
Alias=frontail.service

You may need to change the User and Group values ​​to those that openHab runs under on your system. Save and then run the following commands:

sudo chmod 644 /etc/systemd/system/frontail.service
sudo systemctl daemon-reload
sudo systemctl enable frontail.service
sudo systemctl start frontail.service

If everything is done correctly, then by going to http://<server_addres>:9001 in the browser we will see the treasured logs.

About

It started as a personal modification on the Frontail installation in my openHABian, the full story is in the first post of this thread: https://community.openhab.org/t/frontail-custom-theme-coloring/116673

Long story short, some modifications where made to the following files:

web/index.html
web/assets/app.js

And some files were added:

preset/openhab_AEM.json
web/assets/styles/openhab_AEM.css

Thanks

Thanks to the work of Ethan Dye this is also the standard Frontail version on OpenHABian starting from version 1.6.4: you can install it using openhabian-config, menu 21.

Thanks to Grzegorz Miasko who contributed with new rules and color theme. See his GitHub repository here.

I would also like to thank Schnuecks for helping me and giving some great suggestions. He also created a Repository for the installation via docker image, you can find it here.

frontail_aem's People

Contributors

mthenw avatar lexx27 avatar dependabot[bot] avatar interstellar0verdrive avatar mdelapenya avatar mojoaxel avatar rocat avatar mad-gooze avatar ecdye avatar gifford47 avatar matteocontrini avatar levonet avatar aarondewes avatar ardavis avatar andrew-js-wright avatar domexpire avatar evertet avatar vadakattu avatar kstarzyk avatar orbitbot avatar nayrnet avatar katopz avatar yagop avatar andresol avatar d0nn13 avatar skarnecki avatar tknv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.