fix: server view for link()
This commit is contained in:
@@ -50,12 +50,15 @@ class Application extends BaseModel
|
||||
}
|
||||
public function link()
|
||||
{
|
||||
if (data_get($this, 'environment.project.uuid')) {
|
||||
return route('project.application.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'application_uuid' => $this->uuid
|
||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||
'environment_name' => data_get($this, 'environment.name'),
|
||||
'application_uuid' => data_get($this, 'uuid')
|
||||
]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public function settings()
|
||||
{
|
||||
return $this->hasOne(ApplicationSetting::class);
|
||||
|
||||
@@ -363,12 +363,15 @@ class Service extends BaseModel
|
||||
}
|
||||
public function link()
|
||||
{
|
||||
if (data_get($this, 'environment.project.uuid')) {
|
||||
return route('project.service.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'service_uuid' => $this->uuid
|
||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||
'environment_name' => data_get($this, 'environment.name'),
|
||||
'service_uuid' => data_get($this, 'uuid')
|
||||
]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public function documentation()
|
||||
{
|
||||
$services = getServiceTemplates();
|
||||
|
||||
@@ -43,12 +43,15 @@ class StandaloneMariadb extends BaseModel
|
||||
}
|
||||
public function link()
|
||||
{
|
||||
if (data_get($this, 'environment.project.uuid')) {
|
||||
return route('project.database.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'database_uuid' => $this->uuid
|
||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||
'environment_name' => data_get($this, 'environment.name'),
|
||||
'database_uuid' => data_get($this, 'uuid')
|
||||
]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public function isLogDrainEnabled()
|
||||
{
|
||||
return data_get($this, 'is_log_drain_enabled', false);
|
||||
|
||||
@@ -50,12 +50,15 @@ class StandaloneMongodb extends BaseModel
|
||||
}
|
||||
public function link()
|
||||
{
|
||||
if (data_get($this, 'environment.project.uuid')) {
|
||||
return route('project.database.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'database_uuid' => $this->uuid
|
||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||
'environment_name' => data_get($this, 'environment.name'),
|
||||
'database_uuid' => data_get($this, 'uuid')
|
||||
]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public function mongoInitdbRootPassword(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
|
||||
@@ -43,12 +43,15 @@ class StandaloneMysql extends BaseModel
|
||||
}
|
||||
public function link()
|
||||
{
|
||||
if (data_get($this, 'environment.project.uuid')) {
|
||||
return route('project.database.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'database_uuid' => $this->uuid
|
||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||
'environment_name' => data_get($this, 'environment.name'),
|
||||
'database_uuid' => data_get($this, 'uuid')
|
||||
]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public function type(): string
|
||||
{
|
||||
return 'standalone-mysql';
|
||||
|
||||
@@ -43,12 +43,15 @@ class StandalonePostgresql extends BaseModel
|
||||
}
|
||||
public function link()
|
||||
{
|
||||
if (data_get($this, 'environment.project.uuid')) {
|
||||
return route('project.database.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'database_uuid' => $this->uuid
|
||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||
'environment_name' => data_get($this, 'environment.name'),
|
||||
'database_uuid' => data_get($this, 'uuid')
|
||||
]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public function isLogDrainEnabled()
|
||||
{
|
||||
return data_get($this, 'is_log_drain_enabled', false);
|
||||
|
||||
@@ -38,12 +38,15 @@ class StandaloneRedis extends BaseModel
|
||||
}
|
||||
public function link()
|
||||
{
|
||||
if (data_get($this, 'environment.project.uuid')) {
|
||||
return route('project.database.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'database_uuid' => $this->uuid
|
||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||
'environment_name' => data_get($this, 'environment.name'),
|
||||
'database_uuid' => data_get($this, 'uuid')
|
||||
]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public function isLogDrainEnabled()
|
||||
{
|
||||
return data_get($this, 'is_log_drain_enabled', false);
|
||||
|
||||
@@ -25,10 +25,17 @@
|
||||
@if ($loop->first)
|
||||
<h3 class="pt-4">Defined resources</h3>
|
||||
@endif
|
||||
@if ($resource->link())
|
||||
<a class="flex gap-2 p-1 hover:bg-coolgray-100 hover:no-underline" href="{{ $resource->link() }}">
|
||||
<div class="w-64">{{ str($resource->type())->headline() }}</div>
|
||||
<div>{{ $resource->name }}</div>
|
||||
</a>
|
||||
@else
|
||||
<div class="flex gap-2 p-1 hover:bg-coolgray-100 hover:no-underline">
|
||||
<div class="w-64">{{ str($resource->type())->headline() }}</div>
|
||||
<div>{{ $resource->name }}</div>
|
||||
</div>
|
||||
@endif
|
||||
@empty
|
||||
@endforelse
|
||||
</div>
|
||||
@@ -38,10 +45,17 @@
|
||||
@if ($loop->first)
|
||||
<h3 class="pt-4">Defined resources</h3>
|
||||
@endif
|
||||
@if ($resource->link())
|
||||
<a class="flex gap-2 p-1 hover:bg-coolgray-100 hover:no-underline" href="{{ $resource->link() }}">
|
||||
<div class="w-64">{{ str($resource->type())->headline() }}</div>
|
||||
<div>{{ $resource->name }}</div>
|
||||
</a>
|
||||
@else
|
||||
<div class="flex gap-2 p-1 hover:bg-coolgray-100 hover:no-underline">
|
||||
<div class="w-64">{{ str($resource->type())->headline() }}</div>
|
||||
<div>{{ $resource->name }}</div>
|
||||
</div>
|
||||
@endif
|
||||
@empty
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user