Revision 1df0159c
Added by Erik Kristensen almost 20 years ago
usr/local/www/index.php | ||
---|---|---|
32 | 32 |
POSSIBILITY OF SUCH DAMAGE. |
33 | 33 |
*/ |
34 | 34 |
|
35 |
require_once('guiconfig.inc'); |
|
36 |
require_once('notices.inc'); |
|
35 |
## Load Essential Includes |
|
36 |
require_once('guiconfig.inc'); |
|
37 |
require_once('notices.inc'); |
|
37 | 38 |
|
38 | 39 |
|
39 |
require_once('includes/functions.inc.php'); |
|
40 |
## Load Functions Files |
|
41 |
require_once('includes/functions.inc.php'); |
|
40 | 42 |
|
41 | 43 |
|
44 |
## Load AJAX, Initiate Class ############################################### |
|
45 |
require_once('includes/sajax.class.php'); |
|
42 | 46 |
|
43 |
/* SAJAX STUFF */ |
|
44 |
require_once('includes/sajax.class.php'); |
|
47 |
## Initiate Class and Set location of ajax file containing |
|
48 |
## the information that we need for this page. Also set functions |
|
49 |
## that SAJAX will be using. |
|
50 |
$oSajax = new sajax(); |
|
51 |
$oSajax->sajax_remote_uri = 'sajax/index.sajax.php'; |
|
52 |
$oSajax->sajax_request_type = 'POST'; |
|
53 |
$oSajax->sajax_export("mem_usage","cpu_usage","get_uptime","get_pfstate"); |
|
54 |
$oSajax->sajax_handle_client_request(); |
|
55 |
############################################################################ |
|
45 | 56 |
|
46 |
$oSajax = new sajax(); |
|
47 |
$oSajax->sajax_remote_uri = 'sajax/index.sajax.php'; |
|
48 |
$oSajax->sajax_request_type = 'POST'; |
|
49 |
$oSajax->sajax_export("mem_usage","cpu_usage","get_uptime","get_pfstate"); |
|
50 |
$oSajax->sajax_handle_client_request(); |
|
51 |
/***************/ |
|
52 | 57 |
|
58 |
## Check to see if we have a swap space, |
|
59 |
## if true, display, if false, hide it ... |
|
60 |
$swapinfo = `/usr/sbin/swapinfo`; |
|
61 |
if(stristr($swapinfo,'%') == true) $showswap=true; |
|
53 | 62 |
|
54 | 63 |
|
55 |
$swapinfo = `/usr/sbin/swapinfo`; |
|
56 |
if(stristr($swapinfo,'%') == true) $showswap=true; |
|
64 |
## User recently restored his config. |
|
65 |
## If packages are installed lets resync |
|
66 |
if(file_exists('/needs_package_sync')) { |
|
67 |
if($config['installedpackages'] <> '') { |
|
68 |
conf_mount_rw(); |
|
69 |
unlink('/needs_package_sync'); |
|
70 |
header('Location: pkg_mgr_install.php?mode=reinstallall'); |
|
71 |
exit; |
|
72 |
} |
|
73 |
} |
|
57 | 74 |
|
58 |
/* User recently restored his config. |
|
59 |
If packages are installed lets resync |
|
60 |
*/ |
|
61 |
if(file_exists('/needs_package_sync')) { |
|
62 |
if($config['installedpackages'] <> '') { |
|
75 |
|
|
76 |
## If it is the first time webGUI has been |
|
77 |
## accessed since initial install show this stuff. |
|
78 |
if(file_exists('/trigger_initial_wizard')) { |
|
63 | 79 |
conf_mount_rw(); |
64 |
unlink('/needs_package_sync'); |
|
65 |
header('Location: pkg_mgr_install.php?mode=reinstallall'); |
|
80 |
unlink('/trigger_initial_wizard'); |
|
81 |
conf_mount_ro(); |
|
82 |
|
|
83 |
$pgtitle = 'pfSense first time setup'; |
|
84 |
include('head.inc'); |
|
85 |
|
|
86 |
echo "<body link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">\n"; |
|
87 |
echo "<form>\n"; |
|
88 |
echo "<center>\n"; |
|
89 |
echo "<img src=\"/themes/{$g['theme']}/images/logo.gif\" border=\"0\"><p>\n"; |
|
90 |
echo "<div \" style=\"width:700px;background-color:#ffffff\" id=\"nifty\">\n"; |
|
91 |
echo "Welcome to pfSense!<p>\n"; |
|
92 |
echo "One moment while we start the initial setup wizard.<p>\n"; |
|
93 |
echo "Embedded platform users: Please be patient, the wizard takes a little longer to run than the normal gui.<p>\n"; |
|
94 |
echo "To bypass the wizard, click on the pfSense wizard on the initial page.\n"; |
|
95 |
echo "</div>\n"; |
|
96 |
echo "<meta http-equiv=\"refresh\" content=\"1;url=wizard.php?xml=setup_wizard.xml\">\n"; |
|
97 |
echo "<script type=\"text/javascript\">\n"; |
|
98 |
echo "NiftyCheck();\n"; |
|
99 |
echo "Rounded(\"div#nifty\",\"all\",\"#000\",\"#FFFFFF\",\"smooth\");\n"; |
|
100 |
echo "</script>\n"; |
|
66 | 101 |
exit; |
67 | 102 |
} |
68 |
} |
|
69 | 103 |
|
70 |
if(file_exists('/trigger_initial_wizard')) { |
|
71 |
conf_mount_rw(); |
|
72 |
unlink('/trigger_initial_wizard'); |
|
73 |
conf_mount_ro(); |
|
74 |
|
|
75 |
$pgtitle = 'pfSense first time setup'; |
|
76 |
include('head.inc'); |
|
77 |
|
|
78 |
?> |
|
79 |
<body link='#0000CC' vlink='#0000CC' alink='#0000CC'> |
|
80 |
<form> |
|
81 |
<?php |
|
82 |
echo "<center>\n"; |
|
83 |
echo "<img src=\"/themes/{$g['theme']}/images/logo.gif\" border=\"0\"><p>\n"; |
|
84 |
echo "<div \" style=\"width:700px;background-color:#ffffff\" id=\"nifty\">\n"; |
|
85 |
echo "Welcome to pfSense!<p>\n"; |
|
86 |
echo "One moment while we start the initial setup wizard.<p>\n"; |
|
87 |
echo "Embedded platform users: Please be patient, the wizard takes a little longer to run than the normal gui.<p>\n"; |
|
88 |
echo "To bypass the wizard, click on the pfSense wizard on the initial page.\n"; |
|
89 |
echo "</div>\n"; |
|
90 |
echo "<meta http-equiv=\"refresh\" content=\"1;url=wizard.php?xml=setup_wizard.xml\">\n"; |
|
91 |
echo "<script type=\"text/javascript\">\n"; |
|
92 |
echo "NiftyCheck();\n"; |
|
93 |
echo "Rounded(\"div#nifty\",\"all\",\"#000\",\"#FFFFFF\",\"smooth\");\n"; |
|
94 |
echo "</script>\n"; |
|
95 |
exit; |
|
96 |
} |
|
97 | 104 |
|
98 |
/* find out whether there's hardware encryption (hifn) */ |
|
99 |
unset($hwcrypto); |
|
100 |
$fd = @fopen("{$g['varlog_path']}/dmesg.boot", "r"); |
|
101 |
if ($fd) { |
|
102 |
while (!feof($fd)) { |
|
103 |
$dmesgl = fgets($fd); |
|
104 |
if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches)) { |
|
105 |
$hwcrypto = $matches[1]; |
|
106 |
break; |
|
105 |
## Find out whether there's hardware encryption or not |
|
106 |
unset($hwcrypto); |
|
107 |
$fd = @fopen("{$g['varlog_path']}/dmesg.boot", "r"); |
|
108 |
if ($fd) { |
|
109 |
while (!feof($fd)) { |
|
110 |
$dmesgl = fgets($fd); |
|
111 |
if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches)) { |
|
112 |
$hwcrypto = $matches[1]; |
|
113 |
break; |
|
114 |
} |
|
107 | 115 |
} |
116 |
fclose($fd); |
|
108 | 117 |
} |
109 |
fclose($fd); |
|
110 |
} |
|
111 | 118 |
|
112 | 119 |
|
113 |
|
|
114 |
$pgtitle = "pfSense webGUI"; |
|
115 |
/* include header and other code */ |
|
116 |
include("head.inc"); |
|
120 |
## Set Page Title and Include Header |
|
121 |
$pgtitle = "pfSense webGUI"; |
|
122 |
include("head.inc"); |
|
117 | 123 |
|
118 | 124 |
?> |
119 | 125 |
|
120 | 126 |
<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> |
121 |
<script language="javascript" type="text/javascript"> |
|
122 |
<?php $oSajax->sajax_show_javascript(); ?> |
|
123 |
</script> |
|
124 | 127 |
|
125 |
<form> |
|
126 | 128 |
<?php |
127 |
|
|
128 | 129 |
include("fbegin.inc"); |
129 | 130 |
if(!file_exists("/usr/local/www/themes/{$g['theme']}/no_big_logo")) |
130 | 131 |
echo "<center><img src=\"./themes/".$g['theme']."/images/logobig.jpg\"></center><br>"; |
131 | 132 |
?> |
132 | 133 |
<p class="pgtitle">System Overview</p> |
133 | 134 |
|
134 |
<div id="niftyOutter" width="650"> |
|
135 |
<div id="niftyOutter"> |
|
136 |
<form action="index.php" method="post"> |
|
135 | 137 |
<table bgcolor="#990000" width="100%" border="0" cellspacing="0" cellpadding="0"> |
136 | 138 |
<tbody> |
137 | 139 |
<tr> |
... | ... | |
181 | 183 |
<td width="25%" class="vncellt">CPU usage</td> |
182 | 184 |
<td width="75%" class="listr"> |
183 | 185 |
<?php $cpuUsage = get_cpuusage(get_cputicks(), get_cputicks()); ?> |
184 |
<img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="absmiddle" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" name="cpuwidtha" id="cpuwidtha" width="<?= $cpuUsage; ?>" border="0" align="absmiddle" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" name="cpuwidthb" id="cpuwidthb" width="<?= (100 - $cpuUsage); ?>" border="0" align="absmiddle" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="absmiddle" /><input style="border: 0px solid white;" size="30" name="cpumeter" id="cpumeter" value="<?= $cpuUsage.'%'; ?> (Updating in 3 seconds)" />
|
|
186 |
<img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" name="cpuwidtha" id="cpuwidtha" width="<?= $cpuUsage; ?>" border="0" align="middle" alt="blue bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" name="cpuwidthb" id="cpuwidthb" width="<?= (100 - $cpuUsage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" /><input style="border: 0px solid white;" size="30" name="cpumeter" id="cpumeter" value="<?= $cpuUsage.'%'; ?> (Updating in 3 seconds)" />
|
|
185 | 187 |
</td> |
186 | 188 |
</tr> |
187 | 189 |
<tr> |
188 | 190 |
<td width="25%" class="vncellt">Memory usage</td> |
189 | 191 |
<td width="75%" class="listr"> |
190 | 192 |
<?php $memUsage = mem_usage(); ?> |
191 |
<img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="absmiddle" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" name="memwidtha" id="memwidtha" width="<?= $memUsage; ?>" border="0" align="absmiddle" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" name="memwidthb" id="memwidthb" width="<?= (100 - $memUsage); ?>" border="0" align="absmiddle" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="absmiddle" /><input style="border: 0px solid white;" size="30" name="memusagemeter" id="memusagemeter" value="<?= $memUsage.'%'; ?>" />
|
|
193 |
<img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" name="memwidtha" id="memwidtha" width="<?= $memUsage; ?>" border="0" align="middle" alt="blue bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" name="memwidthb" id="memwidthb" width="<?= (100 - $memUsage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" /><input style="border: 0px solid white;" size="30" name="memusagemeter" id="memusagemeter" value="<?= $memUsage.'%'; ?>" />
|
|
192 | 194 |
</td> |
193 | 195 |
</tr> |
194 | 196 |
<?php if($showswap == true): ?> |
... | ... | |
196 | 198 |
<td width="25%" class="vncellt">SWAP usage</td> |
197 | 199 |
<td width="75%" class="listr"> |
198 | 200 |
<?php $swapusage = swap_usage(); ?> |
199 |
<img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="absmiddle" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" width="<?= $swapUsage; ?>" border="0" align="absmiddle" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" width="<?= (100 - $swapUsage); ?>" border="0" align="absmiddle" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="absmiddle" /><input style="border: 0px solid white;" size="30" name="swapusagemeter" id="swapusagemeter" value="<?= $swapusage.'%'; ?>" />
|
|
201 |
<img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" width="<?= $swapUsage; ?>" border="0" align="middle" alt="blue bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" width="<?= (100 - $swapUsage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" /><input style="border: 0px solid white;" size="30" name="swapusagemeter" id="swapusagemeter" value="<?= $swapusage.'%'; ?>" />
|
|
200 | 202 |
</td> |
201 | 203 |
</tr> |
202 | 204 |
<?php endif; ?> |
... | ... | |
210 | 212 |
<tr> |
211 | 213 |
<td width='25%' class='vncellt'>Temperature</td> |
212 | 214 |
<td width='75%' class='listr'> |
213 |
<img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="absmiddle" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_blue.gif" height="15" name="Tempwidtha" id="tempwidtha" width="<?= $temp; ?>" border="0" align="absmiddle" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_gray.gif" height="15" name="Tempwidthb" id="tempwidthb" width="<?= (100 - $temp); ?>" border="0" align="absmiddle" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="absmiddle" /><input style="border: 0px solid white;" size="30" name="Tempmeter" id="Tempmeter" value="<?= $temp."C"; ?>" />
|
|
215 |
<img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_blue.gif" height="15" name="Tempwidtha" id="tempwidtha" width="<?= $temp; ?>" border="0" align="middle" alt="blue bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_gray.gif" height="15" name="Tempwidthb" id="tempwidthb" width="<?= (100 - $temp); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" /><input style="border: 0px solid white;" size="30" name="Tempmeter" id="Tempmeter" value="<?= $temp."C"; ?>" />
|
|
214 | 216 |
</td> |
215 | 217 |
</tr> |
216 | 218 |
<?php endif; ?> |
... | ... | |
218 | 220 |
<td width="25%" class="vncellt">Disk usage</td> |
219 | 221 |
<td width="75%" class="listr"> |
220 | 222 |
<?php $diskusage = disk_usage(); ?> |
221 |
<img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="absmiddle" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_blue.gif" height="15" width="<?= $diskusage; ?>" border="0" align="absmiddle" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_gray.gif" height="15" width="<?= (100 - $diskusage); ?>" border="0" align="absmiddle" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="absmiddle" />
|
|
223 |
<img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_blue.gif" height="15" width="<?= $diskusage; ?>" border="0" align="middle" alt="blue bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_gray.gif" height="15" width="<?= (100 - $diskusage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" />
|
|
222 | 224 |
<?php echo $diskusage . "%"; ?> |
223 | 225 |
</td> |
224 | 226 |
</tr> |
225 | 227 |
</tbody> |
226 | 228 |
</table> |
229 |
</form> |
|
227 | 230 |
</div> |
228 | 231 |
|
229 | 232 |
<?php include("fend.inc"); ?> |
... | ... | |
232 | 235 |
NiftyCheck(); |
233 | 236 |
Rounded("div#nifty","top","#FFF","#EEEEEE","smooth"); |
234 | 237 |
</script> |
235 |
</form> |
|
238 |
|
|
236 | 239 |
|
237 | 240 |
</body> |
238 | 241 |
</html> |
Also available in: Unified diff
XHTML/CSS Clean Up