diff --git a/app/processes/page.tsx b/app/processes/page.tsx index fcf9ab9..530c2ff 100644 --- a/app/processes/page.tsx +++ b/app/processes/page.tsx @@ -280,7 +280,7 @@ export default function ProcessesPage() { ) : viewMode === 'grouped' ? ( ) : ( -
+
{displayedProcesses.map((process, index) => { const fullName = `${process.group}:${process.name}`; const isFocused = index === focusedIndex; diff --git a/components/charts/GroupStatistics.tsx b/components/charts/GroupStatistics.tsx index f7e79f0..a4d60de 100644 --- a/components/charts/GroupStatistics.tsx +++ b/components/charts/GroupStatistics.tsx @@ -3,6 +3,7 @@ import { ProcessInfo, ProcessState } from '@/lib/supervisor/types'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from 'recharts'; +import { chartColors } from '@/lib/utils/chartColors'; interface GroupStatisticsProps { processes: ProcessInfo[]; @@ -50,11 +51,19 @@ export function GroupStatistics({ processes }: GroupStatisticsProps) { - + - - - + + + diff --git a/components/charts/ProcessStateChart.tsx b/components/charts/ProcessStateChart.tsx index 2e7079f..5912285 100644 --- a/components/charts/ProcessStateChart.tsx +++ b/components/charts/ProcessStateChart.tsx @@ -3,6 +3,7 @@ import { ProcessInfo, ProcessState } from '@/lib/supervisor/types'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { PieChart, Pie, Cell, ResponsiveContainer, Legend, Tooltip } from 'recharts'; +import { chartColors } from '@/lib/utils/chartColors'; interface ProcessStateChartProps { processes: ProcessInfo[]; @@ -23,12 +24,12 @@ export function ProcessStateChart({ processes }: ProcessStateChartProps) { ); const data = [ - { name: 'Running', value: stateCounts.running, color: 'hsl(var(--success))' }, - { name: 'Stopped', value: stateCounts.stopped, color: 'hsl(var(--muted-foreground))' }, - { name: 'Fatal', value: stateCounts.fatal, color: 'hsl(var(--destructive))' }, - { name: 'Starting', value: stateCounts.starting, color: 'hsl(var(--warning))' }, - { name: 'Stopping', value: stateCounts.stopping, color: 'hsl(var(--accent))' }, - { name: 'Other', value: stateCounts.other, color: 'hsl(var(--muted))' }, + { name: 'Running', value: stateCounts.running, color: chartColors.running }, + { name: 'Stopped', value: stateCounts.stopped, color: chartColors.stopped }, + { name: 'Fatal', value: stateCounts.fatal, color: chartColors.fatal }, + { name: 'Starting', value: stateCounts.starting, color: chartColors.starting }, + { name: 'Stopping', value: stateCounts.stopping, color: chartColors.stopping }, + { name: 'Other', value: stateCounts.other, color: chartColors.muted }, ].filter((item) => item.value > 0); return ( @@ -53,7 +54,15 @@ export function ProcessStateChart({ processes }: ProcessStateChartProps) { ))} - + diff --git a/components/charts/ProcessUptimeChart.tsx b/components/charts/ProcessUptimeChart.tsx index 5d875b3..5319737 100644 --- a/components/charts/ProcessUptimeChart.tsx +++ b/components/charts/ProcessUptimeChart.tsx @@ -3,6 +3,7 @@ import { ProcessInfo, ProcessState } from '@/lib/supervisor/types'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from 'recharts'; +import { chartColors } from '@/lib/utils/chartColors'; interface ProcessUptimeChartProps { processes: ProcessInfo[]; @@ -56,9 +57,16 @@ export function ProcessUptimeChart({ processes }: ProcessUptimeChartProps) { const minutes = Math.floor((value - hours) * 60); return `${hours}h ${minutes}m`; }} + contentStyle={{ + backgroundColor: 'rgba(0, 0, 0, 0.9)', + border: 'none', + borderRadius: '8px', + color: '#ffffff', + }} + itemStyle={{ color: '#ffffff' }} /> - + diff --git a/components/groups/GroupCard.tsx b/components/groups/GroupCard.tsx index cc60ba5..8243f2b 100644 --- a/components/groups/GroupCard.tsx +++ b/components/groups/GroupCard.tsx @@ -49,7 +49,7 @@ export function GroupCard({ groupName, processes }: GroupCardProps) { return ( -
+
-
+
diff --git a/components/process/ProcessCard.tsx b/components/process/ProcessCard.tsx index eb9777b..b5090c4 100644 --- a/components/process/ProcessCard.tsx +++ b/components/process/ProcessCard.tsx @@ -42,7 +42,7 @@ export function ProcessCard({ process, isSelected = false, isFocused = false, on return ( - + {/* Metrics */}
diff --git a/lib/utils/chartColors.ts b/lib/utils/chartColors.ts new file mode 100644 index 0000000..8cd6cd9 --- /dev/null +++ b/lib/utils/chartColors.ts @@ -0,0 +1,53 @@ +/** + * Chart color utilities for Recharts compatibility + * + * Recharts doesn't properly parse CSS custom properties or OKLCH colors, + * so we provide static hex colors that work reliably across themes. + */ + +export const chartColors = { + primary: '#3b82f6', // Blue + success: '#22c55e', // Green + warning: '#eab308', // Yellow + destructive: '#ef4444', // Red + accent: '#06b6d4', // Cyan + muted: '#9ca3af', // Gray + running: '#22c55e', // Same as success + stopped: '#6b7280', // Darker gray + fatal: '#ef4444', // Same as destructive + starting: '#eab308', // Same as warning + backoff: '#f97316', // Orange + stopping: '#fb923c', // Light orange + exited: '#9ca3af', // Same as muted + unknown: '#64748b', // Slate +}; + +/** + * Get color for process state + */ +export function getStateColor(state: string): string { + const stateMap: Record = { + running: chartColors.running, + stopped: chartColors.stopped, + fatal: chartColors.fatal, + starting: chartColors.starting, + backoff: chartColors.backoff, + stopping: chartColors.stopping, + exited: chartColors.exited, + unknown: chartColors.unknown, + }; + + return stateMap[state.toLowerCase()] || chartColors.muted; +} + +/** + * Color palette for multiple data series + */ +export const colorPalette = [ + chartColors.primary, + chartColors.success, + chartColors.warning, + chartColors.accent, + chartColors.destructive, + chartColors.muted, +];