From: krishnatejaperannagari Date: Tue, 17 Jun 2014 06:07:54 +0000 (+0530) Subject: recent checkins page speed improvements with hidng feature X-Git-Url: http://git.samba.org/?p=build-farm.git;a=commitdiff_plain;h=b43a77316d4500fe30b30d581f1915476e6058ac recent checkins page speed improvements with hidng feature Signed-off-by: krishnatejaperannagari --- diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index 08d577a1..600ce751 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -887,14 +887,25 @@ class DiffPage(HistoryPage): class RecentCheckinsPage(HistoryPage): - limit = 40 + limit = 10 - def render(self, myself, tree, author=None): + def render(self, myself, tree, gitcount=None, navigation=None, author=None): t = self.buildfarm.trees[tree] interesting = list() authors = {"ALL": "ALL"} branch = t.get_branch() re_author = re.compile("^(.*) <(.*)>$") + + if navigation == "Previous": + gitstart = int(gitcount) - ( 2 * self.limit ) + gitstop = int(gitcount) - self.limit + elif navigation == "Next": + gitstart = int(gitcount) + gitstop = int(gitcount) + self.limit + else: + gitstart = 0 + gitstop = self.limit + for entry in branch.log(limit=HISTORY_HORIZON): m = re_author.match(entry.author) authors[m.group(2)] = m.group(1) @@ -910,11 +921,26 @@ class RecentCheckinsPage(HistoryPage): yield "" % tree yield "" yield "" - - for entry in interesting[:self.limit]: + + for entry in interesting[gitstart:gitstop]: changes = branch.changes_summary(entry.revision) yield "".join(self.history_row_html(myself, entry, t, changes)) yield "\n" + + yield "
" + yield "
\n" + if gitstart != 0: + yield "" + if len(interesting) > gitstop: + yield "" + yield "" + yield "" % gitstop + if author and author != "ALL": + yield "" % author + yield "" % tree + yield "
\n" + yield "
" + yield "
" class BuildFarmApp(object): @@ -1021,8 +1047,10 @@ class BuildFarmApp(object): elif fn_name == "Recent_Checkins": # validate the tree author = get_param(form, 'author') + gitcount = get_param(form, 'gitcount') + navigation = get_param(form, 'navigation') page = RecentCheckinsPage(self.buildfarm) - yield "".join(self.html_page(form, page.render(myself, tree, author))) + yield "".join(self.html_page(form, page.render(myself, tree, gitcount, navigation, author))) elif fn_name == "diff": revision = get_param(form, 'revision') page = DiffPage(self.buildfarm)