summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-09-21 14:36:07 +0200
committerdoktornotor <notordoktor@gmail.com>2015-09-21 14:36:07 +0200
commitfcaca8ef42f7ab638eb3d7ee905894b9836193e0 (patch)
tree3a8556d41937557b0246b6bfd12efd0c14b07b3a /src/etc
parent3c596efc107243ac908b40bbf820ca7e5ff0cd30 (diff)
downloadpfsense-fcaca8ef42f7ab638eb3d7ee905894b9836193e0.zip
pfsense-fcaca8ef42f7ab638eb3d7ee905894b9836193e0.tar.gz
fix interface assignment menus running off VGA screen
When using VGA console, interface assignment can be a real pain in the ass because of the standard 80 columns width. Dmesg reports the many interface description names in very long strings that don't fit in a row, this breaks the nice appearance of the interface list in the assignment menu. The aestethics is one thing, but the real pain is that the interface list goes off screen by the time the menu asks for the WAN interface name, if there are many interfaces present. It's a real problem to choose from a list which is not visible anymore. One fix is to maximize the length of the interface description to 48 chars. The second fix (and also improvement for better overlooking when the list really goes off) is to print a small list of the interface names at each question. This is necessary because when somebody wants to assign the first interface to the last Optional port, the big list will be way off screen by then, and the name of it won't be visible. This also makes it nice clean and straightforward.
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/inc/config.console.inc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/etc/inc/config.console.inc b/src/etc/inc/config.console.inc
index df3fa6f..33194bf 100644
--- a/src/etc/inc/config.console.inc
+++ b/src/etc/inc/config.console.inc
@@ -86,8 +86,9 @@ EOD;
$iflist = array();
} else {
foreach ($iflist as $iface => $ifa) {
+ $ifsmallist = trim($ifsmallist . " " . $iface);
echo sprintf("% -7s%s %s %s\n", $iface, $ifa['mac'],
- $ifa['up'] ? " (up)" : "(down)", $ifa['dmesg']);
+ $ifa['up'] ? " (up)" : "(down)", substr($ifa['dmesg'], 0, 48));
}
}
@@ -190,6 +191,7 @@ EOD;
"VLAN tag {$vlan['tag']}, parent interface {$vlan['if']}");
$iflist[$vlan['if'] . '_vlan' . $vlan['tag']] = array();
+ $ifsmallist = trim($ifsmallist . " " . $vlan['if'] . '_vlan' . $vlan['tag']);
}
}
@@ -202,7 +204,8 @@ hitting 'a' to initiate auto detection.
EOD;
do {
- echo "\n" . gettext("Enter the WAN interface name or 'a' for auto-detection:") . " ";
+ echo "\n" . gettext("Enter the WAN interface name or 'a' for auto-detection") . " ";
+ printf(gettext("%s(%s or a): "), "\n", $ifsmallist);
$wanif = chop(fgets($fp));
if ($wanif === "") {
return;
@@ -214,12 +217,13 @@ EOD;
unset($wanif);
continue;
}
+ $ifsmallist = trim(str_replace(" ", " ", str_replace($wanif, "", $ifsmallist)));
} while (!$wanif);
do {
printf(gettext("%sEnter the LAN interface name or 'a' for auto-detection %s" .
"NOTE: this enables full Firewalling/NAT mode.%s" .
- "(or nothing if finished):%s"), "\n", "\n", "\n", " ");
+ "(%s a or nothing if finished):%s"), "\n", "\n", "\n", $ifsmallist, " ");
$lanif = chop(fgets($fp));
@@ -239,6 +243,7 @@ EOD;
unset($lanif);
continue;
}
+ $ifsmallist = trim(str_replace(" ", " ", str_replace($lanif, "", $ifsmallist)));
} while (!$lanif);
/* optional interfaces */
@@ -257,7 +262,7 @@ EOD;
}
printf(gettext("%sEnter the Optional %s interface name or 'a' for auto-detection%s" .
- "(or nothing if finished):%s"), "\n", $io, "\n", " ");
+ "(%s a or nothing if finished):%s"), "\n", $io, "\n", $ifsmallist, " ");
$optif[$i] = chop(fgets($fp));
@@ -274,6 +279,7 @@ EOD;
unset($optif[$i]);
continue;
}
+ $ifsmallist = trim(str_replace(" ", " ", str_replace($optif[$i], "", $ifsmallist)));
} else {
unset($optif[$i]);
break;
OpenPOWER on IntegriCloud