refactor discord notification view

This commit is contained in:
Andras Bacsai
2024-11-03 23:19:44 +01:00
parent fd546cec9d
commit 1bdc2c6d7c
2 changed files with 84 additions and 34 deletions

View File

@@ -9,7 +9,7 @@
<x-forms.button type="submit">
Save
</x-forms.button>
@if ($team->discord_enabled)
@if ($discordEnabled)
<x-forms.button class="normal-case dark:text-white btn btn-xs no-animation btn-primary"
wire:click="sendTestNotification">
Send Test Notifications
@@ -17,27 +17,26 @@
@endif
</div>
<div class="w-32">
<x-forms.checkbox instantSave id="team.discord_enabled" label="Enabled" />
<x-forms.checkbox instantSave id="discordEnabled" label="Enabled" />
</div>
<x-forms.input type="password"
helper="Generate a webhook in Discord.<br>Example: https://discord.com/api/webhooks/...." required
id="team.discord_webhook_url" label="Webhook" />
id="discordWebhookUrl" label="Webhook" />
</form>
@if (data_get($team, 'discord_enabled'))
@if ($discordEnabled)
<h2 class="mt-4">Subscribe to events</h2>
<div class="w-64">
@if (isDev())
<x-forms.checkbox instantSave="saveModel" id="team.discord_notifications_test" label="Test" />
<x-forms.checkbox instantSave="saveModel" id="discordNotificationsTest" label="Test" />
@endif
<x-forms.checkbox instantSave="saveModel" id="team.discord_notifications_status_changes"
<x-forms.checkbox instantSave="saveModel" id="discordNotificationsStatusChanges"
label="Container Status Changes" />
<x-forms.checkbox instantSave="saveModel" id="team.discord_notifications_deployments"
<x-forms.checkbox instantSave="saveModel" id="discordNotificationsDeployments"
label="Application Deployments" />
<x-forms.checkbox instantSave="saveModel" id="team.discord_notifications_database_backups"
label="Backup Status" />
<x-forms.checkbox instantSave="saveModel" id="team.discord_notifications_scheduled_tasks"
<x-forms.checkbox instantSave="saveModel" id="discordNotificationsDatabaseBackups" label="Backup Status" />
<x-forms.checkbox instantSave="saveModel" id="discordNotificationsScheduledTasks"
label="Scheduled Tasks Status" />
<x-forms.checkbox instantSave="saveModel" id="team.discord_notifications_server_disk_usage"
<x-forms.checkbox instantSave="saveModel" id="discordNotificationsServerDiskUsage"
label="Server Disk Usage" />
</div>
@endif