tazpanel diff hardware.cgi @ rev 514
index.cgi: add package list in report
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Aug 02 19:05:06 2015 +0200 (2015-08-02) |
parents | 5f5f6496a115 |
children | c0997cc494ed |
line diff
1.1 --- a/hardware.cgi Fri May 15 09:25:00 2015 +0200 1.2 +++ b/hardware.cgi Sun Aug 02 19:05:06 2015 +0200 1.3 @@ -10,7 +10,7 @@ 1.4 get_config 1.5 header 1.6 1.7 -TITLE=$(_ 'TazPanel - Hardware') 1.8 +TITLE=$(_ 'Hardware') 1.9 1.10 # Call an optional module 1.11 lib() { 1.12 @@ -105,28 +105,26 @@ 1.13 *\ detect\ *) 1.14 # Front end for Tazhw 1.15 # TODO: Add button to detect webcam, etc. Like in tazhw box. 1.16 - xhtml_header 1.17 + xhtml_header "$(_ 'Detect hardware')" 1.18 cat <<EOT 1.19 -<h2>$(_ 'Detect hardware')</h2> 1.20 <p>$(_ 'Detect PCI and USB hardware')</p> 1.21 - 1.22 -<section> 1.23 - <pre>$(tazhw detect-pci | sed 's|^>|\>|g')</pre> 1.24 - <pre>$(tazhw detect-usb | sed 's|^>|\>|g')</pre> 1.25 -</section> 1.26 EOT 1.27 + tazhw detect-pci | sed 's|^>|\>|g' 1.28 + tazhw detect-usb | sed 's|^>|\>|g' 1.29 ;; 1.30 1.31 1.32 *\ modules\ *|*\ modinfo\ *) 1.33 - xhtml_header 1.34 + xhtml_header "$(_ 'Kernel modules')" 1.35 + 1.36 + search="$(GET search)" 1.37 cat <<EOT 1.38 -<h2>$(_ 'Kernel modules')</h2> 1.39 <p>$(_ 'Manage, search or get information about the Linux kernel modules')</p> 1.40 1.41 -<form> 1.42 +<form class="search"> 1.43 <input type="hidden" name="modules"/> 1.44 - <input type="search" name="search" class="float-right" placeholder="$(_ 'Modules search')" results="5" autosave="modsearch" autocomplete="on"/> 1.45 + <input type="search" name="search" value="$search" placeholder="$(_ 'Modules search')" results="5" autosave="modsearch" autocomplete="on"/> 1.46 + <button type="submit">$(_n 'Search')</button> 1.47 </form> 1.48 EOT 1.49 # Request may be modinfo output that we want in the page itself 1.50 @@ -135,6 +133,7 @@ 1.51 cat <<EOT 1.52 <section> 1.53 <header>$(_ 'Detailed information for module: %s' $get_modinfo)</header> 1.54 + <div class="scroll"> 1.55 1.56 EOT 1.57 modinfo $get_modinfo | awk 'BEGIN{print "<table class=\"wide zebra\">"} 1.58 @@ -142,7 +141,7 @@ 1.59 printf("<tr><td><b>%s</b></td>", $1) 1.60 $1=""; printf("<td>%s</td></tr>", $0) 1.61 } 1.62 - END{print "</table></section>"}' 1.63 + END{print "</table></div></section>"}' 1.64 fi 1.65 1.66 if [ -n "$(GET modprobe)" ]; then 1.67 @@ -152,18 +151,23 @@ 1.68 echo "Removing" 1.69 rmmod -w $(GET rmmod) 1.70 fi 1.71 - get_search="$(GET search)" 1.72 - if [ -n "$get_search" ]; then 1.73 - _ 'Matching result(s) for: %s' $get_search 1.74 - echo '<pre>' 1.75 - modprobe -l | grep "$(GET search)" | while read line 1.76 + 1.77 + # Module search 1.78 + if [ -n "$search" ]; then 1.79 + cat <<EOT 1.80 +<section> 1.81 + <header>$(_ 'Matching result(s) for: %s' $search)</header> 1.82 + <pre class="scroll"> 1.83 +EOT 1.84 + busybox modprobe -l | grep "$search" | while read line 1.85 do 1.86 name=$(basename $line) 1.87 - mod=${name%.ko.gz} 1.88 - echo "$(_ 'Module:') <a href='?modinfo=$mod'>$mod</a>" 1.89 + mod=${name%.ko.xz} 1.90 + echo "<span data-icon=\"modules\">$(_ 'Module:')</span> <a href='?modinfo=$mod'>$mod</a>" 1.91 done 1.92 - echo '</pre>' 1.93 + echo '</pre></section>' 1.94 fi 1.95 + 1.96 cat <<EOT 1.97 <section> 1.98 <table class="zebra"> 1.99 @@ -236,9 +240,8 @@ 1.100 # 1.101 # Default to summary with mounted filesystem, loaded modules 1.102 # 1.103 - xhtml_header 1.104 + xhtml_header "$(_ 'Drivers & Devices')" 1.105 cat <<EOT 1.106 -<h2>$(_ 'Drivers & Devices')</h2> 1.107 <p>$(_ 'Manage your computer hardware')</p> 1.108 1.109 <form><!--