diff options
author | Colin Smith <colin@pfsense.org> | 2005-06-19 07:00:10 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-06-19 07:00:10 +0000 |
commit | 0682e26bff6809e2773132536aa143c127fbe160 (patch) | |
tree | 9855fe2ce484cfd51b7ac0a8a93519df32e02be8 /usr/local | |
parent | f26efd50628f4faba30249a831cb6cb535e58a87 (diff) | |
download | pfsense-0682e26bff6809e2773132536aa143c127fbe160.zip pfsense-0682e26bff6809e2773132536aa143c127fbe160.tar.gz |
Add disk usage meter. This will eventually be integrated with the package system etc.
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/index.php | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/usr/local/www/index.php b/usr/local/www/index.php index 7f669bc..fe9438e 100755 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -24,7 +24,7 @@ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + oR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) @@ -49,9 +49,9 @@ if(file_exists("/needs_package_sync")) { } } -if(file_exists("/trigger_initial_wizard")) { +if(file_exists("/usr/local/www/trigger_initial_wizard")) { conf_mount_rw(); - unlink("/trigger_initial_wizard"); + unlink("/usr/local/www/trigger_initial_wizard"); conf_mount_ro(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> @@ -300,6 +300,21 @@ echo " </td>"; echo " </tr>"; } ?> + <tr> + <td width="25%" class="vncellt">Disk usage</td> + <td width="75%" class="listr"> +<?php +exec("df -h | grep -w '/' | awk '{ print $5 }' | cut -d '%' -f 1", $dfout); +$diskusage = trim($dfout[0]); + +echo "<img src='bar_left.gif' height='15' width='4' border='0' align='absmiddle'>"; +echo "<img src='bar_blue.gif' height='15' width='" . $diskusage . "' border='0' align='absmiddle'>"; +echo "<img src='bar_gray.gif' height='15' width='" . (100 - $diskusage) . "' border='0' align='absmiddle'>"; +echo "<img src='bar_right.gif' height='15' width='5' border='0' align='absmiddle'> "; +echo $diskusage . "%"; +?> + </td> + </tr> </table> @@ -348,6 +363,15 @@ While(!Connection_Aborted()) { echo "document.forms[0].Tempmeter.value = '" . $Temp . "C';\n"; } +/* + exec("df -h | grep -w '/' | awk '{ print $5 }' | cut -d '%' -f 1", $dfout); + $diskusage = trim($dfout[0]); + + echo "document.Diskwidtha.style.width='" . $diskusage . "';\n"; + echo "document.Diskwidthb.style.width='" . (100 - $diskusage) . "';\n"; + echo "document.forms[0].Diskmeter.value = '" . $diskusage . "%';\n"; +*/ + echo "</script>\n"; /* |