fix: 1)get_pricing_display加model过滤避免混入其他模型价格 2)卡片布局分开描述VScrollPanel+定价VBox确保定价始终可见
This commit is contained in:
parent
109d081a3f
commit
b5a63d412c
@ -263,7 +263,7 @@ where a.enabled_date <= ${today}$
|
|||||||
pricing_list = []
|
pricing_list = []
|
||||||
for ppid in pp_map.get(l.id, []):
|
for ppid in pp_map.get(l.id, []):
|
||||||
try:
|
try:
|
||||||
pd = await env.get_pricing_display(ppid)
|
pd = await env.get_pricing_display(ppid, model=l.name)
|
||||||
if pd:
|
if pd:
|
||||||
pricing_list.append(pd.get('display_text', ''))
|
pricing_list.append(pd.get('display_text', ''))
|
||||||
except:
|
except:
|
||||||
@ -413,7 +413,7 @@ async def get_llms_by_catelog(catelogid=None, orderby='providerid'):
|
|||||||
pricing_list = []
|
pricing_list = []
|
||||||
for ppid in pp_map.get(r.id, []):
|
for ppid in pp_map.get(r.id, []):
|
||||||
try:
|
try:
|
||||||
pd = await env.get_pricing_display(ppid)
|
pd = await env.get_pricing_display(ppid, model=r.name)
|
||||||
if pd:
|
if pd:
|
||||||
pricing_list.append(pd.get('display_text', ''))
|
pricing_list.append(pd.get('display_text', ''))
|
||||||
except:
|
except:
|
||||||
|
|||||||
@ -31,30 +31,21 @@
|
|||||||
"subwidgets":[
|
"subwidgets":[
|
||||||
{
|
{
|
||||||
"widgettype":"HBox",
|
"widgettype":"HBox",
|
||||||
"options":{
|
"options":{"cheight":2},
|
||||||
"cheight":2
|
|
||||||
},
|
|
||||||
"subwidgets":[
|
"subwidgets":[
|
||||||
{
|
{
|
||||||
"widgettype":"Svg",
|
"widgettype":"Svg",
|
||||||
"options":{
|
"options":{"rate":1.5,"url":"{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}"}
|
||||||
"rate":1.5,
|
|
||||||
"url":"{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widgettype":"Title6",
|
"widgettype":"Title6",
|
||||||
"options":{
|
"options":{"text":"{{llm.name}}"}
|
||||||
"text":"{{llm.name}}"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widgettype":"VScrollPanel",
|
"widgettype":"VScrollPanel",
|
||||||
"options":{
|
"options":{"css":"card-body-scroll","flex":"1"},
|
||||||
"css":"card-body-scroll"
|
|
||||||
},
|
|
||||||
"subwidgets":[
|
"subwidgets":[
|
||||||
{
|
{
|
||||||
"widgettype":"Text",
|
"widgettype":"Text",
|
||||||
@ -63,30 +54,28 @@
|
|||||||
"wrap":true,
|
"wrap":true,
|
||||||
"halign":"left"
|
"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",
|
"wid":"self",
|
||||||
"event":"click",
|
"event":"click",
|
||||||
@ -103,9 +92,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
},
|
},
|
||||||
"options":{
|
"options":{
|
||||||
"params":{
|
"params":{"id":"{{llm.id}}"},
|
||||||
"id":"{{llm.id}}"
|
|
||||||
},
|
|
||||||
"url":"{{entire_url('./llm_dialog.ui')}}"
|
"url":"{{entire_url('./llm_dialog.ui')}}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user