#591 - monitoring

This commit is contained in:
Saeed Vaziry
2025-05-31 00:18:04 +02:00
parent 857319025f
commit c09c7a63fa
32 changed files with 1692 additions and 117 deletions

View File

@ -4,3 +4,30 @@ import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
// convert kb to gb
export function kbToGb(kb: number | string): number {
if (typeof kb === 'string') {
kb = parseFloat(kb);
}
return Math.round((kb / 1024 / 1024) * 100) / 100;
}
// convert mb to gb
export function mbToGb(mb: number | string): number {
if (typeof mb === 'string') {
mb = parseFloat(mb);
}
return Math.round((mb / 1024) * 100) / 100;
}
export function formatDateString(dateString: string | Date): string {
const date = new Date(dateString);
const year = date.toLocaleString('default', { year: 'numeric' });
const month = date.toLocaleString('default', { month: '2-digit' });
const day = date.toLocaleString('default', { day: '2-digit' });
// Generate yyyy-mm-dd date string
return year + '-' + month + '-' + day;
}