fix: add cb to query builder js

This commit is contained in:
nate 2026-04-08 13:44:56 +04:00
parent 67559e164c
commit 7da67364c4
3 changed files with 5 additions and 3 deletions

View File

@ -11,6 +11,8 @@ const cssFile = Bun.file(resolve(import.meta.dir, "../dashboard/tailwind.css"));
const cssHash = createHash("md5").update(await cssFile.bytes()).digest("hex").slice(0, 8);
const jsFile = Bun.file(resolve(import.meta.dir, "../dashboard/app.js"));
const jsHash = createHash("md5").update(await jsFile.bytes()).digest("hex").slice(0, 8);
const qbFile = Bun.file(resolve(import.meta.dir, "../dashboard/query-builder.js"));
const qbHash = createHash("md5").update(await qbFile.bytes()).digest("hex").slice(0, 8);
const eta = new Eta({ views: resolve(import.meta.dir, "../views"), cache: true, defaultExtension: ".ejs" });
@ -131,7 +133,7 @@ function redirect(to: string) {
export function html(template: string, data: Record<string, unknown> = {}) {
return new Response(eta.render(template, {
...data, timeAgoSSR, sparklineSSR, pickBestRegion, latencyChartSSR, escapeHtmlSSR, cssHash, jsHash,
...data, timeAgoSSR, sparklineSSR, pickBestRegion, latencyChartSSR, escapeHtmlSSR, cssHash, jsHash, qbHash,
regionColors: REGION_COLORS, regionLabels: REGION_LABELS, regions: REGIONS, planLabels: PLAN_LABELS,
}), {
headers: { "content-type": "text/html; charset=utf-8" },

View File

@ -1,4 +1,4 @@
<%~ include('./partials/head', { title: 'Monitor', scripts: ['/dashboard/query-builder.js'] }) %>
<%~ include('./partials/head', { title: 'Monitor', scripts: ['/dashboard/query-builder.js?v=' + it.qbHash] }) %>
<%~ include('./partials/nav', { nav: 'monitors' }) %>
<%

View File

@ -1,4 +1,4 @@
<%~ include('./partials/head', { title: 'New Monitor', scripts: ['/dashboard/query-builder.js'] }) %>
<%~ include('./partials/head', { title: 'New Monitor', scripts: ['/dashboard/query-builder.js?v=' + it.qbHash] }) %>
<%~ include('./partials/nav', { nav: 'monitors' }) %>
<main class="max-w-2xl mx-auto px-6 py-8">