mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
refactor: update remnawave API types for v2.7.0
- 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
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
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', {
|
||||
|
||||
Reference in New Issue
Block a user