mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
display specific host statistics in main page
also fix a bug with urls in logs
This commit is contained in:
parent
b424851a1f
commit
16521bb575
@ -978,6 +978,7 @@ class RunbotController(http.Controller):
|
||||
build_obj = registry['runbot.build']
|
||||
icp = registry['ir.config_parameter']
|
||||
repo_obj = registry['runbot.repo']
|
||||
count = lambda dom: build_obj.search_count(cr, uid, dom)
|
||||
|
||||
repo_ids = repo_obj.search(cr, uid, [], order='id')
|
||||
repos = repo_obj.browse(cr, uid, repo_ids)
|
||||
@ -987,9 +988,8 @@ class RunbotController(http.Controller):
|
||||
context = {
|
||||
'repos': repos,
|
||||
'repo': repo,
|
||||
'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')]),
|
||||
'host_stats': [],
|
||||
'pending_total': count([('state','=','pending')]),
|
||||
'limit': limit,
|
||||
'search': search,
|
||||
'refresh': refresh,
|
||||
@ -1055,13 +1055,20 @@ class RunbotController(http.Controller):
|
||||
|
||||
context.update({
|
||||
'branches': [branch_info(b) for b in branches],
|
||||
'testing': build_obj.search_count(cr, uid, [('repo_id','=',repo.id), ('state','=','testing')]),
|
||||
'running': build_obj.search_count(cr, uid, [('repo_id','=',repo.id), ('state','=','running')]),
|
||||
'pending': build_obj.search_count(cr, uid, [('repo_id','=',repo.id), ('state','=','pending')]),
|
||||
'testing': count([('repo_id','=',repo.id), ('state','=','testing')]),
|
||||
'running': count([('repo_id','=',repo.id), ('state','=','running')]),
|
||||
'pending': count([('repo_id','=',repo.id), ('state','=','pending')]),
|
||||
'qu': QueryURL('/runbot/repo/'+slug(repo), search=search, limit=limit, refresh=refresh, **filters),
|
||||
'filters': filters,
|
||||
})
|
||||
|
||||
for result in build_obj.read_group(cr, uid, [], ['host'], ['host']):
|
||||
context['host_stats'].append({
|
||||
'host': result['host'],
|
||||
'testing': count([('state', '=', 'testing'), ('host', '=', result['host'])]),
|
||||
'running': count([('state', '=', 'running'), ('host', '=', result['host'])]),
|
||||
})
|
||||
|
||||
return request.render("runbot.repo", context)
|
||||
|
||||
def build_info(self, build):
|
||||
|
@ -261,8 +261,8 @@
|
||||
</li>
|
||||
<li t-if="bu['state']!='testing' and bu['state']!='pending'" class="divider"></li>
|
||||
<li><a t-attf-href="/runbot/build/{{bu['id']}}">Logs <i class="fa fa-file-text-o"/></a></li>
|
||||
<li><a t-attf-href="{{bu['host']}}/runbot/static/build/#{bu['real_dest']}/logs/job_10_test_base.txt">Full base logs <i class="fa fa-file-text-o"/></a></li>
|
||||
<li><a t-attf-href="{{bu['host']}}/runbot/static/build/#{bu['real_dest']}/logs/job_20_test_all.txt">Full all logs <i class="fa fa-file-text-o"/></a></li>
|
||||
<li><a t-attf-href="http://{{bu['host']}}/runbot/static/build/#{bu['real_dest']}/logs/job_10_test_base.txt">Full base logs <i class="fa fa-file-text-o"/></a></li>
|
||||
<li><a t-attf-href="http://{{bu['host']}}/runbot/static/build/#{bu['real_dest']}/logs/job_20_test_all.txt">Full all logs <i class="fa fa-file-text-o"/></a></li>
|
||||
<li t-if="bu['state']!='pending'" class="divider"></li>
|
||||
<li><a t-attf-href="{{br['branch'].branch_url}}">Branch or pull <i class="fa fa-github"/></a></li>
|
||||
<li><a t-attf-href="https://{{repo.base}}/commit/{{bu['name']}}">Commit <i class="fa fa-github"/></a></li>
|
||||
@ -347,10 +347,11 @@
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
<span t-foreach="host_stats" t-as="hs" class="navbar-brand navbar-right">
|
||||
<t t-esc="hs['host']"/>: <t t-esc="hs['testing']"/> testing, <t t-esc="hs['running']"/> running
|
||||
</span>
|
||||
<span class="navbar-brand navbar-right">
|
||||
<t t-esc="testing_total"/> testing,
|
||||
<t t-esc="running_total"/> running,
|
||||
<t t-esc="pending_total"/> pending
|
||||
Pending: <t t-esc="pending_total"/>
|
||||
</span>
|
||||
</t>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user