nicegui-tabulator icon indicating copy to clipboard operation
nicegui-tabulator copied to clipboard

404 error when theming

Open dorel14 opened this issue 1 year ago • 6 comments

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

dorel14 avatar Jan 02 '25 16:01 dorel14

@dorel14 Can you give a minimal executable example?

CrystalWindSnake avatar Jan 03 '25 05:01 CrystalWindSnake

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",)

dorel14 avatar Jan 03 '25 09:01 dorel14

@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",
)

CrystalWindSnake avatar Jan 04 '25 08:01 CrystalWindSnake

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

dorel14 avatar Jan 04 '25 13:01 dorel14

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

image

image

CrystalWindSnake avatar Jan 05 '25 05:01 CrystalWindSnake

Really a strange behaviour

Le dim. 5 janv. 2025, 06:57, CrystalWindSnake @.***> a écrit :

@dorel14 https://github.com/dorel14 On my end, all resources fail to load.

image.png (view on web) https://github.com/user-attachments/assets/021a5554-7e5f-4d04-9e85-3934c3b4065a

image.png (view on web) https://github.com/user-attachments/assets/1bb8c0b7-77d7-4e5f-95b7-334456f292be

— Reply to this email directly, view it on GitHub https://github.com/CrystalWindSnake/nicegui-tabulator/issues/33#issuecomment-2571512907, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACTHTNJN2PKUBCYJEEXV3E32JDCT5AVCNFSM6AAAAABUQGX4TCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZRGUYTEOJQG4 . You are receiving this because you were mentioned.Message ID: @.***>

dorel14 avatar Jan 05 '25 09:01 dorel14