mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot: add dedicated route for running
This commit is contained in:
parent
d09b9961cd
commit
91470e0cfa
@ -596,3 +596,13 @@ class Runbot(Controller):
|
||||
}
|
||||
|
||||
return request.render("runbot.load_info", context)
|
||||
|
||||
@route([
|
||||
'/runbot/run/<build_id>',
|
||||
'/runbot/run/<build_id>/<db_suffix>',
|
||||
], type='http', auth="public", website=True, sitemap=False)
|
||||
def access_running(self, build_id, db_suffix=None, **kwargs):
|
||||
build = request.env['runbot.build'].browse(int(build_id)).exists()
|
||||
if db_suffix is None:
|
||||
db_suffix = build.mapped('database_ids')[0].db_suffix
|
||||
return werkzeug.utils.redirect(f'http://{build.dest}-{db_suffix}.{build.host}')
|
||||
|
@ -201,7 +201,7 @@
|
||||
<span t-else="" t-attf-class="btn btn-default disabled slot_name">
|
||||
<span t-esc="slot.trigger_id.name"/>
|
||||
</span>
|
||||
<a t-if="bu.local_state == 'running' and bu.database_ids" t-attf-href="http://{{sorted(bu.mapped('database_ids.name'))[0]}}.{{bu.host}}" class="fa fa-sign-in btn btn-info"/>
|
||||
<a t-if="bu.local_state == 'running' and bu.database_ids" t-attf-href="/runbot/run/{{bu.id}}" class="fa fa-sign-in btn btn-info"/>
|
||||
<a t-if="bu.static_run" t-att-href="bu.static_run" class="fa fa-sign-in btn btn-info"/>
|
||||
<t t-if="bu" t-call="runbot.build_menu"/>
|
||||
<a t-if="not bu" groups="base.group_user" class="btn btn-default" title="Create build" t-attf-href="/runbot/batch/slot/{{slot.id}}/build">
|
||||
@ -213,7 +213,7 @@
|
||||
<template id="runbot.build_button">
|
||||
<div t-attf-class="pull-right">
|
||||
<div t-attf-class="btn-group {{klass}}">
|
||||
<a t-if="bu.local_state == 'running' and bu.database_ids" t-attf-href="http://{{sorted(bu.mapped('database_ids.name'))[0]}}.{{bu.host}}" class="btn btn-info" title="Sign in on this build" aria-label="Sign in on this build">
|
||||
<a t-if="bu.local_state == 'running' and bu.database_ids" t-attf-href="/runbot/run/{{bu.id}}" class="btn btn-info" title="Sign in on this build" aria-label="Sign in on this build">
|
||||
<i class="fa fa-sign-in"/>
|
||||
</a>
|
||||
<a t-if="bu.static_run" t-att-href="bu.static_run" class="btn btn-info" title="View result" aria-label="View result">
|
||||
@ -265,7 +265,7 @@
|
||||
</a>
|
||||
<t t-if="bu.local_state=='running'">
|
||||
<t t-foreach="bu.database_ids.sorted('name')[1:]" t-as="db">
|
||||
<a class="dropdown-item" t-attf-href="http://{{db.name}}.{{bu.host}}/">
|
||||
<a class="dropdown-item" t-attf-href="/runbot/run/{{bu.id}}/{{db.db_suffix}}">
|
||||
<i class="fa fa-sign-in"/>
|
||||
Connect <t t-esc="db.db_suffix"></t>
|
||||
</a>
|
||||
|
Loading…
Reference in New Issue
Block a user