mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
feat(region): fix ISO size display (#23095)
SGuestcdrom.Size is Byte, not MB
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