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

@ -3,9 +3,12 @@
namespace App\ServerTypes;
use App\Events\Broadcast;
use App\Facades\Notifier;
use App\Jobs\Installation\Initialize;
use App\Jobs\Installation\InstallRequirements;
use App\Jobs\Installation\Upgrade;
use App\Notifications\ServerInstallationFailed;
use App\Notifications\ServerInstallationSucceed;
use Illuminate\Support\Facades\Bus;
use Illuminate\Support\Facades\Log;
use Throwable;
@ -66,7 +69,7 @@ public function install(): void
'server' => $this->server,
])
);
/** @todo notify */
Notifier::send($this->server, new ServerInstallationSucceed($this->server));
};
Bus::chain($jobs)
@ -79,7 +82,7 @@ public function install(): void
'server' => $this->server,
])
);
/** @todo notify */
Notifier::send($this->server, new ServerInstallationFailed($this->server));
Log::error('server-installation-error', [
'error' => (string) $e,
]);

View File

@ -4,12 +4,15 @@
use App\Enums\ServerStatus;
use App\Events\Broadcast;
use App\Facades\Notifier;
use App\Jobs\Installation\Initialize;
use App\Jobs\Installation\InstallCertbot;
use App\Jobs\Installation\InstallComposer;
use App\Jobs\Installation\InstallNodejs;
use App\Jobs\Installation\InstallRequirements;
use App\Jobs\Installation\Upgrade;
use App\Notifications\ServerInstallationFailed;
use App\Notifications\ServerInstallationSucceed;
use Illuminate\Support\Facades\Bus;
use Illuminate\Support\Facades\Log;
use Throwable;
@ -88,7 +91,7 @@ public function install(): void
'server' => $this->server,
])
);
/** @todo notify */
Notifier::send($this->server, new ServerInstallationSucceed($this->server));
};
Bus::chain($jobs)
@ -101,7 +104,7 @@ public function install(): void
'server' => $this->server,
])
);
/** @todo notify */
Notifier::send($this->server, new ServerInstallationFailed($this->server));
Log::error('server-installation-error', [
'error' => (string) $e,
]);