fix
This commit is contained in:
parent
f7eccefda3
commit
08d992a1c2
4 changed files with 22 additions and 20 deletions
|
|
@ -18,6 +18,7 @@ public function __construct(
|
||||||
private SlackMessage $message,
|
private SlackMessage $message,
|
||||||
private string $webhookUrl
|
private string $webhookUrl
|
||||||
) {
|
) {
|
||||||
|
$this->onQueue('high');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
|
|
@ -28,7 +29,7 @@ public function handle(): void
|
||||||
'type' => 'section',
|
'type' => 'section',
|
||||||
'text' => [
|
'text' => [
|
||||||
'type' => 'plain_text',
|
'type' => 'plain_text',
|
||||||
'text' => "Coolify Notification",
|
'text' => 'Coolify Notification',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
@ -47,12 +48,12 @@ public function handle(): void
|
||||||
'type' => 'section',
|
'type' => 'section',
|
||||||
'text' => [
|
'text' => [
|
||||||
'type' => 'mrkdwn',
|
'type' => 'mrkdwn',
|
||||||
'text' => $this->message->description
|
'text' => $this->message->description,
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ public function send(SendsSlack $notifiable, Notification $notification): void
|
||||||
{
|
{
|
||||||
$message = $notification->toSlack();
|
$message = $notification->toSlack();
|
||||||
$webhookUrl = $notifiable->routeNotificationForSlack();
|
$webhookUrl = $notifiable->routeNotificationForSlack();
|
||||||
if (!$webhookUrl) {
|
if (! $webhookUrl) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dispatch(new SendMessageToSlackJob($message, $webhookUrl))->onQueue('high');
|
SendMessageToSlackJob::dispatch($message, $webhookUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ public function toDiscord(): DiscordMessage
|
||||||
color: DiscordMessage::successColor(),
|
color: DiscordMessage::successColor(),
|
||||||
);
|
);
|
||||||
|
|
||||||
$message->addField(name: 'Dashboard', value: '[Link](' . base_url() . ')', inline: true);
|
$message->addField(name: 'Dashboard', value: '[Link]('.base_url().')', inline: true);
|
||||||
|
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,19 @@
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration {
|
return new class extends Migration
|
||||||
|
{
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::table('teams', function (Blueprint $table) {
|
Schema::table('teams', function (Blueprint $table) {
|
||||||
$table->boolean('slack_enabled')->default(false);
|
$table->boolean('slack_enabled')->default(false);
|
||||||
$table->string('slack_webhook_url')->nullable();
|
$table->string('slack_webhook_url')->nullable();
|
||||||
$table->boolean('slack_notifications_test')->default(false);
|
$table->boolean('slack_notifications_test')->default(true);
|
||||||
$table->boolean('slack_notifications_deployments')->default(false);
|
$table->boolean('slack_notifications_deployments')->default(true);
|
||||||
$table->boolean('slack_notifications_status_changes')->default(false);
|
$table->boolean('slack_notifications_status_changes')->default(true);
|
||||||
$table->boolean('slack_notifications_database_backups')->default(false);
|
$table->boolean('slack_notifications_database_backups')->default(true);
|
||||||
$table->boolean('slack_notifications_scheduled_tasks')->default(false);
|
$table->boolean('slack_notifications_scheduled_tasks')->default(true);
|
||||||
$table->boolean('slack_notifications_server_disk_usage')->default(false);
|
$table->boolean('slack_notifications_server_disk_usage')->default(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,4 +35,4 @@ public function down(): void
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue