fix: add cb to query builder js
This commit is contained in:
parent
67559e164c
commit
7da67364c4
|
|
@ -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 cssHash = createHash("md5").update(await cssFile.bytes()).digest("hex").slice(0, 8);
|
||||||
const jsFile = Bun.file(resolve(import.meta.dir, "../dashboard/app.js"));
|
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 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" });
|
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> = {}) {
|
export function html(template: string, data: Record<string, unknown> = {}) {
|
||||||
return new Response(eta.render(template, {
|
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,
|
regionColors: REGION_COLORS, regionLabels: REGION_LABELS, regions: REGIONS, planLabels: PLAN_LABELS,
|
||||||
}), {
|
}), {
|
||||||
headers: { "content-type": "text/html; charset=utf-8" },
|
headers: { "content-type": "text/html; charset=utf-8" },
|
||||||
|
|
|
||||||
|
|
@ -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' }) %>
|
<%~ include('./partials/nav', { nav: 'monitors' }) %>
|
||||||
|
|
||||||
<%
|
<%
|
||||||
|
|
|
||||||
|
|
@ -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' }) %>
|
<%~ include('./partials/nav', { nav: 'monitors' }) %>
|
||||||
|
|
||||||
<main class="max-w-2xl mx-auto px-6 py-8">
|
<main class="max-w-2xl mx-auto px-6 py-8">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue