This commit is contained in:
yumoqing 2025-08-19 10:50:04 +08:00
parent 75ca27b663
commit d55b802d95
2 changed files with 1 additions and 31 deletions

View File

@ -17,7 +17,7 @@
"term_options":{ "term_options":{
"fontSize":24 "fontSize":24
}, },
"ws_url":"{{entire_url('/wss/ws/connecthost.xterm')}}?hostid={{params_kw.id}}" "ws_url":"{{entire_url('/wss/msp/connecthost.xterm')}}?hostid={{params_kw.id}}"
} }
} }
} }

View File

@ -1,30 +0,0 @@
debug(f'{params_kw=},')
userid = await get_user()
async def gethostinfo(sor, ns):
sql="""select a.*
from hostdev a
where a.id= ${id}$
and ownerid=${userid}
"""
recs = await sor.sqlExe(sql,ns.copy())
if len(recs) > 0:
r = recs[0]
r.username = r.user
if r.password:
r.password = password_decode(r.password)
if r.passphrase:
r.passphrase = password_decode(r.passphrase)
if r.jumperid:
r.jumperservers = await gethostinfo(sor, {'id':r.jumperid})
return DictObject(**r)
db = DBPools()
userid = await get_user()
dbname = get_module_dbname('msp')
async with db.sqlorContext(dbname) as sor:
ns = {
"ownerid":userid,
"id":params_kw.hostid
}
return await gethostinfo(sor, ns)
return None