修改bug

release
周平 9 months ago
parent 2d2cec8b84
commit b2082e0e8b

@ -134,6 +134,30 @@ class DeviceClassificationDeleteHandler(APIHandler):
self.finish()
class DeviceClassificationEditHandler(APIHandler):
"""
- 描述编辑设备分类
- 请求方式post
- 请求参数
>- id
>- name
- 返回值
"""
@authenticated
@operation_log("企业管理", "设备管理", consts.op_type_edit_str, "编辑设备分类")
def post(self):
did = self.get_int_argument("id")
name = self.get_escaped_argument("name", "")
with self.app_mysql.connect() as conn:
conn.execute(
text("update device_classification set name=:name WHERE id=:id"),
{"id": did, "name": name},
)
conn.commit()
self.finish()
class DeviceAddHandler(APIHandler):
"""
- 描述企业节点添加设备

@ -5,10 +5,8 @@ from website.handlers.enterprise_device import handler
handlers = [
("/enterprise/device/classification/add", handler.DeviceClassificationAddHandler),
("/enterprise/device/classification", handler.DeviceClassificationHandler),
(
"/enterprise/device/classification/delete",
handler.DeviceClassificationDeleteHandler,
),
("/enterprise/device/classification/delete", handler.DeviceClassificationDeleteHandler),
("/enterprise/device/classification/edit", handler.DeviceClassificationEditHandler),
("/enterprise/entity/nodes/device/add", handler.DeviceAddHandler),
("/enterprise/entity/nodes/device/edit", handler.DeviceEditHandler),
("/enterprise/entity/nodes/device/delete", handler.DeviceDeleteHandler),

Loading…
Cancel
Save