raspap-webgui-mirror/templates/networking.php

87 lines
3.9 KiB
PHP
Raw Normal View History

2019-08-18 23:38:41 +00:00
<div class="row">
2019-08-18 23:51:26 +00:00
<div class="col-lg-12">
2019-10-12 22:04:27 +00:00
<div class="card">
2019-11-01 09:08:49 +00:00
<div class="card-header">
<div class="row">
<div class="col">
2020-02-28 23:00:35 +00:00
<i class="fas fa-network-wired mr-2"></i><?php echo _("Networking"); ?>
2019-11-01 09:08:49 +00:00
</div>
</div><!-- ./row -->
</div><!-- ./card-header -->
2019-10-12 22:04:27 +00:00
<div class="card-body">
2019-08-18 23:38:41 +00:00
<div id="msgNetworking"></div>
2019-08-18 23:51:26 +00:00
<ul class="nav nav-tabs">
2019-10-14 20:57:29 +00:00
<li role="presentation" class="nav-item"><a class="nav-link active" href="#summary" aria-controls="summary" role="tab" data-toggle="tab"><?php echo _("Summary"); ?></a></li>
2019-08-18 23:51:26 +00:00
</ul>
<div class="tab-content">
2020-06-25 14:56:53 +00:00
<div role="tabpanel" class="tab-pane active" id="summary">
2020-06-25 14:00:41 +00:00
<h4 class="mt-3"><?php echo _("Internet connection"); ?></h4>
<div class="row">
<div class="col-sm-12"">
<div class="card ">
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th><?php echo _("Interface"); ?></th>
<th><?php echo _("IP Address"); ?></th>
<th><?php echo _("Gateway"); ?></th>
<th colspan="2"><?php echo _("Internet Access"); ?></th>
</tr>
</thead>
<tbody>
<?php
if (isset($routeInfo["error"]) || empty($routeInfo)) {
2020-06-25 14:00:41 +00:00
echo "<tr><td colspan=5>No route to the internet found</td></tr>";
2020-06-28 16:12:42 +00:00
} else {
foreach($routeInfo as $route) {
2020-06-28 16:12:42 +00:00
echo "<tr>";
echo "<td>".$route["interface"]."</td>";
echo "<td>".$route["ip-address"]."</td>";
echo "<td>".$route["gateway"]."<br>".$route["gw-name"]."</td>";
2020-06-29 13:13:06 +00:00
$status = $route["access-ip"] ? "fa-check" : "fa-times";
echo '<td><i class="fas '.$status.'"></i><br>'.RASPI_ACCESS_CHECK_IP.'</td>';
$status = $route["access-dns"] ? "fa-check" : "fa-times";
echo '<td><i class="fas '.$status.'"></i><br>'.RASPI_ACCESS_CHECK_DNS.'</td>';
2020-06-28 16:12:42 +00:00
echo "</tr>";
}
}
2020-06-25 14:00:41 +00:00
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
2019-10-14 20:57:29 +00:00
<h4 class="mt-3"><?php echo _("Current settings") ?></h4>
2019-08-18 23:51:26 +00:00
<div class="row">
<?php if (!$bridgedEnabled) : // No interface details when bridged ?>
2019-08-18 23:51:26 +00:00
<?php foreach ($interfaces as $if): ?>
2020-06-28 16:12:42 +00:00
<?php $if_quoted = htmlspecialchars($if, ENT_QUOTES) ?>
2019-10-14 20:57:29 +00:00
<div class="col-md-6 mb-3">
2019-10-12 22:04:27 +00:00
<div class="card">
<div class="card-header"><?php echo $if_quoted ?></div>
<div class="card-body">
2019-08-18 23:51:26 +00:00
<pre class="unstyled" id="<?php echo $if_quoted ?>-summary"></pre>
</div>
</div>
</div>
<?php endforeach ?>
<?php endif ?>
2019-08-18 23:51:26 +00:00
</div><!-- /.row -->
<div class="col-lg-12">
<div class="row">
<button type="button" onClick="window.location.reload();" class="btn btn-outline btn-primary"><i class="fas fa-sync-alt"></i> <?php echo _("Refresh") ?></a>
2019-08-18 23:51:26 +00:00
</div>
</div>
2019-08-18 23:51:26 +00:00
</div>
</div>
2019-10-12 22:04:27 +00:00
</div><!-- /.card-body -->
<div class="card-footer"><?php echo _("Information provided by /sys/class/net"); ?></div>
</div><!-- /.card -->
2019-08-18 23:38:41 +00:00
</div><!-- /.col-lg-12 -->
</div><!-- /.row -->