@blockrun/franklin 3.6.11 → 3.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/panel/html.js +14 -4
- package/dist/panel/server.js +5 -1
- package/dist/social/browser.js +2 -0
- package/package.json +1 -1
package/dist/panel/html.js
CHANGED
|
@@ -456,6 +456,13 @@ async function loadOverview() {
|
|
|
456
456
|
api('wallet'), api('stats'), api('insights?days=30')
|
|
457
457
|
]);
|
|
458
458
|
|
|
459
|
+
// Surface API errors so users see "offline" instead of silent "—"
|
|
460
|
+
if (!wallet && !stats) {
|
|
461
|
+
const err = document.getElementById('total-cost');
|
|
462
|
+
if (err) err.textContent = 'API offline';
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
|
|
459
466
|
if (wallet) {
|
|
460
467
|
document.getElementById('balance').textContent = usdBig(wallet.balance) + ' USDC';
|
|
461
468
|
document.getElementById('wallet-chain').textContent = wallet.chain;
|
|
@@ -495,11 +502,14 @@ async function loadOverview() {
|
|
|
495
502
|
).join('');
|
|
496
503
|
}
|
|
497
504
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
505
|
+
// Backend returns insights.daily with [{date, requests, costUsd}]
|
|
506
|
+
const dailyData = insights && (insights.daily || insights.dailyCosts);
|
|
507
|
+
if (dailyData && dailyData.length) {
|
|
508
|
+
const days = dailyData.slice(-30);
|
|
509
|
+
const getCost = (d) => d.costUsd !== undefined ? d.costUsd : d.cost || 0;
|
|
510
|
+
const maxDay = Math.max(...days.map(getCost), 0.001);
|
|
501
511
|
document.getElementById('daily-chart').innerHTML = days.map(d =>
|
|
502
|
-
'<div class="daily-bar" data-tip="' + d.date + ': ' + usd(d
|
|
512
|
+
'<div class="daily-bar" data-tip="' + d.date + ': ' + usd(getCost(d)) + '" style="height:' + Math.max(getCost(d)/maxDay*100, 2) + '%"></div>'
|
|
503
513
|
).join('');
|
|
504
514
|
}
|
|
505
515
|
}
|
package/dist/panel/server.js
CHANGED
|
@@ -40,7 +40,11 @@ export function createPanelServer(port) {
|
|
|
40
40
|
const p = url.pathname;
|
|
41
41
|
// ─── HTML ──
|
|
42
42
|
if (p === '/') {
|
|
43
|
-
res.writeHead(200, {
|
|
43
|
+
res.writeHead(200, {
|
|
44
|
+
'Content-Type': 'text/html; charset=utf-8',
|
|
45
|
+
'Cache-Control': 'no-store, no-cache, must-revalidate',
|
|
46
|
+
'Pragma': 'no-cache',
|
|
47
|
+
});
|
|
44
48
|
res.end(html);
|
|
45
49
|
return;
|
|
46
50
|
}
|
package/dist/social/browser.js
CHANGED
|
@@ -145,6 +145,8 @@ export class SocialBrowser {
|
|
|
145
145
|
async snapshot() {
|
|
146
146
|
this.requirePage();
|
|
147
147
|
// Playwright's accessibility snapshot returns a full AX tree
|
|
148
|
+
// page.accessibility was removed from Playwright types in v1.46 but still works at runtime
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
148
150
|
const axRoot = await this.page.accessibility.snapshot({ interestingOnly: false });
|
|
149
151
|
if (!axRoot)
|
|
150
152
|
return '';
|
package/package.json
CHANGED