This commit is contained in:
Andras Bacsai
2023-06-15 09:15:41 +02:00
parent 384ab2dd18
commit f79b3841c7
40 changed files with 119 additions and 197 deletions

View File

@@ -46,7 +46,7 @@ class ApplicationController extends Controller
public function deployment()
{
$deployment_uuid = request()->route('deployment_uuid');
$deploymentUuid = request()->route('deployment_uuid');
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
@@ -60,7 +60,7 @@ class ApplicationController extends Controller
if (!$application) {
return redirect()->route('dashboard');
}
$activity = Activity::where('properties->type_uuid', '=', $deployment_uuid)->first();
$activity = Activity::where('properties->type_uuid', '=', $deploymentUuid)->first();
if (!$activity) {
return redirect()->route('project.application.deployments', [
'project_uuid' => $project->uuid,
@@ -68,7 +68,7 @@ class ApplicationController extends Controller
'application_uuid' => $application->uuid,
]);
}
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $deployment_uuid)->first();
$deployment = ApplicationDeploymentQueue::where('deployment_uuid', $deploymentUuid)->first();
if (!$deployment) {
return redirect()->route('project.application.deployments', [
'project_uuid' => $project->uuid,
@@ -80,7 +80,7 @@ class ApplicationController extends Controller
'application' => $application,
'activity' => $activity,
'deployment' => $deployment,
'deployment_uuid' => $deployment_uuid,
'deployment_uuid' => $deploymentUuid,
]);
}
}

View File

@@ -64,7 +64,7 @@ class Controller extends BaseController
'invitations' => $invitations,
]);
}
public function accept_invitation()
public function acceptInvitation()
{
try {
$invitation = TeamInvitation::whereUuid(request()->route('uuid'))->firstOrFail();
@@ -76,8 +76,8 @@ class Controller extends BaseController
abort(401);
}
$created_at = $invitation->created_at;
$diff = $created_at->diffInMinutes(now());
$createdAt = $invitation->created_at;
$diff = $createdAt->diffInMinutes(now());
if ($diff <= config('constants.invitation.link.expiration')) {
$user->teams()->attach($invitation->team->id, ['role' => $invitation->role]);
$invitation->delete();
@@ -90,7 +90,7 @@ class Controller extends BaseController
throw $th;
}
}
public function revoke_invitation()
public function revokeInvitation()
{
try {
$invitation = TeamInvitation::whereUuid(request()->route('uuid'))->firstOrFail();

View File

@@ -33,7 +33,7 @@ class MagicController extends Controller
'environments' => Project::ownedByCurrentTeam()->whereUuid(request()->query('project_uuid'))->first()->environments
]);
}
public function new_project()
public function newProject()
{
$project = Project::firstOrCreate(
['name' => request()->query('name') ?? generate_random_name()],
@@ -43,7 +43,7 @@ class MagicController extends Controller
'project_uuid' => $project->uuid
]);
}
public function new_environment()
public function newEnvironment()
{
$environment = Environment::firstOrCreate(
['name' => request()->query('name') ?? generate_random_name()],

View File

@@ -8,18 +8,18 @@ class ProjectController extends Controller
{
public function all()
{
$team_id = session('currentTeam')->id;
$teamId = session('currentTeam')->id;
$projects = Project::where('team_id', $team_id)->get();
$projects = Project::where('team_id', $teamId)->get();
return view('projects', ['projects' => $projects]);
}
public function show()
{
$project_uuid = request()->route('project_uuid');
$team_id = session('currentTeam')->id;
$projectUuid = request()->route('project_uuid');
$teamId = session('currentTeam')->id;
$project = Project::where('team_id', $team_id)->where('uuid', $project_uuid)->first();
$project = Project::where('team_id', $teamId)->where('uuid', $projectUuid)->first();
if (!$project) {
return redirect()->route('dashboard');
}

View File

@@ -1,34 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Models\PrivateKey;
use App\Models\Server;
class ServerController extends Controller
{
public function all()
{
return view('server.all', [
'servers' => Server::ownedByCurrentTeam()->get()
]);
}
public function create()
{
return view('server.create', [
'private_keys' => PrivateKey::ownedByCurrentTeam()->get(),
]);
}
public function show()
{
return view('server.show', [
'server' => Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->firstOrFail(),
]);
}
public function proxy()
{
return view('server.proxy', [
'server' => Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->firstOrFail(),
]);
}
}