Skip to content

Commit

Permalink
WebUI typing fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot committed Jan 8, 2025
1 parent 06e1ff8 commit e40d50f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webui/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ def _create_widget(
"""
if disabled:
st.warning(Messages.SETTING_DISABLED_ON_PUBLIC.format(setting=field_name))
if isinstance(value, int):
if type(value) is int:
return st.number_input(
label=field_name, value=value, min_value=0, key=raw_field_name, disabled=disabled
)
elif isinstance(value, bool):
elif type(value) is bool:
return st.checkbox(label=field_name, value=value, key=raw_field_name, disabled=disabled)
elif isinstance(value, tuple):
elif type(value) is tuple:
return st.selectbox(label=field_name, options=value)
elif isinstance(value, dict):
elif type(value) is dict:
return st.selectbox(
label=field_name,
options=value,
Expand Down

0 comments on commit e40d50f

Please sign in to comment.