2017-10-22 18:26:49 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include_once( 'includes/status_messages.php' );
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function DisplayNetworkingConfig(){
|
|
|
|
|
|
|
|
$status = new StatusMessages();
|
|
|
|
|
|
|
|
exec("ls /sys/class/net | grep -v lo", $interfaces);
|
|
|
|
|
|
|
|
foreach($interfaces as $interface) {
|
|
|
|
exec("ip a show $interface",$$interface);
|
|
|
|
}
|
|
|
|
|
2017-10-27 20:40:30 +02:00
|
|
|
CSRFToken();
|
|
|
|
?>
|
2017-10-22 18:26:49 +02:00
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="panel panel-primary">
|
|
|
|
<div class="panel panel-heading">
|
|
|
|
<i class="fa fa-sitemap fa-fw"></i> Configure Networking
|
|
|
|
</div>
|
|
|
|
<div class="panel panel-body">
|
|
|
|
<ul class="nav nav-tabs">
|
|
|
|
<li role="presentation" class="active"><a href="#summary" aria-controls="summary" role="tab" data-toggle="tab">Summary</a></li>
|
|
|
|
<?php
|
|
|
|
foreach($interfaces as $interface) {
|
|
|
|
echo '<li role="presentation"><a href="#'.$interface.'" aria-controls="'.$interface.'" role="tab" data-toggle="tab">'.$interface.'</a></li>';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
|
|
<div role="tabpanel" class="tab-pane active" id="summary">
|
|
|
|
Current Settings:<br />
|
|
|
|
<?php
|
|
|
|
foreach($interfaces as $interface) {
|
|
|
|
echo '<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="panel panel-primary">
|
|
|
|
<div class="panel-heading">'.$interface.'</div>
|
2017-10-27 20:40:30 +02:00
|
|
|
<div class="panel-body" id="'.$interface.'-summary">
|
2017-10-22 18:26:49 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
}
|
|
|
|
?>
|
2017-10-27 20:40:30 +02:00
|
|
|
<a href="#" class="btn btn-success btn-lg" id="btnSummaryRefresh"><i class="fa fa-refresh"></i> Refresh</a>
|
2017-10-22 18:26:49 +02:00
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
foreach($interfaces as $interface) {
|
|
|
|
echo '<div role="tabpanel" class="tab-pane" id="'.$interface.'">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-6">
|
2017-10-27 20:40:30 +02:00
|
|
|
<form id="frm-'.$interface.'">
|
2017-10-22 18:26:49 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<h4>Adapter IP Address Settings:</h4>
|
|
|
|
<div class="btn-group" data-toggle="buttons">
|
2017-10-27 20:40:30 +02:00
|
|
|
<label class="btn btn-primary">
|
|
|
|
<input type="radio" name="'.$interface.'-addresstype" id="'.$interface.'-dhcp" autocomplete="off">DHCP
|
2017-10-22 18:26:49 +02:00
|
|
|
</label>
|
|
|
|
<label class="btn btn-primary">
|
|
|
|
<input type="radio" name="'.$interface.'-addresstype" id="'.$interface.'-static" autocomplete="off">Static IP
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<h4>Enable Fallback to Static Option:</h4>
|
|
|
|
<div class="btn-group" data-toggle="buttons">
|
2017-10-27 20:40:30 +02:00
|
|
|
<label class="btn btn-primary">
|
|
|
|
<input type="radio" name="'.$interface.'-dhcpfailover" id="'.$interface.'-failover" autocomplete="off">Enabled
|
2017-10-22 18:26:49 +02:00
|
|
|
</label>
|
2017-10-27 20:40:30 +02:00
|
|
|
<label class="btn btn-warning">
|
|
|
|
<input type="radio" name="'.$interface.'-dhcpfailover" id="'.$interface.'-nofailover" autocomplete="off">Disabled
|
2017-10-22 18:26:49 +02:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr />
|
|
|
|
<h4>Static IP Options</h4>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="'.$interface.'-ipaddress">IP Address</label>
|
|
|
|
<input type="text" class="form-control" id="'.$interface.'-ipaddress" placeholder="0.0.0.0">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="'.$interface.'-netmask">Subnet Mask</label>
|
|
|
|
<input type="text" class="form-control" id="'.$interface.'-netmask" placeholder="255.255.255.0">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="'.$interface.'-gateway">Default Gateway</label>
|
|
|
|
<input type="text" class="form-control" id="'.$interface.'-gateway" placeholder="0.0.0.0">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="'.$interface.'-dnssvr">DNS Server</label>
|
|
|
|
<input type="text" class="form-control" id="'.$interface.'-dnssvr" placeholder="0.0.0.0">
|
|
|
|
</div>
|
2017-10-27 20:40:30 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="'.$interface.'-dnssvralt">Alternate DNS Server</label>
|
|
|
|
<input type="text" class="form-control" id="'.$interface.'-dnssvralt" placeholder="0.0.0.0">
|
|
|
|
</div>
|
|
|
|
<a href="#" class="btn btn-primary btn-lg active intsave" data-int="'.$interface.'">Save Settings</a>
|
|
|
|
<a href="#" class="btn btn-success btn-lg active intapply" data-int="'.$interface.'">Apply Settings</a>
|
2017-10-22 18:26:49 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|