diff options
author | Ricardo Martincoski <ricardo.martincoski@gmail.com> | 2017-07-05 22:36:31 -0300 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-07-06 21:38:43 +0200 |
commit | 2f762fb620f440a72af128b3455df3897d06fba1 (patch) | |
tree | a454940b15b716d21406899e9311109bc9d7c29d /support | |
parent | 845d3576a5054c4f691fd60a4071fa62f1f7f0bf (diff) | |
download | buildroot-2f762fb620f440a72af128b3455df3897d06fba1.tar.gz buildroot-2f762fb620f440a72af128b3455df3897d06fba1.zip |
pkg-stats: allow to sort by column
With 2000+ packages it's not trivial to identify i.e.:
- all packages that don't have a hash file;
- all packages that have patches;
- all packages that have code style warnings;
User experience can be improved by dynamically sorting the resulting
table.
There is an open-source solution that does that in the client-side and
requires minimal changes to our script: sorttable.js. The script is
MIT licensed as stated in its website.
Also add a hint to the user that the table can be sorted.
Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support')
-rwxr-xr-x | support/scripts/pkg-stats | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index 1956941f37..95a8afc45e 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -26,6 +26,7 @@ # echo "<head> +<script src=\"https://www.kryogenix.org/code/browser/sorttable/sorttable.js\"></script> <style type=\"text/css\"> table { width: 100%; @@ -59,7 +60,9 @@ td.lotsofpatches { <a href=\"#results\">Results</a><br/> -<table> +<p id=\"sortable_hint\"></p> + +<table class=\"sortable\"> <tr> <td>Id</td> <td>Package</td> @@ -428,4 +431,12 @@ echo "</table>" echo "<hr/>" echo "<i>Updated on $(LANG=C date), Git commit $(git log master -n 1 --pretty=format:%H)</i>" echo "</body>" + +echo "<script> +if (typeof sorttable === \"object\") { + document.getElementById(\"sortable_hint\").innerHTML = + \"hint: the table can be sorted by clicking the column headers\" +} +</script> +" echo "</html>" |