mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[IMP] runbot: add host filter on load_info
Makes it possible to filter on host on the load_info view. Monitoring was also adapted to have links to filtered load_info page.
This commit is contained in:
parent
34a92ac0cb
commit
44a1956ff5
@ -629,10 +629,14 @@ class Runbot(Controller):
|
||||
return request.render("runbot.modules_stats", context)
|
||||
|
||||
@route(['/runbot/load_info'], type='http', auth="user", website=True, sitemap=False)
|
||||
def load_infos(self, **post):
|
||||
def load_infos(self, host: str | None = None, **post):
|
||||
build_by_bundle = {}
|
||||
|
||||
for build in request.env['runbot.build'].search([('local_state', 'in', ('pending', 'testing'))], order='id'):
|
||||
domain = [('local_state', 'in', ('pending', 'testing'))]
|
||||
if host:
|
||||
domain.append(('host', '=', host))
|
||||
|
||||
for build in request.env['runbot.build'].search(domain, order='id'):
|
||||
build_by_bundle.setdefault(build.params_id.create_batch_id.bundle_id, []).append(build)
|
||||
|
||||
build_by_bundle = list(build_by_bundle.items())
|
||||
|
@ -87,11 +87,11 @@
|
||||
<t t-if="host.nb_testing > host.nb_worker">
|
||||
<t t-set="klass">danger</t>
|
||||
</t>
|
||||
<span t-attf-class="badge text-bg-{{klass}}">
|
||||
<a t-attf-class="badge text-bg-{{klass}}" t-attf-href="/runbot/load_info?host={{host.name}}">
|
||||
<span t-out="host.nb_testing"/>
|
||||
/
|
||||
<span t-out="host.nb_worker"/>
|
||||
</span>
|
||||
</a>
|
||||
<t t-out="host.nb_running"/>
|
||||
<t t-set="succes_time" t-value="int(datetime.datetime.now().timestamp() - host.last_success.timestamp())"/>
|
||||
<t t-set="start_time" t-value="int(datetime.datetime.now().timestamp() - host.last_start_loop.timestamp())"/>
|
||||
|
Loading…
Reference in New Issue
Block a user