Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjiawei committed Dec 31, 2024
2 parents 6bd8a38 + c232dd5 commit c8000ff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions wecube_plugins_itsdangerous/apps/processor/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,24 @@ def plugin_check(self, data):
table.set_cols_align(["l", "c", "l", "l", "l"])
table.set_cols_valign(["m", "m", "m", "m", "m"])
table.header([_("Instance Ids"), _("Line"), _("Content"), _("Message"), _('Source Script')])
counter = 1
max_counter = 100
for associate_instances, ret in render_results:
associate_ids = ','.join([(inst.get('displayName', '') or '#' + str(inst.get('id', '')))
for inst in associate_instances])
table.add_row([
associate_ids,
'%s-%s' % (ret['lineno'][0], ret['lineno'][1]), ret['content'], ret['message'], ret['script_name']
])
# 到达max_counter行,并且剩余行数大于max_counter,则只显示max_counter行,并显示剩余行数数量
if counter >= max_counter and len(results) > max_counter:
more_lines = len(results) - max_counter
table.add_row([
associate_ids,
'...', '%d more lines(%d total)' % (more_lines, len(results)), '...', '...'
])
break
counter += 1
text_output = table.draw()
return {'text': text_output, 'data': results}

Expand Down Expand Up @@ -517,6 +528,7 @@ def check(self, data, boxes=None, without_subject_test=False, handover_match_par
for r in json_results:
r['script_name'] = ''
results.extend(json_results)
LOG.info('check results', results)
return results


Expand Down

0 comments on commit c8000ff

Please sign in to comment.