Update dah pokonya

This commit is contained in:
adindacintya 2026-06-07 22:47:12 +07:00
parent e7b0d53770
commit dfa11b62da
3 changed files with 20 additions and 9 deletions

10
.gitignore vendored
View File

@ -28,4 +28,12 @@ Thumbs.db
*.h5
.env
/vendor
/node_modules
/node_modules
# Ignore user uploads and python cache
public/uploads/*
!public/uploads/.gitkeep
python_ai/uploads/*
!python_ai/uploads/.gitkeep
python_ai/__pycache__/
*.pyc

View File

@ -65,8 +65,11 @@ public function prediksi(Request $request)
Prediksi::create([
'gambar' => $namaFile,
'penyakit' => $hasil['penyakit'],
'confidence' => $hasil['confidence'],
'user_id' => Auth::id(), // <-- INI YANG MEMBUAT PRIVAT
// Kita buang persen (%) nya dan ubah menjadi tipe Float murni
'confidence' => floatval(str_replace('%', '', $hasil['confidence'])),
'user_id' => Auth::id(),
]);
return back()->with([
@ -79,10 +82,10 @@ public function prediksi(Request $request)
'allPredictions' => $hasil['all_predictions'] ?? [],
]);
} catch (\Exception $e) {
Log::error('Prediksi request error: ' . $e->getMessage());
return back()->with('error', 'Terjadi kesalahan server.');
}
} catch (\Exception $e) {
Log::error('Prediksi request error: ' . $e->getMessage());
return back()->with('error', 'Terjadi kesalahan server.');
}
}
public function riwayat(Request $request)

View File

@ -143,7 +143,7 @@ class="relative rounded-3xl shadow-2xl border-4 border-white transform hover:sca
<div class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
<h3 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-1">Tingkat Kepercayaan (Confidence)</h3>
<p class="text-3xl font-extrabold text-green-600 mt-2 flex items-center gap-2">
{{ session('confidence') }}%
{{ session('confidence') }}
<svg class="w-8 h-8 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
</p>
</div>
@ -160,7 +160,7 @@ class="relative rounded-3xl shadow-2xl border-4 border-white transform hover:sca
<div class="mb-5 group">
<div class="flex justify-between mb-2">
<span class="font-semibold text-gray-700 group-hover:text-green-600 transition-colors">{{ $kelas }}</span>
<span class="font-bold text-gray-900">{{ $nilai }}%</span>
<span class="font-bold text-gray-900">{{ number_format($nilai, 2) }}%</span>
</div>
<div class="w-full bg-gray-100 rounded-full h-3 overflow-hidden shadow-inner">
<div class="bg-gradient-to-r from-green-500 to-green-400 h-3 rounded-full relative transition-all duration-1000 ease-out" style="width: {{ $nilai }}%">