CLOUDSTACK-6154: UI > compute offerings > memory field > check if value is undefined before converting it.

(cherry picked from commit d1440217e9)

Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
This commit is contained in:
Jessica Wang 2014-02-21 14:01:52 -08:00 committed by Animesh Chaturvedi
parent a652737f8d
commit bb54099435
2 changed files with 9 additions and 0 deletions

View File

@ -522,6 +522,9 @@
memory: {
label: 'label.memory.mb',
converter: function(args) {
if (args == undefined)
return '';
else
return cloudStack.converters.convertBytes(args * 1024 * 1024);
}
},
@ -1038,6 +1041,9 @@
memory: {
label: 'label.memory.mb',
converter: function(args) {
if (args == undefined)
return '';
else
return cloudStack.converters.convertBytes(args * 1024 * 1024);
}
},

View File

@ -900,6 +900,9 @@ var roleTypeDomainAdmin = "2";
cloudStack.converters = {
convertBytes: function(bytes) {
if (bytes == undefined)
return '';
if (bytes < 1024 * 1024) {
return (bytes / 1024).toFixed(2) + " KB";
} else if (bytes < 1024 * 1024 * 1024) {