mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-11-07 07:09:46 +00:00
update usb show name
This commit is contained in:
parent
22c7d71f93
commit
991ee424ea
@ -3,6 +3,7 @@ package v1
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -210,6 +211,9 @@ func GetDisksUSBList(c *gin.Context) {
|
|||||||
tempChildren.Size, _ = strconv.ParseUint(child.FSSize, 10, 64)
|
tempChildren.Size, _ = strconv.ParseUint(child.FSSize, 10, 64)
|
||||||
tempChildren.Avail, _ = strconv.ParseUint(child.FSAvail, 10, 64)
|
tempChildren.Avail, _ = strconv.ParseUint(child.FSAvail, 10, 64)
|
||||||
tempChildren.Name = child.Label
|
tempChildren.Name = child.Label
|
||||||
|
if len(tempChildren.Name) == 0 {
|
||||||
|
tempChildren.Name = filepath.Base(child.MountPoint)
|
||||||
|
}
|
||||||
avail, _ := strconv.ParseUint(child.FSAvail, 10, 64)
|
avail, _ := strconv.ParseUint(child.FSAvail, 10, 64)
|
||||||
children = append(children, tempChildren)
|
children = append(children, tempChildren)
|
||||||
temp.Avail += avail
|
temp.Avail += avail
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user