Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonlight-protocol/provider-console",
"version": "0.3.2",
"version": "0.3.3",
"license": "MIT",
"tasks": {
"dev": "deno run --allow-all --allow-env --watch src/server.ts",
Expand Down
17 changes: 14 additions & 3 deletions src/views/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ function fmtRelativeTime(epochMs: number, now: number): string {
return `${hr}h ago`;
}

/** Absolute, human-readable date with hour:minute (24h), e.g. "Jun 12, 2026, 18:16". */
function fmtDateTime(epochMs: number): string {
return new Date(epochMs).toLocaleString(undefined, {
year: "numeric",
month: "short",
day: "numeric",
hour: "2-digit",
minute: "2-digit",
hour12: false,
});
}

function withBriefCopyFeedback(btn: HTMLElement): void {
const orig = btn.innerHTML;
btn.innerHTML =
Expand Down Expand Up @@ -221,7 +233,7 @@ function renderTemplate(
</div>

<h3 style="margin:2rem 0 0.5rem">Entities</h3>
<div id="entities-section" class="stat-card" style="padding:0.75rem 1rem;margin-bottom:2rem">
<div id="entities-section" style="margin-bottom:2rem">
<div id="entities-body" style="color:var(--text-muted);font-size:0.85rem">Loading entities…</div>
</div>
`;
Expand Down Expand Up @@ -336,9 +348,8 @@ async function renderEntitiesSection(
return;
}

const now = Date.now();
const rows = entities.map((e) => {
const date = fmtRelativeTime(new Date(e.updatedAt).getTime(), now);
const date = fmtDateTime(new Date(e.updatedAt).getTime());
return `
<tr>
<td style="white-space:nowrap;color:var(--text-muted)">${
Expand Down
Loading