diff --git a/src/api2/status.rs b/src/api2/status.rs index 5ea1525d..11b46154 100644 --- a/src/api2/status.rs +++ b/src/api2/status.rs @@ -160,12 +160,11 @@ pub fn datastore_status( // we skip the calculation for datastores with not enough data if usage_list.len() >= 7 { + entry["estimated-full-date"] = Value::from(0); if let Some((a,b)) = linear_regression(&time_list, &usage_list) { if b != 0.0 { let estimate = (1.0 - a) / b; entry["estimated-full-date"] = Value::from(estimate.floor() as u64); - } else { - entry["estimated-full-date"] = Value::from(0); } } } diff --git a/www/Utils.js b/www/Utils.js index 778dad24..4667efb2 100644 --- a/www/Utils.js +++ b/www/Utils.js @@ -277,7 +277,7 @@ Ext.define('PBS.Utils', { }, render_estimate: function(value) { - if (!value) { + if (value === undefined) { return gettext('Not enough data'); }