feat: add discord notifications

This commit is contained in:
Andras Bacsai
2023-09-06 14:31:38 +02:00
parent df1b9e7319
commit f9a2ff6d90
21 changed files with 419 additions and 123 deletions

View File

@@ -5,7 +5,7 @@
<x-forms.button type="submit">
Save
</x-forms.button>
@if ($model->discord_enabled)
@if ($team->discord_enabled)
<x-forms.button class="text-white normal-case btn btn-xs no-animation btn-primary"
wire:click="sendTestNotification">
Send Test Notifications
@@ -13,26 +13,26 @@
@endif
</div>
<div class="w-48">
<x-forms.checkbox instantSave id="model.discord_enabled" label="Notification Enabled" />
<x-forms.checkbox instantSave id="team.discord_enabled" label="Notification Enabled" />
</div>
<x-forms.input type="password"
helper="Generate a webhook in Discord.<br>Example: https://discord.com/api/webhooks/...." required
id="model.discord_webhook_url" label="Webhook" />
id="team.discord_webhook_url" label="Webhook" />
</form>
@if (data_get($model, 'discord_enabled'))
@if (data_get($team, 'discord_enabled'))
<h3 class="mt-4">Subscribe to events</h3>
<div class="w-64">
@if (isDev())
<x-forms.checkbox instantSave="saveModel" id="model.discord_notifications_test" label="Test" />
<x-forms.checkbox instantSave="saveModel" id="team.discord_notifications_test" label="Test" />
@endif
<h4 class="mt-4">General</h4>
<x-forms.checkbox instantSave="saveModel" id="model.discord_notifications_status_changes"
<x-forms.checkbox instantSave="saveModel" id="team.discord_notifications_status_changes"
label="Container Status Changes" />
<h4 class="mt-4">Applications</h4>
<x-forms.checkbox instantSave="saveModel" id="model.discord_notifications_deployments"
<x-forms.checkbox instantSave="saveModel" id="team.discord_notifications_deployments"
label="Deployments" />
<h4 class="mt-4">Databases</h4>
<x-forms.checkbox instantSave="saveModel" id="model.discord_notifications_database_backups"
<x-forms.checkbox instantSave="saveModel" id="team.discord_notifications_database_backups"
label="Backup Statuses" />
</div>
@endif