Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| sailing:dashboards [2023/12/06 07:24] – created willy | sailing:dashboards [2024/02/27 12:39] (current) – removed willy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Prev to: [[sailing: | ||
| - | ---- | ||
| - | ====== Dashboard ====== | ||
| - | You got to the end, at last. | ||
| - | |||
| - | At this point all you need is to create a wrap-up page with links to all the services to be used as landing page for your reverse-proxy. You can think of a link dashboard for easy access. | ||
| - | |||
| - | 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. | ||
| - | |||
| - | Since i wanted something really simple and easy, i wrote my own dashboard. Some advantages: | ||
| - | * It's 100% client-side | ||
| - | * Pure HTML+CSS with a drop of Javascript | ||
| - | * Easily extensible, based on a // | ||
| - | * Only depends on [[https:// | ||
| - | * It's all into three files, including jQuery. | ||
| - | |||
| - | The only simpler approach would be a static HTML page with a link for each service. | ||
| - | |||
| - | Go back to the NGINX page and check the //root// path i told you to use: **root / | ||
| - | |||
| - | ===== The single HTML page ===== | ||
| - | |||
| - | This is the simplest possible solution, a static HTML page. Drop the following file into **/ | ||
| - | <file html index.html> | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | You can't go any simpler than this. | ||
| - | |||
| - | ===== 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 | ||
| - | |||
| - | So create the following files in your **/ | ||
| - | <file html index.html> | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | <meta name=" | ||
| - | <link rel=" | ||
| - | <meta http-equiv=" | ||
| - | <meta http-equiv=" | ||
| - | < | ||
| - | <meta charset=" | ||
| - | <link rel=" | ||
| - | <script src=" | ||
| - | </ | ||
| - | < | ||
| - | <div id=" | ||
| - | <img src=" | ||
| - | </ | ||
| - | <div id=" | ||
| - | </ | ||
| - | < | ||
| - | $(window).on(' | ||
| - | | ||
| - | function(data){ | ||
| - | | ||
| - | if ( data.header ){ | ||
| - | var header = $('< | ||
| - | | ||
| - | } | ||
| - | for (var row = 0; row < data.content.length; | ||
| - | var box = $('< | ||
| - | for ( var item = 0; item < data.content[row].length; | ||
| - | if ( data.content[row][item].link != "" | ||
| - | var container = $('< | ||
| - | var link = $('< | ||
| - | var img = data.content[row][item].img != "" | ||
| - | var text = data.content[row][item].text != "" | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | } | ||
| - | | ||
| - | } | ||
| - | if ( data.footer ){ | ||
| - | var footer = $('< | ||
| - | | ||
| - | } | ||
| - | $('# | ||
| - | ' | ||
| - | ' | ||
| - | function() { | ||
| - | | ||
| - | } | ||
| - | }); | ||
| - | }, ' | ||
| - | }); | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | <file css index.css> | ||
| - | body { | ||
| - | padding: 0px; | ||
| - | margin: 0px; | ||
| - | width: 100%; | ||
| - | height: 100%; | ||
| - | text-align: center; | ||
| - | background: black; | ||
| - | } | ||
| - | |||
| - | a { | ||
| - | text-decoration: | ||
| - | color: darkred; | ||
| - | } | ||
| - | |||
| - | div#content { | ||
| - | display: none; | ||
| - | } | ||
| - | |||
| - | div#content > div.header { | ||
| - | margin-top: 1em; | ||
| - | } | ||
| - | |||
| - | div#content > div.header > span { | ||
| - | font-size: 200%; | ||
| - | } | ||
| - | |||
| - | div.container { | ||
| - | margin: 0 auto; | ||
| - | } | ||
| - | |||
| - | div.contained { | ||
| - | display: inline-block; | ||
| - | } | ||
| - | |||
| - | div.header > span { | ||
| - | color: white; | ||
| - | } | ||
| - | |||
| - | .box { | ||
| - | width: 20em; | ||
| - | height: 21em; | ||
| - | background: orange; | ||
| - | margin: 1em; | ||
| - | padding: 0.5em; | ||
| - | text-align: center; | ||
| - | } | ||
| - | |||
| - | .box > a > p { | ||
| - | height: 2em; | ||
| - | margin: 0px; | ||
| - | font-size: 150%; | ||
| - | } | ||
| - | |||
| - | .box > a > img { | ||
| - | height: 19em; | ||
| - | width: 19em; | ||
| - | } | ||
| - | |||
| - | .small { | ||
| - | width: 6em; | ||
| - | height: 7em; | ||
| - | background: orange; | ||
| - | margin: 1em; | ||
| - | text-align: center; | ||
| - | } | ||
| - | |||
| - | .small > a > p { | ||
| - | height: 1em; | ||
| - | margin: 0px; | ||
| - | } | ||
| - | |||
| - | .small > a > img { | ||
| - | height: 5em; | ||
| - | width: 5em; | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | And the // | ||
| - | <file json site.json> | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | }, | ||
| - | " | ||
| - | [ [ { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | },{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | }], | ||
| - | [{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | },{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | },{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | },{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | },{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | }], | ||
| - | |||
| - | [{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | },{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | },{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | },{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | },{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | },{ | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } ] ] | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | This dashboard you can easily configure by modifying the CSS. | ||
| - | |||
| - | ---- | ||
| - | Prev to: [[sailing: | ||