mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +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:
@ -3,8 +3,11 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Exceptions\SourceControlIsNotConnected;
|
||||
use App\Facades\Notifier;
|
||||
use App\Models\GitHook;
|
||||
use App\Notifications\SourceControlDisconnected;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Throwable;
|
||||
|
||||
class GitHookController extends Controller
|
||||
@ -25,7 +28,7 @@ public function __invoke(Request $request)
|
||||
try {
|
||||
$gitHook->site->deploy();
|
||||
} catch (SourceControlIsNotConnected) {
|
||||
// TODO: send notification
|
||||
Notifier::send($gitHook->sourceControl, new SourceControlDisconnected($gitHook->sourceControl));
|
||||
} catch (Throwable $e) {
|
||||
Log::error('git-hook-exception', (array) $e);
|
||||
}
|
||||
|
@ -15,6 +15,10 @@ class AddChannel extends Component
|
||||
|
||||
public string $email;
|
||||
|
||||
public string $bot_token;
|
||||
|
||||
public string $chat_id;
|
||||
|
||||
public function add(): void
|
||||
{
|
||||
app(\App\Actions\NotificationChannels\AddChannel::class)->add(
|
||||
|
Reference in New Issue
Block a user