ui: refactor calculate_dedup_factor
so that we can reuse this Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
8432e4a655
commit
48d6dede4a
@ -247,6 +247,14 @@ Ext.define('PBS.Utils', {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
calculate_dedup_factor: function(gcstatus) {
|
||||||
|
let dedup = 1.0;
|
||||||
|
if (gcstatus['disk-bytes'] > 0) {
|
||||||
|
dedup = (gcstatus['index-data-bytes'] || 0)/gcstatus['disk-bytes'];
|
||||||
|
}
|
||||||
|
return dedup;
|
||||||
|
},
|
||||||
|
|
||||||
constructor: function() {
|
constructor: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
@ -57,10 +57,7 @@ Ext.define('PBS.DataStoreInfo', {
|
|||||||
|
|
||||||
let gcstatus = store.getById('gc-status').data.value;
|
let gcstatus = store.getById('gc-status').data.value;
|
||||||
|
|
||||||
let dedup = 1.0;
|
let dedup = PBS.Utils.calculate_dedup_factor(gcstatus);
|
||||||
if (gcstatus['disk-bytes'] > 0) {
|
|
||||||
dedup = (gcstatus['index-data-bytes'] || 0)/gcstatus['disk-bytes'];
|
|
||||||
}
|
|
||||||
|
|
||||||
let countstext = function(count) {
|
let countstext = function(count) {
|
||||||
count = count || {};
|
count = count || {};
|
||||||
|
Loading…
Reference in New Issue
Block a user