diff --git a/runbot/controllers/frontend.py b/runbot/controllers/frontend.py index 2a20dade..6843746b 100644 --- a/runbot/controllers/frontend.py +++ b/runbot/controllers/frontend.py @@ -304,6 +304,31 @@ class Runbot(Controller): } return request.render("runbot.build", context) + @route([ + '/runbot/build/search', + ], website=True, auth='public', type='http', sitemap=False) + def builds(self, **kwargs): + domain = [] + for key in ('config_id', 'version_id', 'project_id', 'trigger_id', 'create_batch_id.bundle_id', 'create_batch_id'): # allowed params + value = kwargs.get(key) + if value: + domain.append((f'params_id.{key}', '=', int(value))) + + for key in ('global_state', 'local_state', 'global_result', 'local_result'): + value = kwargs.get(key) + if value: + domain.append((f'{key}', '=', value)) + + for key in ('description',): + if key in kwargs: + domain.append((f'{key}', 'ilike', kwargs.get(key))) + + context = { + 'builds': request.env['runbot.build'].search(domain, limit=100), + } + + return request.render('runbot.build_search', context) + @route([ '/runbot/branch/', ], website=True, auth='public', type='http', sitemap=False) diff --git a/runbot/templates/build.xml b/runbot/templates/build.xml index 811d47bb..5e5b41cf 100644 --- a/runbot/templates/build.xml +++ b/runbot/templates/build.xml @@ -330,5 +330,58 @@ + diff --git a/runbot/templates/utils.xml b/runbot/templates/utils.xml index 7f21f7db..ad97ddb7 100644 --- a/runbot/templates/utils.xml +++ b/runbot/templates/utils.xml @@ -306,6 +306,10 @@