|
|
|
|
|
|
|
|
|
|
|
|
|
from h2o_wave import main, app, Q, ui |
|
|
|
|
|
@app('/demo') |
|
async def serve(q: Q): |
|
if q.args.increment_app: |
|
q.app.count = (q.app.count or 0) + 1 |
|
elif q.args.increment_user: |
|
q.user.count = (q.user.count or 0) + 1 |
|
elif q.args.increment_client: |
|
q.client.count = (q.client.count or 0) + 1 |
|
|
|
q.page['example'] = ui.form_card(box='1 1 12 10', items=[ |
|
ui.button(name='increment_app', label=f'App Count={q.app.count or 0}'), |
|
ui.button(name='increment_user', label=f'User Count={q.user.count or 0}'), |
|
ui.button(name='increment_client', label=f'Client Count={q.client.count or 0}'), |
|
]) |
|
|
|
await q.page.save() |
|
|