From 960edc25819c680cf9a842fae963a130855f4b8c Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 29 Jul 2026 15:23:33 +0800 Subject: [PATCH] fix: DSPY cate.llms->cate['llms'], return {total,data} for DataViewer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DataViewer/PageDataLoader expects {total:N, data:[...]} format. Bare array causes d.total=undefined → NaN → infinite paging loop. Also fixes same cate.llms attribute access bug from before. --- wwwroot/api/get_plaza_models.dspy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wwwroot/api/get_plaza_models.dspy b/wwwroot/api/get_plaza_models.dspy index ebda296..ab541ea 100644 --- a/wwwroot/api/get_plaza_models.dspy +++ b/wwwroot/api/get_plaza_models.dspy @@ -11,11 +11,14 @@ data = await request._run_ns.get_llms_by_catelog_to_customer( result = [] for cate in data: - for llm in cate.llms: + for llm in cate['llms']: if providerid and llm.providerid != providerid: continue - if search and search.lower() not in (llm.name or '').lower(): - if search.lower() not in (llm.description or '').lower(): + if search: + sl = search.lower() + n = (llm.name or '').lower() + d = (llm.description or '').lower() + if sl not in n and sl not in d: continue result.append({ 'id': llm.id, @@ -30,4 +33,4 @@ for cate in data: 'pricing_display': getattr(llm, 'pricing_display', []), }) -return json.dumps(result, ensure_ascii=False) +return json.dumps({'total': len(result), 'data': result}, ensure_ascii=False)