Refactor function and configuration names for experimental features

This commit is contained in:
Andras Bacsai
2024-10-24 22:00:26 +02:00
parent 0c34e81b2b
commit b1d2914c08
5 changed files with 7 additions and 6 deletions

View File

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

View File

@@ -362,9 +362,9 @@ function isCloud(): bool
return ! config('coolify.self_hosted'); return ! config('coolify.self_hosted');
} }
function isExperimentalEnabled(): bool function isExperimentalFeaturesEnabled(): bool
{ {
return config('coolify.is_experimental_enabled'); return config('coolify.is_experimental_features_enabled');
} }
function translate_cron_expression($expression_to_validate): string function translate_cron_expression($expression_to_validate): string
{ {

View File

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

View File

@@ -73,6 +73,7 @@ services:
- STRIPE_PRICE_ID_ULTIMATE_MONTHLY_OLD - STRIPE_PRICE_ID_ULTIMATE_MONTHLY_OLD
- STRIPE_PRICE_ID_ULTIMATE_YEARLY_OLD - STRIPE_PRICE_ID_ULTIMATE_YEARLY_OLD
- STRIPE_EXCLUDED_PLANS - STRIPE_EXCLUDED_PLANS
- EXPERIMENTAL_FEATURES
ports: ports:
- "${APP_PORT:-8000}:80" - "${APP_PORT:-8000}:80"
expose: expose:

View File

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