mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-02-19 08:56:23 +00:00
Update modal
This commit is contained in:
@@ -2433,19 +2433,26 @@ ${(report.sections && report.sections.length > 0) ? `
|
||||
</div>
|
||||
</div>
|
||||
{/* Visual bar */}
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1 h-2 rounded-full bg-muted overflow-hidden flex">
|
||||
{acceptCount > 0 && (
|
||||
<div className="h-full bg-green-500 transition-all" style={{ width: `${(acceptCount / total) * 100}%` }} />
|
||||
)}
|
||||
{dropCount > 0 && (
|
||||
<div className="h-full bg-red-500 transition-all" style={{ width: `${(dropCount / total) * 100}%` }} />
|
||||
)}
|
||||
{rejectCount > 0 && (
|
||||
<div className="h-full bg-orange-500 transition-all" style={{ width: `${(rejectCount / total) * 100}%` }} />
|
||||
)}
|
||||
<div className="space-y-1.5 sm:space-y-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1 h-2 rounded-full bg-muted overflow-hidden flex">
|
||||
{acceptCount > 0 && (
|
||||
<div className="h-full bg-green-500 transition-all" style={{ width: `${(acceptCount / total) * 100}%` }} />
|
||||
)}
|
||||
{dropCount > 0 && (
|
||||
<div className="h-full bg-red-500 transition-all" style={{ width: `${(dropCount / total) * 100}%` }} />
|
||||
)}
|
||||
{rejectCount > 0 && (
|
||||
<div className="h-full bg-orange-500 transition-all" style={{ width: `${(rejectCount / total) * 100}%` }} />
|
||||
)}
|
||||
</div>
|
||||
<div className="hidden sm:flex items-center gap-3 text-[10px] text-muted-foreground flex-shrink-0">
|
||||
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-green-500" />Accept</span>
|
||||
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-red-500" />Drop</span>
|
||||
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-orange-500" />Reject</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-3 text-[10px] text-muted-foreground flex-shrink-0">
|
||||
<div className="flex sm:hidden items-center gap-3 text-[10px] text-muted-foreground">
|
||||
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-green-500" />Accept</span>
|
||||
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-red-500" />Drop</span>
|
||||
<span className="flex items-center gap-1"><span className="w-2 h-2 rounded-full bg-orange-500" />Reject</span>
|
||||
|
||||
@@ -120,10 +120,15 @@ export function TemperatureDetailModal({ open, onOpenChange, liveTemperature }:
|
||||
const currentStatus = getStatusInfo(currentTemp)
|
||||
const chartColor = getStatusColor(currentTemp)
|
||||
|
||||
// Calculate Y axis domain with some padding
|
||||
// Calculate Y axis domain including the real min/max stats (not just plotted averages)
|
||||
// This ensures the axis always covers the actual recorded extremes
|
||||
const values = data.map((d) => d.value)
|
||||
const yMin = values.length > 0 ? Math.max(0, Math.floor(Math.min(...values) - 5)) : 0
|
||||
const yMax = values.length > 0 ? Math.ceil(Math.max(...values) + 5) : 100
|
||||
const dataMin = values.length > 0 ? Math.min(...values) : 0
|
||||
const dataMax = values.length > 0 ? Math.max(...values) : 100
|
||||
const realMin = stats.min > 0 ? Math.min(dataMin, stats.min) : dataMin
|
||||
const realMax = stats.max > 0 ? Math.max(dataMax, stats.max) : dataMax
|
||||
const yMin = Math.max(0, Math.floor(realMin - 3))
|
||||
const yMax = Math.ceil(realMax + 3)
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
|
||||
Reference in New Issue
Block a user