This commit is contained in:
Andras Bacsai
2023-06-20 19:08:43 +02:00
parent f648ab49f7
commit 9f0ca1cc2e
19 changed files with 226 additions and 197 deletions

View File

@@ -5,7 +5,7 @@
<x-forms.button type="submit">
Save
</x-forms.button>
@if ($model->extra_attributes->discord_enabled)
@if ($model->discord->enabled)
<x-forms.button class="text-white normal-case btn btn-xs no-animation btn-primary"
wire:click="sendTestNotification">
Send Test Notifications
@@ -13,20 +13,20 @@
@endif
</div>
<div class="w-48">
<x-forms.checkbox instantSave id="model.extra_attributes.discord_enabled" label="Notification Enabled" />
<x-forms.checkbox instantSave id="model.discord.enabled" label="Notification Enabled" />
</div>
<x-forms.input type="string"
helper="Generate a webhook in Discord.<br>Example: https://discord.com/api/webhooks/...." required
id="model.extra_attributes.discord_webhook_url" label="Webhook" />
id="model.discord.webhook_url" label="Webhook" />
</form>
@if (data_get($model, 'extra_attributes.discord_enabled'))
@if (data_get($model, 'discord.enabled'))
<h4 class="mt-4">Subscribe to events</h4>
<div class="w-64 ">
@if (isDev())
<x-forms.checkbox instantSave="saveModel" id="model.extra_attributes.notifications_discord_test"
<x-forms.checkbox instantSave="saveModel" id="model.discord_notifications.test"
label="Test Notifications" />
@endif
<x-forms.checkbox instantSave="saveModel" id="model.extra_attributes.notifications_discord_deployments"
<x-forms.checkbox instantSave="saveModel" id="model.discord_notifications.deployments"
label="New Deployments" />
</div>
@endif

View File

@@ -6,11 +6,11 @@
Save
</x-forms.button>
@if (auth()->user()->isInstanceAdmin())
<x-forms.button wire:click='copySMTP'>
<x-forms.button wire:click='copyFromInstanceSettings'>
Copy from Instance Settings
</x-forms.button>
@endif
@if ($model->extra_attributes->smtp_enabled)
@if ($model->smtp->enabled)
<x-forms.button class="text-white normal-case btn btn-xs no-animation btn-primary"
wire:click="sendTestNotification">
Send Test Notifications
@@ -18,49 +18,44 @@
@endif
</div>
<div class="w-48">
<x-forms.checkbox instantSave id="model.extra_attributes.smtp_enabled" label="Notification Enabled" />
<x-forms.checkbox instantSave id="model.smtp.enabled" label="Notification Enabled" />
</div>
<div class="flex flex-col gap-2 xl:flex-row">
<x-forms.input id="model.extra_attributes.smtp_recipients"
placeholder="If empty, all users will be notified in the team."
<x-forms.input id="model.smtp.recipients" placeholder="If empty, all users will be notified in the team."
helper="Email list to send the all notifications to, separated by comma." label="Recipients" />
<x-forms.input id="model.extra_attributes.smtp_test_recipients" label="Test Notification Recipients"
<x-forms.input id="model.smtp.test_recipients" label="Test Notification Recipients"
placeholder="If empty, all users will be notified in the team."
helper="Email list to send the test notification to, separated by comma." />
</div>
<div class="flex flex-col gap-2 xl:flex-row">
<x-forms.input required id="model.extra_attributes.smtp_host" helper="SMTP Hostname"
placeholder="smtp.mailgun.org" label="Host" />
<x-forms.input required id="model.extra_attributes.smtp_port" helper="SMTP Port" placeholder="587"
label="Port" />
<x-forms.input helper="If SMTP through SSL, set it to 'tls'." placeholder="tls"
id="model.extra_attributes.smtp_encryption" label="Encryption" />
<x-forms.input required id="model.smtp.host" helper="SMTP Hostname" placeholder="smtp.mailgun.org"
label="Host" />
<x-forms.input required id="model.smtp.port" helper="SMTP Port" placeholder="587" label="Port" />
<x-forms.input helper="If SMTP through SSL, set it to 'tls'." placeholder="tls" id="model.smtp.encryption"
label="Encryption" />
</div>
<div class="flex flex-col">
<div class="flex flex-col gap-2 xl:flex-row">
<x-forms.input id="model.extra_attributes.smtp_username" helper="SMTP Username" label="Username" />
<x-forms.input type="password" helper="SMTP Password" id="model.extra_attributes.smtp_password"
label="Password" />
<x-forms.input id="model.smtp.username" helper="SMTP Username" label="Username" />
<x-forms.input type="password" helper="SMTP Password" id="model.smtp.password" label="Password" />
</div>
<x-forms.input id="model.extra_attributes.smtp_timeout" helper="Timeout value for sending emails."
label="Timeout" />
<x-forms.input id="model.smtp.timeout" helper="Timeout value for sending emails." label="Timeout" />
<div class="flex flex-col gap-2 xl:flex-row">
<x-forms.input required id="model.extra_attributes.smtp_from_name" helper="Name used in emails."
label="From Name" />
<x-forms.input required id="model.extra_attributes.smtp_from_address"
helper="Email address used in emails." label="From Address" />
<x-forms.input required id="model.smtp.from_name" helper="Name used in emails." label="From Name" />
<x-forms.input required id="model.smtp.from_address" helper="Email address used in emails."
label="From Address" />
</div>
</div>
</form>
@if (data_get($model, 'extra_attributes.smtp_enabled'))
@if (data_get($model, 'smtp.enabled'))
<h4 class="mt-4">Subscribe to events</h4>
<div class="w-64 ">
<div class="w-64">
@if (isDev())
<x-forms.checkbox instantSave="saveModel" id="model.extra_attributes.notifications_smtp_test"
<x-forms.checkbox instantSave="saveModel" id="model.smtp_notifications.test"
label="Test Notifications" />
@endif
<x-forms.checkbox instantSave="saveModel" id="model.extra_attributes.notifications_email_deployments"
<x-forms.checkbox instantSave="saveModel" id="model.smtp_notifications.deployments"
label="New Deployments" />
</div>
@endif

