mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
feat(region): fix ISO size display (#23128)
SGuestcdrom.Size is Byte, not MB Co-authored-by: happygame <happygame1024@gmail.com>
This commit is contained in:
@@ -136,7 +136,9 @@ func (self *SGuestcdrom) GetImage() (*SCachedimage, error) {
|
||||
func (self *SGuestcdrom) GetDetails() string {
|
||||
if len(self.ImageId) > 0 {
|
||||
if self.Size > 0 {
|
||||
return fmt.Sprintf("%s(%s/%dMB)", self.Name, self.ImageId, self.Size)
|
||||
// Size is stored in bytes, convert to MB for display
|
||||
sizeMB := self.Size / 1024 / 1024
|
||||
return fmt.Sprintf("%s(%s/%dMB)", self.Name, self.ImageId, sizeMB)
|
||||
} else {
|
||||
return fmt.Sprintf("%s(inserting)", self.ImageId)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user