diff --git a/app/Filament/Pages/Settings/NotificationPage.php b/app/Filament/Pages/Settings/NotificationPage.php index 070a4c122..59b63dd8a 100755 --- a/app/Filament/Pages/Settings/NotificationPage.php +++ b/app/Filament/Pages/Settings/NotificationPage.php @@ -96,7 +96,95 @@ public function form(Form $form): Form 'md' => 2, ]), + Section::make('Mail') + ->schema([ + Toggle::make('mail_enabled') + ->label('Enable mail notifications') + ->reactive() + ->columnSpanFull(), + Grid::make([ + 'default' => 1, + ]) + ->hidden(fn (Forms\Get $get) => $get('mail_enabled') !== true) + ->schema([ + Fieldset::make('Triggers') + ->schema([ + Toggle::make('mail_on_speedtest_run') + ->label('Notify on every speedtest run') + ->columnSpanFull(), + Toggle::make('mail_on_threshold_failure') + ->label('Notify on threshold failures') + ->columnSpanFull(), + ]), + Repeater::make('mail_recipients') + ->label('Recipients') + ->schema([ + Forms\Components\TextInput::make('email_address') + ->placeholder('your@email.com') + ->email() + ->required(), + ]) + ->columnSpanFull(), + Actions::make([ + Action::make('test mail') + ->label('Test mail channel') + ->action(fn (Forms\Get $get) => SendMailTestNotification::run(recipients: $get('mail_recipients'))) + ->hidden(fn (Forms\Get $get) => ! count($get('mail_recipients'))), + ]), + ]), + ]) + ->compact() + ->columns([ + 'default' => 1, + 'md' => 2, + ]), + + Section::make('Webhook') + ->schema([ + Toggle::make('webhook_enabled') + ->label('Enable webhook notifications') + ->reactive() + ->columnSpanFull(), + Grid::make([ + 'default' => 1, + ]) + ->hidden(fn (Forms\Get $get) => $get('webhook_enabled') !== true) + ->schema([ + Fieldset::make('Triggers') + ->schema([ + Toggle::make('webhook_on_speedtest_run') + ->label('Notify on every speedtest run') + ->columnSpan(2), + Toggle::make('webhook_on_threshold_failure') + ->label('Notify on threshold failures') + ->columnSpan(2), + ]), + Repeater::make('webhook_urls') + ->label('Recipients') + ->schema([ + Forms\Components\TextInput::make('url') + ->placeholder('https://webhook.site/longstringofcharacters') + ->maxLength(2000) + ->required() + ->url(), + ]) + ->columnSpanFull(), + Actions::make([ + Action::make('test webhook') + ->label('Test webhook channel') + ->action(fn (Forms\Get $get) => SendWebhookTestNotification::run(webhooks: $get('webhook_urls'))) + ->hidden(fn (Forms\Get $get) => ! count($get('webhook_urls'))), + ]), + ]), + ]) + ->compact() + ->columns([ + 'default' => 1, + 'md' => 2, + ]), + Section::make('Pushover') + ->description('⚠️ Pushover is deprecated and will be removed in a future release.') ->schema([ Toggle::make('pushover_enabled') ->label('Enable Pushover webhook notifications') @@ -154,6 +242,7 @@ public function form(Form $form): Form ]), Section::make('Discord') + ->description('⚠️ Discord is deprecated and will be removed in a future release.') ->schema([ Toggle::make('discord_enabled') ->label('Enable Discord webhook notifications') @@ -198,6 +287,7 @@ public function form(Form $form): Form ]), Section::make('Gotify') + ->description('⚠️ Gotify is deprecated and will be removed in a future release.') ->schema([ Toggle::make('gotify_enabled') ->label('Enable Gotify webhook notifications') @@ -242,6 +332,7 @@ public function form(Form $form): Form ]), Section::make('Slack') + ->description('⚠️ Slack is deprecated and will be removed in a future release.') ->schema([ Toggle::make('slack_enabled') ->label('Enable Slack webhook notifications') @@ -286,6 +377,7 @@ public function form(Form $form): Form ]), Section::make('Ntfy') + ->description('⚠️ Ntfy is deprecated and will be removed in a future release.') ->schema([ Toggle::make('ntfy_enabled') ->label('Enable Ntfy webhook notifications') @@ -343,50 +435,8 @@ public function form(Form $form): Form 'md' => 2, ]), - Section::make('Mail') - ->schema([ - Toggle::make('mail_enabled') - ->label('Enable mail notifications') - ->reactive() - ->columnSpanFull(), - Grid::make([ - 'default' => 1, - ]) - ->hidden(fn (Forms\Get $get) => $get('mail_enabled') !== true) - ->schema([ - Fieldset::make('Triggers') - ->schema([ - Toggle::make('mail_on_speedtest_run') - ->label('Notify on every speedtest run') - ->columnSpanFull(), - Toggle::make('mail_on_threshold_failure') - ->label('Notify on threshold failures') - ->columnSpanFull(), - ]), - Repeater::make('mail_recipients') - ->label('Recipients') - ->schema([ - Forms\Components\TextInput::make('email_address') - ->placeholder('your@email.com') - ->email() - ->required(), - ]) - ->columnSpanFull(), - Actions::make([ - Action::make('test mail') - ->label('Test mail channel') - ->action(fn (Forms\Get $get) => SendMailTestNotification::run(recipients: $get('mail_recipients'))) - ->hidden(fn (Forms\Get $get) => ! count($get('mail_recipients'))), - ]), - ]), - ]) - ->compact() - ->columns([ - 'default' => 1, - 'md' => 2, - ]), - Section::make('Healthcheck.io') + ->description('⚠️ Healthcheck.io is deprecated and will be removed in a future release.') ->schema([ Toggle::make('healthcheck_enabled') ->label('Enable healthcheck.io webhook notifications') @@ -432,6 +482,7 @@ public function form(Form $form): Form ]), Section::make('Telegram') + ->description('⚠️ Telegram is deprecated and will be removed in a future release.') ->schema([ Toggle::make('telegram_enabled') ->label('Enable telegram notifications') @@ -480,50 +531,6 @@ public function form(Form $form): Form 'default' => 1, 'md' => 2, ]), - - Section::make('Webhook') - ->schema([ - Toggle::make('webhook_enabled') - ->label('Enable webhook notifications') - ->reactive() - ->columnSpanFull(), - Grid::make([ - 'default' => 1, - ]) - ->hidden(fn (Forms\Get $get) => $get('webhook_enabled') !== true) - ->schema([ - Fieldset::make('Triggers') - ->schema([ - Toggle::make('webhook_on_speedtest_run') - ->label('Notify on every speedtest run') - ->columnSpan(2), - Toggle::make('webhook_on_threshold_failure') - ->label('Notify on threshold failures') - ->columnSpan(2), - ]), - Repeater::make('webhook_urls') - ->label('Recipients') - ->schema([ - Forms\Components\TextInput::make('url') - ->placeholder('https://webhook.site/longstringofcharacters') - ->maxLength(2000) - ->required() - ->url(), - ]) - ->columnSpanFull(), - Actions::make([ - Action::make('test webhook') - ->label('Test webhook channel') - ->action(fn (Forms\Get $get) => SendWebhookTestNotification::run(webhooks: $get('webhook_urls'))) - ->hidden(fn (Forms\Get $get) => ! count($get('webhook_urls'))), - ]), - ]), - ]) - ->compact() - ->columns([ - 'default' => 1, - 'md' => 2, - ]), ]) ->columnSpan([ 'md' => 2, diff --git a/resources/views/filament/forms/notifications-helptext.blade.php b/resources/views/filament/forms/notifications-helptext.blade.php index 131e2a4ea..88ac268d3 100644 --- a/resources/views/filament/forms/notifications-helptext.blade.php +++ b/resources/views/filament/forms/notifications-helptext.blade.php @@ -1,6 +1,11 @@
-

- 💡 Did you know, when a notification is triggered it's sent to channels. - Each channel can be configured separately to have the notification sent to a specific destination. +

+ ⚠️ Deprecated Channels +

+ +

+ Database, mail and webhook channels are considered core notification channels. + + All other channels should be considered deprecated and will be replaced by Apprise in a future release.