From a5afbc5fed434681dded8d37079b4b9acace0f01 Mon Sep 17 00:00:00 2001 From: nicolas-f <1382241+nicolas-f@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:14:25 +0100 Subject: [PATCH] top menu --- .../docker/dashboard/app/static/status.css | 37 ++++++++++++++----- .../docker/dashboard/app/static/status.js | 21 +++++++++++ .../dashboard/app/templates/recordings.html | 19 ++++------ .../dashboard/app/templates/status.html | 12 ------ 4 files changed, 55 insertions(+), 34 deletions(-) diff --git a/services/ansible_openvpn/docker/dashboard/app/static/status.css b/services/ansible_openvpn/docker/dashboard/app/static/status.css index 4a76520..af18bcd 100644 --- a/services/ansible_openvpn/docker/dashboard/app/static/status.css +++ b/services/ansible_openvpn/docker/dashboard/app/static/status.css @@ -39,18 +39,35 @@ h1 { float: center; } -.navbar { - position: relative; - z-index: 100; /* Make sure the menu stays over the map */ - background-color: white; +.top_menu { + position: relative !important; + left: 0; + right: 0; + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; } -.navbar-brand { - min-height: 60px; - padding: 0 20px 5px; - font-size: 16px; +.ul_top_menu { + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; } -.navbar-nav > li { - margin-left: 1em; /* Adjust this value according to your preference */ +.li_top_menu { + float: left; +} + +.li_top_menu a { + display: block; + color: #555; + text-align: center; + padding: 16px; + text-decoration: none; +} + +.li_top_menu a:hover { + background-color: #eeeeee; } diff --git a/services/ansible_openvpn/docker/dashboard/app/static/status.js b/services/ansible_openvpn/docker/dashboard/app/static/status.js index 3ec10ab..087a31f 100644 --- a/services/ansible_openvpn/docker/dashboard/app/static/status.js +++ b/services/ansible_openvpn/docker/dashboard/app/static/status.js @@ -113,6 +113,27 @@ legend.onAdd = function (lmap) { legend.addTo(lmap); +var toplinkbar = L.control({position: 'topcenter'}); + + +toplinkbar.onAdd = function (lmap) { + var div = L.DomUtil.create('div', 'info'); + const links = [ + { text: "Map", url: "/", target : "_self"}, + { text: "Audio records", url: "/recordings", target : "_self" }, + { text: "Backup data", url: "https://nsraw.noise-planet.org" , target : "_blank"} + ]; + var divhtml = "
"; + div.innerHTML += divhtml; + + return div; +}; + +toplinkbar.addTo(lmap); var upTimeControl = L.control({position: 'bottomcenter', }); diff --git a/services/ansible_openvpn/docker/dashboard/app/templates/recordings.html b/services/ansible_openvpn/docker/dashboard/app/templates/recordings.html index 924c9f4..e2e3f6e 100644 --- a/services/ansible_openvpn/docker/dashboard/app/templates/recordings.html +++ b/services/ansible_openvpn/docker/dashboard/app/templates/recordings.html @@ -17,18 +17,13 @@ - +