Merge pull request #4364 from peaklabs-dev/fix-environement-route
Fix: Environment route now uses uuid
This commit is contained in:
@@ -117,11 +117,12 @@ class ApplicationsController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
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: [
|
properties: [
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'The server 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_repository' => ['type' => 'string', 'description' => 'The git repository URL.'],
|
||||||
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
|
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
|
||||||
'build_pack' => ['type' => 'string', 'enum' => ['nixpacks', 'static', 'dockerfile', 'dockercompose'], 'description' => 'The build pack type.'],
|
'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',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
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: [
|
properties: [
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'The server 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.'],
|
'github_app_uuid' => ['type' => 'string', 'description' => 'The Github App UUID.'],
|
||||||
'git_repository' => ['type' => 'string', 'description' => 'The git repository URL.'],
|
'git_repository' => ['type' => 'string', 'description' => 'The git repository URL.'],
|
||||||
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
|
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
|
||||||
@@ -329,11 +331,12 @@ class ApplicationsController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
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: [
|
properties: [
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'The server 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.'],
|
'private_key_uuid' => ['type' => 'string', 'description' => 'The private key UUID.'],
|
||||||
'git_repository' => ['type' => 'string', 'description' => 'The git repository URL.'],
|
'git_repository' => ['type' => 'string', 'description' => 'The git repository URL.'],
|
||||||
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
|
'git_branch' => ['type' => 'string', 'description' => 'The git branch.'],
|
||||||
@@ -435,11 +438,12 @@ class ApplicationsController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['project_uuid', 'server_uuid', 'environment_name', 'dockerfile'],
|
required: ['project_uuid', 'server_uuid', 'environment_name', 'environment_uuid', 'dockerfile'],
|
||||||
properties: [
|
properties: [
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'The server 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.'],
|
'dockerfile' => ['type' => 'string', 'description' => 'The Dockerfile content.'],
|
||||||
'build_pack' => ['type' => 'string', 'enum' => ['nixpacks', 'static', 'dockerfile', 'dockercompose'], 'description' => 'The build pack type.'],
|
'build_pack' => ['type' => 'string', 'enum' => ['nixpacks', 'static', 'dockerfile', 'dockercompose'], 'description' => 'The build pack type.'],
|
||||||
'ports_exposes' => ['type' => 'string', 'description' => 'The ports to expose.'],
|
'ports_exposes' => ['type' => 'string', 'description' => 'The ports to expose.'],
|
||||||
@@ -525,11 +529,12 @@ class ApplicationsController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
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: [
|
properties: [
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'The server 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_name' => ['type' => 'string', 'description' => 'The docker registry image name.'],
|
||||||
'docker_registry_image_tag' => ['type' => 'string', 'description' => 'The docker registry image tag.'],
|
'docker_registry_image_tag' => ['type' => 'string', 'description' => 'The docker registry image tag.'],
|
||||||
'ports_exposes' => ['type' => 'string', 'description' => 'The ports to expose.'],
|
'ports_exposes' => ['type' => 'string', 'description' => 'The ports to expose.'],
|
||||||
@@ -612,11 +617,12 @@ class ApplicationsController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
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: [
|
properties: [
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
'project_uuid' => ['type' => 'string', 'description' => 'The project UUID.'],
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'The server 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.'],
|
'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.'],
|
'destination_uuid' => ['type' => 'string', 'description' => 'The destination UUID if the server has more than one destinations.'],
|
||||||
'name' => ['type' => 'string', 'description' => 'The application name.'],
|
'name' => ['type' => 'string', 'description' => 'The application name.'],
|
||||||
@@ -650,7 +656,7 @@ class ApplicationsController extends Controller
|
|||||||
|
|
||||||
private function create_application(Request $request, $type)
|
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();
|
$teamId = getTeamIdFromToken();
|
||||||
if (is_null($teamId)) {
|
if (is_null($teamId)) {
|
||||||
return invalidTokenResponse();
|
return invalidTokenResponse();
|
||||||
@@ -664,7 +670,8 @@ class ApplicationsController extends Controller
|
|||||||
'name' => 'string|max:255',
|
'name' => 'string|max:255',
|
||||||
'description' => 'string|nullable',
|
'description' => 'string|nullable',
|
||||||
'project_uuid' => 'string|required',
|
'project_uuid' => 'string|required',
|
||||||
'environment_name' => 'string|required',
|
'environment_name' => 'string|nullable',
|
||||||
|
'environment_uuid' => 'string|nullable',
|
||||||
'server_uuid' => 'string|required',
|
'server_uuid' => 'string|required',
|
||||||
'destination_uuid' => 'string',
|
'destination_uuid' => 'string',
|
||||||
]);
|
]);
|
||||||
@@ -684,6 +691,11 @@ class ApplicationsController extends Controller
|
|||||||
], 422);
|
], 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;
|
$serverUuid = $request->server_uuid;
|
||||||
$fqdn = $request->domains;
|
$fqdn = $request->domains;
|
||||||
$instantDeploy = $request->instant_deploy;
|
$instantDeploy = $request->instant_deploy;
|
||||||
@@ -716,7 +728,10 @@ class ApplicationsController extends Controller
|
|||||||
if (! $project) {
|
if (! $project) {
|
||||||
return response()->json(['message' => 'Project not found.'], 404);
|
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) {
|
if (! $environment) {
|
||||||
return response()->json(['message' => 'Environment not found.'], 404);
|
return response()->json(['message' => 'Environment not found.'], 404);
|
||||||
}
|
}
|
||||||
@@ -733,12 +748,6 @@ class ApplicationsController extends Controller
|
|||||||
}
|
}
|
||||||
$destination = $destinations->first();
|
$destination = $destinations->first();
|
||||||
if ($type === 'public') {
|
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 = [
|
$validationRules = [
|
||||||
'git_repository' => 'string|required',
|
'git_repository' => 'string|required',
|
||||||
'git_branch' => 'string|required',
|
'git_branch' => 'string|required',
|
||||||
@@ -748,7 +757,7 @@ class ApplicationsController extends Controller
|
|||||||
'docker_compose_raw' => 'string|nullable',
|
'docker_compose_raw' => 'string|nullable',
|
||||||
'docker_compose_domains' => 'array|nullable',
|
'docker_compose_domains' => 'array|nullable',
|
||||||
];
|
];
|
||||||
$validationRules = array_merge($validationRules, sharedDataApplications());
|
$validationRules = array_merge(sharedDataApplications(), $validationRules);
|
||||||
$validator = customApiValidator($request->all(), $validationRules);
|
$validator = customApiValidator($request->all(), $validationRules);
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
@@ -756,6 +765,12 @@ class ApplicationsController extends Controller
|
|||||||
'errors' => $validator->errors(),
|
'errors' => $validator->errors(),
|
||||||
], 422);
|
], 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);
|
$return = $this->validateDataApplications($request, $server);
|
||||||
if ($return instanceof \Illuminate\Http\JsonResponse) {
|
if ($return instanceof \Illuminate\Http\JsonResponse) {
|
||||||
@@ -820,12 +835,6 @@ class ApplicationsController extends Controller
|
|||||||
'domains' => data_get($application, 'domains'),
|
'domains' => data_get($application, 'domains'),
|
||||||
]));
|
]));
|
||||||
} elseif ($type === 'private-gh-app') {
|
} 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 = [
|
$validationRules = [
|
||||||
'git_repository' => 'string|required',
|
'git_repository' => 'string|required',
|
||||||
'git_branch' => 'string|required',
|
'git_branch' => 'string|required',
|
||||||
@@ -836,7 +845,7 @@ class ApplicationsController extends Controller
|
|||||||
'docker_compose_location' => 'string',
|
'docker_compose_location' => 'string',
|
||||||
'docker_compose_raw' => 'string|nullable',
|
'docker_compose_raw' => 'string|nullable',
|
||||||
];
|
];
|
||||||
$validationRules = array_merge($validationRules, sharedDataApplications());
|
$validationRules = array_merge(sharedDataApplications(), $validationRules);
|
||||||
|
|
||||||
$validator = customApiValidator($request->all(), $validationRules);
|
$validator = customApiValidator($request->all(), $validationRules);
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
@@ -845,6 +854,14 @@ class ApplicationsController extends Controller
|
|||||||
'errors' => $validator->errors(),
|
'errors' => $validator->errors(),
|
||||||
], 422);
|
], 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);
|
$return = $this->validateDataApplications($request, $server);
|
||||||
if ($return instanceof \Illuminate\Http\JsonResponse) {
|
if ($return instanceof \Illuminate\Http\JsonResponse) {
|
||||||
return $return;
|
return $return;
|
||||||
@@ -919,12 +936,6 @@ class ApplicationsController extends Controller
|
|||||||
'domains' => data_get($application, 'domains'),
|
'domains' => data_get($application, 'domains'),
|
||||||
]));
|
]));
|
||||||
} elseif ($type === 'private-deploy-key') {
|
} 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 = [
|
$validationRules = [
|
||||||
'git_repository' => 'string|required',
|
'git_repository' => 'string|required',
|
||||||
@@ -937,7 +948,7 @@ class ApplicationsController extends Controller
|
|||||||
'docker_compose_raw' => 'string|nullable',
|
'docker_compose_raw' => 'string|nullable',
|
||||||
];
|
];
|
||||||
|
|
||||||
$validationRules = array_merge($validationRules, sharedDataApplications());
|
$validationRules = array_merge(sharedDataApplications(), $validationRules);
|
||||||
$validator = customApiValidator($request->all(), $validationRules);
|
$validator = customApiValidator($request->all(), $validationRules);
|
||||||
|
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
@@ -946,6 +957,13 @@ class ApplicationsController extends Controller
|
|||||||
'errors' => $validator->errors(),
|
'errors' => $validator->errors(),
|
||||||
], 422);
|
], 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);
|
$return = $this->validateDataApplications($request, $server);
|
||||||
if ($return instanceof \Illuminate\Http\JsonResponse) {
|
if ($return instanceof \Illuminate\Http\JsonResponse) {
|
||||||
return $return;
|
return $return;
|
||||||
@@ -1015,14 +1033,10 @@ class ApplicationsController extends Controller
|
|||||||
'domains' => data_get($application, 'domains'),
|
'domains' => data_get($application, 'domains'),
|
||||||
]));
|
]));
|
||||||
} elseif ($type === 'dockerfile') {
|
} elseif ($type === 'dockerfile') {
|
||||||
if (! $request->has('name')) {
|
|
||||||
$request->offsetSet('name', 'dockerfile-'.new Cuid2);
|
|
||||||
}
|
|
||||||
|
|
||||||
$validationRules = [
|
$validationRules = [
|
||||||
'dockerfile' => 'string|required',
|
'dockerfile' => 'string|required',
|
||||||
];
|
];
|
||||||
$validationRules = array_merge($validationRules, sharedDataApplications());
|
$validationRules = array_merge(sharedDataApplications(), $validationRules);
|
||||||
$validator = customApiValidator($request->all(), $validationRules);
|
$validator = customApiValidator($request->all(), $validationRules);
|
||||||
|
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
@@ -1031,6 +1045,10 @@ class ApplicationsController extends Controller
|
|||||||
'errors' => $validator->errors(),
|
'errors' => $validator->errors(),
|
||||||
], 422);
|
], 422);
|
||||||
}
|
}
|
||||||
|
if (! $request->has('name')) {
|
||||||
|
$request->offsetSet('name', 'dockerfile-'.new Cuid2);
|
||||||
|
}
|
||||||
|
|
||||||
$return = $this->validateDataApplications($request, $server);
|
$return = $this->validateDataApplications($request, $server);
|
||||||
if ($return instanceof \Illuminate\Http\JsonResponse) {
|
if ($return instanceof \Illuminate\Http\JsonResponse) {
|
||||||
return $return;
|
return $return;
|
||||||
@@ -1100,15 +1118,12 @@ class ApplicationsController extends Controller
|
|||||||
'domains' => data_get($application, 'domains'),
|
'domains' => data_get($application, 'domains'),
|
||||||
]));
|
]));
|
||||||
} elseif ($type === 'dockerimage') {
|
} elseif ($type === 'dockerimage') {
|
||||||
if (! $request->has('name')) {
|
|
||||||
$request->offsetSet('name', 'docker-image-'.new Cuid2);
|
|
||||||
}
|
|
||||||
$validationRules = [
|
$validationRules = [
|
||||||
'docker_registry_image_name' => 'string|required',
|
'docker_registry_image_name' => 'string|required',
|
||||||
'docker_registry_image_tag' => 'string',
|
'docker_registry_image_tag' => 'string',
|
||||||
'ports_exposes' => 'string|regex:/^(\d+)(,\d+)*$/|required',
|
'ports_exposes' => 'string|regex:/^(\d+)(,\d+)*$/|required',
|
||||||
];
|
];
|
||||||
$validationRules = array_merge($validationRules, sharedDataApplications());
|
$validationRules = array_merge(sharedDataApplications(), $validationRules);
|
||||||
$validator = customApiValidator($request->all(), $validationRules);
|
$validator = customApiValidator($request->all(), $validationRules);
|
||||||
|
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
@@ -1117,6 +1132,9 @@ class ApplicationsController extends Controller
|
|||||||
'errors' => $validator->errors(),
|
'errors' => $validator->errors(),
|
||||||
], 422);
|
], 422);
|
||||||
}
|
}
|
||||||
|
if (! $request->has('name')) {
|
||||||
|
$request->offsetSet('name', 'docker-image-'.new Cuid2);
|
||||||
|
}
|
||||||
$return = $this->validateDataApplications($request, $server);
|
$return = $this->validateDataApplications($request, $server);
|
||||||
if ($return instanceof \Illuminate\Http\JsonResponse) {
|
if ($return instanceof \Illuminate\Http\JsonResponse) {
|
||||||
return $return;
|
return $return;
|
||||||
@@ -1164,7 +1182,7 @@ class ApplicationsController extends Controller
|
|||||||
'domains' => data_get($application, 'domains'),
|
'domains' => data_get($application, 'domains'),
|
||||||
]));
|
]));
|
||||||
} elseif ($type === 'dockercompose') {
|
} 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);
|
$extraFields = array_diff(array_keys($request->all()), $allowedFields);
|
||||||
if ($validator->fails() || ! empty($extraFields)) {
|
if ($validator->fails() || ! empty($extraFields)) {
|
||||||
@@ -1186,7 +1204,7 @@ class ApplicationsController extends Controller
|
|||||||
$validationRules = [
|
$validationRules = [
|
||||||
'docker_compose_raw' => 'string|required',
|
'docker_compose_raw' => 'string|required',
|
||||||
];
|
];
|
||||||
$validationRules = array_merge($validationRules, sharedDataApplications());
|
$validationRules = array_merge(sharedDataApplications(), $validationRules);
|
||||||
$validator = customApiValidator($request->all(), $validationRules);
|
$validator = customApiValidator($request->all(), $validationRules);
|
||||||
|
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
@@ -1554,7 +1572,7 @@ class ApplicationsController extends Controller
|
|||||||
'docker_compose_custom_build_command' => 'string|nullable',
|
'docker_compose_custom_build_command' => 'string|nullable',
|
||||||
'custom_nginx_configuration' => 'string|nullable',
|
'custom_nginx_configuration' => 'string|nullable',
|
||||||
];
|
];
|
||||||
$validationRules = array_merge($validationRules, sharedDataApplications());
|
$validationRules = array_merge(sharedDataApplications(), $validationRules);
|
||||||
$validator = customApiValidator($request->all(), $validationRules);
|
$validator = customApiValidator($request->all(), $validationRules);
|
||||||
|
|
||||||
// Validate ports_exposes
|
// Validate ports_exposes
|
||||||
|
|||||||
@@ -523,11 +523,12 @@ class DatabasesController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['server_uuid', 'project_uuid', 'environment_name'],
|
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
|
||||||
properties: [
|
properties: [
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
|
'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_user' => ['type' => 'string', 'description' => 'PostgreSQL user'],
|
||||||
'postgres_password' => ['type' => 'string', 'description' => 'PostgreSQL password'],
|
'postgres_password' => ['type' => 'string', 'description' => 'PostgreSQL password'],
|
||||||
'postgres_db' => ['type' => 'string', 'description' => 'PostgreSQL database'],
|
'postgres_db' => ['type' => 'string', 'description' => 'PostgreSQL database'],
|
||||||
@@ -589,11 +590,12 @@ class DatabasesController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['server_uuid', 'project_uuid', 'environment_name'],
|
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
|
||||||
properties: [
|
properties: [
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
|
'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'],
|
'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_user' => ['type' => 'string', 'description' => 'Clickhouse admin user'],
|
||||||
'clickhouse_admin_password' => ['type' => 'string', 'description' => 'Clickhouse admin password'],
|
'clickhouse_admin_password' => ['type' => 'string', 'description' => 'Clickhouse admin password'],
|
||||||
@@ -651,11 +653,12 @@ class DatabasesController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['server_uuid', 'project_uuid', 'environment_name'],
|
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
|
||||||
properties: [
|
properties: [
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
|
'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'],
|
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
|
||||||
'dragonfly_password' => ['type' => 'string', 'description' => 'DragonFly password'],
|
'dragonfly_password' => ['type' => 'string', 'description' => 'DragonFly password'],
|
||||||
'name' => ['type' => 'string', 'description' => 'Name of the database'],
|
'name' => ['type' => 'string', 'description' => 'Name of the database'],
|
||||||
@@ -712,11 +715,12 @@ class DatabasesController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['server_uuid', 'project_uuid', 'environment_name'],
|
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
|
||||||
properties: [
|
properties: [
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
|
'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'],
|
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
|
||||||
'redis_password' => ['type' => 'string', 'description' => 'Redis password'],
|
'redis_password' => ['type' => 'string', 'description' => 'Redis password'],
|
||||||
'redis_conf' => ['type' => 'string', 'description' => 'Redis conf'],
|
'redis_conf' => ['type' => 'string', 'description' => 'Redis conf'],
|
||||||
@@ -774,11 +778,12 @@ class DatabasesController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['server_uuid', 'project_uuid', 'environment_name'],
|
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
|
||||||
properties: [
|
properties: [
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
|
'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'],
|
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
|
||||||
'keydb_password' => ['type' => 'string', 'description' => 'KeyDB password'],
|
'keydb_password' => ['type' => 'string', 'description' => 'KeyDB password'],
|
||||||
'keydb_conf' => ['type' => 'string', 'description' => 'KeyDB conf'],
|
'keydb_conf' => ['type' => 'string', 'description' => 'KeyDB conf'],
|
||||||
@@ -836,11 +841,12 @@ class DatabasesController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['server_uuid', 'project_uuid', 'environment_name'],
|
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
|
||||||
properties: [
|
properties: [
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
|
'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'],
|
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
|
||||||
'mariadb_conf' => ['type' => 'string', 'description' => 'MariaDB conf'],
|
'mariadb_conf' => ['type' => 'string', 'description' => 'MariaDB conf'],
|
||||||
'mariadb_root_password' => ['type' => 'string', 'description' => 'MariaDB root password'],
|
'mariadb_root_password' => ['type' => 'string', 'description' => 'MariaDB root password'],
|
||||||
@@ -901,11 +907,12 @@ class DatabasesController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['server_uuid', 'project_uuid', 'environment_name'],
|
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
|
||||||
properties: [
|
properties: [
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
|
'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'],
|
'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_root_password' => ['type' => 'string', 'description' => 'MySQL root password'],
|
||||||
'mysql_password' => ['type' => 'string', 'description' => 'MySQL password'],
|
'mysql_password' => ['type' => 'string', 'description' => 'MySQL password'],
|
||||||
@@ -966,11 +973,12 @@ class DatabasesController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['server_uuid', 'project_uuid', 'environment_name'],
|
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid'],
|
||||||
properties: [
|
properties: [
|
||||||
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
'server_uuid' => ['type' => 'string', 'description' => 'UUID of the server'],
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'UUID of the project'],
|
'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'],
|
'destination_uuid' => ['type' => 'string', 'description' => 'UUID of the destination if the server has multiple destinations'],
|
||||||
'mongo_conf' => ['type' => 'string', 'description' => 'MongoDB conf'],
|
'mongo_conf' => ['type' => 'string', 'description' => 'MongoDB conf'],
|
||||||
'mongo_initdb_root_username' => ['type' => 'string', 'description' => 'MongoDB initdb root username'],
|
'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)
|
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();
|
$teamId = getTeamIdFromToken();
|
||||||
if (is_null($teamId)) {
|
if (is_null($teamId)) {
|
||||||
@@ -1039,6 +1047,11 @@ class DatabasesController extends Controller
|
|||||||
'errors' => $errors,
|
'errors' => $errors,
|
||||||
], 422);
|
], 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;
|
$serverUuid = $request->server_uuid;
|
||||||
$instantDeploy = $request->instant_deploy ?? false;
|
$instantDeploy = $request->instant_deploy ?? false;
|
||||||
if ($request->is_public && ! $request->public_port) {
|
if ($request->is_public && ! $request->public_port) {
|
||||||
@@ -1048,9 +1061,12 @@ class DatabasesController extends Controller
|
|||||||
if (! $project) {
|
if (! $project) {
|
||||||
return response()->json(['message' => 'Project not found.'], 404);
|
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) {
|
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();
|
$server = Server::whereTeamId($teamId)->whereUuid($serverUuid)->first();
|
||||||
if (! $server) {
|
if (! $server) {
|
||||||
@@ -1074,7 +1090,8 @@ class DatabasesController extends Controller
|
|||||||
'description' => 'string|nullable',
|
'description' => 'string|nullable',
|
||||||
'image' => 'string',
|
'image' => 'string',
|
||||||
'project_uuid' => 'string|required',
|
'project_uuid' => 'string|required',
|
||||||
'environment_name' => 'string|required',
|
'environment_name' => 'string|nullable',
|
||||||
|
'environment_uuid' => 'string|nullable',
|
||||||
'server_uuid' => 'string|required',
|
'server_uuid' => 'string|required',
|
||||||
'destination_uuid' => 'string',
|
'destination_uuid' => 'string',
|
||||||
'is_public' => 'boolean',
|
'is_public' => 'boolean',
|
||||||
@@ -1105,7 +1122,7 @@ class DatabasesController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($type === NewDatabaseTypes::POSTGRESQL) {
|
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(), [
|
$validator = customApiValidator($request->all(), [
|
||||||
'postgres_user' => 'string',
|
'postgres_user' => 'string',
|
||||||
'postgres_password' => 'string',
|
'postgres_password' => 'string',
|
||||||
@@ -1164,7 +1181,7 @@ class DatabasesController extends Controller
|
|||||||
|
|
||||||
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
||||||
} elseif ($type === NewDatabaseTypes::MARIADB) {
|
} 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(), [
|
$validator = customApiValidator($request->all(), [
|
||||||
'clickhouse_admin_user' => 'string',
|
'clickhouse_admin_user' => 'string',
|
||||||
'clickhouse_admin_password' => 'string',
|
'clickhouse_admin_password' => 'string',
|
||||||
@@ -1220,7 +1237,7 @@ class DatabasesController extends Controller
|
|||||||
|
|
||||||
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
||||||
} elseif ($type === NewDatabaseTypes::MYSQL) {
|
} 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(), [
|
$validator = customApiValidator($request->all(), [
|
||||||
'mysql_root_password' => 'string',
|
'mysql_root_password' => 'string',
|
||||||
'mysql_password' => 'string',
|
'mysql_password' => 'string',
|
||||||
@@ -1279,7 +1296,7 @@ class DatabasesController extends Controller
|
|||||||
|
|
||||||
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
||||||
} elseif ($type === NewDatabaseTypes::REDIS) {
|
} 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(), [
|
$validator = customApiValidator($request->all(), [
|
||||||
'redis_password' => 'string',
|
'redis_password' => 'string',
|
||||||
'redis_conf' => 'string',
|
'redis_conf' => 'string',
|
||||||
@@ -1335,7 +1352,7 @@ class DatabasesController extends Controller
|
|||||||
|
|
||||||
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
||||||
} elseif ($type === NewDatabaseTypes::DRAGONFLY) {
|
} 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(), [
|
$validator = customApiValidator($request->all(), [
|
||||||
'dragonfly_password' => 'string',
|
'dragonfly_password' => 'string',
|
||||||
]);
|
]);
|
||||||
@@ -1365,7 +1382,7 @@ class DatabasesController extends Controller
|
|||||||
'uuid' => $database->uuid,
|
'uuid' => $database->uuid,
|
||||||
]))->setStatusCode(201);
|
]))->setStatusCode(201);
|
||||||
} elseif ($type === NewDatabaseTypes::KEYDB) {
|
} 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(), [
|
$validator = customApiValidator($request->all(), [
|
||||||
'keydb_password' => 'string',
|
'keydb_password' => 'string',
|
||||||
'keydb_conf' => 'string',
|
'keydb_conf' => 'string',
|
||||||
@@ -1421,7 +1438,7 @@ class DatabasesController extends Controller
|
|||||||
|
|
||||||
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
||||||
} elseif ($type === NewDatabaseTypes::CLICKHOUSE) {
|
} 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(), [
|
$validator = customApiValidator($request->all(), [
|
||||||
'clickhouse_admin_user' => 'string',
|
'clickhouse_admin_user' => 'string',
|
||||||
'clickhouse_admin_password' => 'string',
|
'clickhouse_admin_password' => 'string',
|
||||||
@@ -1457,7 +1474,7 @@ class DatabasesController extends Controller
|
|||||||
|
|
||||||
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
return response()->json(serializeApiResponse($payload))->setStatusCode(201);
|
||||||
} elseif ($type === NewDatabaseTypes::MONGODB) {
|
} 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(), [
|
$validator = customApiValidator($request->all(), [
|
||||||
'mongo_conf' => 'string',
|
'mongo_conf' => 'string',
|
||||||
'mongo_initdb_root_username' => 'string',
|
'mongo_initdb_root_username' => 'string',
|
||||||
|
|||||||
@@ -102,16 +102,16 @@ class ProjectController extends Controller
|
|||||||
|
|
||||||
#[OA\Get(
|
#[OA\Get(
|
||||||
summary: 'Environment',
|
summary: 'Environment',
|
||||||
description: 'Get environment by name.',
|
description: 'Get environment by name or UUID.',
|
||||||
path: '/projects/{uuid}/{environment_name}',
|
path: '/projects/{uuid}/{environment_name_or_uuid}',
|
||||||
operationId: 'get-environment-by-name',
|
operationId: 'get-environment-by-name-or-uuid',
|
||||||
security: [
|
security: [
|
||||||
['bearerAuth' => []],
|
['bearerAuth' => []],
|
||||||
],
|
],
|
||||||
tags: ['Projects'],
|
tags: ['Projects'],
|
||||||
parameters: [
|
parameters: [
|
||||||
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),
|
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: [
|
responses: [
|
||||||
new OA\Response(
|
new OA\Response(
|
||||||
@@ -141,14 +141,17 @@ class ProjectController extends Controller
|
|||||||
if (! $request->uuid) {
|
if (! $request->uuid) {
|
||||||
return response()->json(['message' => 'UUID is required.'], 422);
|
return response()->json(['message' => 'UUID is required.'], 422);
|
||||||
}
|
}
|
||||||
if (! $request->environment_name) {
|
if (! $request->environment_name_or_uuid) {
|
||||||
return response()->json(['message' => 'Environment name is required.'], 422);
|
return response()->json(['message' => 'Environment name or UUID is required.'], 422);
|
||||||
}
|
}
|
||||||
$project = Project::whereTeamId($teamId)->whereUuid($request->uuid)->first();
|
$project = Project::whereTeamId($teamId)->whereUuid($request->uuid)->first();
|
||||||
if (! $project) {
|
if (! $project) {
|
||||||
return response()->json(['message' => 'Project not found.'], 404);
|
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) {
|
if (! $environment) {
|
||||||
return response()->json(['message' => 'Environment not found.'], 404);
|
return response()->json(['message' => 'Environment not found.'], 404);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class ServicesController extends Controller
|
|||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
schema: new OA\Schema(
|
schema: new OA\Schema(
|
||||||
type: 'object',
|
type: 'object',
|
||||||
required: ['server_uuid', 'project_uuid', 'environment_name', 'type'],
|
required: ['server_uuid', 'project_uuid', 'environment_name', 'environment_uuid', 'type'],
|
||||||
properties: [
|
properties: [
|
||||||
'type' => [
|
'type' => [
|
||||||
'description' => 'The one-click service 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.'],
|
'name' => ['type' => 'string', 'maxLength' => 255, 'description' => 'Name of the service.'],
|
||||||
'description' => ['type' => 'string', 'nullable' => true, 'description' => 'Description of the service.'],
|
'description' => ['type' => 'string', 'nullable' => true, 'description' => 'Description of the service.'],
|
||||||
'project_uuid' => ['type' => 'string', 'description' => 'Project UUID.'],
|
'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.'],
|
'server_uuid' => ['type' => 'string', 'description' => 'Server UUID.'],
|
||||||
'destination_uuid' => ['type' => 'string', 'description' => 'Destination UUID. Required if server has multiple destinations.'],
|
'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.'],
|
'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)
|
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();
|
$teamId = getTeamIdFromToken();
|
||||||
if (is_null($teamId)) {
|
if (is_null($teamId)) {
|
||||||
@@ -250,7 +251,8 @@ class ServicesController extends Controller
|
|||||||
$validator = customApiValidator($request->all(), [
|
$validator = customApiValidator($request->all(), [
|
||||||
'type' => 'string|required',
|
'type' => 'string|required',
|
||||||
'project_uuid' => 'string|required',
|
'project_uuid' => 'string|required',
|
||||||
'environment_name' => 'string|required',
|
'environment_name' => 'string|nullable',
|
||||||
|
'environment_uuid' => 'string|nullable',
|
||||||
'server_uuid' => 'string|required',
|
'server_uuid' => 'string|required',
|
||||||
'destination_uuid' => 'string',
|
'destination_uuid' => 'string',
|
||||||
'name' => 'string|max:255',
|
'name' => 'string|max:255',
|
||||||
@@ -272,6 +274,11 @@ class ServicesController extends Controller
|
|||||||
'errors' => $errors,
|
'errors' => $errors,
|
||||||
], 422);
|
], 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;
|
$serverUuid = $request->server_uuid;
|
||||||
$instantDeploy = $request->instant_deploy ?? false;
|
$instantDeploy = $request->instant_deploy ?? false;
|
||||||
if ($request->is_public && ! $request->public_port) {
|
if ($request->is_public && ! $request->public_port) {
|
||||||
@@ -281,7 +288,10 @@ class ServicesController extends Controller
|
|||||||
if (! $project) {
|
if (! $project) {
|
||||||
return response()->json(['message' => 'Project not found.'], 404);
|
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) {
|
if (! $environment) {
|
||||||
return response()->json(['message' => 'Environment not found.'], 404);
|
return response()->json(['message' => 'Environment not found.'], 404);
|
||||||
}
|
}
|
||||||
@@ -349,7 +359,11 @@ class ServicesController extends Controller
|
|||||||
}
|
}
|
||||||
$domains = $service->applications()->get()->pluck('fqdn')->sort();
|
$domains = $service->applications()->get()->pluck('fqdn')->sort();
|
||||||
$domains = $domains->map(function ($domain) {
|
$domains = $domains->map(function ($domain) {
|
||||||
|
if (count(explode(':', $domain)) > 2) {
|
||||||
return str($domain)->beforeLast(':')->value();
|
return str($domain)->beforeLast(':')->value();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $domain;
|
||||||
});
|
});
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
|
|||||||
@@ -1405,7 +1405,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
'project_uuid' => data_get($this->application, 'environment.project.uuid'),
|
'project_uuid' => data_get($this->application, 'environment.project.uuid'),
|
||||||
'application_uuid' => data_get($this->application, 'uuid'),
|
'application_uuid' => data_get($this->application, 'uuid'),
|
||||||
'deployment_uuid' => $deployment_uuid,
|
'deployment_uuid' => $deployment_uuid,
|
||||||
'environment_name' => data_get($this->application, 'environment.name'),
|
'environment_uuid' => data_get($this->application, 'environment.uuid'),
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use App\Models\Server;
|
|||||||
use App\Models\Team;
|
use App\Models\Team;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
use Visus\Cuid2\Cuid2;
|
||||||
|
|
||||||
class Index extends Component
|
class Index extends Component
|
||||||
{
|
{
|
||||||
@@ -334,6 +335,7 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
|
|||||||
$this->createdProject = Project::create([
|
$this->createdProject = Project::create([
|
||||||
'name' => 'My first project',
|
'name' => 'My first project',
|
||||||
'team_id' => currentTeam()->id,
|
'team_id' => currentTeam()->id,
|
||||||
|
'uuid' => (string) new Cuid2,
|
||||||
]);
|
]);
|
||||||
$this->currentState = 'create-resource';
|
$this->currentState = 'create-resource';
|
||||||
}
|
}
|
||||||
@@ -346,7 +348,7 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
|
|||||||
'project.resource.create',
|
'project.resource.create',
|
||||||
[
|
[
|
||||||
'project_uuid' => $this->createdProject->uuid,
|
'project_uuid' => $this->createdProject->uuid,
|
||||||
'environment_name' => 'production',
|
'environment_uuid' => $this->createdProject->environments->first()->uuid,
|
||||||
'server' => $this->createdServer->id,
|
'server' => $this->createdServer->id,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use App\Models\Project;
|
|||||||
use App\Models\Server;
|
use App\Models\Server;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Artisan;
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
use Illuminate\Support\Facades\Redirect;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
class Dashboard extends Component
|
class Dashboard extends Component
|
||||||
@@ -49,6 +50,20 @@ class Dashboard extends Component
|
|||||||
])->sortBy('id')->groupBy('server_name')->toArray();
|
])->sortBy('id')->groupBy('server_name')->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function navigateToProject($projectUuid)
|
||||||
|
{
|
||||||
|
$project = Project::where('uuid', $projectUuid)->first();
|
||||||
|
|
||||||
|
if ($project && $project->environments->count() === 1) {
|
||||||
|
return Redirect::route('project.resource.index', [
|
||||||
|
'project_uuid' => $projectUuid,
|
||||||
|
'environment_uuid' => $project->environments->first()->uuid,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Redirect::route('project.show', ['project_uuid' => $projectUuid]);
|
||||||
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
return view('livewire.dashboard');
|
return view('livewire.dashboard');
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Livewire\Project;
|
|||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use Livewire\Attributes\Validate;
|
use Livewire\Attributes\Validate;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
use Visus\Cuid2\Cuid2;
|
||||||
|
|
||||||
class AddEmpty extends Component
|
class AddEmpty extends Component
|
||||||
{
|
{
|
||||||
@@ -22,6 +23,7 @@ class AddEmpty extends Component
|
|||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
'team_id' => currentTeam()->id,
|
'team_id' => currentTeam()->id,
|
||||||
|
'uuid' => (string) new Cuid2,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return redirect()->route('project.show', $project->uuid);
|
return redirect()->route('project.show', $project->uuid);
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ class Configuration extends Component
|
|||||||
->where('uuid', request()->route('project_uuid'))
|
->where('uuid', request()->route('project_uuid'))
|
||||||
->firstOrFail();
|
->firstOrFail();
|
||||||
$environment = $project->environments()
|
$environment = $project->environments()
|
||||||
->select('id', 'name', 'project_id')
|
->select('id', 'uuid', 'name', 'project_id')
|
||||||
->where('name', request()->route('environment_name'))
|
->where('uuid', request()->route('environment_uuid'))
|
||||||
->firstOrFail();
|
->firstOrFail();
|
||||||
$application = $environment->applications()
|
$application = $environment->applications()
|
||||||
->with(['destination'])
|
->with(['destination'])
|
||||||
@@ -39,7 +39,6 @@ class Configuration extends Component
|
|||||||
$this->project = $project;
|
$this->project = $project;
|
||||||
$this->environment = $environment;
|
$this->environment = $environment;
|
||||||
$this->application = $application;
|
$this->application = $application;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class Index extends Component
|
|||||||
if (! $project) {
|
if (! $project) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
|
$environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);
|
||||||
if (! $environment) {
|
if (! $environment) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class Show extends Component
|
|||||||
if (! $project) {
|
if (! $project) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
|
$environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);
|
||||||
if (! $environment) {
|
if (! $environment) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
@@ -34,19 +34,11 @@ class Show extends Component
|
|||||||
if (! $application) {
|
if (! $application) {
|
||||||
return redirect()->route('dashboard');
|
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();
|
$application_deployment_queue = ApplicationDeploymentQueue::where('deployment_uuid', $deploymentUuid)->first();
|
||||||
if (! $application_deployment_queue) {
|
if (! $application_deployment_queue) {
|
||||||
return redirect()->route('project.application.deployment.index', [
|
return redirect()->route('project.application.deployment.index', [
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
'application_uuid' => $application->uuid,
|
'application_uuid' => $application->uuid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class Heading extends Component
|
|||||||
{
|
{
|
||||||
$this->parameters = [
|
$this->parameters = [
|
||||||
'project_uuid' => $this->application->project()->uuid,
|
'project_uuid' => $this->application->project()->uuid,
|
||||||
'environment_name' => $this->application->environment->name,
|
'environment_uuid' => $this->application->environment->uuid,
|
||||||
'application_uuid' => $this->application->uuid,
|
'application_uuid' => $this->application->uuid,
|
||||||
];
|
];
|
||||||
$lastDeployment = $this->application->get_last_successful_deployment();
|
$lastDeployment = $this->application->get_last_successful_deployment();
|
||||||
@@ -94,7 +94,7 @@ class Heading extends Component
|
|||||||
'project_uuid' => $this->parameters['project_uuid'],
|
'project_uuid' => $this->parameters['project_uuid'],
|
||||||
'application_uuid' => $this->parameters['application_uuid'],
|
'application_uuid' => $this->parameters['application_uuid'],
|
||||||
'deployment_uuid' => $this->deploymentUuid,
|
'deployment_uuid' => $this->deploymentUuid,
|
||||||
'environment_name' => $this->parameters['environment_name'],
|
'environment_uuid' => $this->parameters['environment_uuid'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ class Heading extends Component
|
|||||||
'project_uuid' => $this->parameters['project_uuid'],
|
'project_uuid' => $this->parameters['project_uuid'],
|
||||||
'application_uuid' => $this->parameters['application_uuid'],
|
'application_uuid' => $this->parameters['application_uuid'],
|
||||||
'deployment_uuid' => $this->deploymentUuid,
|
'deployment_uuid' => $this->deploymentUuid,
|
||||||
'environment_name' => $this->parameters['environment_name'],
|
'environment_uuid' => $this->parameters['environment_uuid'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ class Previews extends Component
|
|||||||
'project_uuid' => $this->parameters['project_uuid'],
|
'project_uuid' => $this->parameters['project_uuid'],
|
||||||
'application_uuid' => $this->parameters['application_uuid'],
|
'application_uuid' => $this->parameters['application_uuid'],
|
||||||
'deployment_uuid' => $this->deployment_uuid,
|
'deployment_uuid' => $this->deployment_uuid,
|
||||||
'environment_name' => $this->parameters['environment_name'],
|
'environment_uuid' => $this->parameters['environment_uuid'],
|
||||||
]);
|
]);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class Rollback extends Component
|
|||||||
'project_uuid' => $this->parameters['project_uuid'],
|
'project_uuid' => $this->parameters['project_uuid'],
|
||||||
'application_uuid' => $this->parameters['application_uuid'],
|
'application_uuid' => $this->parameters['application_uuid'],
|
||||||
'deployment_uuid' => $deployment_uuid,
|
'deployment_uuid' => $deployment_uuid,
|
||||||
'environment_name' => $this->parameters['environment_name'],
|
'environment_uuid' => $this->parameters['environment_uuid'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class CloneMe extends Component
|
|||||||
{
|
{
|
||||||
public string $project_uuid;
|
public string $project_uuid;
|
||||||
|
|
||||||
public string $environment_name;
|
public string $environment_uuid;
|
||||||
|
|
||||||
public int $project_id;
|
public int $project_id;
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ class CloneMe extends Component
|
|||||||
{
|
{
|
||||||
$this->project_uuid = $project_uuid;
|
$this->project_uuid = $project_uuid;
|
||||||
$this->project = Project::where('uuid', $project_uuid)->firstOrFail();
|
$this->project = Project::where('uuid', $project_uuid)->firstOrFail();
|
||||||
$this->environment = $this->project->environments->where('name', $this->environment_name)->first();
|
$this->environment = $this->project->environments->where('uuid', $this->environment_uuid)->first();
|
||||||
$this->project_id = $this->project->id;
|
$this->project_id = $this->project->id;
|
||||||
$this->servers = currentTeam()->servers;
|
$this->servers = currentTeam()->servers;
|
||||||
$this->newName = str($this->project->name.'-clone-'.(string) new Cuid2)->slug();
|
$this->newName = str($this->project->name.'-clone-'.(string) new Cuid2)->slug();
|
||||||
@@ -89,6 +89,7 @@ class CloneMe extends Component
|
|||||||
if ($this->environment->name !== 'production') {
|
if ($this->environment->name !== 'production') {
|
||||||
$project->environments()->create([
|
$project->environments()->create([
|
||||||
'name' => $this->environment->name,
|
'name' => $this->environment->name,
|
||||||
|
'uuid' => (string) new Cuid2,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$environment = $project->environments->where('name', $this->environment->name)->first();
|
$environment = $project->environments->where('name', $this->environment->name)->first();
|
||||||
@@ -100,6 +101,7 @@ class CloneMe extends Component
|
|||||||
$project = $this->project;
|
$project = $this->project;
|
||||||
$environment = $this->project->environments()->create([
|
$environment = $this->project->environments()->create([
|
||||||
'name' => $this->newName,
|
'name' => $this->newName,
|
||||||
|
'uuid' => (string) new Cuid2,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$applications = $this->environment->applications;
|
$applications = $this->environment->applications;
|
||||||
@@ -174,7 +176,7 @@ class CloneMe extends Component
|
|||||||
|
|
||||||
return redirect()->route('project.resource.index', [
|
return redirect()->route('project.resource.index', [
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
]);
|
]);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Execution extends Component
|
|||||||
if (! $project) {
|
if (! $project) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
|
$environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);
|
||||||
if (! $environment) {
|
if (! $environment) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Index extends Component
|
|||||||
if (! $project) {
|
if (! $project) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
|
$environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);
|
||||||
if (! $environment) {
|
if (! $environment) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ class Index extends Component
|
|||||||
) {
|
) {
|
||||||
return redirect()->route('project.database.configuration', [
|
return redirect()->route('project.database.configuration', [
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
'database_uuid' => $database->uuid,
|
'database_uuid' => $database->uuid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ class Configuration extends Component
|
|||||||
->where('uuid', request()->route('project_uuid'))
|
->where('uuid', request()->route('project_uuid'))
|
||||||
->firstOrFail();
|
->firstOrFail();
|
||||||
$environment = $project->environments()
|
$environment = $project->environments()
|
||||||
->select('id', 'name', 'project_id')
|
->select('id', 'name', 'project_id', 'uuid')
|
||||||
->where('name', request()->route('environment_name'))
|
->where('uuid', request()->route('environment_uuid'))
|
||||||
->firstOrFail();
|
->firstOrFail();
|
||||||
$database = $environment->databases()
|
$database = $environment->databases()
|
||||||
->where('uuid', request()->route('database_uuid'))
|
->where('uuid', request()->route('database_uuid'))
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ class EnvironmentEdit extends Component
|
|||||||
#[Validate(['nullable', 'string', 'max:255'])]
|
#[Validate(['nullable', 'string', 'max:255'])]
|
||||||
public ?string $description = null;
|
public ?string $description = null;
|
||||||
|
|
||||||
public function mount(string $project_uuid, string $environment_name)
|
public function mount(string $project_uuid, string $environment_uuid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->project = Project::ownedByCurrentTeam()->where('uuid', $project_uuid)->firstOrFail();
|
$this->project = Project::ownedByCurrentTeam()->where('uuid', $project_uuid)->firstOrFail();
|
||||||
$this->environment = $this->project->environments()->where('name', $environment_name)->firstOrFail();
|
$this->environment = $this->project->environments()->where('uuid', $environment_uuid)->firstOrFail();
|
||||||
$this->syncData();
|
$this->syncData();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
@@ -52,7 +52,10 @@ class EnvironmentEdit extends Component
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->syncData(true);
|
$this->syncData(true);
|
||||||
$this->redirectRoute('project.environment.edit', ['environment_name' => $this->environment->name, 'project_uuid' => $this->project->uuid]);
|
$this->redirectRoute('project.environment.edit', [
|
||||||
|
'environment_uuid' => $this->environment->uuid,
|
||||||
|
'project_uuid' => $this->project->uuid,
|
||||||
|
]);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Livewire\Project;
|
|||||||
use App\Models\PrivateKey;
|
use App\Models\PrivateKey;
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use App\Models\Server;
|
use App\Models\Server;
|
||||||
|
use Illuminate\Support\Facades\Redirect;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
class Index extends Component
|
class Index extends Component
|
||||||
@@ -30,4 +31,18 @@ class Index extends Component
|
|||||||
{
|
{
|
||||||
return view('livewire.project.index');
|
return view('livewire.project.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function navigateToProject($projectUuid)
|
||||||
|
{
|
||||||
|
$project = Project::where('uuid', $projectUuid)->first();
|
||||||
|
|
||||||
|
if ($project && $project->environments->count() === 1) {
|
||||||
|
return Redirect::route('project.resource.index', [
|
||||||
|
'project_uuid' => $projectUuid,
|
||||||
|
'environment_uuid' => $project->environments->first()->uuid,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Redirect::route('project.show', ['project_uuid' => $projectUuid]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class DockerCompose extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
|
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
|
||||||
$environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
|
$environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();
|
||||||
|
|
||||||
$destination_uuid = $this->query['destination'];
|
$destination_uuid = $this->query['destination'];
|
||||||
$destination = StandaloneDocker::where('uuid', $destination_uuid)->first();
|
$destination = StandaloneDocker::where('uuid', $destination_uuid)->first();
|
||||||
@@ -97,7 +97,7 @@ class DockerCompose extends Component
|
|||||||
|
|
||||||
return redirect()->route('project.service.configuration', [
|
return redirect()->route('project.service.configuration', [
|
||||||
'service_uuid' => $service->uuid,
|
'service_uuid' => $service->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
]);
|
]);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class DockerImage extends Component
|
|||||||
$destination_class = $destination->getMorphClass();
|
$destination_class = $destination->getMorphClass();
|
||||||
|
|
||||||
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
|
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
|
||||||
$environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
|
$environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();
|
||||||
$application = Application::create([
|
$application = Application::create([
|
||||||
'name' => 'docker-image-'.new Cuid2,
|
'name' => 'docker-image-'.new Cuid2,
|
||||||
'repository_project_id' => 0,
|
'repository_project_id' => 0,
|
||||||
@@ -69,7 +69,7 @@ class DockerImage extends Component
|
|||||||
|
|
||||||
return redirect()->route('project.application.configuration', [
|
return redirect()->route('project.application.configuration', [
|
||||||
'application_uuid' => $application->uuid,
|
'application_uuid' => $application->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Livewire\Project\New;
|
|||||||
|
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
use Visus\Cuid2\Cuid2;
|
||||||
|
|
||||||
class EmptyProject extends Component
|
class EmptyProject extends Component
|
||||||
{
|
{
|
||||||
@@ -12,8 +13,9 @@ class EmptyProject extends Component
|
|||||||
$project = Project::create([
|
$project = Project::create([
|
||||||
'name' => generate_random_name(),
|
'name' => generate_random_name(),
|
||||||
'team_id' => currentTeam()->id,
|
'team_id' => currentTeam()->id,
|
||||||
|
'uuid' => (string) new Cuid2,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return redirect()->route('project.show', ['project_uuid' => $project->uuid, 'environment_name' => 'production']);
|
return redirect()->route('project.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $project->environments->first()->uuid]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ class GithubPrivateRepository extends Component
|
|||||||
$destination_class = $destination->getMorphClass();
|
$destination_class = $destination->getMorphClass();
|
||||||
|
|
||||||
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
|
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
|
||||||
$environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
|
$environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();
|
||||||
|
|
||||||
$application = Application::create([
|
$application = Application::create([
|
||||||
'name' => generate_application_name($this->selected_repository_owner.'/'.$this->selected_repository_repo, $this->selected_branch_name),
|
'name' => generate_application_name($this->selected_repository_owner.'/'.$this->selected_repository_repo, $this->selected_branch_name),
|
||||||
@@ -211,7 +211,7 @@ class GithubPrivateRepository extends Component
|
|||||||
|
|
||||||
return redirect()->route('project.application.configuration', [
|
return redirect()->route('project.application.configuration', [
|
||||||
'application_uuid' => $application->uuid,
|
'application_uuid' => $application->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
]);
|
]);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class GithubPrivateRepositoryDeployKey extends Component
|
|||||||
$this->get_git_source();
|
$this->get_git_source();
|
||||||
|
|
||||||
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
|
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
|
||||||
$environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
|
$environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();
|
||||||
if ($this->git_source === 'other') {
|
if ($this->git_source === 'other') {
|
||||||
$application_init = [
|
$application_init = [
|
||||||
'name' => generate_random_name(),
|
'name' => generate_random_name(),
|
||||||
@@ -184,7 +184,7 @@ class GithubPrivateRepositoryDeployKey extends Component
|
|||||||
|
|
||||||
return redirect()->route('project.application.configuration', [
|
return redirect()->route('project.application.configuration', [
|
||||||
'application_uuid' => $application->uuid,
|
'application_uuid' => $application->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
]);
|
]);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ class PublicGitRepository extends Component
|
|||||||
$this->validate();
|
$this->validate();
|
||||||
$destination_uuid = $this->query['destination'];
|
$destination_uuid = $this->query['destination'];
|
||||||
$project_uuid = $this->parameters['project_uuid'];
|
$project_uuid = $this->parameters['project_uuid'];
|
||||||
$environment_name = $this->parameters['environment_name'];
|
$environment_uuid = $this->parameters['environment_uuid'];
|
||||||
|
|
||||||
$destination = StandaloneDocker::where('uuid', $destination_uuid)->first();
|
$destination = StandaloneDocker::where('uuid', $destination_uuid)->first();
|
||||||
if (! $destination) {
|
if (! $destination) {
|
||||||
@@ -237,7 +237,7 @@ class PublicGitRepository extends Component
|
|||||||
$destination_class = $destination->getMorphClass();
|
$destination_class = $destination->getMorphClass();
|
||||||
|
|
||||||
$project = Project::where('uuid', $project_uuid)->first();
|
$project = Project::where('uuid', $project_uuid)->first();
|
||||||
$environment = $project->load(['environments'])->environments->where('name', $environment_name)->first();
|
$environment = $project->load(['environments'])->environments->where('uuid', $environment_uuid)->first();
|
||||||
|
|
||||||
if ($this->build_pack === 'dockercompose' && isDev() && $this->new_compose_services) {
|
if ($this->build_pack === 'dockercompose' && isDev() && $this->new_compose_services) {
|
||||||
$server = $destination->server;
|
$server = $destination->server;
|
||||||
@@ -260,7 +260,7 @@ class PublicGitRepository extends Component
|
|||||||
|
|
||||||
return redirect()->route('project.service.configuration', [
|
return redirect()->route('project.service.configuration', [
|
||||||
'service_uuid' => $service->uuid,
|
'service_uuid' => $service->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -319,7 +319,7 @@ class PublicGitRepository extends Component
|
|||||||
|
|
||||||
return redirect()->route('project.application.configuration', [
|
return redirect()->route('project.application.configuration', [
|
||||||
'application_uuid' => $application->uuid,
|
'application_uuid' => $application->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
]);
|
]);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class Select extends Component
|
|||||||
}
|
}
|
||||||
$projectUuid = data_get($this->parameters, 'project_uuid');
|
$projectUuid = data_get($this->parameters, 'project_uuid');
|
||||||
$this->environments = Project::whereUuid($projectUuid)->first()->environments;
|
$this->environments = Project::whereUuid($projectUuid)->first()->environments;
|
||||||
$this->selectedEnvironment = data_get($this->parameters, 'environment_name');
|
$this->selectedEnvironment = data_get($this->parameters, 'environment_uuid');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
@@ -73,20 +73,10 @@ class Select extends Component
|
|||||||
{
|
{
|
||||||
return redirect()->route('project.resource.create', [
|
return redirect()->route('project.resource.create', [
|
||||||
'project_uuid' => $this->parameters['project_uuid'],
|
'project_uuid' => $this->parameters['project_uuid'],
|
||||||
'environment_name' => $this->selectedEnvironment,
|
'environment_uuid' => $this->selectedEnvironment,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function addExistingPostgresql()
|
|
||||||
// {
|
|
||||||
// try {
|
|
||||||
// instantCommand("psql {$this->existingPostgresqlUrl} -c 'SELECT 1'");
|
|
||||||
// $this->dispatch('success', 'Successfully connected to the database.');
|
|
||||||
// } catch (\Throwable $e) {
|
|
||||||
// return handleError($e, $this);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
public function loadServices()
|
public function loadServices()
|
||||||
{
|
{
|
||||||
$services = get_service_templates(true);
|
$services = get_service_templates(true);
|
||||||
@@ -308,7 +298,7 @@ class Select extends Component
|
|||||||
|
|
||||||
return redirect()->route('project.resource.create', [
|
return redirect()->route('project.resource.create', [
|
||||||
'project_uuid' => $this->parameters['project_uuid'],
|
'project_uuid' => $this->parameters['project_uuid'],
|
||||||
'environment_name' => $this->parameters['environment_name'],
|
'environment_uuid' => $this->parameters['environment_uuid'],
|
||||||
'type' => $this->type,
|
'type' => $this->type,
|
||||||
'destination' => $this->destination_uuid,
|
'destination' => $this->destination_uuid,
|
||||||
'server_id' => $this->server_id,
|
'server_id' => $this->server_id,
|
||||||
@@ -323,7 +313,7 @@ class Select extends Component
|
|||||||
} else {
|
} else {
|
||||||
return redirect()->route('project.resource.create', [
|
return redirect()->route('project.resource.create', [
|
||||||
'project_uuid' => $this->parameters['project_uuid'],
|
'project_uuid' => $this->parameters['project_uuid'],
|
||||||
'environment_name' => $this->parameters['environment_name'],
|
'environment_uuid' => $this->parameters['environment_uuid'],
|
||||||
'type' => $this->type,
|
'type' => $this->type,
|
||||||
'destination' => $this->destination_uuid,
|
'destination' => $this->destination_uuid,
|
||||||
'server_id' => $this->server_id,
|
'server_id' => $this->server_id,
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ CMD ["nginx", "-g", "daemon off;"]
|
|||||||
$destination_class = $destination->getMorphClass();
|
$destination_class = $destination->getMorphClass();
|
||||||
|
|
||||||
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
|
$project = Project::where('uuid', $this->parameters['project_uuid'])->first();
|
||||||
$environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
|
$environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();
|
||||||
|
|
||||||
$port = get_port_from_dockerfile($this->dockerfile);
|
$port = get_port_from_dockerfile($this->dockerfile);
|
||||||
if (! $port) {
|
if (! $port) {
|
||||||
@@ -78,7 +78,7 @@ CMD ["nginx", "-g", "daemon off;"]
|
|||||||
|
|
||||||
return redirect()->route('project.application.configuration', [
|
return redirect()->route('project.application.configuration', [
|
||||||
'application_uuid' => $application->uuid,
|
'application_uuid' => $application->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class Create extends Component
|
|||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
$this->project = $project;
|
$this->project = $project;
|
||||||
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first();
|
$environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first();
|
||||||
if (! $environment) {
|
if (! $environment) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ class Create extends Component
|
|||||||
|
|
||||||
return redirect()->route('project.database.configuration', [
|
return redirect()->route('project.database.configuration', [
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
'database_uuid' => $database->uuid,
|
'database_uuid' => $database->uuid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ class Create extends Component
|
|||||||
|
|
||||||
return redirect()->route('project.service.configuration', [
|
return redirect()->route('project.service.configuration', [
|
||||||
'service_uuid' => $service->uuid,
|
'service_uuid' => $service->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
'project_uuid' => $project->uuid,
|
'project_uuid' => $project->uuid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class EnvironmentSelect extends Component
|
|||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
$this->selectedEnvironment = request()->route('environment_name');
|
$this->selectedEnvironment = request()->route('environment_uuid');
|
||||||
$this->project_uuid = request()->route('project_uuid');
|
$this->project_uuid = request()->route('project_uuid');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ class EnvironmentSelect extends Component
|
|||||||
} else {
|
} else {
|
||||||
return redirect()->route('project.resource.index', [
|
return redirect()->route('project.resource.index', [
|
||||||
'project_uuid' => $this->project_uuid,
|
'project_uuid' => $this->project_uuid,
|
||||||
'environment_name' => $value,
|
'environment_uuid' => $value,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Livewire\Project\Resource;
|
|||||||
|
|
||||||
use App\Models\Environment;
|
use App\Models\Environment;
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
class Index extends Component
|
class Index extends Component
|
||||||
@@ -12,39 +13,42 @@ class Index extends Component
|
|||||||
|
|
||||||
public Environment $environment;
|
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 array $parameters;
|
||||||
|
|
||||||
public function mount()
|
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();
|
$this->parameters = get_route_parameters();
|
||||||
$project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
|
$project = currentTeam()
|
||||||
if (! $project) {
|
->projects()
|
||||||
return redirect()->route('dashboard');
|
->select('id', 'uuid', 'team_id', 'name')
|
||||||
}
|
->where('uuid', request()->route('project_uuid'))
|
||||||
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first();
|
->firstOrFail();
|
||||||
if (! $environment) {
|
$environment = $project->environments()
|
||||||
return redirect()->route('dashboard');
|
->select('id', 'uuid', 'name', 'project_id')
|
||||||
}
|
->where('uuid', request()->route('environment_uuid'))
|
||||||
|
->firstOrFail();
|
||||||
|
|
||||||
$this->project = $project;
|
$this->project = $project;
|
||||||
$this->environment = $environment->loadCount([
|
$this->environment = $environment->loadCount([
|
||||||
'applications',
|
'applications',
|
||||||
@@ -69,9 +73,9 @@ class Index extends Component
|
|||||||
])->get()->sortBy('name');
|
])->get()->sortBy('name');
|
||||||
$this->applications = $this->applications->map(function ($application) {
|
$this->applications = $this->applications->map(function ($application) {
|
||||||
$application->hrefLink = route('project.application.configuration', [
|
$application->hrefLink = route('project.application.configuration', [
|
||||||
'project_uuid' => $this->project->uuid,
|
'project_uuid' => data_get($application, 'environment.project.uuid'),
|
||||||
'application_uuid' => $application->uuid,
|
'environment_uuid' => data_get($application, 'environment.uuid'),
|
||||||
'environment_name' => $this->environment->name,
|
'application_uuid' => data_get($application, 'uuid'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $application;
|
return $application;
|
||||||
@@ -89,14 +93,6 @@ class Index extends Component
|
|||||||
'clickhouses' => 'clickhouses',
|
'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) {
|
foreach ($databaseTypes as $property => $relation) {
|
||||||
$this->{$property} = $this->environment->{$relation}()->with([
|
$this->{$property} = $this->environment->{$relation}()->with([
|
||||||
'tags',
|
'tags',
|
||||||
@@ -106,7 +102,7 @@ class Index extends Component
|
|||||||
$db->hrefLink = route('project.database.configuration', [
|
$db->hrefLink = route('project.database.configuration', [
|
||||||
'project_uuid' => $this->project->uuid,
|
'project_uuid' => $this->project->uuid,
|
||||||
'database_uuid' => $db->uuid,
|
'database_uuid' => $db->uuid,
|
||||||
'environment_name' => $this->environment->name,
|
'environment_uuid' => data_get($this->environment, 'uuid'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $db;
|
return $db;
|
||||||
@@ -120,9 +116,9 @@ class Index extends Component
|
|||||||
])->get()->sortBy('name');
|
])->get()->sortBy('name');
|
||||||
$this->services = $this->services->map(function ($service) {
|
$this->services = $this->services->map(function ($service) {
|
||||||
$service->hrefLink = route('project.service.configuration', [
|
$service->hrefLink = route('project.service.configuration', [
|
||||||
'project_uuid' => $this->project->uuid,
|
'project_uuid' => data_get($service, 'environment.project.uuid'),
|
||||||
'service_uuid' => $service->uuid,
|
'environment_uuid' => data_get($service, 'environment.uuid'),
|
||||||
'environment_name' => $this->environment->name,
|
'service_uuid' => data_get($service, 'uuid'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $service;
|
return $service;
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ class Configuration extends Component
|
|||||||
->where('uuid', request()->route('project_uuid'))
|
->where('uuid', request()->route('project_uuid'))
|
||||||
->firstOrFail();
|
->firstOrFail();
|
||||||
$environment = $project->environments()
|
$environment = $project->environments()
|
||||||
->select('id', 'name', 'project_id')
|
->select('id', 'uuid', 'name', 'project_id')
|
||||||
->where('name', request()->route('environment_name'))
|
->where('uuid', request()->route('environment_uuid'))
|
||||||
->firstOrFail();
|
->firstOrFail();
|
||||||
$this->service = $environment->services()->whereUuid(request()->route('service_uuid'))->firstOrFail();
|
$this->service = $environment->services()->whereUuid(request()->route('service_uuid'))->firstOrFail();
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class Danger extends Component
|
|||||||
|
|
||||||
public $projectUuid;
|
public $projectUuid;
|
||||||
|
|
||||||
public $environmentName;
|
public $environmentUuid;
|
||||||
|
|
||||||
public bool $delete_configurations = true;
|
public bool $delete_configurations = true;
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ class Danger extends Component
|
|||||||
$parameters = get_route_parameters();
|
$parameters = get_route_parameters();
|
||||||
$this->modalId = new Cuid2;
|
$this->modalId = new Cuid2;
|
||||||
$this->projectUuid = data_get($parameters, 'project_uuid');
|
$this->projectUuid = data_get($parameters, 'project_uuid');
|
||||||
$this->environmentName = data_get($parameters, 'environment_name');
|
$this->environmentUuid = data_get($parameters, 'environment_uuid');
|
||||||
|
|
||||||
if ($this->resource === null) {
|
if ($this->resource === null) {
|
||||||
if (isset($parameters['service_uuid'])) {
|
if (isset($parameters['service_uuid'])) {
|
||||||
@@ -107,7 +107,7 @@ class Danger extends Component
|
|||||||
|
|
||||||
return redirect()->route('project.resource.index', [
|
return redirect()->route('project.resource.index', [
|
||||||
'project_uuid' => $this->projectUuid,
|
'project_uuid' => $this->projectUuid,
|
||||||
'environment_name' => $this->environmentName,
|
'environment_uuid' => $this->environmentUuid,
|
||||||
]);
|
]);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class Destination extends Component
|
|||||||
'project_uuid' => data_get($this->resource, 'environment.project.uuid'),
|
'project_uuid' => data_get($this->resource, 'environment.project.uuid'),
|
||||||
'application_uuid' => data_get($this->resource, 'uuid'),
|
'application_uuid' => data_get($this->resource, 'uuid'),
|
||||||
'deployment_uuid' => $deployment_uuid,
|
'deployment_uuid' => $deployment_uuid,
|
||||||
'environment_name' => data_get($this->resource, 'environment.name'),
|
'environment_uuid' => data_get($this->resource, 'environment.uuid'),
|
||||||
]);
|
]);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ResourceOperations extends Component
|
|||||||
|
|
||||||
public $projectUuid;
|
public $projectUuid;
|
||||||
|
|
||||||
public $environmentName;
|
public $environmentUuid;
|
||||||
|
|
||||||
public $projects;
|
public $projects;
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ class ResourceOperations extends Component
|
|||||||
{
|
{
|
||||||
$parameters = get_route_parameters();
|
$parameters = get_route_parameters();
|
||||||
$this->projectUuid = data_get($parameters, 'project_uuid');
|
$this->projectUuid = data_get($parameters, 'project_uuid');
|
||||||
$this->environmentName = data_get($parameters, 'environment_name');
|
$this->environmentUuid = data_get($parameters, 'environment_uuid');
|
||||||
$this->projects = Project::ownedByCurrentTeam()->get();
|
$this->projects = Project::ownedByCurrentTeam()->get();
|
||||||
$this->servers = currentTeam()->servers;
|
$this->servers = currentTeam()->servers;
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ class ResourceOperations extends Component
|
|||||||
}
|
}
|
||||||
$route = route('project.application.configuration', [
|
$route = route('project.application.configuration', [
|
||||||
'project_uuid' => $this->projectUuid,
|
'project_uuid' => $this->projectUuid,
|
||||||
'environment_name' => $this->environmentName,
|
'environment_uuid' => $this->environmentUuid,
|
||||||
'application_uuid' => $new_resource->uuid,
|
'application_uuid' => $new_resource->uuid,
|
||||||
]).'#resource-operations';
|
]).'#resource-operations';
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ class ResourceOperations extends Component
|
|||||||
}
|
}
|
||||||
$route = route('project.database.configuration', [
|
$route = route('project.database.configuration', [
|
||||||
'project_uuid' => $this->projectUuid,
|
'project_uuid' => $this->projectUuid,
|
||||||
'environment_name' => $this->environmentName,
|
'environment_uuid' => $this->environmentUuid,
|
||||||
'database_uuid' => $new_resource->uuid,
|
'database_uuid' => $new_resource->uuid,
|
||||||
]).'#resource-operations';
|
]).'#resource-operations';
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ class ResourceOperations extends Component
|
|||||||
$new_resource->parse();
|
$new_resource->parse();
|
||||||
$route = route('project.service.configuration', [
|
$route = route('project.service.configuration', [
|
||||||
'project_uuid' => $this->projectUuid,
|
'project_uuid' => $this->projectUuid,
|
||||||
'environment_name' => $this->environmentName,
|
'environment_uuid' => $this->environmentUuid,
|
||||||
'service_uuid' => $new_resource->uuid,
|
'service_uuid' => $new_resource->uuid,
|
||||||
]).'#resource-operations';
|
]).'#resource-operations';
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ class ResourceOperations extends Component
|
|||||||
if ($this->resource->type() === 'application') {
|
if ($this->resource->type() === 'application') {
|
||||||
$route = route('project.application.configuration', [
|
$route = route('project.application.configuration', [
|
||||||
'project_uuid' => $new_environment->project->uuid,
|
'project_uuid' => $new_environment->project->uuid,
|
||||||
'environment_name' => $new_environment->name,
|
'environment_uuid' => $new_environment->uuid,
|
||||||
'application_uuid' => $this->resource->uuid,
|
'application_uuid' => $this->resource->uuid,
|
||||||
]).'#resource-operations';
|
]).'#resource-operations';
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ class ResourceOperations extends Component
|
|||||||
} elseif (str($this->resource->type())->startsWith('standalone-')) {
|
} elseif (str($this->resource->type())->startsWith('standalone-')) {
|
||||||
$route = route('project.database.configuration', [
|
$route = route('project.database.configuration', [
|
||||||
'project_uuid' => $new_environment->project->uuid,
|
'project_uuid' => $new_environment->project->uuid,
|
||||||
'environment_name' => $new_environment->name,
|
'environment_uuid' => $new_environment->uuid,
|
||||||
'database_uuid' => $this->resource->uuid,
|
'database_uuid' => $this->resource->uuid,
|
||||||
]).'#resource-operations';
|
]).'#resource-operations';
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ class ResourceOperations extends Component
|
|||||||
} elseif ($this->resource->type() === 'service') {
|
} elseif ($this->resource->type() === 'service') {
|
||||||
$route = route('project.service.configuration', [
|
$route = route('project.service.configuration', [
|
||||||
'project_uuid' => $new_environment->project->uuid,
|
'project_uuid' => $new_environment->project->uuid,
|
||||||
'environment_name' => $new_environment->name,
|
'environment_uuid' => $new_environment->uuid,
|
||||||
'service_uuid' => $this->resource->uuid,
|
'service_uuid' => $this->resource->uuid,
|
||||||
]).'#resource-operations';
|
]).'#resource-operations';
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class Show extends Component
|
|||||||
#[Locked]
|
#[Locked]
|
||||||
public string $task_uuid;
|
public string $task_uuid;
|
||||||
|
|
||||||
public function mount(string $task_uuid, string $project_uuid, string $environment_name, ?string $application_uuid = null, ?string $service_uuid = null)
|
public function mount(string $task_uuid, string $project_uuid, string $environment_uuid, ?string $application_uuid = null, ?string $service_uuid = null)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->task_uuid = $task_uuid;
|
$this->task_uuid = $task_uuid;
|
||||||
@@ -60,7 +60,7 @@ class Show extends Component
|
|||||||
$this->resource = Service::ownedByCurrentTeam()->where('uuid', $service_uuid)->firstOrFail();
|
$this->resource = Service::ownedByCurrentTeam()->where('uuid', $service_uuid)->firstOrFail();
|
||||||
}
|
}
|
||||||
$this->parameters = [
|
$this->parameters = [
|
||||||
'environment_name' => $environment_name,
|
'environment_uuid' => $environment_uuid,
|
||||||
'project_uuid' => $project_uuid,
|
'project_uuid' => $project_uuid,
|
||||||
'application_uuid' => $application_uuid,
|
'application_uuid' => $application_uuid,
|
||||||
'service_uuid' => $service_uuid,
|
'service_uuid' => $service_uuid,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use App\Models\Environment;
|
|||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use Livewire\Attributes\Validate;
|
use Livewire\Attributes\Validate;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
use Visus\Cuid2\Cuid2;
|
||||||
|
|
||||||
class Show extends Component
|
class Show extends Component
|
||||||
{
|
{
|
||||||
@@ -33,17 +34,26 @@ class Show extends Component
|
|||||||
$environment = Environment::create([
|
$environment = Environment::create([
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'project_id' => $this->project->id,
|
'project_id' => $this->project->id,
|
||||||
|
'uuid' => (string) new Cuid2,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return redirect()->route('project.resource.index', [
|
return redirect()->route('project.resource.index', [
|
||||||
'project_uuid' => $this->project->uuid,
|
'project_uuid' => $this->project->uuid,
|
||||||
'environment_name' => $environment->name,
|
'environment_uuid' => $environment->uuid,
|
||||||
]);
|
]);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
handleError($e, $this);
|
handleError($e, $this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function navigateToEnvironment($projectUuid, $environmentUuid)
|
||||||
|
{
|
||||||
|
return redirect()->route('project.resource.index', [
|
||||||
|
'project_uuid' => $projectUuid,
|
||||||
|
'environment_uuid' => $environmentUuid,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
return view('livewire.project.show');
|
return view('livewire.project.show');
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ class Show extends Component
|
|||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
$this->parameters = get_route_parameters();
|
$this->parameters = get_route_parameters();
|
||||||
$this->project = Project::ownedByCurrentTeam()->where('uuid', request()->route('project_uuid'))->first();
|
$this->project = Project::ownedByCurrentTeam()->where('uuid', request()->route('project_uuid'))->firstOrFail();
|
||||||
$this->environment = $this->project->environments()->where('name', request()->route('environment_name'))->first();
|
$this->environment = $this->project->environments()->where('uuid', request()->route('environment_uuid'))->firstOrFail();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
|
|||||||
@@ -130,14 +130,14 @@ class Change extends Component
|
|||||||
} else {
|
} else {
|
||||||
$parameters = data_get(session('from'), 'parameters');
|
$parameters = data_get(session('from'), 'parameters');
|
||||||
$back = data_get(session('from'), 'back');
|
$back = data_get(session('from'), 'back');
|
||||||
$environment_name = data_get($parameters, 'environment_name');
|
$environment_uuid = data_get($parameters, 'environment_uuid');
|
||||||
$project_uuid = data_get($parameters, 'project_uuid');
|
$project_uuid = data_get($parameters, 'project_uuid');
|
||||||
$type = data_get($parameters, 'type');
|
$type = data_get($parameters, 'type');
|
||||||
$destination = data_get($parameters, 'destination');
|
$destination = data_get($parameters, 'destination');
|
||||||
session()->forget('from');
|
session()->forget('from');
|
||||||
|
|
||||||
return redirect()->route($back, [
|
return redirect()->route($back, [
|
||||||
'environment_name' => $environment_name,
|
'environment_uuid' => $environment_uuid,
|
||||||
'project_uuid' => $project_uuid,
|
'project_uuid' => $project_uuid,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'destination' => $destination,
|
'destination' => $destination,
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ class Application extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
return route('project.application.configuration', [
|
return route('project.application.configuration', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'application_uuid' => data_get($this, 'uuid'),
|
'application_uuid' => data_get($this, 'uuid'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -338,7 +338,7 @@ class Application extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
$route = route('project.application.scheduled-tasks', [
|
$route = route('project.application.scheduled-tasks', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'application_uuid' => data_get($this, 'uuid'),
|
'application_uuid' => data_get($this, 'uuid'),
|
||||||
'task_uuid' => $task_uuid,
|
'task_uuid' => $task_uuid,
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use OpenApi\Attributes as OA;
|
use OpenApi\Attributes as OA;
|
||||||
|
|
||||||
#[OA\Schema(
|
#[OA\Schema(
|
||||||
@@ -18,7 +17,7 @@ use OpenApi\Attributes as OA;
|
|||||||
'description' => ['type' => 'string'],
|
'description' => ['type' => 'string'],
|
||||||
]
|
]
|
||||||
)]
|
)]
|
||||||
class Environment extends Model
|
class Environment extends BaseModel
|
||||||
{
|
{
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use OpenApi\Attributes as OA;
|
use OpenApi\Attributes as OA;
|
||||||
|
use Visus\Cuid2\Cuid2;
|
||||||
|
|
||||||
#[OA\Schema(
|
#[OA\Schema(
|
||||||
description: 'Project model',
|
description: 'Project model',
|
||||||
@@ -24,8 +25,6 @@ class Project extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
protected $appends = ['default_environment'];
|
|
||||||
|
|
||||||
public static function ownedByCurrentTeam()
|
public static function ownedByCurrentTeam()
|
||||||
{
|
{
|
||||||
return Project::whereTeamId(currentTeam()->id)->orderByRaw('LOWER(name)');
|
return Project::whereTeamId(currentTeam()->id)->orderByRaw('LOWER(name)');
|
||||||
@@ -40,6 +39,7 @@ class Project extends BaseModel
|
|||||||
Environment::create([
|
Environment::create([
|
||||||
'name' => 'production',
|
'name' => 'production',
|
||||||
'project_id' => $project->id,
|
'project_id' => $project->id,
|
||||||
|
'uuid' => (string) new Cuid2,
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
static::deleting(function ($project) {
|
static::deleting(function ($project) {
|
||||||
@@ -140,18 +140,4 @@ class Project extends BaseModel
|
|||||||
{
|
{
|
||||||
return $this->postgresqls()->get()->merge($this->redis()->get())->merge($this->mongodbs()->get())->merge($this->mysqls()->get())->merge($this->mariadbs()->get())->merge($this->keydbs()->get())->merge($this->dragonflies()->get())->merge($this->clickhouses()->get());
|
return $this->postgresqls()->get()->merge($this->redis()->get())->merge($this->mongodbs()->get())->merge($this->mysqls()->get())->merge($this->mariadbs()->get())->merge($this->keydbs()->get())->merge($this->dragonflies()->get())->merge($this->clickhouses()->get());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDefaultEnvironmentAttribute()
|
|
||||||
{
|
|
||||||
$default = $this->environments()->where('name', 'production')->first();
|
|
||||||
if ($default) {
|
|
||||||
return $default->name;
|
|
||||||
}
|
|
||||||
$default = $this->environments()->get();
|
|
||||||
if ($default->count() > 0) {
|
|
||||||
return $default->sortBy('created_at')->first()->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1133,7 +1133,7 @@ class Service extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
return route('project.service.configuration', [
|
return route('project.service.configuration', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'service_uuid' => data_get($this, 'uuid'),
|
'service_uuid' => data_get($this, 'uuid'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -1146,7 +1146,7 @@ class Service extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
$route = route('project.service.scheduled-tasks', [
|
$route = route('project.service.scheduled-tasks', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'service_uuid' => data_get($this, 'uuid'),
|
'service_uuid' => data_get($this, 'uuid'),
|
||||||
'task_uuid' => $task_uuid,
|
'task_uuid' => $task_uuid,
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ class StandaloneClickhouse extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
return route('project.database.configuration', [
|
return route('project.database.configuration', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'database_uuid' => data_get($this, 'uuid'),
|
'database_uuid' => data_get($this, 'uuid'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class StandaloneDragonfly extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
return route('project.database.configuration', [
|
return route('project.database.configuration', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'database_uuid' => data_get($this, 'uuid'),
|
'database_uuid' => data_get($this, 'uuid'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class StandaloneKeydb extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
return route('project.database.configuration', [
|
return route('project.database.configuration', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'database_uuid' => data_get($this, 'uuid'),
|
'database_uuid' => data_get($this, 'uuid'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class StandaloneMariadb extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
return route('project.database.configuration', [
|
return route('project.database.configuration', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'database_uuid' => data_get($this, 'uuid'),
|
'database_uuid' => data_get($this, 'uuid'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ class StandaloneMongodb extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
return route('project.database.configuration', [
|
return route('project.database.configuration', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'database_uuid' => data_get($this, 'uuid'),
|
'database_uuid' => data_get($this, 'uuid'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ class StandaloneMysql extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
return route('project.database.configuration', [
|
return route('project.database.configuration', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'database_uuid' => data_get($this, 'uuid'),
|
'database_uuid' => data_get($this, 'uuid'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class StandalonePostgresql extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
return route('project.database.configuration', [
|
return route('project.database.configuration', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'database_uuid' => data_get($this, 'uuid'),
|
'database_uuid' => data_get($this, 'uuid'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class StandaloneRedis extends BaseModel
|
|||||||
if (data_get($this, 'environment.project.uuid')) {
|
if (data_get($this, 'environment.project.uuid')) {
|
||||||
return route('project.database.configuration', [
|
return route('project.database.configuration', [
|
||||||
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
'project_uuid' => data_get($this, 'environment.project.uuid'),
|
||||||
'environment_name' => data_get($this, 'environment.name'),
|
'environment_uuid' => data_get($this, 'environment.uuid'),
|
||||||
'database_uuid' => data_get($this, 'uuid'),
|
'database_uuid' => data_get($this, 'uuid'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ class DeploymentFailed extends CustomEmailNotification
|
|||||||
|
|
||||||
public string $project_uuid;
|
public string $project_uuid;
|
||||||
|
|
||||||
|
public string $environment_uuid;
|
||||||
|
|
||||||
public string $environment_name;
|
public string $environment_name;
|
||||||
|
|
||||||
public ?string $deployment_url = null;
|
public ?string $deployment_url = null;
|
||||||
@@ -36,12 +38,13 @@ class DeploymentFailed extends CustomEmailNotification
|
|||||||
$this->preview = $preview;
|
$this->preview = $preview;
|
||||||
$this->application_name = data_get($application, 'name');
|
$this->application_name = data_get($application, 'name');
|
||||||
$this->project_uuid = data_get($application, 'environment.project.uuid');
|
$this->project_uuid = data_get($application, 'environment.project.uuid');
|
||||||
|
$this->environment_uuid = data_get($application, 'environment.uuid');
|
||||||
$this->environment_name = data_get($application, 'environment.name');
|
$this->environment_name = data_get($application, 'environment.name');
|
||||||
$this->fqdn = data_get($application, 'fqdn');
|
$this->fqdn = data_get($application, 'fqdn');
|
||||||
if (str($this->fqdn)->explode(',')->count() > 1) {
|
if (str($this->fqdn)->explode(',')->count() > 1) {
|
||||||
$this->fqdn = str($this->fqdn)->explode(',')->first();
|
$this->fqdn = str($this->fqdn)->explode(',')->first();
|
||||||
}
|
}
|
||||||
$this->deployment_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
|
$this->deployment_url = base_url()."/project/{$this->project_uuid}/environments/{$this->environment_uuid}/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function via(object $notifiable): array
|
public function via(object $notifiable): array
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ class DeploymentSuccess extends CustomEmailNotification
|
|||||||
|
|
||||||
public string $project_uuid;
|
public string $project_uuid;
|
||||||
|
|
||||||
|
public string $environment_uuid;
|
||||||
|
|
||||||
public string $environment_name;
|
public string $environment_name;
|
||||||
|
|
||||||
public ?string $deployment_url = null;
|
public ?string $deployment_url = null;
|
||||||
@@ -36,12 +38,13 @@ class DeploymentSuccess extends CustomEmailNotification
|
|||||||
$this->preview = $preview;
|
$this->preview = $preview;
|
||||||
$this->application_name = data_get($application, 'name');
|
$this->application_name = data_get($application, 'name');
|
||||||
$this->project_uuid = data_get($application, 'environment.project.uuid');
|
$this->project_uuid = data_get($application, 'environment.project.uuid');
|
||||||
|
$this->environment_uuid = data_get($application, 'environment.uuid');
|
||||||
$this->environment_name = data_get($application, 'environment.name');
|
$this->environment_name = data_get($application, 'environment.name');
|
||||||
$this->fqdn = data_get($application, 'fqdn');
|
$this->fqdn = data_get($application, 'fqdn');
|
||||||
if (str($this->fqdn)->explode(',')->count() > 1) {
|
if (str($this->fqdn)->explode(',')->count() > 1) {
|
||||||
$this->fqdn = str($this->fqdn)->explode(',')->first();
|
$this->fqdn = str($this->fqdn)->explode(',')->first();
|
||||||
}
|
}
|
||||||
$this->deployment_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
|
$this->deployment_url = base_url()."/project/{$this->project_uuid}/environments/{$this->environment_uuid}/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function via(object $notifiable): array
|
public function via(object $notifiable): array
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ class StatusChanged extends CustomEmailNotification
|
|||||||
|
|
||||||
public string $project_uuid;
|
public string $project_uuid;
|
||||||
|
|
||||||
|
public string $environment_uuid;
|
||||||
|
|
||||||
public string $environment_name;
|
public string $environment_name;
|
||||||
|
|
||||||
public ?string $resource_url = null;
|
public ?string $resource_url = null;
|
||||||
@@ -26,12 +28,13 @@ class StatusChanged extends CustomEmailNotification
|
|||||||
$this->onQueue('high');
|
$this->onQueue('high');
|
||||||
$this->resource_name = data_get($resource, 'name');
|
$this->resource_name = data_get($resource, 'name');
|
||||||
$this->project_uuid = data_get($resource, 'environment.project.uuid');
|
$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->environment_name = data_get($resource, 'environment.name');
|
||||||
$this->fqdn = data_get($resource, 'fqdn', null);
|
$this->fqdn = data_get($resource, 'fqdn', null);
|
||||||
if (str($this->fqdn)->explode(',')->count() > 1) {
|
if (str($this->fqdn)->explode(',')->count() > 1) {
|
||||||
$this->fqdn = str($this->fqdn)->explode(',')->first();
|
$this->fqdn = str($this->fqdn)->explode(',')->first();
|
||||||
}
|
}
|
||||||
$this->resource_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->resource->uuid}";
|
$this->resource_url = base_url()."/project/{$this->project_uuid}/environments/{$this->environment_uuid}/application/{$this->resource->uuid}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function via(object $notifiable): array
|
public function via(object $notifiable): array
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ function removeUnnecessaryFieldsFromRequest(Request $request)
|
|||||||
{
|
{
|
||||||
$request->offsetUnset('project_uuid');
|
$request->offsetUnset('project_uuid');
|
||||||
$request->offsetUnset('environment_name');
|
$request->offsetUnset('environment_name');
|
||||||
|
$request->offsetUnset('environment_uuid');
|
||||||
$request->offsetUnset('destination_uuid');
|
$request->offsetUnset('destination_uuid');
|
||||||
$request->offsetUnset('server_uuid');
|
$request->offsetUnset('server_uuid');
|
||||||
$request->offsetUnset('type');
|
$request->offsetUnset('type');
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Visus\Cuid2\Cuid2;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('environments', function (Blueprint $table) {
|
||||||
|
$table->string('uuid')->after('id')->nullable()->unique();
|
||||||
|
});
|
||||||
|
|
||||||
|
DB::table('environments')
|
||||||
|
->whereNull('uuid')
|
||||||
|
->chunkById(100, function ($environments) {
|
||||||
|
foreach ($environments as $environment) {
|
||||||
|
DB::table('environments')
|
||||||
|
->where('id', $environment->id)
|
||||||
|
->update(['uuid' => (string) new Cuid2]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::table('environments', function (Blueprint $table) {
|
||||||
|
$table->string('uuid')->nullable(false)->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('environments', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('uuid');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
300
openapi.json
300
openapi.json
@@ -65,6 +65,7 @@
|
|||||||
"project_uuid",
|
"project_uuid",
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"environment_name",
|
"environment_name",
|
||||||
|
"environment_uuid",
|
||||||
"git_repository",
|
"git_repository",
|
||||||
"git_branch",
|
"git_branch",
|
||||||
"build_pack",
|
"build_pack",
|
||||||
@@ -81,7 +82,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"git_repository": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -377,6 +382,7 @@
|
|||||||
"project_uuid",
|
"project_uuid",
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"environment_name",
|
"environment_name",
|
||||||
|
"environment_uuid",
|
||||||
"github_app_uuid",
|
"github_app_uuid",
|
||||||
"git_repository",
|
"git_repository",
|
||||||
"git_branch",
|
"git_branch",
|
||||||
@@ -394,7 +400,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"github_app_uuid": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -694,6 +704,7 @@
|
|||||||
"project_uuid",
|
"project_uuid",
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"environment_name",
|
"environment_name",
|
||||||
|
"environment_uuid",
|
||||||
"private_key_uuid",
|
"private_key_uuid",
|
||||||
"git_repository",
|
"git_repository",
|
||||||
"git_branch",
|
"git_branch",
|
||||||
@@ -711,7 +722,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"private_key_uuid": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -1011,6 +1026,7 @@
|
|||||||
"project_uuid",
|
"project_uuid",
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"environment_name",
|
"environment_name",
|
||||||
|
"environment_uuid",
|
||||||
"dockerfile"
|
"dockerfile"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -1024,7 +1040,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"dockerfile": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -1257,6 +1277,7 @@
|
|||||||
"project_uuid",
|
"project_uuid",
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"environment_name",
|
"environment_name",
|
||||||
|
"environment_uuid",
|
||||||
"docker_registry_image_name",
|
"docker_registry_image_name",
|
||||||
"ports_exposes"
|
"ports_exposes"
|
||||||
],
|
],
|
||||||
@@ -1271,7 +1292,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"docker_registry_image_name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -1486,6 +1511,7 @@
|
|||||||
"project_uuid",
|
"project_uuid",
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"environment_name",
|
"environment_name",
|
||||||
|
"environment_uuid",
|
||||||
"docker_compose_raw"
|
"docker_compose_raw"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -1499,7 +1525,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"docker_compose_raw": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -3079,7 +3109,8 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"project_uuid",
|
"project_uuid",
|
||||||
"environment_name"
|
"environment_name",
|
||||||
|
"environment_uuid"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"server_uuid": {
|
"server_uuid": {
|
||||||
@@ -3092,7 +3123,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"postgres_user": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -3215,7 +3250,8 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"project_uuid",
|
"project_uuid",
|
||||||
"environment_name"
|
"environment_name",
|
||||||
|
"environment_uuid"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"server_uuid": {
|
"server_uuid": {
|
||||||
@@ -3228,7 +3264,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"destination_uuid": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -3335,7 +3375,8 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"project_uuid",
|
"project_uuid",
|
||||||
"environment_name"
|
"environment_name",
|
||||||
|
"environment_uuid"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"server_uuid": {
|
"server_uuid": {
|
||||||
@@ -3348,7 +3389,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"destination_uuid": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -3451,7 +3496,8 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"project_uuid",
|
"project_uuid",
|
||||||
"environment_name"
|
"environment_name",
|
||||||
|
"environment_uuid"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"server_uuid": {
|
"server_uuid": {
|
||||||
@@ -3464,7 +3510,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"destination_uuid": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -3571,7 +3621,8 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"project_uuid",
|
"project_uuid",
|
||||||
"environment_name"
|
"environment_name",
|
||||||
|
"environment_uuid"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"server_uuid": {
|
"server_uuid": {
|
||||||
@@ -3584,7 +3635,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"destination_uuid": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -3691,7 +3746,8 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"project_uuid",
|
"project_uuid",
|
||||||
"environment_name"
|
"environment_name",
|
||||||
|
"environment_uuid"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"server_uuid": {
|
"server_uuid": {
|
||||||
@@ -3704,7 +3760,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"destination_uuid": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -3823,7 +3883,8 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"project_uuid",
|
"project_uuid",
|
||||||
"environment_name"
|
"environment_name",
|
||||||
|
"environment_uuid"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"server_uuid": {
|
"server_uuid": {
|
||||||
@@ -3836,7 +3897,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"destination_uuid": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -3955,7 +4020,8 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"server_uuid",
|
"server_uuid",
|
||||||
"project_uuid",
|
"project_uuid",
|
||||||
"environment_name"
|
"environment_name",
|
||||||
|
"environment_uuid"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"server_uuid": {
|
"server_uuid": {
|
||||||
@@ -3968,7 +4034,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"destination_uuid": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -4808,14 +4878,14 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"\/projects\/{uuid}\/{environment_name}": {
|
"\/projects\/{uuid}\/{environment_name_or_uuid}": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"Projects"
|
"Projects"
|
||||||
],
|
],
|
||||||
"summary": "Environment",
|
"summary": "Environment",
|
||||||
"description": "Get environment by name.",
|
"description": "Get environment by name or UUID.",
|
||||||
"operationId": "get-environment-by-name",
|
"operationId": "get-environment-by-name-or-uuid",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"name": "uuid",
|
"name": "uuid",
|
||||||
@@ -4827,9 +4897,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "environment_name",
|
"name": "environment_name_or_uuid",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"description": "Environment name",
|
"description": "Environment name or UUID",
|
||||||
"required": true,
|
"required": true,
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -5724,6 +5794,7 @@
|
|||||||
"server_uuid",
|
"server_uuid",
|
||||||
"project_uuid",
|
"project_uuid",
|
||||||
"environment_name",
|
"environment_name",
|
||||||
|
"environment_uuid",
|
||||||
"type"
|
"type"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -5835,7 +5906,11 @@
|
|||||||
},
|
},
|
||||||
"environment_name": {
|
"environment_name": {
|
||||||
"type": "string",
|
"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": {
|
"server_uuid": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -7282,13 +7357,10 @@
|
|||||||
"uuid": {
|
"uuid": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"application_id": {
|
"resourceable_type": {
|
||||||
"type": "integer"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"service_id": {
|
"resourceable_id": {
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"database_id": {
|
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"is_build_time": {
|
"is_build_time": {
|
||||||
@@ -7684,174 +7756,14 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The date and time the team was last updated."
|
"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": {
|
"show_boarding": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Whether to show the boarding screen or not."
|
"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": {
|
"custom_server_limit": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The custom server limit."
|
"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": {
|
"members": {
|
||||||
"description": "The members of the team.",
|
"description": "The members of the team.",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
|||||||
228
openapi.yaml
228
openapi.yaml
@@ -47,6 +47,7 @@ paths:
|
|||||||
- project_uuid
|
- project_uuid
|
||||||
- server_uuid
|
- server_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
- git_repository
|
- git_repository
|
||||||
- git_branch
|
- git_branch
|
||||||
- build_pack
|
- build_pack
|
||||||
@@ -60,7 +61,10 @@ paths:
|
|||||||
description: 'The server UUID.'
|
description: 'The server UUID.'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
git_repository:
|
||||||
type: string
|
type: string
|
||||||
description: 'The git repository URL.'
|
description: 'The git repository URL.'
|
||||||
@@ -272,6 +276,7 @@ paths:
|
|||||||
- project_uuid
|
- project_uuid
|
||||||
- server_uuid
|
- server_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
- github_app_uuid
|
- github_app_uuid
|
||||||
- git_repository
|
- git_repository
|
||||||
- git_branch
|
- git_branch
|
||||||
@@ -286,7 +291,10 @@ paths:
|
|||||||
description: 'The server UUID.'
|
description: 'The server UUID.'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
github_app_uuid:
|
||||||
type: string
|
type: string
|
||||||
description: 'The Github App UUID.'
|
description: 'The Github App UUID.'
|
||||||
@@ -501,6 +509,7 @@ paths:
|
|||||||
- project_uuid
|
- project_uuid
|
||||||
- server_uuid
|
- server_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
- private_key_uuid
|
- private_key_uuid
|
||||||
- git_repository
|
- git_repository
|
||||||
- git_branch
|
- git_branch
|
||||||
@@ -515,7 +524,10 @@ paths:
|
|||||||
description: 'The server UUID.'
|
description: 'The server UUID.'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
private_key_uuid:
|
||||||
type: string
|
type: string
|
||||||
description: 'The private key UUID.'
|
description: 'The private key UUID.'
|
||||||
@@ -730,6 +742,7 @@ paths:
|
|||||||
- project_uuid
|
- project_uuid
|
||||||
- server_uuid
|
- server_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
- dockerfile
|
- dockerfile
|
||||||
properties:
|
properties:
|
||||||
project_uuid:
|
project_uuid:
|
||||||
@@ -740,7 +753,10 @@ paths:
|
|||||||
description: 'The server UUID.'
|
description: 'The server UUID.'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
dockerfile:
|
||||||
type: string
|
type: string
|
||||||
description: 'The Dockerfile content.'
|
description: 'The Dockerfile content.'
|
||||||
@@ -906,6 +922,7 @@ paths:
|
|||||||
- project_uuid
|
- project_uuid
|
||||||
- server_uuid
|
- server_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
- docker_registry_image_name
|
- docker_registry_image_name
|
||||||
- ports_exposes
|
- ports_exposes
|
||||||
properties:
|
properties:
|
||||||
@@ -917,7 +934,10 @@ paths:
|
|||||||
description: 'The server UUID.'
|
description: 'The server UUID.'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
docker_registry_image_name:
|
||||||
type: string
|
type: string
|
||||||
description: 'The docker registry image name.'
|
description: 'The docker registry image name.'
|
||||||
@@ -1073,6 +1093,7 @@ paths:
|
|||||||
- project_uuid
|
- project_uuid
|
||||||
- server_uuid
|
- server_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
- docker_compose_raw
|
- docker_compose_raw
|
||||||
properties:
|
properties:
|
||||||
project_uuid:
|
project_uuid:
|
||||||
@@ -1083,7 +1104,10 @@ paths:
|
|||||||
description: 'The server UUID.'
|
description: 'The server UUID.'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
docker_compose_raw:
|
||||||
type: string
|
type: string
|
||||||
description: 'The Docker Compose raw content.'
|
description: 'The Docker Compose raw content.'
|
||||||
@@ -2137,6 +2161,7 @@ paths:
|
|||||||
- server_uuid
|
- server_uuid
|
||||||
- project_uuid
|
- project_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
properties:
|
properties:
|
||||||
server_uuid:
|
server_uuid:
|
||||||
type: string
|
type: string
|
||||||
@@ -2146,7 +2171,10 @@ paths:
|
|||||||
description: 'UUID of the project'
|
description: 'UUID of the project'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
postgres_user:
|
||||||
type: string
|
type: string
|
||||||
description: 'PostgreSQL user'
|
description: 'PostgreSQL user'
|
||||||
@@ -2235,6 +2263,7 @@ paths:
|
|||||||
- server_uuid
|
- server_uuid
|
||||||
- project_uuid
|
- project_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
properties:
|
properties:
|
||||||
server_uuid:
|
server_uuid:
|
||||||
type: string
|
type: string
|
||||||
@@ -2244,7 +2273,10 @@ paths:
|
|||||||
description: 'UUID of the project'
|
description: 'UUID of the project'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
destination_uuid:
|
||||||
type: string
|
type: string
|
||||||
description: 'UUID of the destination if the server has multiple destinations'
|
description: 'UUID of the destination if the server has multiple destinations'
|
||||||
@@ -2321,6 +2353,7 @@ paths:
|
|||||||
- server_uuid
|
- server_uuid
|
||||||
- project_uuid
|
- project_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
properties:
|
properties:
|
||||||
server_uuid:
|
server_uuid:
|
||||||
type: string
|
type: string
|
||||||
@@ -2330,7 +2363,10 @@ paths:
|
|||||||
description: 'UUID of the project'
|
description: 'UUID of the project'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
destination_uuid:
|
||||||
type: string
|
type: string
|
||||||
description: 'UUID of the destination if the server has multiple destinations'
|
description: 'UUID of the destination if the server has multiple destinations'
|
||||||
@@ -2404,6 +2440,7 @@ paths:
|
|||||||
- server_uuid
|
- server_uuid
|
||||||
- project_uuid
|
- project_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
properties:
|
properties:
|
||||||
server_uuid:
|
server_uuid:
|
||||||
type: string
|
type: string
|
||||||
@@ -2413,7 +2450,10 @@ paths:
|
|||||||
description: 'UUID of the project'
|
description: 'UUID of the project'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
destination_uuid:
|
||||||
type: string
|
type: string
|
||||||
description: 'UUID of the destination if the server has multiple destinations'
|
description: 'UUID of the destination if the server has multiple destinations'
|
||||||
@@ -2490,6 +2530,7 @@ paths:
|
|||||||
- server_uuid
|
- server_uuid
|
||||||
- project_uuid
|
- project_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
properties:
|
properties:
|
||||||
server_uuid:
|
server_uuid:
|
||||||
type: string
|
type: string
|
||||||
@@ -2499,7 +2540,10 @@ paths:
|
|||||||
description: 'UUID of the project'
|
description: 'UUID of the project'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
destination_uuid:
|
||||||
type: string
|
type: string
|
||||||
description: 'UUID of the destination if the server has multiple destinations'
|
description: 'UUID of the destination if the server has multiple destinations'
|
||||||
@@ -2576,6 +2620,7 @@ paths:
|
|||||||
- server_uuid
|
- server_uuid
|
||||||
- project_uuid
|
- project_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
properties:
|
properties:
|
||||||
server_uuid:
|
server_uuid:
|
||||||
type: string
|
type: string
|
||||||
@@ -2585,7 +2630,10 @@ paths:
|
|||||||
description: 'UUID of the project'
|
description: 'UUID of the project'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
destination_uuid:
|
||||||
type: string
|
type: string
|
||||||
description: 'UUID of the destination if the server has multiple destinations'
|
description: 'UUID of the destination if the server has multiple destinations'
|
||||||
@@ -2671,6 +2719,7 @@ paths:
|
|||||||
- server_uuid
|
- server_uuid
|
||||||
- project_uuid
|
- project_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
properties:
|
properties:
|
||||||
server_uuid:
|
server_uuid:
|
||||||
type: string
|
type: string
|
||||||
@@ -2680,7 +2729,10 @@ paths:
|
|||||||
description: 'UUID of the project'
|
description: 'UUID of the project'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
destination_uuid:
|
||||||
type: string
|
type: string
|
||||||
description: 'UUID of the destination if the server has multiple destinations'
|
description: 'UUID of the destination if the server has multiple destinations'
|
||||||
@@ -2766,6 +2818,7 @@ paths:
|
|||||||
- server_uuid
|
- server_uuid
|
||||||
- project_uuid
|
- project_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
properties:
|
properties:
|
||||||
server_uuid:
|
server_uuid:
|
||||||
type: string
|
type: string
|
||||||
@@ -2775,7 +2828,10 @@ paths:
|
|||||||
description: 'UUID of the project'
|
description: 'UUID of the project'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
destination_uuid:
|
||||||
type: string
|
type: string
|
||||||
description: 'UUID of the destination if the server has multiple destinations'
|
description: 'UUID of the destination if the server has multiple destinations'
|
||||||
@@ -3293,13 +3349,13 @@ paths:
|
|||||||
security:
|
security:
|
||||||
-
|
-
|
||||||
bearerAuth: []
|
bearerAuth: []
|
||||||
'/projects/{uuid}/{environment_name}':
|
'/projects/{uuid}/{environment_name_or_uuid}':
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- Projects
|
- Projects
|
||||||
summary: Environment
|
summary: Environment
|
||||||
description: 'Get environment by name.'
|
description: 'Get environment by name or UUID.'
|
||||||
operationId: get-environment-by-name
|
operationId: get-environment-by-name-or-uuid
|
||||||
parameters:
|
parameters:
|
||||||
-
|
-
|
||||||
name: uuid
|
name: uuid
|
||||||
@@ -3309,9 +3365,9 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
-
|
-
|
||||||
name: environment_name
|
name: environment_name_or_uuid
|
||||||
in: path
|
in: path
|
||||||
description: 'Environment name'
|
description: 'Environment name or UUID'
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
@@ -3872,6 +3928,7 @@ paths:
|
|||||||
- server_uuid
|
- server_uuid
|
||||||
- project_uuid
|
- project_uuid
|
||||||
- environment_name
|
- environment_name
|
||||||
|
- environment_uuid
|
||||||
- type
|
- type
|
||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
@@ -3891,7 +3948,10 @@ paths:
|
|||||||
description: 'Project UUID.'
|
description: 'Project UUID.'
|
||||||
environment_name:
|
environment_name:
|
||||||
type: string
|
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:
|
server_uuid:
|
||||||
type: string
|
type: string
|
||||||
description: 'Server UUID.'
|
description: 'Server UUID.'
|
||||||
@@ -4856,11 +4916,9 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
uuid:
|
uuid:
|
||||||
type: string
|
type: string
|
||||||
application_id:
|
resourceable_type:
|
||||||
type: integer
|
type: string
|
||||||
service_id:
|
resourceable_id:
|
||||||
type: integer
|
|
||||||
database_id:
|
|
||||||
type: integer
|
type: integer
|
||||||
is_build_time:
|
is_build_time:
|
||||||
type: boolean
|
type: boolean
|
||||||
@@ -5139,132 +5197,12 @@ components:
|
|||||||
updated_at:
|
updated_at:
|
||||||
type: string
|
type: string
|
||||||
description: 'The date and time the team was last updated.'
|
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:
|
show_boarding:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: 'Whether to show the boarding screen or not.'
|
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:
|
custom_server_limit:
|
||||||
type: string
|
type: string
|
||||||
description: 'The custom server limit.'
|
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:
|
members:
|
||||||
description: 'The members of the team.'
|
description: 'The members of the team.'
|
||||||
type: array
|
type: array
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
@apply h-full bg-neutral-50 text-neutral-800 dark:bg-base dark:text-neutral-400 w-full;
|
@apply min-h-full bg-neutral-50 dark:bg-base dark:text-neutral-400 w-full;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@apply text-sm antialiased scrollbar;
|
@apply text-sm antialiased scrollbar min-h-screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
.apexcharts-tooltip {
|
.apexcharts-tooltip {
|
||||||
|
|||||||
@@ -21,7 +21,10 @@
|
|||||||
<li>
|
<li>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<a class="text-xs truncate lg:text-sm"
|
<a class="text-xs truncate lg:text-sm"
|
||||||
href="{{ route('project.resource.index', ['environment_name' => data_get($resource, 'environment.name'), '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"
|
<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">
|
viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path fill-rule="evenodd"
|
<path fill-rule="evenodd"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<div class="grid grid-cols-1 gap-2 xl:grid-cols-2">
|
<div class="grid grid-cols-1 gap-2 xl:grid-cols-2">
|
||||||
@foreach ($projects as $project)
|
@foreach ($projects as $project)
|
||||||
<div class="gap-2 border border-transparent cursor-pointer box group"
|
<div class="gap-2 border border-transparent cursor-pointer box group"
|
||||||
onclick="gotoProject('{{ $project->uuid }}','{{ $project->default_environment }}')">
|
wire:click="navigateToProject('{{ $project->uuid }}')">
|
||||||
<div class="flex flex-1 mx-6">
|
<div class="flex flex-1 mx-6">
|
||||||
<div class="flex flex-col justify-center flex-1">
|
<div class="flex flex-col justify-center flex-1">
|
||||||
<div class="box-title">{{ $project->name }}</div>
|
<div class="box-title">{{ $project->name }}</div>
|
||||||
@@ -34,10 +34,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-center gap-2 text-xs font-bold">
|
<div class="flex items-center justify-center gap-2 text-xs font-bold">
|
||||||
|
@if ($project->environments->first())
|
||||||
<a class="hover:underline"
|
<a class="hover:underline"
|
||||||
href="{{ route('project.resource.create', ['project_uuid' => $project->uuid, 'environment_name' => data_get($project, 'default_environment', 'production')]) }}">
|
href="{{ route('project.resource.create', [
|
||||||
|
'project_uuid' => $project->uuid,
|
||||||
|
'environment_uuid' => $project->environments->first()->uuid,
|
||||||
|
]) }}">
|
||||||
<span class="p-2 font-bold">+ Add Resource</span>
|
<span class="p-2 font-bold">+ Add Resource</span>
|
||||||
</a>
|
</a>
|
||||||
|
@endif
|
||||||
<a class="hover:underline"
|
<a class="hover:underline"
|
||||||
href="{{ route('project.edit', ['project_uuid' => $project->uuid]) }}">
|
href="{{ route('project.edit', ['project_uuid' => $project->uuid]) }}">
|
||||||
Settings
|
Settings
|
||||||
@@ -167,15 +172,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function gotoProject(uuid, environment) {
|
|
||||||
if (environment) {
|
|
||||||
window.location.href = '/project/' + uuid + '/' + environment;
|
|
||||||
} else {
|
|
||||||
window.location.href = '/project/' + uuid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,31 +9,31 @@
|
|||||||
<div class="flex flex-col h-full gap-8 pt-6 sm:flex-row">
|
<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">
|
<div class="flex flex-col items-start gap-2 min-w-fit">
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>General</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Advanced</a>
|
||||||
@if ($application->destination->server->isSwarm())
|
@if ($application->destination->server->isSwarm())
|
||||||
<a class="menu-item"
|
<a class="menu-item"
|
||||||
wire:current.exact="menu-item-active
|
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
|
wire:navigate>Swarm
|
||||||
Configuration</a>
|
Configuration</a>
|
||||||
@endif
|
@endif
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Environment Variables</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Persistent Storage</a>
|
||||||
@if ($application->git_based())
|
@if ($application->git_based())
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Git Source</a>
|
||||||
@endif
|
@endif
|
||||||
<a class="menu-item flex items-center gap-2" wire:current.exact="menu-item-active"
|
<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
|
wire:navigate>Servers
|
||||||
@if (str($application->status)->contains('degraded'))
|
@if (str($application->status)->contains('degraded'))
|
||||||
<span title="Some servers are unavailable">
|
<span title="Some servers are unavailable">
|
||||||
@@ -53,35 +53,35 @@
|
|||||||
@endif
|
@endif
|
||||||
</a>
|
</a>
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Scheduled Tasks</a>
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Webhooks</a>
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Preview Deployments</a>
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Healthcheck</a>
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Rollback</a>
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Resource Limits</a>
|
||||||
|
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Resource Operations</a>
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Metrics</a>
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Tags</a>
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Danger Zone</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
|
|||||||
@@ -8,38 +8,37 @@
|
|||||||
<div class="flex flex-col h-full gap-8 pt-6 sm:flex-row">
|
<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">
|
<div class="flex flex-col items-start gap-2 min-w-fit">
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>General</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Environment Variables</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Servers</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Persistent Storage</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Import Backups</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Webhooks</a>
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Resource Limits</a>
|
||||||
|
|
||||||
<a class="menu-item" wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Resource Operations</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Metrics</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Tags</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Danger Zone</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<a class="text-xs truncate lg:text-sm"
|
<a class="text-xs truncate lg:text-sm"
|
||||||
href="{{ route('project.resource.index', ['environment_name' => $environment->name, 'project_uuid' => $project->uuid]) }}">
|
href="{{ route('project.resource.index', ['environment_uuid' => $environment->uuid, 'project_uuid' => $project->uuid]) }}">
|
||||||
{{ $environment->name }}
|
{{ $environment->name }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,21 +12,21 @@
|
|||||||
<div x-data="searchComponent()">
|
<div x-data="searchComponent()">
|
||||||
<x-forms.input placeholder="Search for name, description..." x-model="search" id="null" />
|
<x-forms.input placeholder="Search for name, description..." x-model="search" id="null" />
|
||||||
<div class="grid grid-cols-2 gap-4 pt-4">
|
<div class="grid grid-cols-2 gap-4 pt-4">
|
||||||
<template x-if="allFilteredItems.length === 0">
|
<template x-if="filteredProjects.length === 0">
|
||||||
<div>No project found with the search term "<span x-text="search"></span>".</div>
|
<div>No project found with the search term "<span x-text="search"></span>".</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template x-for="item in allFilteredItems" :key="item.uuid">
|
<template x-for="project in filteredProjects" :key="project.uuid">
|
||||||
<div class="box group" @click="gotoProject(item)">
|
<div class="box group cursor-pointer" @click="$wire.navigateToProject(project.uuid)">
|
||||||
<div class="flex flex-col justify-center flex-1 mx-6">
|
<div class="flex flex-col justify-center flex-1 mx-6">
|
||||||
<div class="box-title" x-text="item.name"></div>
|
<div class="box-title" x-text="project.name"></div>
|
||||||
<div class="box-description">
|
<div class="box-description">
|
||||||
<div x-text="item.description"></div>
|
<div x-text="project.description"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-center gap-2 pt-4 pb-2 mr-4 text-xs lg:py-0 lg:justify-normal">
|
<div class="flex items-center justify-center gap-2 pt-4 pb-2 mr-4 text-xs lg:py-0 lg:justify-normal">
|
||||||
<a class="mx-4 font-bold hover:underline"
|
<a class="mx-4 font-bold hover:underline"
|
||||||
:href="item.settingsRoute">
|
:href="project.settingsRoute">
|
||||||
Settings
|
Settings
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -36,38 +36,21 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function sortFn(a, b) {
|
|
||||||
return a.name.localeCompare(b.name)
|
|
||||||
}
|
|
||||||
|
|
||||||
function searchComponent() {
|
function searchComponent() {
|
||||||
return {
|
return {
|
||||||
search: '',
|
search: '',
|
||||||
projects: @js($projects),
|
get filteredProjects() {
|
||||||
filterAndSort(items) {
|
const projects = @js($projects);
|
||||||
if (this.search === '') {
|
if (this.search === '') {
|
||||||
return Object.values(items).sort(sortFn);
|
return projects;
|
||||||
}
|
}
|
||||||
const searchLower = this.search.toLowerCase();
|
const searchLower = this.search.toLowerCase();
|
||||||
return Object.values(items).filter(item => {
|
return projects.filter(project => {
|
||||||
return (item.name?.toLowerCase().includes(searchLower) ||
|
return (project.name?.toLowerCase().includes(searchLower) ||
|
||||||
item.description?.toLowerCase().includes(searchLower))
|
project.description?.toLowerCase().includes(searchLower))
|
||||||
}).sort(sortFn);
|
});
|
||||||
},
|
|
||||||
get allFilteredItems() {
|
|
||||||
return [
|
|
||||||
this.projects,
|
|
||||||
].flatMap((items) => this.filterAndSort(items));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function gotoProject(item) {
|
|
||||||
if (item.default_environment) {
|
|
||||||
window.location.href = '/project/' + item.uuid + '/' + item.default_environment;
|
|
||||||
} else {
|
|
||||||
window.location.href = '/project/' + item.uuid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<x-forms.select wire:model.live="selectedEnvironment">
|
<x-forms.select wire:model.live="selectedEnvironment">
|
||||||
<option value="edit">Create / Edit</option>
|
|
||||||
<option disabled>-----</option>
|
|
||||||
@foreach ($environments as $environment)
|
@foreach ($environments as $environment)
|
||||||
<option value="{{ $environment->name }}">{{ $environment->name }}
|
<option value="{{ $environment->uuid }}">{{ $environment->name }}</option>
|
||||||
</option>
|
|
||||||
@endforeach
|
@endforeach
|
||||||
|
<option disabled>-----</option>
|
||||||
|
<option value="edit">Create / Edit</option>
|
||||||
</x-forms.select>
|
</x-forms.select>
|
||||||
|
|||||||
@@ -7,15 +7,15 @@
|
|||||||
<h1>Resources</h1>
|
<h1>Resources</h1>
|
||||||
@if ($environment->isEmpty())
|
@if ($environment->isEmpty())
|
||||||
<a class="button"
|
<a class="button"
|
||||||
href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => data_get($parameters, 'environment_name')]) }}">
|
href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_uuid' => data_get($environment, 'uuid')]) }}">
|
||||||
Clone
|
Clone
|
||||||
</a>
|
</a>
|
||||||
@else
|
@else
|
||||||
<a href="{{ route('project.resource.create', ['project_uuid' => data_get($parameters, 'project_uuid'), 'environment_name' => data_get($parameters, 'environment_name')]) }} "
|
<a href="{{ route('project.resource.create', ['project_uuid' => data_get($parameters, 'project_uuid'), 'environment_uuid' => data_get($environment, 'uuid')]) }}"
|
||||||
class="button">+
|
class="button">+
|
||||||
New</a>
|
New</a>
|
||||||
<a class="button"
|
<a class="button"
|
||||||
href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => data_get($parameters, 'environment_name')]) }}">
|
href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_uuid' => data_get($environment, 'uuid')]) }}">
|
||||||
Clone
|
Clone
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
@if ($environment->isEmpty())
|
@if ($environment->isEmpty())
|
||||||
<a href="{{ route('project.resource.create', ['project_uuid' => data_get($parameters, 'project_uuid'), 'environment_name' => data_get($parameters, 'environment_name')]) }} "
|
<a href="{{ route('project.resource.create', ['project_uuid' => data_get($parameters, 'project_uuid'), 'environment_uuid' => data_get($environment, 'uuid')]) }}"
|
||||||
class="items-center justify-center box">+ Add New Resource</a>
|
class="items-center justify-center box">+ Add New Resource</a>
|
||||||
@else
|
@else
|
||||||
<div x-data="searchComponent()">
|
<div x-data="searchComponent()">
|
||||||
@@ -211,7 +211,7 @@
|
|||||||
},
|
},
|
||||||
goto(item) {
|
goto(item) {
|
||||||
const hrefLink = item.hrefLink;
|
const hrefLink = item.hrefLink;
|
||||||
window.location.href = `${hrefLink}#tags`;
|
window.location.href = `${hrefLink}/tags`;
|
||||||
},
|
},
|
||||||
filterAndSort(items) {
|
filterAndSort(items) {
|
||||||
if (this.search === '') {
|
if (this.search === '') {
|
||||||
|
|||||||
@@ -9,30 +9,30 @@
|
|||||||
<a class="menu-item sm:min-w-fit" target="_blank" href="{{ $service->documentation() }}">Documentation
|
<a class="menu-item sm:min-w-fit" target="_blank" href="{{ $service->documentation() }}">Documentation
|
||||||
<x-external-link /></a>
|
<x-external-link /></a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>General</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Environment Variables</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Persistent Storages</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Scheduled Tasks</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Webhooks</a>
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Resource Operations</a>
|
||||||
|
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Tags</a>
|
||||||
|
|
||||||
<a class='menu-item' wire:current.exact="menu-item-active"
|
<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>
|
wire:navigate>Danger Zone</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex items-center px-4">
|
<div class="flex items-center px-4">
|
||||||
<a class="mx-4 text-xs font-bold hover:underline"
|
<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
|
Settings
|
||||||
</a>
|
</a>
|
||||||
@if (str($application->status)->contains('running'))
|
@if (str($application->status)->contains('running'))
|
||||||
@@ -143,12 +143,12 @@
|
|||||||
<div class="flex items-center px-4">
|
<div class="flex items-center px-4">
|
||||||
@if ($database->isBackupSolutionAvailable())
|
@if ($database->isBackupSolutionAvailable())
|
||||||
<a class="mx-4 text-xs font-bold hover:underline"
|
<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
|
Backups
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
<a class="mx-4 text-xs font-bold hover:underline"
|
<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
|
Settings
|
||||||
</a>
|
</a>
|
||||||
@if (str($database->status)->contains('running'))
|
@if (str($database->status)->contains('running'))
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
$resource->getMorphClass() == 'App\Models\StandaloneKeydb' ||
|
$resource->getMorphClass() == 'App\Models\StandaloneKeydb' ||
|
||||||
$resource->getMorphClass() == 'App\Models\StandaloneDragonfly' ||
|
$resource->getMorphClass() == 'App\Models\StandaloneDragonfly' ||
|
||||||
$resource->getMorphClass() == 'App\Models\StandaloneClickhouse' ||
|
$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">
|
<div class="flex items-center gap-2">
|
||||||
<h2>Storages</h2>
|
<h2>Storages</h2>
|
||||||
<x-helper
|
<x-helper
|
||||||
|
|||||||
@@ -17,18 +17,18 @@
|
|||||||
<div class="text-xs truncate subtitle lg:text-sm">{{ $project->name }}.</div>
|
<div class="text-xs truncate subtitle lg:text-sm">{{ $project->name }}.</div>
|
||||||
<div class="grid gap-2 lg:grid-cols-2">
|
<div class="grid gap-2 lg:grid-cols-2">
|
||||||
@forelse ($project->environments->sortBy('created_at') as $environment)
|
@forelse ($project->environments->sortBy('created_at') as $environment)
|
||||||
<div class="gap-2 border border-transparent cursor-pointer box group" x-data
|
<div class="gap-2 border border-transparent cursor-pointer box group"
|
||||||
x-on:click="goto('{{ $project->uuid }}','{{ $environment->name }}')">
|
wire:click="navigateToEnvironment('{{ $project->uuid }}', '{{ $environment->uuid }}')">
|
||||||
<div class="flex flex-1 mx-6">
|
<div class="flex flex-1 mx-6">
|
||||||
<a class="flex flex-col justify-center flex-1"
|
<a class="flex flex-col justify-center flex-1"
|
||||||
href="{{ route('project.resource.index', [$project->uuid, $environment->name]) }}">
|
href="{{ route('project.resource.index', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid]) }}">
|
||||||
<div class="font-bold dark:text-white"> {{ $environment->name }}</div>
|
<div class="font-bold dark:text-white"> {{ $environment->name }}</div>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
{{ $environment->description }}</div>
|
{{ $environment->description }}</div>
|
||||||
</a>
|
</a>
|
||||||
<div class="flex items-center justify-center gap-2 text-xs">
|
<div class="flex items-center justify-center gap-2 text-xs">
|
||||||
<a class="font-bold hover:underline"
|
<a class="font-bold hover:underline"
|
||||||
href="{{ route('project.environment.edit', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => $environment->name]) }}">
|
href="{{ route('project.environment.edit', ['project_uuid' => $project->uuid, 'environment_uuid' => $environment->uuid]) }}">
|
||||||
Settings
|
Settings
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -37,10 +37,5 @@
|
|||||||
@empty
|
@empty
|
||||||
<p>No environments found.</p>
|
<p>No environments found.</p>
|
||||||
@endforelse
|
@endforelse
|
||||||
<script>
|
|
||||||
function goto(projectUuid, environmentName) {
|
|
||||||
window.location.href = '/project/' + projectUuid + '/' + environmentName;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,10 @@
|
|||||||
<div class="pt-0 pb-3">{{ data_get($project, 'description') }}</div>
|
<div class="pt-0 pb-3">{{ data_get($project, 'description') }}</div>
|
||||||
@forelse ($project->environments as $environment)
|
@forelse ($project->environments as $environment)
|
||||||
<a class="box group"
|
<a class="box group"
|
||||||
href="{{ route('shared-variables.environment.show', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name]) }}">
|
href="{{ route('shared-variables.environment.show', [
|
||||||
|
'project_uuid' => $project->uuid,
|
||||||
|
'environment_uuid' => $environment->uuid
|
||||||
|
]) }}">
|
||||||
<div class="flex flex-col justify-center flex-1 mx-6 ">
|
<div class="flex flex-col justify-center flex-1 mx-6 ">
|
||||||
<div class="box-title"> {{ $environment->name }}</div>
|
<div class="box-title"> {{ $environment->name }}</div>
|
||||||
<div class="box-description">
|
<div class="box-description">
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ Route::group([
|
|||||||
'middleware' => ['auth:sanctum', ApiAllowed::class, 'api.sensitive'],
|
'middleware' => ['auth:sanctum', ApiAllowed::class, 'api.sensitive'],
|
||||||
'prefix' => 'v1',
|
'prefix' => 'v1',
|
||||||
], function () {
|
], function () {
|
||||||
|
|
||||||
Route::get('/version', [OtherController::class, 'version'])->middleware(['api.ability:read']);
|
Route::get('/version', [OtherController::class, 'version'])->middleware(['api.ability:read']);
|
||||||
|
|
||||||
Route::get('/teams', [TeamController::class, 'teams'])->middleware(['api.ability:read']);
|
Route::get('/teams', [TeamController::class, 'teams'])->middleware(['api.ability:read']);
|
||||||
@@ -39,7 +40,7 @@ Route::group([
|
|||||||
|
|
||||||
Route::get('/projects', [ProjectController::class, 'projects'])->middleware(['api.ability:read']);
|
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}', [ProjectController::class, 'project_by_uuid'])->middleware(['api.ability:read']);
|
||||||
Route::get('/projects/{uuid}/{environment_name}', [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::post('/projects', [ProjectController::class, 'create_project'])->middleware(['api.ability:read']);
|
||||||
Route::patch('/projects/{uuid}', [ProjectController::class, 'update_project'])->middleware(['api.ability:write']);
|
Route::patch('/projects/{uuid}', [ProjectController::class, 'update_project'])->middleware(['api.ability:write']);
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ Route::middleware(['auth', 'verified'])->group(function () {
|
|||||||
Route::get('/projects', ProjectSharedVariablesIndex::class)->name('shared-variables.project.index');
|
Route::get('/projects', ProjectSharedVariablesIndex::class)->name('shared-variables.project.index');
|
||||||
Route::get('/project/{project_uuid}', ProjectSharedVariablesShow::class)->name('shared-variables.project.show');
|
Route::get('/project/{project_uuid}', ProjectSharedVariablesShow::class)->name('shared-variables.project.show');
|
||||||
Route::get('/environments', EnvironmentSharedVariablesIndex::class)->name('shared-variables.environment.index');
|
Route::get('/environments', EnvironmentSharedVariablesIndex::class)->name('shared-variables.environment.index');
|
||||||
Route::get('/environment/{project_uuid}/{environment_name}', EnvironmentSharedVariablesShow::class)->name('shared-variables.environment.show');
|
Route::get('/environments/project/{project_uuid}/environment/{environment_uuid}', EnvironmentSharedVariablesShow::class)->name('shared-variables.environment.show');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::prefix('team')->group(function () {
|
Route::prefix('team')->group(function () {
|
||||||
@@ -175,13 +175,13 @@ Route::middleware(['auth', 'verified'])->group(function () {
|
|||||||
Route::get('/', ProjectShow::class)->name('project.show');
|
Route::get('/', ProjectShow::class)->name('project.show');
|
||||||
Route::get('/edit', ProjectEdit::class)->name('project.edit');
|
Route::get('/edit', ProjectEdit::class)->name('project.edit');
|
||||||
});
|
});
|
||||||
Route::prefix('project/{project_uuid}/{environment_name}')->group(function () {
|
Route::prefix('project/{project_uuid}/environment/{environment_uuid}')->group(function () {
|
||||||
Route::get('/', ResourceIndex::class)->name('project.resource.index');
|
Route::get('/', ResourceIndex::class)->name('project.resource.index');
|
||||||
Route::get('/clone', ProjectCloneMe::class)->name('project.clone-me');
|
Route::get('/clone', ProjectCloneMe::class)->name('project.clone-me');
|
||||||
Route::get('/new', ResourceCreate::class)->name('project.resource.create');
|
Route::get('/new', ResourceCreate::class)->name('project.resource.create');
|
||||||
Route::get('/edit', EnvironmentEdit::class)->name('project.environment.edit');
|
Route::get('/edit', EnvironmentEdit::class)->name('project.environment.edit');
|
||||||
});
|
});
|
||||||
Route::prefix('project/{project_uuid}/{environment_name}/application/{application_uuid}')->group(function () {
|
Route::prefix('project/{project_uuid}/environment/{environment_uuid}/application/{application_uuid}')->group(function () {
|
||||||
Route::get('/', ApplicationConfiguration::class)->name('project.application.configuration');
|
Route::get('/', ApplicationConfiguration::class)->name('project.application.configuration');
|
||||||
Route::get('/swarm', ApplicationConfiguration::class)->name('project.application.swarm');
|
Route::get('/swarm', ApplicationConfiguration::class)->name('project.application.swarm');
|
||||||
Route::get('/advanced', ApplicationConfiguration::class)->name('project.application.advanced');
|
Route::get('/advanced', ApplicationConfiguration::class)->name('project.application.advanced');
|
||||||
@@ -206,7 +206,7 @@ Route::middleware(['auth', 'verified'])->group(function () {
|
|||||||
Route::get('/terminal', ExecuteContainerCommand::class)->name('project.application.command');
|
Route::get('/terminal', ExecuteContainerCommand::class)->name('project.application.command');
|
||||||
Route::get('/tasks/{task_uuid}', ScheduledTaskShow::class)->name('project.application.scheduled-tasks');
|
Route::get('/tasks/{task_uuid}', ScheduledTaskShow::class)->name('project.application.scheduled-tasks');
|
||||||
});
|
});
|
||||||
Route::prefix('project/{project_uuid}/{environment_name}/database/{database_uuid}')->group(function () {
|
Route::prefix('project/{project_uuid}/environment/{environment_uuid}/database/{database_uuid}')->group(function () {
|
||||||
Route::get('/', DatabaseConfiguration::class)->name('project.database.configuration');
|
Route::get('/', DatabaseConfiguration::class)->name('project.database.configuration');
|
||||||
Route::get('/environment-variables', DatabaseConfiguration::class)->name('project.database.environment-variables');
|
Route::get('/environment-variables', DatabaseConfiguration::class)->name('project.database.environment-variables');
|
||||||
Route::get('/servers', DatabaseConfiguration::class)->name('project.database.servers');
|
Route::get('/servers', DatabaseConfiguration::class)->name('project.database.servers');
|
||||||
@@ -224,7 +224,7 @@ Route::middleware(['auth', 'verified'])->group(function () {
|
|||||||
Route::get('/backups', DatabaseBackupIndex::class)->name('project.database.backup.index');
|
Route::get('/backups', DatabaseBackupIndex::class)->name('project.database.backup.index');
|
||||||
Route::get('/backups/{backup_uuid}', DatabaseBackupExecution::class)->name('project.database.backup.execution');
|
Route::get('/backups/{backup_uuid}', DatabaseBackupExecution::class)->name('project.database.backup.execution');
|
||||||
});
|
});
|
||||||
Route::prefix('project/{project_uuid}/{environment_name}/service/{service_uuid}')->group(function () {
|
Route::prefix('project/{project_uuid}/environment/{environment_uuid}/service/{service_uuid}')->group(function () {
|
||||||
Route::get('/', ServiceConfiguration::class)->name('project.service.configuration');
|
Route::get('/', ServiceConfiguration::class)->name('project.service.configuration');
|
||||||
Route::get('/logs', Logs::class)->name('project.service.logs');
|
Route::get('/logs', Logs::class)->name('project.service.logs');
|
||||||
Route::get('/environment-variables', ServiceConfiguration::class)->name('project.service.environment-variables');
|
Route::get('/environment-variables', ServiceConfiguration::class)->name('project.service.environment-variables');
|
||||||
|
|||||||
Reference in New Issue
Block a user