Fixed min setting bug

This commit is contained in:
Henry Whitaker
2020-09-11 01:23:25 +01:00
parent 8ff87c2e7a
commit 342d3fabf4
6 changed files with 13 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
# Speedtest Tracker # Speedtest Tracker
[![Docker pulls](https://img.shields.io/docker/pulls/henrywhitaker3/speedtest-tracker?style=flat-square)](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Stable?label=master&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Dev?label=dev&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![last_commit](https://img.shields.io/github/last-commit/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [![issues](https://img.shields.io/github/issues/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [![commit_freq](https://img.shields.io/github/commit-activity/m/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) ![version](https://img.shields.io/badge/version-v1.9.7-success?style=flat-square) [![license](https://img.shields.io/github/license/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE) [![Docker pulls](https://img.shields.io/docker/pulls/henrywhitaker3/speedtest-tracker?style=flat-square)](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Stable?label=master&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Dev?label=dev&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![last_commit](https://img.shields.io/github/last-commit/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [![issues](https://img.shields.io/github/issues/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [![commit_freq](https://img.shields.io/github/commit-activity/m/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) ![version](https://img.shields.io/badge/version-v1.9.8-success?style=flat-square) [![license](https://img.shields.io/github/license/henrywhitaker3/Speedtest-Tracker?style=flat-square)](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. 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.

View File

@@ -144,7 +144,7 @@ class SpeedtestController extends Controller
$response['maximum'] = $max; $response['maximum'] = $max;
} }
if (SettingsHelper::get('show_average')) { if (SettingsHelper::get('show_min')) {
$min = Speedtest::select(DB::raw('MIN(ping) as ping, MIN(download) as download, MIN(upload) as upload')) $min = Speedtest::select(DB::raw('MIN(ping) as ping, MIN(download) as download, MIN(upload) as upload'))
->where('failed', false) ->where('failed', false)
->first() ->first()

View File

@@ -1,4 +1,10 @@
{ {
"1.9.8": [
{
"description": "Fixed bug with minimum display setting.",
"link": ""
}
],
"1.9.7": [ "1.9.7": [
{ {
"description": "Added option to display minimum values on the top widgets.", "description": "Added option to display minimum values on the top widgets.",

View File

@@ -7,7 +7,7 @@ return [
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
'version' => '1.9.7', 'version' => '1.9.8',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -30,7 +30,7 @@ export default class Widget extends Component {
returnData.max = parseFloat(data.maximum.ping).toFixed(1); returnData.max = parseFloat(data.maximum.ping).toFixed(1);
} }
if(window.config.widgets.show_max) { if(window.config.widgets.show_min) {
returnData.min = parseFloat(data.minimum.ping).toFixed(1); returnData.min = parseFloat(data.minimum.ping).toFixed(1);
} }
} }
@@ -46,7 +46,7 @@ export default class Widget extends Component {
returnData.max = parseFloat(data.maximum.upload).toFixed(1); returnData.max = parseFloat(data.maximum.upload).toFixed(1);
} }
if(window.config.widgets.show_max) { if(window.config.widgets.show_min) {
returnData.min = parseFloat(data.minimum.upload).toFixed(1); returnData.min = parseFloat(data.minimum.upload).toFixed(1);
} }
} }
@@ -62,7 +62,7 @@ export default class Widget extends Component {
returnData.max = parseFloat(data.maximum.download).toFixed(1); returnData.max = parseFloat(data.maximum.download).toFixed(1);
} }
if(window.config.widgets.show_max) { if(window.config.widgets.show_min) {
returnData.min = parseFloat(data.minimum.download).toFixed(1); returnData.min = parseFloat(data.minimum.download).toFixed(1);
} }
} }