Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 96a1f534 authored by Betoule Marc's avatar Betoule Marc
Browse files

performance improvment in web.py for the product page

parent 3676ae1e
......@@ -226,10 +226,7 @@ class Web:
@cherrypy.expose
@auth.pipeauth.read_access()
def index(self, **keys):
return self.p.run(self._index,**keys)
def _index(self, highlight=None, thumbnail=None):
def index(self, highlight=None, thumbnail=None):
""" Pipeline instances tree view
Print the pipeline instances trough a tree view.
......@@ -384,9 +381,12 @@ class Web:
html += '<a class="icon apply" href="javascript:check_all();"><small>Check all</small></a>'
html += '<a class="icon clear" href="javascript:uncheck(\'checkbox_p\');"><small>Clear</small></a>'
html += '<ul>'
for e in l:
html += '<li><a href="pipedir?segid=%s&directory=%s"> %s </a><INPUT type="checkbox" name="checkbox_p" id="%d"></li>'%(segid,os.path.relpath(e[0],start=currdir),e[0],e[1])
html += '</ul></div></body></html>'
# os.path.relpath is somewhat slow. This is a quick workaround, I hope it's correct.
#s = ''.join(['<li><a href="pipedir?segid=%s&directory=%s"> %s </a><INPUT type="checkbox" name="checkbox_p" id="%d"></li>'%(segid,os.path.relpath(e[0],start=currdir),e[0],e[1]) for e in l])
r = os.path.relpath(l[0][0], currdir)
currdir=l[0][0].replace(r,'')
s = ''.join(['<li><a href="pipedir?segid=%s&directory=%s"> %s </a><INPUT type="checkbox" name="checkbox_p" id="%d"></li>'%(segid,e[0].replace(currdir,''),e[0],e[1]) for e in l])
html += s + '</ul></div></body></html>'
return html
def _get_fathers(self, segid):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment