mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-14 02:02:16 +00:00
feat: improve ui appearance of stored object
This commit is contained in:
@@ -442,10 +442,13 @@ pre.rich-traceback-code {
|
|||||||
|
|
||||||
[id^="pywebio-scope-dashboard-value-"] {
|
[id^="pywebio-scope-dashboard-value-"] {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-end;
|
align-items: baseline;
|
||||||
height: 1.5rem;
|
height: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[id^="pywebio-scope-arg_stored-stored-value-"] p {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
#pywebio-scope-log {
|
#pywebio-scope-log {
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
|
|||||||
+34
-8
@@ -1,4 +1,3 @@
|
|||||||
import copy
|
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
@@ -325,11 +324,17 @@ def put_arg_input(kwargs: T_Output_Kwargs) -> Output:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def product_stored_row(kwargs: T_Output_Kwargs, key, value):
|
def product_stored_row(key, value):
|
||||||
kwargs = copy.copy(kwargs)
|
if key[-1].isdigit():
|
||||||
kwargs["name"] += f'_{key}'
|
# quest1, quest2, quest3
|
||||||
kwargs["value"] = value
|
return [put_text(value).style("--dashboard-time--")]
|
||||||
return put_input(**kwargs).style("--input--")
|
else:
|
||||||
|
# calyx, relic
|
||||||
|
# 3 (relic)
|
||||||
|
return [
|
||||||
|
put_text(value).style("--dashboard-value--"),
|
||||||
|
put_text(f" ({key})").style("--dashboard-time--"),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def put_arg_stored(kwargs: T_Output_Kwargs) -> Output:
|
def put_arg_stored(kwargs: T_Output_Kwargs) -> Output:
|
||||||
@@ -337,11 +342,32 @@ def put_arg_stored(kwargs: T_Output_Kwargs) -> Output:
|
|||||||
kwargs["disabled"] = True
|
kwargs["disabled"] = True
|
||||||
|
|
||||||
values = kwargs.pop("value", {})
|
values = kwargs.pop("value", {})
|
||||||
|
value = values.pop("value", "")
|
||||||
|
total = values.pop("total", "")
|
||||||
time_ = values.pop("time", "")
|
time_ = values.pop("time", "")
|
||||||
|
|
||||||
rows = [product_stored_row(kwargs, key, value) for key, value in values.items() if value]
|
if value != "" and total != "":
|
||||||
|
rows = [put_scope(f"dashboard-value-{name}", [
|
||||||
|
put_text(value).style("--dashboard-value--"),
|
||||||
|
put_text(f" / {total}").style("--dashboard-time--"),
|
||||||
|
])]
|
||||||
|
elif value != "":
|
||||||
|
rows = [put_scope(f"dashboard-value-{name}", [
|
||||||
|
put_text(value).style("--dashboard-value--")
|
||||||
|
])]
|
||||||
|
else:
|
||||||
|
rows = []
|
||||||
|
if values:
|
||||||
|
rows += [
|
||||||
|
put_scope(f"dashboard-value-{name}-{key}", product_stored_row(key, value))
|
||||||
|
for key, value in values.items() if value != ""
|
||||||
|
]
|
||||||
|
|
||||||
if time_:
|
if time_:
|
||||||
rows += [product_stored_row(kwargs, "time", time_)]
|
rows.append(
|
||||||
|
put_text(time_).style("--dashboard-time--")
|
||||||
|
)
|
||||||
|
|
||||||
return put_scope(
|
return put_scope(
|
||||||
f"arg_container-stored-{name}",
|
f"arg_container-stored-{name}",
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user