2017-10-22 18:26:49 +02:00
|
|
|
<?php
|
|
|
|
|
2019-04-10 10:37:35 +02:00
|
|
|
include_once('includes/status_messages.php');
|
2017-10-22 18:26:49 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2019-04-10 10:37:35 +02:00
|
|
|
function DisplayNetworkingConfig()
|
|
|
|
{
|
2017-10-22 18:26:49 +02:00
|
|
|
|
2019-04-10 10:37:35 +02:00
|
|
|
$status = new StatusMessages();
|
2017-10-22 18:26:49 +02:00
|
|
|
|
2019-04-10 10:37:35 +02:00
|
|
|
exec("ls /sys/class/net | grep -v lo", $interfaces);
|
2017-10-22 18:26:49 +02:00
|
|
|
|
2019-04-10 10:37:35 +02:00
|
|
|
foreach ($interfaces as $interface) {
|
|
|
|
exec("ip a show $interface", $$interface);
|
|
|
|
}
|
2017-10-27 20:40:30 +02:00
|
|
|
?>
|
2017-10-22 18:26:49 +02:00
|
|
|
|
|
|
|
<div class="row">
|
2017-11-04 21:24:23 +01:00
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="panel panel-primary">
|
|
|
|
<div class="panel panel-heading">
|
2019-04-10 10:37:35 +02:00
|
|
|
<i class="fa fa-sitemap fa-fw"></i> <?php echo _("Configure networking"); ?></div>
|
2017-11-04 21:24:23 +01:00
|
|
|
<div class="panel-body">
|
|
|
|
<div id="msgNetworking"></div>
|
|
|
|
<ul class="nav nav-tabs">
|
2019-04-10 10:37:35 +02:00
|
|
|
<li role="presentation" class="active"><a href="#summary" aria-controls="summary" role="tab" data-toggle="tab"><?php echo _("Summary"); ?></a></li>
|
2017-11-04 21:24:23 +01:00
|
|
|
<?php
|
2019-04-10 10:37:35 +02:00
|
|
|
foreach ($interfaces as $interface) {
|
|
|
|
echo '<li role="presentation"><a href="#'.htmlspecialchars($interface, ENT_QUOTES).'" aria-controls="'.htmlspecialchars($interface, ENT_QUOTES).'" role="tab" data-toggle="tab">'.htmlspecialchars($interface, ENT_QUOTES).'</a></li>';
|
|
|
|
}
|
2017-11-04 21:24:23 +01:00
|
|
|
?>
|
|
|
|
</ul>
|
2017-10-22 18:26:49 +02:00
|
|
|
<div class="tab-content">
|
2017-11-04 21:24:23 +01:00
|
|
|
<div role="tabpanel" class="tab-pane active" id="summary">
|
2019-04-10 10:37:35 +02:00
|
|
|
<h4><?php echo _("Current settings"); ?></h4>
|
2017-11-04 21:24:23 +01:00
|
|
|
<div class="row">
|
2019-04-10 10:37:35 +02:00
|
|
|
<?php
|
|
|
|
foreach ($interfaces as $interface) {
|
|
|
|
echo '<div class="col-md-6">
|
2017-11-04 21:24:23 +01:00
|
|
|
<div class="panel panel-default">
|
2018-08-04 01:58:34 +02:00
|
|
|
<div class="panel-heading">'.htmlspecialchars($interface, ENT_QUOTES).'</div>
|
2019-07-30 14:10:42 +02:00
|
|
|
<div class="panel-body">
|
|
|
|
<pre class="unstyled" id="'.htmlspecialchars($interface, ENT_QUOTES).'-summary"></pre>
|
|
|
|
</div>
|
2017-11-04 21:24:23 +01:00
|
|
|
</div>
|
2017-10-22 18:26:49 +02:00
|
|
|
</div>';
|
|
|
|
}
|
2019-04-10 10:37:35 +02:00
|
|
|
?>
|
2017-11-04 21:24:23 +01:00
|
|
|
</div><!-- /.row -->
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="row">
|
2019-04-10 10:37:35 +02:00
|
|
|
<a href="#" class="btn btn-outline btn-primary" id="btnSummaryRefresh"><i class="fa fa-refresh"></i> <?php echo _("Refresh"); ?></a>
|
2017-11-04 21:24:23 +01:00
|
|
|
</div><!-- /.row -->
|
|
|
|
</div><!-- /.col-lg-12 -->
|
|
|
|
</div><!-- /.tab-pane -->
|
2018-08-04 01:58:34 +02:00
|
|
|
<?php
|
2019-04-10 10:37:35 +02:00
|
|
|
foreach ($interfaces as $interface) {
|
|
|
|
echo '
|
2018-08-04 01:58:34 +02:00
|
|
|
<div role="tabpanel" class="tab-pane fade in" id="'.htmlspecialchars($interface, ENT_QUOTES).'">
|
2017-11-04 21:24:23 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-6">
|
2018-08-04 01:58:34 +02:00
|
|
|
<form id="frm-'.htmlspecialchars($interface, ENT_QUOTES).'">
|
2019-08-14 02:41:20 +02:00
|
|
|
' . CSRFTokenFieldTag() . '
|
2017-11-04 21:24:23 +01:00
|
|
|
<div class="form-group">
|
2018-05-27 17:51:06 +02:00
|
|
|
<h4>' . _("Adapter IP Address Settings") . '</h4>
|
2017-11-04 21:24:23 +01:00
|
|
|
<div class="btn-group" data-toggle="buttons">
|
|
|
|
<label class="btn btn-primary">
|
2018-08-04 01:58:34 +02:00
|
|
|
<input type="radio" name="'.htmlspecialchars($interface, ENT_QUOTES).'-addresstype" id="'.htmlspecialchars($interface, ENT_QUOTES).'-dhcp" autocomplete="off">' . _("DHCP") . '
|
2017-11-04 21:24:23 +01:00
|
|
|
</label>
|
|
|
|
<label class="btn btn-primary">
|
2018-08-04 01:58:34 +02:00
|
|
|
<input type="radio" name="'.htmlspecialchars($interface, ENT_QUOTES).'-addresstype" id="'.htmlspecialchars($interface, ENT_QUOTES).'-static" autocomplete="off">' . _("Static IP") . '
|
2017-11-04 21:24:23 +01:00
|
|
|
</label>
|
|
|
|
</div><!-- /.btn-group -->
|
2018-05-27 17:51:06 +02:00
|
|
|
<h4>' . _("Enable Fallback to Static Option") . '</h4>
|
2017-11-04 21:24:23 +01:00
|
|
|
<div class="btn-group" data-toggle="buttons">
|
|
|
|
<label class="btn btn-primary">
|
2018-08-04 01:58:34 +02:00
|
|
|
<input type="radio" name="'.htmlspecialchars($interface, ENT_QUOTES).'-dhcpfailover" id="'.htmlspecialchars($interface, ENT_QUOTES).'-failover" autocomplete="off">' . _("Enabled") . '
|
2017-11-04 21:24:23 +01:00
|
|
|
</label>
|
|
|
|
<label class="btn btn-warning">
|
2018-08-04 01:58:34 +02:00
|
|
|
<input type="radio" name="'.htmlspecialchars($interface, ENT_QUOTES).'-dhcpfailover" id="'.htmlspecialchars($interface, ENT_QUOTES).'-nofailover" autocomplete="off">' . _("Disabled") . '
|
2017-11-04 21:24:23 +01:00
|
|
|
</label>
|
|
|
|
</div><!-- /.btn-group -->
|
|
|
|
</div><!-- /.form-group -->
|
|
|
|
<hr />
|
2018-05-27 17:51:06 +02:00
|
|
|
<h4>' . _("Static IP Options") . '</h4>
|
2017-11-04 21:24:23 +01:00
|
|
|
<div class="form-group">
|
2018-08-04 01:58:34 +02:00
|
|
|
<label for="'.htmlspecialchars($interface, ENT_QUOTES).'-ipaddress">' . _("IP Address") . '</label>
|
|
|
|
<input type="text" class="form-control" id="'.htmlspecialchars($interface, ENT_QUOTES).'-ipaddress" placeholder="0.0.0.0">
|
2017-11-04 21:24:23 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-08-04 01:58:34 +02:00
|
|
|
<label for="'.htmlspecialchars($interface, ENT_QUOTES).'-netmask">' . _("Subnet Mask") . '</label>
|
|
|
|
<input type="text" class="form-control" id="'.htmlspecialchars($interface, ENT_QUOTES).'-netmask" placeholder="255.255.255.0">
|
2017-11-04 21:24:23 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-08-04 01:58:34 +02:00
|
|
|
<label for="'.htmlspecialchars($interface, ENT_QUOTES).'-gateway">' . _("Default Gateway") . '</label>
|
|
|
|
<input type="text" class="form-control" id="'.htmlspecialchars($interface, ENT_QUOTES).'-gateway" placeholder="0.0.0.0">
|
2017-11-04 21:24:23 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-08-04 01:58:34 +02:00
|
|
|
<label for="'.htmlspecialchars($interface, ENT_QUOTES).'-dnssvr">' . _("DNS Server") . '</label>
|
|
|
|
<input type="text" class="form-control" id="'.htmlspecialchars($interface, ENT_QUOTES).'-dnssvr" placeholder="0.0.0.0">
|
2017-11-04 21:24:23 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-08-04 01:58:34 +02:00
|
|
|
<label for="'.htmlspecialchars($interface, ENT_QUOTES).'-dnssvralt">' . _("Alternate DNS Server") . '</label>
|
|
|
|
<input type="text" class="form-control" id="'.htmlspecialchars($interface, ENT_QUOTES).'-dnssvralt" placeholder="0.0.0.0">
|
2017-11-04 21:24:23 +01:00
|
|
|
</div>
|
2018-08-04 01:58:34 +02:00
|
|
|
<a href="#" class="btn btn-outline btn-primary intsave" data-int="'.htmlspecialchars($interface, ENT_QUOTES).'">' . _("Save settings") . '</a>
|
|
|
|
<a href="#" class="btn btn-warning intapply" data-int="'.htmlspecialchars($interface, ENT_QUOTES).'">' . _("Apply settings") . '</a>
|
2017-11-04 21:24:23 +01:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div><!-- /.tab-panel -->
|
|
|
|
</div>';
|
2019-04-10 10:37:35 +02:00
|
|
|
}
|
2018-08-04 01:58:34 +02:00
|
|
|
?>
|
2017-11-04 21:24:23 +01:00
|
|
|
</div><!-- /.tab-content -->
|
|
|
|
</div><!-- /.panel-body -->
|
2019-04-10 10:37:35 +02:00
|
|
|
<div class="panel-footer"><?php echo _("Information provided by /sys/class/net"); ?></div>
|
2017-11-04 21:24:23 +01:00
|
|
|
</div><!-- /.panel-primary -->
|
|
|
|
</div><!-- /.col-lg-12 -->
|
2017-10-22 18:26:49 +02:00
|
|
|
</div>
|
2017-11-04 21:24:23 +01:00
|
|
|
|
2017-10-22 18:26:49 +02:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|