Commit graph

6 commits

Author SHA1 Message Date
Jan Hoffmann
c0c37903f2
luci-app-vnstat2: fix configuration page when database is empty (#6746)
The output of the command "vnstat --dbiflist 1" is empty when there are
no interfaces in the database. Add a check to avoid a "result.stdout is
undefined" error in that case.

Ref: https://forum.openwrt.org/t/error-in-luci-vnstat2-configuration-menu/179700
Fixes: 3ac4f567df ("luci-app-vnstat2: use more efficient way to get database interfaces")

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-12-06 02:24:25 +01:00
Jan Hoffmann
3ac4f567df luci-app-vnstat2: use more efficient way to get database interfaces
The currently used command "vnstat --json f 1" can be very slow when the
database contains many entries. This can result in an XHR timeout error
on the configuration page.

Use the "--dbiflist" option instead, which was added in vnStat 2.7.

Fixes: #6702
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-11-18 09:52:45 +01:00
Jo-Philipp Wich
03c77dafe3 treewide: transition div tables to actual table markup
Modern browsers allow decomposing table markup equally well as nested div
constructs, therefor migrate our <div> table markup to actual <table> tags
but keep the old table/tr/th/td CSS classes for now to allow for a smooth
theme transition.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-11-27 21:36:40 +01:00
Jan Hoffmann
6037c8a847 luci-app-vnstat2: fix ACL rules, disable button on insufficient ACLs
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2020-04-24 18:43:03 +02:00
Jo-Philipp Wich
3c4bc228a1 treewide: import utility classes explicitly
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-03 10:00:06 +02:00
Jan Hoffmann
1750433bc1 luci-app-vnstat2: add application
This adds an application for vnStat version 2.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2020-01-23 12:44:22 +01:00