You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
806 B
33 lines
806 B
6 months ago
|
'''
|
||
|
实现系统的监控
|
||
|
'''
|
||
|
from flask import Blueprint,render_template,jsonify,request
|
||
|
import adminProcess
|
||
|
|
||
|
sysm=Blueprint("sysm",__name__)
|
||
|
|
||
|
@sysm.route('/admin/systeminfo')
|
||
|
def systeminfo():
|
||
|
'''
|
||
|
获取系统信息
|
||
|
:return:
|
||
|
'''
|
||
|
return render_template('/admin/sysmonitor.html')
|
||
|
|
||
|
# 获取系统监控信息
|
||
|
@sysm.route('/admin/systeminfoj')
|
||
|
def systeminfoj():
|
||
|
return jsonify({"data":adminProcess.getsysInfo(),"code":200})
|
||
|
|
||
|
#设定日志路由
|
||
|
@sysm.route('/admin/systemlog')
|
||
|
def systemlog():
|
||
|
page = request.args.get('page')
|
||
|
if not page:page=1
|
||
|
data={}
|
||
|
data['log']=adminProcess.getSysLog(page=int(page))
|
||
|
data['currentPage']=int(page)
|
||
|
data['totalPage']=adminProcess.getDataListPage(tableName='dblog')
|
||
|
return render_template("admin/syslog.html",data=data)
|
||
|
|