From b5a63d412c4f5e9ce85be85d40523e202f4cac36 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 6 Jul 2026 15:44:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=201)get=5Fpricing=5Fdisplay=E5=8A=A0model?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E9=81=BF=E5=85=8D=E6=B7=B7=E5=85=A5=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E6=A8=A1=E5=9E=8B=E4=BB=B7=E6=A0=BC=202)=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E5=B8=83=E5=B1=80=E5=88=86=E5=BC=80=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?VScrollPanel+=E5=AE=9A=E4=BB=B7VBox=E7=A1=AE=E4=BF=9D=E5=AE=9A?= =?UTF-8?q?=E4=BB=B7=E5=A7=8B=E7=BB=88=E5=8F=AF=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- llmage/utils.py | 4 +-- wwwroot/show_llms_cards.ui | 61 +++++++++++++++----------------------- 2 files changed, 26 insertions(+), 39 deletions(-) diff --git a/llmage/utils.py b/llmage/utils.py index e2f6d3d..41f80be 100644 --- a/llmage/utils.py +++ b/llmage/utils.py @@ -263,7 +263,7 @@ where a.enabled_date <= ${today}$ pricing_list = [] for ppid in pp_map.get(l.id, []): try: - pd = await env.get_pricing_display(ppid) + pd = await env.get_pricing_display(ppid, model=l.name) if pd: pricing_list.append(pd.get('display_text', '')) except: @@ -413,7 +413,7 @@ async def get_llms_by_catelog(catelogid=None, orderby='providerid'): pricing_list = [] for ppid in pp_map.get(r.id, []): try: - pd = await env.get_pricing_display(ppid) + pd = await env.get_pricing_display(ppid, model=r.name) if pd: pricing_list.append(pd.get('display_text', '')) except: diff --git a/wwwroot/show_llms_cards.ui b/wwwroot/show_llms_cards.ui index 170555b..a8df1fc 100644 --- a/wwwroot/show_llms_cards.ui +++ b/wwwroot/show_llms_cards.ui @@ -31,30 +31,21 @@ "subwidgets":[ { "widgettype":"HBox", - "options":{ - "cheight":2 - }, + "options":{"cheight":2}, "subwidgets":[ { "widgettype":"Svg", - "options":{ - "rate":1.5, - "url":"{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}" - } + "options":{"rate":1.5,"url":"{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}"} }, { "widgettype":"Title6", - "options":{ - "text":"{{llm.name}}" - } + "options":{"text":"{{llm.name}}"} } ] }, { "widgettype":"VScrollPanel", - "options":{ - "css":"card-body-scroll" - }, + "options":{"css":"card-body-scroll","flex":"1"}, "subwidgets":[ { "widgettype":"Text", @@ -63,30 +54,28 @@ "wrap":true, "halign":"left" } - }, - { - "widgettype":"Filler", - "options":{ - "css":"pricing-box" - }, - "subwidgets":[ - {% for pricing_text in llm.pricing_display %} - { - "widgettype":"Text", - "options":{ - "text":{{json.dumps(pricing_text, ensure_ascii=False)}}, - "wrap":true, - "halign":"left", - "css":"pricing-text" - } - }{% if not loop.last %},{% endif %} - {% endfor %} - ] } ] + }, + { + "widgettype":"VBox", + "options":{"css":"pricing-box","cheight":4}, + "subwidgets":[ + {% for pricing_text in llm.pricing_display %} + { + "widgettype":"Text", + "options":{ + "text":{{json.dumps(pricing_text, ensure_ascii=False)}}, + "wrap":true, + "halign":"left", + "css":"pricing-text" + } + }{% if not loop.last %},{% endif %} + {% endfor %} + ] } - ], - "binds":[ + ], + "binds":[ { "wid":"self", "event":"click", @@ -103,9 +92,7 @@ {% endif %} }, "options":{ - "params":{ - "id":"{{llm.id}}" - }, + "params":{"id":"{{llm.id}}"}, "url":"{{entire_url('./llm_dialog.ui')}}" } }