This commit is contained in:
Stefanescu Mihai
2026-03-19 19:40:49 +02:00
parent 528a55cce7
commit e8d2728d57
14 changed files with 1454 additions and 80 deletions
+37
View File
@@ -0,0 +1,37 @@
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">New Project</h2>
</x-slot>
<div class="py-8">
<div class="max-w-2xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg p-6">
<form method="POST" action="{{ route('projects.store') }}" class="space-y-6">
@csrf
<div>
<x-input-label for="name" value="Project Name" />
<x-text-input id="name" name="name" type="text" class="mt-1 block w-full" :value="old('name')" required autofocus />
<x-input-error :messages="$errors->get('name')" class="mt-2" />
</div>
<div>
<x-input-label for="platform" value="Platform" />
<select id="platform" name="platform" class="mt-1 block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm">
<option value="">Select a platform...</option>
@foreach(['php', 'javascript', 'python', 'ruby', 'java', 'go', 'rust', 'csharp', 'node', 'other'] as $plat)
<option value="{{ $plat }}" {{ old('platform') === $plat ? 'selected' : '' }}>{{ ucfirst($plat) }}</option>
@endforeach
</select>
<x-input-error :messages="$errors->get('platform')" class="mt-2" />
</div>
<div class="flex items-center gap-4">
<x-primary-button>Create Project</x-primary-button>
<a href="{{ route('projects.index') }}" class="text-sm text-gray-600 hover:text-gray-900">Cancel</a>
</div>
</form>
</div>
</div>
</div>
</x-app-layout>
+48
View File
@@ -0,0 +1,48 @@
<x-app-layout>
<x-slot name="header">
<div class="flex items-center justify-between">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">Projects</h2>
<a href="{{ route('projects.create') }}" class="inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 transition">
New Project
</a>
</div>
</x-slot>
<div class="py-8">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
@if(session('status'))
<div class="mb-4 bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-md text-sm">
{{ session('status') }}
</div>
@endif
@if($projects->isEmpty())
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg p-12 text-center">
<p class="text-gray-500 mb-4">You don't have any projects yet.</p>
<a href="{{ route('projects.create') }}" class="text-indigo-600 hover:underline font-medium">Create your first project</a>
</div>
@else
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
@foreach($projects as $project)
<a href="{{ route('projects.issues.index', $project) }}" class="block bg-white overflow-hidden shadow-sm sm:rounded-lg hover:shadow-md transition">
<div class="p-6">
<div class="flex items-center justify-between mb-2">
<h3 class="text-lg font-semibold text-gray-900">{{ $project->name }}</h3>
@if($project->platform)
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-600">
{{ $project->platform }}
</span>
@endif
</div>
<div class="text-sm text-gray-500">
{{ $project->issues_count }} unresolved {{ Str::plural('issue', $project->issues_count) }}
</div>
</div>
</a>
@endforeach
</div>
@endif
</div>
</div>
</x-app-layout>
@@ -0,0 +1,80 @@
<x-app-layout>
@php($currentProject = $project)
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">{{ $project->name }} &mdash; Settings</h2>
</x-slot>
<div class="py-8">
<div class="max-w-3xl mx-auto sm:px-6 lg:px-8 space-y-6">
@if(session('status'))
<div class="bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-md text-sm">
{{ session('status') }}
</div>
@endif
{{-- DSN --}}
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg p-6">
<h3 class="text-lg font-medium text-gray-900 mb-4">Client DSN</h3>
<p class="text-sm text-gray-500 mb-3">Use this DSN in your Sentry SDK configuration to send events to this project.</p>
<div x-data="{ copied: false }" class="flex items-center gap-2">
<code class="flex-1 bg-gray-50 border border-gray-200 rounded-md px-4 py-3 text-sm font-mono text-gray-800 break-all select-all">{{ $project->dsn }}</code>
<button @click="navigator.clipboard.writeText('{{ $project->dsn }}'); copied = true; setTimeout(() => copied = false, 2000)"
class="shrink-0 inline-flex items-center px-3 py-2 bg-white border border-gray-300 rounded-md text-sm text-gray-700 hover:bg-gray-50 transition"
type="button">
<span x-show="!copied">Copy</span>
<span x-show="copied" x-cloak>Copied!</span>
</button>
</div>
<form method="POST" action="{{ route('projects.regenerate-keys', $project) }}" class="mt-4"
onsubmit="return confirm('Regenerating keys will invalidate the current DSN. Continue?')">
@csrf
@method('PATCH')
<x-secondary-button type="submit">Regenerate Keys</x-secondary-button>
</form>
</div>
{{-- Update Project --}}
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg p-6">
<h3 class="text-lg font-medium text-gray-900 mb-4">Project Details</h3>
<form method="POST" action="{{ route('projects.update', $project) }}" class="space-y-6">
@csrf
@method('PATCH')
<div>
<x-input-label for="name" value="Project Name" />
<x-text-input id="name" name="name" type="text" class="mt-1 block w-full" :value="old('name', $project->name)" required />
<x-input-error :messages="$errors->get('name')" class="mt-2" />
</div>
<div>
<x-input-label for="platform" value="Platform" />
<select id="platform" name="platform" class="mt-1 block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm">
<option value="">Select a platform...</option>
@foreach(['php', 'javascript', 'python', 'ruby', 'java', 'go', 'rust', 'csharp', 'node', 'other'] as $plat)
<option value="{{ $plat }}" {{ old('platform', $project->platform) === $plat ? 'selected' : '' }}>{{ ucfirst($plat) }}</option>
@endforeach
</select>
<x-input-error :messages="$errors->get('platform')" class="mt-2" />
</div>
<x-primary-button>Save Changes</x-primary-button>
</form>
</div>
{{-- Delete Project --}}
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg p-6">
<h3 class="text-lg font-medium text-red-600 mb-2">Danger Zone</h3>
<p class="text-sm text-gray-500 mb-4">Deleting a project will permanently remove all its issues and events.</p>
<form method="POST" action="{{ route('projects.destroy', $project) }}"
onsubmit="return confirm('Are you sure you want to delete this project? This action cannot be undone.')">
@csrf
@method('DELETE')
<x-danger-button>Delete Project</x-danger-button>
</form>
</div>
</div>
</div>
</x-app-layout>