Comments (5)
@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.
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.
"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.
I have got the same issue (vnstat 2.6)
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.
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)
- Projected traffic usage
- interface names under title should reflect config.php HOT 4
- No data displayed with vnStat2.1 HOT 5
- fopen is disabled for security reasons HOT 3
- PHP 7.2 support HOT 2
- No Data Displayed on Web UI HOT 2
- Add Graph and Table for 5 minute data HOT 1
- [Question] Is RaspberryPi / Raspbian Buster supported ? HOT 1
- Lots of warnings (PHP 7.2.27-1+0~20200123.34+debian9~1.gbp63c0bc)
- Cannot read property 'getTime' of null on monthly graph HOT 1
- lots of warnings with debian 8.11 and php 7.2 HOT 7
- Run vnstat-dashboard locally? HOT 1
- possible to get a non google-charts alternative? HOT 1
- errors HOT 6
- vnstat json does not have an id field HOT 2
- Button Interface Selection does not work HOT 1
- Warning in /includes/vnstat.php on line 136 HOT 1
- /vendor/autoload.php doesn't exist
- --dumpdb not longer supported!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vnstat-dashboard.