Users can upload a photo of a nail polish bottle; a background queue job sends it to Ollama (llama3.2-vision at 192.168.30.172:11434), extracts name, number and manufacturer, then creates the nail polish and adds it to the user's collection automatically. - ProcessNailPolishImage job (180s timeout, 2 tries) - NailPolishImport model + migration (status tracking) - AiSetting model + migration (Ollama URL + model, admin-configurable) - NailPolishImportController: upload, status page (auto-refresh every 5s) - Admin\AiSettingController: configure Ollama connection - Views: drag-drop upload form, live status page, import history - Navbar: "Foto importieren" link for all users - Admin dropdown: "KI-Einstellungen" - neonail-worker.conf: Supervisor config for the queue worker Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
792 B
PHP
32 lines
792 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\AiSetting;
|
|
use Illuminate\Http\Request;
|
|
|
|
class AiSettingController extends Controller
|
|
{
|
|
public function show()
|
|
{
|
|
$ai = AiSetting::get();
|
|
return view('admin.ai.show', compact('ai'));
|
|
}
|
|
|
|
public function update(Request $request)
|
|
{
|
|
$request->validate([
|
|
'ollama_url' => 'required|url|max:255',
|
|
'ollama_model' => 'required|string|max:100',
|
|
]);
|
|
|
|
$ai = AiSetting::get();
|
|
$ai->ollama_url = rtrim($request->ollama_url, '/');
|
|
$ai->ollama_model = $request->ollama_model;
|
|
$ai->save();
|
|
|
|
return redirect()->route('admin.ai.show')->with('success', 'KI-Einstellungen gespeichert.');
|
|
}
|
|
}
|