C-Dash: Add telemetry panel
[csit.git] / csit.infra.dash / app / cdash / stats / layout.py
index 8a206f1..116185d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2022 Cisco and/or its affiliates.
+# Copyright (c) 2023 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -83,7 +83,11 @@ class Layout:
             debug=True
         ).read_stats(days=self._time_period)
 
-        df_tst_info = pd.concat([data_mrr, data_ndrpdr], ignore_index=True)
+        df_tst_info = pd.concat(
+            [data_mrr, data_ndrpdr],
+            ignore_index=True,
+            copy=False
+        )
 
         # Pre-process the data:
         data_stats = data_stats[~data_stats.job.str.contains("-verify-")]
@@ -246,7 +250,7 @@ class Layout:
                             self._add_navbar()
                         ]
                     ),
-                    dcc.Loading(
+                    dbc.Spinner(
                         dbc.Offcanvas(
                             class_name="w-50",
                             id="offcanvas-metadata",
@@ -328,7 +332,7 @@ class Layout:
         return dbc.Col(
             id="col-plotting-area",
             children=[
-                dcc.Loading(
+                dbc.Spinner(
                     children=[
                         dbc.Row(
                             id="plotting-area",
@@ -353,75 +357,95 @@ class Layout:
             dbc.Row(
                 class_name="g-0 p-1",
                 children=[
-                    dbc.Label(
-                        children=show_tooltip(
-                            self._tooltips,
-                            "help-dut",
-                            "Device under Test"
-                        )
-                    ),
-                    dbc.RadioItems(
-                        id="ri-duts",
-                        inline=True,
-                        value=self._default["dut"],
-                        options=self._default["duts"],
-                        input_class_name="border-info bg-info"
+                    dbc.InputGroup(
+                        [
+                            dbc.InputGroupText(
+                                children=show_tooltip(
+                                    self._tooltips,
+                                    "help-dut",
+                                    "DUT"
+                                )
+                            ),
+                            dbc.RadioItems(
+                                id="ri-duts",
+                                inline=True,
+                                value=self._default["dut"],
+                                options=self._default["duts"],
+                                class_name="form-control"
+                            )
+                        ],
+                        size="sm"
                     )
                 ]
             ),
             dbc.Row(
                 class_name="g-0 p-1",
                 children=[
-                    dbc.Label(
-                        children=show_tooltip(
-                            self._tooltips,
-                            "help-ttype",
-                            "Test Type"
-                        )
-                    ),
-                    dbc.RadioItems(
-                        id="ri-ttypes",
-                        inline=True,
-                        value=self._default["ttype"],
-                        options=self._default["ttypes"],
-                        input_class_name="border-info bg-info"
+                    dbc.InputGroup(
+                        [
+                            dbc.InputGroupText(
+                                children=show_tooltip(
+                                    self._tooltips,
+                                    "help-ttype",
+                                    "Test Type"
+                                )
+                            ),
+                            dbc.RadioItems(
+                                id="ri-ttypes",
+                                inline=True,
+                                value=self._default["ttype"],
+                                options=self._default["ttypes"],
+                                class_name="form-control"
+                            )
+                        ],
+                        size="sm"
                     )
                 ]
             ),
             dbc.Row(
                 class_name="g-0 p-1",
                 children=[
-                    dbc.Label(
-                        children=show_tooltip(
-                            self._tooltips,
-                            "help-cadence",
-                            "Cadence"
-                        )
-                    ),
-                    dbc.RadioItems(
-                        id="ri-cadences",
-                        inline=True,
-                        value=self._default["cadence"],
-                        options=self._default["cadences"],
-                        input_class_name="border-info bg-info"
+                    dbc.InputGroup(
+                        [
+                            dbc.InputGroupText(
+                                children=show_tooltip(
+                                    self._tooltips,
+                                    "help-cadence",
+                                    "Cadence"
+                                )
+                            ),
+                            dbc.RadioItems(
+                                id="ri-cadences",
+                                inline=True,
+                                value=self._default["cadence"],
+                                options=self._default["cadences"],
+                                class_name="form-control"
+                            )
+                        ],
+                        size="sm"
                     )
                 ]
             ),
             dbc.Row(
                 class_name="g-0 p-1",
                 children=[
-                    dbc.Label(
-                        children=show_tooltip(
-                            self._tooltips,
-                            "help-tbed",
-                            "Test Bed"
-                        )
-                    ),
-                    dbc.Select(
-                        id="dd-tbeds",
-                        placeholder="Select a test bed...",
-                        value=self._default["tbed"],
-                        options=self._default["tbeds"]
+                    dbc.InputGroup(
+                        [
+                            dbc.InputGroupText(
+                                children=show_tooltip(
+                                    self._tooltips,
+                                    "help-tbed",
+                                    "Test Bed"
+                                )
+                            ),
+                            dbc.Select(
+                                id="dd-tbeds",
+                                placeholder="Select a test bed...",
+                                value=self._default["tbed"],
+                                options=self._default["tbeds"]
+                            )
+                        ],
+                        size="sm"
                     )
                 ]
             ),
@@ -485,7 +509,7 @@ class Layout:
                         [
                             dbc.Button(
                                 id="plot-btn-url",
-                                children="URL",
+                                children="Show URL",
                                 class_name="me-1",
                                 color="info",
                                 style={