About Extending WebUI Pages in the Pyri Framework #12
Replies: 5 comments 7 replies
-
I just tried deploying the pyri-example-plugin. I packaged the project into a wheel and then copied it to ./local/share/pyri-webui-server and then restarted the entire pyri, but I still can't see the new content. Is there something wrong with the deployment steps? |
Beta Was this translation helpful? Give feedback.
-
I just tested it again and found that both blockly and sandbox in the example-plugin have been successfully loaded and run, but there isn't a webui_server page. I see there is a hello.html in the directory but it doesn't appear. Is there something wrong? |
Beta Was this translation helpful? Give feedback.
-
Pyri has two major execution environments: the "runtime" side, which contains the nodes that run as normal Python programs, and the "webui" which runs inside the web browser using Pyodide. The The Pyodide webui side is very different. This uses WebAssembly to run Python inside the web browser itself. The user interface uses a combination of Pyodide, Vue, Bootstrap, and other JavaScript components to implement the user interface. The Python code and resources are stored in Python wheels, and the wheels are placed in a special directory Let's look at the some important points for pyri-robotics-browser, which is loaded into the webui and provides the "Jog" panel.
Hope this helps. I think I will need to create more detailed tutorials in the future. Note that the webui-routes are different, and are for adding HTTP routes to the webui server. This is independent of the Pyodide webui wheels, and is intended for adding resources and additional HTTP features. For your use case you most likely won't need this, unless you want to add JavaScript packages. |
Beta Was this translation helpful? Give feedback.
-
Hi @Lafatalite I am going to put together an example repository, stand by... |
Beta Was this translation helpful? Give feedback.
-
See https://github.com/pyri-project/pyri-example-browser |
Beta Was this translation helpful? Give feedback.
-
I want to add a new page to the webui. I have already read the documentation but didn't understand it. I tried to emulate the robotics_browser project and packaged it into a wheel file, then copied it to ./local/share/pyri-webui-server, but it didn't display successfully. I'm wondering if there is a simpler example, like a page that displays "Hello World", to understand its working principle. The robotics_browser seems very complex, and I also want to know the difference between robotics_browser and robotics. From my understanding, projects with the "browser" suffix are webui projects that include a frontend page and have some backend functionalities. Are they interconnected, or do they need to be independent?
Beta Was this translation helpful? Give feedback.
All reactions