From 6a212457c4d82a3e7ec0b703744aa52a434eb14c Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 25 Aug 2025 17:17:58 +0800 Subject: [PATCH] bugfix --- wwwroot/connecthost.xterm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 wwwroot/connecthost.xterm diff --git a/wwwroot/connecthost.xterm b/wwwroot/connecthost.xterm new file mode 100644 index 0000000..5393813 --- /dev/null +++ b/wwwroot/connecthost.xterm @@ -0,0 +1,29 @@ +debug(f'{params_kw=},') +async def gethostinfo(sor, ns): + sql="""select a.* +from hostdev a +where a.id= ${id}$ + and a.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