Release v0.11.13 (#550)

This commit is contained in:
Alex Justesen
2023-04-18 20:30:08 -04:00
committed by GitHub
parent b48a5b3533
commit 8507bfc906
14 changed files with 670 additions and 585 deletions
+25
View File
@@ -0,0 +1,25 @@
# Description
A short description of the pull request changes should go here and the sections below should list in detail all changes. You can remove the sections you don't need.
## Changelog
### Added
- one
- two
### Changed
- one
- two
### Fixed
- one
- two
### Removed
- one
- two
## Screenshots
If this PR has any UI/UX changes it's strongly suggested you add screenshots here.
+81 -5
View File
@@ -4,7 +4,7 @@
/**
* A helper file for Laravel, to provide autocomplete information to your IDE
* Generated for Laravel 9.52.4.
* Generated for Laravel 9.52.6.
*
* This file should not be included in your code, only analyzed by your IDE!
*
@@ -18593,7 +18593,7 @@
/**
*
*
* @param \Spatie\FlareClient\FlareMiddleware\FlareMiddleware|array<FlareMiddleware>|\Spatie\FlareClient\class-string<FlareMiddleware> $middleware
* @param \Spatie\FlareClient\FlareMiddleware\FlareMiddleware|array<FlareMiddleware>|\Spatie\FlareClient\class-string<FlareMiddleware>|callable $middleware
* @return \Spatie\FlareClient\Flare
* @static
*/
@@ -18888,6 +18888,21 @@
public static function parseActionName($name)
{
return \Livewire\Testing\TestableLivewire::parseActionName($name);
}
/**
*
*
* @see \Filament\Support\Testing\TestsActions::assertActionListInOrder()
* @param array $names
* @param array $actions
* @param string $actionType
* @param string $actionClass
* @return self
* @static
*/
public static function assertActionListInOrder($names, $actions, $actionType, $actionClass)
{
return \Livewire\Testing\TestableLivewire::assertActionListInOrder($names, $actions, $actionType, $actionClass);
}
/**
*
@@ -18974,6 +18989,18 @@
public static function assertPageActionDoesNotExist($name)
{
return \Livewire\Testing\TestableLivewire::assertPageActionDoesNotExist($name);
}
/**
*
*
* @see \Filament\Testing\TestsPageActions::assertPageActionsExistInOrder()
* @param array $names
* @return static
* @static
*/
public static function assertPageActionsExistInOrder($names)
{
return \Livewire\Testing\TestableLivewire::assertPageActionsExistInOrder($names);
}
/**
*
@@ -19278,13 +19305,14 @@
*
* @see \Filament\Forms\Testing\TestsForms::assertFormFieldExists()
* @param string $fieldName
* @param string $formName
* @param \Closure|string $formName
* @param \Closure|null $callback
* @return static
* @static
*/
public static function assertFormFieldExists($fieldName, $formName = 'form')
public static function assertFormFieldExists($fieldName, $formName = 'form', $callback = null)
{
return \Livewire\Testing\TestableLivewire::assertFormFieldExists($fieldName, $formName);
return \Livewire\Testing\TestableLivewire::assertFormFieldExists($fieldName, $formName, $callback);
}
/**
*
@@ -19437,6 +19465,42 @@
public static function assertTableActionDoesNotExist($name)
{
return \Livewire\Testing\TestableLivewire::assertTableActionDoesNotExist($name);
}
/**
*
*
* @see \Filament\Tables\Testing\TestsActions::assertTableActionsExistInOrder()
* @param array $names
* @return static
* @static
*/
public static function assertTableActionsExistInOrder($names)
{
return \Livewire\Testing\TestableLivewire::assertTableActionsExistInOrder($names);
}
/**
*
*
* @see \Filament\Tables\Testing\TestsActions::assertTableHeaderActionsExistInOrder()
* @param array $names
* @return static
* @static
*/
public static function assertTableHeaderActionsExistInOrder($names)
{
return \Livewire\Testing\TestableLivewire::assertTableHeaderActionsExistInOrder($names);
}
/**
*
*
* @see \Filament\Tables\Testing\TestsActions::assertTableEmptyStateActionsExistInOrder()
* @param array $names
* @return static
* @static
*/
public static function assertTableEmptyStateActionsExistInOrder($names)
{
return \Livewire\Testing\TestableLivewire::assertTableEmptyStateActionsExistInOrder($names);
}
/**
*
@@ -19763,6 +19827,18 @@
public static function assertTableBulkActionDoesNotExist($name)
{
return \Livewire\Testing\TestableLivewire::assertTableBulkActionDoesNotExist($name);
}
/**
*
*
* @see \Filament\Tables\Testing\TestsBulkActions::assertTableBulkActionsExistInOrder()
* @param array $names
* @return static
* @static
*/
public static function assertTableBulkActionsExistInOrder($names)
{
return \Livewire\Testing\TestableLivewire::assertTableBulkActionsExistInOrder($names);
}
/**
*
+2 -2
View File
@@ -33,8 +33,8 @@ class Dashboard extends BasePage
$settings = new GeneralSettings();
$this->lastResult = $result->created_at
->timezone($settings->timezone)
->format($settings->time_format);
->timezone($settings->timezone)
->format($settings->time_format);
}
return view(static::$view, $this->getViewData())
+103 -103
View File
@@ -44,115 +44,115 @@ class GeneralPage extends SettingsPage
Grid::make([
'default' => 1,
])
->schema([
Section::make('Site Settings')
->schema([
TextInput::make('site_name')
->maxLength(50)
->required()
->columnSpan(['md' => 2]),
Select::make('timezone')
->options(Timezone::all()->pluck('code', 'code'))
->searchable()
->required(),
TextInput::make('time_format')
->helperText('Use [DateTime Format](https://www.php.net/manual/en/datetime.format.php) options to change the format of the datetime in views.')
->placeholder('M j, Y G:i:s')
->maxLength(25)
->required(),
Select::make('content_width')
->options([
'7xl' => 'Default width',
'full' => 'Full width',
]),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
->schema([
Section::make('Site Settings')
->schema([
TextInput::make('site_name')
->maxLength(50)
->required()
->columnSpan(['md' => 2]),
Select::make('timezone')
->options(Timezone::all()->pluck('code', 'code'))
->searchable()
->required(),
TextInput::make('time_format')
->helperText('Use [DateTime Format](https://www.php.net/manual/en/datetime.format.php) options to change the format of the datetime in views.')
->placeholder('M j, Y G:i:s')
->maxLength(25)
->required(),
Select::make('content_width')
->options([
'7xl' => 'Default width',
'full' => 'Full width',
]),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
Section::make('Speedtest Settings')
->schema([
TextInput::make('speedtest_schedule')
->rules([new ValidCronExpression()])
->helperText('Leave empty to disable the schedule. You can also use the cron expression generator [HERE](https://crontab.cronhub.io/) to help you make schedules.')
->nullable()
->columnSpan(1),
Select::make('speedtest_server')
->label('Speedtest server ID')
->helperText('Leave empty to let the system pick the best server.')
->nullable()
->multiple()
->maxItems(10)
->searchable()
->options(function () {
$response = Http::get(
url: 'https://www.speedtest.net/api/js/servers',
query: [
'engine' => 'js',
'https_functional' => true,
'limit' => 10,
]
);
Section::make('Speedtest Settings')
->schema([
TextInput::make('speedtest_schedule')
->rules([new ValidCronExpression()])
->helperText('Leave empty to disable the schedule. You can also use the cron expression generator [HERE](https://crontab.cronhub.io/) to help you make schedules.')
->nullable()
->columnSpan(1),
Select::make('speedtest_server')
->label('Speedtest server ID')
->helperText('Leave empty to let the system pick the best server.')
->nullable()
->multiple()
->maxItems(10)
->searchable()
->options(function () {
$response = Http::get(
url: 'https://www.speedtest.net/api/js/servers',
query: [
'engine' => 'js',
'https_functional' => true,
'limit' => 10,
]
);
if ($response->failed()) {
return [
'' => 'There was an error retrieving Speedtest servers',
];
}
if ($response->failed()) {
return [
'' => 'There was an error retrieving Speedtest servers',
];
}
return $response->collect()->map(function ($item) {
return [
'id' => $item['id'],
'name' => $item['id'].': '.$item['name'].' ('.$item['sponsor'].')',
];
})->pluck('name', 'id');
})
->getSearchResultsUsing(function (string $search) {
$response = Http::get(
url: 'https://www.speedtest.net/api/js/servers',
query: [
'engine' => 'js',
'search' => $search,
'https_functional' => true,
'limit' => 10,
]
);
return $response->collect()->map(function ($item) {
return [
'id' => $item['id'],
'name' => $item['id'].': '.$item['name'].' ('.$item['sponsor'].')',
];
})->pluck('name', 'id');
})
->getSearchResultsUsing(function (string $search) {
$response = Http::get(
url: 'https://www.speedtest.net/api/js/servers',
query: [
'engine' => 'js',
'search' => $search,
'https_functional' => true,
'limit' => 10,
]
);
if ($response->failed()) {
return [
'' => 'There was an error retrieving Speedtest servers',
];
}
if ($response->failed()) {
return [
'' => 'There was an error retrieving Speedtest servers',
];
}
if (! $response->collect()->count() && is_numeric($search)) {
return collect([
[
'id' => $search,
'name' => $search.': No server found, manually add this ID.',
],
]);
}
if (! $response->collect()->count() && is_numeric($search)) {
return collect([
[
'id' => $search,
'name' => $search.': No server found, manually add this ID.',
],
]);
}
return $response->collect()->map(function ($item) {
return [
'id' => $item['id'],
'name' => $item['id'].': '.$item['name'].' ('.$item['sponsor'].')',
];
})->pluck('name', 'id');
})
->columnSpan(2),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
])
->columnSpan([
'md' => 2,
]),
return $response->collect()->map(function ($item) {
return [
'id' => $item['id'],
'name' => $item['id'].': '.$item['name'].' ('.$item['sponsor'].')',
];
})->pluck('name', 'id');
})
->columnSpan(2),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
])
->columnSpan([
'md' => 2,
]),
]),
];
}
+49 -49
View File
@@ -44,56 +44,56 @@ class InfluxDbPage extends SettingsPage
Grid::make([
'default' => 1,
])
->schema([
Section::make('InfluxDB v2 Settings')
->schema([
Toggle::make('v2_enabled')
->label('Enable')
->reactive()
->columnSpan(2),
Grid::make([
'default' => 1,
->schema([
Section::make('InfluxDB v2 Settings')
->schema([
Toggle::make('v2_enabled')
->label('Enable')
->reactive()
->columnSpan(2),
Grid::make([
'default' => 1,
])
->hidden(fn (Closure $get) => $get('v2_enabled') !== true)
->schema([
TextInput::make('v2_url')
->label('URL')
->placeholder('http://your-influxdb-instance')
->maxLength(255)
->required(fn (Closure $get) => $get('v2_enabled') == true)
->columnSpan(['md' => 2]),
Checkbox::make('v2_verify_ssl')
->label('Verify SSL')
->columnSpan(['md' => 2]),
TextInput::make('v2_org')
->label('Org')
->maxLength(255)
->required(fn (Closure $get) => $get('v2_enabled') == true)
->columnSpan(1),
TextInput::make('v2_bucket')
->placeholder('speedtest-tracker')
->label('Bucket')
->maxLength(255)
->required(fn (Closure $get) => $get('v2_enabled') == true)
->columnSpan(1),
TextInput::make('v2_token')
->label('Token')
->maxLength(255)
->password()
->required(fn (Closure $get) => $get('v2_enabled') == true)
->disableAutocomplete()
->columnSpan(['md' => 2]),
]),
])
->hidden(fn (Closure $get) => $get('v2_enabled') !== true)
->schema([
TextInput::make('v2_url')
->label('URL')
->placeholder('http://your-influxdb-instance')
->maxLength(255)
->required(fn (Closure $get) => $get('v2_enabled') == true)
->columnSpan(['md' => 2]),
Checkbox::make('v2_verify_ssl')
->label('Verify SSL')
->columnSpan(['md' => 2]),
TextInput::make('v2_org')
->label('Org')
->maxLength(255)
->required(fn (Closure $get) => $get('v2_enabled') == true)
->columnSpan(1),
TextInput::make('v2_bucket')
->placeholder('speedtest-tracker')
->label('Bucket')
->maxLength(255)
->required(fn (Closure $get) => $get('v2_enabled') == true)
->columnSpan(1),
TextInput::make('v2_token')
->label('Token')
->maxLength(255)
->password()
->required(fn (Closure $get) => $get('v2_enabled') == true)
->disableAutocomplete()
->columnSpan(['md' => 2]),
]),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
])
->columnSpan([
'md' => 2,
]),
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
])
->columnSpan([
'md' => 2,
]),
]),
];
}
+105 -103
View File
@@ -54,117 +54,119 @@ class NotificationPage extends SettingsPage
Grid::make([
'default' => 1,
])
->schema([
Section::make('Database')
->description('Notifications sent to this channel will show up under the 🔔 icon in the header.')
->schema([
Toggle::make('database_enabled')
->label('Enable database notifications')
->reactive()
->columnSpan(2),
Grid::make([
'default' => 1,
])
->hidden(fn (Closure $get) => $get('database_enabled') !== true)
->schema([
Section::make('Database')
->description('Notifications sent to this channel will show up under the 🔔 icon in the header.')
->schema([
Fieldset::make('Triggers')
Toggle::make('database_enabled')
->label('Enable database notifications')
->reactive()
->columnSpan(2),
Grid::make([
'default' => 1,
])
->hidden(fn (Closure $get) => $get('database_enabled') !== true)
->schema([
Toggle::make('database_on_speedtest_run')
->label('Notify on every speetest run')
->columnSpan(2),
Toggle::make('database_on_threshold_failure')
->label('Notify on threshold failures')
->columnSpan(2),
Fieldset::make('Triggers')
->schema([
Toggle::make('database_on_speedtest_run')
->label('Notify on every speetest run')
->columnSpan(2),
Toggle::make('database_on_threshold_failure')
->label('Notify on threshold failures')
->columnSpan(2),
]),
TestDatabaseNotification::make('test channel'),
]),
TestDatabaseNotification::make('test channel'),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
Section::make('Mail')
->schema([
Toggle::make('mail_enabled')
->label('Enable mail notifications')
->reactive()
->columnSpan(2),
Grid::make([
'default' => 1,
])
->hidden(fn (Closure $get) => $get('mail_enabled') !== true)
Section::make('Mail')
->schema([
Fieldset::make('Triggers')
->schema([
Toggle::make('mail_on_speedtest_run')
->label('Notify on every speetest run')
->columnSpan(2),
Toggle::make('mail_on_threshold_failure')
->label('Notify on threshold failures')
->columnSpan(2),
]),
]),
Repeater::make('mail_recipients')
->label('Recipients')
->schema([
TextInput::make('email_address')
->email()
->required(),
Toggle::make('mail_enabled')
->label('Enable mail notifications')
->reactive()
->columnSpan(2),
Grid::make([
'default' => 1,
])
->hidden(fn (Closure $get) => $get('mail_enabled') !== true)
->columnSpan(['md' => 2]),
TestMailNotification::make('test channel')
->hidden(fn (Closure $get) => $get('mail_enabled') !== true),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
Section::make('Telegram')
->schema([
Toggle::make('telegram_enabled')
->label('Enable telegram notifications')
->reactive()
->columnSpan(2),
Grid::make([
'default' => 1, ])
->hidden(fn (Closure $get) => $get('telegram_enabled') !== true)
->schema([
Fieldset::make('Triggers')
->schema([
Toggle::make('telegram_on_speedtest_run')
->label('Notify on every speetest run')
->columnSpan(2),
Toggle::make('telegram_on_threshold_failure')
->label('Notify on threshold failures')
->columnSpan(2),
]),
]),
Repeater::make('telegram_recipients')
->label('Recipients')
->schema([
TextInput::make('telegram_chat_id')
->maxLength(50)
->required()
Fieldset::make('Triggers')
->schema([
Toggle::make('mail_on_speedtest_run')
->label('Notify on every speetest run')
->columnSpan(2),
Toggle::make('mail_on_threshold_failure')
->label('Notify on threshold failures')
->columnSpan(2),
]),
])
->hidden(fn (Closure $get) => $get('mail_enabled') !== true),
Repeater::make('mail_recipients')
->label('Recipients')
->schema([
TextInput::make('email_address')
->email()
->required(),
])
->hidden(fn (Closure $get) => $get('mail_enabled') !== true)
->columnSpan(['md' => 2]),
])
->hidden(fn (Closure $get) => $get('telegram_enabled') !== true)
->columnSpan(['md' => 2]),
TestTelegramNotification::make('test channel')
->hidden(fn (Closure $get) => $get('telegram_enabled') !== true),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
])
->columnSpan([
'md' => 2,
]),
TestMailNotification::make('test channel')
->hidden(fn (Closure $get) => $get('mail_enabled') !== true),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
Section::make('Telegram')
->schema([
Toggle::make('telegram_enabled')
->label('Enable telegram notifications')
->reactive()
->columnSpan(2),
Grid::make([
'default' => 1, ])
->hidden(fn (Closure $get) => $get('telegram_enabled') !== true)
->schema([
Fieldset::make('Triggers')
->schema([
Toggle::make('telegram_on_speedtest_run')
->label('Notify on every speetest run')
->columnSpan(2),
Toggle::make('telegram_on_threshold_failure')
->label('Notify on threshold failures')
->columnSpan(2),
]),
]),
Repeater::make('telegram_recipients')
->label('Recipients')
->schema([
TextInput::make('telegram_chat_id')
->maxLength(50)
->required()
->columnSpan(['md' => 2]),
])
->hidden(fn (Closure $get) => $get('telegram_enabled') !== true)
->columnSpan(['md' => 2]),
TestTelegramNotification::make('test channel')
->hidden(fn (Closure $get) => $get('telegram_enabled') !== true),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
])
->columnSpan([
'md' => 2,
]),
Card::make()
->schema([
@@ -233,7 +235,7 @@ class NotificationPage extends SettingsPage
if (! empty($notificationSettings->telegram_recipients)) {
foreach ($notificationSettings->telegram_recipients as $recipient) {
\Illuminate\Support\Facades\Notification::route('telegram_chat_id', $recipient['telegram_chat_id'])
->notify(new TelegramNotification('Test notification channel *telegram*'));
->notify(new TelegramNotification('Test notification channel *telegram*'));
}
Notification::make()
+51 -51
View File
@@ -46,61 +46,61 @@ class ThresholdsPage extends SettingsPage
Grid::make([
'default' => 1,
])
->schema([
Section::make('Absolute')
->description('Absolute thresholds do not take into account previous history and could be triggered on each test.')
->schema([
Toggle::make('absolute_enabled')
->label('Enable absolute thresholds')
->reactive()
->columnSpan(2),
Grid::make([
'default' => 1,
])
->hidden(fn (Closure $get) => $get('absolute_enabled') !== true)
->schema([
Section::make('Absolute')
->description('Absolute thresholds do not take into account previous history and could be triggered on each test.')
->schema([
Fieldset::make('Metrics')
Toggle::make('absolute_enabled')
->label('Enable absolute thresholds')
->reactive()
->columnSpan(2),
Grid::make([
'default' => 1,
])
->hidden(fn (Closure $get) => $get('absolute_enabled') !== true)
->schema([
TextInput::make('absolute_download')
->label('Download')
->hint('Mbps')
->helperText('Set to zero to disable this metric.')
->default(0)
->minValue(0)
->numeric()
->required(),
TextInput::make('absolute_upload')
->label('Upload')
->hint('Mbps')
->helperText('Set to zero to disable this metric.')
->default(0)
->minValue(0)
->numeric()
->required(),
TextInput::make('absolute_ping')
->label('Ping')
->hint('Ms')
->helperText('Set to zero to disable this metric.')
->default(0)
->minValue(0)
->numeric()
->required(),
])
->columns([
'default' => 1,
'md' => 2,
Fieldset::make('Metrics')
->schema([
TextInput::make('absolute_download')
->label('Download')
->hint('Mbps')
->helperText('Set to zero to disable this metric.')
->default(0)
->minValue(0)
->numeric()
->required(),
TextInput::make('absolute_upload')
->label('Upload')
->hint('Mbps')
->helperText('Set to zero to disable this metric.')
->default(0)
->minValue(0)
->numeric()
->required(),
TextInput::make('absolute_ping')
->label('Ping')
->hint('Ms')
->helperText('Set to zero to disable this metric.')
->default(0)
->minValue(0)
->numeric()
->required(),
])
->columns([
'default' => 1,
'md' => 2,
]),
]),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
])
->compact()
->columns([
'default' => 1,
'md' => 2,
]),
])
->columnSpan([
'md' => 2,
]),
])
->columnSpan([
'md' => 2,
]),
Card::make()
->schema([
+1 -1
View File
@@ -215,7 +215,7 @@ class AbsoluteListener implements ShouldQueue
])->render();
\Illuminate\Support\Facades\Notification::route('telegram_chat_id', $recipient['telegram_chat_id'])
->notify(new TelegramNotification($message));
->notify(new TelegramNotification($message));
}
}
}
-16
View File
@@ -1,16 +0,0 @@
<?php
namespace App\Policies;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
class FailedJobPolicy
{
use HandlesAuthorization;
public function viewAny(User $user): bool
{
return config('app.debug');
}
}
-4
View File
@@ -4,10 +4,7 @@ namespace App\Providers;
// use Illuminate\Support\Facades\Gate;
// TODO: remove package and policy as FailedJob is no longer included
use Amvisor\FilamentFailedJobs\Models\FailedJob;
use App\Models\Result;
use App\Policies\FailedJobPolicy;
use App\Policies\ResultPolicy;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
@@ -19,7 +16,6 @@ class AuthServiceProvider extends ServiceProvider
* @var array<class-string, class-string>
*/
protected $policies = [
FailedJob::class => FailedJobPolicy::class,
Result::class => ResultPolicy::class,
];
+2 -2
View File
@@ -42,7 +42,7 @@ class TelegramNotification extends Notification
public function toTelegram($notifiable)
{
return TelegramMessage::create()
->to($notifiable->routes['telegram_chat_id'])
->content($this->message);
->to($notifiable->routes['telegram_chat_id'])
->content($this->message);
}
}
Generated
+246 -247
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -6,7 +6,7 @@ return [
/**
* Build information
*/
'build_date' => Carbon::parse('2023-03-26'),
'build_date' => Carbon::parse('2023-04-18'),
'build_version' => '0.11.12',
'build_version' => '0.11.13',
];
+3
View File
@@ -0,0 +1,3 @@
{
"preset": "laravel"
}