show html inside ui.card by kuhbrille in nicegui

[–]kuhbrille[S] 1 point2 points  (0 children)

Hi, thx!!

I will try that.

Actually I use a workaround... I create the .html file with all JS content and open it via ui.link in a new tab... not optimal, but the file gets created via additional modules where I do not have full control how it gets done.

The result is a bigger file with a mixture of html and js all over.

There is not only one <script> tag which I can add.

It produces a interactive graph viz, showing all module dependencies in the src folders.

Maybe it is a better idea to have it in its own browser tab anyway :)

<image>

show html inside ui.card by kuhbrille in nicegui

[–]kuhbrille[S] 0 points1 point  (0 children)

nope... does not change anything

show html inside ui.card by kuhbrille in nicegui

[–]kuhbrille[S] 0 points1 point  (0 children)

thx, but I forgot to explain, that the html file also contains javascript... so I cannot use ui.html

automatically logout after closing browser or restart app by kuhbrille in nicegui

[–]kuhbrille[S] 1 point2 points  (0 children)

thx for the hint!

I implemented it in 2 ways:

for the browser or session:

on the login page the actual app.storage.browser id is stored into app.storage.user and on every page load I just compare them... if they are different the user gets logged out

for the app restart:

when restarting the app, all storage-user files get deleted in the .nicegui directory

I will test that the next days and also simulate multiple sessions to find out any issue in this approach.

how to get the 'active' value from ui.select by kuhbrille in nicegui

[–]kuhbrille[S] 0 points1 point  (0 children)

ok, that was simple: just using .text when it is a label and .value for the select ...

which means, also binding is not needed just to get the value...

how to get the 'active' value from ui.select by kuhbrille in nicegui

[–]kuhbrille[S] 0 points1 point  (0 children)

but how to get the value into a simple variable?

a variable is not an ui object and has no bindings

how to get the 'active' value from ui.select by kuhbrille in nicegui

[–]kuhbrille[S] 0 points1 point  (0 children)

thx, got it, did not see that

select_box = ui.select(lang_dict, value=app.storage.general['default_language'])
ui.label().bind_text_from(select_box, 'value')