mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +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']
|
build_obj = registry['runbot.build']
|
||||||
icp = registry['ir.config_parameter']
|
icp = registry['ir.config_parameter']
|
||||||
repo_obj = registry['runbot.repo']
|
repo_obj = registry['runbot.repo']
|
||||||
|
count = lambda dom: build_obj.search_count(cr, uid, dom)
|
||||||
|
|
||||||
repo_ids = repo_obj.search(cr, uid, [], order='id')
|
repo_ids = repo_obj.search(cr, uid, [], order='id')
|
||||||
repos = repo_obj.browse(cr, uid, repo_ids)
|
repos = repo_obj.browse(cr, uid, repo_ids)
|
||||||
@ -987,9 +988,8 @@ class RunbotController(http.Controller):
|
|||||||
context = {
|
context = {
|
||||||
'repos': repos,
|
'repos': repos,
|
||||||
'repo': repo,
|
'repo': repo,
|
||||||
'pending_total': build_obj.search_count(cr, uid, [('state','=','pending')]),
|
'host_stats': [],
|
||||||
'testing_total': build_obj.search_count(cr, uid, [('state','=','testing')]),
|
'pending_total': count([('state','=','pending')]),
|
||||||
'running_total': build_obj.search_count(cr, uid, [('state','=','running')]),
|
|
||||||
'limit': limit,
|
'limit': limit,
|
||||||
'search': search,
|
'search': search,
|
||||||
'refresh': refresh,
|
'refresh': refresh,
|
||||||
@ -1055,13 +1055,20 @@ class RunbotController(http.Controller):
|
|||||||
|
|
||||||
context.update({
|
context.update({
|
||||||
'branches': [branch_info(b) for b in branches],
|
'branches': [branch_info(b) for b in branches],
|
||||||
'testing': build_obj.search_count(cr, uid, [('repo_id','=',repo.id), ('state','=','testing')]),
|
'testing': count([('repo_id','=',repo.id), ('state','=','testing')]),
|
||||||
'running': build_obj.search_count(cr, uid, [('repo_id','=',repo.id), ('state','=','running')]),
|
'running': count([('repo_id','=',repo.id), ('state','=','running')]),
|
||||||
'pending': build_obj.search_count(cr, uid, [('repo_id','=',repo.id), ('state','=','pending')]),
|
'pending': count([('repo_id','=',repo.id), ('state','=','pending')]),
|
||||||
'qu': QueryURL('/runbot/repo/'+slug(repo), search=search, limit=limit, refresh=refresh, **filters),
|
'qu': QueryURL('/runbot/repo/'+slug(repo), search=search, limit=limit, refresh=refresh, **filters),
|
||||||
'filters': 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)
|
return request.render("runbot.repo", context)
|
||||||
|
|
||||||
def build_info(self, build):
|
def build_info(self, build):
|
||||||
|
@ -261,8 +261,8 @@
|
|||||||
</li>
|
</li>
|
||||||
<li t-if="bu['state']!='testing' and bu['state']!='pending'" class="divider"></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="/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="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="{{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_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 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="{{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>
|
<li><a t-attf-href="https://{{repo.base}}/commit/{{bu['name']}}">Commit <i class="fa fa-github"/></a></li>
|
||||||
@ -347,10 +347,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</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">
|
<span class="navbar-brand navbar-right">
|
||||||
<t t-esc="testing_total"/> testing,
|
Pending: <t t-esc="pending_total"/>
|
||||||
<t t-esc="running_total"/> running,
|
|
||||||
<t t-esc="pending_total"/> pending
|
|
||||||
</span>
|
</span>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user