Skip to content

Commit

Permalink
Major redesign of the Home page.
Browse files Browse the repository at this point in the history
Added new alarm.
Fixed depricated functions
  • Loading branch information
petya-vasileva committed Jan 14, 2025
1 parent e1cae08 commit 1ab87ef
Show file tree
Hide file tree
Showing 6 changed files with 499 additions and 159 deletions.
4 changes: 3 additions & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
# cache the data in /parquet.
ParquetUpdater()

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css', dbc.themes.BOOTSTRAP, dbc.icons.BOOTSTRAP]
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css',
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css",
dbc.themes.BOOTSTRAP, dbc.icons.BOOTSTRAP]

app = Dash(__name__, external_stylesheets=external_stylesheets,
external_scripts=[
Expand Down
42 changes: 27 additions & 15 deletions src/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ body{
.table-container .cell-markdown>p {
display: flex;
height: 100%;
justify-content: center;
align-items: center;
text-align: center;
}


Expand Down Expand Up @@ -138,6 +137,11 @@ body{
--selected-background: rgb(227, 234, 244) !important;
}

.dash-spreadsheet-container.dash-spreadsheet.dash-empty-01.dash-fill-width {
border: none !important;
box-shadow: none !important;
}

.container {
margin-bottom: 20px;
max-width: 1550px !important;
Expand Down Expand Up @@ -168,24 +172,25 @@ body{
}

.cls-site-map {
height: 740px;
height: 640px;
/* padding: 20px;
border: 1px solid rgba(0, 0, 0, .125);
border-radius: 1rem */
}

.mapboxgl-ctrl-bottom-right {
display: none;
}

.table-container th {
border-left: 0px !important;
border-right: 0px !important;
border-top-color: white !important;
border-bottom-color: white !important;
background-color: #bac4d4 !important;
background-color: #f1f1f1 !important;
color: rgb(45, 44, 44);
}

.table-container {
border: 1px solid #dfdfdf;
}

.table-container .previous-next-container {
padding-top: 1% !important;
Expand All @@ -197,12 +202,6 @@ body{
border-color: #cbd4e7;
}

@media (max-width: 1580px) {
.sidebysite-cont {
width: 100% !important;
}
}

.card {
border-radius: 1rem;
}
Expand Down Expand Up @@ -568,12 +567,17 @@ body{
background-color: #ffffff;
}

count-box {
padding: 30px;
text-align: center;
}
/*
@media (max-width: 1500px) {
.column-margin {
margin-top: 10px;
padding: 0 20px;
}
}
} */

@media (max-width: 1340px) {
.status-box {
Expand Down Expand Up @@ -633,7 +637,6 @@ body{

.how-status-div {
padding: 0 20px;
margin-top: 10px;
}

.how-status-div button {
Expand All @@ -650,4 +653,13 @@ body{
.next-10-btn:disabled, .all-btn:disabled {
background-color: gray;
color: white;
}

.fa-search {
font-size: 1em;
color: white;
background-color: #7f7f7f;
padding: 10px;
margin-right: 10px;
border-radius: 5px;
}
9 changes: 7 additions & 2 deletions src/model/Alarms.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def unpackAlarms(self, alarmsData):

elif event in ['high packet loss',
'path changed',
'path changed v2',
'destination cannot be reached from any',
'source cannot reach any',
'bandwidth decreased',
Expand Down Expand Up @@ -374,11 +375,15 @@ def formatDfValues(self, df, event):
df.drop(columns=['avg_value'], inplace=True)

# TODO: create pages/visualizatios for the following events then remove the df.drop('alarm_link') below
if event not in ['unresolvable host', 'hosts not found']:
if event not in ['unresolvable host', 'hosts not found', 'path changed v2']:
df = self.createAlarmURL(df, event)
else:
df.drop('alarm_link', axis=1, inplace=True)
df['site'] = df['site'].fillna("Unknown site")
if 'asn_list' in df.columns:
df = self.replaceCol('asn_list', df, '\n')

if 'site' in df.columns:
df['site'] = df['site'].fillna("Unknown site")

# Reorder 'from' and 'to' columns to be the first two columns if they exist
df = self.reorder_columns(df, ['from', 'to'])
Expand Down
8 changes: 4 additions & 4 deletions src/model/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ def queryPathChanged(dateFrom, dateTo):
"must": [{
"range": {
"to_date": {
"from": dateFrom,
"to": dateTo,
"gte": dateFrom,
"lte": dateTo,
"format": "strict_date_optional_time"
}
}
Expand Down Expand Up @@ -413,8 +413,8 @@ def queryTraceChanges(dateFrom, dateTo, asn=None):
{
"range": {
"to_date": {
"from": dateFrom,
"to": dateTo,
"gte": dateFrom,
"lte": dateTo,
"format": "strict_date_optional_time"
}
}
Expand Down
Loading

0 comments on commit 1ab87ef

Please sign in to comment.