feat: add environment_uuid support and update API documentation

- Introduced `environment_uuid` as a required field in various API endpoints and schemas.
- Updated descriptions to clarify that either `environment_name` or `environment_uuid` must be provided.
- Modified routes and controller methods to accommodate the new UUID parameter.
- Adjusted frontend components to utilize `environment_uuid` for better consistency and clarity.
- Removed deprecated fields related to environment handling.

This change enhances the API's flexibility in identifying environments, improving overall usability.
This commit is contained in:
Andras Bacsai
2024-12-17 13:42:16 +01:00
parent 0ce01238d7
commit 9e3467578f
24 changed files with 421 additions and 525 deletions

View File

@@ -117,11 +117,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['project_uuid', 'server_uuid', 'environment_name', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'git_repository' => ['type' => 'string', 'description' => 'The git repository URL.'],
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
'build_pack' => ['type' => 'string', 'enum' => ['nixpacks', 'static', 'dockerfile', 'dockercompose'], 'description' => 'The build pack type.'],
@@ -223,11 +224,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['project_uuid', 'server_uuid', 'environment_name', 'github_app_uuid', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'github_app_uuid', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'github_app_uuid' => ['type' => 'string', 'description' => 'The Github App UUID.'],
'git_repository' => ['type' => 'string', 'description' => 'The git repository URL.'],
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
@@ -329,11 +331,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['project_uuid', 'server_uuid', 'environment_name', 'private_key_uuid', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'private_key_uuid', 'git_repository', 'git_branch', 'build_pack', 'ports_exposes'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'private_key_uuid' => ['type' => 'string', 'description' => 'The private key UUID.'],
'git_repository' => ['type' => 'string', 'description' => 'The git repository URL.'],
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
@@ -435,11 +438,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['project_uuid', 'server_uuid', 'environment_name', 'dockerfile'],
required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'dockerfile'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'dockerfile' => ['type' => 'string', 'description' => 'The Dockerfile content.'],
'build_pack' => ['type' => 'string', 'enum' => ['nixpacks', 'static', 'dockerfile', 'dockercompose'], 'description' => 'The build pack type.'],
'ports_exposes' => ['type' => 'string', 'description' => 'The ports to expose.'],
@@ -525,11 +529,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['project_uuid', 'server_uuid', 'environment_name', 'docker_registry_image_name', 'ports_exposes'],
required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'docker_registry_image_name', 'ports_exposes'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'docker_registry_image_name' => ['type' => 'string', 'description' => 'The docker registry image name.'],
'docker_registry_image_tag' => ['type' => 'string', 'description' => 'The docker registry image tag.'],
'ports_exposes' => ['type' => 'string', 'description' => 'The ports to expose.'],
@@ -612,11 +617,12 @@ class ApplicationsController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['project_uuid', 'server_uuid', 'environment_name', 'docker_compose_raw'],
required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'docker_compose_raw'],
properties: [
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
'server_uuid' => ['type' => 'string', 'description' => 'The server UUID.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name.'],
'environment_name' => ['type' => 'string', 'description' => 'The environment name. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'docker_compose_raw' => ['type' => 'string', 'description' => 'The Docker Compose raw content.'],
'destination_uuid' => ['type' => 'string', 'description' => 'The destination UUID if the server has more than one destinations.'],
'name' => ['type' => 'string', 'description' => 'The application name.'],
@@ -650,7 +656,7 @@ class ApplicationsController extends Controller
private function create_application(Request $request, $type)
{
$allowedFields = ['project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'type', 'name', 'description', 'is_static', 'domains', 'git_repository', 'git_branch', 'git_commit_sha', 'private_key_uuid', 'docker_registry_image_name', 'docker_registry_image_tag', 'build_pack', 'install_command', 'build_command', 'start_command', 'ports_exposes', 'ports_mappings', 'base_directory', 'publish_directory', 'health_check_enabled', 'health_check_path', 'health_check_port', 'health_check_host', 'health_check_method', 'health_check_return_code', 'health_check_scheme', 'health_check_response_text', 'health_check_interval', 'health_check_timeout', 'health_check_retries', 'health_check_start_period', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'custom_labels', 'custom_docker_run_options', 'post_deployment_command', 'post_deployment_command_container', 'pre_deployment_command', 'pre_deployment_command_container', 'manual_webhook_secret_github', 'manual_webhook_secret_gitlab', 'manual_webhook_secret_bitbucket', 'manual_webhook_secret_gitea', 'redirect', 'github_app_uuid', 'instant_deploy', 'dockerfile', 'docker_compose_location', 'docker_compose_raw', 'docker_compose_custom_start_command', 'docker_compose_custom_build_command', 'docker_compose_domains', 'watch_paths', 'use_build_server', 'static_image', 'custom_nginx_configuration'];
$allowedFields = ['project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'type', 'name', 'description', 'is_static', 'domains', 'git_repository', 'git_branch', 'git_commit_sha', 'private_key_uuid', 'docker_registry_image_name', 'docker_registry_image_tag', 'build_pack', 'install_command', 'build_command', 'start_command', 'ports_exposes', 'ports_mappings', 'base_directory', 'publish_directory', 'health_check_enabled', 'health_check_path', 'health_check_port', 'health_check_host', 'health_check_method', 'health_check_return_code', 'health_check_scheme', 'health_check_response_text', 'health_check_interval', 'health_check_timeout', 'health_check_retries', 'health_check_start_period', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'custom_labels', 'custom_docker_run_options', 'post_deployment_command', 'post_deployment_command_container', 'pre_deployment_command', 'pre_deployment_command_container', 'manual_webhook_secret_github', 'manual_webhook_secret_gitlab', 'manual_webhook_secret_bitbucket', 'manual_webhook_secret_gitea', 'redirect', 'github_app_uuid', 'instant_deploy', 'dockerfile', 'docker_compose_location', 'docker_compose_raw', 'docker_compose_custom_start_command', 'docker_compose_custom_build_command', 'docker_compose_domains', 'watch_paths', 'use_build_server', 'static_image', 'custom_nginx_configuration'];
$teamId = getTeamIdFromToken();
if (is_null($teamId)) {
return invalidTokenResponse();
@@ -664,7 +670,8 @@ class ApplicationsController extends Controller
'name' => 'string|max:255',
'description' => 'string|nullable',
'project_uuid' => 'string|required',
'environment_name' => 'string|required',
'environment_name' => 'string|nullable',
'environment_uuid' => 'string|nullable',
'server_uuid' => 'string|required',
'destination_uuid' => 'string',
]);
@@ -684,6 +691,11 @@ class ApplicationsController extends Controller
], 422);
}
$environmentUuid = $request->environment_uuid;
$environmentName = $request->environment_name;
if (blank($environmentUuid) && blank($environmentName)) {
return response()->json(['message' => 'You need to provide at least one of environment_name or environment_uuid.'], 422);
}
$serverUuid = $request->server_uuid;
$fqdn = $request->domains;
$instantDeploy = $request->instant_deploy;
@@ -716,7 +728,10 @@ class ApplicationsController extends Controller
if (! $project) {
return response()->json(['message' => 'Project not found.'], 404);
}
$environment = $project->environments()->where('name', $request->environment_name)->first();
$environment = $project->environments()->where('name', $environmentName)->first();
if (! $environment) {
$environment = $project->environments()->where('uuid', $environmentUuid)->first();
}
if (! $environment) {
return response()->json(['message' => 'Environment not found.'], 404);
}
@@ -733,12 +748,6 @@ class ApplicationsController extends Controller
}
$destination = $destinations->first();
if ($type === 'public') {
if (! $request->has('name')) {
$request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
}
if ($request->build_pack === 'dockercompose') {
$request->offsetSet('ports_exposes', '80');
}
$validationRules = [
'git_repository' => 'string|required',
'git_branch' => 'string|required',
@@ -748,7 +757,7 @@ class ApplicationsController extends Controller
'docker_compose_raw' => 'string|nullable',
'docker_compose_domains' => 'array|nullable',
];
$validationRules = array_merge($validationRules, sharedDataApplications());
$validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
return response()->json([
@@ -756,6 +765,12 @@ class ApplicationsController extends Controller
'errors' => $validator->errors(),
], 422);
}
if (! $request->has('name')) {
$request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
}
if ($request->build_pack === 'dockercompose') {
$request->offsetSet('ports_exposes', '80');
}
$return = $this->validateDataApplications($request, $server);
if ($return instanceof \Illuminate\Http\JsonResponse) {
@@ -820,12 +835,6 @@ class ApplicationsController extends Controller
'domains' => data_get($application, 'domains'),
]));
} elseif ($type === 'private-gh-app') {
if (! $request->has('name')) {
$request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
}
if ($request->build_pack === 'dockercompose') {
$request->offsetSet('ports_exposes', '80');
}
$validationRules = [
'git_repository' => 'string|required',
'git_branch' => 'string|required',
@@ -836,7 +845,7 @@ class ApplicationsController extends Controller
'docker_compose_location' => 'string',
'docker_compose_raw' => 'string|nullable',
];
$validationRules = array_merge($validationRules, sharedDataApplications());
$validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
@@ -845,6 +854,14 @@ class ApplicationsController extends Controller
'errors' => $validator->errors(),
], 422);
}
if (! $request->has('name')) {
$request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
}
if ($request->build_pack === 'dockercompose') {
$request->offsetSet('ports_exposes', '80');
}
$return = $this->validateDataApplications($request, $server);
if ($return instanceof \Illuminate\Http\JsonResponse) {
return $return;
@@ -919,12 +936,6 @@ class ApplicationsController extends Controller
'domains' => data_get($application, 'domains'),
]));
} elseif ($type === 'private-deploy-key') {
if (! $request->has('name')) {
$request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
}
if ($request->build_pack === 'dockercompose') {
$request->offsetSet('ports_exposes', '80');
}
$validationRules = [
'git_repository' => 'string|required',
@@ -937,7 +948,7 @@ class ApplicationsController extends Controller
'docker_compose_raw' => 'string|nullable',
];
$validationRules = array_merge($validationRules, sharedDataApplications());
$validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
@@ -946,6 +957,13 @@ class ApplicationsController extends Controller
'errors' => $validator->errors(),
], 422);
}
if (! $request->has('name')) {
$request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
}
if ($request->build_pack === 'dockercompose') {
$request->offsetSet('ports_exposes', '80');
}
$return = $this->validateDataApplications($request, $server);
if ($return instanceof \Illuminate\Http\JsonResponse) {
return $return;
@@ -1015,14 +1033,10 @@ class ApplicationsController extends Controller
'domains' => data_get($application, 'domains'),
]));
} elseif ($type === 'dockerfile') {
if (! $request->has('name')) {
$request->offsetSet('name', 'dockerfile-'.new Cuid2);
}
$validationRules = [
'dockerfile' => 'string|required',
];
$validationRules = array_merge($validationRules, sharedDataApplications());
$validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
@@ -1031,6 +1045,10 @@ class ApplicationsController extends Controller
'errors' => $validator->errors(),
], 422);
}
if (! $request->has('name')) {
$request->offsetSet('name', 'dockerfile-'.new Cuid2);
}
$return = $this->validateDataApplications($request, $server);
if ($return instanceof \Illuminate\Http\JsonResponse) {
return $return;
@@ -1100,15 +1118,12 @@ class ApplicationsController extends Controller
'domains' => data_get($application, 'domains'),
]));
} elseif ($type === 'dockerimage') {
if (! $request->has('name')) {
$request->offsetSet('name', 'docker-image-'.new Cuid2);
}
$validationRules = [
'docker_registry_image_name' => 'string|required',
'docker_registry_image_tag' => 'string',
'ports_exposes' => 'string|regex:/^(\d+)(,\d+)*$/|required',
];
$validationRules = array_merge($validationRules, sharedDataApplications());
$validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
@@ -1117,6 +1132,9 @@ class ApplicationsController extends Controller
'errors' => $validator->errors(),
], 422);
}
if (! $request->has('name')) {
$request->offsetSet('name', 'docker-image-'.new Cuid2);
}
$return = $this->validateDataApplications($request, $server);
if ($return instanceof \Illuminate\Http\JsonResponse) {
return $return;
@@ -1164,7 +1182,7 @@ class ApplicationsController extends Controller
'domains' => data_get($application, 'domains'),
]));
} elseif ($type === 'dockercompose') {
$allowedFields = ['project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'type', 'name', 'description', 'instant_deploy', 'docker_compose_raw'];
$allowedFields = ['project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'type', 'name', 'description', 'instant_deploy', 'docker_compose_raw'];
$extraFields = array_diff(array_keys($request->all()), $allowedFields);
if ($validator->fails() || ! empty($extraFields)) {
@@ -1186,7 +1204,7 @@ class ApplicationsController extends Controller
$validationRules = [
'docker_compose_raw' => 'string|required',
];
$validationRules = array_merge($validationRules, sharedDataApplications());
$validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) {
@@ -1554,7 +1572,7 @@ class ApplicationsController extends Controller
'docker_compose_custom_build_command' => 'string|nullable',
'custom_nginx_configuration' => 'string|nullable',
];
$validationRules = array_merge($validationRules, sharedDataApplications());
$validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules);
// Validate ports_exposes

View File

@@ -523,11 +523,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['server_uuid', 'project_uuid', 'environment_name'],
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'postgres_user' => ['type' => 'string', 'description' => 'PostgreSQL user'],
'postgres_password' => ['type' => 'string', 'description' => 'PostgreSQL password'],
'postgres_db' => ['type' => 'string', 'description' => 'PostgreSQL database'],
@@ -589,11 +590,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['server_uuid', 'project_uuid', 'environment_name'],
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'clickhouse_admin_user' => ['type' => 'string', 'description' => 'Clickhouse admin user'],
'clickhouse_admin_password' => ['type' => 'string', 'description' => 'Clickhouse admin password'],
@@ -651,11 +653,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['server_uuid', 'project_uuid', 'environment_name'],
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'dragonfly_password' => ['type' => 'string', 'description' => 'DragonFly password'],
'name' => ['type' => 'string', 'description' => 'Name of the database'],
@@ -712,11 +715,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['server_uuid', 'project_uuid', 'environment_name'],
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'redis_password' => ['type' => 'string', 'description' => 'Redis password'],
'redis_conf' => ['type' => 'string', 'description' => 'Redis conf'],
@@ -774,11 +778,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['server_uuid', 'project_uuid', 'environment_name'],
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'keydb_password' => ['type' => 'string', 'description' => 'KeyDB password'],
'keydb_conf' => ['type' => 'string', 'description' => 'KeyDB conf'],
@@ -836,11 +841,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['server_uuid', 'project_uuid', 'environment_name'],
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'mariadb_conf' => ['type' => 'string', 'description' => 'MariaDB conf'],
'mariadb_root_password' => ['type' => 'string', 'description' => 'MariaDB root password'],
@@ -901,11 +907,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['server_uuid', 'project_uuid', 'environment_name'],
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'mysql_root_password' => ['type' => 'string', 'description' => 'MySQL root password'],
'mysql_password' => ['type' => 'string', 'description' => 'MySQL password'],
@@ -966,11 +973,12 @@ class DatabasesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['server_uuid', 'project_uuid', 'environment_name'],
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
properties: [
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment'],
'environment_name' => ['type' => 'string', 'description' => 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'],
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
'mongo_conf' => ['type' => 'string', 'description' => 'MongoDB conf'],
'mongo_initdb_root_username' => ['type' => 'string', 'description' => 'MongoDB initdb root username'],
@@ -1013,7 +1021,7 @@ class DatabasesController extends Controller
public function create_database(Request $request, NewDatabaseTypes $type)
{
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'postgres_user', 'postgres_password', 'postgres_db', 'postgres_initdb_args', 'postgres_host_auth_method', 'postgres_conf', 'clickhouse_admin_user', 'clickhouse_admin_password', 'dragonfly_password', 'redis_password', 'redis_conf', 'keydb_password', 'keydb_conf', 'mariadb_conf', 'mariadb_root_password', 'mariadb_user', 'mariadb_password', 'mariadb_database', 'mongo_conf', 'mongo_initdb_root_username', 'mongo_initdb_root_password', 'mongo_initdb_database', 'mysql_root_password', 'mysql_password', 'mysql_user', 'mysql_database', 'mysql_conf'];
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'postgres_user', 'postgres_password', 'postgres_db', 'postgres_initdb_args', 'postgres_host_auth_method', 'postgres_conf', 'clickhouse_admin_user', 'clickhouse_admin_password', 'dragonfly_password', 'redis_password', 'redis_conf', 'keydb_password', 'keydb_conf', 'mariadb_conf', 'mariadb_root_password', 'mariadb_user', 'mariadb_password', 'mariadb_database', 'mongo_conf', 'mongo_initdb_root_username', 'mongo_initdb_root_password', 'mongo_initdb_database', 'mysql_root_password', 'mysql_password', 'mysql_user', 'mysql_database', 'mysql_conf'];
$teamId = getTeamIdFromToken();
if (is_null($teamId)) {
@@ -1039,6 +1047,11 @@ class DatabasesController extends Controller
'errors' => $errors,
], 422);
}
$environmentUuid = $request->environment_uuid;
$environmentName = $request->environment_name;
if (blank($environmentUuid) && blank($environmentName)) {
return response()->json(['message' => 'You need to provide at least one of environment_name or environment_uuid.'], 422);
}
$serverUuid = $request->server_uuid;
$instantDeploy = $request->instant_deploy ?? false;
if ($request->is_public && ! $request->public_port) {
@@ -1048,9 +1061,12 @@ class DatabasesController extends Controller
if (! $project) {
return response()->json(['message' => 'Project not found.'], 404);
}
$environment = $project->environments()->where('name', $request->environment_name)->first();
$environment = $project->environments()->where('name', $environmentName)->first();
if (! $environment) {
return response()->json(['message' => 'Environment not found.'], 404);
$environment = $project->environments()->where('uuid', $environmentUuid)->first();
}
if (! $environment) {
return response()->json(['message' => 'You need to provide a valid environment_name or environment_uuid.'], 422);
}
$server = Server::whereTeamId($teamId)->whereUuid($serverUuid)->first();
if (! $server) {
@@ -1074,7 +1090,8 @@ class DatabasesController extends Controller
'description' => 'string|nullable',
'image' => 'string',
'project_uuid' => 'string|required',
'environment_name' => 'string|required',
'environment_name' => 'string|nullable',
'environment_uuid' => 'string|nullable',
'server_uuid' => 'string|required',
'destination_uuid' => 'string',
'is_public' => 'boolean',
@@ -1105,7 +1122,7 @@ class DatabasesController extends Controller
}
}
if ($type === NewDatabaseTypes::POSTGRESQL) {
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'postgres_user', 'postgres_password', 'postgres_db', 'postgres_initdb_args', 'postgres_host_auth_method', 'postgres_conf'];
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'postgres_user', 'postgres_password', 'postgres_db', 'postgres_initdb_args', 'postgres_host_auth_method', 'postgres_conf'];
$validator = customApiValidator($request->all(), [
'postgres_user' => 'string',
'postgres_password' => 'string',
@@ -1164,7 +1181,7 @@ class DatabasesController extends Controller
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::MARIADB) {
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'mariadb_conf', 'mariadb_root_password', 'mariadb_user', 'mariadb_password', 'mariadb_database'];
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'mariadb_conf', 'mariadb_root_password', 'mariadb_user', 'mariadb_password', 'mariadb_database'];
$validator = customApiValidator($request->all(), [
'clickhouse_admin_user' => 'string',
'clickhouse_admin_password' => 'string',
@@ -1220,7 +1237,7 @@ class DatabasesController extends Controller
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::MYSQL) {
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'mysql_root_password', 'mysql_password', 'mysql_user', 'mysql_database', 'mysql_conf'];
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'mysql_root_password', 'mysql_password', 'mysql_user', 'mysql_database', 'mysql_conf'];
$validator = customApiValidator($request->all(), [
'mysql_root_password' => 'string',
'mysql_password' => 'string',
@@ -1279,7 +1296,7 @@ class DatabasesController extends Controller
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::REDIS) {
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'redis_password', 'redis_conf'];
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'redis_password', 'redis_conf'];
$validator = customApiValidator($request->all(), [
'redis_password' => 'string',
'redis_conf' => 'string',
@@ -1335,7 +1352,7 @@ class DatabasesController extends Controller
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::DRAGONFLY) {
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'dragonfly_password'];
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'dragonfly_password'];
$validator = customApiValidator($request->all(), [
'dragonfly_password' => 'string',
]);
@@ -1365,7 +1382,7 @@ class DatabasesController extends Controller
'uuid' => $database->uuid,
]))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::KEYDB) {
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'keydb_password', 'keydb_conf'];
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'keydb_password', 'keydb_conf'];
$validator = customApiValidator($request->all(), [
'keydb_password' => 'string',
'keydb_conf' => 'string',
@@ -1421,7 +1438,7 @@ class DatabasesController extends Controller
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::CLICKHOUSE) {
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'clickhouse_admin_user', 'clickhouse_admin_password'];
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'clickhouse_admin_user', 'clickhouse_admin_password'];
$validator = customApiValidator($request->all(), [
'clickhouse_admin_user' => 'string',
'clickhouse_admin_password' => 'string',
@@ -1457,7 +1474,7 @@ class DatabasesController extends Controller
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
} elseif ($type === NewDatabaseTypes::MONGODB) {
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'mongo_conf', 'mongo_initdb_root_username', 'mongo_initdb_root_password', 'mongo_initdb_database'];
$allowedFields = ['name', 'description', 'image', 'public_port', 'is_public', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'mongo_conf', 'mongo_initdb_root_username', 'mongo_initdb_root_password', 'mongo_initdb_database'];
$validator = customApiValidator($request->all(), [
'mongo_conf' => 'string',
'mongo_initdb_root_username' => 'string',

View File

@@ -102,16 +102,16 @@ class ProjectController extends Controller
#[OA\Get(
summary: 'Environment',
description: 'Get environment by name.',
path: '/projects/{uuid}/{environment_name}',
operationId: 'get-environment-by-name',
description: 'Get environment by name or UUID.',
path: '/projects/{uuid}/{environment_name_or_uuid}',
operationId: 'get-environment-by-name-or-uuid',
security: [
['bearerAuth' => []],
],
tags: ['Projects'],
parameters: [
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),
new OA\Parameter(name: 'environment_name', in: 'path', required: true, description: 'Environment name', schema: new OA\Schema(type: 'string')),
new OA\Parameter(name: 'environment_name_or_uuid', in: 'path', required: true, description: 'Environment name or UUID', schema: new OA\Schema(type: 'string')),
],
responses: [
new OA\Response(
@@ -141,14 +141,17 @@ class ProjectController extends Controller
if (! $request->uuid) {
return response()->json(['message' => 'UUID is required.'], 422);
}
if (! $request->environment_name) {
return response()->json(['message' => 'Environment name is required.'], 422);
if (! $request->environment_name_or_uuid) {
return response()->json(['message' => 'Environment name or UUID is required.'], 422);
}
$project = Project::whereTeamId($teamId)->whereUuid($request->uuid)->first();
if (! $project) {
return response()->json(['message' => 'Project not found.'], 404);
}
$environment = $project->environments()->whereName($request->environment_name)->first();
$environment = $project->environments()->whereName($request->environment_name_or_uuid)->first();
if (! $environment) {
$environment = $project->environments()->whereUuid($request->environment_name_or_uuid)->first();
}
if (! $environment) {
return response()->json(['message' => 'Environment not found.'], 404);
}

View File

@@ -102,7 +102,7 @@ class ServicesController extends Controller
mediaType: 'application/json',
schema: new OA\Schema(
type: 'object',
required: ['server_uuid', 'project_uuid', 'environment_name', 'type'],
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid', 'type'],
properties: [
'type' => [
'description' => 'The one-click service type',
@@ -199,7 +199,8 @@ class ServicesController extends Controller
'name' => ['type' => 'string', 'maxLength' => 255, 'description' => 'Name of the service.'],
'description' => ['type' => 'string', 'nullable' => true, 'description' => 'Description of the service.'],
'project_uuid' => ['type' => 'string', 'description' => 'Project UUID.'],
'environment_name' => ['type' => 'string', 'description' => 'Environment name.'],
'environment_name' => ['type' => 'string', 'description' => 'Environment name. You need to provide at least one of environment_name or environment_uuid.'],
'environment_uuid' => ['type' => 'string', 'description' => 'Environment UUID. You need to provide at least one of environment_name or environment_uuid.'],
'server_uuid' => ['type' => 'string', 'description' => 'Server UUID.'],
'destination_uuid' => ['type' => 'string', 'description' => 'Destination UUID. Required if server has multiple destinations.'],
'instant_deploy' => ['type' => 'boolean', 'default' => false, 'description' => 'Start the service immediately after creation.'],
@@ -236,7 +237,7 @@ class ServicesController extends Controller
)]
public function create_service(Request $request)
{
$allowedFields = ['type', 'name', 'description', 'project_uuid', 'environment_name', 'server_uuid', 'destination_uuid', 'instant_deploy'];
$allowedFields = ['type', 'name', 'description', 'project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'instant_deploy'];
$teamId = getTeamIdFromToken();
if (is_null($teamId)) {
@@ -250,7 +251,8 @@ class ServicesController extends Controller
$validator = customApiValidator($request->all(), [
'type' => 'string|required',
'project_uuid' => 'string|required',
'environment_name' => 'string|required',
'environment_name' => 'string|nullable',
'environment_uuid' => 'string|nullable',
'server_uuid' => 'string|required',
'destination_uuid' => 'string',
'name' => 'string|max:255',
@@ -272,6 +274,11 @@ class ServicesController extends Controller
'errors' => $errors,
], 422);
}
$environmentUuid = $request->environment_uuid;
$environmentName = $request->environment_name;
if (blank($environmentUuid) && blank($environmentName)) {
return response()->json(['message' => 'You need to provide at least one of environment_name or environment_uuid.'], 422);
}
$serverUuid = $request->server_uuid;
$instantDeploy = $request->instant_deploy ?? false;
if ($request->is_public && ! $request->public_port) {
@@ -281,7 +288,10 @@ class ServicesController extends Controller
if (! $project) {
return response()->json(['message' => 'Project not found.'], 404);
}
$environment = $project->environments()->where('name', $request->environment_name)->first();
$environment = $project->environments()->where('name', $environmentName)->first();
if (! $environment) {
$environment = $project->environments()->where('uuid', $environmentUuid)->first();
}
if (! $environment) {
return response()->json(['message' => 'Environment not found.'], 404);
}
@@ -349,7 +359,11 @@ class ServicesController extends Controller
}
$domains = $service->applications()->get()->pluck('fqdn')->sort();
$domains = $domains->map(function ($domain) {
if (count(explode(':', $domain)) > 2) {
return str($domain)->beforeLast(':')->value();
}
return $domain;
});
return response()->json([

View File

@@ -1405,7 +1405,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
'project_uuid' => data_get($this->application, 'environment.project.uuid'),
'application_uuid' => data_get($this->application, 'uuid'),
'deployment_uuid' => $deployment_uuid,
'environment_name' => data_get($this->application, 'environment.name'),
'environment_uuid' => data_get($this->application, 'environment.uuid'),
]));
}
}

View File

@@ -21,7 +21,6 @@ class Configuration extends Component
public function mount()
{
$this->currentRoute = request()->route()->getName();
$project = currentTeam()
->projects()
@@ -29,7 +28,7 @@ class Configuration extends Component
->where('uuid', request()->route('project_uuid'))
->firstOrFail();
$environment = $project->environments()
->select('id', 'name', 'project_id')
->select('id', 'uuid', 'name', 'project_id')
->where('uuid', request()->route('environment_uuid'))
->firstOrFail();
$application = $environment->applications()
@@ -40,7 +39,6 @@ class Configuration extends Component
$this->project = $project;
$this->environment = $environment;
$this->application = $application;
}
public function render()

View File

@@ -34,14 +34,6 @@ class Show extends Component
if (! $application) {
return redirect()->route('dashboard');
}
// $activity = Activity::where('properties->type_uuid', '=', $deploymentUuid)->first();
// if (!$activity) {
// return redirect()->route('project.application.deployment.index', [
// 'project_uuid' => $project->uuid,
// 'environment_name' => $environment->name,
// 'application_uuid' => $application->uuid,
// ]);
// }
$application_deployment_queue = ApplicationDeploymentQueue::where('deployment_uuid', $deploymentUuid)->first();
if (! $application_deployment_queue) {
return redirect()->route('project.application.deployment.index', [

View File

@@ -38,7 +38,7 @@ class Heading extends Component
{
$this->parameters = [
'project_uuid' => $this->application->project()->uuid,
'environment_name' => $this->application->environment->name,
'environment_uuid' => $this->application->environment->uuid,
'application_uuid' => $this->application->uuid,
];
$lastDeployment = $this->application->get_last_successful_deployment();

View File

@@ -24,7 +24,7 @@ class Configuration extends Component
->where('uuid', request()->route('project_uuid'))
->firstOrFail();
$environment = $project->environments()
->select('id', 'name', 'project_id')
->select('id', 'name', 'project_id', 'uuid')
->where('uuid', request()->route('environment_uuid'))
->firstOrFail();
$database = $environment->databases()

View File

@@ -4,6 +4,7 @@ namespace App\Livewire\Project\Resource;
use App\Models\Environment;
use App\Models\Project;
use Illuminate\Support\Collection;
use Livewire\Component;
class Index extends Component
@@ -12,39 +13,42 @@ class Index extends Component
public Environment $environment;
public $applications = [];
public Collection $applications;
public $postgresqls = [];
public Collection $postgresqls;
public $redis = [];
public Collection $redis;
public $mongodbs = [];
public Collection $mongodbs;
public $mysqls = [];
public Collection $mysqls;
public $mariadbs = [];
public Collection $mariadbs;
public $keydbs = [];
public Collection $keydbs;
public $dragonflies = [];
public Collection $dragonflies;
public $clickhouses = [];
public Collection $clickhouses;
public $services = [];
public Collection $services;
public array $parameters;
public function mount()
{
$this->applications = $this->postgresqls = $this->redis = $this->mongodbs = $this->mysqls = $this->mariadbs = $this->keydbs = $this->dragonflies = $this->clickhouses = $this->services = collect();
$this->parameters = get_route_parameters();
$project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (! $project) {
return redirect()->route('dashboard');
}
$environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first();
if (! $environment) {
return redirect()->route('dashboard');
}
$project = currentTeam()
->projects()
->select('id', 'uuid', 'team_id', 'name')
->where('uuid', request()->route('project_uuid'))
->firstOrFail();
$environment = $project->environments()
->select('id', 'uuid', 'name', 'project_id')
->where('uuid', request()->route('environment_uuid'))
->firstOrFail();
$this->project = $project;
$this->environment = $environment->loadCount([
'applications',
@@ -89,14 +93,6 @@ class Index extends Component
'clickhouses' => 'clickhouses',
];
// Load all server-related data first to prevent duplicate queries
$serverData = $this->environment->applications()
->with(['destination.server.settings'])
->get()
->pluck('destination.server')
->filter()
->unique('id');
foreach ($databaseTypes as $property => $relation) {
$this->{$property} = $this->environment->{$relation}()->with([
'tags',
@@ -108,6 +104,7 @@ class Index extends Component
'database_uuid' => $db->uuid,
'environment_uuid' => data_get($this->environment, 'uuid'),
]);
return $db;
});
}
@@ -123,6 +120,7 @@ class Index extends Component
'environment_uuid' => data_get($service, 'environment.uuid'),
'service_uuid' => data_get($service, 'uuid'),
]);
return $service;
});
}

View File

@@ -52,8 +52,8 @@ class Configuration extends Component
->where('uuid', request()->route('project_uuid'))
->firstOrFail();
$environment = $project->environments()
->select('id', 'name', 'project_id')
->where('name', request()->route('environment_name'))
->select('id', 'uuid', 'name', 'project_id')
->where('uuid', request()->route('environment_uuid'))
->firstOrFail();
$this->service = $environment->services()->whereUuid(request()->route('service_uuid'))->firstOrFail();

View File

@@ -3,7 +3,6 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use OpenApi\Attributes as OA;
#[OA\Schema(
@@ -18,7 +17,7 @@ use OpenApi\Attributes as OA;
'description' => ['type' => 'string'],
]
)]
class Environment extends Model
class Environment extends BaseModel
{
protected $guarded = [];

View File

@@ -17,6 +17,8 @@ class StatusChanged extends CustomEmailNotification
public string $environment_uuid;
public string $environment_name;
public ?string $resource_url = null;
public ?string $fqdn;
@@ -27,6 +29,7 @@ class StatusChanged extends CustomEmailNotification
$this->resource_name = data_get($resource, 'name');
$this->project_uuid = data_get($resource, 'environment.project.uuid');
$this->environment_uuid = data_get($resource, 'environment.uuid');
$this->environment_name = data_get($resource, 'environment.name');
$this->fqdn = data_get($resource, 'fqdn', null);
if (str($this->fqdn)->explode(',')->count() > 1) {
$this->fqdn = str($this->fqdn)->explode(',')->first();

View File

@@ -166,6 +166,7 @@ function removeUnnecessaryFieldsFromRequest(Request $request)
{
$request->offsetUnset('project_uuid');
$request->offsetUnset('environment_name');
$request->offsetUnset('environment_uuid');
$request->offsetUnset('destination_uuid');
$request->offsetUnset('server_uuid');
$request->offsetUnset('type');

View File

@@ -65,6 +65,7 @@
"project_uuid",
"server_uuid",
"environment_name",
"environment_uuid",
"git_repository",
"git_branch",
"build_pack",
@@ -81,7 +82,11 @@
},
"environment_name": {
"type": "string",
"description": "The environment name."
"description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"git_repository": {
"type": "string",
@@ -377,6 +382,7 @@
"project_uuid",
"server_uuid",
"environment_name",
"environment_uuid",
"github_app_uuid",
"git_repository",
"git_branch",
@@ -394,7 +400,11 @@
},
"environment_name": {
"type": "string",
"description": "The environment name."
"description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"github_app_uuid": {
"type": "string",
@@ -694,6 +704,7 @@
"project_uuid",
"server_uuid",
"environment_name",
"environment_uuid",
"private_key_uuid",
"git_repository",
"git_branch",
@@ -711,7 +722,11 @@
},
"environment_name": {
"type": "string",
"description": "The environment name."
"description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"private_key_uuid": {
"type": "string",
@@ -1011,6 +1026,7 @@
"project_uuid",
"server_uuid",
"environment_name",
"environment_uuid",
"dockerfile"
],
"properties": {
@@ -1024,7 +1040,11 @@
},
"environment_name": {
"type": "string",
"description": "The environment name."
"description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"dockerfile": {
"type": "string",
@@ -1257,6 +1277,7 @@
"project_uuid",
"server_uuid",
"environment_name",
"environment_uuid",
"docker_registry_image_name",
"ports_exposes"
],
@@ -1271,7 +1292,11 @@
},
"environment_name": {
"type": "string",
"description": "The environment name."
"description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"docker_registry_image_name": {
"type": "string",
@@ -1486,6 +1511,7 @@
"project_uuid",
"server_uuid",
"environment_name",
"environment_uuid",
"docker_compose_raw"
],
"properties": {
@@ -1499,7 +1525,11 @@
},
"environment_name": {
"type": "string",
"description": "The environment name."
"description": "The environment name. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "The environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"docker_compose_raw": {
"type": "string",
@@ -3079,7 +3109,8 @@
"required": [
"server_uuid",
"project_uuid",
"environment_name"
"environment_name",
"environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3092,7 +3123,11 @@
},
"environment_name": {
"type": "string",
"description": "Name of the environment"
"description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"postgres_user": {
"type": "string",
@@ -3215,7 +3250,8 @@
"required": [
"server_uuid",
"project_uuid",
"environment_name"
"environment_name",
"environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3228,7 +3264,11 @@
},
"environment_name": {
"type": "string",
"description": "Name of the environment"
"description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3335,7 +3375,8 @@
"required": [
"server_uuid",
"project_uuid",
"environment_name"
"environment_name",
"environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3348,7 +3389,11 @@
},
"environment_name": {
"type": "string",
"description": "Name of the environment"
"description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3451,7 +3496,8 @@
"required": [
"server_uuid",
"project_uuid",
"environment_name"
"environment_name",
"environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3464,7 +3510,11 @@
},
"environment_name": {
"type": "string",
"description": "Name of the environment"
"description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3571,7 +3621,8 @@
"required": [
"server_uuid",
"project_uuid",
"environment_name"
"environment_name",
"environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3584,7 +3635,11 @@
},
"environment_name": {
"type": "string",
"description": "Name of the environment"
"description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3691,7 +3746,8 @@
"required": [
"server_uuid",
"project_uuid",
"environment_name"
"environment_name",
"environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3704,7 +3760,11 @@
},
"environment_name": {
"type": "string",
"description": "Name of the environment"
"description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3823,7 +3883,8 @@
"required": [
"server_uuid",
"project_uuid",
"environment_name"
"environment_name",
"environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3836,7 +3897,11 @@
},
"environment_name": {
"type": "string",
"description": "Name of the environment"
"description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -3955,7 +4020,8 @@
"required": [
"server_uuid",
"project_uuid",
"environment_name"
"environment_name",
"environment_uuid"
],
"properties": {
"server_uuid": {
@@ -3968,7 +4034,11 @@
},
"environment_name": {
"type": "string",
"description": "Name of the environment"
"description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."
},
"destination_uuid": {
"type": "string",
@@ -4808,14 +4878,14 @@
]
}
},
"\/projects\/{uuid}\/{environment_name}": {
"\/projects\/{uuid}\/{environment_name_or_uuid}": {
"get": {
"tags": [
"Projects"
],
"summary": "Environment",
"description": "Get environment by name.",
"operationId": "get-environment-by-name",
"description": "Get environment by name or UUID.",
"operationId": "get-environment-by-name-or-uuid",
"parameters": [
{
"name": "uuid",
@@ -4827,9 +4897,9 @@
}
},
{
"name": "environment_name",
"name": "environment_name_or_uuid",
"in": "path",
"description": "Environment name",
"description": "Environment name or UUID",
"required": true,
"schema": {
"type": "string"
@@ -5724,6 +5794,7 @@
"server_uuid",
"project_uuid",
"environment_name",
"environment_uuid",
"type"
],
"properties": {
@@ -5835,7 +5906,11 @@
},
"environment_name": {
"type": "string",
"description": "Environment name."
"description": "Environment name. You need to provide at least one of environment_name or environment_uuid."
},
"environment_uuid": {
"type": "string",
"description": "Environment UUID. You need to provide at least one of environment_name or environment_uuid."
},
"server_uuid": {
"type": "string",
@@ -7282,13 +7357,10 @@
"uuid": {
"type": "string"
},
"application_id": {
"type": "integer"
"resourceable_type": {
"type": "string"
},
"service_id": {
"type": "integer"
},
"database_id": {
"resourceable_id": {
"type": "integer"
},
"is_build_time": {
@@ -7684,174 +7756,14 @@
"type": "string",
"description": "The date and time the team was last updated."
},
"smtp_enabled": {
"type": "boolean",
"description": "Whether SMTP is enabled or not."
},
"smtp_from_address": {
"type": "string",
"description": "The email address to send emails from."
},
"smtp_from_name": {
"type": "string",
"description": "The name to send emails from."
},
"smtp_recipients": {
"type": "string",
"description": "The email addresses to send emails to."
},
"smtp_host": {
"type": "string",
"description": "The SMTP host."
},
"smtp_port": {
"type": "string",
"description": "The SMTP port."
},
"smtp_encryption": {
"type": "string",
"description": "The SMTP encryption."
},
"smtp_username": {
"type": "string",
"description": "The SMTP username."
},
"smtp_password": {
"type": "string",
"description": "The SMTP password."
},
"smtp_timeout": {
"type": "string",
"description": "The SMTP timeout."
},
"smtp_notifications_test": {
"type": "boolean",
"description": "Whether to send test notifications via SMTP."
},
"smtp_notifications_deployments": {
"type": "boolean",
"description": "Whether to send deployment notifications via SMTP."
},
"smtp_notifications_status_changes": {
"type": "boolean",
"description": "Whether to send status change notifications via SMTP."
},
"smtp_notifications_scheduled_tasks": {
"type": "boolean",
"description": "Whether to send scheduled task notifications via SMTP."
},
"smtp_notifications_database_backups": {
"type": "boolean",
"description": "Whether to send database backup notifications via SMTP."
},
"smtp_notifications_server_disk_usage": {
"type": "boolean",
"description": "Whether to send server disk usage notifications via SMTP."
},
"discord_enabled": {
"type": "boolean",
"description": "Whether Discord is enabled or not."
},
"discord_webhook_url": {
"type": "string",
"description": "The Discord webhook URL."
},
"discord_notifications_test": {
"type": "boolean",
"description": "Whether to send test notifications via Discord."
},
"discord_notifications_deployments": {
"type": "boolean",
"description": "Whether to send deployment notifications via Discord."
},
"discord_notifications_status_changes": {
"type": "boolean",
"description": "Whether to send status change notifications via Discord."
},
"discord_notifications_database_backups": {
"type": "boolean",
"description": "Whether to send database backup notifications via Discord."
},
"discord_notifications_scheduled_tasks": {
"type": "boolean",
"description": "Whether to send scheduled task notifications via Discord."
},
"discord_notifications_server_disk_usage": {
"type": "boolean",
"description": "Whether to send server disk usage notifications via Discord."
},
"show_boarding": {
"type": "boolean",
"description": "Whether to show the boarding screen or not."
},
"resend_enabled": {
"type": "boolean",
"description": "Whether to enable resending or not."
},
"resend_api_key": {
"type": "string",
"description": "The resending API key."
},
"use_instance_email_settings": {
"type": "boolean",
"description": "Whether to use instance email settings or not."
},
"telegram_enabled": {
"type": "boolean",
"description": "Whether Telegram is enabled or not."
},
"telegram_token": {
"type": "string",
"description": "The Telegram token."
},
"telegram_chat_id": {
"type": "string",
"description": "The Telegram chat ID."
},
"telegram_notifications_test": {
"type": "boolean",
"description": "Whether to send test notifications via Telegram."
},
"telegram_notifications_deployments": {
"type": "boolean",
"description": "Whether to send deployment notifications via Telegram."
},
"telegram_notifications_status_changes": {
"type": "boolean",
"description": "Whether to send status change notifications via Telegram."
},
"telegram_notifications_database_backups": {
"type": "boolean",
"description": "Whether to send database backup notifications via Telegram."
},
"telegram_notifications_test_message_thread_id": {
"type": "string",
"description": "The Telegram test message thread ID."
},
"telegram_notifications_deployments_message_thread_id": {
"type": "string",
"description": "The Telegram deployment message thread ID."
},
"telegram_notifications_status_changes_message_thread_id": {
"type": "string",
"description": "The Telegram status change message thread ID."
},
"telegram_notifications_database_backups_message_thread_id": {
"type": "string",
"description": "The Telegram database backup message thread ID."
},
"custom_server_limit": {
"type": "string",
"description": "The custom server limit."
},
"telegram_notifications_scheduled_tasks": {
"type": "boolean",
"description": "Whether to send scheduled task notifications via Telegram."
},
"telegram_notifications_scheduled_tasks_thread_id": {
"type": "string",
"description": "The Telegram scheduled task message thread ID."
},
"members": {
"description": "The members of the team.",
"type": "array",

View File

@@ -47,6 +47,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- git_repository
- git_branch
- build_pack
@@ -60,7 +61,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
git_repository:
type: string
description: 'The git repository URL.'
@@ -272,6 +276,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- github_app_uuid
- git_repository
- git_branch
@@ -286,7 +291,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
github_app_uuid:
type: string
description: 'The Github App UUID.'
@@ -501,6 +509,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- private_key_uuid
- git_repository
- git_branch
@@ -515,7 +524,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
private_key_uuid:
type: string
description: 'The private key UUID.'
@@ -730,6 +742,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- dockerfile
properties:
project_uuid:
@@ -740,7 +753,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
dockerfile:
type: string
description: 'The Dockerfile content.'
@@ -906,6 +922,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- docker_registry_image_name
- ports_exposes
properties:
@@ -917,7 +934,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
docker_registry_image_name:
type: string
description: 'The docker registry image name.'
@@ -1073,6 +1093,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- docker_compose_raw
properties:
project_uuid:
@@ -1083,7 +1104,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
docker_compose_raw:
type: string
description: 'The Docker Compose raw content.'
@@ -2137,6 +2161,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2146,7 +2171,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
postgres_user:
type: string
description: 'PostgreSQL user'
@@ -2235,6 +2263,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2244,7 +2273,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2321,6 +2353,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2330,7 +2363,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2404,6 +2440,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2413,7 +2450,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2490,6 +2530,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2499,7 +2540,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2576,6 +2620,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2585,7 +2630,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2671,6 +2719,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2680,7 +2729,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2766,6 +2818,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2775,7 +2828,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -3293,13 +3349,13 @@ paths:
security:
-
bearerAuth: []
'/projects/{uuid}/{environment_name}':
'/projects/{uuid}/{environment_name_or_uuid}':
get:
tags:
- Projects
summary: Environment
description: 'Get environment by name.'
operationId: get-environment-by-name
description: 'Get environment by name or UUID.'
operationId: get-environment-by-name-or-uuid
parameters:
-
name: uuid
@@ -3309,9 +3365,9 @@ paths:
schema:
type: string
-
name: environment_name
name: environment_name_or_uuid
in: path
description: 'Environment name'
description: 'Environment name or UUID'
required: true
schema:
type: string
@@ -3872,6 +3928,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
- type
properties:
type:
@@ -3891,7 +3948,10 @@ paths:
description: 'Project UUID.'
environment_name:
type: string
description: 'Environment name.'
description: 'Environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'Environment UUID. You need to provide at least one of environment_name or environment_uuid.'
server_uuid:
type: string
description: 'Server UUID.'
@@ -4856,11 +4916,9 @@ components:
type: integer
uuid:
type: string
application_id:
type: integer
service_id:
type: integer
database_id:
resourceable_type:
type: string
resourceable_id:
type: integer
is_build_time:
type: boolean
@@ -5139,132 +5197,12 @@ components:
updated_at:
type: string
description: 'The date and time the team was last updated.'
smtp_enabled:
type: boolean
description: 'Whether SMTP is enabled or not.'
smtp_from_address:
type: string
description: 'The email address to send emails from.'
smtp_from_name:
type: string
description: 'The name to send emails from.'
smtp_recipients:
type: string
description: 'The email addresses to send emails to.'
smtp_host:
type: string
description: 'The SMTP host.'
smtp_port:
type: string
description: 'The SMTP port.'
smtp_encryption:
type: string
description: 'The SMTP encryption.'
smtp_username:
type: string
description: 'The SMTP username.'
smtp_password:
type: string
description: 'The SMTP password.'
smtp_timeout:
type: string
description: 'The SMTP timeout.'
smtp_notifications_test:
type: boolean
description: 'Whether to send test notifications via SMTP.'
smtp_notifications_deployments:
type: boolean
description: 'Whether to send deployment notifications via SMTP.'
smtp_notifications_status_changes:
type: boolean
description: 'Whether to send status change notifications via SMTP.'
smtp_notifications_scheduled_tasks:
type: boolean
description: 'Whether to send scheduled task notifications via SMTP.'
smtp_notifications_database_backups:
type: boolean
description: 'Whether to send database backup notifications via SMTP.'
smtp_notifications_server_disk_usage:
type: boolean
description: 'Whether to send server disk usage notifications via SMTP.'
discord_enabled:
type: boolean
description: 'Whether Discord is enabled or not.'
discord_webhook_url:
type: string
description: 'The Discord webhook URL.'
discord_notifications_test:
type: boolean
description: 'Whether to send test notifications via Discord.'
discord_notifications_deployments:
type: boolean
description: 'Whether to send deployment notifications via Discord.'
discord_notifications_status_changes:
type: boolean
description: 'Whether to send status change notifications via Discord.'
discord_notifications_database_backups:
type: boolean
description: 'Whether to send database backup notifications via Discord.'
discord_notifications_scheduled_tasks:
type: boolean
description: 'Whether to send scheduled task notifications via Discord.'
discord_notifications_server_disk_usage:
type: boolean
description: 'Whether to send server disk usage notifications via Discord.'
show_boarding:
type: boolean
description: 'Whether to show the boarding screen or not.'
resend_enabled:
type: boolean
description: 'Whether to enable resending or not.'
resend_api_key:
type: string
description: 'The resending API key.'
use_instance_email_settings:
type: boolean
description: 'Whether to use instance email settings or not.'
telegram_enabled:
type: boolean
description: 'Whether Telegram is enabled or not.'
telegram_token:
type: string
description: 'The Telegram token.'
telegram_chat_id:
type: string
description: 'The Telegram chat ID.'
telegram_notifications_test:
type: boolean
description: 'Whether to send test notifications via Telegram.'
telegram_notifications_deployments:
type: boolean
description: 'Whether to send deployment notifications via Telegram.'
telegram_notifications_status_changes:
type: boolean
description: 'Whether to send status change notifications via Telegram.'
telegram_notifications_database_backups:
type: boolean
description: 'Whether to send database backup notifications via Telegram.'
telegram_notifications_test_message_thread_id:
type: string
description: 'The Telegram test message thread ID.'
telegram_notifications_deployments_message_thread_id:
type: string
description: 'The Telegram deployment message thread ID.'
telegram_notifications_status_changes_message_thread_id:
type: string
description: 'The Telegram status change message thread ID.'
telegram_notifications_database_backups_message_thread_id:
type: string
description: 'The Telegram database backup message thread ID.'
custom_server_limit:
type: string
description: 'The custom server limit.'
telegram_notifications_scheduled_tasks:
type: boolean
description: 'Whether to send scheduled task notifications via Telegram.'
telegram_notifications_scheduled_tasks_thread_id:
type: string
description: 'The Telegram scheduled task message thread ID.'
members:
description: 'The members of the team.'
type: array

View File

@@ -21,7 +21,10 @@
<li>
<div class="flex items-center">
<a class="text-xs truncate lg:text-sm"
href="{{ route('project.resource.index', ['environment_uuid' => $this->parameters['environment_uuid', 'project_uuid' => data_get($resource, 'environment.project.uuid')]) }}">{{ data_get($resource, 'environment.name') }}</a>
href="{{ route('project.resource.index', [
'environment_uuid' => data_get($resource, 'environment.uuid'),
'project_uuid' => data_get($resource, 'environment.project.uuid'),
]) }}">{{ data_get($resource, 'environment.name') }}</a>
<svg aria-hidden="true" class="w-4 h-4 mx-1 font-bold dark:text-warning" fill="currentColor"
viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"

View File

@@ -38,7 +38,7 @@
<a class="hover:underline"
href="{{ route('project.resource.create', [
'project_uuid' => $project->uuid,
'environment_uuid' => $project->environments->first()->uuid
'environment_uuid' => $project->environments->first()->uuid,
]) }}">
<span class="p-2 font-bold">+ Add Resource</span>
</a>

View File

@@ -9,31 +9,31 @@
<div class="flex flex-col h-full gap-8 pt-6 sm:flex-row">
<div class="flex flex-col items-start gap-2 min-w-fit">
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.application.configuration', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.configuration', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>General</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.application.advanced', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.advanced', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Advanced</a>
@if ($application->destination->server->isSwarm())
<a class="menu-item"
wire:current.exact="menu-item-active
href="{{ route('project.application.swarm', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.swarm', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Swarm
Configuration</a>
@endif
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.application.environment-variables', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.environment-variables', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Environment Variables</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.application.persistent-storage', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.persistent-storage', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Persistent Storage</a>
@if ($application->git_based())
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.application.source', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.source', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Git Source</a>
@endif
<a class="menu-item flex items-center gap-2" wire:current.exact="menu-item-active"
href="{{ route('project.application.servers', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.servers', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Servers
@if (str($application->status)->contains('degraded'))
<span title="Some servers are unavailable">
@@ -53,35 +53,35 @@
@endif
</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.application.scheduled-tasks.show', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.scheduled-tasks.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Scheduled Tasks</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.application.webhooks', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.webhooks', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Webhooks</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.application.preview-deployments', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.preview-deployments', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Preview Deployments</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.application.healthcheck', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.healthcheck', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Healthcheck</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.application.rollback', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.rollback', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Rollback</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.application.resource-limits', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.resource-limits', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Resource Limits</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.application.resource-operations', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.resource-operations', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Resource Operations</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.application.metrics', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.metrics', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Metrics</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.application.tags', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.tags', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Tags</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.application.danger', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'application_uuid' => $application->uuid]) }}"
href="{{ route('project.application.danger', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'application_uuid' => $application->uuid]) }}"
wire:navigate>Danger Zone</a>
</div>
<div class="w-full">

View File

@@ -8,38 +8,37 @@
<div class="flex flex-col h-full gap-8 pt-6 sm:flex-row">
<div class="flex flex-col items-start gap-2 min-w-fit">
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.database.configuration', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'database_uuid' => $database->uuid]) }}"
href="{{ route('project.database.configuration', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'database_uuid' => $database->uuid]) }}"
wire:navigate>General</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.database.environment-variables', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'database_uuid' => $database->uuid]) }}"
href="{{ route('project.database.environment-variables', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'database_uuid' => $database->uuid]) }}"
wire:navigate>Environment Variables</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.database.servers', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'database_uuid' => $database->uuid]) }}"
href="{{ route('project.database.servers', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'database_uuid' => $database->uuid]) }}"
wire:navigate>Servers</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.database.persistent-storage', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'database_uuid' => $database->uuid]) }}"
href="{{ route('project.database.persistent-storage', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'database_uuid' => $database->uuid]) }}"
wire:navigate>Persistent Storage</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.database.import-backups', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'database_uuid' => $database->uuid]) }}"
href="{{ route('project.database.import-backups', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'database_uuid' => $database->uuid]) }}"
wire:navigate>Import Backups</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.database.webhooks', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'database_uuid' => $database->uuid]) }}"
href="{{ route('project.database.webhooks', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'database_uuid' => $database->uuid]) }}"
wire:navigate>Webhooks</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.database.resource-limits', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'database_uuid' => $database->uuid]) }}"
href="{{ route('project.database.resource-limits', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'database_uuid' => $database->uuid]) }}"
wire:navigate>Resource Limits</a>
<a class="menu-item" wire:current.exact="menu-item-active"
href="{{ route('project.database.resource-operations', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'database_uuid' => $database->uuid]) }}"
href="{{ route('project.database.resource-operations', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'database_uuid' => $database->uuid]) }}"
wire:navigate>Resource Operations</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.database.metrics', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'database_uuid' => $database->uuid]) }}"
href="{{ route('project.database.metrics', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'database_uuid' => $database->uuid]) }}"
wire:navigate>Metrics</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.database.tags', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'database_uuid' => $database->uuid]) }}"
href="{{ route('project.database.tags', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'database_uuid' => $database->uuid]) }}"
wire:navigate>Tags</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.database.danger', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'database_uuid' => $database->uuid]) }}"
href="{{ route('project.database.danger', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'database_uuid' => $database->uuid]) }}"
wire:navigate>Danger Zone</a>
</div>
<div class="w-full">

View File

@@ -211,7 +211,7 @@
},
goto(item) {
const hrefLink = item.hrefLink;
window.location.href = `${hrefLink}#tags`;
window.location.href = `${hrefLink}/tags`;
},
filterAndSort(items) {
if (this.search === '') {

View File

@@ -9,30 +9,30 @@
<a class="menu-item sm:min-w-fit" target="_blank" href="{{ $service->documentation() }}">Documentation
<x-external-link /></a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.service.configuration', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'service_uuid' => $service->uuid]) }}"
href="{{ route('project.service.configuration', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid]) }}"
wire:navigate>General</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.service.environment-variables', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'service_uuid' => $service->uuid]) }}"
href="{{ route('project.service.environment-variables', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid]) }}"
wire:navigate>Environment Variables</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.service.storages', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'service_uuid' => $service->uuid]) }}"
href="{{ route('project.service.storages', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid]) }}"
wire:navigate>Persistent Storages</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.service.scheduled-tasks.show', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'service_uuid' => $service->uuid]) }}"
href="{{ route('project.service.scheduled-tasks.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid]) }}"
wire:navigate>Scheduled Tasks</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.service.webhooks', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'service_uuid' => $service->uuid]) }}"
href="{{ route('project.service.webhooks', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid]) }}"
wire:navigate>Webhooks</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.service.resource-operations', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'service_uuid' => $service->uuid]) }}"
href="{{ route('project.service.resource-operations', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid]) }}"
wire:navigate>Resource Operations</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.service.tags', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'service_uuid' => $service->uuid]) }}"
href="{{ route('project.service.tags', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid]) }}"
wire:navigate>Tags</a>
<a class='menu-item' wire:current.exact="menu-item-active"
href="{{ route('project.service.danger', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'service_uuid' => $service->uuid]) }}"
href="{{ route('project.service.danger', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid]) }}"
wire:navigate>Danger Zone</a>
</div>
<div class="w-full">
@@ -95,7 +95,7 @@
</div>
<div class="flex items-center px-4">
<a class="mx-4 text-xs font-bold hover:underline"
href="{{ route('project.service.index', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'service_uuid' => $service->uuid, 'stack_service_uuid' => $application->uuid]) }}">
href="{{ route('project.service.index', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid, 'stack_service_uuid' => $application->uuid]) }}">
Settings
</a>
@if (str($application->status)->contains('running'))
@@ -143,12 +143,12 @@
<div class="flex items-center px-4">
@if ($database->isBackupSolutionAvailable())
<a class="mx-4 text-xs font-bold hover:underline"
href="{{ route('project.service.index', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'service_uuid' => $service->uuid, 'stack_service_uuid' => $database->uuid]) }}#backups">
href="{{ route('project.service.index', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid, 'stack_service_uuid' => $database->uuid]) }}#backups">
Backups
</a>
@endif
<a class="mx-4 text-xs font-bold hover:underline"
href="{{ route('project.service.index', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name, 'service_uuid' => $service->uuid, 'stack_service_uuid' => $database->uuid]) }}">
href="{{ route('project.service.index', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid, 'service_uuid' => $service->uuid, 'stack_service_uuid' => $database->uuid]) }}">
Settings
</a>
@if (str($database->status)->contains('running'))

View File

@@ -7,7 +7,8 @@
$resource->getMorphClass() == 'App\Models\StandaloneKeydb' ||
$resource->getMorphClass() == 'App\Models\StandaloneDragonfly' ||
$resource->getMorphClass() == 'App\Models\StandaloneClickhouse' ||
$resource->getMorphClass() == 'App\Models\StandaloneMongodb')
$resource->getMorphClass() == 'App\Models\StandaloneMongodb' ||
$resource->getMorphClass() == 'App\Models\StandaloneMysql')
<div class="flex items-center gap-2">
<h2>Storages</h2>
<x-helper

View File

@@ -40,7 +40,7 @@ Route::group([
Route::get('/projects', [ProjectController::class, 'projects'])->middleware(['api.ability:read']);
Route::get('/projects/{uuid}', [ProjectController::class, 'project_by_uuid'])->middleware(['api.ability:read']);
Route::get('/projects/{uuid}/{environment_uuid}', [ProjectController::class, 'environment_details'])->middleware(['api.ability:read']);
Route::get('/projects/{uuid}/{environment_name_or_uuid}', [ProjectController::class, 'environment_details'])->middleware(['api.ability:read']);
Route::post('/projects', [ProjectController::class, 'create_project'])->middleware(['api.ability:read']);
Route::patch('/projects/{uuid}', [ProjectController::class, 'update_project'])->middleware(['api.ability:write']);