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,41 +2,26 @@
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Models\SourceControl;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class SourceControlDisconnected extends Notification implements ShouldQueue
class SourceControlDisconnected extends AbstractNotification
{
use Queueable;
protected string $sourceControl;
public function __construct(string $sourceControl)
public function __construct(protected SourceControl $sourceControl)
{
$this->sourceControl = $sourceControl;
}
public function via(): array
public function rawText(): string
{
return ['mail'];
return __('Source control [:sourceControl] has been disconnected from Vito', [
'sourceControl' => $this->sourceControl->profile,
]);
}
public function toMail(): MailMessage
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->subject('Lost connection to your '.$this->sourceControl)
->line("We've lost connection to your $this->sourceControl account.")
->line("We'll not able to do any deployments until you reconnect.")
->line("To reconnect your $this->sourceControl account please click on the bellow button.")
->action('Reconnect', url('/source-controls'));
}
public function toArray(): array
{
return [
//
];
->subject(__('Source control disconnected!'))
->line($this->rawText());
}
}