Skip to content

Commit

Permalink
部分错误和展示细节调整
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo committed Aug 12, 2019
1 parent 465463c commit 5344f70
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
10 changes: 6 additions & 4 deletions sql/db_diagnostic.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ def process(request):
else:
sql = "{} where command= '{}';".format(base_sql, command_type)
query_engine = get_engine(instance=instance)
processlist = query_engine.query('information_schema', sql).to_dict()

result = {'status': 0, 'msg': 'ok', 'rows': processlist}

query_result = query_engine.query('information_schema', sql)
if not query_result.error:
processlist = query_result.to_dict()
result = {'status': 0, 'msg': 'ok', 'rows': processlist}
else:
result = {'status': 1, 'msg': query_result.error}
# 返回查询结果
return HttpResponse(json.dumps(result, cls=ExtendJSONEncoder, bigint_as_string=True),
content_type='application/json')
Expand Down
4 changes: 2 additions & 2 deletions sql/templates/dbdiagnostic.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ <h4 class="modal-title text-danger">确定要终止所选会话吗?</h4>
sortName: 'time', //排序字段
sidePagination: "client", //分页方式client客户端分页server服务端分页*
pageNumber: 1, //初始化加载第一页默认第一页,并记录
pageSize: 30, //每页的记录行数*
pageList: [20, 30, 50, 100], //可供选择的每页的行数*
pageSize: 100, //每页的记录行数*
pageList: [20, 30, 50, 100, 1000], //可供选择的每页的行数*
search: true, //是否显示表格搜索
strictSearch: false, //是否全匹配搜索
showColumns: true, //是否显示所有的列选择显示的列
Expand Down
2 changes: 2 additions & 0 deletions sql/templates/queryapplylist.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
<!-- 自定义操作按钮-->
<div id="toolbar" class="btn-group">
<a type="button" class="btn btn-default" href="/queryuserprivileges/">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
<span aria-hidden="true"></span>权限管理</a>
<button id="btn_add" type="button" class="btn btn-default"
data-toggle="modal" data-target="#apply">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
<span aria-hidden="true"></span>权限申请
</button>
</div>
Expand Down

0 comments on commit 5344f70

Please sign in to comment.