{# 设置页"截图""删除已识别完的截图"两行里要数截图的几块(screenshots.usage):张数和大小、能腾出多少、"删除截图"按钮。 打开设置页时先不数(截图多时要好几秒,2026-11-11 群友反映设置页像是点不进去),这几块写"正在统计…"(shots 是 None); 页面打开后脚本取 /settings/shots(直接渲染这个文件,shots 有数字),按 id 换掉(settings.html 的脚本)。 常见的情况(识别完就删)换上去也是一行字,下面的内容不会挪;读屏软件:等的时候 aria-busy,换好不播报。 locked:用源码运行(不删截图,不用等数字) #} {% macro usage_desc(shots) -%}
{%- if shots %}共 {{ shots.count }} 张 · {{ shots.size }}{% else %}正在统计…{% endif -%}
{%- endmacro %} {% macro clean_desc(shots, locked) -%}
{%- if locked %}用源码运行时不删截图 {%- elif not shots %}正在统计… {%- elif shots.clean_count or shots.clean_convert %}可以腾出约 {{ shots.clean_size }}( {%- if shots.clean_count %}删掉 {{ shots.clean_count }} 张{% endif %} {%- if shots.clean_count and shots.clean_convert %},{% endif %} {%- if shots.clean_convert %}{{ shots.clean_convert }} 张总结页截图转成 JPG{% endif %})。 {%- if shots.clean_convert %}总结页截图转成 JPG 留着,{% else %}总结页截图、{% endif %}待确认的局要用的截图{% if shots.recording %}、正在记录的这一次{% endif %}不删 {%- else %}没有可以删的截图{% if shots.count %}:剩下的是总结页截图、待确认的局要用的{% if shots.recording %},或者正在记录{% endif %}{% endif %} {%- endif -%}
{%- endmacro %} {# 确认框的话写在 data-confirm 里(settings.html 的表单 onsubmit 读它);还没数完、没有可以删的时候按钮不能点 #} {% macro clean_button(shots, locked) -%} {%- set s = shots or {} %} {%- set what = ('删除 %d 张已识别完的截图' % s.clean_count if s.clean_count else '') ~ ('、' if s.clean_count and s.clean_convert else '') ~ ('把 %d 张总结页截图转成 JPG' % s.clean_convert if s.clean_convert else '') %} {%- endmacro %} {%- if shots is defined and shots %} {{ usage_desc(shots) }} {{ clean_desc(shots, shots_locked) }} {{ clean_button(shots, shots_locked) }} {%- endif %}