tazpanel rev 433

hardware.cgi, index.cgi: user support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Apr 06 19:06:05 2015 +0200 (2015-04-06)
parents 2ce8e949aef9
children 678dd43435a3
files hardware.cgi index.cgi styles/default/header.html
line diff
     1.1 --- a/hardware.cgi	Mon Apr 06 17:22:23 2015 +0200
     1.2 +++ b/hardware.cgi	Mon Apr 06 19:06:05 2015 +0200
     1.3 @@ -223,9 +223,13 @@
     1.4  <p>$(gettext 'Manage your computer hardware')</p>
     1.5  
     1.6  <form><!--
     1.7 -	--><button name="modules" data-icon="modules">$(gettext 'Kernel modules')</button><!--
     1.8 -	--><button name="detect"  data-icon="detect" >$(gettext 'Detect PCI/USB')</button><!--
     1.9 -	--><button name="tazx"    data-icon="tazx"   >$(gettext 'Auto-install Xorg video driver')</button>
    1.10 +	--><button name="modules" data-icon="modules">$(gettext 'Kernel modules')</button>
    1.11 +EOT
    1.12 +		[ "$REMOTE_USER" == "root" ] && cat <<EOT
    1.13 +	<button name="detect"  data-icon="detect" >$(gettext 'Detect PCI/USB')</button>
    1.14 +	<button name="tazx"    data-icon="tazx"   >$(gettext 'Auto-install Xorg video driver')</button>
    1.15 +EOT
    1.16 +		cat <<EOT
    1.17  </form>
    1.18  
    1.19  EOT
    1.20 @@ -438,6 +442,8 @@
    1.21  		cat <<EOT
    1.22  			</tbody>
    1.23  		</table>
    1.24 +EOT
    1.25 +		[ "$REMOTE_USER" == "root" ] && cat <<EOT
    1.26  		$(lib crypto input)
    1.27  
    1.28  		<footer>
    1.29 @@ -445,6 +451,8 @@
    1.30  			$(gettext 'new mount point:') <input type="text" name="mountpoint" value="/media/usbdisk"/> -
    1.31  			<input type="checkbox" name="readonly" id="ro"><label for="ro">&thinsp;$(gettext 'read-only')</label>
    1.32  		</footer>
    1.33 +EOT
    1.34 +		cat <<EOT
    1.35  	</form>
    1.36  </section>
    1.37  EOT
     2.1 --- a/index.cgi	Mon Apr 06 17:22:23 2015 +0200
     2.2 +++ b/index.cgi	Mon Apr 06 19:06:05 2015 +0200
     2.3 @@ -161,6 +161,8 @@
     2.4  
     2.5  			cat <<EOT
     2.6  <section>
     2.7 +EOT
     2.8 +			[ -w "$file" ] && cat <<EOT
     2.9  	<header>
    2.10  		<span data-icon="text">$file</span>
    2.11  		<form>
    2.12 @@ -169,7 +171,8 @@
    2.13  			-->$(file_is_modified $file button)
    2.14  		</form>
    2.15  	</header>
    2.16 -
    2.17 +EOT
    2.18 +			cat <<EOT
    2.19  	<div>
    2.20  		<pre>
    2.21  EOT
     3.1 --- a/styles/default/header.html	Mon Apr 06 17:22:23 2015 +0200
     3.2 +++ b/styles/default/header.html	Mon Apr 06 19:06:05 2015 +0200
     3.3 @@ -20,9 +20,13 @@
     3.4     <span>$(gettext 'Panel')</span>
     3.5     <menu>
     3.6      <li><a data-icon="info"     href="/">$(gettext 'Summary')</a></li>
     3.7 +    <li><a data-icon="proc"     href="/index.cgi?top">$(gettext 'Processes')</a></li>
     3.8 +EOT
     3.9 +[ "$REMOTE_USER" == "root" ] && cat << EOT
    3.10      <li><a data-icon="terminal" href="/index.cgi?cmd=help">$(gettext 'Terminal')</a></li>
    3.11 -    <li><a data-icon="proc"     href="/index.cgi?top">$(gettext 'Processes')</a></li>
    3.12      <li><a data-icon="report"   href="/index.cgi?report">$(gettext 'Create Report')</a></li>
    3.13 +EOT
    3.14 +cat << EOT
    3.15      $(for i in menu.d/panel/* ; do [ -f $i ] && sh $i menu $i ; done)
    3.16     </menu>
    3.17    </li>
    3.18 @@ -37,15 +41,6 @@
    3.19     </menu>
    3.20    </li>
    3.21    <li tabindex="3">
    3.22 -   <span>$(gettext 'Settings')</span>
    3.23 -   <menu>
    3.24 -    <li><a data-icon="info"  href="/settings.cgi">$(gettext 'Summary')</a></li>
    3.25 -    <li><a data-icon="user"  href="/settings.cgi?users">$(gettext 'Users')</a></li>
    3.26 -    <li><a data-icon="group" href="/settings.cgi?groups">$(gettext 'Groups')</a></li>
    3.27 -    $(for i in menu.d/settings/* ; do [ -f $i ] && sh $i menu $i ; done)
    3.28 -   </menu>
    3.29 -  </li>
    3.30 -  <li tabindex="4">
    3.31     <span>$(gettext 'Boot')</span>
    3.32     <menu>
    3.33      <li><a data-icon="info" href="/boot.cgi">$(gettext 'Summary')</a></li>
    3.34 @@ -62,16 +57,33 @@
    3.35      $(for i in menu.d/boot/* ; do [ -f $i ] && sh $i menu $i ; done)
    3.36     </menu>
    3.37    </li>
    3.38 -  <li tabindex="5">
    3.39 +  <li tabindex="4">
    3.40     <span>$(gettext 'Hardware')</span>
    3.41     <menu>
    3.42      <li><a data-icon="info"    href="/hardware.cgi">$(gettext 'Summary')</a></li>
    3.43      <li><a data-icon="modules" href="/hardware.cgi?modules">$(gettext 'Kernel modules')</a></li>
    3.44 +EOT
    3.45 +[ "$REMOTE_USER" == "root" ] && cat << EOT
    3.46      <li><a data-icon="detect"  href="/hardware.cgi?detect">$(gettext 'Detect PCI/USB')</a></li>
    3.47 +EOT
    3.48 +cat << EOT
    3.49      <li><a data-icon="hdd"     href="/hardware.cgi#disk">$(gettext 'Disks')</a></li>
    3.50      $(for i in menu.d/hardware/* ; do [ -f $i ] && sh $i menu $i ; done)
    3.51     </menu>
    3.52    </li>
    3.53 +EOT
    3.54 +[ "$REMOTE_USER" == "root" ] && cat << EOT
    3.55 +  <li tabindex="5">
    3.56 +   <span>$(gettext 'Settings')</span>
    3.57 +   <menu>
    3.58 +    <li><a data-icon="info"  href="/settings.cgi">$(gettext 'Summary')</a></li>
    3.59 +    <li><a data-icon="user"  href="/settings.cgi?users">$(gettext 'Users')</a></li>
    3.60 +    <li><a data-icon="group" href="/settings.cgi?groups">$(gettext 'Groups')</a></li>
    3.61 +    $(for i in menu.d/settings/* ; do [ -f $i ] && sh $i menu $i ; done)
    3.62 +   </menu>
    3.63 +  </li>
    3.64 +EOT
    3.65 +cat << EOT
    3.66    $(for i in menu.d/* ; do [ -f $i ] && sh $i menu $i ; done)
    3.67   </menu>
    3.68   <span id="icons">