feat: 模型广场改为左右分栏布局,左侧分类/供应商导航,右侧模型卡片
This commit is contained in:
parent
cfa355a7a5
commit
2b30a3f0dc
@ -17,6 +17,22 @@
|
||||
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 */
|
||||
.plaza-card {
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
@ -50,7 +66,7 @@
|
||||
/* Smooth card grid */
|
||||
.plaza-grid {
|
||||
gap: 12px !important;
|
||||
padding: 4px 0;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
/* Model icon area */
|
||||
|
||||
@ -1,105 +1,72 @@
|
||||
{% set userorgid = get_userorgid() %}
|
||||
{% set catelogs = get_llmcatelogs() %}
|
||||
{
|
||||
"widgettype":"VScrollPanel",
|
||||
"widgettype":"HBox",
|
||||
"options":{
|
||||
"width":"100%",
|
||||
"height":"100%"
|
||||
},
|
||||
"subwidgets":[
|
||||
{% for cate in get_llms_by_catelog() %}
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"widgettype":"VScrollPanel",
|
||||
"options":{
|
||||
"width":"100%"
|
||||
"cwidth":18,
|
||||
"height":"100%",
|
||||
"css":"plaza-sidebar"
|
||||
},
|
||||
"subwidgets":[
|
||||
{
|
||||
"widgettype":"Title3",
|
||||
"widgettype":"Button",
|
||||
"options":{
|
||||
"wrap":true,
|
||||
"halign": "left",
|
||||
"i18n": true,
|
||||
"otext":"{{cate.catelogname}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype":"DynamicColumn",
|
||||
"options":{
|
||||
"css":"filler plaza-grid",
|
||||
"label":"全部",
|
||||
"css":"plaza-nav-btn",
|
||||
"width":"100%"
|
||||
},
|
||||
"subwidgets":[
|
||||
{% for llm in cate.llms %}
|
||||
{
|
||||
"widgettype":"VScrollPanel",
|
||||
"options":{
|
||||
"css":"card plaza-card",
|
||||
"cwidth":20,
|
||||
"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')}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
"binds":[
|
||||
{
|
||||
"wid":"self",
|
||||
"event":"click",
|
||||
"actiontype":"urlwidget",
|
||||
"target":"plaza_cards_panel",
|
||||
"options":{
|
||||
"url":"{{entire_url('show_llms_cards.ui')}}"
|
||||
}
|
||||
}
|
||||
{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{% if not loop.last %}, {% endif %}
|
||||
},
|
||||
{% for cat in catelogs %}
|
||||
{
|
||||
"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 %}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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":{
|
||||
"width":"100%",
|
||||
"height":"100%"
|
||||
},
|
||||
"subwidgets":[
|
||||
{% for p in get_llms_sort_by_provider() %}
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"widgettype":"VScrollPanel",
|
||||
"options":{
|
||||
"width":"100%"
|
||||
"cwidth":18,
|
||||
"height":"100%",
|
||||
"css":"plaza-sidebar"
|
||||
},
|
||||
"subwidgets":[
|
||||
{
|
||||
"widgettype":"Title3",
|
||||
"widgettype":"Button",
|
||||
"options":{
|
||||
"wrap":true,
|
||||
"halign": "left",
|
||||
"text":"{{p.orgname}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype":"DynamicColumn",
|
||||
"options":{
|
||||
"css":"filler plaza-grid",
|
||||
"label":"全部",
|
||||
"css":"plaza-nav-btn",
|
||||
"width":"100%"
|
||||
},
|
||||
"subwidgets":[
|
||||
{% for llm in p.llms %}
|
||||
{
|
||||
"widgettype":"VScrollPanel",
|
||||
"options":{
|
||||
"css":"card plaza-card",
|
||||
"cwidth":20,
|
||||
"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')}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
"binds":[
|
||||
{
|
||||
"wid":"self",
|
||||
"event":"click",
|
||||
"actiontype":"urlwidget",
|
||||
"target":"plaza_provider_panel",
|
||||
"options":{
|
||||
"url":"{{entire_url('show_llms_cards_by_provider.ui')}}"
|
||||
}
|
||||
}
|
||||
{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{% if not loop.last %}, {% endif %}
|
||||
},
|
||||
{% for p in providers %}
|
||||
{
|
||||
"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 %}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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