mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-20 10:23:30 +00:00
Extract application/database/service configuration sidebars and unified headings; improve clone-to-environment, embedded deployments, storage actions, OAuth icons, terminal, and shared form components.
29 lines
965 B
PHP
29 lines
965 B
PHP
@props([
|
|
'enabled',
|
|
'enabledProperty',
|
|
'toggleMethod',
|
|
'testMethod' => 'sendTestNotification',
|
|
'canUpdate' => true,
|
|
])
|
|
|
|
<div class="flex items-center gap-2"
|
|
x-data="{
|
|
enabled: @js((bool) $enabled),
|
|
enabledProperty: @js($enabledProperty),
|
|
toggleMethod: @js($toggleMethod),
|
|
testMethod: @js($testMethod),
|
|
}">
|
|
<x-forms.button type="button" :disabled="!$canUpdate" :isHighlighted="!$enabled"
|
|
x-on:click="
|
|
if (!enabled && !$el.closest('form').reportValidity()) return;
|
|
$wire.$set(enabledProperty, !enabled).then(() => $wire.$call(toggleMethod));
|
|
">
|
|
{{ $enabled ? 'Disable' : 'Enable' }}
|
|
</x-forms.button>
|
|
<x-forms.button type="button" :disabled="!$enabled"
|
|
x-on:click="if ($el.closest('form').reportValidity()) $wire.$call(testMethod)">
|
|
<x-reicon name="notifications" class="size-3.5" />
|
|
Send test
|
|
</x-forms.button>
|
|
</div>
|