mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 06:56:15 +00:00
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:
@ -2,11 +2,10 @@
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Contracts\Notification;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
|
||||
class ServerInstallationSucceed implements Notification
|
||||
class ServerInstallationSucceed extends AbstractNotification
|
||||
{
|
||||
protected Server $server;
|
||||
|
||||
@ -20,14 +19,10 @@ public function subject(): string
|
||||
return __('Server installation succeed!');
|
||||
}
|
||||
|
||||
public function message(bool $mail = false): mixed
|
||||
public function rawText(): string
|
||||
{
|
||||
$this->server->refresh();
|
||||
|
||||
if ($mail) {
|
||||
return $this->mail();
|
||||
}
|
||||
|
||||
return __("Installation succeed for server [:server] \nServer IP: :ip \nUser: :user\nPassword: :password\n:link", [
|
||||
'server' => $this->server->name,
|
||||
'ip' => $this->server->ip,
|
||||
@ -37,11 +32,12 @@ public function message(bool $mail = false): mixed
|
||||
]);
|
||||
}
|
||||
|
||||
public function mail(): MailMessage
|
||||
public function toMail(object $notifiable): MailMessage
|
||||
{
|
||||
$this->server->refresh();
|
||||
|
||||
return (new MailMessage)
|
||||
->subject(__('Server installation succeed!'))
|
||||
->line('Your server ['.$this->server->name.'] has been installed successfully.')
|
||||
->line('Server IP: '.$this->server->ip)
|
||||
->line('User: '.$this->server->authentication['user'])
|
||||
|
Reference in New Issue
Block a user