From d2d62acc26f3c87cbde27909be3bc1ffa3988771 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 31 Jul 2025 18:38:38 +0800 Subject: [PATCH] bugfix --- json/downapp.json | 4 ++-- wwwroot/copy_apikey.dspy | 43 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/json/downapp.json b/json/downapp.json index a1e78bf..94d98d5 100644 --- a/json/downapp.json +++ b/json/downapp.json @@ -4,13 +4,12 @@ "params": { "sortby":"id", "confidential_fields":["secretkey"], - "noedit":true, "browserfields": { "exclouded": ["id", "secretkey", "orgid" ], "alters": {} }, "editexclouded": [ - + "id", "secretkey", "orgid" ], "toolbar":{ "tools":[ @@ -22,6 +21,7 @@ { "name":"copy_apikey", "label":"复制apikey", + "selected_row":true, "icon":"{{entire_url('/imgs/copy.svg')}}" } ] diff --git a/wwwroot/copy_apikey.dspy b/wwwroot/copy_apikey.dspy index 867a20b..13957ba 100644 --- a/wwwroot/copy_apikey.dspy +++ b/wwwroot/copy_apikey.dspy @@ -7,7 +7,7 @@ async with db.sqlorContext(dbname) as sor: ns = { "id": params_kw.id, "orgid":orgid, - "userid":"userid + "userid":userid } sql = """select a.*, b.apikey @@ -19,5 +19,42 @@ where a.id = b.dappid recs = await sor.sqlExe(sql, ns) if len(recs): r = recs[0] - return UiMessage(title="copy apikey", message=f"appid={r.id}, apikey={r.apikey} secretkey={r.secretkey}") -return UiError(title='copy apikey', message='copy apikey error') + return { + "widgettype":"VBox", + "options":{ + "height":"100%", + "width":"100%" + }, + "subwidgets":[ + { + "widgettype":"Text", + "options":{ + "wrap":True, + "halign":"left", + "text":f"appid={r.dappid}" + } + }, + { + "widgettype":"Text", + "options":{ + "wrap":True, + "halign":"left", + "text":f"apikey={r.apikey}" + } + }, + { + "widgettype":"Text", + "options":{ + "wrap":True, + "halign":"left", + "text":f"secretkey={r.secretkey}" + } + } + ] + } +return { + "widgettype":"Text", + "options":{ + "text":'copy apikey error' + } +}