Compare commits
No commits in common. "7545aef6cb2d9da373aa84a3a5705b8659b77b83" and "e820355f7a8c7c49a175f31ab76521261ca274dc" have entirely different histories.
7545aef6cb
...
e820355f7a
118
json/upapp.json
118
json/upapp.json
@ -6,116 +6,6 @@
|
||||
"sortby":"name",
|
||||
"logined_userorgid":"ownerid",
|
||||
"confidential_fields":["secretkey"],
|
||||
"toolbar":{
|
||||
"tools":[
|
||||
{
|
||||
"name":"jumpin",
|
||||
"label":"跳转到",
|
||||
"selected_data":true
|
||||
},
|
||||
{
|
||||
"selected_row":true,
|
||||
"name":"upappkey",
|
||||
"icon":"{{entire_url('/imgs/upappkey.svg')}}",
|
||||
"label":"APIKEY"
|
||||
},
|
||||
{
|
||||
"selected_row":true,
|
||||
"name":"uapi",
|
||||
"icon":"{{entire_url('/imgs/uapi.svg')}}",
|
||||
"label":"API"
|
||||
},
|
||||
{
|
||||
"selected_row":true,
|
||||
"name":"copy_api",
|
||||
"label":"复制API"
|
||||
}
|
||||
]
|
||||
},
|
||||
"binds":[
|
||||
{
|
||||
"wid":"self",
|
||||
"event":"jumpin",
|
||||
"actiontype":"urlwidget",
|
||||
"target":"self",
|
||||
"options":{
|
||||
"url":"{{entire_url('/uapi/jump_in.dspy')}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"wid":"self",
|
||||
"event":"upappkey",
|
||||
"actiontype":"urlwidget",
|
||||
"target":"PopupWindow",
|
||||
"popup_options":{
|
||||
"title":"APIKEY",
|
||||
"icon":"{{entire_url('/appbase/get_icon.dspy')}}?id=upappkey",
|
||||
"resizable":true,
|
||||
"height":"70%",
|
||||
"width":"70%"
|
||||
},
|
||||
"params_mapping":{
|
||||
"mapping":{
|
||||
"id":"upappid",
|
||||
"referer_widget":"referer_widget"
|
||||
},
|
||||
"need_other":false
|
||||
},
|
||||
"options":{
|
||||
"method":"POST",
|
||||
"params":{},
|
||||
"url":"{{entire_url('../upappkey')}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"wid":"self",
|
||||
"event":"uapi",
|
||||
"actiontype":"urlwidget",
|
||||
"target":"PopupWindow",
|
||||
"popup_options":{
|
||||
"title":"API",
|
||||
"icon":"{{entire_url('/appbase/get_icon.dspy')}}?id=uapi",
|
||||
"resizable":true,
|
||||
"height":"70%",
|
||||
"width":"70%"
|
||||
},
|
||||
"params_mapping":{
|
||||
"mapping":{
|
||||
"id":"upappid",
|
||||
"referer_widget":"referer_widget"
|
||||
},
|
||||
"need_other":false
|
||||
},
|
||||
"options":{
|
||||
"method":"POST",
|
||||
"params":{},
|
||||
"url":"{{entire_url('../uapi')}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"wid":"self",
|
||||
"event":"copy_api",
|
||||
"actiontype":"urlwidget",
|
||||
"target":"PopupWindow",
|
||||
"popup_options":{
|
||||
"title":"复制API到其他上位系统",
|
||||
"dismiss_events":["cancel","submited"],
|
||||
"height":"auto",
|
||||
"width":"500px"
|
||||
},
|
||||
"params_mapping":{
|
||||
"mapping":{
|
||||
"id":"upappid"
|
||||
},
|
||||
"need_other":false
|
||||
},
|
||||
"options":{
|
||||
"method":"GET",
|
||||
"params":{},
|
||||
"url":"{{entire_url('../copy_uapi.ui')}}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"browserfields":{
|
||||
"exclouded":["ownerid"],
|
||||
"alters":{}
|
||||
@ -124,13 +14,13 @@
|
||||
"subtables":[
|
||||
{
|
||||
"field":"upappid",
|
||||
"subtable":"upappkey",
|
||||
"title":"APIKEY"
|
||||
"subtable": "upappkey",
|
||||
"title": "APIKEY"
|
||||
},
|
||||
{
|
||||
"field":"upappid",
|
||||
"subtable":"uapi",
|
||||
"title":"API"
|
||||
"subtable": "uapi",
|
||||
"title": "API"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -34,6 +34,12 @@
|
||||
"length": 32,
|
||||
"nullable": "yes"
|
||||
},
|
||||
{
|
||||
"name": "apisetid",
|
||||
"title": "api集id",
|
||||
"type": "str",
|
||||
"length": 32
|
||||
},
|
||||
{
|
||||
"name": "secretkey",
|
||||
"title": "加密密钥",
|
||||
@ -74,4 +80,4 @@
|
||||
"textfield": "orgname"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -23,8 +23,6 @@ paths = [
|
||||
("/uapi/minimax_callback.dspy", "any"),
|
||||
("/uapi/uptask_callback.dspy", "any"),
|
||||
("/uapi/viducallback", "any"),
|
||||
("/uapi/copy_uapi.ui", "logined"),
|
||||
("/uapi/api/copy_uapi.dspy", "logined"),
|
||||
]
|
||||
|
||||
|
||||
|
||||
15
uapi/init.py
15
uapi/init.py
@ -1,5 +1,4 @@
|
||||
from ahserver.serverenv import ServerEnv
|
||||
from sqlor.dbpools import get_sor_context
|
||||
from .appapi import (
|
||||
UAPI,
|
||||
deerer,
|
||||
@ -18,19 +17,6 @@ from .uptask import (
|
||||
from .uapi import UpAppApi
|
||||
from .apidata import UAPIData
|
||||
|
||||
async def get_upapps_for_copy(request):
|
||||
"""获取所有upapp供复制API时选择目标(排除源upapp)"""
|
||||
source_upappid = (request._run_ns.params_kw or {}).get('upappid', '')
|
||||
env = ServerEnv()
|
||||
async with get_sor_context(env, 'uapi') as sor:
|
||||
sql = "select id as value, name as text from upapp"
|
||||
ns = {}
|
||||
if source_upappid:
|
||||
sql += " where id != ${source_upappid}$"
|
||||
ns['source_upappid'] = source_upappid
|
||||
recs = await sor.sqlExe(sql, ns)
|
||||
return recs
|
||||
|
||||
def load_uapi():
|
||||
g = ServerEnv()
|
||||
g.UAPI = UAPI
|
||||
@ -46,7 +32,6 @@ def load_uapi():
|
||||
g.get_my_uptasks = get_my_uptasks
|
||||
g.uptask_feedback = uptask_feedback
|
||||
g.uptask_started = uptask_started
|
||||
g.get_upapps_for_copy = get_upapps_for_copy
|
||||
# Bind hot_reload event — instance method, WeakMethod safe (stored on g)
|
||||
if hasattr(g, 'event_dispatcher'):
|
||||
g.event_dispatcher.bind('hot_reload', g.uapi_data.on_hot_reload)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user