Skip to content
Closed
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 Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ wasm-bindgen = "0.2.120"

[package]
name = "rezolus"
version = "5.13.1-alpha.5"
version = "5.13.1-alpha.6"
description = "High resolution systems performance telemetry agent"
edition = "2021"
license.workspace = true
Expand Down
39 changes: 39 additions & 0 deletions site/viewer/lib/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,47 @@ async function loadParquet(data, filename) {
fileMetadata: state.fileMetadata,
selectionPayload: state.selectionPayload,
reportMode,
// Wire the topnav "Load Parquet" button to the same handler the
// landing-page dropzone uses. The server viewer uploads via
// /api/v1/upload; here we take the File bytes and reuse
// loadParquet directly.
onUploadParquet: loadFile,
});
}

// Shared file-upload entry point: reads the File's bytes and runs the
// usual loadParquet flow. Used by both the landing-page Choose-File /
// drop zone and the topnav "Load Parquet" button after a capture is
// already loaded (which destroys the splash and re-enters loadParquet
// with the new bytes — same lifecycle as `loadCapture`).
async function loadFile(file) {
if (!file) return;
const display = file.name || 'capture.parquet';
splashLabel = display;
splashProgress = -1;
landingError = null;
m.redraw();
try {
const data = new Uint8Array(await file.arrayBuffer());
splashLabel = 'Initializing';
splashProgress = -1;
m.redraw();
await loadParquet(data, display);
// Drop any URL params that pinned the previous capture so a
// refresh doesn't fight the just-uploaded file.
const url = new URL(window.location);
url.searchParams.delete('demo');
url.searchParams.delete('demoA');
url.searchParams.delete('demoB');
url.searchParams.delete('capture');
window.history.replaceState(null, '', url);
} catch (e) {
splashLabel = null;
landingError = `Failed to load ${display}: ${e?.message ?? e ?? 'unknown error'}`;
m.redraw();
}
}

// ── Load demo parquet (with download progress) ──────────────────────

// Fetch a parquet by URL or relative path. Relative paths resolve under
Expand Down Expand Up @@ -383,6 +421,7 @@ const Root = {
]));
}
return m('div', m(FileUpload, {
onFile: loadFile,
onDemo: (demo) => {
if (demo && Array.isArray(demo.files) && demo.files.length === 2) {
loadCompareDemo(
Expand Down
Loading