Project

General

Profile

« Previous | Next » 

Revision 3cd21b4e

Added by PiBa-NL over 6 years ago

Routing, actually show the "(default)" mark on the default route as it is present on the OS

Most obvious problem was when manually switching from WANGW1 to WANGW2 it showed both as (default) after saving the setting and before applying it. Also after applying it would require another page refresh to show the updated situation. Also add a little information box that shows what (Default) means for the user.

View differences:

src/etc/inc/gwlb.inc
671 671
			}
672 672

  
673 673
			if ($gateway['ipprotocol'] == "inet" &&
674
					($config['gateways']['defaultgw4'] == $gateway['name'] || $gateway['gateway'] == $cgw4)) {
674
					($gateway['gateway'] == $cgw4)) {
675 675
				$gateway['isdefaultgw'] = true;
676 676
				$found_defaultv4 = 1;
677 677
			} else if ($gateway['ipprotocol'] == "inet6" &&
678
					($config['gateways']['defaultgw6'] == $gateway['name'] || $gateway['gateway'] == $cgw6)) {
678
					($gateway['gateway'] == $cgw6)) {
679 679
				$gateway['isdefaultgw'] = true;
680 680
				$found_defaultv6 = 1;
681 681
			}
src/usr/local/www/system_gateways.php
65 65
	write_config("System - Gateways: save default gateway");
66 66
}
67 67

  
68
$a_gateways = return_gateways_array(true, false, true, true);
69

  
70 68
if ($_POST['apply']) {
71 69

  
72 70
	$retval = 0;
......
84 82
	}
85 83
}
86 84

  
85
$a_gateways = return_gateways_array(true, false, true, true);
87 86

  
88 87
function can_delete_disable_gateway_item($id, $disable = false) {
89 88
	global $config, $input_errors, $a_gateways;
......
343 342
						<?=htmlspecialchars($gateway['name'])?>
344 343
<?php
345 344
						if (isset($gateway['isdefaultgw'])) {
346
							echo " <strong>(default)</strong>";
345
							echo ' <i class="fa fa-globe"></i>';
347 346
						}
348 347
?>
349 348
						</td>
......
445 444
print $form;
446 445

  
447 446
?>
447
<div class="infoblock">
448
<?php
449
print_info_box(
450
	sprintf(gettext('%1$s%2$s%3$s is the current default route as present in the current routing table of the operating system'), '<strong>', '<i class="fa fa-globe"></i>', '</strong>')
451
	);
452
?>
453
</div>
448 454
<script type="text/javascript">
449 455
//<![CDATA[
450 456
events.push(function() {

Also available in: Unified diff