alexandermarston / vnstat-dashboard

A responsive web UI to view network traffic statistics provided by vnStat (with support for version 2.x)
https://alexandermarston.github.io/vnstat-dashboard/
142 stars 60 forks source link

interface names under title should reflect config.php #27

Open brianjmurrell opened 5 years ago

brianjmurrell commented 5 years ago

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.

alexandermarston commented 5 years ago

Hi @brianjmurrell

Can you confirm that $use_predefined_interfaces is set to false?

Could you perhaps post your config.php?

Thanks.

brianjmurrell commented 5 years ago

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?

alexandermarston commented 5 years ago

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

In your case would you rather the link say:

brianjmurrell commented 5 years ago

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