Skip to content

Commit

Permalink
Removed the personal devices table from the ping tab
Browse files Browse the repository at this point in the history
  • Loading branch information
eolus87 committed Apr 17, 2024
1 parent 8ebd58a commit 43d524b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
26 changes: 1 addition & 25 deletions layout/ping_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
# Standard libraries
import os
# Third party libraries
from dash import dcc, html, dash_table
from dash import dcc, html
import dash_daq as daq
import pandas as pd
# Custom libraries
from utilities.utilities import load_yaml

Expand All @@ -16,9 +15,6 @@
update_interval_ms = 2050
update_interval_ms_slow = 5*60*1000

# Initialization
init_table = pd.DataFrame(columns=["Device", "Mean", "Std", "Available"])

# Objects
device_ping_distribution = html.Div(className="row", children=[
html.Div(className="six columns", children=[
Expand Down Expand Up @@ -58,24 +54,6 @@
),
dcc.Graph(id='infrastructure_graph')])

personal_devices_table = html.Div([
html.H2(children="Personal devices [ms]",
style={'textAlign': 'center',
'color': '#FFFFFF'}
),
html.Div(
dash_table.DataTable(
data=init_table.to_dict('records'),
columns=[{"name": i, "id": i} for i in init_table.columns],
style_cell={'textAlign': 'center',
'backgroundColor': '#111111',
'color': 'white',
'font_size': '20px'},
style_header={'border': '1px solid black',
'font_size': '30px'},
style_as_list_view=True,
id='personal_devices_table'))])

# Tab definition and layout
ping_tab = dcc.Tab(label='Ping',
style=styles["tab_style"],
Expand All @@ -97,6 +75,4 @@
device_ping_distribution,
# Title and Graph
infrastructure_figure,
# Title and Table
personal_devices_table,
])
13 changes: 0 additions & 13 deletions main_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,6 @@ def stream_fig_network(value):
return fig


@app.callback(
Output(component_id='personal_devices_table', component_property='data'),
Input(component_id='interval_refresh_ping', component_property="n_intervals")
)
def stream_table(value):
dict_of_dfs = ping_data_extractor.retrieve_type_data(
[PingDeviceType.PERSONAL_DEVICE],
configuration["hours_for_tables"])
table = calculate_stats(dict_of_dfs)

return table.to_dict('records')


@app.callback(
Output(component_id='power_graph', component_property='figure'),
Input(component_id='interval_refresh_power', component_property="n_intervals")
Expand Down

0 comments on commit 43d524b

Please sign in to comment.