|
import streamlit as st |
|
|
|
|
|
|
|
def check_password(): |
|
"""Returns `True` if the user had the correct password.""" |
|
|
|
|
|
def password_entered(): |
|
"""Checks whether a password entered by the user is correct.""" |
|
if ( |
|
str(st.session_state.get("username", "")).strip() |
|
== str(st.secrets.get("username", "")).strip() |
|
and str(st.session_state.get("password", "")).strip() |
|
== str(st.secrets.get("password", "")).strip() |
|
): |
|
st.session_state["password_correct"] = True |
|
del st.session_state["password"] |
|
del st.session_state["username"] |
|
else: |
|
st.session_state["password_correct"] = False |
|
|
|
|
|
if ( |
|
"password_correct" not in st.session_state |
|
or not st.session_state["password_correct"] |
|
): |
|
|
|
st.markdown( |
|
""" |
|
<style> |
|
.login-container { |
|
background-color: #f0f2f6; |
|
padding: 30px; |
|
border-radius: 10px; |
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); |
|
margin-bottom: 20px; |
|
text-align: center; |
|
} |
|
.login-title { |
|
font-size: 24px; |
|
font-weight: bold; |
|
margin-bottom: 20px; |
|
color: #0f52ba; |
|
} |
|
.login-subtitle { |
|
font-size: 16px; |
|
margin-bottom: 30px; |
|
color: #555; |
|
} |
|
.stButton button { |
|
background-color: #0f52ba; |
|
color: white; |
|
font-weight: bold; |
|
border-radius: 5px; |
|
padding: 10px 20px; |
|
} |
|
</style> |
|
""", |
|
unsafe_allow_html=True, |
|
) |
|
|
|
|
|
col1, col2, col3 = st.columns([1, 2, 1]) |
|
|
|
with col2: |
|
|
|
st.markdown( |
|
""" |
|
<div class="login-container"> |
|
<div class="login-title">NPO DB Query</div> |
|
<div class="login-subtitle">Please log in to continue</div> |
|
</div> |
|
""", |
|
unsafe_allow_html=True, |
|
) |
|
|
|
|
|
if ( |
|
"password_correct" in st.session_state |
|
and not st.session_state["password_correct"] |
|
): |
|
st.error("😕 User not known or password incorrect") |
|
|
|
|
|
st.text_input("Username", key="username", placeholder="Enter your username") |
|
st.text_input( |
|
"Password", |
|
type="password", |
|
key="password", |
|
placeholder="Enter your password", |
|
) |
|
|
|
|
|
st.button("Login", on_click=password_entered, use_container_width=True) |
|
|
|
return False |
|
else: |
|
|
|
return True |
|
|
|
|
|
|
|
if check_password(): |
|
st.set_page_config( |
|
page_title="NPO DB Query", |
|
page_icon="💻", |
|
layout="wide", |
|
initial_sidebar_state="expanded", |
|
menu_items={ |
|
"About": "**📡 NPO DB Query v0.2.12**", |
|
}, |
|
) |
|
|
|
pages = { |
|
"Apps": [ |
|
st.Page("apps/database_page.py", title="🏡Generate Databases"), |
|
st.Page( |
|
"apps/parameters_distribution.py", title="📊Parameters distribution" |
|
), |
|
st.Page("apps/core_dump_page.py", title="📠Parse dump core"), |
|
st.Page("apps/gps_converter.py", title="🧭GPS Converter"), |
|
st.Page("apps/distance.py", title="🛰Distance Calculator"), |
|
st.Page( |
|
"apps/multi_points_distance_calculator.py", |
|
title=" 🗺 Multi Points Distance Calculator", |
|
), |
|
st.Page( |
|
"apps/sector_kml_generator.py", |
|
title="📡 Sector KML Generator", |
|
), |
|
st.Page( |
|
"apps/clustering.py", |
|
title="📡 Automatic Site Clustering", |
|
), |
|
st.Page("apps/fnb_parser.py", title="📄 F4NB Extractor"), |
|
st.Page("apps/dump_compare.py", title="📊 Dump Compare"), |
|
st.Page( |
|
"apps/import_physical_db.py", title="🌏Physical Database Verification" |
|
), |
|
], |
|
"Capacity Analysis": [ |
|
st.Page( |
|
"apps/kpi_analysis/gsm_capacity.py", |
|
title=" 📊 GSM Capacity Analysis", |
|
), |
|
st.Page( |
|
"apps/kpi_analysis/wbts_capacty.py", |
|
title=" 📊 WBTS Capacity BB and CE Analysis", |
|
), |
|
st.Page( |
|
"apps/kpi_analysis/wcel_capacity.py", |
|
title=" 📊 WCEL Capacity Analysis", |
|
), |
|
st.Page( |
|
"apps/kpi_analysis/lcg_analysis.py", |
|
title=" 📊 LCG Capacity Analysis", |
|
), |
|
st.Page( |
|
"apps/kpi_analysis/lte_capacity.py", |
|
title=" 📊 LTE Capacity Analysis", |
|
), |
|
], |
|
"Paging Analysis": [ |
|
st.Page( |
|
"apps/kpi_analysis/gsm_lac_load.py", |
|
title=" 📊 GSM LAC Load Analysis", |
|
), |
|
], |
|
"KPI Analysis": [ |
|
st.Page( |
|
"apps/kpi_analysis/lte_drop_trafic.py", |
|
title=" 📊 LTE Drop Traffic Analysis", |
|
), |
|
st.Page( |
|
"apps/kpi_analysis/anomalie.py", |
|
title=" 📊 KPIs Anomaly Detection", |
|
), |
|
st.Page( |
|
"apps/kpi_analysis/trafic_analysis.py", |
|
title=" 📊 Trafic Analysis", |
|
), |
|
], |
|
"Documentations": [ |
|
st.Page( |
|
"documentations/database_doc.py", title="📚Databases Documentation" |
|
), |
|
st.Page( |
|
"documentations/core_dump_doc.py", title="📗Dump core Documentation" |
|
), |
|
st.Page( |
|
"documentations/gsm_capacity_docs.py", |
|
title="📘GSM Capacity Documentation", |
|
), |
|
st.Page( |
|
"documentations/lte_capacity_docs.py", |
|
title="📘LTE Capacity Documentation", |
|
), |
|
], |
|
} |
|
|
|
pg = st.navigation(pages, position="top") |
|
pg.run() |
|
|