mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 07:28:21 +08:00
Fix: [ALAS] Checkbox cannot be dynamically updated
This commit is contained in:
@@ -82,6 +82,7 @@ from module.webui.utils import (
|
|||||||
parse_pin_value,
|
parse_pin_value,
|
||||||
raise_exception,
|
raise_exception,
|
||||||
re_fullmatch,
|
re_fullmatch,
|
||||||
|
to_pin_value,
|
||||||
)
|
)
|
||||||
from module.webui.widgets import (
|
from module.webui.widgets import (
|
||||||
BinarySwitchButton,
|
BinarySwitchButton,
|
||||||
@@ -491,7 +492,7 @@ class AlasGUI(Frame):
|
|||||||
modified[set_key] = set_value
|
modified[set_key] = set_value
|
||||||
deep_set(config, set_key, set_value)
|
deep_set(config, set_key, set_value)
|
||||||
valid.append(set_key)
|
valid.append(set_key)
|
||||||
pin["_".join(set_key.split("."))] = set_value
|
pin["_".join(set_key.split("."))] = to_pin_value(set_value)
|
||||||
else:
|
else:
|
||||||
modified.pop(k)
|
modified.pop(k)
|
||||||
invalid.append(k)
|
invalid.append(k)
|
||||||
|
|||||||
@@ -427,6 +427,18 @@ def parse_pin_value(val, valuetype: str = None):
|
|||||||
return v
|
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):
|
def login(password):
|
||||||
if get_localstorage("password") == str(password):
|
if get_localstorage("password") == str(password):
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user