[IMP] runbot: add a frontend btn to parse a single log

This commit is contained in:
Christophe Monniez 2023-04-03 15:24:18 +02:00 committed by xdo
parent 68892398cd
commit c322458c5b
2 changed files with 15 additions and 1 deletions

View File

@ -624,3 +624,8 @@ class Runbot(Controller):
run_url = build._get_run_url(db_suffix)
_logger.info('Redirecting to %s', run_url)
return werkzeug.utils.redirect(run_url)
@route(['/runbot/parse_log/<model("ir.logging"):ir_log>'], type='http', auth='user', website=True, sitemap=False)
def parse_log(self, ir_log, **kwargs):
request.env['runbot.build.error']._parse_logs(ir_log)
return werkzeug.utils.redirect('/runbot/build/%s' % ir_log.build_id.id)

View File

@ -313,6 +313,15 @@
</t>
</t>
</td>
<td t-attf-class="bg-{{message_class.strip() or logclass}}-light">
<t t-if="l.level in ('CRITICAL', 'ERROR', 'WARNING') and not l.with_context(active_test=False).error_id">
<small>
<a groups="runbot.group_runbot_admin" t-attf-href="/runbot/parse_log/{{l.id}}" class="sm" title="Parse this log line to follow this error.">
<i t-attf-class="fa fa-magic"/>
</a>
</small>
</t>
</td>
</tr>
<t t-if="l.with_context(active_test=False).error_id">
<t t-set="icon" t-value="'list'"/>
@ -325,7 +334,7 @@
</t>
<tr>
<td/><td/><td/>
<td t-attf-class="bg-{{'info' if error.active else 'success'}}-light {{size}}">
<td t-attf-class="bg-{{'info' if error.active else 'success'}}-light {{size}}" colspan="2">
This error is already <t t-esc="'known' if error.active else 'fixed'"/>.
<a groups="runbot.group_user" t-attf-href="/web#id={{l.error_id.id}}&amp;view_type=form&amp;model=runbot.build.error&amp;menu_id={{env.ref('runbot.runbot_menu_root').id}}" title="View in Backend" target="new">
<i t-attf-class="fa fa-{{icon}}"/>