gethomepage / homepage

A highly customizable homepage (or startpage / application dashboard) with Docker and service API integrations.
https://gethomepage.dev/
GNU General Public License v3.0
17.17k stars 991 forks source link

Enhancement: Allow Disk Resources Widget For Combined Disk Mounts #3547

Closed jeremyjohn closed 1 month ago

jeremyjohn commented 1 month ago

Proposed change

Changes

Backend

The API now returns an array of drive data, previous logic for root '/' and local paths remains.

Example Response

{
    "drive": [
        {
            "fs": "/dev/sdc1",
            "type": "ext4",
            "size": 3936819662848,
            "used": 28672,
            "available": 3736763559936,
            "use": 0,
            "mount": "/storage_disks/hdd4",
            "rw": false
        },
        {
            "fs": "/dev/sdf1",
            "type": "ext4",
            "size": 1967846068224,
            "used": 1863119540224,
            "available": 4689858560,
            "use": 99.75,
            "mount": "/storage_disks/hdd1",
            "rw": false
        },
        {
            "fs": "/dev/sde1",
            "type": "ext4",
            "size": 1967846068224,
            "used": 1857638305792,
            "available": 10171092992,
            "use": 99.46,
            "mount": "/storage_disks/hdd2",
            "rw": false
        },
        {
            "fs": "/dev/sdd1",
            "type": "ext4",
            "size": 983350071296,
            "used": 891776819200,
            "available": 41546285056,
            "use": 95.55,
            "mount": "/storage_disks/hdd3",
            "rw": false
        }
    ]
}

Frontend

Example Use Case

docker-compose.yml

    volumes:
      - /hdd1:/storage_disks/hdd1:ro 
      - /hdd2:/storage_disks/hdd2:ro
      - /hdd3:/storage_disks/hdd3:ro
      - /hdd4:/storage_disks/hdd4:ro

widgets.yaml

- resources:
    disk: /storage_disks
    expanded: true

Results image

Type of change

Checklist:

shamoon commented 1 month ago

Thanks for the PR. We don’t accept PRs for features without a related feature request, see the guidelines checked off above. Of course we’d be happy to reassess in the future

github-actions[bot] commented 1 week ago

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns. See our contributing guidelines for more details.