mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot: add optional warning message on frontend
This commit is contained in:
parent
080d5a4e1b
commit
ae1eed46f5
@ -128,6 +128,8 @@ class Runbot(Controller):
|
||||
'testing': build_obj.search_count([('local_state', '=', 'testing'), ('host', '=', result['host'])]),
|
||||
'running': build_obj.search_count([('local_state', '=', 'running'), ('host', '=', result['host'])]),
|
||||
})
|
||||
|
||||
context.update({'message': request.env['ir.config_parameter'].sudo().get_param('runbot.runbot_message')})
|
||||
return request.render('runbot.repo', context)
|
||||
|
||||
@route(['/runbot/build/<int:build_id>/kill'], type='http', auth="user", methods=['POST'], csrf=False)
|
||||
|
@ -15,6 +15,7 @@ class ResConfigSettings(models.TransientModel):
|
||||
runbot_max_age = fields.Integer('Max branch age (in days)')
|
||||
runbot_logdb_uri = fields.Char('Runbot URI for build logs')
|
||||
runbot_update_frequency = fields.Integer('Update frequency (in seconds)')
|
||||
runbot_message = fields.Text('Frontend warning message')
|
||||
|
||||
@api.model
|
||||
def get_values(self):
|
||||
@ -28,6 +29,7 @@ class ResConfigSettings(models.TransientModel):
|
||||
runbot_max_age=int(get_param('runbot.runbot_max_age', default=30)),
|
||||
runbot_logdb_uri=get_param('runbot.runbot_logdb_uri', default=False),
|
||||
runbot_update_frequency=int(get_param('runbot.runbot_update_frequency', default=10)),
|
||||
runbot_message = get_param('runbot.runbot_message', default=''),
|
||||
)
|
||||
return res
|
||||
|
||||
@ -43,3 +45,4 @@ class ResConfigSettings(models.TransientModel):
|
||||
set_param("runbot.runbot_max_age", self.runbot_max_age)
|
||||
set_param("runbot.runbot_logdb_uri", self.runbot_logdb_uri)
|
||||
set_param('runbot.runbot_update_frequency', self.runbot_update_frequency)
|
||||
set_param('runbot.runbot_message', self.runbot_message)
|
||||
|
@ -97,6 +97,9 @@
|
||||
</p>
|
||||
</div>
|
||||
</nav>
|
||||
<div t-if="message" class="alert alert-warning" role="alert">
|
||||
<t t-esc="message" />
|
||||
</div>
|
||||
<div t-if="not repo" class="mb32">
|
||||
<h1>No Repository yet.</h1>
|
||||
</div>
|
||||
|
@ -50,6 +50,10 @@
|
||||
<label for="runbot_update_frequency" class="col-xs-3 o_light_label" style="width: 60%;"/>
|
||||
<field name="runbot_update_frequency" style="width: 30%;"/>
|
||||
</div>
|
||||
<div class="mt-16 row">
|
||||
<label for="runbot_message" class="col-xs-3 o_light_label" style="width: 60%;"/>
|
||||
<field name="runbot_message" style="width: 30%;"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user