Initial ui
This commit is contained in:
parent
526822335e
commit
4bfb87448f
18 changed files with 702 additions and 92 deletions
15
app/lib/utils.ts
Normal file
15
app/lib/utils.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
export function formatBytes(bytes: number): string {
|
||||
if (bytes > 1e9) return (bytes / 1e9).toFixed(1) + " GB";
|
||||
if (bytes > 1e6) return (bytes / 1e6).toFixed(1) + " MB";
|
||||
return (bytes / 1e3).toFixed(1) + " KB";
|
||||
}
|
||||
|
||||
export function statColor(percent: number): string {
|
||||
if (percent > 80) return "#ef4444";
|
||||
if (percent > 60) return "#f59e0b";
|
||||
return "#3b82f6";
|
||||
}
|
||||
|
||||
export function pad(n: number): string {
|
||||
return String(n).padStart(2, "0");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue