Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 error when theming #33

Open
dorel14 opened this issue Jan 2, 2025 · 6 comments
Open

404 error when theming #33

dorel14 opened this issue Jan 2, 2025 · 6 comments

Comments

@dorel14
Copy link

dorel14 commented Jan 2, 2025

Hello
I have set up latest version i set use_theme('bootstrap4') and on each reload i have "GET /tabulator_bootstrap4.min.css HTTP/1.1" 404
Can you help me

For information , i have set up a root_path in nicegui run

@CrystalWindSnake
Copy link
Owner

@dorel14 Can you give a minimal executable example?

@dorel14
Copy link
Author

dorel14 commented Jan 3, 2025

from nicegui import ui
import pandas as pd
from nicegui_tabulator import tabulator, theme

def main():
    # Exemple de données sous forme de DataFrame
    data = {
        'ID': [1, 2, 3, 4, 5],
        'Name': ['Alice', 'Bob', 'Charlie', 'Diana', 'Eve'],
        'Age': [25, 30, 35, 40, 45]
    }
    df = pd.DataFrame(data)

    # Configuration du tableau avec les options spécifiées
    csv_table_config = {
        "data": df.to_dict('records'),
        "columns": [{"field": col, "title": col} for col in df.columns],
        "layout": "fitColumns",
        "responsiveLayout": True,
        "resizableRows": True,
        "resizableRowGuide": True,
        "pagination": "local",
        "paginationSize": 10
    }

    # Titre de l'application
    ui.label('Tableau NiceGUI avec configuration avancée').classes('text-h4 text-center')
    use_theme('bootstrap4')
    # Ajoute le tableau à l'interface
    tabulator(csv_table_config).classes('max-w-2xl mx-auto mt-4')

if __name__ == '__main__':
    main()
    ui.run(host='0.0.0.0',
        port=8181,
        title='test app',
        favicon="🚀",
        root_path="/webapp",)

@CrystalWindSnake
Copy link
Owner

@dorel14
It seems that setting the root_path causes all NiceGUI resources to fail to load properly, not just Tabulator. The following code also does not display correctly.

from nicegui import ui


def main():
    ui.label("Hello World")


main()

ui.run(
    host="0.0.0.0",
    port=8181,
    title="test app",
    favicon="🚀",
    root_path="/webapp",
)

@dorel14
Copy link
Author

dorel14 commented Jan 4, 2025

HI , all my nicegui app is working well as it is behind a traefik proxy .
Project repo

usetheme activated

image

image

usetheme off

image

image

@CrystalWindSnake
Copy link
Owner

@dorel14 On my end, all resources fail to load.

image

image

@dorel14
Copy link
Author

dorel14 commented Jan 5, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants