ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
Ignore virtual mounts, dedupe devices; tweak sidebar
Juan Denisc4591c405ecc
diff --git a/backend/app/services/file_service.py b/backend/app/services/file_service.pyindex 051a2e0a..ab02a7fc 100644--- a/backend/app/services/file_service.py+++ b/backend/app/services/file_service.py@@ -483,14 +483,37 @@ class FileService:size /= 1024return f"{size:.1f} PB"+ # Virtual/pseudo filesystem types to hide from disk usage+ _VIRTUAL_FSTYPES = {+ 'squashfs', 'tmpfs', 'devtmpfs', 'devfs', 'overlay', 'aufs',+ 'proc', 'sysfs', 'cgroup', 'cgroup2', 'debugfs', 'tracefs',+ 'securityfs', 'pstore', 'efivarfs', 'bpf', 'fusectl',+ 'configfs', 'hugetlbfs', 'mqueue', 'ramfs', 'nsfs',+ }++ # Mount-point prefixes that are always noise+ _SKIP_MOUNT_PREFIXES = ('/snap/', '/var/lib/docker/', '/run/')+@classmethoddef get_all_disk_mounts(cls) -> Dict:- """Get disk usage for all mount points."""+ """Get disk usage for all physical mount points, deduplicated by device."""try:partitions = psutil.disk_partitions(all=False)mounts = []+ seen_devices = set()for partition in partitions:+ # Skip virtual/pseudo filesystems+ if partition.fstype in cls._VIRTUAL_FSTYPES:+ continue+ # Skip noisy mount prefixes (snaps, docker layers, etc.)+ if any(partition.mountpoint.startswith(p) for p in cls._SKIP_MOUNT_PREFIXES):+ continue+ # Deduplicate: keep only the shortest mount path per device+ if partition.device in seen_devices:+ continue+ seen_devices.add(partition.device)+try:usage = psutil.disk_usage(partition.mountpoint)mounts.append({diff --git a/frontend/src/styles/pages/_file-manager.less b/frontend/src/styles/pages/_file-manager.lessindex 37e282c4..bc912ffe 100644--- a/frontend/src/styles/pages/_file-manager.less+++ b/frontend/src/styles/pages/_file-manager.less@@ -180,6 +180,8 @@display: flex;flex-direction: column;gap: @space-4;+ overflow-y: auto;+ max-height: calc(100vh - 120px);.transition(all);@media (max-width: @breakpoint-lg) {@@ -189,11 +191,11 @@bottom: 0;width: 100%;max-width: 360px;+ max-height: none;background: @bg-body;padding: @space-4;z-index: @z-modal;box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);- overflow-y: auto;}}@@ -207,6 +209,10 @@background: @bg-card;border-radius: @radius-lg;overflow: hidden;++ &:last-child {+ max-height: none;+ }}.sidebar-section-header {