fix: add experimental flag

This commit is contained in:
Andras Bacsai
2024-10-24 21:48:51 +02:00
parent 8182305ac4
commit 0c34e81b2b
4 changed files with 9 additions and 4 deletions

View File

@@ -9,10 +9,10 @@ class StartSentinel
{
use AsAction;
public function handle(Server $server, bool $restart = false, bool $is_dev = false)
public function handle(Server $server, bool $restart = false)
{
// TODO: Sentinel is not available in this version (soon).
if (! $is_dev) {
if (! isExperimentalEnabled()) {
return;
}
$version = get_latest_sentinel_version();

View File

@@ -362,6 +362,10 @@ function isCloud(): bool
return ! config('coolify.self_hosted');
}
function isExperimentalEnabled(): bool
{
return config('coolify.is_experimental_enabled');
}
function translate_cron_expression($expression_to_validate): string
{
if (isset(VALID_CRON_STRINGS[$expression_to_validate])) {

View File

@@ -13,4 +13,5 @@ return [
'helper_image' => env('HELPER_IMAGE', 'ghcr.io/coollabsio/coolify-helper'),
'is_horizon_enabled' => env('HORIZON_ENABLED', true),
'is_scheduler_enabled' => env('SCHEDULER_ENABLED', true),
'is_experimental_enabled' => env('EXPERIMENTAL_ENABLED', false),
];

View File

@@ -159,7 +159,7 @@
</div>
</div>
@if (!$server->isSwarm() && !$server->isBuildServer())
@if (isDev())
@if (isExperimentalEnabled())
<div class="flex gap-2 items-center pt-4 pb-2">
<h3>Sentinel</h3>
@if ($server->isSentinelEnabled())
@@ -181,7 +181,7 @@
<h3>Sentinel</h3>
<div>Sentinel is not available in this version (soon).</div>
@endif
@if (isDev())
@if (isExperimentalEnabled())
<div class="flex flex-col gap-2">
<div class="w-64">
<x-forms.checkbox wire:model.live="server.settings.is_sentinel_enabled"