aboutsummaryrefslogtreecommitdiffstats
path: root/csit.infra.dash/app/cdash/stats
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2023-06-21 14:03:36 +0000
committerTibor Frank <tifrank@cisco.com>2023-06-21 14:07:00 +0000
commit55f72749a29e303c3a1049349b82baf258079e29 (patch)
tree83ea1877a69aff50df629e9a1922d24a1688165a /csit.infra.dash/app/cdash/stats
parentb5027b7e2c9e3cd506502847c1dc169f4c8c853e (diff)
C-Dash: Add documentation and other items to the navbar
Change-Id: Ic6ec5e74d62ac115a30973cf8204fe6001ff7d33 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'csit.infra.dash/app/cdash/stats')
-rw-r--r--csit.infra.dash/app/cdash/stats/layout.py50
1 files changed, 42 insertions, 8 deletions
diff --git a/csit.infra.dash/app/cdash/stats/layout.py b/csit.infra.dash/app/cdash/stats/layout.py
index ecd81bacbe..574479e123 100644
--- a/csit.infra.dash/app/cdash/stats/layout.py
+++ b/csit.infra.dash/app/cdash/stats/layout.py
@@ -252,6 +252,18 @@ class Layout:
self._add_ctrl_col(),
self._add_plotting_col()
]
+ ),
+ dbc.Offcanvas(
+ class_name="w-75",
+ id="offcanvas-documentation",
+ title="Documentation",
+ placement="end",
+ is_open=False,
+ children=html.Iframe(
+ src=C.URL_DOC_TRENDING,
+ width="100%",
+ height="100%"
+ )
)
]
)
@@ -277,14 +289,26 @@ class Layout:
return dbc.NavbarSimple(
id="navbarsimple-main",
children=[
- dbc.NavItem(
- dbc.NavLink(
- C.STATS_TITLE,
- disabled=True,
- external_link=True,
- href="#"
- )
- )
+ dbc.NavItem(dbc.NavLink(
+ C.TREND_TITLE,
+ external_link=True,
+ href="/trending"
+ )),
+ dbc.NavItem(dbc.NavLink(
+ C.NEWS_TITLE,
+ external_link=True,
+ href="/news"
+ )),
+ dbc.NavItem(dbc.NavLink(
+ C.STATS_TITLE,
+ active=True,
+ external_link=True,
+ href="/stats"
+ )),
+ dbc.NavItem(dbc.NavLink(
+ "Documentation",
+ id="btn-documentation",
+ ))
],
brand=C.BRAND,
brand_href="/",
@@ -839,3 +863,13 @@ class Layout:
open_canvas = True
return metadata, open_canvas
+
+ @app.callback(
+ Output("offcanvas-documentation", "is_open"),
+ Input("btn-documentation", "n_clicks"),
+ State("offcanvas-documentation", "is_open")
+ )
+ def toggle_offcanvas_documentation(n_clicks, is_open):
+ if n_clicks:
+ return not is_open
+ return is_open