- Fixed database relationships: LlmRequest now properly uses gateway_user_id instead of user_id - Updated Models: GatewayUser and LlmRequest relationships corrected - Removed User->llmRequests relationship (admin users don't have LLM requests) - Simplified Dashboard: Now shows Gateway User statistics instead of admin users - Removed obsolete Budgets management pages (budgets handled directly in gateway_users) - Removed User Budgets admin section (redundant with gateway_users management) - Fixed view errors: Added null-checks for user_id in keys views - Updated navigation: Removed Budget and User Budget links - Updated routes: Cleaned up unused BudgetController and UserManagementController routes - Simplified StatisticsService: Focus on gateway_users and basic metrics only
90 lines
4.2 KiB
PHP
90 lines
4.2 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
|
|
{{ __('Edit Gateway User') }}
|
|
</h2>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="max-w-3xl mx-auto sm:px-6 lg:px-8">
|
|
<!-- Header -->
|
|
<div class="mb-6">
|
|
<h1 class="text-3xl font-bold text-gray-900">Edit Gateway User</h1>
|
|
<p class="mt-1 text-sm text-gray-600">Update user settings and configuration</p>
|
|
</div>
|
|
|
|
<!-- Form -->
|
|
<div class="bg-white rounded-lg shadow-sm p-6">
|
|
<form method="POST" action="{{ route('gateway-users.update', $user->user_id) }}">
|
|
@csrf
|
|
@method('PUT')
|
|
|
|
<!-- User ID (Read-only) -->
|
|
<div class="mb-6">
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">
|
|
User ID
|
|
</label>
|
|
<input type="text"
|
|
value="{{ $user->user_id }}"
|
|
readonly
|
|
class="block w-full rounded-md border-gray-300 bg-gray-50 shadow-sm sm:text-sm font-mono">
|
|
<p class="mt-1 text-sm text-gray-500">Cannot be changed</p>
|
|
</div>
|
|
|
|
<!-- Alias -->
|
|
<div class="mb-6">
|
|
<label for="alias" class="block text-sm font-medium text-gray-700 mb-2">
|
|
Alias (Optional)
|
|
</label>
|
|
<input type="text"
|
|
name="alias"
|
|
id="alias"
|
|
value="{{ old('alias', $user->alias) }}"
|
|
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm @error('alias') border-red-300 @enderror"
|
|
placeholder="My Application">
|
|
@error('alias')
|
|
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
|
|
@enderror
|
|
</div>
|
|
|
|
<!-- Current Spend (Read-only) -->
|
|
<div class="mb-6">
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">
|
|
Current Spend
|
|
</label>
|
|
<input type="text"
|
|
value="${{ number_format($user->spend, 2) }}"
|
|
readonly
|
|
class="block w-full rounded-md border-gray-300 bg-gray-50 shadow-sm sm:text-sm">
|
|
</div>
|
|
|
|
<!-- Actions -->
|
|
<div class="flex items-center justify-between">
|
|
<form action="{{ route('gateway-users.destroy', $user->user_id) }}"
|
|
method="POST"
|
|
onsubmit="return confirm('Are you sure? This will delete the user and all associated data.');">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit"
|
|
class="inline-flex items-center px-4 py-2 bg-red-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-700">
|
|
Delete User
|
|
</button>
|
|
</form>
|
|
|
|
<div class="flex space-x-3">
|
|
<a href="{{ route('gateway-users.show', $user->user_id) }}"
|
|
class="inline-flex items-center px-4 py-2 bg-white border border-gray-300 rounded-md font-semibold text-xs text-gray-700 uppercase tracking-widest shadow-sm hover:bg-gray-50">
|
|
Cancel
|
|
</a>
|
|
<button type="submit"
|
|
class="inline-flex items-center px-4 py-2 bg-indigo-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-indigo-700">
|
|
Update User
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|