Comments (15)
I noticed that the notification ui.notify('my notification')
does not work when run with the uds keyword ui.run(uds='/tmp/app.sock')
.
from nicegui.
Other primitives (scene.line([0,0,0], [1,1,1])) are not shown if served via socket.
from nicegui.
Hi @kovalp,
We should make sure that the basic infrastructure works before looking into ui.scene
. Does a simple button work that shows a notification?
ui.button('Hi!', on_click=lambda: ui.notify('Ho!'))
from nicegui.
If I remove the keyword argument uds
from my asgi.py
script
from nicegui import ui
from test_nicegui.main import main
main()
ui.run()
and start serving from localhost (proxy_pass http://localhost:8080;
in nginx conf), the issue persists.
from nicegui.
Hi @kovalp,
We should make sure that the basic infrastructure works before looking into
ui.scene
. Does a simple button work that shows a notification?ui.button('Hi!', on_click=lambda: ui.notify('Ho!'))
Hi,
No, this does not work in production. I see the button, but when I click on it, the notification wouldn't show up. In the development this button works.
from nicegui.
If I make
...
def my_function():
print('print ho')
ui.notify('Ho!')
ui.button('Hi!', on_click=my_function)
then I can see 'print ho' in development run, but I cannot find in the production run (systemctl -l status nicegui-test
)
from nicegui.
Maybe this error message from systemctl status nicegui-test
would give a clue?
Apr 22 09:00:26 ubuntu-2gb-nbg1-1 python[768]: NiceGUI ready to go on http://localhost:8080, and http://116.203.218.8:8080
Apr 22 09:01:37 ubuntu-2gb-nbg1-1 python[768]: Invalid websocket upgrade (further occurrences of this error will be logged with level INFO)
from nicegui.
I simplified the main.py down to one button
"""."""
from nicegui import ui
def main() -> None:
"""."""
def my_function():
print('print ho')
ui.notify('Ho!')
ui.button('Hi!', on_click=my_function)
main()
ui.run()
and it still would not work in production, while continuing to work in the development run.
from nicegui.
Maybe this error message from
systemctl status nicegui-test
would give a clue?Apr 22 09:00:26 ubuntu-2gb-nbg1-1 python[768]: NiceGUI ready to go on http://localhost:8080, and http://116.203.218.8:8080 Apr 22 09:01:37 ubuntu-2gb-nbg1-1 python[768]: Invalid websocket upgrade (further occurrences of this error will be logged with level INFO)
This error seems to be known
https://stackoverflow.com/questions/78232346/invalid-websocket-upgrade
from nicegui.
Maybe this error message from
systemctl status nicegui-test
would give a clue?Apr 22 09:00:26 ubuntu-2gb-nbg1-1 python[768]: NiceGUI ready to go on http://localhost:8080, and http://116.203.218.8:8080 Apr 22 09:01:37 ubuntu-2gb-nbg1-1 python[768]: Invalid websocket upgrade (further occurrences of this error will be logged with level INFO)
This error seems to be known
https://stackoverflow.com/questions/78232346/invalid-websocket-upgrade
This solves the issue. At least the button starts to work. It would be nice to give more details on the nginx configuration in the niceGUI documentation.
from nicegui.
Everything else (3D spheres) works too. Feel free to close the issue.
from nicegui.
The nginx config should contain the
lines
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
in the server.location section
server {
server_name your.domain-name.ext;
location / {
include proxy_params;
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
from nicegui.
The docker image suggested in the documentation is not using nginx, so I wouldn't know how to configure nginx until I try.
from nicegui.
Have you seen our nginx example: https://github.com/zauberzeug/nicegui/tree/main/examples/nginx_subpath?
from nicegui.
Have you seen our nginx example: https://github.com/zauberzeug/nicegui/tree/main/examples/nginx_subpath?
Hi,
No, I did not find this config when I was looking. Anyway, I see that it is much more elaborated than the beginner's config I managed to compose.
This config needs another tutorial to explain the meaning/behavior of the software. I am afraid I need more explanations than in the provided read-me file :-)
from nicegui.
Related Issues (20)
- Change to MS-Windows style windows is not possible? HOT 2
- 2-way bindings backward direction does not work anymore HOT 1
- Not able to clear input anymore HOT 1
- Accessibility issue with hidden connection warning HOT 3
- Autocomplete for `ui.input` not working on mobile HOT 1
- Need Assistance Calling the Search Filter Function Inside the Search Template in NiceGUI Table
- NiceGUI uses 100% of a CPU core when running inside a container HOT 1
- [Pycharm Problem] Raise asyncio error when reload HOT 1
- local_file_picker Example error in version 1.4.25: HOT 5
- custom vue.js component not updated after modification HOT 3
- non-existing on_pointer parameter in InteractiveImage HOT 1
- `ui.chip` textcolor stays black on dark background HOT 2
- Bump plotly.js to 2.32.0 version supporting zindex HOT 1
- Lifespan state is not passed when a FastAPI app mount a Nicegui app HOT 3
- plotly is missing from docker image HOT 2
- How to get the value of a cell slot within a table?
- how can nicegui upload all files and subdirectory in an directory?
- auto-reload make pyinstaller build failed HOT 2
- `ui.codemirror` does not work via NiceGUI On Air
- Audio with hashtags in filenames are not loaded
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nicegui.