mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-21 13:23:04 +01:00
Added failure graph and graph settings panel
This commit is contained in:
70
database/migrations/2020_07_06_105930_add_graph_settings.php
Normal file
70
database/migrations/2020_07_06_105930_add_graph_settings.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
use App\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddGraphSettings extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Setting::create([
|
||||
'name' => 'download_upload_graph_enabled',
|
||||
'value' => true,
|
||||
'description' => 'Enable the download/upload graph'
|
||||
]);
|
||||
|
||||
Setting::create([
|
||||
'name' => 'download_upload_graph_width',
|
||||
'value' => 6,
|
||||
'description' => 'Set the width of the download/upload graph'
|
||||
]);
|
||||
|
||||
Setting::create([
|
||||
'name' => 'ping_graph_enabled',
|
||||
'value' => true,
|
||||
'description' => 'Enable the ping graph'
|
||||
]);
|
||||
|
||||
Setting::create([
|
||||
'name' => 'ping_graph_width',
|
||||
'value' => 6,
|
||||
'description' => 'Set the width of the ping graph'
|
||||
]);
|
||||
|
||||
Setting::create([
|
||||
'name' => 'failure_graph_enabled',
|
||||
'value' => true,
|
||||
'description' => 'Enable the failure rate graph'
|
||||
]);
|
||||
|
||||
Setting::create([
|
||||
'name' => 'failure_graph_width',
|
||||
'value' => 6,
|
||||
'description' => 'Set the width of the failure rate graph'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Setting::whereIn('name', [
|
||||
'download_upload_graph_enabled',
|
||||
'download_upload_graph_width',
|
||||
'ping_graph_enabled',
|
||||
'ping_graph_width',
|
||||
'failure_graph_enabled',
|
||||
'failure_graph_width'
|
||||
])->delete();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user