How alexandermarston/vnstat-dashboard works
vnStat Dashboard is a PHP web UI for viewing network-traffic statistics from vnstat. A browser request enters app/index.php, which selects an interface, requests hourly, daily, monthly, and top-10 data, and renders a Smarty page. The vnStat adapter obtains JSON from the local vnstat executable; shared utilities format and scale its values. The README also documents Google Charts and automatic interface selection. Template internals were not excerpted, so their individual rendering relationships are not inferred.
Main entry points: site_index.tpl Smarty page template · index.php Page controller · vnstat.php vnStat adapter · module_graph_js.tpl Graph script template
Components 13
Web request and presentation
- Page controller
app/index.php - Smarty page template
app/templates/site_index.tpl - Graph template
app/templates/module_graph.tpl - Graph script template
app/templates/module_graph_js.tpl - Table template
app/templates/module_table.tpl - Header template
app/templates/module_header.tpl - Footer template
app/templates/module_footer.tpl
Traffic data processing
- vnStat adapter
app/includes/vnstat.php - Formatting utilities
app/includes/utilities.php
Runtime configuration
- Runtime settings
app/includes/config.php
Other components
- Browser user
- vnstat executable
- Google Charts
Connections 12
- Browser user → Page controller: requests page
- Page controller → Runtime settings: loads settings
app/index.php - Page controller → vnStat adapter: requests interface data
app/index.php - vnStat adapter → vnstat executable: runs JSON command
app/includes/vnstat.php - vnStat adapter → Formatting utilities: formats values
app/includes/vnstat.php - Page controller → Smarty page template: renders page
app/index.php - Smarty page template → Graph template
- Smarty page template → Graph script template
- Smarty page template → Table template
- Smarty page template → Header template
- Smarty page template → Footer template
- Graph script template → Google Charts: uses charts
README.md