Skip to content
Merged

Dev #62

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion client/src/components/Bytes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from 'recharts';
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from '@/components/ui/card';
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/EnhancedRecentUsage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const calculatePeak24h = (
if (points.length === 0) return 0;

// Get all values and find the maximum
const values = points.map((point) => {
const values = points.map((point: any) => {
const rawValue = point.value?.doubleValue ?? 0;
return convertToPercentage ? rawValue * 100 : rawValue;
});
Expand All @@ -94,12 +94,12 @@ const calculateAverage24h = (
const points = timeSeries[0].points;
if (points.length === 0) return 0;

const values = points.map((point) => {
const values = points.map((point: any) => {
const rawValue = point.value?.doubleValue ?? 0;
return convertToPercentage ? rawValue * 100 : rawValue;
});

const sum = values.reduce((acc, val) => acc + val, 0);
const sum = values.reduce((acc: number, val: number) => acc + val, 0);
return sum / values.length;
};

Expand Down
2 changes: 0 additions & 2 deletions client/src/hooks/useNotifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ export interface K8sNotification {

export const useNotifications = () => {
const [notifications, setNotifications] = useState<K8sNotification[]>([]);
const [socket, setSocket] = useState<Socket | null>(null);
const [isConnected, setIsConnected] = useState(false);

useEffect(() => {
const socketInstance = io(
import.meta.env.VITE_API_URL || 'http://localhost:3000',
);
setSocket(socketInstance);

socketInstance.on('connect', () => {
setIsConnected(true);
Expand Down