This commit is contained in:
yumoqing 2025-10-14 14:54:24 +08:00
parent 461411af79
commit 4504e76623
2 changed files with 57 additions and 0 deletions

25
wwwroot/sagelog.ui Normal file
View File

@ -0,0 +1,25 @@
{
"widgettype":"PopupWindow",
"options":{
"auto_open":true,
"auto_destroy":true,
"archor":"cc",
"cwidth":45,
"cheight":40,
"movable":true,
"icon":"{{entire_url('imgs/terminal.svg')}}",
"title":"大平台日志",
"content":{
"widgettype":"Wterm",
"options":{
"height":"100%",
"width":"100%",
"term_options":{
"fontSize":24
},
"ws_url":"{{entire_url('/wss/msp/sagelog.xterm')}}?id=none"
}
}
}
}

32
wwwroot/sagelog.xterm Normal file
View File

@ -0,0 +1,32 @@
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.client_key:
r.client_keys = [password_decode(r.client_key)]
if r.passwd:
r.password = password_decode(r.passwd)
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 = {
"id":"JFWxNcA_wsdFJ4ZO-4PKr"
}
r = await gethostinfo(sor, ns)
r.cmdargs = [ "~/bin/sagelog" ]
r.noinput = True
return r
return None