Skip to content

Commit c4d0a06

Browse files
committed
update the ui
1 parent f3efb81 commit c4d0a06

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

app/Filament/Pages/Settings/Notification.php

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,57 @@ public function form(Schema $schema): Schema
185185

186186
// ...
187187
]),
188+
Tab::make(__('settings/notifications.apprise'))
189+
->icon(Heroicon::CloudArrowUp)
190+
->schema([
191+
Toggle::make('apprise_enabled')
192+
->label(__('settings/notifications.enable_apprise_notifications'))
193+
->reactive()
194+
->columnSpanFull(),
195+
Grid::make([
196+
'default' => 1,
197+
])
198+
->hidden(fn (Get $get) => $get('apprise_enabled') !== true)
199+
->schema([
200+
Fieldset::make(__('settings.triggers'))
201+
->schema([
202+
Checkbox::make('apprise_on_speedtest_run')
203+
->label(__('settings/notifications.apprise_on_speedtest_run'))
204+
->columnSpanFull(),
205+
Checkbox::make('apprise_on_threshold_failure')
206+
->label(__('settings/notifications.apprise_on_threshold_failure'))
207+
->columnSpanFull(),
208+
]),
209+
Fieldset::make(__('settings/notifications.apprise_sidecar'))
210+
->schema([
211+
Checkbox::make('apprise_verify_ssl')
212+
->label(__('settings/notifications.apprise_verify_ssl'))
213+
->default(true)
214+
->columnSpanFull(),
215+
]),
216+
Repeater::make('apprise_channel_urls')
217+
->label(__('settings/notifications.apprise_channels'))
218+
->hint(new HtmlString('<a href="https://github.com/caronc/apprise-api" target="_blank">'.__('settings/notifications.apprise_documentation').'</a>'))
219+
->schema([
220+
TextInput::make('channel_url')
221+
->label(__('settings/notifications.apprise_channel_url'))
222+
->placeholder(__('settings/notifications.apprise_channel_url_placeholder'))
223+
->helperText(__('settings/notifications.apprise_channel_url_helper'))
224+
->maxLength(2000)
225+
->distinct()
226+
->required(),
227+
])
228+
->columnSpanFull(),
229+
Actions::make([
230+
Action::make('test apprise')
231+
->label(__('settings/notifications.test_apprise_channel'))
232+
->action(fn (Get $get) => SendAppriseTestNotification::run(
233+
channel_urls: $get('apprise_channel_urls'),
234+
))
235+
->hidden(fn (Get $get) => ! count($get('apprise_channel_urls'))),
236+
]),
237+
]),
238+
])
188239
])
189240
->columnSpanFull(),
190241

lang/en/settings/notifications.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// Apprise notifications
2222
'apprise' => 'Apprise',
23-
'apprise_description' => 'The Apprise Notification Library enables sending notifications to a wide range of services.',
2423
'enable_apprise_notifications' => 'Enable Apprise notifications',
2524
'apprise_on_speedtest_run' => 'Notify on every speedtest run',
2625
'apprise_on_threshold_failure' => 'Notify on threshold failures',

0 commit comments

Comments
 (0)