Pārlūkot izejas kodu

cleanup, styling and fixing subpage link

Rodja Trappe 2 gadi atpakaļ
vecāks
revīzija
5d6945c343

+ 4 - 2
examples/nginx_subpath/app/main.py

@@ -3,7 +3,9 @@ from nicegui import ui
 
 @ui.page('/subpage')
 def subpage():
-    ui.label('This is a subpage.')
+    ui.label('This is a subpage').classes('text-h5 mx-auto mt-12')
+    # TODO: this is not working properly yet
+    # ui.button('back', on_click=lambda: ui.open('/')).classes('mx-auto')
 
 
 @ui.page('/')
@@ -12,7 +14,7 @@ def index():
         ui.label('This demonstrates hosting of a NiceGUI app on a subpath.').classes('text-h5')
         ui.label('As you can see the entire app is available below "/nicegui".').classes('text-lg')
         ui.label('But the code here does not need to know that.').classes('text-lg')
-        ui.link('Navigate to a subpage.', subpage).classes('text-lg')
+        ui.link('Navigate to a subpage.', 'subpage').classes('text-lg')
 
 
 ui.run()

+ 2 - 2
examples/nginx_subpath/nginx.conf

@@ -47,10 +47,10 @@ http {
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection $connection_upgrade;
             proxy_set_header Authorization $http_authorization;
-            proxy_pass_header  Authorization;
+            proxy_pass_header Authorization;
 
             proxy_pass http://app:8080/$1?$args;
-            proxy_set_header X-Forwarded-Prefix /nicegui/;
+            proxy_set_header X-Forwarded-Prefix /nicegui;
         }
     }
 }