mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 06:06:32 +00:00
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>
This commit is contained in:
parent
845d3576a5
commit
2f762fb620
@ -26,6 +26,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
echo "<head>
|
echo "<head>
|
||||||
|
<script src=\"https://www.kryogenix.org/code/browser/sorttable/sorttable.js\"></script>
|
||||||
<style type=\"text/css\">
|
<style type=\"text/css\">
|
||||||
table {
|
table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -59,7 +60,9 @@ td.lotsofpatches {
|
|||||||
|
|
||||||
<a href=\"#results\">Results</a><br/>
|
<a href=\"#results\">Results</a><br/>
|
||||||
|
|
||||||
<table>
|
<p id=\"sortable_hint\"></p>
|
||||||
|
|
||||||
|
<table class=\"sortable\">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Id</td>
|
<td>Id</td>
|
||||||
<td>Package</td>
|
<td>Package</td>
|
||||||
@ -428,4 +431,12 @@ echo "</table>"
|
|||||||
echo "<hr/>"
|
echo "<hr/>"
|
||||||
echo "<i>Updated on $(LANG=C date), Git commit $(git log master -n 1 --pretty=format:%H)</i>"
|
echo "<i>Updated on $(LANG=C date), Git commit $(git log master -n 1 --pretty=format:%H)</i>"
|
||||||
echo "</body>"
|
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>"
|
echo "</html>"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user