tazpanel rev 375
hardware.cgi: input type=file does not return allways the path
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jul 29 20:45:13 2013 +0200 (2013-07-29) |
parents | 7f8ca464ff96 |
children | c6752ed0e680 |
files | hardware.cgi |
line diff
1.1 --- a/hardware.cgi Thu Jul 25 02:46:28 2013 +0300 1.2 +++ b/hardware.cgi Mon Jul 29 20:45:13 2013 +0200 1.3 @@ -279,7 +279,9 @@ 1.4 case "$device" in 1.5 *[\;\`\&\|\$]*) ;; 1.6 mount\ *) 1.7 - $device $(GET mountpoint);; 1.8 + ro="" 1.9 + [ -n "$(GET readonly)" ] && ro="-r" 1.10 + $device $ro $(GET mountpoint);; 1.11 umount\ *|swapon\ *|swapoff\ *) 1.12 $device ;; 1.13 esac 1.14 @@ -295,6 +297,8 @@ 1.15 size=$2 1.16 used=$3 1.17 av=$4 1.18 + grep "^$fs " /proc/mounts | grep -q "[, ]ro[, ]" && 1.19 + av="<del>$av</del>" 1.20 pct=$5 1.21 mp=$6 1.22 action="mount" 1.23 @@ -354,7 +358,8 @@ 1.24 </table> 1.25 $(lib crypto input) 1.26 <input type="submit" value="mount / umount" /> - 1.27 -new mount point <input type=text" name="mountpoint" value="/media/usbdisk" /> 1.28 +new mount point <input type=text" name="mountpoint" value="/media/usbdisk" /> - 1.29 +<input type="checkbox" name="readonly"> read-only 1.30 </form> 1.31 1.32 1.33 @@ -416,9 +421,9 @@ 1.34 </table> 1.35 $(lib crypto input) 1.36 <input type="submit" value="Setup" /> - 1.37 -new backing file <input type="file" name="backingfile" /> - 1.38 +new backing file <input type="text" name="backingfile" /> - 1.39 offset in bytes <input type="text" name="offset" size="8" value="0" /> - 1.40 -<input type="checkbox" name "readonly"> read-only 1.41 +<input type="checkbox" name="readonly"> read-only 1.42 </form> 1.43 EOT 1.44