Skip to content

Commit

Permalink
✨ Frontend: Connect payments and transactions (ITISFoundation#4704)
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored Sep 6, 2023
1 parent f071e95 commit a045f1d
Show file tree
Hide file tree
Showing 10 changed files with 318 additions and 462 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,15 @@ qx.Class.define("osparc.component.resourceUsage.OverviewTable", {
const serviceName = parts.pop();
newData[cols["service"].pos] = serviceName + ":" + data["service_version"];
}
const startTime = new Date(data["started_at"]);
newData[cols["start"].pos] = osparc.utils.Utils.formatDateAndTime(startTime);
const stopTime = new Date(data["stopped_at"]);
const durationTimeSec = (stopTime - startTime)/1000;
newData[cols["duration"].pos] = durationTimeSec;
if (data["started_at"]) {
const startTime = new Date(data["started_at"]);
newData[cols["start"].pos] = osparc.utils.Utils.formatDateAndTime(startTime);
if (data["stopped_at"]) {
const stopTime = new Date(data["stopped_at"]);
const durationTimeSec = (stopTime - startTime)/1000;
newData[cols["duration"].pos] = durationTimeSec;
}
}
newData[cols["status"].pos] = qx.lang.String.firstUp(data["service_run_status"].toLowerCase());
newData[cols["wallet"].pos] = data["wallet_label"] ? data["wallet_label"] : "unknown";
newData[cols["cost"].pos] = "unknown";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,21 @@ qx.Class.define("osparc.data.Resources", {
}
}
},
/*
* PAYMENTS
*/
"payments": {
endpoints: {
get: {
method: "GET",
url: statics.API + "/wallets/-/payments"
},
post: {
method: "POST",
url: statics.API + "/wallets/{walletId}/payments"
}
}
},
/*
* CLUSTERS
*/
Expand Down
Loading

0 comments on commit a045f1d

Please sign in to comment.