fix
This commit is contained in:
@@ -18,6 +18,7 @@ class SendMessageToSlackJob implements ShouldQueue
|
|||||||
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 @@ class SendMessageToSlackJob implements ShouldQueue
|
|||||||
'type' => 'section',
|
'type' => 'section',
|
||||||
'text' => [
|
'text' => [
|
||||||
'type' => 'plain_text',
|
'type' => 'plain_text',
|
||||||
'text' => "Coolify Notification",
|
'text' => 'Coolify Notification',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -47,12 +48,12 @@ class SendMessageToSlackJob implements ShouldQueue
|
|||||||
'type' => 'section',
|
'type' => 'section',
|
||||||
'text' => [
|
'text' => [
|
||||||
'type' => 'mrkdwn',
|
'type' => 'mrkdwn',
|
||||||
'text' => $this->message->description
|
'text' => $this->message->description,
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,9 +14,9 @@ class SlackChannel
|
|||||||
{
|
{
|
||||||
$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 @@ class Test extends Notification implements ShouldQueue
|
|||||||
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\Migrations\Migration;
|
|||||||
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 @@ return new class extends Migration {
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user