From 2b30a3f0dcddfd41630ca5b9a8bdaa0e81c7047d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 1 Jun 2026 11:56:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A8=A1=E5=9E=8B=E5=B9=BF=E5=9C=BA?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=B7=A6=E5=8F=B3=E5=88=86=E6=A0=8F=E5=B8=83?= =?UTF-8?q?=E5=B1=80=EF=BC=8C=E5=B7=A6=E4=BE=A7=E5=88=86=E7=B1=BB/?= =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E5=AF=BC=E8=88=AA=EF=BC=8C=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E6=A8=A1=E5=9E=8B=E5=8D=A1=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/model_plaza.css | 18 +++- wwwroot/show_llms.ui | 139 ++++++++++--------------- wwwroot/show_llms_by_providers.ui | 138 ++++++++++-------------- wwwroot/show_llms_cards.ui | 90 ++++++++++++++++ wwwroot/show_llms_cards_by_provider.ui | 95 +++++++++++++++++ 5 files changed, 308 insertions(+), 172 deletions(-) create mode 100644 wwwroot/show_llms_cards.ui create mode 100644 wwwroot/show_llms_cards_by_provider.ui diff --git a/wwwroot/model_plaza.css b/wwwroot/model_plaza.css index 2ffd29c..f189e27 100644 --- a/wwwroot/model_plaza.css +++ b/wwwroot/model_plaza.css @@ -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 */ diff --git a/wwwroot/show_llms.ui b/wwwroot/show_llms.ui index 739ee8c..eec80f9 100644 --- a/wwwroot/show_llms.ui +++ b/wwwroot/show_llms.ui @@ -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')}}" + } + } ] } diff --git a/wwwroot/show_llms_by_providers.ui b/wwwroot/show_llms_by_providers.ui index fb50657..8265850 100644 --- a/wwwroot/show_llms_by_providers.ui +++ b/wwwroot/show_llms_by_providers.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')}}" + } + } ] } diff --git a/wwwroot/show_llms_cards.ui b/wwwroot/show_llms_cards.ui new file mode 100644 index 0000000..31b073c --- /dev/null +++ b/wwwroot/show_llms_cards.ui @@ -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 %} + ] + } + ] +} diff --git a/wwwroot/show_llms_cards_by_provider.ui b/wwwroot/show_llms_cards_by_provider.ui new file mode 100644 index 0000000..11791ce --- /dev/null +++ b/wwwroot/show_llms_cards_by_provider.ui @@ -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 %} + ] + } + ] +}