mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-02 13:15:17 +09:00
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md Phase 3 utility consolidation.
Replaces the scattered, drifted-apart local helpers with the canonical utils
added in Phase 1.
formatBytes (was 14 local copies):
- utils/formatBytes.js realigned to the codebase convention (1024 divisor +
KB/MB/GB labels; `iec` opt switches labels to KiB/MiB). It was unused until
now, so displayed values are preserved.
- Removed local formatBytes/formatSize/formatMemory from ApplicationDetail,
Backups, Databases, Monitoring, Terminal, ServerDetail (x2), BackupsTab,
QuarantineTab, SystemTab, DiskUsageBar, SnapshotTable. Decimals matched per
call site (e.g. BackupsTab keeps 2 decimals); empty/falsy fallbacks preserved
via defaultValue. fileTypes.js and logHelpers.js now re-export the canonical
(their named exports are consumed elsewhere).
formatRelativeTime (was 6 local copies):
- ActivityFeed, PipelineView (x2), Dashboard migrated to utils/time.js.
- serviceTypes.js and logHelpers.js re-export the canonical.
- EnvironmentCard left as-is (intentionally distinct "Today/Yesterday/X days
ago" vocabulary, not the "Xm ago" format).
Behavioral deltas are cosmetic only: trailing-zero trim ("1.0 GB"->"1 GB"), the
date-fallback threshold normalized to 30d, and sub-hour times now show precise
"Xm ago". Units and numeric values are unchanged.
Verified: npm run build passes; eslint adds no new errors.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>