Upload files to "/"
This commit is contained in:
@@ -206,6 +206,9 @@
|
|||||||
const LIMIT = 1000;
|
const LIMIT = 1000;
|
||||||
const results = [];
|
const results = [];
|
||||||
|
|
||||||
|
// Total search time only
|
||||||
|
const t0 = performance.now();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setStatus(`searching for "${term}"...`);
|
setStatus(`searching for "${term}"...`);
|
||||||
outEl.textContent = `Searching: "${term}"`;
|
outEl.textContent = `Searching: "${term}"`;
|
||||||
@@ -282,7 +285,8 @@
|
|||||||
`Found ${results.length} match(es) for "${term}" (showing up to ${LIMIT}):\n\n` + lines.join("\n");
|
`Found ${results.length} match(es) for "${term}" (showing up to ${LIMIT}):\n\n` + lines.join("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
setStatus("done.");
|
const t1 = performance.now();
|
||||||
|
setStatus(`done. Search time: ${(t1 - t0).toFixed(0)} ms`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
setStatus("failed.");
|
setStatus("failed.");
|
||||||
|
|||||||
@@ -209,6 +209,9 @@
|
|||||||
// Build a quick lookup for headers by file name
|
// Build a quick lookup for headers by file name
|
||||||
const headersByFile = new Map(datasets.map(d => [d.fileName, d.headers]));
|
const headersByFile = new Map(datasets.map(d => [d.fileName, d.headers]));
|
||||||
|
|
||||||
|
// Total search time only
|
||||||
|
const t0 = performance.now();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setStatus(`searching for "${term}"...`);
|
setStatus(`searching for "${term}"...`);
|
||||||
outEl.textContent = `Searching: "${term}"`;
|
outEl.textContent = `Searching: "${term}"`;
|
||||||
@@ -298,7 +301,8 @@
|
|||||||
lines.join("\n\n");
|
lines.join("\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
setStatus("done.");
|
const t1 = performance.now();
|
||||||
|
setStatus(`done. Search time: ${(t1 - t0).toFixed(0)} ms`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
setStatus("failed.");
|
setStatus("failed.");
|
||||||
|
|||||||
@@ -206,6 +206,9 @@
|
|||||||
const LIMIT = 1000;
|
const LIMIT = 1000;
|
||||||
const results = [];
|
const results = [];
|
||||||
|
|
||||||
|
// Total search time only
|
||||||
|
const t0 = performance.now();
|
||||||
|
|
||||||
// Build a quick lookup for headers by file name
|
// Build a quick lookup for headers by file name
|
||||||
const headersByFile = new Map(datasets.map(d => [d.fileName, d.headers]));
|
const headersByFile = new Map(datasets.map(d => [d.fileName, d.headers]));
|
||||||
|
|
||||||
@@ -355,7 +358,8 @@
|
|||||||
lines.join("\n\n");
|
lines.join("\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
setStatus("done.");
|
const t1 = performance.now();
|
||||||
|
setStatus(`done. Search time: ${(t1 - t0).toFixed(0)} ms`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
setStatus("failed.");
|
setStatus("failed.");
|
||||||
|
|||||||
Reference in New Issue
Block a user