瀏覽代碼

support/scripts/pkg-stats: fix bug when sorting by hashfile

Because the div_class variable was not reassigned a value,
cells in the latest_version column were still being assigned
hash_file classes and so were being picked up as elements in
the hash_file sort. This lead to execessive grid gap elements
stacking up and creating huge blank spaces at the top of the page.
This is very noticable on pages with a large number of packages,
like the ones the autobuilder creates.

original behaviour(click the "Hash file" column label twice):
http://autobuild.buildroot.org/stats/master.html

demo of fixed behaviour:
https://sen-h.codeberg.page/pkg-stats-demos/@pages/fix-bug-when-sorting-by-hash-file.html

Signed-off-by: Sen Hastings <sen@hastings.org>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
Sen Hastings 1 年之前
父節點
當前提交
6e3d79f52e
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      support/scripts/pkg-stats

+ 1 - 0
support/scripts/pkg-stats

@@ -977,6 +977,7 @@ def dump_html_pkg(f, pkg):
 
     # Latest version
     data_field_id = f'latest_version__{pkg_css_class}'
+    div_class = ["centered"]
     div_class.append(f'_{pkg_css_class}')
     div_class.append("latest_version data")
     if pkg.latest_version['status'] == RM_API_STATUS_ERROR: