根因:TabPanel tab content通过urlwidget加载show_llms.ui时, urlwidget渲染后替换自身DOM,导致plaza_cards_panel的id丢失, getWidgetById()返回null。 修复:将左右分栏布局直接内联到model_plaza.ui的TabPanel tab content中, plaza_cards_panel改为VBox容器(保持id),初始内容通过子urlwidget加载, 点击导航按钮时用mode:replace替换VBox内容。
222 lines
5.0 KiB
XML
222 lines
5.0 KiB
XML
{% set catelogs = get_llmcatelogs() %}
|
|
{% set providers = get_llms_sort_by_provider() %}
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"css": "filler",
|
|
"width": "100%"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"css": "plaza-header",
|
|
"width": "100%"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Title2",
|
|
"options": {
|
|
"otext": "模型广场",
|
|
"i18n": true,
|
|
"halign": "left"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Text",
|
|
"options": {
|
|
"otext": "探索和使用各类AI模型",
|
|
"i18n": true,
|
|
"halign": "left",
|
|
"wrap": true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "TabPanel",
|
|
"id": "plaza_tabs",
|
|
"options": {
|
|
"css": "filler plaza-tabs",
|
|
"tab_pos": "top",
|
|
"items": [
|
|
{
|
|
"name": "by_catelog",
|
|
"label": "按分类",
|
|
"content": {
|
|
"widgettype": "HBox",
|
|
"options": {
|
|
"css": "filler",
|
|
"width": "100%",
|
|
"height": "100%"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "VScrollPanel",
|
|
"options": {
|
|
"cwidth": 18,
|
|
"height": "100%",
|
|
"css": "plaza-sidebar"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Button",
|
|
"options": {
|
|
"label": "全部",
|
|
"css": "plaza-nav-btn",
|
|
"width": "100%"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "click",
|
|
"actiontype": "urlwidget",
|
|
"target": "app.plaza_cards_panel",
|
|
"mode": "replace",
|
|
"options": {
|
|
"url": "{{entire_url('show_llms_cards.ui')}}"
|
|
}
|
|
}
|
|
]
|
|
}{% for cat in catelogs %},
|
|
{
|
|
"widgettype": "Button",
|
|
"options": {
|
|
"label": "{{cat.name}}",
|
|
"css": "plaza-nav-btn",
|
|
"width": "100%"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "click",
|
|
"actiontype": "urlwidget",
|
|
"target": "app.plaza_cards_panel",
|
|
"mode": "replace",
|
|
"options": {
|
|
"url": "{{entire_url('show_llms_cards.ui')}}",
|
|
"params": {
|
|
"catelogid": "{{cat.id}}"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}{% endfor %}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"id": "plaza_cards_panel",
|
|
"options": {
|
|
"css": "filler",
|
|
"cwidth": 82,
|
|
"height": "100%"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "urlwidget",
|
|
"options": {
|
|
"css": "filler",
|
|
"width": "100%",
|
|
"height": "100%",
|
|
"url": "{{entire_url('show_llms_cards.ui')}}"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "by_provider",
|
|
"label": "按供应商",
|
|
"content": {
|
|
"widgettype": "HBox",
|
|
"options": {
|
|
"css": "filler",
|
|
"width": "100%",
|
|
"height": "100%"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "VScrollPanel",
|
|
"options": {
|
|
"cwidth": 18,
|
|
"height": "100%",
|
|
"css": "plaza-sidebar"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Button",
|
|
"options": {
|
|
"label": "全部",
|
|
"css": "plaza-nav-btn",
|
|
"width": "100%"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "click",
|
|
"actiontype": "urlwidget",
|
|
"target": "app.plaza_provider_panel",
|
|
"mode": "replace",
|
|
"options": {
|
|
"url": "{{entire_url('show_llms_cards_by_provider.ui')}}"
|
|
}
|
|
}
|
|
]
|
|
}{% for p in providers %},
|
|
{
|
|
"widgettype": "Button",
|
|
"options": {
|
|
"label": "{{p.orgname}}",
|
|
"css": "plaza-nav-btn",
|
|
"width": "100%"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "click",
|
|
"actiontype": "urlwidget",
|
|
"target": "app.plaza_provider_panel",
|
|
"mode": "replace",
|
|
"options": {
|
|
"url": "{{entire_url('show_llms_cards_by_provider.ui')}}",
|
|
"params": {
|
|
"providerid": "{{p.id}}"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}{% endfor %}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "VBox",
|
|
"id": "plaza_provider_panel",
|
|
"options": {
|
|
"css": "filler",
|
|
"cwidth": 82,
|
|
"height": "100%"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "urlwidget",
|
|
"options": {
|
|
"css": "filler",
|
|
"width": "100%",
|
|
"height": "100%",
|
|
"url": "{{entire_url('show_llms_cards_by_provider.ui')}}"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|