aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2022-08-18 14:37:03 +0200
committerTibor Frank <tifrank@cisco.com>2022-08-19 05:51:49 +0000
commitd2ddfd1ead021f1dd520271d763e1789954e32d9 (patch)
treee91daf9237e0405ce2617469b2974b5f9f6f6ff4 /resources
parent0b947247146f27936e986c262fc9f1d641b5ac4f (diff)
UTI: Set date picker by info from url
- Performance trending - Statistics Change-Id: I06077f233e07ee814b44bc6891519dc19c49b57d Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources')
-rw-r--r--resources/tools/dash/app/pal/stats/layout.py14
-rw-r--r--resources/tools/dash/app/pal/trending/layout.py9
2 files changed, 19 insertions, 4 deletions
diff --git a/resources/tools/dash/app/pal/stats/layout.py b/resources/tools/dash/app/pal/stats/layout.py
index 1d271cb265..273ee23362 100644
--- a/resources/tools/dash/app/pal/stats/layout.py
+++ b/resources/tools/dash/app/pal/stats/layout.py
@@ -552,7 +552,10 @@ class Layout:
"ri-ttypes-value": default["ttype"],
"ri-cadences-value": default["cadence"],
"dd-tbeds-value": default["tbed"],
- "al-job-children": default["job"]
+ "al-job-children": default["job"],
+ "dpr-start-date": datetime.utcnow() - \
+ timedelta(days=C.TIME_PERIOD),
+ "dpr-end-date": datetime.utcnow()
}
self._panel = deepcopy(self._defaults)
if panel:
@@ -622,6 +625,8 @@ class Layout:
Output("ri-cadences", "value"),
Output("dd-tbeds", "value"),
Output("al-job", "children"),
+ Output("dpr-period", "start_date"),
+ Output("dpr-period", "end_date"),
State("control-panel", "data"), # Store
Input("ri-duts", "value"),
Input("ri-ttypes", "value"),
@@ -719,7 +724,6 @@ class Layout:
elif trigger_id == "dpr-period":
pass
elif trigger_id == "url":
- # TODO: Add verification
if url_params:
new_job = url_params.get("job", list())[0]
new_start = url_params.get("start", list())[0]
@@ -740,7 +744,11 @@ class Layout:
ctrl_panel.get("dd-tbeds-value")
)
- ctrl_panel.set({"al-job-children": job})
+ ctrl_panel.set({
+ "al-job-children": job,
+ "dpr-start-date": start,
+ "dpr-end-date": end
+ })
fig_passed, fig_duration = graph_statistics(self.data, job,
self.layout, start, end)
diff --git a/resources/tools/dash/app/pal/trending/layout.py b/resources/tools/dash/app/pal/trending/layout.py
index 187860dffb..9e78b7c15e 100644
--- a/resources/tools/dash/app/pal/trending/layout.py
+++ b/resources/tools/dash/app/pal/trending/layout.py
@@ -712,6 +712,9 @@ class Layout:
"btn-ctrl-add-disabled": True,
"cl-normalize-value": list(),
"cl-selected-options": list(),
+ "dpr-start-date": datetime.utcnow() - \
+ timedelta(days=C.TIME_PERIOD),
+ "dpr-end-date": datetime.utcnow()
}
self._panel = deepcopy(self._defaults)
@@ -875,6 +878,8 @@ class Layout:
Output("btn-ctrl-add", "disabled"),
Output("cl-ctrl-normalize", "value"),
Output("cl-selected", "options"), # User selection
+ Output("dpr-period", "start_date"),
+ Output("dpr-period", "end_date"),
State("control-panel", "data"), # Store
State("selected-tests", "data"), # Store
State("cl-selected", "value"), # User selection
@@ -1282,7 +1287,9 @@ class Layout:
)
)
ctrl_panel.set({
- "cl-selected-options": list_tests(store_sel)
+ "cl-selected-options": list_tests(store_sel),
+ "dpr-start-date": d_start,
+ "dpr-end-date": d_end
})
else:
row_fig_tput = C.PLACEHOLDER