Added Debug notifications
Some checks failed
Push image to registry / build-image (push) Failing after 3m41s
Some checks failed
Push image to registry / build-image (push) Failing after 3m41s
This commit is contained in:
40
app/Notification/Notifications/JobDebugNotification.php
Normal file
40
app/Notification/Notifications/JobDebugNotification.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notification\Notifications;
|
||||
|
||||
use App\Browser\JobDebugScreenshot;
|
||||
use App\Notification\Notification;
|
||||
use App\Notification\NotificationBody\JobDebugNotificationBody;
|
||||
use App\Notification\Stringifiable;
|
||||
use App\Notification\Stringifiable\StringifiableSimpleText;
|
||||
|
||||
class JobDebugNotification extends Notification {
|
||||
|
||||
private string|null $title;
|
||||
private string|null $screenShotProjectPath;
|
||||
|
||||
public function __construct(int $jobId, string $body, string $title = null, string $error = null, string $screenshotProjectPath = JobDebugScreenshot::getImgFileProjectPath($jobId), bool $isError = false) {
|
||||
parent::__construct($jobId, isError:$isError);
|
||||
$this->title = $title;
|
||||
$this->screenShotProjectPath = $screenshotProjectPath;
|
||||
$this->setBody(new JobDebugNotificationBody($this->job, $this->title, $body, $error, $this->screenShotProjectPath != null));
|
||||
}
|
||||
|
||||
public function getTitle(): Stringifiable {
|
||||
return new StringifiableSimpleText($this->title ?? "DEBUG Job {$this->job->name}");
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getImageProjectPath(): string|null {
|
||||
return $this->screenShotProjectPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getLinkURL(): string|null {
|
||||
return route('jobs.show', ['job' => $this->job->id]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user