Ihre Kommentare
vor 10 Jahren
BTW in latest Ajenti, you can bind to dict keys directly now with bind="[key]"
I would recommend a ready-made solution such as Proxmox
It's also possible to directly force an UI update using self.context.endpoint.send_ui().
Oh I think you mean that you have some long-running code below that delays update in the browser? In this case, use Gevent task switching to let the other threads send the browser updates - add gevent.sleep(0) (import gevent) in the places where you want to give way to the updater thread: http://sdiehl.github.io/gevent-tutorial/#synchronous-asynchronous-execution
update() method updates the object with the information from UI. You only need populate() (update and populate have opposite effects) here. You can peek at the Binding demo plugin which demonstrates when to use update() and populate().
Browser side UI is automatically updated when there are any changes on the server-side. The reason why you don't see the updates is because you have overwritten your object data with empty values from UI when you called update() for the first time.
Browser side UI is automatically updated when there are any changes on the server-side. The reason why you don't see the updates is because you have overwritten your object data with empty values from UI when you called update() for the first time.
How exactly is your background task launched? With gevent 1.0, Ajenti will be able to send keepalive signals to browser, and the connection won't timeout no matter how long the process takes to complete.
Customer support service by UserEcho