diff options
author | Lukas Metzger | 2020-06-25 14:50:54 +0200 |
---|---|---|
committer | Lukas Metzger | 2020-06-25 14:50:54 +0200 |
commit | 0a576b57b06ad8a3df683ae9ef05cc5fa60ee5d8 (patch) | |
tree | 6c96be18c6761609edb124d002556dc65d7ef009 /dash | |
parent | Fix errors in sum calculation (diff) | |
download | bwlp-statistics-0a576b57b06ad8a3df683ae9ef05cc5fa60ee5d8.tar.gz bwlp-statistics-0a576b57b06ad8a3df683ae9ef05cc5fa60ee5d8.tar.xz bwlp-statistics-0a576b57b06ad8a3df683ae9ef05cc5fa60ee5d8.zip |
Fixes for machines
Diffstat (limited to 'dash')
-rw-r--r-- | dash/pages/machines.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/dash/pages/machines.py b/dash/pages/machines.py index b82df43..b6cb6f8 100644 --- a/dash/pages/machines.py +++ b/dash/pages/machines.py @@ -55,6 +55,9 @@ def layout(): dbc.Row([dbc.Col([ dcc.Loading(dcc.Graph(id='machines-graph-location')) ])]), + dbc.Row([dbc.Col([ + dcc.Loading(html.Pre(id='machines-sum-location')) + ])]), dbc.Row([ dbc.Col(width=12, md=6, xl=4, children=[ dcc.Loading(dcc.Graph(id='machines-graph-ram')) @@ -65,7 +68,7 @@ def layout(): dbc.Col(width=12, md=6, xl=4, children=[ dcc.Loading(dcc.Graph(id='machines-graph-kvmstate')) ]), - dbc.Col(width=12, xl=8, children=[ + dbc.Col(width=12, xl=7, children=[ dcc.Loading(dcc.Graph(id='machines-graph-systemmodel')), ]), dbc.Col(width=12, xl=4, id='machines-graph-systemmodel-locations-container', children=[ @@ -84,7 +87,7 @@ def layout(): ] )) ]), - dbc.Col(width=12, xl=8, children=[ + dbc.Col(width=12, xl=7, children=[ dcc.Loading(dcc.Graph(id='machines-graph-cpumodel')), ]), dbc.Col(width=12, xl=4, id='machines-graph-cpumodel-locations-container', children=[ @@ -106,7 +109,8 @@ def layout(): ]) ]) -@app.callback(Output('machines-graph-location', 'figure'), +@app.callback([Output('machines-graph-location', 'figure'), + Output('machines-sum-location', 'children')], [Input('machines-days', 'value'), Input('machines-date', 'date'), Input('machines-satellites', 'value')]) @@ -139,16 +143,20 @@ def make_graph_location(days, date, satellites): y=[item['count'] for item in data] )) figure.update_layout( - title_text = 'Locations' + title_text = 'Locations', + yaxis_title = 'Machines' ) - return figure + + totalStr = 'Total Locations: {}'.format(len(data)) + + return figure, totalStr @app.callback(Output('machines-graph-cpumodel', 'figure'), [Input('machines-days', 'value'), Input('machines-date', 'date'), Input('machines-satellites', 'value')]) def make_graph_cpumodel(days, date, satellites): - return make_graph(days, date, satellites, 'cpumodel', 'CPU', typ='bar') + return make_graph(days, date, satellites, 'cpumodel', 'CPU<br><sub>Click Bar to view Details</sub>', typ='bar') @app.callback(Output('machines-graph-realcores', 'figure'), [Input('machines-days', 'value'), @@ -169,7 +177,7 @@ def make_graph_ram(days, date, satellites): Input('machines-date', 'date'), Input('machines-satellites', 'value')]) def make_graph_systemmodel(days, date, satellites): - return make_graph(days, date, satellites, 'systemmodel', 'System Model', typ='bar') + return make_graph(days, date, satellites, 'systemmodel', 'System Model<br><sub>Click Bar to view Details</sub>', typ='bar') @app.callback(Output('machines-graph-kvmstate', 'figure'), [Input('machines-days', 'value'), |