summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/widgets/openvpn.widget.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-07-27 11:36:08 -0400
committerjim-p <jimp@pfsense.org>2011-07-27 11:37:18 -0400
commit95305736abcdf964f9ea03ebd628b1abbfeab5fc (patch)
tree6299cb65a570e93bcea87a82e11759bd318c04e5 /usr/local/www/widgets/widgets/openvpn.widget.php
parent6b2dcac596477f7201a0c6b5734ab8f1b9a04c5e (diff)
downloadpfsense-95305736abcdf964f9ea03ebd628b1abbfeab5fc.zip
pfsense-95305736abcdf964f9ea03ebd628b1abbfeab5fc.tar.gz
Rework OpenVPN status, show status for shared key servers.
Diffstat (limited to 'usr/local/www/widgets/widgets/openvpn.widget.php')
-rw-r--r--usr/local/www/widgets/widgets/openvpn.widget.php58
1 files changed, 53 insertions, 5 deletions
diff --git a/usr/local/www/widgets/widgets/openvpn.widget.php b/usr/local/www/widgets/widgets/openvpn.widget.php
index c93c708..4d186f0 100644
--- a/usr/local/www/widgets/widgets/openvpn.widget.php
+++ b/usr/local/www/widgets/widgets/openvpn.widget.php
@@ -55,6 +55,7 @@ function kill_client($port, $remipp) {
}
$servers = openvpn_get_active_servers();
+$sk_servers = openvpn_get_active_servers("sharedkey");
$clients = openvpn_get_active_clients();
?>
@@ -95,7 +96,7 @@ $clients = openvpn_get_active_clients();
<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="6" class="listtopic">
- Client connections for <?=$server['name'];?>
+ <?=$server['name'];?> Client connections
</td>
</tr>
<tr>
@@ -140,14 +141,61 @@ $clients = openvpn_get_active_clients();
</table>
<?php endforeach; ?>
-<br/>
+<?php if (!empty($sk_servers)) { ?>
+<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td colspan="6" class="listtopic">
+ Shared Key Server Instance Statistics
+ </td>
+ </tr>
+ <tr>
+ <table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="listhdrr">Name/Time</td>
+ <td class="listhdrr">Remote/Virtual IP</td>
+ </tr>
+<?php foreach ($sk_servers as $sk_server): ?>
+ <tr name='<?php echo "r:{$sk_server['port']}:{$sk_server['remote_host']}"; ?>'>
+ <td class="listlr">
+ <?=$sk_server['name'];?>
+ </td>
+ <td class="listr">
+ <?=$sk_server['remote_host'];?>
+ </td>
+ <td rowspan="2" align="center">
+ <?php
+ if ($sk_server['status'] == "up") {
+ /* tunnel is up */
+ $iconfn = "interface_up";
+ } else {
+ /* tunnel is down */
+ $iconfn = "interface_down";
+ }
+ echo "<img src ='/themes/{$g['theme']}/images/icons/icon_{$iconfn}.gif'>";
+ ?>
+ </td>
+ </tr>
+ <tr name='<?php echo "r:{$sk_server['port']}:{$sk_server['remote_host']}"; ?>'>
+ <td class="listlr">
+ <?=$sk_server['connect_time'];?>
+ </td>
+ <td class="listr">
+ <?=$sk_server['virtual_addr'];?>
+ </td>
+ </tr>
+<?php endforeach; ?>
+ </table>
+ </tr>
+</table>
+<?php
+} ?>
<?php if (!empty($clients)) { ?>
<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="6" class="listtopic">
- OpenVPN client instances statistics
+ Client Instance Statistics
</td>
</tr>
<tr>
@@ -158,7 +206,7 @@ $clients = openvpn_get_active_clients();
</tr>
<?php foreach ($clients as $client): ?>
- <tr name='<?php echo "r:{$client['port']}:{$conn['remote_host']}"; ?>'>
+ <tr name='<?php echo "r:{$client['port']}:{$client['remote_host']}"; ?>'>
<td class="listlr">
<?=$client['name'];?>
</td>
@@ -178,7 +226,7 @@ $clients = openvpn_get_active_clients();
?>
</td>
</tr>
- <tr name='<?php echo "r:{$client['port']}:{$conn['remote_host']}"; ?>'>
+ <tr name='<?php echo "r:{$client['port']}:{$client['remote_host']}"; ?>'>
<td class="listlr">
<?=$client['connect_time'];?>
</td>
OpenPOWER on IntegriCloud