fix: show defined resources in server tab, so you will know what you need to delete before you can delete the server.
This commit is contained in:
@@ -137,7 +137,7 @@ class ProjectController extends Controller
|
||||
}
|
||||
$service->parse(isNew: true);
|
||||
|
||||
return redirect()->route('project.service', [
|
||||
return redirect()->route('project.service.configuration', [
|
||||
'service_uuid' => $service->uuid,
|
||||
'environment_name' => $environment->name,
|
||||
'project_uuid' => $project->uuid,
|
||||
|
||||
@@ -129,7 +129,7 @@ class DockerCompose extends Component
|
||||
|
||||
$service->parse(isNew: true);
|
||||
|
||||
return redirect()->route('project.service', [
|
||||
return redirect()->route('project.service.configuration', [
|
||||
'service_uuid' => $service->uuid,
|
||||
'environment_name' => $environment->name,
|
||||
'project_uuid' => $project->uuid,
|
||||
|
||||
@@ -41,7 +41,7 @@ class Application extends Component
|
||||
try {
|
||||
$this->application->delete();
|
||||
$this->emit('success', 'Application deleted successfully.');
|
||||
return redirect()->route('project.service', $this->parameters);
|
||||
return redirect()->route('project.service.configuration', $this->parameters);
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,14 @@ class Application extends BaseModel
|
||||
$application->environment_variables_preview()->delete();
|
||||
});
|
||||
}
|
||||
|
||||
public function link()
|
||||
{
|
||||
return route('project.application.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'application_uuid' => $this->uuid
|
||||
]);
|
||||
}
|
||||
public function settings()
|
||||
{
|
||||
return $this->hasOne(ApplicationSetting::class);
|
||||
|
||||
@@ -194,6 +194,12 @@ class Server extends BaseModel
|
||||
{
|
||||
return instant_remote_process(["df /| tail -1 | awk '{ print $5}' | sed 's/%//g'"], $this, false);
|
||||
}
|
||||
public function definedResources() {
|
||||
$applications = $this->applications();
|
||||
$databases = $this->databases();
|
||||
$services = $this->services();
|
||||
return $applications->concat($databases)->concat($services->get());
|
||||
}
|
||||
public function hasDefinedResources()
|
||||
{
|
||||
$applications = $this->applications()->count() > 0;
|
||||
|
||||
@@ -361,6 +361,14 @@ class Service extends BaseModel
|
||||
}
|
||||
}
|
||||
}
|
||||
public function link()
|
||||
{
|
||||
return route('project.service.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'service_uuid' => $this->uuid
|
||||
]);
|
||||
}
|
||||
public function documentation()
|
||||
{
|
||||
$services = getServiceTemplates();
|
||||
|
||||
@@ -41,6 +41,14 @@ class StandaloneMariadb extends BaseModel
|
||||
$database->environment_variables()->delete();
|
||||
});
|
||||
}
|
||||
public function link()
|
||||
{
|
||||
return route('project.database.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'database_uuid' => $this->uuid
|
||||
]);
|
||||
}
|
||||
public function isLogDrainEnabled()
|
||||
{
|
||||
return data_get($this, 'is_log_drain_enabled', false);
|
||||
|
||||
@@ -48,6 +48,14 @@ class StandaloneMongodb extends BaseModel
|
||||
{
|
||||
return data_get($this, 'is_log_drain_enabled', false);
|
||||
}
|
||||
public function link()
|
||||
{
|
||||
return route('project.database.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'database_uuid' => $this->uuid
|
||||
]);
|
||||
}
|
||||
public function mongoInitdbRootPassword(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
|
||||
@@ -41,6 +41,14 @@ class StandaloneMysql extends BaseModel
|
||||
$database->environment_variables()->delete();
|
||||
});
|
||||
}
|
||||
public function link()
|
||||
{
|
||||
return route('project.database.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'database_uuid' => $this->uuid
|
||||
]);
|
||||
}
|
||||
public function type(): string
|
||||
{
|
||||
return 'standalone-mysql';
|
||||
|
||||
@@ -41,7 +41,14 @@ class StandalonePostgresql extends BaseModel
|
||||
$database->environment_variables()->delete();
|
||||
});
|
||||
}
|
||||
|
||||
public function link()
|
||||
{
|
||||
return route('project.database.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'database_uuid' => $this->uuid
|
||||
]);
|
||||
}
|
||||
public function isLogDrainEnabled()
|
||||
{
|
||||
return data_get($this, 'is_log_drain_enabled', false);
|
||||
|
||||
@@ -36,7 +36,14 @@ class StandaloneRedis extends BaseModel
|
||||
$database->environment_variables()->delete();
|
||||
});
|
||||
}
|
||||
|
||||
public function link()
|
||||
{
|
||||
return route('project.database.configuration', [
|
||||
'project_uuid' => $this->environment->project->uuid,
|
||||
'environment_name' => $this->environment->name,
|
||||
'database_uuid' => $this->uuid
|
||||
]);
|
||||
}
|
||||
public function isLogDrainEnabled()
|
||||
{
|
||||
return data_get($this, 'is_log_drain_enabled', false);
|
||||
|
||||
Reference in New Issue
Block a user