mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-10 09:12:05 +00:00
fix: checkbox cannot be updated dynamically
This commit is contained in:
+13
-3
@@ -11,9 +11,7 @@ from typing import Callable, Generator, List
|
||||
import pywebio
|
||||
from pywebio.input import PASSWORD, input
|
||||
from pywebio.output import PopupSize, popup, put_html, toast
|
||||
from pywebio.session import eval_js
|
||||
from pywebio.session import info as session_info
|
||||
from pywebio.session import register_thread, run_js
|
||||
from pywebio.session import eval_js, info as session_info, register_thread, run_js
|
||||
from rich.console import Console
|
||||
from rich.terminal_theme import TerminalTheme
|
||||
|
||||
@@ -427,6 +425,18 @@ def parse_pin_value(val, valuetype: str = None):
|
||||
return v
|
||||
|
||||
|
||||
def to_pin_value(val):
|
||||
"""
|
||||
Convert bool to checkbox
|
||||
"""
|
||||
if val is True:
|
||||
return [True]
|
||||
elif val is False:
|
||||
return []
|
||||
else:
|
||||
return val
|
||||
|
||||
|
||||
def login(password):
|
||||
if get_localstorage("password") == str(password):
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user