real-time graph view

This commit is contained in:
Raika Furude 2025-12-04 23:35:36 -05:00
parent 31333c8ba3
commit aea7403f10
10 changed files with 592 additions and 592 deletions

View File

@ -10,12 +10,26 @@ const PatientDetailModal = ({ patient, onClose }) => {
const [loading, setLoading] = useState(true);
const [selectedMetric, setSelectedMetric] = useState('all');
useEffect(() => {
useEffect(() => {
// 1. Fetch immediately on open
fetchPatientHistory();
// 2. Set up polling interval (every 2 seconds)
const intervalId = setInterval(() => {
// We pass 'true' to indicate this is a background update
// (so we don't show the loading spinner again)
fetchPatientHistory(true);
}, 2000);
// 3. Cleanup on close
return () => clearInterval(intervalId);
}, [patient.patient_id]);
const fetchPatientHistory = async () => {
const fetchPatientHistory = async (isBackgroundUpdate = false) => {
try {
// Only show loading spinner on the FIRST load, not subsequent updates
if (!isBackgroundUpdate) setLoading(true);
const response = await fetch(`${API_BASE}/api/patients/${patient.patient_id}/vitals-history?limit=200`);
const data = await response.json();

View File

@ -0,0 +1,4 @@
68835
68890
68897
69003

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
68835

View File

@ -3,7 +3,7 @@
> vite
VITE v7.1.10 ready in 262 ms
VITE v7.1.10 ready in 223 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose

View File

@ -0,0 +1 @@
68897

View File

@ -4,7 +4,7 @@
Port 5173 is in use, trying another one...
VITE v7.1.10 ready in 236 ms
VITE v7.1.10 ready in 216 ms
➜ Local: http://localhost:5174/
➜ Network: use --host to expose

1
vitallink/logs/kiosk.pid Normal file
View File

@ -0,0 +1 @@
69003

View File

@ -0,0 +1 @@
68890

Binary file not shown.