Giter Site home page Giter Site logo

Comments (5)

alexandermarston avatar alexandermarston commented on June 15, 2024

@Aerya thanks for submitting this issue.

Could you please run "vnstat --json" on your system and attach the results to this issue and I can look into this for you.

Many thanks,
Alex

from vnstat-dashboard.

tomangert avatar tomangert commented on June 15, 2024

vnstat2.x uses a different json tag for interface names. ('name' instead of 'id') The pull request for #35 also adds vnstat2 support.

from vnstat-dashboard.

tomangert avatar tomangert commented on June 15, 2024

"interfaces": [
{
"name": "br0",
"alias": "",
"created": {
"date": {
"year": 2019,
"month": 6,
"day": 25
}
},
"updated": {
"date": {
"year": 2019,
"month": 10,
"day": 11
},
"time": {
"hour": 9,
"minute": 5
}
},
"traffic": {
"total": {
"rx": 1378209818161,
"tx": 723392017482
},
...

from vnstat-dashboard.

qwrty-ftw avatar qwrty-ftw commented on June 15, 2024

I have got the same issue (vnstat 2.6)

image

My config.php

// Set to true to set your own interfaces
$use_predefined_interfaces = true;

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

    $interface_name['eth0'] = "Internal #1";
    $interface_name['eth1'] = "Internal #2";
	$interface_name['tun0'] = "VPN Tunnel";
}

from vnstat-dashboard.

edwardecl avatar edwardecl commented on June 15, 2024

The other guy on here who said that 'id' has been changed to 'name' is correct, you just need to modify 2 lines in the file...

/vnstat/includes/vnstat.php

line 81:
array_push($vnstatInterfaces, $interface['name']);

Line 98:
$arrayIndex = array_search($interface, array_column($this->vnstatData['interfaces'], 'name'));

And it works on vnstat 2.6 (Ubuntu 20.10).

from vnstat-dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.