do not use hash routing for tabs

add empty project creation
if local image is found, we only refresh the configuration
This commit is contained in:
Andras Bacsai
2023-04-26 14:29:33 +02:00
parent 9f32730714
commit 2c68eed072
13 changed files with 138 additions and 109 deletions

View File

@@ -36,6 +36,43 @@ class Application extends BaseModel
'publish_directory',
];
public function publishDirectory(): Attribute
{
return Attribute::make(
set: fn ($value) => $value ? '/' . ltrim($value, '/') : null,
);
}
public function baseDirectory(): Attribute
{
return Attribute::make(
set: fn ($value) => '/' . ltrim($value, '/'),
);
}
public function portsMappings(): Attribute
{
return Attribute::make(
set: fn ($value) => $value === "" ? null : $value,
);
}
public function portsMappingsArray(): Attribute
{
return Attribute::make(
get: fn () =>
is_null($this->ports_mappings)
? []
: explode(',', $this->ports_mappings),
);
}
public function portsExposesArray(): Attribute
{
return Attribute::make(
get: fn () =>
is_null($this->ports_exposes)
? []
: explode(',', $this->ports_exposes)
);
}
public function environment()
{
return $this->belongsTo(Environment::class);
@@ -57,38 +94,7 @@ class Application extends BaseModel
return $this->morphMany(LocalPersistentVolume::class, 'resource');
}
public function publishDirectory(): Attribute
{
return Attribute::make(
set: fn ($value) => $value ? '/' . ltrim($value, '/') : null,
);
}
public function baseDirectory(): Attribute
{
return Attribute::make(
set: fn ($value) => '/' . ltrim($value, '/'),
);
}
public function portsMappingsArray(): Attribute
{
return Attribute::make(
get: fn () =>
is_null($this->ports_mappings)
? []
: explode(',', $this->ports_mappings)
);
}
public function portsExposesArray(): Attribute
{
return Attribute::make(
get: fn () =>
is_null($this->ports_exposes)
? []
: explode(',', $this->ports_exposes)
);
}
public function deployments()
{
return Activity::where('subject_id', $this->id)->where('properties->deployment_uuid', '!=', null)->orderBy('created_at', 'desc')->get();