Skip to content

Commit

Permalink
Display tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJohnnyGault committed Dec 22, 2023
1 parent 4d44e66 commit 7c575bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion public/_head.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<script>
const params = new URLSearchParams(document.location.search);
if (params.get("apiToken")) {
ORC_AUTH_TOKEN = params.get("apiToken");
localStorage.setItem("apiToken", params.get("apiToken"));
}
ORC_AUTH_TOKEN = localStorage.getItem("apiToken");
</script>
{{end}}
11 changes: 6 additions & 5 deletions public/js/orc.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,23 @@ class Orc {
return (this.txLogs || []).map((l) => {
const body = JSON.parse(l.RialtoBody);
const result = l.RialtoResult && JSON.parse(l.RialtoResult);
const out = pick(l, "SSID", "Nonce", "RialtoEndpoint");
const out = {};
out.CreatedAt = DateTime.fromISO(l.CreatedAt).toRelative();
out.TxID = body?.TxID;
out.RialtoEndpoint = l.RialtoEndpoint;
out.Error = l?.ErrorMsg ? "❌" : "";
out.Nonce = l.Nonce;
out.NodeID = body?.NodeID;
// out.SubmittedAt = l?.SubmittedAt?.toLocaleString(DateTime.DATETIME_SHORT);
out.TxID = body?.TxID || result?.TxID;
out.ErrorMsg = l?.ErrorMsg;
out.RialtoBody = { body: JSON.parse(l.RialtoBody) };
out.RialtoResult = { result: l.RialtoResult && JSON.parse(l.RialtoResult) };
out.SSID = l.SSID;
return out;
});
}

refreshDataLoop(fn) {
const poll = async () => {
// console.log("Polling for orc data");
// await this.fetchMinipools();
await this.fetchTxLogs();
fn();
setTimeout(poll, 10000);
Expand Down

0 comments on commit 7c575bf

Please sign in to comment.