Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
services:dashboards [2024/02/27 12:43] – created willy | services:dashboards [2024/04/08 12:56] (current) – willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Dashboard ====== | + | ====== |
- | Wouldn' | + | A **dashboard** is a nice web page where you can organize |
- | There are literally lots of options at your fingertip, looking for //html dashboard// or similar queries will find you tons of open-source products that you can explore and try out. [[https:// | + | There are literally lots of options at your fingertip, looking for //html dashboard// or similar queries will find you tons of open-source products that you can explore and try out. [[https:// |
- | + | ||
- | Since i wanted something really simple | + | I started using [[https://github.com/gardiol/ |
- | | + | |
- | * Pure HTML+CSS with a drop of Javascript | + | |
- | * Easily extensible, based on a // | + | |
- | * Only depends on [[https://jquery.com/|jQuery]] and nothing else | + | |
- | * It's all into three files, including jQuery. | + | |
- | The only simpler approach would be a static | + | Some advantages: |
+ | * It's 100% client-side | ||
+ | * Pure HTML+CSS with a drop of Javascript (jQuery) | ||
+ | * Easily extensible, based on a //JSON// file | ||
+ | * No external dependency (no CDN, no internet required) | ||
+ | * It's all into five files, including jQuery. | ||
Go back to the NGINX page and check the //root// path i told you to use: **root / | Go back to the NGINX page and check the //root// path i told you to use: **root / | ||
- | ===== The single HTML page ===== | + | ===== Installation |
- | This is the simplest possible solution, a static HTML page. Drop the following file into **/ | + | Clone the repository here [[https:// |
- | <file html index.html> | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | < | + | |
- | </ | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | You **can' | + | |
- | + | ||
- | ===== The simple Dashboard ===== | + | |
- | + | ||
- | This is a very small client-side Javascript app that will fetch a list of links from a json file and generate on-the-fly a nice page for your browser. You need: | + | |
- | * One index.html page with little HTML and some Javascript | + | |
- | * One CSS file | + | |
- | * One // | + | |
- | * Optionally, a subfolder called //images// with icons for the links | + | |
- | + | ||
- | You can grab the repository here [[https:// | + | |
<code bash> | <code bash> | ||
cd / | cd / | ||
Line 52: | Line 24: | ||
</ | </ | ||
- | Then create the **site.json** file: | + | Then create the **site.json** file, for example: |
<file json site.json> | <file json site.json> | ||
{ | { | ||
- | | + | |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | }, | + | }, |
- | | + | "content" : [ // List of rows |
- | [ [ { | + | { |
- | | + | "foldable": |
- | " | + | "title": "", |
- | " | + | "content": |
- | " | + | |
- | " | + | |
- | },{ | + | |
- | " | + | |
- | | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }], | + | |
- | [{ | + | |
- | " | + | |
- | "text" : " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | | + | |
- | "img" : " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | },{ | + | |
- | "img" : " | + | |
- | " | + | |
- | " | + | |
- | "style" : "small", | + | |
- | " | + | |
- | },{ | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | "style" : " | + | |
- | " | + | |
- | },{ | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }], | + | |
- | | + | // Example of two link blocks to a service or page: |
- | " | + | |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | },{ | + | " |
- | " | + | },{ |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | },{ | + | " |
- | " | + | } ] |
- | " | + | |
- | " | + | |
- | " | + | // Example of one link block to display external output in dashboard: |
- | " | + | [ { |
- | | + | |
- | | + | "run" : "/cgi/monitor.sh", |
- | "text" : "Libri", | + | "style" : "runner", |
- | "link" : "/readarr-books/", | + | "interval" : 5 |
- | " | + | } ] |
- | "new_page" : true | + | } ], |
- | },{ | + | |
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | } |
- | " | + | |
- | | + | |
} | } | ||
</ | </ | ||
- | This dashboard | + | Here are a few screenshots: |
+ | {{ : | ||
+ | {{ : | ||
+ | |||
+ | ===== Style ===== | ||
+ | |||
+ | The dashboard can easily | ||
+ | < | ||
+ | body { background: black; } | ||
+ | a { color: darkred; } | ||
+ | div.header > span { color: white; } | ||
+ | .ok { color: green; } | ||
+ | .ko { color: red; } | ||
+ | |||
+ | .box { | ||
+ | width: 20em; | ||
+ | height: 21em; | ||
+ | background: orange; | ||
+ | margin: 1em; | ||
+ | padding: 0.5em; | ||
+ | text-align: center; | ||
+ | border-radius: | ||
+ | box-shadow: 0.2em 0.2em darkred; | ||
+ | } | ||
+ | .box > a > p { | ||
+ | height: 2em; | ||
+ | margin: 0px; | ||
+ | font-size: 150%; | ||
+ | } | ||
+ | .box > a > img { | ||
+ | height: 19em; | ||
+ | width: 19em; | ||
+ | } | ||
+ | |||
+ | .small { | ||
+ | width: 5em; | ||
+ | height: 6em; | ||
+ | background: orange; | ||
+ | margin: 1em; | ||
+ | padding: 0.5em; | ||
+ | text-align: center; | ||
+ | border-radius: | ||
+ | box-shadow: 0.2em 0.2em darkred; | ||
+ | } | ||
+ | .small > a > p { | ||
+ | height: 1em; | ||
+ | margin: 0px; | ||
+ | } | ||
+ | .small > a > img { | ||
+ | height: 4.5em; | ||
+ | width: 4.5em; | ||
+ | } | ||
+ | |||
+ | .container > p { | ||
+ | color: white; | ||
+ | border-top: 1px solid white; | ||
+ | } | ||
+ | |||
+ | .runner { | ||
+ | max-width: 40em; | ||
+ | max-height: 40em; | ||
+ | background: orange; | ||
+ | color: darkred; | ||
+ | margin: 1em; | ||
+ | padding: 0.5em; | ||
+ | text-align: center; | ||
+ | border-radius: | ||
+ | box-shadow: 0.2em 0.2em darkred; | ||
+ | } | ||
+ | .runner > p { | ||
+ | color: darkred; | ||
+ | margin: 0px; | ||
+ | font-size: 150%; | ||
+ | } | ||
+ | </ | ||