Skip to content

Commit

Permalink
Merge branch 'master' into enh/user-notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored Nov 4, 2024
2 parents 8ca9802 + 24445c0 commit e21037e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ qx.Class.define("osparc.store.Services", {
let serviceLatest = servicesLatest[key];
if (excludeFrontend && key.includes("simcore/services/frontend/")) {
// do not add frontend services
return;
continue;
}
if (excludeDeprecated && serviceLatest["retired"]) {
// first check if a previous version of this service isn't retired
Expand All @@ -68,13 +68,14 @@ qx.Class.define("osparc.store.Services", {
for (let j=0; j<versions.length; j++) {
const version = versions[j];
if (!this.servicesCached[key][version]["retired"]) {
// one older non retired version found
serviceLatest = await this.getService(key, version);
break;
}
}
if (serviceLatest["retired"]) {
// do not add retired services
return;
continue;
}
}
servicesList.push(serviceLatest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,12 +720,14 @@ qx.Class.define("osparc.utils.Utils", {
if (!+bytes) {
return "0 Bytes";
}

const k = 1000;
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
const dm = decimals < 0 ? 0 : decimals;

const i = Math.floor(Math.log(bytes) / Math.log(k))
return `${isDecimalCollapsed ? parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) : (bytes / Math.pow(k, i)).toFixed(dm)} ${sizes[i]}`
const i = Math.floor(Math.log(bytes) / Math.log(k));
const value = (bytes / Math.pow(k, i)).toFixed(dm);
const metrics = ["Bytes", "kB", "MB", "GB", "TB"];
const metric = i < metrics.length ? metrics[i] : "";
return `${isDecimalCollapsed ? parseFloat(value) : value} ${metric}`
},

bytesToGB: function(bytes) {
Expand Down

0 comments on commit e21037e

Please sign in to comment.