refactor: update CRUD dspy and UI files

This commit is contained in:
yumoqing 2026-05-29 18:25:40 +08:00
parent 4ea407c60b
commit b41dc0a02d
20 changed files with 889 additions and 854 deletions

View File

@ -1,5 +1,8 @@
ns = params_kw.copy()
for k,v in ns.items():
if v == 'NaN' or v == 'null':
ns[k] = None
id = params_kw.id
if not id or len(id) > 32:
id = uuid()
@ -8,13 +11,12 @@ ns['id'] = id
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = 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",

View File

@ -5,7 +5,7 @@ ns = {
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.D('components', ns)
debug('delete success');

View File

@ -15,8 +15,7 @@ from (select * from components where 1=1 [[filterstr]]) a left join (select k as
v as ccatelogid_text from appcodes_kv where parentid='ccatelog') b on a.ccatelogid = b.ccatelogid'''
filterjson = params_kw.get('data_filter')
if not filterjson:
fields = [ f['name'] for f in [
fields_str=r'''[
{
"name": "id",
"title": "id",
@ -52,7 +51,10 @@ if not filterjson:
"title": "计量值",
"type": "short"
}
] ]
]'''
ori_fields = json.loads(fields_str)
if not filterjson:
fields = [ f['name'] for f in ori_fields ]
filterjson = default_filterjson(fields, ns)
filterdic = ns.copy()
filterdic['filterstr'] = ''
@ -73,7 +75,7 @@ sql = ac.convert(sql, filterdic)
debug(f'{sql=}')
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.sqlPaging(sql, ns)
return r

View File

@ -3,6 +3,8 @@
"id":"components_tbl",
"widgettype":"Tabular",
"options":{
"width":"100%",
"height":"100%",
"title":"部件表",
@ -12,14 +14,22 @@
"css":"card",
"editable":{
"new_data_url":"{{entire_url('add_components.dspy')}}",
"delete_data_url":"{{entire_url('delete_components.dspy')}}",
"update_data_url":"{{entire_url('update_components.dspy')}}"
},
"data_url":"{{entire_url('./get_components.dspy')}}",
"data_method":"GET",
"data_params":{{json.dumps(params_kw, indent=4, ensure_ascii=False)}},
"row_options":{
@ -69,7 +79,7 @@
"valueField": "ccatelogid",
"textField": "ccatelogid_text",
"params": {
"dbname": "{{rfexe('get_module_dbname', 'cpcc')}}",
"dbname": "{{get_module_dbname('cpcc')}}",
"table": "appcodes_kv",
"tblvalue": "k",
"tbltext": "v",

View File

@ -1,12 +1,16 @@
ns = params_kw.copy()
for k,v in ns.items():
if v == 'NaN' or v == 'null':
ns[k] = None
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.U('components', ns)
debug('update success');
return {

View File

@ -1,5 +1,8 @@
ns = params_kw.copy()
for k,v in ns.items():
if v == 'NaN' or v == 'null':
ns[k] = None
id = params_kw.id
if not id or len(id) > 32:
id = uuid()
@ -8,13 +11,12 @@ ns['id'] = id
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.C('cpccluster', ns.copy())
return {
"widgettype":"Message",
"options":{
"user_data":ns,
"cwidth":16,
"cheight":9,
"title":"Add Success",

View File

@ -5,7 +5,7 @@ ns = {
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.D('cpccluster', ns)
debug('delete success');
@ -16,7 +16,7 @@ async with db.sqlorContext(dbname) as sor:
"timeout":3,
"cwidth":16,
"cheight":9,
"message":"ok记得把关联的节点都解除占用状态 ~"
"message":"ok"
}
}

View File

@ -9,14 +9,14 @@ if not ns.get('sort'):
ns['sort'] = 'id'
sql = '''select a.*, b.clustertype_text, c.controllerid_text
from (select * from cpccluster where 1=1 [[filterstr]]) a left join (select k as clustertype,
v as clustertype_text from appcodes_kv where parentid='clustertype') b on a.clustertype = b.clustertype left join (select id as controllerid,
ip as controllerid_text from cpcnode where 1 = 1) c on a.controllerid = c.controllerid'''
name as controllerid_text from hostdev where 1 = 1) c on a.controllerid = c.controllerid'''
filterjson = params_kw.get('data_filter')
if not filterjson:
fields = [ f['name'] for f in [
fields_str=r'''[
{
"name": "id",
"title": "id",
@ -60,7 +60,10 @@ if not filterjson:
"type": "date",
"length": 255
}
] ]
]'''
ori_fields = json.loads(fields_str)
if not filterjson:
fields = [ f['name'] for f in ori_fields ]
filterjson = default_filterjson(fields, ns)
filterdic = ns.copy()
filterdic['filterstr'] = ''
@ -81,7 +84,7 @@ sql = ac.convert(sql, filterdic)
debug(f'{sql=}')
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.sqlPaging(sql, ns)
return r

View File

@ -1,77 +1,56 @@
{
"id":"cpccluster_tbl",
"widgettype":"Tabular",
"options":{
"width":"100%",
"height":"100%",
"title":"算力集群",
"css":"card",
"toolbar": {
"tools": [
{
"name": "newworker",
"selected_row": true,
"label": "新增工作节点"
},
{
"name": "newpodyaml",
"selected_row": true,
"label": "新建资源YAML"
}
],
"css": "float-right"
},
"editable":{
"new_data_url":"{{entire_url('add_cpccluster.dspy')}}",
"delete_data_url":"{{entire_url('delete_cpccluster.dspy')}}",
"update_data_url":"{{entire_url('update_cpccluster.dspy')}}"
},
"data_url":"{{entire_url('./get_cpccluster.dspy')}}",
"data_method":"GET",
"data_params":{{json.dumps(params_kw, indent=4, ensure_ascii=False)}},
"row_options":{
"browserfields": {
"exclouded": [
"id",
"cpcid",
"clusterid"
"cpcid"
],
"alters": {}
},
"editexclouded":[
"id",
"cpcid",
"clusterid"
"cpcid"
],
"fields":[
{
"name": "name",
"title": "集群名称",
"type": "str",
"length": 255,
"cwidth": 14,
"uitype": "str",
"datatype": "str",
"label": "集群名称"
},
{
"name": "controllerid",
"title": "控制节点IP",
"type": "str",
"length": 32,
"cwidth": 12,
"label": "控制节点IP",
"uitype": "code",
"valueField": "controllerid",
"textField": "controllerid_text",
"params": {
"dbname": "{{rfexe('get_module_dbname', 'cpcc')}}",
"table": "cpcnode",
"tblvalue": "id",
"tbltext": "name",
"valueField": "controllerid",
"textField": "controllerid_text"
},
"dataurl": "{{entire_url('/appbase/get_code.dspy')}}"
},
{
"name": "id",
"title": "id",
@ -82,13 +61,23 @@
"datatype": "str",
"label": "id"
},
{
"name": "name",
"title": "名称",
"type": "str",
"length": 255,
"cwidth": 18,
"uitype": "str",
"datatype": "str",
"label": "名称"
},
{
"name": "cpcid",
"title": "算力中心id",
"type": "str",
"length": 32,
"nullable": "no",
"cwidth": 10,
"cwidth": 18,
"uitype": "str",
"datatype": "str",
"label": "算力中心id"
@ -98,13 +87,12 @@
"title": "集群类型",
"type": "str",
"length": 1,
"cwidth": 8,
"label": "集群类型",
"uitype": "code",
"valueField": "clustertype",
"textField": "clustertype_text",
"params": {
"dbname": "{{rfexe('get_module_dbname', 'cpcc')}}",
"dbname": "{{get_module_dbname('cpcc')}}",
"table": "appcodes_kv",
"tblvalue": "k",
"tbltext": "v",
@ -115,21 +103,30 @@
"dataurl": "{{entire_url('/appbase/get_code.dspy')}}"
},
{
"name": "clusterjoin",
"title": "加入集群凭证",
"name": "controllerid",
"title": "控制节点id",
"type": "str",
"length": 255,
"cwidth": 45,
"uitype": "str",
"datatype": "str",
"label": "加入集群凭证"
"length": 32,
"label": "控制节点id",
"uitype": "code",
"valueField": "controllerid",
"textField": "controllerid_text",
"params": {
"dbname": "{{get_module_dbname('cpcc')}}",
"table": "hostdev",
"tblvalue": "id",
"tbltext": "name",
"valueField": "controllerid",
"textField": "controllerid_text"
},
"dataurl": "{{entire_url('/appbase/get_code.dspy')}}"
},
{
"name": "enable_date",
"title": "启用日期",
"type": "date",
"length": 0,
"cwidth": 8,
"cwidth": 18,
"uitype": "date",
"datatype": "date",
"label": "启用日期"
@ -139,101 +136,20 @@
"title": "停用日期",
"type": "date",
"length": 0,
"cwidth": 8,
"cwidth": 18,
"uitype": "date",
"datatype": "date",
"label": "停用日期"
}
]
},
"content_view": {
"widgettype": "TabPanel",
"options": {
"tab_wide": "auto",
"height": "100%",
"width": "100%",
"tab_pos": "top",
"items": [
{
"name": "cpcpod",
"label": "实时资源实例",
"content": {
"widgettype": "urlwidget",
"options": {
"params": {
"clusterid": "${id}",
"cpcid": "${cpcid}"
},
"url": "{{entire_url('..\/cpcpod')}}"
}
}
},
{
"name": "cpcworker",
"label": "实时集群节点",
"content": {
"widgettype": "urlwidget",
"options": {
"params": {
"clusterid": "${id}",
"cpcid": "${cpcid}"
},
"url": "{{entire_url('..\/cpcworker')}}"
}
}
},
{
"name": "cpcyamlconfig",
"label": "资源实例配置",
"content": {
"widgettype": "urlwidget",
"options": {
"params": {
"clusterid": "${id}",
"cpcid": "${cpcid}"
},
"url": "{{entire_url('..\/cpcpodyaml')}}"
}
}
}
]
}
},
"page_rows":160,
"cache_limit":5
},
"binds": [
{
"wid": "self",
"event": "newworker",
"actiontype": "urlwidget",
"target": "PopupWindow",
"popup_options": {
"width": "80%",
"height": "80%"
},
"options": {
"url": "{{entire_url('../cpcworker/new_worker.ui')}}",
"params": {
"id": "{{params_kw.id}}"
}
}
},
{
"wid": "self",
"event": "newpodyaml",
"actiontype": "urlwidget",
"target": "PopupWindow",
"popup_options": {
"width": "80%",
"height": "80%"
},
"options": {
"url": "{{entire_url('../cpcpod/new_podyaml.ui')}}",
"params": {
"id": "{{params_kw.id}}"
}
}
}
]
,"binds":[]
}

View File

@ -1,12 +1,16 @@
ns = params_kw.copy()
for k,v in ns.items():
if v == 'NaN' or v == 'null':
ns[k] = None
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.U('cpccluster', ns)
debug('update success');
return {

View File

@ -1,5 +1,8 @@
ns = params_kw.copy()
for k,v in ns.items():
if v == 'NaN' or v == 'null':
ns[k] = None
id = params_kw.id
if not id or len(id) > 32:
id = uuid()
@ -25,13 +28,12 @@ if not userorgid:
ns['orgid'] = userorgid
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.C('cpclist', ns.copy())
return {
"widgettype":"Message",
"options":{
"user_data":ns,
"cwidth":16,
"cheight":9,
"title":"Add Success",

View File

@ -19,7 +19,7 @@ if not userorgid:
ns['orgid'] = userorgid
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.D('cpclist', ns)
debug('delete success');

View File

@ -30,8 +30,7 @@ from (select * from cpclist where 1=1 [[filterstr]]) a left join (select id as o
orgname as orgid_text from organization where 1 = 1) b on a.orgid = b.orgid'''
filterjson = params_kw.get('data_filter')
if not filterjson:
fields = [ f['name'] for f in [
fields_str=r'''[
{
"name": "id",
"title": "id",
@ -92,7 +91,10 @@ if not filterjson:
"type": "str",
"length": 100
}
] ]
]'''
ori_fields = json.loads(fields_str)
if not filterjson:
fields = [ f['name'] for f in ori_fields ]
filterjson = default_filterjson(fields, ns)
filterdic = ns.copy()
filterdic['filterstr'] = ''
@ -113,7 +115,7 @@ sql = ac.convert(sql, filterdic)
debug(f'{sql=}')
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.sqlPaging(sql, ns)
return r

View File

@ -1,27 +1,63 @@
{
"id":"cpclist_tbl",
"widgettype":"Tabular",
"options":{
"width":"100%",
"height":"100%",
"title":"算力中心列表",
"toolbar":{
"tools": [
{
"name": "newcluster",
"selected_row": true,
"label": "新建集群"
},
{
"selected_row": true,
"name": "cpccluster",
"icon": "{{entire_url('/imgs/cpccluster.svg')}}",
"label": "集群"
},
{
"selected_row": true,
"name": "cpcnode",
"icon": "{{entire_url('/imgs/cpcnode.svg')}}",
"label": "节点"
}
]
},
"css":"card",
"editable":{
"new_data_url":"{{entire_url('add_cpclist.dspy')}}",
"delete_data_url":"{{entire_url('delete_cpclist.dspy')}}",
"update_data_url":"{{entire_url('update_cpclist.dspy')}}"
},
"data_url":"{{entire_url('./get_cpclist.dspy')}}",
"data_method":"GET",
"data_params":{{json.dumps(params_kw, indent=4, ensure_ascii=False)}},
"row_options":{
"browserfields": {
"exclouded": [
"id",
@ -32,10 +68,13 @@
],
"alters": {}
},
"editexclouded":[
"id",
"orgid"
],
"fields":[
{
"name": "id",
@ -67,7 +106,7 @@
"valueField": "orgid",
"textField": "orgid_text",
"params": {
"dbname": "{{rfexe('get_module_dbname', 'cpcc')}}",
"dbname": "{{get_module_dbname('cpcc')}}",
"table": "organization",
"tblvalue": "id",
"tbltext": "orgname",
@ -102,7 +141,7 @@
"type": "str",
"length": 100,
"cwidth": 18,
"uitype": "str",
"uitype": "password",
"datatype": "str",
"label": "接口密码"
},
@ -148,47 +187,14 @@
}
]
},
"content_view": {
"widgettype": "TabPanel",
"options": {
"tab_wide": "auto",
"height": "100%",
"width": "100%",
"tab_pos": "top",
"items": [
{
"name": "cpccluster",
"label": "集群",
"content": {
"widgettype": "urlwidget",
"options": {
"params": {
"cpcid": "${id}"
},
"url": "{{entire_url('..\/cpccluster')}}"
}
}
},
{
"name": "cpcnode",
"label": "节点",
"content": {
"widgettype": "urlwidget",
"options": {
"params": {
"cpcid": "${id}"
},
"url": "{{entire_url('..\/cpcnode')}}"
}
}
}
]
}
},
"page_rows":160,
"cache_limit":5
},
"binds": [
}
,"binds":[
{
"wid": "self",
"event": "newcluster",
@ -204,6 +210,57 @@
"id": "{{params_kw.id}}"
}
}
},
{
"wid": "self",
"event": "cpccluster",
"actiontype": "urlwidget",
"target": "PopupWindow",
"popup_options": {
"title": "集群",
"icon": "{{entire_url('/appbase/get_icon.dspy')}}?id=cpccluster",
"resizable": true,
"height": "70%",
"width": "70%"
},
"params_mapping": {
"mapping": {
"id": "cpcid",
"referer_widget": "referer_widget"
},
"need_other": false
},
"options": {
"method": "POST",
"params": {},
"url": "{{entire_url('../cpccluster')}}"
}
},
{
"wid": "self",
"event": "cpcnode",
"actiontype": "urlwidget",
"target": "PopupWindow",
"popup_options": {
"title": "节点",
"icon": "{{entire_url('/appbase/get_icon.dspy')}}?id=cpcnode",
"resizable": true,
"height": "70%",
"width": "70%"
},
"params_mapping": {
"mapping": {
"id": "cpcid",
"referer_widget": "referer_widget"
},
"need_other": false
},
"options": {
"method": "POST",
"params": {},
"url": "{{entire_url('../cpcnode')}}"
}
}
]
}

View File

@ -1,5 +1,8 @@
ns = params_kw.copy()
for k,v in ns.items():
if v == 'NaN' or v == 'null':
ns[k] = None
userorgid = await get_userorgid()
@ -22,8 +25,29 @@ if params_kw.get('api_pwd'):
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
ns1 = {
"orgid": userorgid,
"id": params_kw.id
}
recs = await sor.R('cpclist', ns1)
if len(recs) < 1:
return {
"widgettype":"Error",
"options":{
"title":"Update Error",
"cwidth":16,
"cheight":9,
"timeout":3,
"message":"Record no exist or with wrong ownership"
}
}
r = await sor.U('cpclist', ns)
debug('update success');
return {

View File

@ -1,5 +1,8 @@
ns = params_kw.copy()
for k,v in ns.items():
if v == 'NaN' or v == 'null':
ns[k] = None
id = params_kw.id
if not id or len(id) > 32:
id = uuid()
@ -11,13 +14,12 @@ if params_kw.get('adminpwd'):
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.C('cpcnode', ns.copy())
return {
"widgettype":"Message",
"options":{
"user_data":ns,
"cwidth":16,
"cheight":9,
"title":"Add Success",

View File

@ -5,7 +5,7 @@ ns = {
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.D('cpcnode', ns)
debug('delete success');

View File

@ -10,17 +10,12 @@ if not ns.get('sort'):
ns['sort'] = 'id'
sql = '''select a.*, b.node_status_text,d.devicetype_text
from (select * from cpcnode where 1=1 [[filterstr]])
a left join (select k as node_status, v as node_status_text from appcodes_kv where parentid='node_status')
b on a.node_status = b.node_status
left join (select k as devicetype, v as devicetype_text from appcodes_kv where parentid = 'devicetype')
d on a.devicetype = d.devicetype'''
sql = '''select a.*, b.node_status_text
from (select * from cpcnode where 1=1 [[filterstr]]) a left join (select k as node_status,
v as node_status_text from appcodes_kv where parentid='node_status') b on a.node_status = b.node_status'''
filterjson = params_kw.get('data_filter')
if not filterjson:
fields = [ f['name'] for f in [
fields_str=r'''[
{
"name": "id",
"title": "id",
@ -33,12 +28,6 @@ if not filterjson:
"type": "str",
"length": 255
},
{
"name": "devicetype",
"title": "设备类型",
"type": "str",
"length": 1
},
{
"name": "ip",
"title": "内网ip",
@ -95,7 +84,10 @@ if not filterjson:
"type": "date",
"length": 255
}
] ]
]'''
ori_fields = json.loads(fields_str)
if not filterjson:
fields = [ f['name'] for f in ori_fields ]
filterjson = default_filterjson(fields, ns)
filterdic = ns.copy()
filterdic['filterstr'] = ''
@ -116,7 +108,7 @@ sql = ac.convert(sql, filterdic)
debug(f'{sql=}')
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.sqlPaging(sql, ns)
return r

View File

@ -1,31 +1,56 @@
{
"id":"cpcnode_tbl",
"widgettype":"Tabular",
"options":{
"title": "入网算力节点",
"width":"100%",
"height":"100%",
"title":"算力节点",
"css":"card",
"editable":{
"new_data_url":"{{entire_url('add_cpcnode.dspy')}}",
"delete_data_url":"{{entire_url('delete_cpcnode.dspy')}}",
"update_data_url":"{{entire_url('update_cpcnode.dspy')}}"
},
"data_url":"{{entire_url('./get_cpcnode.dspy')}}",
"data_method":"GET",
"data_params":{{json.dumps(params_kw, indent=4, ensure_ascii=False)}},
"row_options":{
"browserfields": {
"exclouded": [
"id",
"cpcid",
"clusterid"
"cpcid"
],
"alters": {}
},
"editexclouded":[
"id",
"cpcid",
"clusterid"
],
"fields":[
{
"name": "id",
@ -37,46 +62,25 @@
"datatype": "str",
"label": "id"
},
{
"name": "ip",
"title": "内网ip",
"type": "str",
"length": 90,
"cwidth": 10,
"uitype": "str",
"datatype": "str",
"label": "内网ip"
},
{
"name": "name",
"title": "名称",
"type": "str",
"length": 255,
"cwidth": 16,
"cwidth": 18,
"uitype": "str",
"datatype": "str",
"label": "名称"
},
{
"name": "devicetype",
"title": "设备类型",
"name": "ip",
"title": "内网ip",
"type": "str",
"length": 1,
"cwidth": 8,
"label": "设备类型",
"uitype": "code",
"valueField": "devicetype",
"textField": "devicetype_text",
"params": {
"dbname": "{{rfexe('get_module_dbname', 'cpcc')}}",
"table": "appcodes_kv",
"tblvalue": "k",
"tbltext": "v",
"valueField": "devicetype",
"textField": "devicetype_text",
"cond": "parentid='devicetype'"
},
"dataurl": "{{entire_url('/appbase/get_code.dspy')}}"
"length": 90,
"cwidth": 18,
"uitype": "str",
"datatype": "str",
"label": "内网ip"
},
{
"name": "sshport",
@ -92,7 +96,7 @@
"title": "管理账号",
"type": "str",
"length": 99,
"cwidth": 8,
"cwidth": 18,
"uitype": "str",
"datatype": "str",
"label": "管理账号"
@ -103,7 +107,7 @@
"type": "str",
"length": 99,
"cwidth": 18,
"uitype": "str",
"uitype": "password",
"datatype": "str",
"label": "管理密码"
},
@ -129,7 +133,7 @@
"valueField": "node_status",
"textField": "node_status_text",
"params": {
"dbname": "{{rfexe('get_module_dbname', 'cpcc')}}",
"dbname": "{{get_module_dbname('cpcc')}}",
"table": "appcodes_kv",
"tblvalue": "k",
"tbltext": "v",
@ -172,8 +176,13 @@
}
]
},
"page_rows":160,
"cache_limit":5
},
"binds": []
}
,"binds":[]
}

View File

@ -1,5 +1,8 @@
ns = params_kw.copy()
for k,v in ns.items():
if v == 'NaN' or v == 'null':
ns[k] = None
@ -8,8 +11,9 @@ if params_kw.get('adminpwd'):
db = DBPools()
dbname = await rfexe('get_module_dbname', 'cpcc')
dbname = get_module_dbname('cpcc')
async with db.sqlorContext(dbname) as sor:
r = await sor.U('cpcnode', ns)
debug('update success');
return {