cpcc/wwwroot/components/add_components.dspy
2025-07-16 14:32:09 +08:00

35 lines
621 B
Plaintext

ns = params_kw.copy()
id = params_kw.id
if not id or len(id) > 32:
id = uuid()
ns['id'] = id
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.C('components', ns.copy())
return {
"widgettype":"Message",
"options":{
"user_data":ns,
"cwidth":16,
"cheight":9,
"title":"Add Success",
"timeout":3,
"message":"ok"
}
}
return {
"widgettype":"Error",
"options":{
"title":"Add Error",
"cwidth":16,
"cheight":9,
"timeout":3,
"message":"failed"
}
}