mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-21 21:33:08 +01:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e556250aa | ||
|
|
87fc35c1c5 | ||
|
|
b6fca4e1a7 | ||
|
|
ae40f503e2 | ||
|
|
61da652b82 | ||
|
|
ec56337b99 | ||
|
|
0ed4674c3f | ||
|
|
dd56a667cd | ||
|
|
35a1de7333 | ||
|
|
f6de728265 | ||
|
|
d6da8962eb |
@@ -1,9 +1,11 @@
|
||||
# Speedtest Tracker
|
||||
|
||||
[](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [](https://github.com/henrywhitaker3/Speedtest-Tracker/commits)  [](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE)
|
||||
[](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [](https://github.com/henrywhitaker3/Speedtest-Tracker/commits)  [](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE)
|
||||
|
||||
This program runs a speedtest check every hour and graphs the results. The back-end is written in [Laravel](https://laravel.com/) and the front-end uses [React](https://reactjs.org/). It uses the [Ookla's speedtest cli](https://www.speedtest.net/apps/cli) package to get the data and uses [Chart.js](https://www.chartjs.org/) to plot the results.
|
||||
|
||||
A demo can be found [here](https://speedtest.plexmox.com)
|
||||
|
||||
Disclaimer: You will need to accept Ookla's EULA and privacy agreements in order to use this container.
|
||||
|
||||

|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Helpers;
|
||||
|
||||
use App\Events\TestNotificationEvent;
|
||||
use App\Setting;
|
||||
use Cache;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class SettingsHelper {
|
||||
@@ -53,6 +54,10 @@ class SettingsHelper {
|
||||
]);
|
||||
}
|
||||
|
||||
if($name == 'show_failed_tests_on_graph') {
|
||||
Cache::flush();
|
||||
}
|
||||
|
||||
return $setting;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,14 @@ class SpeedtestController extends Controller
|
||||
|
||||
$ttl = Carbon::now()->addDays(1);
|
||||
$data = Cache::remember('speedtest-days-' . $days, $ttl, function () use ($days) {
|
||||
$showFailed = (bool)SettingsHelper::get('show_failed_tests_on_graph')->value;
|
||||
|
||||
if($showFailed === true) {
|
||||
return Speedtest::where('created_at', '>=', Carbon::now()->subDays($days))
|
||||
->orderBy('created_at', 'asc')
|
||||
->get();
|
||||
}
|
||||
|
||||
return Speedtest::where('created_at', '>=', Carbon::now()->subDays($days))
|
||||
->where('failed', false)
|
||||
->orderBy('created_at', 'asc')
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
{
|
||||
"1.9.5": [
|
||||
{
|
||||
"description": "Added toggle to show failed tests on graphs.",
|
||||
"link": ""
|
||||
},
|
||||
{
|
||||
"description": "Updated dependencies.",
|
||||
"link": ""
|
||||
}
|
||||
],
|
||||
"1.9.4": [
|
||||
{
|
||||
"description": "Changed integration config loading.",
|
||||
|
||||
73
composer.lock
generated
73
composer.lock
generated
@@ -1149,16 +1149,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v7.25.0",
|
||||
"version": "v7.26.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "fdf3d4a40447eb286ba3820768306cae64bcc0b3"
|
||||
"reference": "f64299a11dedaaadf1cfff07b2b3220a9b791837"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/fdf3d4a40447eb286ba3820768306cae64bcc0b3",
|
||||
"reference": "fdf3d4a40447eb286ba3820768306cae64bcc0b3",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/f64299a11dedaaadf1cfff07b2b3220a9b791837",
|
||||
"reference": "f64299a11dedaaadf1cfff07b2b3220a9b791837",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1264,6 +1264,7 @@
|
||||
"nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).",
|
||||
"pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).",
|
||||
"phpunit/phpunit": "Required to use assertions and run tests (^8.4|^9.0).",
|
||||
"predis/predis": "Required to use the predis connector (^1.1.2).",
|
||||
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
|
||||
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).",
|
||||
"symfony/cache": "Required to PSR-6 cache bridge (^5.0).",
|
||||
@@ -1302,30 +1303,30 @@
|
||||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"time": "2020-08-11T13:43:10+00:00"
|
||||
"time": "2020-08-25T13:44:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/slack-notification-channel",
|
||||
"version": "v2.1.0",
|
||||
"version": "v2.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/slack-notification-channel.git",
|
||||
"reference": "d0a7f53342a5daa74e43e1b08dc8a7e83db152d8"
|
||||
"reference": "98e0fe5c8dda645e6af914285af7b742e167462a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/d0a7f53342a5daa74e43e1b08dc8a7e83db152d8",
|
||||
"reference": "d0a7f53342a5daa74e43e1b08dc8a7e83db152d8",
|
||||
"url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/98e0fe5c8dda645e6af914285af7b742e167462a",
|
||||
"reference": "98e0fe5c8dda645e6af914285af7b742e167462a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"guzzlehttp/guzzle": "^6.0|^7.0",
|
||||
"illuminate/notifications": "~5.8.0|^6.0|^7.0",
|
||||
"illuminate/notifications": "~5.8.0|^6.0|^7.0|^8.0",
|
||||
"php": "^7.1.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.0",
|
||||
"phpunit/phpunit": "^7.0|^8.0"
|
||||
"phpunit/phpunit": "^7.0|^8.0|^9.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
@@ -1359,7 +1360,7 @@
|
||||
"notifications",
|
||||
"slack"
|
||||
],
|
||||
"time": "2020-06-30T20:34:53+00:00"
|
||||
"time": "2020-08-25T18:21:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/tinker",
|
||||
@@ -1427,27 +1428,27 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/ui",
|
||||
"version": "v2.1.0",
|
||||
"version": "v2.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/ui.git",
|
||||
"reference": "da9350533d0da60d5dc42fb7de9c561c72129bba"
|
||||
"reference": "fb1404f04ece6eee128e3fb750d3a1e064238b33"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/ui/zipball/da9350533d0da60d5dc42fb7de9c561c72129bba",
|
||||
"reference": "da9350533d0da60d5dc42fb7de9c561c72129bba",
|
||||
"url": "https://api.github.com/repos/laravel/ui/zipball/fb1404f04ece6eee128e3fb750d3a1e064238b33",
|
||||
"reference": "fb1404f04ece6eee128e3fb750d3a1e064238b33",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/console": "^7.0",
|
||||
"illuminate/filesystem": "^7.0",
|
||||
"illuminate/support": "^7.0",
|
||||
"illuminate/console": "^7.0|^8.0",
|
||||
"illuminate/filesystem": "^7.0|^8.0",
|
||||
"illuminate/support": "^7.0|^8.0",
|
||||
"php": "^7.2.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.0",
|
||||
"phpunit/phpunit": "^8.0"
|
||||
"phpunit/phpunit": "^8.0|^9.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
@@ -1478,7 +1479,7 @@
|
||||
"laravel",
|
||||
"ui"
|
||||
],
|
||||
"time": "2020-06-30T20:56:33+00:00"
|
||||
"time": "2020-08-25T18:30:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "lcobucci/jwt",
|
||||
@@ -1537,16 +1538,16 @@
|
||||
},
|
||||
{
|
||||
"name": "league/commonmark",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/commonmark.git",
|
||||
"reference": "2574454b97e4103dc4e36917bd783b25624aefcd"
|
||||
"reference": "21819c989e69bab07e933866ad30c7e3f32984ba"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/2574454b97e4103dc4e36917bd783b25624aefcd",
|
||||
"reference": "2574454b97e4103dc4e36917bd783b25624aefcd",
|
||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/21819c989e69bab07e933866ad30c7e3f32984ba",
|
||||
"reference": "21819c989e69bab07e933866ad30c7e3f32984ba",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1628,20 +1629,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-19T22:47:30+00:00"
|
||||
"time": "2020-08-18T01:19:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/flysystem",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/flysystem.git",
|
||||
"reference": "481c0174b9c99b189959e2bb9d6f52188ed1f692"
|
||||
"reference": "9be3b16c877d477357c015cec057548cf9b2a14a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/481c0174b9c99b189959e2bb9d6f52188ed1f692",
|
||||
"reference": "481c0174b9c99b189959e2bb9d6f52188ed1f692",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a",
|
||||
"reference": "9be3b16c877d477357c015cec057548cf9b2a14a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1719,7 +1720,7 @@
|
||||
"type": "other"
|
||||
}
|
||||
],
|
||||
"time": "2020-08-09T15:57:10+00:00"
|
||||
"time": "2020-08-23T07:39:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/mime-type-detection",
|
||||
@@ -1928,16 +1929,16 @@
|
||||
},
|
||||
{
|
||||
"name": "nesbot/carbon",
|
||||
"version": "2.38.0",
|
||||
"version": "2.39.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/briannesbitt/Carbon.git",
|
||||
"reference": "d8f6a6a91d1eb9304527b040500f61923e97674b"
|
||||
"reference": "0a41ea7f7fedacf307b7a339800e10356a042918"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d8f6a6a91d1eb9304527b040500f61923e97674b",
|
||||
"reference": "d8f6a6a91d1eb9304527b040500f61923e97674b",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/0a41ea7f7fedacf307b7a339800e10356a042918",
|
||||
"reference": "0a41ea7f7fedacf307b7a339800e10356a042918",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2013,7 +2014,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-08-04T19:12:46+00:00"
|
||||
"time": "2020-08-24T12:35:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nikic/php-parser",
|
||||
|
||||
@@ -7,7 +7,7 @@ return [
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'version' => '1.9.4',
|
||||
'version' => '1.9.5',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use App\Helpers\SettingsHelper;
|
||||
use App\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddShowFailedTestsSetting extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if(!SettingsHelper::get('show_failed_tests_on_graph')) {
|
||||
Setting::create([
|
||||
'name' => 'show_failed_tests_on_graph',
|
||||
'value' => true,
|
||||
'description' => 'If enabled, failed tests will appear on the graphs as 0.'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Setting::whereIn('name', [
|
||||
'show_failed_tests_on_graph',
|
||||
])->delete();
|
||||
}
|
||||
}
|
||||
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
4
resources/js/components/Settings/Settings.js
vendored
4
resources/js/components/Settings/Settings.js
vendored
@@ -119,6 +119,10 @@ export default class Settings extends Component {
|
||||
'value': 6
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
obj: e.show_failed_tests_on_graph,
|
||||
type: 'checkbox'
|
||||
}
|
||||
]} />
|
||||
</Col>
|
||||
|
||||
Reference in New Issue
Block a user