]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - src/Utils.js
bandwidth/utils: move out SizeUnits definition to more common module
[proxmox-widget-toolkit.git] / src / Utils.js
index 9703bd9f2537fc165cdb82ef8ebb950f64bd9184..b8ffd851a1bb20f5eef8a55b938c367e06aa7990 100644 (file)
@@ -664,6 +664,22 @@ utilities: {
        return `${size.toFixed(commaDigits)} ${unit}B`;
     },
 
+    SizeUnits: {
+       'B': 1,
+
+       'KiB': 1024,
+       'MiB': 1024*1024,
+       'GiB': 1024*1024*1024,
+       'TiB': 1024*1024*1024*1024,
+       'PiB': 1024*1024*1024*1024*1024,
+
+       'KB': 1000,
+       'MB': 1000*1000,
+       'GB': 1000*1000*1000,
+       'TB': 1000*1000*1000*1000,
+       'PB': 1000*1000*1000*1000*1000,
+    },
+
     render_upid: function(value, metaData, record) {
        let task = record.data;
        let type = task.type || task.worker_type;