View File

@@ -8,12 +8,12 @@
</div>
<div class="pt-2 pb-4 ">SMTP settings for password resets, invitations, etc.</div>
<div class="flex flex-col">
<x-forms.checkbox instantSave id="settings.extra_attributes.smtp_enabled" label="Enabled" />
<x-forms.checkbox instantSave id="settings.smtp.enabled" label="Enabled" />
</div>
<div class="flex items-end gap-2">
<x-forms.input id="settings.extra_attributes.smtp_test_recipients" label="Test Recipients"
<x-forms.input id="settings.smtp.test_recipients" label="Test Recipients"
helper="Email list to send a test email to, separated by comma." />
@if ($settings->extra_attributes->smtp_enabled)
@if ($settings->smtp->enabled)
<x-forms.button wire:click='test_email'>
Send Test Email
</x-forms.button>
@@ -21,26 +21,22 @@
</div>
<div class="flex flex-col gap-2 xl:flex-row">
<div class="flex flex-col w-full">
<x-forms.input required id="settings.extra_attributes.smtp_host" helper="SMTP Hostname"
placeholder="smtp.mailgun.org" label="Host" />
<x-forms.input required id="settings.extra_attributes.smtp_port" helper="SMTP Port" placeholder="587"
label="Port" />
<x-forms.input id="settings.extra_attributes.smtp_encryption"
helper="If SMTP through SSL, set it to 'tls'." placeholder="tls" label="Encryption" />
<x-forms.input required id="settings.smtp.host" helper="SMTP Hostname" placeholder="smtp.mailgun.org"
label="Host" />
<x-forms.input required id="settings.smtp.port" helper="SMTP Port" placeholder="587" label="Port" />
<x-forms.input id="settings.smtp.encryption" helper="If SMTP through SSL, set it to 'tls'."
placeholder="tls" label="Encryption" />
</div>
<div class="flex flex-col w-full">
<x-forms.input id="settings.extra_attributes.smtp_username" helper="SMTP Username"
label="SMTP Username" />
<x-forms.input id="settings.extra_attributes.smtp_password" type="password" helper="SMTP Password"
<x-forms.input id="settings.smtp.username" helper="SMTP Username" label="SMTP Username" />
<x-forms.input id="settings.smtp.password" type="password" helper="SMTP Password"
label="SMTP Password" />
<x-forms.input id="settings.extra_attributes.smtp_timeout" helper="Timeout value for sending emails."
label="Timeout" />
<x-forms.input id="settings.smtp.timeout" helper="Timeout value for sending emails." label="Timeout" />
</div>
<div class="flex flex-col w-full">
<x-forms.input required id="settings.extra_attributes.smtp_from_name" helper="Name used in emails."
label="From Name" />
<x-forms.input required id="settings.extra_attributes.smtp_from_address"
helper="Email address used in emails." label="From Address" />
<x-forms.input required id="settings.smtp.from_name" helper="Name used in emails." label="From Name" />
<x-forms.input required id="settings.smtp.from_address" helper="Email address used in emails."
label="From Address" />
</div>
</div>
</form>