landing: kGOA units, full money stats, rootless resource display
Public bank/exchange/merchant landing stats and performance UI only. Secret goa-ui overlay stays on local/merchant-secret-ui (never push).
This commit is contained in:
parent
bf8a915a01
commit
fb1a0b0b8e
12 changed files with 1046 additions and 333 deletions
|
|
@ -273,6 +273,15 @@
|
|||
.stats-run-note {
|
||||
margin: 0.35rem 0 0; font-size: 0.7rem; color: #f0a090; text-align: center;
|
||||
}
|
||||
.unit-legend {
|
||||
margin: 0.45rem auto 0; border-collapse: collapse; font-size: 0.68rem; color: var(--muted);
|
||||
display: inline-table;
|
||||
}
|
||||
.unit-legend th, .unit-legend td {
|
||||
padding: 0.1rem 0.4rem; border-bottom: 1px solid rgba(167, 139, 250, 0.15); text-align: left;
|
||||
}
|
||||
.unit-legend th { font-weight: 700; font-size: 0.6rem; text-transform: uppercase; }
|
||||
.unit-legend strong { color: var(--goa); }
|
||||
.step-card {
|
||||
background: var(--card); border: 1px solid var(--border); border-radius: 18px;
|
||||
padding: 1.3rem 1.25rem 1.4rem; margin-bottom: 1.2rem;
|
||||
|
|
@ -704,12 +713,12 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
|||
|
||||
|
||||
<section class="stats" id="stats" aria-labelledby="stats-title">
|
||||
<h2 id="stats-title">Merchant stats</h2>
|
||||
<p class="note">From merchant DB · dual currency side by side</p>
|
||||
<h2 id="stats-title">Merchant stats · all payments</h2>
|
||||
<p class="note">From merchant DB · dual currency · large GOA as kGOA / MGOA / …</p>
|
||||
<div class="stats-grid">
|
||||
<div class="stat"><span class="k">Instances</span><span class="v teal" id="st-instances">—</span></div>
|
||||
<div class="stat"><span class="k">Orders</span><span class="v" id="st-orders">—</span></div>
|
||||
<div class="stat"><span class="k">Paid</span><span class="v teal" id="st-paid">—</span></div>
|
||||
<div class="stat"><span class="k">All orders</span><span class="v" id="st-orders">—</span></div>
|
||||
<div class="stat"><span class="k">All paid</span><span class="v teal" id="st-paid">—</span></div>
|
||||
<div class="stat"><span class="k">Unpaid</span><span class="v" id="st-unpaid">—</span></div>
|
||||
<div class="stat"><span class="k">Wired</span><span class="v" id="st-wired">—</span></div>
|
||||
<div class="stat"><span class="k">Refunds</span><span class="v" id="st-refunds">—</span></div>
|
||||
|
|
@ -721,29 +730,31 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
|||
<div class="cur-name">GOA</div>
|
||||
<div class="cur-sub">explorational · hacktivism</div>
|
||||
<span class="amt-big" id="goa-paid-amt">—</span>
|
||||
<span class="amt-label">paid volume</span>
|
||||
<span class="amt-label">all paid volume</span>
|
||||
<div class="cur-meta">
|
||||
<div><span class="mk">Orders</span><span class="mv" id="goa-orders">—</span></div>
|
||||
<div><span class="mk">Paid</span><span class="mv" id="goa-paid">—</span></div>
|
||||
<div><span class="mk">Wired</span><span class="mv" id="goa-wired">—</span></div>
|
||||
<div><span class="mk">Unpaid</span><span class="mv" id="goa-unpaid">—</span></div>
|
||||
</div>
|
||||
<div class="amt-secondary">all orders <strong id="goa-all-amt">—</strong></div>
|
||||
<div class="amt-secondary">all orders volume <strong id="goa-all-amt">—</strong></div>
|
||||
</div>
|
||||
<div class="cur-panel chf" id="panel-chf">
|
||||
<div class="cur-name">CHF</div>
|
||||
<div class="cur-sub">taler-ops</div>
|
||||
<span class="amt-big" id="chf-paid-amt">—</span>
|
||||
<span class="amt-label">paid volume</span>
|
||||
<span class="amt-label">all paid volume</span>
|
||||
<div class="cur-meta">
|
||||
<div><span class="mk">Orders</span><span class="mv" id="chf-orders">—</span></div>
|
||||
<div><span class="mk">Paid</span><span class="mv" id="chf-paid">—</span></div>
|
||||
<div><span class="mk">Wired</span><span class="mv" id="chf-wired">—</span></div>
|
||||
<div><span class="mk">Unpaid</span><span class="mv" id="chf-unpaid">—</span></div>
|
||||
</div>
|
||||
<div class="amt-secondary">all orders <strong id="chf-all-amt">—</strong></div>
|
||||
<div class="amt-secondary">all orders volume <strong id="chf-all-amt">—</strong></div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="note" style="margin-top:0.65rem;text-align:center;font-size:0.68rem">Unit names for large GOA</p>
|
||||
<div id="st-unit-legend" style="text-align:center"></div>
|
||||
<p class="stats-foot" id="st-foot">Loading…</p>
|
||||
<p class="stats-run-note" id="st-run-note" hidden></p>
|
||||
</section>
|
||||
|
|
@ -755,22 +766,24 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
|||
<div class="stat"><span class="k">/config</span><span class="v teal" id="st-config-ms">—</span></div>
|
||||
<div class="stat"><span class="k">/terms</span><span class="v" id="st-terms-ms">—</span></div>
|
||||
<div class="stat"><span class="k">/webui/</span><span class="v" id="st-webui-ms">—</span></div>
|
||||
<div class="stat"><span class="k">Loadavg</span><span class="v sm" id="st-load">—</span></div>
|
||||
<div class="stat"><span class="k">Container</span><span class="v teal" id="st-mem-ctr">—</span></div>
|
||||
<div class="stat"><span class="k">CPU (container)</span><span class="v teal" id="st-cpu">—</span></div>
|
||||
<div class="stat"><span class="k">Loadavg (host)</span><span class="v sm" id="st-load">—</span></div>
|
||||
<div class="stat"><span class="k">PIDs</span><span class="v" id="st-pids">—</span></div>
|
||||
<div class="stat"><span class="k">Container RSS</span><span class="v teal" id="st-mem-ctr">—</span></div>
|
||||
<div class="stat"><span class="k">PostgreSQL</span><span class="v" id="st-mem-pg">—</span></div>
|
||||
<div class="stat"><span class="k">Taler procs</span><span class="v" id="st-mem-taler">—</span></div>
|
||||
<div class="stat"><span class="k">Nginx</span><span class="v sm" id="st-mem-nginx">—</span></div>
|
||||
</div>
|
||||
<div style="margin-top:0.85rem;overflow-x:auto">
|
||||
<p class="note" style="margin-bottom:0.4rem">Top processes (RSS)</p>
|
||||
<p class="note" style="margin-bottom:0.4rem">Top processes (RSS inside container)</p>
|
||||
<div id="st-mem-top"></div>
|
||||
</div>
|
||||
<p class="stats-foot" id="st-perf-foot">Memory from /proc + cgroup inside podman container.</p>
|
||||
<p class="stats-foot" id="st-perf-foot">RSS from /proc inside container (no memory cgroup in rootless podman). CPU from podman stats.</p>
|
||||
</section>
|
||||
|
||||
<section class="stats" id="activity" aria-labelledby="act-title">
|
||||
<h2 id="act-title">Recent activity</h2>
|
||||
<p class="note">Latest 5 payments & refunds per currency</p>
|
||||
<h2 id="act-title">Latest payments</h2>
|
||||
<p class="note">Latest payments & refunds per currency (all paid totals above)</p>
|
||||
<div class="act-pair" id="st-activity-pair">
|
||||
<div class="act-col goa" aria-labelledby="act-goa-h">
|
||||
<h3 class="act-col-h" id="act-goa-h">GOA</h3>
|
||||
|
|
@ -812,6 +825,7 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
|||
</footer>
|
||||
</main>
|
||||
<script src="/intro/goa-amount.js"></script>
|
||||
<script src="/intro/goa-ui.js" defer></script>
|
||||
<script>
|
||||
/* Fallback if goa-amount.js not yet deployed (uses amount_alt from stats.json) */
|
||||
(function () {
|
||||
|
|
@ -903,7 +917,10 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
|||
.then(function (r) { if (!r.ok) throw new Error("http"); return r.json(); })
|
||||
.then(function (d) {
|
||||
if (!d || !d.ok) throw new Error("bad");
|
||||
if (window.GoaAmount) GoaAmount.rememberAlt(d);
|
||||
if (window.GoaAmount) {
|
||||
GoaAmount.rememberAlt(d);
|
||||
if (GoaAmount.fillLegend) GoaAmount.fillLegend("st-unit-legend", d);
|
||||
}
|
||||
set("st-instances", d.instances);
|
||||
set("st-orders", d.orders);
|
||||
set("st-paid", d.paid);
|
||||
|
|
@ -931,11 +948,16 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
|||
var li = document.createElement("li");
|
||||
li.className = "act-item";
|
||||
// no merchant names / ids — amount, optional summary, time only
|
||||
var amtShow = a.amount_alt || a.amount || "—";
|
||||
if (window.GoaAmount && !a.amount_alt) {
|
||||
amtShow = GoaAmount.format(a.amount, d.alt_unit_names).display;
|
||||
var amtShow = a.amount || "—";
|
||||
var amtTitle = a.amount || "";
|
||||
if (window.GoaAmount) {
|
||||
var af = GoaAmount.pick(a, d.alt_unit_names);
|
||||
amtShow = af.display;
|
||||
amtTitle = af.title || a.amount || "";
|
||||
} else if (a.amount_alt) {
|
||||
amtShow = a.amount_alt;
|
||||
amtTitle = a.amount_full || a.amount || "";
|
||||
}
|
||||
var amtTitle = a.amount_full || a.amount || "";
|
||||
li.innerHTML =
|
||||
'<span class="act-kind ' + esc(kind) + '">' + esc(kind) + "</span>" +
|
||||
'<div class="act-main">' +
|
||||
|
|
@ -963,8 +985,8 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
|||
if (cur === "GOA") byCur.GOA.push(a);
|
||||
else if (cur === "CHF") byCur.CHF.push(a);
|
||||
});
|
||||
byCur.GOA = byCur.GOA.slice(0, 5);
|
||||
byCur.CHF = byCur.CHF.slice(0, 5);
|
||||
byCur.GOA = byCur.GOA.slice(0, 10);
|
||||
byCur.CHF = byCur.CHF.slice(0, 10);
|
||||
}
|
||||
fillActivityList(document.getElementById("st-activity-goa"), byCur.GOA);
|
||||
fillActivityList(document.getElementById("st-activity-chf"), byCur.CHF);
|
||||
|
|
@ -973,26 +995,39 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
|||
foot.textContent = (d.dual_currency ? "Dual-currency · " : "") +
|
||||
(d.generated_at_human || d.generated_at || "");
|
||||
}
|
||||
function escHtml(s) {
|
||||
return String(s == null ? "" : s)
|
||||
.replace(/&/g, "&").replace(/</g, "<")
|
||||
.replace(/>/g, ">").replace(/"/g, """);
|
||||
}
|
||||
function setMem(id, human, n, bytes) {
|
||||
var el = document.getElementById(id);
|
||||
if (!el) return;
|
||||
if (!human && human !== 0) {
|
||||
var b = bytes != null && bytes !== "" ? Number(bytes) : NaN;
|
||||
var nn = n != null && n !== "" ? Number(n) : NaN;
|
||||
var empty =
|
||||
human == null || human === "" || human === "—" ||
|
||||
human === "0 B" || human === "0B" ||
|
||||
(isFinite(b) && b <= 0 && (!isFinite(nn) || nn <= 0));
|
||||
if (empty) {
|
||||
el.textContent = "—";
|
||||
el.removeAttribute("title");
|
||||
return;
|
||||
}
|
||||
var h = String(human);
|
||||
if (n != null && n !== "" && Number(n) > 0) h += " · " + n + "p";
|
||||
if (isFinite(nn) && nn > 0) h += " · " + nn + "p";
|
||||
el.textContent = h;
|
||||
if (bytes != null && bytes !== "" && Number(bytes) > 0) {
|
||||
el.setAttribute("title", Number(bytes).toLocaleString("en-US") + " B");
|
||||
if (isFinite(b) && b > 0) {
|
||||
el.setAttribute("title", b.toLocaleString("en-US") + " B");
|
||||
} else el.removeAttribute("title");
|
||||
}
|
||||
var p = d.performance || {};
|
||||
set("st-config-ms", msLabel(p.config_ms, p.config_http));
|
||||
set("st-terms-ms", msLabel(p.terms_ms, p.terms_http));
|
||||
set("st-webui-ms", msLabel(p.webui_ms, p.webui_http));
|
||||
set("st-cpu", p.cpu_percent_label || (p.cpu_percent != null ? (Number(p.cpu_percent).toFixed(2) + "%") : "—"));
|
||||
set("st-load", p.loadavg || "—");
|
||||
set("st-pids", p.pids != null ? p.pids : ((p.memory && p.memory.pids) != null ? p.memory.pids : "—"));
|
||||
var mem = p.memory || {};
|
||||
setMem("st-mem-ctr", mem.container_rss_label || mem.container_rss_human || "—", null, mem.container_rss_bytes);
|
||||
setMem("st-mem-pg", mem.postgres_rss_human, mem.postgres_n, mem.postgres_rss_bytes);
|
||||
|
|
@ -1013,12 +1048,12 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
|||
var cmdFull = t.cmd_full || cmd;
|
||||
if (cmd.length > 64) cmd = cmd.slice(0, 61) + "…";
|
||||
th += '<tr><td style="padding:0.25rem;color:#5eead4" title="' +
|
||||
(t.rss_bytes != null ? Number(t.rss_bytes).toLocaleString("en-US") + " B" : "") + '">' +
|
||||
(t.rss_human || "?") +
|
||||
'</td><td style="padding:0.25rem">' + (t.comm || "") +
|
||||
escHtml(t.rss_bytes != null ? Number(t.rss_bytes).toLocaleString("en-US") + " B" : "") + '">' +
|
||||
escHtml(t.rss_human || "?") +
|
||||
'</td><td style="padding:0.25rem">' + escHtml(t.comm || "") +
|
||||
'</td><td style="padding:0.25rem;word-break:break-all;color:var(--muted)" title="' +
|
||||
String(cmdFull).replace(/"/g, """) + '">' +
|
||||
cmd + "</td></tr>";
|
||||
escHtml(cmdFull) + '">' +
|
||||
escHtml(cmd) + "</td></tr>";
|
||||
});
|
||||
th += "</tbody></table>";
|
||||
topBox.innerHTML = th;
|
||||
|
|
@ -1026,9 +1061,11 @@ sudo apt-get install -y taler-wallet-cli</pre>
|
|||
}
|
||||
var pf = document.getElementById("st-perf-foot");
|
||||
if (pf) {
|
||||
pf.textContent = "Container RSS + process groups" +
|
||||
(mem.source ? " · " + mem.source : "") + " · " +
|
||||
(d.generated_at_human || d.generated_at || "");
|
||||
var basis = mem.memory_basis === "cgroup" ? "cgroup" : "proc RSS sum";
|
||||
pf.textContent = "Memory: " + basis +
|
||||
(mem.source ? " · " + mem.source : "") +
|
||||
(p.loadavg_source ? " · loadavg=" + p.loadavg_source : "") +
|
||||
" · " + (d.generated_at_human || d.generated_at || "");
|
||||
}
|
||||
return fetch("/intro/stats-run.json", { cache: "no-store" })
|
||||
.then(function (r) { return r.ok ? r.json() : null; })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue