Changed latest graph to show last 7 days by default

This commit is contained in:
Henry Whitaker
2020-04-21 23:23:56 +01:00
parent 62eeeee9fe
commit 1c92353816
7 changed files with 18 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ class SpeedtestController extends Controller
{
public function index()
{
$data = Speedtest::orderBy('id', 'desc')
$data = Speedtest::orderBy('created_at', 'desc')
->paginate();
return response()->json([
@@ -40,6 +40,7 @@ class SpeedtestController extends Controller
}
$data = Speedtest::where('created_at', '>=', Carbon::now()->subDays($days))
->orderBy('created_at', 'desc')
->get();
return response()->json([

View File

@@ -39,7 +39,7 @@ class Kernel extends HttpKernel
],
'api' => [
'throttle:60,1',
'throttle:100,1',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];

View File

@@ -1,8 +1,18 @@
{
"1.2.6": [
{
"description": "Changed default view to last 7 days rather than last 30.",
"link": ""
},
{
"description": "Ordered all tests table by created date rather than id value.",
"link": ""
}
],
"1.2.5": [
{
"description": "Added max and average values to the latest results cards.",
"link": ""
"link": "https://github.com/henrywhitaker3/Speedtest-Tracker/commit/2adb977cfb75308d947426db81593df3df2c4839"
}
],
"1.2.4": [

View File

@@ -13,7 +13,7 @@ return [
|
*/
'name' => env('APP_NAME', 'Laravel'),
'name' => env('APP_NAME', 'Speedtest-Tracker'),
/*
|--------------------------------------------------------------------------

View File

@@ -7,7 +7,7 @@ return [
|--------------------------------------------------------------------------
*/
'version' => '1.2.5',
'version' => '1.2.6',
/*
|--------------------------------------------------------------------------

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -11,7 +11,7 @@ export default class HistoryGraph extends Component {
super(props)
this.state = {
days: 30,
days: 7,
duData: {},
duOptions: {},
pingData: {},