Initial commit: Any-LLM Gateway with Laravel Admin Interface

- Any-LLM Gateway setup with Docker Compose
- Laravel 11 admin interface with Livewire
- Dashboard with usage statistics and charts
- Gateway Users management with budget tracking
- API Keys management with revocation
- Budget templates with assignment
- Usage Logs with filtering and CSV export
- Model Pricing management with calculator
- PostgreSQL database integration
- Complete authentication system for admins
This commit is contained in:
wtrinkl
2025-11-16 12:38:05 +01:00
commit b1363aeab9
148 changed files with 23995 additions and 0 deletions

View File

@@ -0,0 +1,91 @@
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
{{ __('Create 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">Create Gateway User</h1>
<p class="mt-1 text-sm text-gray-600">Add a new API consumer to the gateway</p>
</div>
<!-- Form -->
<div class="bg-white rounded-lg shadow-sm p-6">
<form method="POST" action="{{ route('gateway-users.store') }}">
@csrf
<!-- 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') }}"
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">
<p class="mt-1 text-sm text-gray-500">A friendly name to identify this user</p>
@error('alias')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<!-- Budget -->
<div class="mb-6">
<label for="budget_id" class="block text-sm font-medium text-gray-700 mb-2">
Budget Template (Optional)
</label>
<select name="budget_id"
id="budget_id"
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm @error('budget_id') border-red-300 @enderror">
<option value="">No Budget</option>
@foreach($budgets as $budget)
<option value="{{ $budget->budget_id }}" {{ old('budget_id') == $budget->budget_id ? 'selected' : '' }}>
{{ $budget->budget_id }} - ${{ number_format($budget->max_budget, 2) }}
({{ floor($budget->budget_duration_sec / 86400) }}d)
</option>
@endforeach
</select>
<p class="mt-1 text-sm text-gray-500">Assign a spending limit to this user</p>
@error('budget_id')
<p class="mt-1 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
<!-- Info Box -->
<div class="mb-6 bg-blue-50 border-l-4 border-blue-400 p-4">
<div class="flex">
<div class="flex-shrink-0">
<svg class="h-5 w-5 text-blue-400" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/>
</svg>
</div>
<div class="ml-3">
<p class="text-sm text-blue-700">
A unique user ID will be automatically generated. You can create API keys for this user after creation.
</p>
</div>
</div>
</div>
<!-- Actions -->
<div class="flex items-center justify-end space-x-3">
<a href="{{ route('gateway-users.index') }}"
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">
Create User
</button>
</div>
</form>
</div>
</div>
</div>
</x-app-layout>