diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 7cb89f2..d474e25 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -1,10 +1,10 @@ ### Before submitting an issue -RaspAP is a project currently led by one developer (Billz) in his limited spare time. As a result, I'm not able to respond to every troubleshooting request in a timely manner. If your issue is of a general nature (for example, "Is it possible to do 'x' with my RPi?") and not directly related to a defect with this project, try searching the official [Raspberry Pi forums](https://www.raspberrypi.org/forums/) or [Raspberry Pi on Stack Exchange](https://raspberrypi.stackexchange.com/). Chances are your question has been discussed and answered on one of these forums. +RaspAP is a project currently led by one developer (@billz) in his limited spare time. As a result, I'm not able to respond to every troubleshooting request in a timely manner. If your issue is of a general nature (for example, "Is it possible to do 'x' with my RPi?") and not directly related to a defect with this project, try searching the official Raspberry Pi forums (https://www.raspberrypi.org/forums/) or Raspberry Pi on Stack Exchange (https://raspberrypi.stackexchange.com/). Chances are your question has been discussed and answered before. -In most cases, RaspAP functions very well "out of the box" on fresh installs of the latest Raspbian distribtion (currently Stretch; the Lite version is recommended) on recent hardware like the RPi 3 Model B. Alternate hardware platforms such as the Banana Pi and operating systems other than Raspbian are not supported. If you have installed other software packages on top of RaspAP, particularly those related to networking such as TOR or OpenVPN, please test RaspAP first on a fresh install before reporting an issue. +In most cases, RaspAP functions very well "out of the box" on fresh installs of the latest Raspbian distribution (currently Stretch; the Lite version is recommended) on recent hardware like the RPi 3 Model B. Alternate hardware platforms such as the Banana Pi and operating systems other than Raspbian are not supported. If you have installed other software packages on top of RaspAP, particularly those related to networking such as TOR or OpenVPN, please test RaspAP first on a fresh install before reporting an issue. -The [FAQs](https://github.com/billz/raspap-webgui/wiki/FAQs) have answers to many common issues. Kindly refer to this before creating a new issue. +The FAQs have answers to many common issues. Kindly check this before creating a new issue https://github.com/billz/raspap-webgui/wiki/FAQs If, after searching these community forums and consulting the FAQ, your issue still persists please provide as much detailed information as possible. Incomplete issue reports will not be considered. @@ -13,15 +13,15 @@ Describe your issue here. ### Your environment * Raspberry Pi hardware (examples: Pi 3 Model B, Pi 2 Model B, Pi 1 Model B+, Pi Zero) -* Raspbian version (examples: Stretch, Jessie) +* Raspbian version (examples: Stretch Lite, Jessie) * RaspAP Quick Install or Manual setup? * Other software or services running with RaspAP? ### Steps to reproduce Tell us how to reproduce this issue. -### Expected behaviour +### Expected behavior Tell us what should happen. -### Actual behaviour +### Actual behavior Tell us what happens instead. diff --git a/README.md b/README.md index 5ab7882..655fcda 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This project was inspired by a [**blog post**](http://sirlagz.net/2013/02/06/scr We'd be curious to hear about how you use this with your own RPi-powered projects. Until then, here are some screenshots: -![](https://i.imgur.com/5E3SnEW.png) +![](https://i.imgur.com/gPbaM56.png) ![](https://i.imgur.com/jFDMEy6.png) ![](https://i.imgur.com/ck0XS8P.png) ![](https://i.imgur.com/Vaej8Xv.png) @@ -16,11 +16,11 @@ We'd be curious to hear about how you use this with your own RPi-powered project - [Prerequisites](#prerequisites) - [Quick installer](#quick-installer) + - [Support us](#support-us) - [Manual installation](#manual-installation) - [Multilingual support](#multilingual-support) - [Optional services](#optional-services) - [How to contribute](#how-to-contribute) - - [Support us](#support-us) - [License](#license) ## Prerequisites @@ -54,6 +54,12 @@ configured as an access point as follows: * SSID: `raspi-webgui` * Password: ChangeMe +## Support us + +RaspAP is free software, but powered by your support. If you find RaspAP useful for your personal projects, please consider making a small donation. We feel strongly about creating high quality, easy-to-use software, as well as the importance of keeping it maintained. + +[![Beerpay](https://beerpay.io/billz/raspap-webgui/badge.svg?style=flat)](https://beerpay.io/billz/raspap-webgui) + ## Manual installation These steps apply to the latest release of Raspbian (currently [Stretch](https://www.raspberrypi.org/downloads/raspbian/)). Notes for previously released versions are provided, where applicable. Start off by installing git, lighttpd, php7, hostapd and dnsmasq. ```sh @@ -161,12 +167,6 @@ Please note that these are only UI's for now. If there's enough interest I'll co 4. Open a pull request, and reference the initial issue in the pull request message. -## Support us - -If you find RaspAP useful for your personal or commerical projects, please consider buying the founders a beer! - -[![Beerpay](https://beerpay.io/billz/raspap-webgui/badge.svg?style=beer-square)](https://beerpay.io/billz/raspap-webgui) - ## License See the [LICENSE](./LICENSE) file. diff --git a/ajax/bandwidth/get_bandwidth.php b/ajax/bandwidth/get_bandwidth.php index ea0c103..a784b4d 100644 --- a/ajax/bandwidth/get_bandwidth.php +++ b/ajax/bandwidth/get_bandwidth.php @@ -26,6 +26,8 @@ if (strlen($interface) > IFNAMSIZ) { exit('Invalid interface name.'); } +require_once './get_bandwidth_hourly.php'; + exec(sprintf('vnstat -i %s --json ', escapeshellarg($interface)), $jsonstdoutvnstat, $exitcodedaily); if ($exitcodedaily !== 0) { diff --git a/ajax/bandwidth/get_bandwidth_hourly.php b/ajax/bandwidth/get_bandwidth_hourly.php new file mode 100644 index 0000000..5c8276d --- /dev/null +++ b/ajax/bandwidth/get_bandwidth_hourly.php @@ -0,0 +1,63 @@ + array('date' => '00:00', 'rx' => 0, 'tx' => 0), + 1 => array('date' => '01:00', 'rx' => 0, 'tx' => 0), + 2 => array('date' => '02:00', 'rx' => 0, 'tx' => 0), + 3 => array('date' => '03:00', 'rx' => 0, 'tx' => 0), + 4 => array('date' => '04:00', 'rx' => 0, 'tx' => 0), + 5 => array('date' => '05:00', 'rx' => 0, 'tx' => 0), + 6 => array('date' => '06:00', 'rx' => 0, 'tx' => 0), + 7 => array('date' => '07:00', 'rx' => 0, 'tx' => 0), + 8 => array('date' => '08:00', 'rx' => 0, 'tx' => 0), + 9 => array('date' => '09:00', 'rx' => 0, 'tx' => 0), + 10 => array('date' => '10:00', 'rx' => 0, 'tx' => 0), + 11 => array('date' => '11:00', 'rx' => 0, 'tx' => 0), + 12 => array('date' => '12:00', 'rx' => 0, 'tx' => 0), + 13 => array('date' => '13:00', 'rx' => 0, 'tx' => 0), + 14 => array('date' => '14:00', 'rx' => 0, 'tx' => 0), + 15 => array('date' => '15:00', 'rx' => 0, 'tx' => 0), + 16 => array('date' => '16:00', 'rx' => 0, 'tx' => 0), + 17 => array('date' => '17:00', 'rx' => 0, 'tx' => 0), + 18 => array('date' => '18:00', 'rx' => 0, 'tx' => 0), + 19 => array('date' => '19:00', 'rx' => 0, 'tx' => 0), + 20 => array('date' => '20:00', 'rx' => 0, 'tx' => 0), + 21 => array('date' => '21:00', 'rx' => 0, 'tx' => 0), + 22 => array('date' => '22:00', 'rx' => 0, 'tx' => 0), + 23 => array('date' => '23:00', 'rx' => 0, 'tx' => 0) + ); + + + + + exec(sprintf('vnstat -i %s --json h', escapeshellarg($interface)), $jsonstdoutvnstat, $exitcodedaily); + if ($exitcodedaily !== 0) { + exit('vnstat error'); + } + + $jsonobj = json_decode($jsonstdoutvnstat[0], true)['interfaces'][0]; + $jsonData = $jsonobj['traffic']['hours']; + for ($i = count($jsonData) - 1; $i >= 0; --$i) { + $data_template[$jsonData[$i]['id']]['rx'] = round($jsonData[$i]['rx'] / 1024, 0); + $data_template[$jsonData[$i]['id']]['tx'] = round($jsonData[$i]['tx'] / 1024, 0); + } + + $data = array(); + $hour = $jsonobj['updated']['time']['hour']; + foreach ($data_template as $key => $value) { + if ($key > $hour) { + array_push($data, $value); + } + } + foreach ($data_template as $key => $value) { + if ($key <= $hour) { + array_push($data, $value); + } + } + echo json_encode($data); + exit(0); +} diff --git a/includes/data_usage.php b/includes/data_usage.php index db2e4cb..6436dc3 100755 --- a/includes/data_usage.php +++ b/includes/data_usage.php @@ -5,6 +5,7 @@ */ function DisplayDataUsage(&$extraFooterScripts) { +exec("ip -o link show | awk -F ': ' '{print $2}' | grep -v lo ", $interfacesWlo); ?>
@@ -16,27 +17,48 @@ function DisplayDataUsage(&$extraFooterScripts)
-
+
+
+
+

+ + + +
+
+
+
+
+

- +
@@ -53,7 +75,6 @@ foreach ($interfacesWlo as $interface) { echo ' ' , PHP_EOL; } - ?>