Routing table: fix display of metric value when zero

This commit is contained in:
bergware
2023-07-15 00:12:09 +02:00
parent 9467711a86
commit 8b8bf199d7
@@ -33,7 +33,7 @@ default:
$route = $cell[0];
$gateway = $cell[2];
if ($route=='default') $gateway .= " via {$cell[4]}";
$metric = '1';
$metric = '0';
for ($i=5; $i<count($cell); $i++) if ($cell[$i]=='metric') {$metric = $cell[$i+1]; break;}
echo "<tr><td>IPv4</td><td>$route</td><td>$gateway</td><td>$metric</td><td style='text-align:center'><a href='#' onclick='deleteRoute(\"$gateway\",\"$route\",\"$metric\");return false'><i class='fa fa-trash-o'></i></a></td></tr>";
}