This commit is contained in:
yumoqing 2025-07-31 18:38:38 +08:00
parent 045eea4cd6
commit d2d62acc26
2 changed files with 42 additions and 5 deletions

View File

@ -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')}}"
}
]

View File

@ -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'
}
}