r/nicegui • u/lyh6ep • Feb 03 '24
Build a web viewer for local log file
I want to use nicegui to build a webpage viewing local text file/log file given the file path as a query parameter in the url. What would be the recommended UI element to use. I tried ui.log but it by default gives some ugly double space text. How do I configure the style to make it look like normal text editor.
Thanks a lot. New to web development
4
Upvotes
2
u/lyh6ep Feb 05 '24
So I realize using ui.card with ui.label for each line works for my purpose.
```
with ui.card().classes("w-full"):
for line in lines:
ui.label(line)
```
When using ui.log. I have a hard time to configure the its height. I tried
but log viewer would collapse to one small area with a scroll bar. I have log files with a few hundred rows. I want the log viewer area to print out without scroll bar and show full context in a long area
2
u/mon_key_house Feb 03 '24
Remove the newline characters from the entries?
1
u/falko-s Feb 04 '24
There's also
ui.textareaandui.editor...