WIP notifications and other refactors (#88)

* WIP notifications and other refactors
- refactor notification channels
- send notifications on events related to the servers and sites
- delete server log files on server deletion
- add telegram notification channel
- add new icons
- cache configs and icons on installation and updates
- new navbar for dark mode and settings

* discord channel

* build assets

* pint
This commit is contained in:
Saeed Vaziry
2024-01-07 09:54:08 +01:00
committed by GitHub
parent f06b8f7d20
commit e997d0deea
72 changed files with 1153 additions and 480 deletions

View File

@ -2,9 +2,17 @@
namespace App\Contracts;
use Illuminate\Notifications\Messages\MailMessage;
interface Notification
{
public function subject(): string;
public function rawText(): string;
public function message(bool $mail = false): mixed;
public function toMail(object $notifiable): MailMessage;
public function toSlack(object $notifiable): string;
public function toDiscord(object $notifiable): string;
public function toTelegram(object $notifiable): string;
}

View File

@ -4,11 +4,13 @@
interface NotificationChannel
{
public function validationRules(): array;
public function createRules(array $input): array;
public function data(array $input): array;
public function createData(array $input): array;
public function data(): array;
public function connect(): bool;
public function sendMessage(string $subject, string $text): void;
public function send(object $notifiable, Notification $notification): void;
}