bugfix
This commit is contained in:
parent
df126dfdf6
commit
4664d2b353
28
wwwroot/ws/connecthost.xterm
Normal file
28
wwwroot/ws/connecthost.xterm
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
debug(f'{params_kw=},')
|
||||||
|
async def gethostinfo(sor, ns):
|
||||||
|
sql="""select a.*
|
||||||
|
from hostdev a
|
||||||
|
where a.id= ${id}$
|
||||||
|
"""
|
||||||
|
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
|
||||||
Loading…
x
Reference in New Issue
Block a user