-
- try:
- if trigger.idx == "tput":
- idx = 0
- elif trigger.idx == "bandwidth":
- idx = 1
- elif trigger.idx == "lat":
- idx = 2
- else:
- raise PreventUpdate
- graph_data = graph_data[idx]["points"][0]
- except (IndexError, KeyError, ValueError, TypeError):
- raise PreventUpdate
-
- metadata = no_update
- graph = list()
-
- list_group_items = list()
- for itm in graph_data.get("text", None).split("<br>"):
- if not itm:
- continue
- lst_itm = itm.split(": ")
- if lst_itm[0] == "csit-ref":
- list_group_item = dbc.ListGroupItem([
- dbc.Badge(lst_itm[0]),
- html.A(
- lst_itm[1],
- href=f"{C.URL_JENKINS}{lst_itm[1]}",
- target="_blank"
- )
- ])
- else:
- list_group_item = dbc.ListGroupItem([
- dbc.Badge(lst_itm[0]),
- lst_itm[1]
- ])
- list_group_items.append(list_group_item)
-
- if trigger.idx == "tput":
- title = "Throughput"
- elif trigger.idx == "bandwidth":
- title = "Bandwidth"
- elif trigger.idx == "lat":
- title = "Latency"
- hdrh_data = graph_data.get("customdata", None)
- if hdrh_data:
- graph = [dbc.Card(
- class_name="gy-2 p-0",
- children=[
- dbc.CardHeader(hdrh_data.pop("name")),
- dbc.CardBody(
- dcc.Graph(
- id="hdrh-latency-graph",
- figure=graph_hdrh_latency(
- hdrh_data, self._graph_layout
- )
- )
- )
- ])
- ]
- else: