[feature] Add environment values for Thresholds during initial setup (#1933)

This commit is contained in:
Sven van Ginkel
2024-12-29 14:32:44 +01:00
committed by GitHub
parent b2c8b28ebf
commit d40e4f7baa
2 changed files with 15 additions and 4 deletions
+11
View File
@@ -40,4 +40,15 @@ return [
*/
'skip_ips' => env('SPEEDTEST_SKIP_IPS', ''),
/**
* Threshold settings.
*/
'threshold_enabled' => env('THRESHOLD_ENABLED', false),
'threshold_download' => env('THRESHOLD_DOWNLOAD', 0),
'threshold_upload' => env('THRESHOLD_UPLOAD', 0),
'threshold_ping' => env('THRESHOLD_PING', 0) ,
];
@@ -6,9 +6,9 @@ class CreateThresholdsSettings extends SettingsMigration
{
public function up(): void
{
$this->migrator->add('threshold.absolute_enabled', false);
$this->migrator->add('threshold.absolute_download', 0);
$this->migrator->add('threshold.absolute_upload', 0);
$this->migrator->add('threshold.absolute_ping', 0);
$this->migrator->add('threshold.absolute_enabled', config('speedtest.threshold_enabled'));
$this->migrator->add('threshold.absolute_download', config('speedtest.threshold_download'));
$this->migrator->add('threshold.absolute_upload', config('speedtest.threshold_upload'));
$this->migrator->add('threshold.absolute_ping', config('speedtest.threshold_ping'));
}
}