1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 15:36:59 +08:00
This commit is contained in:
sui-feng-cb
2026-01-20 19:44:12 +08:00
16 changed files with 1112 additions and 1099 deletions

View File

@@ -63,7 +63,7 @@ from module.webui.base import Frame
from module.webui.discord_presence import close_discord_rpc, init_discord_rpc
from module.webui.fastapi import asgi_app
from module.webui.lang import _t, t
from module.webui.patch import patch_executor, patch_mimetype
from module.webui.patch import fix_py37_subprocess_communicate, patch_executor, patch_mimetype
from module.webui.pin import put_input, put_select
from module.webui.process_manager import ProcessManager
from module.webui.remote_access import RemoteAccess
@@ -96,6 +96,7 @@ from module.webui.widgets import (
patch_executor()
patch_mimetype()
fix_py37_subprocess_communicate()
task_handler = TaskHandler()
@@ -156,8 +157,8 @@ class AlasGUI(Frame):
buttons=[{"label": t("Gui.Aside.Home"), "value": "Home", "color": "aside"}],
onclick=[self.ui_develop],
)
put_scope("aside_instance",[
put_scope(f"alas-instance-{i}",[])
put_scope("aside_instance", [
put_scope(f"alas-instance-{i}", [])
for i, _ in enumerate(alas_instance())
])
self.set_aside_status()
@@ -179,7 +180,8 @@ class AlasGUI(Frame):
@use_scope("aside_instance")
def set_aside_status(self) -> None:
flag = True
flag = True
def update(name, seq):
with use_scope(f"alas-instance-{seq}", clear=True):
icon_html = Icon.RUN
@@ -192,7 +194,7 @@ class AlasGUI(Frame):
onclick=self.ui_alas,
)
return rendered_state
if not len(self.rendered_cache) or self.load_home:
# Reload when add/delete new instance | first start app.py | go to HomePage (HomePage load call force reload)
flag = False
@@ -215,7 +217,7 @@ class AlasGUI(Frame):
# Redraw lost focus, now focus on aside button
aside_name = get_localstorage("aside")
self.active_button("aside", aside_name)
return
@use_scope("header_status")
@@ -1153,8 +1155,8 @@ class AlasGUI(Frame):
"--loading-border-fill--"
)
if (
State.deploy_config.EnableRemoteAccess
and State.deploy_config.Password
State.deploy_config.EnableRemoteAccess
and State.deploy_config.Password
):
put_text(t("Gui.Remote.NotRunning"), scope="remote_state")
else:
@@ -1599,8 +1601,8 @@ def startup():
if State.deploy_config.StartOcrServer:
start_ocr_server_process(State.deploy_config.OcrServerPort)
if (
State.deploy_config.EnableRemoteAccess
and State.deploy_config.Password is not None
State.deploy_config.EnableRemoteAccess
and State.deploy_config.Password is not None
):
task_handler.add(RemoteAccess.keep_ssh_alive(), 60)