diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d474a57..0cb8ef0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: run: sed -i 's/host=db/host=127.0.0.1/' db.config.example - name: Run linters run: | - flake8 app.py controllers/ models/ view/ - mypy app.py controllers/ models/ view/ + flake8 app.py controllers/ models/ views/ + mypy app.py controllers/ models/ views/ - name: Run tests run: pytest --cov=controllers --cov=models diff --git a/app.py b/app.py index c090f95..cd80f3e 100644 --- a/app.py +++ b/app.py @@ -2,14 +2,6 @@ import streamlit as st -from views import ( - api_configurazione, - esecuzione_test, - gestione_domande, - gestione_set, - home, - visualizza_risultati, -) from views.session_state import initialize_session_state from views.style_utils import load_css from utils.startup_utils import setup_logging @@ -34,16 +26,16 @@ # Aggiungi CSS personalizzato e stili globali load_css() -PAGES = { - "Home": home.render, - "Configurazione API": api_configurazione.render, - "Gestione Domande": gestione_domande.render, - "Gestione Set di Domande": gestione_set.render, - "Esecuzione Test": esecuzione_test.render, - "Visualizzazione Risultati": visualizza_risultati.render, -} - -selected_page = st.sidebar.radio("Navigazione", list(PAGES.keys())) - -render_page = PAGES[selected_page] -render_page() +# --- Definizione pagine con il nuovo sistema --- +Home = st.Page("views/home.py", title="Home", icon=":material/home:", default=True) +Configurazione_API = st.Page("views/api_configurazione.py", title="Configurazione API", icon=":material/api:") +Gestione_domande = st.Page("views/gestione_domande.py", title="Gestione Domande", icon=":material/construction:") +Gestione_set = st.Page("views/gestione_set.py", title="Gestione Set di Domande", icon=":material/list:") +Esecuzione_test = st.Page("views/esecuzione_test.py", title="Esecuzione Test", icon=":material/rule_settings:") +Visualizza_risultati = st.Page("views/visualizza_risultati.py", + title="Visualizzazione Risultati", + icon=":material/bar_chart:") + +# --- Navigazione --- +pg = st.navigation([Home, Configurazione_API, Gestione_domande, Gestione_set, Esecuzione_test, Visualizza_risultati]) +pg.run() diff --git a/controllers/__init__.py b/controllers/__init__.py index 1bc3006..3d410d6 100644 --- a/controllers/__init__.py +++ b/controllers/__init__.py @@ -2,6 +2,7 @@ # Gestione dei preset API import logging +from .startup_controller import get_initial_state from .api_preset_controller import ( load_presets, @@ -65,7 +66,6 @@ calculate_statistics = TestResult.calculate_statistics # Funzioni di avvio -from .startup_controller import get_initial_state logger = logging.getLogger(__name__) diff --git a/controllers/__pycache__/__init__.cpython-311.pyc b/controllers/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..62c2571 Binary files /dev/null and b/controllers/__pycache__/__init__.cpython-311.pyc differ diff --git a/controllers/__pycache__/api_preset_controller.cpython-311.pyc b/controllers/__pycache__/api_preset_controller.cpython-311.pyc new file mode 100644 index 0000000..825200e Binary files /dev/null and b/controllers/__pycache__/api_preset_controller.cpython-311.pyc differ diff --git a/controllers/__pycache__/openai_client.cpython-311.pyc b/controllers/__pycache__/openai_client.cpython-311.pyc new file mode 100644 index 0000000..71c50f8 Binary files /dev/null and b/controllers/__pycache__/openai_client.cpython-311.pyc differ diff --git a/controllers/__pycache__/question_controller.cpython-311.pyc b/controllers/__pycache__/question_controller.cpython-311.pyc new file mode 100644 index 0000000..019cf3e Binary files /dev/null and b/controllers/__pycache__/question_controller.cpython-311.pyc differ diff --git a/controllers/__pycache__/question_set_controller.cpython-311.pyc b/controllers/__pycache__/question_set_controller.cpython-311.pyc new file mode 100644 index 0000000..16218a3 Binary files /dev/null and b/controllers/__pycache__/question_set_controller.cpython-311.pyc differ diff --git a/controllers/__pycache__/result_controller.cpython-311.pyc b/controllers/__pycache__/result_controller.cpython-311.pyc new file mode 100644 index 0000000..4ddd7e4 Binary files /dev/null and b/controllers/__pycache__/result_controller.cpython-311.pyc differ diff --git a/controllers/__pycache__/startup_controller.cpython-311.pyc b/controllers/__pycache__/startup_controller.cpython-311.pyc new file mode 100644 index 0000000..32d5779 Binary files /dev/null and b/controllers/__pycache__/startup_controller.cpython-311.pyc differ diff --git a/controllers/__pycache__/test_controller.cpython-311.pyc b/controllers/__pycache__/test_controller.cpython-311.pyc new file mode 100644 index 0000000..05c9ef1 Binary files /dev/null and b/controllers/__pycache__/test_controller.cpython-311.pyc differ diff --git a/controllers/question_set_controller.py b/controllers/question_set_controller.py index dd46d39..a89801c 100644 --- a/controllers/question_set_controller.py +++ b/controllers/question_set_controller.py @@ -3,7 +3,7 @@ import pandas as pd -from models.question_set import QuestionSet, PersistSetsResult, question_set_importer +from models.question_set import QuestionSet, question_set_importer # PersistSetsResult not used from utils.cache import ( get_questions as _get_questions, get_question_sets as _get_question_sets, @@ -15,6 +15,7 @@ ) logger = logging.getLogger(__name__) + def load_sets() -> pd.DataFrame: """Restituisce tutti i set di domande utilizzando la cache.""" return _get_question_sets() diff --git a/controllers/startup_controller.py b/controllers/startup_controller.py index 9908827..99e0389 100644 --- a/controllers/startup_controller.py +++ b/controllers/startup_controller.py @@ -5,7 +5,7 @@ DefaultConfig, initialize_database, load_default_config, - setup_logging, + # setup_logging, ) logger = logging.getLogger(__name__) diff --git a/db.config b/db.config new file mode 100644 index 0000000..f69b3f1 --- /dev/null +++ b/db.config @@ -0,0 +1,14 @@ +[mysql] +host=db +user=root +password= +database=llm_platform +port=3306 +ssl_ca= + +# Per l'ambiente Docker, utilizzare: +# host=db +# user=root +# password= +# database=llm_platform +# port=3306 diff --git a/models/__pycache__/__init__.cpython-311.pyc b/models/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..96cf87a Binary files /dev/null and b/models/__pycache__/__init__.cpython-311.pyc differ diff --git a/models/__pycache__/api_preset.cpython-311.pyc b/models/__pycache__/api_preset.cpython-311.pyc new file mode 100644 index 0000000..d0e4f39 Binary files /dev/null and b/models/__pycache__/api_preset.cpython-311.pyc differ diff --git a/models/__pycache__/database.cpython-311.pyc b/models/__pycache__/database.cpython-311.pyc new file mode 100644 index 0000000..eb5c296 Binary files /dev/null and b/models/__pycache__/database.cpython-311.pyc differ diff --git a/models/__pycache__/db_utils.cpython-311.pyc b/models/__pycache__/db_utils.cpython-311.pyc new file mode 100644 index 0000000..a11f286 Binary files /dev/null and b/models/__pycache__/db_utils.cpython-311.pyc differ diff --git a/models/__pycache__/orm_models.cpython-311.pyc b/models/__pycache__/orm_models.cpython-311.pyc new file mode 100644 index 0000000..a76012f Binary files /dev/null and b/models/__pycache__/orm_models.cpython-311.pyc differ diff --git a/models/__pycache__/question.cpython-311.pyc b/models/__pycache__/question.cpython-311.pyc new file mode 100644 index 0000000..c4fd0c8 Binary files /dev/null and b/models/__pycache__/question.cpython-311.pyc differ diff --git a/models/__pycache__/question_set.cpython-311.pyc b/models/__pycache__/question_set.cpython-311.pyc new file mode 100644 index 0000000..401aed2 Binary files /dev/null and b/models/__pycache__/question_set.cpython-311.pyc differ diff --git a/models/__pycache__/test_result.cpython-311.pyc b/models/__pycache__/test_result.cpython-311.pyc new file mode 100644 index 0000000..7e3ff1a Binary files /dev/null and b/models/__pycache__/test_result.cpython-311.pyc differ diff --git a/models/cached_data.py b/models/cached_data.py index 869a950..fd6235e 100644 --- a/models/cached_data.py +++ b/models/cached_data.py @@ -7,6 +7,7 @@ from models.test_result import TestResult logger = logging.getLogger(__name__) + def get_questions() -> List[Question]: return Question.load_all() diff --git a/models/database.py b/models/database.py index 6332a93..d3b9dad 100644 --- a/models/database.py +++ b/models/database.py @@ -124,4 +124,3 @@ def init_db(self) -> None: class Base(DeclarativeBase): """Base class per i modelli dichiarativi SQLAlchemy.""" pass - diff --git a/models/question_set.py b/models/question_set.py index c0e34b1..8cb06bf 100644 --- a/models/question_set.py +++ b/models/question_set.py @@ -292,4 +292,3 @@ def gather_data(self) -> List[Dict[str, Any]]: # type: ignore[override] question_set_importer = QuestionSetImporter() - diff --git a/models/test_result.py b/models/test_result.py index 307943b..0ed93c8 100644 --- a/models/test_result.py +++ b/models/test_result.py @@ -194,4 +194,3 @@ def gather_data(self) -> pd.DataFrame: # type: ignore[override] test_result_importer = TestResultImporter() - diff --git a/utils/__pycache__/__init__.cpython-311.pyc b/utils/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..2221480 Binary files /dev/null and b/utils/__pycache__/__init__.cpython-311.pyc differ diff --git a/utils/__pycache__/cache.cpython-311.pyc b/utils/__pycache__/cache.cpython-311.pyc new file mode 100644 index 0000000..63b5e07 Binary files /dev/null and b/utils/__pycache__/cache.cpython-311.pyc differ diff --git a/utils/__pycache__/data_format_utils.cpython-311.pyc b/utils/__pycache__/data_format_utils.cpython-311.pyc new file mode 100644 index 0000000..cb94050 Binary files /dev/null and b/utils/__pycache__/data_format_utils.cpython-311.pyc differ diff --git a/utils/__pycache__/export_template.cpython-311.pyc b/utils/__pycache__/export_template.cpython-311.pyc new file mode 100644 index 0000000..54d5056 Binary files /dev/null and b/utils/__pycache__/export_template.cpython-311.pyc differ diff --git a/utils/__pycache__/file_reader_utils.cpython-311.pyc b/utils/__pycache__/file_reader_utils.cpython-311.pyc new file mode 100644 index 0000000..5531ef7 Binary files /dev/null and b/utils/__pycache__/file_reader_utils.cpython-311.pyc differ diff --git a/utils/__pycache__/import_template.cpython-311.pyc b/utils/__pycache__/import_template.cpython-311.pyc new file mode 100644 index 0000000..9e4e1d5 Binary files /dev/null and b/utils/__pycache__/import_template.cpython-311.pyc differ diff --git a/utils/__pycache__/openai_client.cpython-311.pyc b/utils/__pycache__/openai_client.cpython-311.pyc new file mode 100644 index 0000000..a7d8270 Binary files /dev/null and b/utils/__pycache__/openai_client.cpython-311.pyc differ diff --git a/utils/__pycache__/startup_utils.cpython-311.pyc b/utils/__pycache__/startup_utils.cpython-311.pyc new file mode 100644 index 0000000..6d838a2 Binary files /dev/null and b/utils/__pycache__/startup_utils.cpython-311.pyc differ diff --git a/views/__pycache__/__init__.cpython-311.pyc b/views/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..0004b71 Binary files /dev/null and b/views/__pycache__/__init__.cpython-311.pyc differ diff --git a/views/__pycache__/api_configurazione.cpython-311.pyc b/views/__pycache__/api_configurazione.cpython-311.pyc new file mode 100644 index 0000000..6956b06 Binary files /dev/null and b/views/__pycache__/api_configurazione.cpython-311.pyc differ diff --git a/views/__pycache__/esecuzione_test.cpython-311.pyc b/views/__pycache__/esecuzione_test.cpython-311.pyc new file mode 100644 index 0000000..6b369f3 Binary files /dev/null and b/views/__pycache__/esecuzione_test.cpython-311.pyc differ diff --git a/views/__pycache__/gestione_domande.cpython-311.pyc b/views/__pycache__/gestione_domande.cpython-311.pyc new file mode 100644 index 0000000..276ba1d Binary files /dev/null and b/views/__pycache__/gestione_domande.cpython-311.pyc differ diff --git a/views/__pycache__/gestione_set.cpython-311.pyc b/views/__pycache__/gestione_set.cpython-311.pyc new file mode 100644 index 0000000..604e95d Binary files /dev/null and b/views/__pycache__/gestione_set.cpython-311.pyc differ diff --git a/views/__pycache__/home.cpython-311.pyc b/views/__pycache__/home.cpython-311.pyc new file mode 100644 index 0000000..09f1213 Binary files /dev/null and b/views/__pycache__/home.cpython-311.pyc differ diff --git a/views/__pycache__/session_state.cpython-311.pyc b/views/__pycache__/session_state.cpython-311.pyc new file mode 100644 index 0000000..9824153 Binary files /dev/null and b/views/__pycache__/session_state.cpython-311.pyc differ diff --git a/views/__pycache__/set_helpers.cpython-311.pyc b/views/__pycache__/set_helpers.cpython-311.pyc new file mode 100644 index 0000000..3a1780f Binary files /dev/null and b/views/__pycache__/set_helpers.cpython-311.pyc differ diff --git a/views/__pycache__/state_models.cpython-311.pyc b/views/__pycache__/state_models.cpython-311.pyc new file mode 100644 index 0000000..1cd9be5 Binary files /dev/null and b/views/__pycache__/state_models.cpython-311.pyc differ diff --git a/views/__pycache__/style_utils.cpython-311.pyc b/views/__pycache__/style_utils.cpython-311.pyc new file mode 100644 index 0000000..f44c198 Binary files /dev/null and b/views/__pycache__/style_utils.cpython-311.pyc differ diff --git a/views/__pycache__/visualizza_risultati.cpython-311.pyc b/views/__pycache__/visualizza_risultati.cpython-311.pyc new file mode 100644 index 0000000..a65a827 Binary files /dev/null and b/views/__pycache__/visualizza_risultati.cpython-311.pyc differ diff --git a/views/api_configurazione.py b/views/api_configurazione.py index 30cfe72..17c9012 100644 --- a/views/api_configurazione.py +++ b/views/api_configurazione.py @@ -1,7 +1,7 @@ import logging import streamlit as st -from views import register_page +# from views import register_page from views.style_utils import add_page_header, add_section_title from controllers import ( save_preset, @@ -116,7 +116,7 @@ def delete_preset_callback(preset_id): st.error(message) -@register_page("Configurazione API") +# @register_page("Configurazione API") def render(): add_page_header( "Gestione Preset API", @@ -283,3 +283,9 @@ def render(): if "preset_deleted_message" in st.session_state: st.success(st.session_state.preset_deleted_message) del st.session_state.preset_deleted_message + + +if __name__ == "__main__": + render() +else: + render() diff --git a/views/esecuzione_test.py b/views/esecuzione_test.py index 44b9130..628c1ad 100644 --- a/views/esecuzione_test.py +++ b/views/esecuzione_test.py @@ -3,7 +3,7 @@ import streamlit as st from controllers import run_test, load_sets, load_presets, get_preset_by_name -from views import register_page +# from views import register_page from views.style_utils import add_page_header, add_section_title logger = logging.getLogger(__name__) @@ -22,7 +22,7 @@ def run_llm_test_callback(): st.session_state.run_llm_test = True -@register_page("Esecuzione Test") +# @register_page("Esecuzione Test") def render(): # === Inizializzazione delle variabili di stato === if 'test_mode' not in st.session_state: @@ -165,3 +165,9 @@ def render(): st.write("**Risposta Generata:**", result['actual_answer']) st.write("**Punteggio:**", f"{result['evaluation']['score']:.1f}%") st.write("**Valutazione:**", result['evaluation']['explanation']) + + +if __name__ == "__main__": + render() +else: + render() diff --git a/views/gestione_domande.py b/views/gestione_domande.py index 8ab7ef9..f6681e6 100644 --- a/views/gestione_domande.py +++ b/views/gestione_domande.py @@ -11,7 +11,7 @@ delete_question_action, import_questions_action, ) -from views import register_page +# from views import register_page from views.style_utils import add_page_header from views.state_models import QuestionPageState logger = logging.getLogger(__name__) @@ -106,7 +106,7 @@ def confirm_delete_question_dialog(question_id, question_text): st.rerun() -@register_page("Gestione Domande") +# @register_page("Gestione Domande") def render(): # === Inizializzazione dello stato === st.session_state.setdefault("question_page_state", QuestionPageState()) @@ -303,3 +303,9 @@ def render(): key="import_questions_btn", on_click=import_questions_callback ) + + +if __name__ == "__main__": + render() +else: + render() diff --git a/views/gestione_set.py b/views/gestione_set.py index 3879006..eccb233 100644 --- a/views/gestione_set.py +++ b/views/gestione_set.py @@ -5,7 +5,7 @@ load_sets, prepare_sets_for_view, ) -from views import register_page +# from views import register_page from views.style_utils import add_page_header, add_global_styles from views.state_models import SetPageState from views.set_helpers import ( @@ -18,7 +18,7 @@ logger = logging.getLogger(__name__) -@register_page("Gestione Set di Domande") +# @register_page("Gestione Set di Domande") def render(): add_global_styles() @@ -350,3 +350,9 @@ def render(): key="import_set_btn", on_click=lambda: import_set_callback(state) ) + + +if __name__ == "__main__": + render() +else: + render() diff --git a/views/home.py b/views/home.py index cd50295..ec79396 100644 --- a/views/home.py +++ b/views/home.py @@ -3,13 +3,13 @@ import logging import streamlit as st -from .style_utils import add_home_styles -from views import register_page +from views.style_utils import add_home_styles +# from views import register_page logger = logging.getLogger(__name__) -@register_page("Home") +# @register_page("Home") def render(): """Visualizza la pagina principale con le funzionalità della piattaforma.""" @@ -100,3 +100,9 @@ def render(): """, unsafe_allow_html=True, ) + + +if __name__ == "__main__": + render() +else: + render() diff --git a/views/style_utils.py b/views/style_utils.py index dab2af9..de72135 100644 --- a/views/style_utils.py +++ b/views/style_utils.py @@ -9,6 +9,7 @@ logger = logging.getLogger(__name__) + def load_css(): """ Applica il CSS globale presente in 'styles.css'. @@ -18,13 +19,14 @@ def load_css(): css_content = css_path.read_text() st.markdown(f"", unsafe_allow_html=True) else: - st.warning("File styles.css non trovato. Assicurati che sia presente nella cartella utils.") + st.warning("File styles.css non trovato. Assicurati che sia presente nella cartella views.") def add_global_styles(): """Aggiunge stili globali all'applicazione.""" load_css() + def add_page_header(title: str, icon: str = "💡", description: str | None = None): """Aggiunge un'intestazione di pagina stilizzata.""" load_css() diff --git a/views/styles.css b/views/styles.css index 733b435..5656c39 100644 --- a/views/styles.css +++ b/views/styles.css @@ -1,15 +1,20 @@ /* =========================== - STILI GENERALI LAYOUT + LAYOUT GENERALE =========================== */ .main .block-container { padding-top: 2rem; padding-bottom: 2rem; } -.main { - background-color: #FAFBFF; + +/* =========================== + MENU +=========================== */ +section[data-testid="stSidebar"] div[data-testid="stSidebarNav"] span { + font-size: 20px !important; } -.sidebar .sidebar-content { - background-color: #F0F4FF; +section[data-testid="stSidebar"] div[data-testid="stSidebarNav"] svg { + width: 1.5em !important; + height: 1.5em !important; } /* =========================== @@ -21,8 +26,6 @@ .stSelectbox div[data-baseweb="select"], .stMultiselect div[data-baseweb="select"] { border-radius: 8px !important; - border: 1px solid #E0E5FF !important; - background-color: white !important; transition: all 0.3s ease !important; width: 100% !important; box-sizing: border-box !important; @@ -30,34 +33,17 @@ .stTextInput input:focus, .stNumberInput input:focus, .stTextArea textarea:focus { - border-color: #4F6AF0 !important; box-shadow: 0 0 0 3px rgba(79, 106, 240, 0.2) !important; } -.stSelectbox, -.stMultiselect { - border-radius: 8px !important; - width: 100% !important; -} .stMultiselect span[data-baseweb="tag"] { max-width: 100%; white-space: normal !important; flex-wrap: wrap; overflow-wrap: anywhere; } -.stMultiselect span[data-baseweb="tag"] span { - white-space: normal !important; - word-break: break-word; -} -.stMultiselect .st-gz { - max-width: none !important; -} -/* Consenti testo a capo nei menu */ div[data-baseweb="select"] * { max-width: 100%; overflow-wrap: anywhere; - word-break: normal; -} -div[data-baseweb="menu"] * { white-space: normal !important; word-break: break-word; } @@ -66,17 +52,44 @@ div[data-baseweb="menu"] * { BOTTONI =========================== */ .stButton > button { - border-radius: 8px !important; - border: 1px solid #4F6AF0 !important; - background-color: #4F6AF0 !important; + background-color: #4fbdf0 !important; color: white !important; + border-radius: 8px !important; font-weight: 600 !important; padding: 0.5rem 1rem !important; transition: all 0.3s ease !important; box-shadow: 0 2px 5px rgba(79, 106, 240, 0.2) !important; } .stButton > button:hover { - background-color: #3A56E0 !important; + background-color: #3a9ee0 !important; + box-shadow: 0 3px 10px rgba(79, 106, 240, 0.4) !important; + transform: translateY(-1px) !important; +} +.stFormSubmitButton > button { + background-color: #4fbdf0 !important; + color: white !important; + border-radius: 8px !important; + font-weight: 600 !important; + padding: 0.5rem 1rem !important; + transition: all 0.3s ease !important; + box-shadow: 0 2px 5px rgba(79, 106, 240, 0.2) !important; +} +.stFormSubmitButton > button:hover { + background-color: #3a9ee0 !important; + box-shadow: 0 3px 10px rgba(79, 106, 240, 0.4) !important; + transform: translateY(-1px) !important; +} +.st-emotion-cache-15yv26i > button { + background-color: #4fbdf0 !important; + color: white !important; + border-radius: 8px !important; + font-weight: 600 !important; + padding: 0.5rem 1rem !important; + transition: all 0.3s ease !important; + box-shadow: 0 2px 5px rgba(79, 106, 240, 0.2) !important; +} +.st-emotion-cache-15yv26i > button:hover { + background-color: #3a9ee0 !important; box-shadow: 0 3px 10px rgba(79, 106, 240, 0.4) !important; transform: translateY(-1px) !important; } @@ -87,7 +100,6 @@ div[data-baseweb="menu"] * { .stCheckbox label, .stRadio label { font-weight: 400 !important; - color: #333333 !important; } .stCheckbox > div[role="radiogroup"] > label > div:first-child, .stRadio > div[role="radiogroup"] > label > div:first-child { @@ -101,16 +113,13 @@ div[data-baseweb="menu"] * { gap: 0.5rem; } .stTabs [data-baseweb="tab"] { - border-radius: 8px 8px 0 0 !important; - background-color: #EAEEFF !important; + background-color: #EAEEFF !important; color: #333333 !important; + border-radius: 8px 8px 0 0 !important; padding: 0.5rem 1rem !important; - border: 1px solid #E0E5FF !important; border-bottom: none !important; } .stTabs [aria-selected="true"] { - background-color: white !important; - color: #4F6AF0 !important; font-weight: 600 !important; border-top: 2px solid #4F6AF0 !important; } @@ -120,14 +129,12 @@ div[data-baseweb="menu"] * { =========================== */ .shadow-card { border-radius: 10px; - background-color: white; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); padding: 1.5rem; margin-bottom: 1.5rem; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); } .page-header { margin-bottom: 1.5rem; - background-color: white; padding: 1.5rem; border-radius: 12px; box-shadow: 0 4px 12px rgba(79, 106, 240, 0.1); @@ -136,12 +143,10 @@ div[data-baseweb="menu"] * { .page-title { font-size: 2rem; font-weight: bold; - color: #4F6AF0; margin-bottom: 0.5rem; } .page-description { font-size: 1.1rem; - color: #666; margin-bottom: 0.5rem; } hr.header-divider { @@ -156,7 +161,6 @@ hr.header-divider { font-weight: 600; margin-top: 1.5rem; margin-bottom: 1rem; - color: #4F6AF0; padding-bottom: 0.5rem; border-bottom: 2px solid rgba(79, 106, 240, 0.2); } @@ -165,7 +169,6 @@ hr.header-divider { FEATURE BOXES =========================== */ .feature-box { - background-color: white; border-radius: 12px; padding: 25px; margin-bottom: 25px; @@ -181,19 +184,16 @@ hr.header-divider { font-size: 1.3rem; font-weight: 600; margin-bottom: 15px; - color: #333; display: flex; align-items: center; } .feature-description { font-size: 1rem; - color: #555; line-height: 1.5; } .icon-large { font-size: 2rem; margin-right: 0.75rem; - background: linear-gradient(135deg, #F0F4FF, #E6EBFF); width: 50px; height: 50px; line-height: 50px; @@ -207,26 +207,23 @@ hr.header-divider { =========================== */ .welcome-section { margin-bottom: 2.5rem; - background-color: white; padding: 2rem; border-radius: 12px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); border-left: 5px solid #4F6AF0; + background-color: --backgroundColor !important; } .welcome-title { font-size: 2.2rem; font-weight: bold; - color: #4F6AF0; margin-bottom: 1rem; } .subtitle { font-size: 1.3rem; - color: #555; line-height: 1.6; margin-bottom: 1.5rem; } .getting-started { - background: white; padding: 2rem; border-radius: 12px; margin-top: 2rem; @@ -235,7 +232,6 @@ hr.header-divider { border-left: 5px solid #4F6AF0; } .getting-started h3 { - color: #4F6AF0; margin-bottom: 1rem; } .getting-started ol { @@ -246,74 +242,4 @@ hr.header-divider { line-height: 1.6; } -/* =========================== - TEMA SCURO -=========================== */ -[data-theme="dark"] div[data-testid="stTextInput"] input, -.streamlit-dark div[data-testid="stTextInput"] input, -[data-theme="dark"] div[data-baseweb="input"] input, -.streamlit-dark div[data-baseweb="input"] input, -[data-theme="dark"] div[data-testid="stTextArea"] textarea, -.streamlit-dark div[data-testid="stTextArea"] textarea, -[data-theme="dark"] div[data-baseweb="textarea"] textarea, -.streamlit-dark div[data-baseweb="textarea"] textarea, -[data-theme="dark"] div[data-testid="stNumberInput"] input, -.streamlit-dark div[data-testid="stNumberInput"] input { - color: #000 !important; - background-color: #FFF !important; - border: 1px solid #AAA !important; -} -[data-theme="dark"] div[data-testid="stSelectbox"] div[data-baseweb="select"] > div, -.streamlit-dark div[data-testid="stSelectbox"] div[data-baseweb="select"] > div { - color: #000 !important; - background-color: #FFF !important; - border: 1px solid #AAA !important; -} -[data-theme="dark"] div[data-testid="stSelectbox"] svg, -.streamlit-dark div[data-testid="stSelectbox"] svg { - fill: #000 !important; -} - -/* =========================== - TEMA CHIARO -=========================== */ -[data-theme="light"] div[data-testid="stTextInput"] input, -.streamlit-light div[data-testid="stTextInput"] input, -[data-theme="light"] div[data-baseweb="input"] input, -.streamlit-light div[data-baseweb="input"] input, -[data-theme="light"] div[data-testid="stTextArea"] textarea, -.streamlit-light div[data-testid="stTextArea"] textarea, -[data-theme="light"] div[data-baseweb="textarea"] textarea, -.streamlit-light div[data-baseweb="textarea"] textarea, -[data-theme="light"] div[data-testid="stNumberInput"] input, -.streamlit-light div[data-testid="stNumberInput"] input { - color: #000 !important; - background-color: #FFF !important; - border: 1px solid #E0E0E0 !important; -} -[data-theme="light"] div[data-testid="stSelectbox"] div[data-baseweb="select"] > div, -.streamlit-light div[data-testid="stSelectbox"] div[data-baseweb="select"] > div { - color: #000 !important; - background-color: #FFF !important; - border: 1px solid #E0E0E0 !important; -} -[data-theme="light"] div[data-testid="stSelectbox"] svg, -.streamlit-light div[data-testid="stSelectbox"] svg { - fill: #000 !important; -} -/* =========================== - STILI FINALI (BORDI INPUT) -=========================== */ -div[data-testid="stTextInput"] input, -div[data-baseweb="input"] input, -div[data-testid="stTextArea"] textarea, -div[data-baseweb="textarea"] textarea, -div[data-testid="stNumberInput"] input, -div[data-testid="stSelectbox"] div[data-baseweb="select"] > div { - border-radius: 4px !important; -} -/* Mostra interamente il testo selezionato */ -div[data-baseweb="select"] * { - white-space: normal !important; -} diff --git a/views/visualizza_risultati.py b/views/visualizza_risultati.py index 15ba664..4ebf04b 100644 --- a/views/visualizza_risultati.py +++ b/views/visualizza_risultati.py @@ -15,12 +15,12 @@ list_model_names, prepare_select_options, ) -from views import register_page +# from views import register_page from views.style_utils import add_page_header, add_section_title logger = logging.getLogger(__name__) -@register_page("Visualizzazione Risultati") +# @register_page("Visualizzazione Risultati") def render(): add_page_header( "Visualizzazione Risultati Test", @@ -358,8 +358,6 @@ def import_results_callback(): st.markdown(f"**Risposta Attesa:** {expected_answer}") st.markdown(f"**Risposta Generata/Effettiva:** {actual_answer}") st.divider() - - evaluation = q_data.get( 'evaluation', {} ) # Assicurati che evaluation sia sempre un dizionario @@ -386,5 +384,10 @@ def import_results_callback(): "Completezza", f"{completeness:.2f}%" ) - st.markdown("--- --- ---") + + +if __name__ == "__main__": + render() +else: + render()