From 0c66443db89fec72c5fb2af0588a02695683613c Mon Sep 17 00:00:00 2001 From: Daniel GarcĂ­a Moreno Date: Wed, 14 Sep 2022 14:01:18 +0200 Subject: Add multiple servers to the dashboard view --- ogcp/og_server.py | 5 + ogcp/static/css/soleta.css | 8 +- ogcp/templates/base.html | 2 +- ogcp/templates/dashboard.html | 642 ++++++++++++++++++++++++------------------ ogcp/templates/macros.html | 4 +- ogcp/templates/servers.html | 2 +- ogcp/templates/users.html | 2 +- ogcp/views.py | 61 ++-- 8 files changed, 417 insertions(+), 309 deletions(-) diff --git a/ogcp/og_server.py b/ogcp/og_server.py index 0f542ff..38d9a01 100644 --- a/ogcp/og_server.py +++ b/ogcp/og_server.py @@ -37,6 +37,11 @@ class OGServer: json=payload) return r + @property + def id(self): + ip = self.ip.replace('.', '-') + return f'server_{ip}_{self.port}' + servers = [] if {'IP', 'PORT', 'API_TOKEN'} <= app.config.keys(): diff --git a/ogcp/static/css/soleta.css b/ogcp/static/css/soleta.css index beca3a9..5edf03f 100644 --- a/ogcp/static/css/soleta.css +++ b/ogcp/static/css/soleta.css @@ -11,19 +11,19 @@ html, body { margin: 10px; } -.nav { +.nav.ogcp-nav { position: relative; } -.nav-item { +.ogcp-nav .nav-item { padding-left: 20px; position: relative; } -.nav-link { +.ogcp-nav .nav-link { padding: 0; } -.active > .nav-link { +.ogcp-nav .active > .nav-link { font-weight: bold; background: slategrey; border-radius: 10rem; diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index da5f1db..9d53d5c 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -15,7 +15,7 @@
-