Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
feat(uti): Form layout
[csit.git]
/
resources
/
tools
/
dash
/
app
/
pal
/
trending
/
layout.py
diff --git
a/resources/tools/dash/app/pal/trending/layout.py
b/resources/tools/dash/app/pal/trending/layout.py
index
11900c6
..
690a9b7
100644
(file)
--- a/
resources/tools/dash/app/pal/trending/layout.py
+++ b/
resources/tools/dash/app/pal/trending/layout.py
@@
-35,14
+35,14
@@
class Layout:
"""
"""
"""
"""
- NO_GRAPH = {"data": [], "layout": {}, "frames": []}
+ STYLE_DISABLED = {"display": "none"}
+ STYLE_ENABLED = {"display": "inherit"}
CL_ALL_DISABLED = [{
"label": "All",
"value": "all",
"disabled": True
}]
CL_ALL_DISABLED = [{
"label": "All",
"value": "all",
"disabled": True
}]
-
CL_ALL_ENABLED = [{
"label": "All",
"value": "all",
CL_ALL_ENABLED = [{
"label": "All",
"value": "all",
@@
-154,6
+154,7
@@
class Layout:
),
dcc.Loading(
dbc.Offcanvas(
),
dcc.Loading(
dbc.Offcanvas(
+ class_name="w-50",
id="offcanvas-metadata",
title="Throughput And Latency",
placement="end",
id="offcanvas-metadata",
title="Throughput And Latency",
placement="end",
@@
-420,6
+421,7
@@
class Layout:
children=[
dcc.DatePickerRange(
id="dpr-period",
children=[
dcc.DatePickerRange(
id="dpr-period",
+ className="d-flex justify-content-center",
min_date_allowed=\
datetime.utcnow()-timedelta(days=180),
max_date_allowed=datetime.utcnow(),
min_date_allowed=\
datetime.utcnow()-timedelta(days=180),
max_date_allowed=datetime.utcnow(),
@@
-431,30
+433,29
@@
class Layout:
]
),
dbc.Row(
]
),
dbc.Row(
+ id="row-card-sel-tests",
class_name="gy-1",
class_name="gy-1",
+ style=self.STYLE_DISABLED,
children=[
children=[
- dbc.Card(
- class_name="p-0",
- children=[
- dbc.Label(
- "Selected tests",
- class_name="p-0"
- ),
- dbc.Checklist(
- id="cl-selected",
- options=[],
- inline=False
- )
- ],
- color="light",
- outline=True
+ dbc.Label(
+ "Selected tests",
+ class_name="p-0"
+ ),
+ dbc.Checklist(
+ class_name="overflow-auto",
+ id="cl-selected",
+ options=[],
+ inline=False,
+ style={"max-height": "12em"},
)
)
- ]
+ ]
,
),
dbc.Row(
),
dbc.Row(
+ id="row-btns-sel-tests",
+ style=self.STYLE_DISABLED,
children=[
dbc.ButtonGroup(
children=[
dbc.ButtonGroup(
- [
+
children=
[
dbc.Button(
id="btn-sel-remove-all",
children="Remove All",
dbc.Button(
id="btn-sel-remove-all",
children="Remove All",
@@
-478,7
+479,7
@@
class Layout:
)
],
size="md",
)
],
size="md",
- )
,
+ )
]
),
]
]
),
]
@@
-614,6
+615,8
@@
class Layout:
Output("row-graph-tput", "children"),
Output("row-graph-lat", "children"),
Output("row-btn-download", "children"),
Output("row-graph-tput", "children"),
Output("row-graph-lat", "children"),
Output("row-btn-download", "children"),
+ Output("row-card-sel-tests", "style"),
+ Output("row-btns-sel-tests", "style"),
Output("dd-ctrl-phy", "value"),
Output("dd-ctrl-area", "options"),
Output("dd-ctrl-area", "disabled"),
Output("dd-ctrl-phy", "value"),
Output("dd-ctrl-area", "options"),
Output("dd-ctrl-area", "disabled"),
@@
-670,6
+673,8
@@
class Layout:
row_fig_tput = no_update
row_fig_lat = no_update
row_btn_dwnld = no_update
row_fig_tput = no_update
row_fig_lat = no_update
row_btn_dwnld = no_update
+ row_card_sel_tests = no_update
+ row_btns_sel_tests = no_update
ctrl_panel = self.ControlPanel(cp_data)
ctrl_panel = self.ControlPanel(cp_data)
@@
-870,6
+875,8
@@
class Layout:
"core": core.lower(),
"testtype": ttype.lower()
})
"core": core.lower(),
"testtype": ttype.lower()
})
+ row_card_sel_tests = self.STYLE_ENABLED
+ row_btns_sel_tests = self.STYLE_ENABLED
ctrl_panel.set(ctrl_panel.defaults)
ctrl_panel.set({
"cl-selected-options": self._list_tests(store_sel)
ctrl_panel.set(ctrl_panel.defaults)
ctrl_panel.set({
"cl-selected-options": self._list_tests(store_sel)
@@
-887,6
+894,8
@@
class Layout:
row_fig_tput = self.PLACEHOLDER
row_fig_lat = self.PLACEHOLDER
row_btn_dwnld = self.PLACEHOLDER
row_fig_tput = self.PLACEHOLDER
row_fig_lat = self.PLACEHOLDER
row_btn_dwnld = self.PLACEHOLDER
+ row_card_sel_tests = self.STYLE_DISABLED
+ row_btns_sel_tests = self.STYLE_DISABLED
store_sel = list()
ctrl_panel.set({
"cl-selected-options": list()
store_sel = list()
ctrl_panel.set({
"cl-selected-options": list()
@@
-913,6
+922,8
@@
class Layout:
row_fig_tput = self.PLACEHOLDER
row_fig_lat = self.PLACEHOLDER
row_btn_dwnld = self.PLACEHOLDER
row_fig_tput = self.PLACEHOLDER
row_fig_lat = self.PLACEHOLDER
row_btn_dwnld = self.PLACEHOLDER
+ row_card_sel_tests = self.STYLE_DISABLED
+ row_btns_sel_tests = self.STYLE_DISABLED
store_sel = list()
ctrl_panel.set({
"cl-selected-options": list()
store_sel = list()
ctrl_panel.set({
"cl-selected-options": list()
@@
-920,7
+931,8
@@
class Layout:
ret_val = [
ctrl_panel.panel, store_sel,
ret_val = [
ctrl_panel.panel, store_sel,
- row_fig_tput, row_fig_lat, row_btn_dwnld
+ row_fig_tput, row_fig_lat, row_btn_dwnld,
+ row_card_sel_tests, row_btns_sel_tests
]
ret_val.extend(ctrl_panel.values())
return ret_val
]
ret_val.extend(ctrl_panel.values())
return ret_val
@@
-945,14
+957,24
@@
class Layout:
trigger_id = callback_context.triggered[0]["prop_id"].split(".")[0]
if trigger_id == "graph-tput":
title = "Throughput"
trigger_id = callback_context.triggered[0]["prop_id"].split(".")[0]
if trigger_id == "graph-tput":
title = "Throughput"
- txt = tput_data["points"][0]["text"].replace("<br>", "\n")
+ array = tput_data["points"][0]["text"].split("<br>")
+ children = [
+ dbc.ListGroupItem(
+ [dbc.Badge(x.split(":")[0]), x.split(": ")[1]]
+ ) for x in array
+ ]
elif trigger_id == "graph-latency":
title = "Latency"
elif trigger_id == "graph-latency":
title = "Latency"
- txt = lat_data["points"][0]["text"].replace("<br>", "\n")
+ array = lat_data["points"][0]["text"].split("<br>")
+ children = [
+ dbc.ListGroupItem(
+ [dbc.Badge(x.split(":")[0]), x.split(": ")[1]]
+ ) for x in array
+ ]
hdrh_data = lat_data["points"][0].get("customdata", None)
if hdrh_data:
graph = [dbc.Card(
hdrh_data = lat_data["points"][0].get("customdata", None)
if hdrh_data:
graph = [dbc.Card(
- class_name="g-0",
+ class_name="g
y-2 p
-0",
children=[
dbc.CardHeader(hdrh_data.pop("name")),
dbc.CardBody(children=[
children=[
dbc.CardHeader(hdrh_data.pop("name")),
dbc.CardBody(children=[
@@
-967,7
+989,7
@@
class Layout:
]
metadata = [
dbc.Card(
]
metadata = [
dbc.Card(
- class_name="g-0",
+ class_name="g
y-2 p
-0",
children=[
dbc.CardHeader(children=[
dcc.Clipboard(
children=[
dbc.CardHeader(children=[
dcc.Clipboard(
@@
-979,7
+1001,10
@@
class Layout:
]),
dbc.CardBody(
id="tput-lat-metadata",
]),
dbc.CardBody(
id="tput-lat-metadata",
- children=[txt]
+ class_name="p-0",
+ children=[
+ dbc.ListGroup(children, flush=True)
+ ]
)
]
)
)
]
)