Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into nick-clickhouse
Browse files Browse the repository at this point in the history
  • Loading branch information
nick2wang committed Feb 16, 2022
2 parents 45a72a8 + ca10a8f commit c0509ca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sql/engines/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,9 @@ def execute_check(self, db_name=None, sql=''):
check_result.rows += [result]
continue
else:
method = sql_str.split('.')[2]
methodStr = method.split('(')[0].strip()
# method = sql_str.split('.')[2]
# methodStr = method.split('(')[0].strip()
methodStr = sql_str.split('(')[0].split('.')[-1].strip() # 最后一个.和括号(之间的字符串作为方法
if methodStr in is_exist_premise_method and not is_in:
check_result.error = "文档不存在"
check_result.error_count += 1
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def submit(request):
workflow_id = sql_workflow.id
# 自动审核通过了,才调用工作流
if workflow_status == 'workflow_manreviewing':
# 调用工作流插入审核信息, 查询权限申请workflow_type=2
# 调用工作流插入审核信息, SQL上线权限申请workflow_type=2
Audit.add(WorkflowDict.workflow_type['sqlreview'], workflow_id)
except Exception as msg:
logger.error(f"提交工单报错,错误信息:{traceback.format_exc()}")
Expand Down
13 changes: 12 additions & 1 deletion sql/templates/sqlquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ <h4 class="modal-title text-danger">收藏语句</h4>
//初始化查询结果
var isdetail = false
var optgroup = $('#instance_name :selected').parent().attr('label');
if (optgroup == 'Mongo') {
if (optgroup === 'Mongo' || optgroup === 'Redis') {
isdetail = true
}
var showExport = {{can_download}}===1
Expand Down Expand Up @@ -812,6 +812,17 @@ <h4 class="modal-title text-danger">收藏语句</h4>
$.each(row, function (key, value) {
if (key === 0) {//mongodb这里要修改
let rs = value;
if (optgroup === 'Redis') {
try {
rs = JSON.parse(rs);
if (typeof rs == 'object' && rs) {
rs = JSON.stringify(rs, null, 2)
}
} catch (e) {
html.push('<strong>' + "非json格式,无法格式化!" + '</strong>');
return false;
}
}
html.push('<pre>' + highLight(rs) + '</pre>');
}
});
Expand Down

0 comments on commit c0509ca

Please sign in to comment.