update helper and disable input if variable is shared

This commit is contained in:
peaklabs-dev
2024-10-16 13:44:17 +02:00
parent 6f97d589ae
commit 85c3270dcc
3 changed files with 32 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Livewire\Project\Database\Redis;
use App\Actions\Database\StartDatabaseProxy;
use App\Actions\Database\StopDatabaseProxy;
use App\Models\EnvironmentVariable;
use App\Models\Server;
use App\Models\StandaloneRedis;
use Exception;
@@ -144,6 +145,14 @@ class General extends Component
return view('livewire.project.database.redis.general');
}
public function isSharedVariable($name)
{
return EnvironmentVariable::where('key', $name)
->where('standalone_redis_id', $this->database->id)
->where('is_shared', true)
->exists();
}
private function updateEnvironmentVariable($key, $value)
{
$envVar = $this->database->runtime_environment_variables()