mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Expose metric for network interfaces
This commit is contained in:
parent
4fc16555cb
commit
deaf393a2f
@ -15,6 +15,9 @@ if (isset($_POST['generate'])) {
|
|||||||
if ($cnfFile['static'] === 'true') {
|
if ($cnfFile['static'] === 'true') {
|
||||||
$strConfFile .= "#Static IP configured for ".$cnfFile['interface']."\n";
|
$strConfFile .= "#Static IP configured for ".$cnfFile['interface']."\n";
|
||||||
$strConfFile .= "interface ".$cnfFile['interface']."\n";
|
$strConfFile .= "interface ".$cnfFile['interface']."\n";
|
||||||
|
if (isset($cnfFile['metric'])) {
|
||||||
|
$strConfFile .= "metric ".$cnfFile['metric']."\n";
|
||||||
|
}
|
||||||
$strConfFile .= "static ip_address=".$cnfFile['ip_address']."\n";
|
$strConfFile .= "static ip_address=".$cnfFile['ip_address']."\n";
|
||||||
$strConfFile .= "static routers=".$cnfFile['routers']."\n";
|
$strConfFile .= "static routers=".$cnfFile['routers']."\n";
|
||||||
$strConfFile .= "static domain_name_servers=".$cnfFile['domain_name_server']."\n\n";
|
$strConfFile .= "static domain_name_servers=".$cnfFile['domain_name_server']."\n\n";
|
||||||
@ -25,6 +28,9 @@ if (isset($_POST['generate'])) {
|
|||||||
$strConfFile .= "static routers=".$cnfFile['routers']."\n";
|
$strConfFile .= "static routers=".$cnfFile['routers']."\n";
|
||||||
$strConfFile .= "static domain_name_servers=".$cnfFile['domain_name_server']."\n\n";
|
$strConfFile .= "static domain_name_servers=".$cnfFile['domain_name_server']."\n\n";
|
||||||
$strConfFile .= "interface ".$cnfFile['interface']."\n";
|
$strConfFile .= "interface ".$cnfFile['interface']."\n";
|
||||||
|
if (isset($cnfFile['metric'])) {
|
||||||
|
$strConfFile .= "metric ".$cnfFile['metric']."\n";
|
||||||
|
}
|
||||||
$strConfFile .= "fallback static_".$cnfFile['interface']."\n\n";
|
$strConfFile .= "fallback static_".$cnfFile['interface']."\n\n";
|
||||||
} else {
|
} else {
|
||||||
$strConfFile .= "#DHCP configured for ".$cnfFile['interface']."\n\n";
|
$strConfFile .= "#DHCP configured for ".$cnfFile['interface']."\n\n";
|
||||||
|
@ -21,6 +21,7 @@ if (isset($_POST['interface'])) {
|
|||||||
$cfg['domain_name_server'] = $dns1." ".$dns2;
|
$cfg['domain_name_server'] = $dns1." ".$dns2;
|
||||||
$cfg['static'] = $_POST[$int.'-static'];
|
$cfg['static'] = $_POST[$int.'-static'];
|
||||||
$cfg['failover'] = $_POST[$int.'-failover'];
|
$cfg['failover'] = $_POST[$int.'-failover'];
|
||||||
|
$cfg['metric'] = $_POST[$int.'-metric'];
|
||||||
|
|
||||||
if (write_php_ini($cfg, RASPI_CONFIG_NETWORKING.'/'.$file)) {
|
if (write_php_ini($cfg, RASPI_CONFIG_NETWORKING.'/'.$file)) {
|
||||||
$jsonData = ['return'=>0,'output'=>['Successfully Updated Network Configuration']];
|
$jsonData = ['return'=>0,'output'=>['Successfully Updated Network Configuration']];
|
||||||
|
@ -141,10 +141,14 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="<?php echo $if_quoted ?>-dnssvralt"><?php echo _("Alternate DNS Server") ?></label>
|
<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">
|
<input type="text" class="form-control" id="<?php echo $if_quoted ?>-dnssvralt" placeholder="0.0.0.0">
|
||||||
</div>
|
</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) : ?>
|
<?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-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>
|
<a href="#" class="btn btn-warning intapply" data-int="<?php echo $if_quoted ?>"><?php echo _("Apply settings") ?></a>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user