summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-11-16 11:28:12 -0500
committerStephen Beaver <sbeaver@netgate.com>2015-11-16 11:28:12 -0500
commit261d5071e2eb4bbc218a13fb501eece40308f0df (patch)
tree41d6c00ef3f49a151dd48a8318834440bd79a0f0 /src
parent4b951e647c4e53a6511985d346ed75eb9ea680a3 (diff)
downloadpfsense-261d5071e2eb4bbc218a13fb501eece40308f0df.zip
pfsense-261d5071e2eb4bbc218a13fb501eece40308f0df.tar.gz
Completed #5458
Cosmetic changes to system information widget Cosmetic changes to pkg_mgr_install.php Removed 'Cancel' buttons
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/pkg_mgr_install.php3
-rw-r--r--src/usr/local/www/widgets/widgets/interface_statistics.widget.php116
-rw-r--r--src/usr/local/www/widgets/widgets/system_information.widget.php9
3 files changed, 82 insertions, 46 deletions
diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php
index 1d9cb14..5d69c6c 100644
--- a/src/usr/local/www/pkg_mgr_install.php
+++ b/src/usr/local/www/pkg_mgr_install.php
@@ -336,10 +336,8 @@ if ($input_errors)
<?php
if ($firmwareversion['version'] != $firmwareversion['installed_version'] ) {
?>
- <br />
<input type="hidden" name="id" value="firmware" />
<input type="submit" class="btn btn-success" name="pkgconfirm" id="pkgconfirm" value="Confirm"/>
- <input type="submit" class="btn btn-default" name="pkgcancel" id="pkgcancel" value="Cancel"/>
<?php
} else {
?>
@@ -356,7 +354,6 @@ if ($input_errors)
?>
<input type="hidden" name="id" value="<?=$pkgname;?>" />
<input type="submit" class="btn btn-success" name="pkgconfirm" id="pkgconfirm" value="Confirm"/>
- <input type="submit" class="btn btn-default" name="pkgcancel" id="pkgcancel" value="Cancel"/>
<?php
}
?>
diff --git a/src/usr/local/www/widgets/widgets/interface_statistics.widget.php b/src/usr/local/www/widgets/widgets/interface_statistics.widget.php
index 866d42b..ee71aa7 100644
--- a/src/usr/local/www/widgets/widgets/interface_statistics.widget.php
+++ b/src/usr/local/www/widgets/widgets/interface_statistics.widget.php
@@ -66,43 +66,83 @@ require_once("pfsense-utils.inc");
require_once("functions.inc");
require_once("/usr/local/www/widgets/include/interface_statistics.inc");
-$rows = array(
- 'inpkts' => 'Packets In',
- 'outpkts' => 'Packets Out',
- 'inbytes' => 'Bytes In',
- 'outbytes' => 'Bytes Out',
- 'inerrs' => 'Errors In',
- 'outerrs' => 'Errors Out',
- 'collisions' => 'Collisions',
-);
-$ifdescrs = get_configured_interface_with_descr();
+// Compose the table contents and pass it back to the ajax caller
+if($_REQUEST && $_REQUEST['ajax']) {
+
+ $rows = array(
+ 'inpkts' => 'Packets In',
+ 'outpkts' => 'Packets Out',
+ 'inbytes' => 'Bytes In',
+ 'outbytes' => 'Bytes Out',
+ 'inerrs' => 'Errors In',
+ 'outerrs' => 'Errors Out',
+ 'collisions' => 'Collisions',
+ );
+
+ $ifdescrs = get_configured_interface_with_descr();
+
+ print("<thead>");
+ print( "<tr>");
+ print( "<th></th>");
+
+ foreach ($ifdescrs as $ifname) {
+ print( "<th>" . $ifname . "</th>");
+ }
+
+ print( "</tr>");
+ print( "/thead>");
+ print( "<tbody>");
+
+ foreach ($rows as $key => $name) {
+ print("<tr>");
+ print( "<th>" . $name . "</th>");
+
+ foreach ($ifdescrs as $ifdescr => $ifname) {
+ $ifinfo = get_interface_info($ifdescr);
+
+ if ($ifinfo['status'] == "down")
+ continue;
+
+ $ifinfo['inbytes'] = format_bytes($ifinfo['inbytes']);
+ $ifinfo['outbytes'] = format_bytes($ifinfo['outbytes']);
+
+ print("<td>" . (isset($ifinfo[$key]) ? htmlspecialchars($ifinfo[$key]) : 'n/a') . "</td>");
+ }
+
+ print( "</td>");
+ print( "</tbody>");
+ }
+
+ exit;
+}
?>
-<table class="table table-striped table-hover">
-<thead>
- <tr>
- <td></td>
-<?php foreach ($ifdescrs as $ifname): ?>
- <th><?=$ifname?></th>
-<?php endforeach; ?>
- </tr>
-</thead>
-<tbody>
-<?php foreach ($rows as $key => $name): ?>
- <tr>
- <th><?=$name?></th>
-<?php foreach ($ifdescrs as $ifdescr => $ifname):
- $ifinfo = get_interface_info($ifdescr);
-
- if ($ifinfo['status'] == "down")
- continue;
-
- $ifinfo['inbytes'] = format_bytes($ifinfo['inbytes']);
- $ifinfo['outbytes'] = format_bytes($ifinfo['outbytes']);
- ?>
- <td><?=(isset($ifinfo[$key]) ? htmlspecialchars($ifinfo[$key]) : 'n/a')?></td>
-<?php endforeach; ?>
- </tr>
-<?php endforeach; ?>
- </tbody>
-</table> \ No newline at end of file
+<table id="iftbl" class="table table-striped table-hover">
+ <tr><td><?=gettext("Retrieving interface data")?></td></tr>
+</table>
+
+<script>
+//<![CDATA[
+
+ function get_if_stats() {
+ var ajaxRequest;
+
+ ajaxRequest = $.ajax({
+ url: "/widgets/widgets/interface_statistics.widget.php",
+ type: "post",
+ data: { ajax: "ajax"}
+ });
+
+ // Deal with the results of the above ajax call
+ ajaxRequest.done(function (response, textStatus, jqXHR) {
+ $('#iftbl').html(response);
+ // and do it again
+ setTimeout(get_if_stats, 5000);
+ });
+ }
+
+ events.push(function(){
+ get_if_stats();
+ });
+//]]>
+</script> \ No newline at end of file
diff --git a/src/usr/local/www/widgets/widgets/system_information.widget.php b/src/usr/local/www/widgets/widgets/system_information.widget.php
index 326e845..2db61f7 100644
--- a/src/usr/local/www/widgets/widgets/system_information.widget.php
+++ b/src/usr/local/www/widgets/widgets/system_information.widget.php
@@ -83,11 +83,10 @@ if ($_REQUEST['getupdatestatus']) {
switch ($version_compare) {
case '<':
?>
- <div class="alert alert-warning" role="alert">
- Version <?=$system_version['version']?> <?=gettext("is available. ")?>
- <a href="/pkg_mgr_install.php?id=firmware" class="alert-link">
- <?=gettext("Click Here to update.")?>
- </a>
+ <div>
+ <?=gettext("Version ")?>
+ <span style="color: green"><?=$system_version['version']?></span> <?=gettext("is available.")?>
+ <a class="fa fa-cloud-download fa-lg" href="/pkg_mgr_install.php?id=firmware"></a>
</div>
<?php
break;
OpenPOWER on IntegriCloud