Skip to content

Commit

Permalink
Add icons to webhook input fields in settings page
Browse files Browse the repository at this point in the history
- Added 'tabler-webhook' icon to all webhook input fields when the webhook type is set to 'json'.
- Added 'tabler-brand-discord-filled' icon to all webhook input fields when the webhook type is set to 'discord'.

These changes enhance the user interface of the settings page by providing visual indicators for different webhook types.
  • Loading branch information
Poseidon281 committed Aug 3, 2024
1 parent 0395078 commit 182c6a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/Filament/Pages/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ private function webhookSettings(): array
->label('Main Webhook')
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'json')
->url()
->prefixIcon('tabler-webhook')
->helperText('When webhooks are enabled, and a specific category is not set up, this fallback webhook will be used.')
->default(env('MAIN_WEBHOOK')),

Expand All @@ -356,6 +357,7 @@ private function webhookSettings(): array
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'json')
->hintAction($this->getUserHintAction())
->url()
->prefixIcon('tabler-webhook')
->helperText('All User related events will be logged to this webhook')
->default(env('USER_WEBHOOK')),

Expand All @@ -364,6 +366,7 @@ private function webhookSettings(): array
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'json')
->hintAction($this->getServerHintAction())
->url()
->prefixIcon('tabler-webhook')
->helperText('All Server related events will be logged to this webhook')
->default(env('SERVER_WEBHOOK')),

Expand All @@ -372,6 +375,7 @@ private function webhookSettings(): array
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'json')
->hintAction($this->getEggHintAction())
->url()
->prefixIcon('tabler-webhook')
->helperText('All Egg related events will be logged to this webhook')
->default(env('EGG_WEBHOOK')),

Expand All @@ -380,6 +384,7 @@ private function webhookSettings(): array
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'json')
->hintAction($this->getNodeHintAction())
->url()
->prefixIcon('tabler-webhook')
->helperText('All Node related events will be logged to this webhook')
->default(env('NODE_WEBHOOK')),

Expand All @@ -388,13 +393,15 @@ private function webhookSettings(): array
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'json')
->hintAction($this->getDatabaseHostHintAction())
->url()
->prefixIcon('tabler-webhook')
->helperText('All DatabaseHost related events will be logged to this webhook')
->default(env('DATABASE_HOST_WEBHOOK')),

TextInput::make('MAIN_WEBHOOK_DISCORD')
->label('Main Webhook')
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'discord')
->url()
->prefixIcon('tabler-brand-discord-filled')
->placeholder('https://discord.com/api/webhooks/')
->helperText('When webhooks are enabled, and a specific category is not set up, this fallback webhook will be used.')
->default(env('MAIN_WEBHOOK_DISCORD')),
Expand All @@ -403,6 +410,7 @@ private function webhookSettings(): array
->label('User Webhook')
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'discord')
->url()
->prefixIcon('tabler-brand-discord-filled')
->hintAction($this->getUserHintAction())
->placeholder('https://discord.com/api/webhooks/')
->helperText('All User related events will be logged to this webhook')
Expand All @@ -412,6 +420,7 @@ private function webhookSettings(): array
->label('Server Webhook')
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'discord')
->url()
->prefixIcon('tabler-brand-discord-filled')
->hintAction($this->getServerHintAction())
->placeholder('https://discord.com/api/webhooks/')
->helperText('All Server related events will be logged to this webhook')
Expand All @@ -422,6 +431,7 @@ private function webhookSettings(): array
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'discord')
->hintAction($this->getEggHintAction())
->url()
->prefixIcon('tabler-brand-discord-filled')
->placeholder('https://discord.com/api/webhooks/')
->helperText('All Egg related events will be logged to this webhook')
->default(env('EGG_WEBHOOK_DISCORD')),
Expand All @@ -431,6 +441,7 @@ private function webhookSettings(): array
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'discord')
->hintAction($this->getNodeHintAction())
->url()
->prefixIcon('tabler-brand-discord-filled')
->placeholder('https://discord.com/api/webhooks/')
->helperText('All Node related events will be logged to this webhook')
->default(env('NODE_WEBHOOK_DISCORD')),
Expand All @@ -440,6 +451,7 @@ private function webhookSettings(): array
->visible(fn (Get $get) => $get('WEBHOOK_TYPE') === 'discord')
->hintAction($this->getDatabaseHostHintAction())
->url()
->prefixIcon('tabler-brand-discord-filled')
->placeholder('https://discord.com/api/webhooks/')
->helperText('All DatabaseHost related events will be logged to this webhook')
->default(env('DATABASE_HOST_WEBHOOK_DISCORD')),
Expand Down

0 comments on commit 182c6a1

Please sign in to comment.