mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-10 09:12:05 +00:00
feat: add ETA display and comment support in dashboard
This commit is contained in:
@@ -61,6 +61,7 @@ Dashboard:
|
||||
HoursAgo:
|
||||
DaysAgo:
|
||||
LongTimeAgo:
|
||||
EtaDays:
|
||||
|
||||
AddAlas:
|
||||
PopupTitle:
|
||||
|
||||
@@ -16,6 +16,7 @@ class GeneratedConfig:
|
||||
Scheduler_ServerUpdate = '04:00'
|
||||
|
||||
# Group `Emulator`
|
||||
Emulator_Serial = 'auto'
|
||||
Emulator_PackageName = 'auto' # auto, JP-Official, OVERSEA-TWHKMO, OVERSEA-Korea, OVERSEA-Asia, OVERSEA-America, OVERSEA-Global
|
||||
Emulator_GameLanguage = 'auto' # auto, jp, en, zht
|
||||
Emulator_ScreenshotMethod = 'auto' # auto, ADB, ADB_nc, uiautomator2, aScreenCap, aScreenCap_nc, DroidCast, DroidCast_raw, scrcpy, nemu_ipc
|
||||
|
||||
@@ -923,7 +923,8 @@
|
||||
"MinutesAgo": "{time}min ago",
|
||||
"HoursAgo": "{time}h ago",
|
||||
"DaysAgo": "{time}d ago",
|
||||
"LongTimeAgo": "long time ago"
|
||||
"LongTimeAgo": "long time ago",
|
||||
"EtaDays": "ETA {time}d"
|
||||
},
|
||||
"AddAlas": {
|
||||
"PopupTitle": "Add new config",
|
||||
|
||||
@@ -923,7 +923,8 @@
|
||||
"MinutesAgo": "{time}分钟前",
|
||||
"HoursAgo": "{time}小时前",
|
||||
"DaysAgo": "{time}天前",
|
||||
"LongTimeAgo": "很久以前"
|
||||
"LongTimeAgo": "很久以前",
|
||||
"EtaDays": "剩余{time}天"
|
||||
},
|
||||
"AddAlas": {
|
||||
"PopupTitle": "添加新配置",
|
||||
|
||||
@@ -341,6 +341,11 @@ class AlasGUI(Frame):
|
||||
put_text(config.get("value", nodata)).style("--dashboard-value--"),
|
||||
put_text(f' / {config.get("total", "")}').style("--dashboard-time--"),
|
||||
]
|
||||
elif "comment" in dic.get("attrs", []) and config.get("comment") is not None:
|
||||
return [
|
||||
put_text(config.get("value", nodata)).style("--dashboard-value--"),
|
||||
put_text(f' {config.get("comment", "")}').style("--dashboard-time--"),
|
||||
]
|
||||
else:
|
||||
return [
|
||||
put_text(config.get("value", nodata)).style("--dashboard-value--"),
|
||||
|
||||
+13
-1
@@ -345,6 +345,7 @@ def put_arg_stored(kwargs: T_Output_Kwargs) -> Output:
|
||||
value = values.pop("value", "")
|
||||
total = values.pop("total", "")
|
||||
time_ = values.pop("time", "")
|
||||
comment = values.pop("comment", "")
|
||||
|
||||
if value != "" and total != "":
|
||||
# 0 / 100
|
||||
@@ -352,6 +353,12 @@ def put_arg_stored(kwargs: T_Output_Kwargs) -> Output:
|
||||
put_text(value).style("--dashboard-value--"),
|
||||
put_text(f" / {total}").style("--dashboard-time--"),
|
||||
])]
|
||||
elif value != "" and comment != "":
|
||||
# 88% <1.2d
|
||||
rows = [put_scope(f"dashboard-value-{name}", [
|
||||
put_text(value).style("--dashboard-value--"),
|
||||
put_text(f" {comment}").style("--dashboard-time--"),
|
||||
])]
|
||||
elif value != "":
|
||||
# 100
|
||||
rows = [put_scope(f"dashboard-value-{name}", [
|
||||
@@ -393,6 +400,11 @@ def put_arg_planner(kwargs: T_Output_Kwargs) -> Output | None:
|
||||
except KeyError:
|
||||
# Hide items not needed by the planner
|
||||
return None
|
||||
eta = values.get("eta", 0)
|
||||
if eta > 0:
|
||||
eta = f" - {t('Gui.Dashboard.EtaDays', time=eta)}"
|
||||
else:
|
||||
eta = ""
|
||||
|
||||
value = values.pop('value', 0)
|
||||
if isinstance(value, dict):
|
||||
@@ -403,7 +415,7 @@ def put_arg_planner(kwargs: T_Output_Kwargs) -> Output | None:
|
||||
|
||||
row = put_scope(f"arg_stored-stored-value-{name}", [
|
||||
put_text(f"{progress:.2f}%").style("--dashboard-bold--"),
|
||||
put_text(f"{value} / {total}").style("--dashboard-time--"),
|
||||
put_text(f"{value} / {total}{eta}").style("--dashboard-time--"),
|
||||
])
|
||||
|
||||
return put_scope(
|
||||
|
||||
Reference in New Issue
Block a user