[IMP] display the nmbr of pending/running/testing

display the total number (for the runbot) and the numbers by repo
This commit is contained in:
Gery Debongnie 2014-07-15 10:55:35 +02:00
parent 46ce71ee4a
commit 2089b04c1f
2 changed files with 23 additions and 2 deletions

View File

@ -272,6 +272,10 @@ class runbot_repo(osv.osv):
Build.write(cr, uid, to_be_skipped_ids, {'state': 'done', 'result': 'skipped'})
def scheduler(self, cr, uid, ids=None, context=None):
icp = self.pool['ir.config_parameter']
workers = icp.get_param(cr, uid, 'runbot.workers', default=6)
running_max = icp.get_param(cr, uid, 'runbot.running_max', default=75)
for repo in self.browse(cr, uid, ids, context=context):
Build = self.pool['runbot.build']
domain = [('repo_id', '=', repo.id)]
@ -849,6 +853,13 @@ class RunbotController(http.Controller):
registry, cr, uid, context = request.registry, request.cr, 1, request.context
branch_obj = registry['runbot.branch']
build_obj = registry['runbot.build']
icp = registry['ir.config_parameter']
workers = icp.get_param(cr, uid, 'runbot.workers', default=6)
running_max = icp.get_param(cr, uid, 'runbot.running_max', default=75)
pending_total = build_obj.search_count(cr, uid, [('state','=','pending')])
testing_total = build_obj.search_count(cr, uid, [('state','=','testing')])
running_total = build_obj.search_count(cr, uid, [('state','=','running')])
v = self.common(cr, uid)
# repo
if not repo and v['repos']:
@ -898,6 +909,11 @@ class RunbotController(http.Controller):
'limit': limit,
'refresh': refresh,
'repo': repo,
'workers': workers,
'running_max': running_max,
'pending_total': pending_total,
'running_total': running_total,
'testing_total': testing_total,
})
return request.render("runbot.repo", v)

View File

@ -279,6 +279,11 @@
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" t-attf-href="/runbot/{{'repo/' + slug(repo) if repo else ''}}"><b t-if="repo"><t t-esc="repo.base"/></b></a>
<span class="navbar-brand">
<t t-esc="testing_total"/>/<t t-esc="workers"/> testing,
<t t-esc="running_total"/>/<t t-esc="running_max"/> running,
<t t-esc="pending_total"/> pending.
</span>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<form class="navbar-form navbar-left form-inline">
@ -331,8 +336,8 @@
<tr>
<th>Branch</th>
<td colspan="4" class="text-right">
<t t-esc="testing"/>/<t t-esc="repo.testing"/> testing,
<t t-esc="running"/>/<t t-esc="repo.running"/> running,
<t t-esc="testing"/> testing,
<t t-esc="running"/> running,
<t t-esc="pending"/> pending.
</td>