mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
- ServerInfo: remove cpu_physical_cores, memory_available - NodeInfo: replace cpu_count/cpu_model/total_ram with versions/system, xray_uptime changed to number, users_online now required - NodeStatus: same field updates, remove dead uptime field - Extract formatUptime to shared utils/format.ts - Update AdminRemnawave and AdminDashboard components
18 lines
552 B
TypeScript
18 lines
552 B
TypeScript
export function formatUptime(seconds: number): string {
|
|
const days = Math.floor(seconds / 86400);
|
|
const hours = Math.floor((seconds % 86400) / 3600);
|
|
const minutes = Math.floor((seconds % 3600) / 60);
|
|
if (days > 0) return `${days}d ${hours}h`;
|
|
if (hours > 0) return `${hours}h ${minutes}m`;
|
|
return `${minutes}m`;
|
|
}
|
|
|
|
export function formatPrice(kopeks: number): string {
|
|
const rubles = kopeks / 100;
|
|
return new Intl.NumberFormat('ru-RU', {
|
|
style: 'currency',
|
|
currency: 'RUB',
|
|
maximumFractionDigits: 0,
|
|
}).format(rubles);
|
|
}
|