mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 02:15:51 +00:00
feat(ui): Shadow UI redesign, domain management, and DNS autoconfigure (#11119)
Co-authored-by: ShadowArcanist <162910371+ShadowArcanist@users.noreply.github.com>
This commit is contained in:
1 parent
0b843bb07c
commit
8ae56587d5
497 files changed
+44045
-22630
No files matched your search
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Notifications\Concerns;
|
||||
|
||||
trait TogglesNotificationEvents
|
||||
{
|
||||
private const NOTIFICATION_EVENT_KEYS = [
|
||||
'deploymentSuccess',
|
||||
'deploymentFailure',
|
||||
'statusChange',
|
||||
'backupSuccess',
|
||||
'backupFailure',
|
||||
'scheduledTaskSuccess',
|
||||
'scheduledTaskFailure',
|
||||
'dockerCleanupSuccess',
|
||||
'dockerCleanupFailure',
|
||||
'serverDiskUsage',
|
||||
'serverReachable',
|
||||
'serverUnreachable',
|
||||
'serverPatch',
|
||||
'traefikOutdated',
|
||||
];
|
||||
|
||||
public function toggleEvent(string $property): void
|
||||
{
|
||||
$channel = class_basename(static::class);
|
||||
$allowedProperties = array_map(
|
||||
static fn (string $event): string => $event.$channel.'Notifications',
|
||||
self::NOTIFICATION_EVENT_KEYS,
|
||||
);
|
||||
|
||||
abort_unless(in_array($property, $allowedProperties, true), 404);
|
||||
|
||||
$this->{$property} = ! $this->{$property};
|
||||
$this->saveModel();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user