mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Transfer template logic to includes, see #749 thx @mp035
This commit is contained in:
@@ -12,12 +12,6 @@
|
||||
<div id="msgNetworking"></div>
|
||||
<ul class="nav nav-tabs">
|
||||
<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>
|
||||
<?php
|
||||
// Get Bridged AP mode status
|
||||
$arrHostapdConf = parse_ini_file('/etc/raspap/hostapd.ini');
|
||||
// defaults to false
|
||||
$bridgedEnabled = $arrHostapdConf['BridgedEnable'];
|
||||
?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="summary">
|
||||
@@ -38,12 +32,10 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$checkAccess=true;
|
||||
require "includes/internetRoute.php";
|
||||
if (isset($rInfo["error"]) || empty($rInfo)) {
|
||||
if (isset($routeInfo["error"]) || empty($routeInfo)) {
|
||||
echo "<tr><td colspan=5>No route to the internet found</td></tr>";
|
||||
} else {
|
||||
foreach($rInfo as $route) {
|
||||
foreach($routeInfo as $route) {
|
||||
echo "<tr>";
|
||||
echo "<td>".$route["interface"]."</td>";
|
||||
echo "<td>".$route["ip-address"]."</td>";
|
||||
@@ -65,6 +57,7 @@
|
||||
</div>
|
||||
<h4 class="mt-3"><?php echo _("Current settings") ?></h4>
|
||||
<div class="row">
|
||||
<?php if (!$bridgedEnabled) : // No interface details when bridged ?>
|
||||
<?php foreach ($interfaces as $if): ?>
|
||||
<?php $if_quoted = htmlspecialchars($if, ENT_QUOTES) ?>
|
||||
<div class="col-md-6 mb-3">
|
||||
@@ -76,84 +69,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
</div><!-- /.row -->
|
||||
<div class="col-lg-12">
|
||||
<div class="row">
|
||||
<a href="#" class="btn btn-outline btn-primary" id="btnSummaryRefresh"><i class="fas fa-sync-alt"></i> <?php echo _("Refresh"); ?></a>
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.col-lg-12 -->
|
||||
</div><!-- /.tab-pane -->
|
||||
|
||||
<?php foreach ($interfaces as $if): ?>
|
||||
<?php $if_quoted = htmlspecialchars($if, ENT_QUOTES) ?>
|
||||
<div role="tabpanel" class="tab-pane fade in" id="<?php echo $if_quoted ?>">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
|
||||
<form id="frm-<?php echo $if_quoted ?>">
|
||||
<?php echo CSRFTokenFieldTag() ?>
|
||||
<div class="form-group">
|
||||
<h4 class="mt-3"><?php echo _("Adapter IP Address Settings") ?></h4>
|
||||
<div class="btn-group" role="group" data-toggle="buttons">
|
||||
<label class="btn btn-primary">
|
||||
<input class="mr-2" type="radio" name="<?php echo $if_quoted ?>-addresstype" id="<?php echo $if_quoted ?>-dhcp" autocomplete="off"><?php echo _("DHCP") ?>
|
||||
</label>
|
||||
<label class="btn btn-primary">
|
||||
<input class="mr-2" type="radio" name="<?php echo $if_quoted ?>-addresstype" id="<?php echo $if_quoted ?>-static" autocomplete="off"><?php echo _("Static IP") ?>
|
||||
</label>
|
||||
</div><!-- /.btn-group -->
|
||||
<h4 class="mt-3"><?php echo _("Enable Fallback to Static Option") ?></h4>
|
||||
<div class="btn-group" role="group" data-toggle="buttons">
|
||||
<label class="btn btn-primary">
|
||||
<input class="mr-2" type="radio" name="<?php echo $if_quoted ?>-dhcpfailover" id="<?php echo $if_quoted ?>-failover" autocomplete="off"><?php echo _("Enabled") ?>
|
||||
</label>
|
||||
<label class="btn btn-warning">
|
||||
<input class="mr-2" type="radio" name="<?php echo $if_quoted ?>-dhcpfailover" id="<?php echo $if_quoted ?>-nofailover" autocomplete="off"><?php echo _("Disabled") ?>
|
||||
</label>
|
||||
</div><!-- /.btn-group -->
|
||||
</div><!-- /.form-group -->
|
||||
|
||||
<hr />
|
||||
|
||||
<h4><?php echo _("Static IP Options") ?></h4>
|
||||
<div class="form-group">
|
||||
<label for="<?php echo $if_quoted ?>-ipaddress"><?php echo _("IP Address") ?></label>
|
||||
<input type="text" class="form-control" id="<?php echo $if_quoted ?>-ipaddress" placeholder="0.0.0.0">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="<?php echo $if_quoted ?>-netmask"><?php echo _("Subnet Mask") ?></label>
|
||||
<input type="text" class="form-control" id="<?php echo $if_quoted ?>-netmask" placeholder="255.255.255.0">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="<?php echo $if_quoted ?>-gateway"><?php echo _("Default Gateway") ?></label>
|
||||
<input type="text" class="form-control" id="<?php echo $if_quoted ?>-gateway" placeholder="0.0.0.0">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="<?php echo $if_quoted ?>-dnssvr"><?php echo _("DNS Server") ?></label>
|
||||
<input type="text" class="form-control" id="<?php echo $if_quoted ?>-dnssvr" placeholder="0.0.0.0">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="<?php echo $if_quoted ?>-dnssvralt"><?php echo _("Alternate DNS Server") ?></label>
|
||||
<input type="text" class="form-control" id="<?php echo $if_quoted ?>-dnssvralt" placeholder="0.0.0.0">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="<?php echo $if_quoted ?>-metric"><?php echo _("Metric") ?></label>
|
||||
<input type="text" class="form-control" id="<?php echo $if_quoted ?>-metric" placeholder="0">
|
||||
</div>
|
||||
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
||||
<a href="#" class="btn btn-outline btn-primary intsave" data-int="<?php echo $if_quoted ?>"><?php echo _("Save settings") ?></a>
|
||||
<a href="#" class="btn btn-warning intapply" data-int="<?php echo $if_quoted ?>"><?php echo _("Apply settings") ?></a>
|
||||
<?php endif ?>
|
||||
</form>
|
||||
|
||||
<button type="button" onClick="window.location.reload();" class="btn btn-outline btn-primary"><i class="fas fa-sync-alt"></i> <?php echo _("Refresh") ?></a>
|
||||
</div>
|
||||
</div><!-- /.tab-panel -->
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
|
||||
</div><!-- /.tab-content -->
|
||||
</div>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer"><?php echo _("Information provided by /sys/class/net"); ?></div>
|
||||
</div><!-- /.card -->
|
||||
</div><!-- /.col-lg-12 -->
|
||||
</div>
|
||||
</div><!-- /.row -->
|
||||
|
||||
|
Reference in New Issue
Block a user