Revision 3b463c5a snf-cyclades-app/synnefo/ui/static/snf/js/quota.js
b/snf-cyclades-app/synnefo/ui/static/snf/js/quota.js | ||
---|---|---|
152 | 152 |
|
153 | 153 |
can_consume: function(key, value) { |
154 | 154 |
return (this.get_available(key) - parseInt(value)) >= 0 |
155 |
}, |
|
156 |
|
|
157 |
get_available_readable: function(key) { |
|
158 |
var value; |
|
159 |
if (this.is_bytes(key)) { |
|
160 |
var value = this.get_available(key); |
|
161 |
if (!value) { return 0 } |
|
162 |
return snf.util.readablizeBytes(value); |
|
163 |
} else { |
|
164 |
return this.get_available(key); |
|
165 |
} |
|
155 | 166 |
} |
156 | 167 |
|
157 | 168 |
}); |
Also available in: Unified diff