Commit cc6530f6 authored by Franco Fichtner's avatar Franco Fichtner

widgets: apply whitespace cleanups

parent 8be7fb86
......@@ -4,4 +4,4 @@
$installed_packages_title = "Installed Packages";
$installed_packages_title_link = "pkg_mgr_installed.php";
?>
\ No newline at end of file
?>
......@@ -2,4 +2,4 @@
//set variable for custom title
$interface_statistics_title = "Interface Statistics";
$interface_statistics_title_link = "status_interfaces.php";
?>
\ No newline at end of file
?>
......@@ -3,4 +3,4 @@
$interfaces_title = "Interfaces";
$interfaces_title_link = "status_interfaces.php";
?>
\ No newline at end of file
?>
......@@ -3,4 +3,4 @@
$log_title = "Firewall Logs";
$log_title_link = "diag_logs_filter.php";
?>
\ No newline at end of file
?>
<?php
$openvpn_title = "OpenVPN";
$openvpn_title_link = "status_openvpn.php";
?>
\ No newline at end of file
?>
......@@ -4,4 +4,4 @@
$services_status_title = "Services Status";
$services_status_title_link = "status_services.php";
?>
\ No newline at end of file
?>
<?php
/*
$Id: thermal_sensors.inc
File location:
File location:
\usr\local\www\widgets\include\
Used by:
......@@ -22,6 +22,6 @@ function getThermalSensorsData() {
$_gb = exec("/sbin/sysctl -a | grep temperature", $dfout);
$thermalSensorsData = join("|", $dfout);
return $thermalSensorsData;
}
?>
......@@ -4,4 +4,4 @@
$wake_on_lan_title = "Wake On Lan";
$wake_on_lan_title_link = "services_wol.php";
?>
\ No newline at end of file
?>
......@@ -2,8 +2,8 @@ function updateIpsec(){
selectIntLink = "ipsecDetailed";
ipsecsettings = "ipsecDetail=";
ipsecsettings += d.getElementById(selectIntLink).checked;
selectIntLink = "ipsec-config";
textlink = d.getElementById(selectIntLink);
textlink.value = ipsecsettings;
}
\ No newline at end of file
}
function trafficshowDiv(incDiv,swapButtons){
//appear element
selectedDiv = incDiv + "graphdiv";
jQuery('#' + selectedDiv).show();
d = document;
jQuery('#' + selectedDiv).show();
d = document;
if (swapButtons){
selectIntLink = selectedDiv + "-min";
textlink = d.getElementById(selectIntLink);
textlink.style.display = "inline";
textlink.style.display = "inline";
selectIntLink = selectedDiv + "-open";
textlink = d.getElementById(selectIntLink);
textlink.style.display = "none";
}
document.iform["shown[" + incDiv + "]"].value = "show";
}
function trafficminimizeDiv(incDiv,swapButtons){
//fade element
selectedDiv = incDiv + "graphdiv";
jQuery('#' + selectedDiv).hide();
d = document;
jQuery('#' + selectedDiv).hide();
d = document;
if (swapButtons){
selectIntLink = selectedDiv + "-open";
textlink = d.getElementById(selectIntLink);
textlink.style.display = "inline";
textlink.style.display = "inline";
selectIntLink = selectedDiv + "-min";
textlink = d.getElementById(selectIntLink);
textlink.style.display = "none";
}
}
document.iform["shown[" + incDiv + "]"].value = "hide";
}
<?php
<?php
/*
captive_portal_status.widget.php
Copyright (C) 2007 Sam Wenham
......@@ -6,20 +6,20 @@
status_captiveportal.php
part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
......@@ -63,15 +63,15 @@ $a_cp =& $config['captiveportal'];
$cpdb_all = array();
foreach ($a_cp as $cpzone => $cp) {
$cpdb_handle = new OPNsense\CaptivePortal\DB($cpzone);
$cpdb_handle = new OPNsense\CaptivePortal\DB($cpzone);
$order = "";
$order = "";
if ($_GET['order']) {
if ($_GET['order'] == "ip") $order = "ip";
else if ($_GET['order'] == "mac") $order = "mac";
else if ($_GET['order'] == "user") $order = "username";
}
$cpdb = $cpdb_handle->listClients(array(),"and",array($order) ) ;
$cpdb_all[$cpzone] = $cpdb;
}
......
......@@ -126,5 +126,3 @@ $counter = 1;
</tr>
<?php } // foreach ?>
</table>
......@@ -77,12 +77,12 @@ require_once("/usr/local/www/widgets/include/interfaces.inc");
<?php if($ifinfo['status'] == "up" || $ifinfo['status'] == "associated") { ?>
<td class="listr" align="center">
<span id="<?php echo $ifname;?>" class="glyphicon glyphicon-arrow-up text-success"></span>
</td>
<?php } else if ($ifinfo['status'] == "no carrier") { ?>
<td class="listr" align="center">
<span id="<?php echo $ifname;?>" class="glyphicon glyphicon-arrow-down text-danger"></span>
</td>
<?php } else if ($ifinfo['status'] == "down") { ?>
<td class="listr" align="center">
......@@ -94,13 +94,13 @@ require_once("/usr/local/www/widgets/include/interfaces.inc");
</td>
<td class="vncellt">
<?php if($ifinfo['ipaddr'] != "") { ?>
<div id="<?php echo $ifname;?>-ip" style="display:inline"><?=htmlspecialchars($ifinfo['ipaddr']);?> </div>
<br />
<div id="<?php echo $ifname;?>-ip" style="display:inline"><?=htmlspecialchars($ifinfo['ipaddr']);?> </div>
<br />
<?php }
if ($ifinfo['ipaddrv6'] != "") { ?>
<div id="<?php echo $ifname;?>-ipv6" style="display:inline"><?=htmlspecialchars($ifinfo['ipaddrv6']);?> </div>
<?php } ?>
</td>
</tr>
<?php }//end for each ?>
<?php }//end for each ?>
</table>
......@@ -84,7 +84,7 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<table class="table table-striped" width="100%" border="0" cellspacing="0" cellpadding="0" summary="interfaces statistics">
<tr><td class="widgetsubheader" style="height:25px">&nbsp;&nbsp;&nbsp;</td></tr>
<tr>
<td><b><?php echo gettext('Packets In')?></b></td>
<td><b><?php echo gettext('Packets In')?></b></td>
</tr>
<tr>
<td><b><?php echo gettext('Packets Out')?></b></td>
......@@ -111,12 +111,12 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<table class="table table-striped" width="100%" border="0" cellspacing="0" cellpadding="0" summary="the stats">
<tr>
<?php
$interface_names = array();
foreach ($ifdescrs as $ifdescr => $ifname):
$ifinfo = get_interface_info($ifdescr);
if ($ifinfo['status'] != "down"){ ?>
<td class="widgetsubheader nowrap" style="height:25px">
<b><?=htmlspecialchars($ifname);?></b>
$interface_names = array();
foreach ($ifdescrs as $ifdescr => $ifname):
$ifinfo = get_interface_info($ifdescr);
if ($ifinfo['status'] != "down"){ ?>
<td class="widgetsubheader nowrap" style="height:25px">
<b><?=htmlspecialchars($ifname);?></b>
</td>
<?php
//build array of interface names
......@@ -135,9 +135,9 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<tr>
<?php
$counter = 2;
foreach ($array_out_packets as $data): ?>
......@@ -147,10 +147,10 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<?php
<?php
$counter = 3;
foreach ($array_in_bytes as $data): ?>
<td class="listr nowrap" id="stat<?php echo $counter;?>" style="height:25px">
......@@ -159,9 +159,9 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<tr>
<?php
$counter = 4;
foreach ($array_out_bytes as $data): ?>
......@@ -171,9 +171,9 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<tr>
<?php
$counter = 5;
foreach ($array_in_errors as $data): ?>
......@@ -183,11 +183,11 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<?php
$counter = 6;
<?php
$counter = 6;
foreach ($array_out_errors as $data): ?>
<td class="listr nowrap" id="stat<?php echo $counter;?>" style="height:25px">
<?=htmlspecialchars($data);?>
......@@ -195,11 +195,11 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
<?php
$counter = $counter + 7;
endforeach; ?>
</tr>
</tr>
<tr>
<?php
$counter = 7;
<?php
$counter = 7;
foreach ($array_collisions as $data): ?>
<td class="listr nowrap" id="stat<?php echo $counter;?>" style="height:25px">
<?=htmlspecialchars($data);?>
......
......@@ -172,7 +172,7 @@ if (isset($config['ipsec']['phase1'])){?>
<?php
if (is_array($mobile['pool'])):
foreach ($mobile['pool'] as $pool):
if (is_array($pool['lease'])):
if (is_array($pool['lease'])):
foreach ($pool['lease'] as $muser) : ?>
<div style="display:table-row;">
<div class="listlr" style="display:table-cell;width:139px">
......
......@@ -14,7 +14,7 @@
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
......
......@@ -146,7 +146,7 @@ if($_REQUEST['updateme']) {
<td width="40%" class="vncellt">Clock location</td>
<td width="60%" class="listr">
<a target="_gmaps" href="http://maps.google.com/?q=<?php echo $gps_lat; ?>,<?php echo $gps_lon; ?>">
<?php
<?php
echo sprintf("%.5f", $gps_lat) . " " . $gps_la . ", " . sprintf("%.5f", $gps_lon) . " " . $gps_lo; ?>
</a>
<?php if (isset($gps_alt)) {echo " (" . $gps_alt . " " . $gps_alt_unit . " alt.)";} ?>
......@@ -156,10 +156,10 @@ if($_REQUEST['updateme']) {
<tr>
<td width="40%" class="vncellt">Satellites</td>
<td width="60%" class="listr">
<?php
<?php
if (isset($gps_satview)) {echo 'in view ' . intval($gps_satview);}
if (isset($gps_sat) && isset($gps_satview)) {echo ', ';}
if (isset($gps_sat)) {echo 'in use ' . $gps_sat;}
if (isset($gps_sat)) {echo 'in use ' . $gps_sat;}
?>
</td>
</tr>
......@@ -167,7 +167,7 @@ if($_REQUEST['updateme']) {
<?php endif; ?>
</tbody>
</table>
<?php
<?php
exit;
}
......@@ -266,7 +266,7 @@ History: 1.0 2000-05-09 GIF-image digits
cookies to work around Win IE stale-time bug
2.1 2002-10-12 Noted Mozilla 1.0 compatibility; released PHP version.
2.1.1 2002-10-20 Fixed octal bug in the PHP translation; the number of
minutes & seconds were misinterpretes when less than 10
minutes & seconds were misinterpretes when less than 10
2.1.2 2003-08-07 The previous fix had introduced a bug when the
minutes or seconds were exactly 0. Thanks to Man Bui
for reporting the bug.
......@@ -356,7 +356,7 @@ function clockTimeString(inHours, inMinutes, inSeconds) {
}
function clockDisplayTime(inHours, inMinutes, inSeconds) {
clockWriteToDiv("ClockTime", clockTimeString(inHours, inMinutes, inSeconds));
}
......@@ -416,7 +416,7 @@ function clockUpdate()
{
var lastLocalTime = localTime;
localTime = (new Date()).getTime();
/* Sanity-check the diff. in local time between successive calls;
reload if user has reset system clock */
if (clockOffset == null) {
......@@ -431,11 +431,11 @@ function clockUpdate()
location.reload(); // will refresh time values in cookies
}
else {
// Compute what time would be on server
// Compute what time would be on server
var serverTime = new Date(localTime + clockOffset);
clockDisplayTime(serverTime.getHours(), serverTime.getMinutes(),
serverTime.getSeconds());
// Reschedule this func to run on next even clockIncrementMillis boundary
clockTimerID = setTimeout("clockUpdate()",
clockIncrementMillis - (serverTime.getTime() % clockIncrementMillis));
......
......@@ -2,7 +2,7 @@
/*
Copyright (C) 2014 Deciso B.V.
Copyright 2007 Scott Dale
Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
and Jonathan Watt <jwatt@jwatt.org>.
All rights reserved.
......@@ -42,10 +42,10 @@ if($_POST['action'] == 'pkg_update') {
$shell = new Core\Shell();
// execute shell command and collect (only valid) info into named array
$shell->exec("/usr/local/opnsense/scripts/pkg_updatecheck.sh",false,false,$shell_output);
}
}
if (file_exists($file_pkg_status)) {
$json = file_get_contents($file_pkg_status);
$pkg_status = json_decode($json,true);
}
......@@ -65,7 +65,7 @@ if($_REQUEST['getupdatestatus']) {
echo "<span class='text-danger'>".gettext("Unknown")."</span><br/><span class='btn-link' onclick='checkupdate()'>".gettext("Click to check now")."</span>";
}
exit;
}
}
$curcfg = $config['system']['firmware'];
......@@ -74,7 +74,7 @@ $filesystems = get_mounted_filesystems();
?>
<script type="text/javascript">
//<![CDATA[
jQuery(function() {
jQuery(function() {
jQuery("#statePB").css( { width: '<?php echo get_pfstate(true); ?>%' } );
jQuery("#mbufPB").css( { width: '<?php echo get_mbuf(true); ?>%' } );
jQuery("#cpuPB").css( { width:0 } );
......@@ -89,7 +89,7 @@ $filesystems = get_mounted_filesystems();
jQuery("#swapUsagePB").css( { width: '<?php echo swap_usage(); ?>%' } );
<?php endif; ?>
<?php if (get_temp() != ""): ?>
jQuery("#tempPB").css( { width: '<?php echo get_temp(); ?>%' } );
jQuery("#tempPB").css( { width: '<?php echo get_temp(); ?>%' } );
<?php endif; ?>
});
//]]>
......@@ -154,7 +154,7 @@ $filesystems = get_mounted_filesystems();
<tr>
<td width="25%" class="vncellt"><?=gettext("CPU Type");?></td>
<td width="75%" class="listr">
<?php
<?php
echo (htmlspecialchars(get_single_sysctl("hw.model")));
?>
<div id="cpufreq"><?= get_cpufreq(); ?></div>
......@@ -191,7 +191,7 @@ $filesystems = get_mounted_filesystems();
}
?>
</td>
</tr>
</tr>
<?php if ($config['revision']): ?>
<tr>
<td width="25%" class="vncellt"><?=gettext("Last config change");?></td>
......@@ -209,10 +209,10 @@ $filesystems = get_mounted_filesystems();
<span class="sr-only"></span>
</div>
</div>
<span id="pfstateusagemeter"><?= $pfstateusage.'%'; ?></span> (<span id="pfstate"><?= htmlspecialchars($pfstatetext); ?></span>)
<br />
<a href="diag_dump_states.php"><?=gettext("Show states");?></a>
<br />
<a href="diag_dump_states.php"><?=gettext("Show states");?></a>
</td>
</tr>
<tr>
......@@ -222,7 +222,7 @@ $filesystems = get_mounted_filesystems();
$mbufstext = get_mbuf();
$mbufusage = get_mbuf(true);
?>
<div class="progress">
<div id="mbufPB" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
<span class="sr-only"></span>
......@@ -236,7 +236,7 @@ $filesystems = get_mounted_filesystems();
<td width="25%" class="vncellt"><?=gettext("Temperature");?></td>
<td width="75%" class="listr">
<?php $TempMeter = $temp = get_temp(); ?>
<div class="progress">
<div id="tempPB" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
<span class="sr-only"></span>
......@@ -255,7 +255,7 @@ $filesystems = get_mounted_filesystems();
<tr>
<td width="25%" class="vncellt"><?=gettext("CPU usage");?></td>
<td width="75%" class="listr">
<div class="progress">
<div id="cpuPB" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
<span class="sr-only"></span>
......@@ -322,7 +322,7 @@ $filesystems = get_mounted_filesystems();
success:function(html) {
//alert(html);
getstatus();
}
});
}
......
......@@ -110,16 +110,16 @@ if (isset($a_config["scale_type"])) {
<?php foreach ($ifdescrs as $ifname => $ifdescr) { ?>
<input type="hidden" name="shown[<?= $ifname ?>]" value="<?= $shown[$ifname] ? "show" : "hide" ?>" />
<?php } ?>
<table class="table table-striped">
<tbody>
<tbody>
<tr>
<td>
Default AutoScale:
</td>
</tr>
<?php
<?php
$scale_type_up="checked=\"checked\"";
$scale_type_follow="";
if (isset($config["widgets"]["trafficgraphs"]["scale_type"])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment