vnstat-dashboard icon indicating copy to clipboard operation
vnstat-dashboard copied to clipboard

interface names under title should reflect config.php

Open brianjmurrell opened this issue 6 years ago • 4 comments

If I define friendly names for interfaces in config.php, the page main title shows that name in brackets, but the interface names below -- the clickable links, still show the raw names. They should show the friendly names.

brianjmurrell avatar Nov 05 '18 13:11 brianjmurrell

Hi @brianjmurrell

Can you confirm that $use_predefined_interfaces is set to false?

Could you perhaps post your config.php?

Thanks.

alexandermarston avatar Nov 05 '18 13:11 alexandermarston

Can you confirm that $use_predefined_interfaces is set to false?

false? The comment says: // Set to true to set your own interfaces and the code says:

if ($use_predefined_interfaces == true) {
    $interface_list = ["eth0", "eth1", "tun0", "6to4", "sit0"];

    $interface_name['eth0'] = "Internet";
    $interface_name['eth1'] = "LAN";
    $interface_name['tun0'] = "VPN";
} else {
    $interface_list = getVnstatInterfaces($vnstat_bin_dir);

    foreach ($interface_list as $interface) {
        $interface_name[$interface] = $interface;
    }
}

So my $interface_name[*]s are only being used when $use_predefined_interfaces == true.

What am I misunderstanding?

brianjmurrell avatar Nov 05 '18 15:11 brianjmurrell

Ah, OK I understand what you mean - that's a fair point.

In your case would you rather the link say:

  • eth0 (Internet)
  • Internet
  • some other variant

alexandermarston avatar Nov 05 '18 15:11 alexandermarston

I think we agree. What I have currently is:

Network Traffic (Internet) eth0, eth1, tun0, 6to4, sit0

It should be

Network Traffic (Internet) Internet, LAN, VPN, 6to4, sit0

brianjmurrell avatar Nov 05 '18 17:11 brianjmurrell