mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-17 04:15:02 +00:00
feat(core): prevent using servers with existing resources as build servers
This commit is contained in:
1 parent
372b064dba
commit
65b925252c
3 files changed
+22
-1
No files matched your search
@@ -7,6 +7,7 @@ use App\Actions\Server\StopSentinel;
|
||||
use App\Events\ServerReachabilityChanged;
|
||||
use App\Models\Server;
|
||||
use Livewire\Attributes\Computed;
|
||||
use Livewire\Attributes\Locked;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
@@ -50,6 +51,9 @@ class Show extends Component
|
||||
#[Validate(['required'])]
|
||||
public bool $isBuildServer;
|
||||
|
||||
#[Locked]
|
||||
public bool $isBuildServerLocked = false;
|
||||
|
||||
#[Validate(['required'])]
|
||||
public bool $isMetricsEnabled;
|
||||
|
||||
@@ -95,6 +99,9 @@ class Show extends Component
|
||||
try {
|
||||
$this->server = Server::ownedByCurrentTeam()->whereUuid($server_uuid)->firstOrFail();
|
||||
$this->syncData();
|
||||
if (! $this->server->isEmpty()) {
|
||||
$this->isBuildServerLocked = true;
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user