{% set rows = api_model_perf(request) %} {% set total = 0 %}{% set succ = 0 %} {% for r in rows %}{% set total = total + r.total_calls %}{% set succ = succ + r.success_calls %}{% endfor %} {% set rate = (succ * 100 / total)|round(1) if total > 0 else 0 %} { "widgettype": "VBox", "options": {"css": "card", "padding": "16px", "borderRadius": "12px", "width": "100%"}, "subwidgets": [ {"widgettype": "Text", "options": {"text": "成功率", "fontSize": "12px", "color": "var(--sage-text-secondary)"}}, {"widgettype": "Title2", "options": {"text": "{{rate}}%", "fontWeight": "700", "marginTop": "4px"}} ] }