mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 08:18:08 +00:00
Merge remote-tracking branch 'origin/next' into feat/railpack
This commit is contained in:
commit
207002dbb7
45 files changed
+1572
-272
No files matched your search
@@ -32,6 +32,11 @@ use OpenApi\Attributes as OA;
|
||||
)]
|
||||
class EnvironmentVariable extends BaseModel
|
||||
{
|
||||
protected $attributes = [
|
||||
'is_runtime' => true,
|
||||
'is_buildtime' => true,
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
// Core identification
|
||||
'key',
|
||||
|
||||
@@ -1471,6 +1471,9 @@ $schema://$host {
|
||||
if ($validProxyTypes->contains(str($proxyType)->lower())) {
|
||||
$this->proxy->set('type', str($proxyType)->upper());
|
||||
$this->proxy->set('status', 'exited');
|
||||
$this->proxy->set('last_saved_proxy_configuration', null);
|
||||
$this->proxy->set('last_saved_settings', null);
|
||||
$this->proxy->set('last_applied_settings', null);
|
||||
$this->save();
|
||||
if ($this->proxySet()) {
|
||||
if ($async) {
|
||||
|
||||
+14
-7
@@ -89,10 +89,13 @@ class Team extends Model implements SendsDiscord, SendsEmail, SendsPushover, Sen
|
||||
});
|
||||
}
|
||||
|
||||
public static function serverLimitReached()
|
||||
public static function serverLimitReached(?Team $team = null)
|
||||
{
|
||||
$serverLimit = Team::serverLimit();
|
||||
$team = currentTeam();
|
||||
$team = $team ?? currentTeam();
|
||||
if (! $team) {
|
||||
return true;
|
||||
}
|
||||
$serverLimit = Team::serverLimit($team);
|
||||
$servers = $team->servers->count();
|
||||
|
||||
return $servers >= $serverLimit;
|
||||
@@ -109,19 +112,23 @@ class Team extends Model implements SendsDiscord, SendsEmail, SendsPushover, Sen
|
||||
|
||||
public function serverOverflow()
|
||||
{
|
||||
if ($this->serverLimit() < $this->servers->count()) {
|
||||
if (Team::serverLimit($this) < $this->servers->count()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function serverLimit()
|
||||
public static function serverLimit(?Team $team = null)
|
||||
{
|
||||
if (currentTeam()->id === 0 && isDev()) {
|
||||
$team = $team ?? currentTeam();
|
||||
if (! $team) {
|
||||
return 0;
|
||||
}
|
||||
if ($team->id === 0 && isDev()) {
|
||||
return 9999999;
|
||||
}
|
||||
$team = Team::find(currentTeam()->id);
|
||||
$team = Team::find($team->id);
|
||||
if (! $team) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user