feat: 模型广场改为左右分栏布局,左侧分类/供应商导航,右侧模型卡片
This commit is contained in:
parent
cfa355a7a5
commit
2b30a3f0dc
@ -17,6 +17,22 @@
|
|||||||
color: var(--sage-brand, #6366f1);
|
color: var(--sage-brand, #6366f1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Left sidebar */
|
||||||
|
.plaza-sidebar {
|
||||||
|
border-right: 1px solid var(--sage-border, #e2e8f0);
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plaza-nav-btn {
|
||||||
|
margin-bottom: 2px;
|
||||||
|
text-align: left;
|
||||||
|
transition: background-color 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plaza-nav-btn:hover {
|
||||||
|
background-color: var(--sage-hover, rgba(99, 102, 241, 0.08));
|
||||||
|
}
|
||||||
|
|
||||||
/* Card hover effects for model cards */
|
/* Card hover effects for model cards */
|
||||||
.plaza-card {
|
.plaza-card {
|
||||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||||
@ -50,7 +66,7 @@
|
|||||||
/* Smooth card grid */
|
/* Smooth card grid */
|
||||||
.plaza-grid {
|
.plaza-grid {
|
||||||
gap: 12px !important;
|
gap: 12px !important;
|
||||||
padding: 4px 0;
|
padding: 4px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Model icon area */
|
/* Model icon area */
|
||||||
|
|||||||
@ -1,105 +1,72 @@
|
|||||||
{% set userorgid = get_userorgid() %}
|
{% set catelogs = get_llmcatelogs() %}
|
||||||
{
|
{
|
||||||
"widgettype":"VScrollPanel",
|
"widgettype":"HBox",
|
||||||
"options":{
|
"options":{
|
||||||
"width":"100%",
|
"width":"100%",
|
||||||
"height":"100%"
|
"height":"100%"
|
||||||
},
|
},
|
||||||
"subwidgets":[
|
"subwidgets":[
|
||||||
{% for cate in get_llms_by_catelog() %}
|
|
||||||
{
|
{
|
||||||
"widgettype": "VBox",
|
"widgettype":"VScrollPanel",
|
||||||
"options":{
|
"options":{
|
||||||
"width":"100%"
|
"cwidth":18,
|
||||||
|
"height":"100%",
|
||||||
|
"css":"plaza-sidebar"
|
||||||
},
|
},
|
||||||
"subwidgets":[
|
"subwidgets":[
|
||||||
{
|
{
|
||||||
"widgettype":"Title3",
|
"widgettype":"Button",
|
||||||
"options":{
|
"options":{
|
||||||
"wrap":true,
|
"label":"全部",
|
||||||
"halign": "left",
|
"css":"plaza-nav-btn",
|
||||||
"i18n": true,
|
|
||||||
"otext":"{{cate.catelogname}}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype":"DynamicColumn",
|
|
||||||
"options":{
|
|
||||||
"css":"filler plaza-grid",
|
|
||||||
"width":"100%"
|
"width":"100%"
|
||||||
},
|
},
|
||||||
"subwidgets":[
|
"binds":[
|
||||||
{% for llm in cate.llms %}
|
{
|
||||||
{
|
"wid":"self",
|
||||||
"widgettype":"VScrollPanel",
|
"event":"click",
|
||||||
"options":{
|
"actiontype":"urlwidget",
|
||||||
"css":"card plaza-card",
|
"target":"plaza_cards_panel",
|
||||||
"cwidth":20,
|
"options":{
|
||||||
"cheight":12
|
"url":"{{entire_url('show_llms_cards.ui')}}"
|
||||||
},
|
}
|
||||||
"subwidgets":[
|
|
||||||
{
|
|
||||||
"widgettype":"HBox",
|
|
||||||
"options":{
|
|
||||||
"cheight":2
|
|
||||||
},
|
|
||||||
"subwidgets":[
|
|
||||||
{
|
|
||||||
"widgettype":"Svg",
|
|
||||||
"options":{
|
|
||||||
"rate":1.5,
|
|
||||||
"url":"{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype":"Title6",
|
|
||||||
"options":{
|
|
||||||
"text":"{{llm.name}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype":"Text",
|
|
||||||
"options":{
|
|
||||||
"text":{{json.dumps(llm.description, ensure_ascii=False)}},
|
|
||||||
"wrap":true,
|
|
||||||
"halign":"left"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"binds":[
|
|
||||||
{
|
|
||||||
"wid":"self",
|
|
||||||
"event":"click",
|
|
||||||
"actiontype":"urlwidget",
|
|
||||||
"target":"PopupWindow",
|
|
||||||
"popup_options":{
|
|
||||||
"title":"{{llm.name}}",
|
|
||||||
{% if int(params_kw._is_mobile) %}
|
|
||||||
"width": "100%",
|
|
||||||
"height": "100%"
|
|
||||||
{% else %}
|
|
||||||
"width": "40%",
|
|
||||||
"height":"85%"
|
|
||||||
{% endif %}
|
|
||||||
},
|
|
||||||
"options":{
|
|
||||||
"params":{
|
|
||||||
"id":"{{llm.id}}"
|
|
||||||
},
|
|
||||||
"url":"{{entire_url('./llm_dialog.ui')}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
{% if not loop.last %}, {% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
]
|
{% for cat in catelogs %}
|
||||||
}
|
{
|
||||||
{% if not loop.last %}, {% endif %}
|
"widgettype":"Button",
|
||||||
|
"options":{
|
||||||
|
"label":"{{cat.name}}",
|
||||||
|
"css":"plaza-nav-btn",
|
||||||
|
"width":"100%"
|
||||||
|
},
|
||||||
|
"binds":[
|
||||||
|
{
|
||||||
|
"wid":"self",
|
||||||
|
"event":"click",
|
||||||
|
"actiontype":"urlwidget",
|
||||||
|
"target":"plaza_cards_panel",
|
||||||
|
"options":{
|
||||||
|
"url":"{{entire_url('show_llms_cards.ui')}}",
|
||||||
|
"params":{
|
||||||
|
"catelogid":"{{cat.id}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}{% if not loop.last %},{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widgettype":"urlwidget",
|
||||||
|
"id":"plaza_cards_panel",
|
||||||
|
"options":{
|
||||||
|
"cwidth":82,
|
||||||
|
"height":"100%",
|
||||||
|
"url":"{{entire_url('show_llms_cards.ui')}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,104 +1,72 @@
|
|||||||
{% set userorgid = get_userorgid() %}
|
{% set providers = get_llms_sort_by_provider() %}
|
||||||
{
|
{
|
||||||
"widgettype":"VScrollPanel",
|
"widgettype":"HBox",
|
||||||
"options":{
|
"options":{
|
||||||
"width":"100%",
|
"width":"100%",
|
||||||
"height":"100%"
|
"height":"100%"
|
||||||
},
|
},
|
||||||
"subwidgets":[
|
"subwidgets":[
|
||||||
{% for p in get_llms_sort_by_provider() %}
|
|
||||||
{
|
{
|
||||||
"widgettype": "VBox",
|
"widgettype":"VScrollPanel",
|
||||||
"options":{
|
"options":{
|
||||||
"width":"100%"
|
"cwidth":18,
|
||||||
|
"height":"100%",
|
||||||
|
"css":"plaza-sidebar"
|
||||||
},
|
},
|
||||||
"subwidgets":[
|
"subwidgets":[
|
||||||
{
|
{
|
||||||
"widgettype":"Title3",
|
"widgettype":"Button",
|
||||||
"options":{
|
"options":{
|
||||||
"wrap":true,
|
"label":"全部",
|
||||||
"halign": "left",
|
"css":"plaza-nav-btn",
|
||||||
"text":"{{p.orgname}}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype":"DynamicColumn",
|
|
||||||
"options":{
|
|
||||||
"css":"filler plaza-grid",
|
|
||||||
"width":"100%"
|
"width":"100%"
|
||||||
},
|
},
|
||||||
"subwidgets":[
|
"binds":[
|
||||||
{% for llm in p.llms %}
|
{
|
||||||
{
|
"wid":"self",
|
||||||
"widgettype":"VScrollPanel",
|
"event":"click",
|
||||||
"options":{
|
"actiontype":"urlwidget",
|
||||||
"css":"card plaza-card",
|
"target":"plaza_provider_panel",
|
||||||
"cwidth":20,
|
"options":{
|
||||||
"cheight":12
|
"url":"{{entire_url('show_llms_cards_by_provider.ui')}}"
|
||||||
},
|
}
|
||||||
"subwidgets":[
|
|
||||||
{
|
|
||||||
"widgettype":"HBox",
|
|
||||||
"options":{
|
|
||||||
"cheight":2
|
|
||||||
},
|
|
||||||
"subwidgets":[
|
|
||||||
{
|
|
||||||
"widgettype":"Svg",
|
|
||||||
"options":{
|
|
||||||
"rate":1.5,
|
|
||||||
"url":"{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype":"Title6",
|
|
||||||
"options":{
|
|
||||||
"text":"{{llm.name}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype":"Text",
|
|
||||||
"options":{
|
|
||||||
"text":{{json.dumps(llm.description, ensure_ascii=False)}},
|
|
||||||
"wrap":true,
|
|
||||||
"halign":"left"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"binds":[
|
|
||||||
{
|
|
||||||
"wid":"self",
|
|
||||||
"event":"click",
|
|
||||||
"actiontype":"urlwidget",
|
|
||||||
"target":"PopupWindow",
|
|
||||||
"popup_options":{
|
|
||||||
"title":"{{llm.name}}",
|
|
||||||
{% if int(params_kw._is_mobile) %}
|
|
||||||
"width": "100%",
|
|
||||||
"height": "100%"
|
|
||||||
{% else %}
|
|
||||||
"width": "40%",
|
|
||||||
"height":"85%"
|
|
||||||
{% endif %}
|
|
||||||
},
|
|
||||||
"options":{
|
|
||||||
"params":{
|
|
||||||
"id":"{{llm.id}}"
|
|
||||||
},
|
|
||||||
"url":"{{entire_url('./llm_dialog.ui')}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
{% if not loop.last %}, {% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
]
|
{% for p in providers %}
|
||||||
}
|
{
|
||||||
{% if not loop.last %}, {% endif %}
|
"widgettype":"Button",
|
||||||
|
"options":{
|
||||||
|
"label":"{{p.orgname}}",
|
||||||
|
"css":"plaza-nav-btn",
|
||||||
|
"width":"100%"
|
||||||
|
},
|
||||||
|
"binds":[
|
||||||
|
{
|
||||||
|
"wid":"self",
|
||||||
|
"event":"click",
|
||||||
|
"actiontype":"urlwidget",
|
||||||
|
"target":"plaza_provider_panel",
|
||||||
|
"options":{
|
||||||
|
"url":"{{entire_url('show_llms_cards_by_provider.ui')}}",
|
||||||
|
"params":{
|
||||||
|
"providerid":"{{p.id}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}{% if not loop.last %},{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widgettype":"urlwidget",
|
||||||
|
"id":"plaza_provider_panel",
|
||||||
|
"options":{
|
||||||
|
"cwidth":82,
|
||||||
|
"height":"100%",
|
||||||
|
"url":"{{entire_url('show_llms_cards_by_provider.ui')}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
90
wwwroot/show_llms_cards.ui
Normal file
90
wwwroot/show_llms_cards.ui
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
{% set catelogid = params_kw.get('catelogid', None) %}
|
||||||
|
{% set data = get_llms_by_catelog(catelogid=catelogid) %}
|
||||||
|
{% set ns = namespace(first=true) %}
|
||||||
|
{
|
||||||
|
"widgettype":"VScrollPanel",
|
||||||
|
"options":{
|
||||||
|
"width":"100%",
|
||||||
|
"height":"100%"
|
||||||
|
},
|
||||||
|
"subwidgets":[
|
||||||
|
{
|
||||||
|
"widgettype":"DynamicColumn",
|
||||||
|
"options":{
|
||||||
|
"css":"filler plaza-grid",
|
||||||
|
"width":"100%"
|
||||||
|
},
|
||||||
|
"subwidgets":[
|
||||||
|
{% for cate in data %}
|
||||||
|
{% for llm in cate.llms %}
|
||||||
|
{% if not ns.first %},{% endif %}
|
||||||
|
{
|
||||||
|
"widgettype":"VScrollPanel",
|
||||||
|
"options":{
|
||||||
|
"css":"card plaza-card",
|
||||||
|
"cwidth":25,
|
||||||
|
"cheight":12
|
||||||
|
},
|
||||||
|
"subwidgets":[
|
||||||
|
{
|
||||||
|
"widgettype":"HBox",
|
||||||
|
"options":{
|
||||||
|
"cheight":2
|
||||||
|
},
|
||||||
|
"subwidgets":[
|
||||||
|
{
|
||||||
|
"widgettype":"Svg",
|
||||||
|
"options":{
|
||||||
|
"rate":1.5,
|
||||||
|
"url":"{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widgettype":"Title6",
|
||||||
|
"options":{
|
||||||
|
"text":"{{llm.name}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widgettype":"Text",
|
||||||
|
"options":{
|
||||||
|
"text":{{json.dumps(llm.description, ensure_ascii=False)}},
|
||||||
|
"wrap":true,
|
||||||
|
"halign":"left"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"binds":[
|
||||||
|
{
|
||||||
|
"wid":"self",
|
||||||
|
"event":"click",
|
||||||
|
"actiontype":"urlwidget",
|
||||||
|
"target":"PopupWindow",
|
||||||
|
"popup_options":{
|
||||||
|
"title":"{{llm.name}}",
|
||||||
|
{% if int(params_kw._is_mobile) %}
|
||||||
|
"width": "100%",
|
||||||
|
"height": "100%"
|
||||||
|
{% else %}
|
||||||
|
"width": "40%",
|
||||||
|
"height":"85%"
|
||||||
|
{% endif %}
|
||||||
|
},
|
||||||
|
"options":{
|
||||||
|
"params":{
|
||||||
|
"id":"{{llm.id}}"
|
||||||
|
},
|
||||||
|
"url":"{{entire_url('./llm_dialog.ui')}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
{% set ns.first = false %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
95
wwwroot/show_llms_cards_by_provider.ui
Normal file
95
wwwroot/show_llms_cards_by_provider.ui
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
{% set providerid = params_kw.get('providerid', None) %}
|
||||||
|
{% set all_data = get_llms_sort_by_provider() %}
|
||||||
|
{% if providerid %}
|
||||||
|
{% set data = [p for p in all_data if p.id == providerid] %}
|
||||||
|
{% else %}
|
||||||
|
{% set data = all_data %}
|
||||||
|
{% endif %}
|
||||||
|
{% set ns = namespace(first=true) %}
|
||||||
|
{
|
||||||
|
"widgettype":"VScrollPanel",
|
||||||
|
"options":{
|
||||||
|
"width":"100%",
|
||||||
|
"height":"100%"
|
||||||
|
},
|
||||||
|
"subwidgets":[
|
||||||
|
{
|
||||||
|
"widgettype":"DynamicColumn",
|
||||||
|
"options":{
|
||||||
|
"css":"filler plaza-grid",
|
||||||
|
"width":"100%"
|
||||||
|
},
|
||||||
|
"subwidgets":[
|
||||||
|
{% for p in data %}
|
||||||
|
{% for llm in p.llms %}
|
||||||
|
{% if not ns.first %},{% endif %}
|
||||||
|
{
|
||||||
|
"widgettype":"VScrollPanel",
|
||||||
|
"options":{
|
||||||
|
"css":"card plaza-card",
|
||||||
|
"cwidth":25,
|
||||||
|
"cheight":12
|
||||||
|
},
|
||||||
|
"subwidgets":[
|
||||||
|
{
|
||||||
|
"widgettype":"HBox",
|
||||||
|
"options":{
|
||||||
|
"cheight":2
|
||||||
|
},
|
||||||
|
"subwidgets":[
|
||||||
|
{
|
||||||
|
"widgettype":"Svg",
|
||||||
|
"options":{
|
||||||
|
"rate":1.5,
|
||||||
|
"url":"{{entire_url('/appbase/show_icon.dspy')}}?id={{llm.iconid}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widgettype":"Title6",
|
||||||
|
"options":{
|
||||||
|
"text":"{{llm.name}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widgettype":"Text",
|
||||||
|
"options":{
|
||||||
|
"text":{{json.dumps(llm.description, ensure_ascii=False)}},
|
||||||
|
"wrap":true,
|
||||||
|
"halign":"left"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"binds":[
|
||||||
|
{
|
||||||
|
"wid":"self",
|
||||||
|
"event":"click",
|
||||||
|
"actiontype":"urlwidget",
|
||||||
|
"target":"PopupWindow",
|
||||||
|
"popup_options":{
|
||||||
|
"title":"{{llm.name}}",
|
||||||
|
{% if int(params_kw._is_mobile) %}
|
||||||
|
"width": "100%",
|
||||||
|
"height": "100%"
|
||||||
|
{% else %}
|
||||||
|
"width": "40%",
|
||||||
|
"height":"85%"
|
||||||
|
{% endif %}
|
||||||
|
},
|
||||||
|
"options":{
|
||||||
|
"params":{
|
||||||
|
"id":"{{llm.id}}"
|
||||||
|
},
|
||||||
|
"url":"{{entire_url('./llm_dialog.ui')}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
{% set ns.first = false %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user