diff --git a/SearchFrontend/search_ui/src/components/EmbedTimeline.jsx b/SearchFrontend/search_ui/src/components/EmbedTimeline.jsx
index 31a7d04..1eedd0e 100644
--- a/SearchFrontend/search_ui/src/components/EmbedTimeline.jsx
+++ b/SearchFrontend/search_ui/src/components/EmbedTimeline.jsx
@@ -443,16 +443,30 @@ const EmbedTimeline = React.memo(function EmbedTimeline({
// --- Chart Event Handlers ---
async function onChartClick(params, echarts) {
+ let pixel;
const nativeEvent = params.event.event;
- const pixel = [nativeEvent.offsetX, nativeEvent.offsetY];
+
+ // Support both mouse and touch events
+ if (nativeEvent.touches && nativeEvent.touches.length > 0) {
+ // Touch event
+ const rect = nativeEvent.target.getBoundingClientRect();
+ const touch = nativeEvent.touches[0];
+ pixel = [
+ touch.clientX - rect.left,
+ touch.clientY - rect.top
+ ];
+ } else {
+ // Mouse event
+ pixel = [nativeEvent.offsetX, nativeEvent.offsetY];
+ }
+
const dataCoord = echarts.convertFromPixel({ seriesIndex: 0 }, pixel);
const res = await fetch("/api/events/click", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
- timestamp:
- mapVirtualToRealTime(dataCoord[0], breaks, virtualTime) / 1000,
+ timestamp: mapVirtualToRealTime(dataCoord[0], breaks, virtualTime) / 1000,
}),
});
if (!res.ok) throw new Error(`HTTP error: ${res.status}`);
diff --git a/SearchFrontend/search_ui/src/components/StatusDisplay.jsx b/SearchFrontend/search_ui/src/components/StatusDisplay.jsx
index fa12460..0b7c9c4 100644
--- a/SearchFrontend/search_ui/src/components/StatusDisplay.jsx
+++ b/SearchFrontend/search_ui/src/components/StatusDisplay.jsx
@@ -2,6 +2,37 @@ import { useTable } from "react-table";
import { useMemo } from "react";
import "./StatusDisplay.css";
+function ProgressBar({ progress, total }) {
+ const percent = total ? Math.round((progress / total) * 100) : 0;
+ return (
+
+
+
+ {progress}/{total} ({percent}%)
+
+
+ );
+}
+
export default function StatusesDisplayHUD({ statusMessages }) {
const msg = {};
const dataPre = {};
@@ -9,7 +40,19 @@ export default function StatusesDisplayHUD({ statusMessages }) {
{ Header: "When", accessor: "WHEN" },
{ Header: "Scheduled", accessor: "SCHEDULED" },
{ Header: "Queued", accessor: "QUEUED" },
- { Header: "Processing", accessor: "VECTOR_CALC" },
+ {
+ Header: "Processing",
+ accessor: "VECTOR_CALC",
+ Cell: ({ value }) =>
+ value && value.type === "progress" ? (
+
+ ) : (
+ value || ""
+ ),
+ },
{ Header: "Calculating", accessor: "SCORE_CALC" },
{ Header: "Status", accessor: "STATUS" },
];
@@ -55,8 +98,13 @@ export default function StatusesDisplayHUD({ statusMessages }) {
m["progress"] +
"/" +
m["how_many"];
- dataPre[when_key]["VECTOR_CALC"] =
- m["progress"] + "/" + m["how_many"];
+ // dataPre[when_key]["VECTOR_CALC"] =
+ // m["progress"] + "/" + m["how_many"];
+ dataPre[when_key]["VECTOR_CALC"] = {
+ progress: m["progress"],
+ how_many: m["how_many"],
+ type: "progress",
+ };
break;
case "VECTOR_CALC_IN_FOLDER_DONE":
msg_show = "Finished processing videos";
@@ -72,7 +120,7 @@ export default function StatusesDisplayHUD({ statusMessages }) {
msg_show = c_task;
}
msg[when_key] = msg_show;
- console.log(when_key);
+ // console.log(when_key);
dataPre[when_key]["STATUS"] = msg_show;
}
});
@@ -86,48 +134,42 @@ export default function StatusesDisplayHUD({ statusMessages }) {
const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } =
useTable({ columns: columnsMemo, data });
- return (
-
-
- {rows.length > 0 && (
-
- {headerGroups.map((headerGroup) => (
-
- {headerGroup.headers.map((column) => (
- |
- {column.render("Header")}
- |
- ))}
-
- ))}
-
- )}
-
- {rows.map((row) => {
- prepareRow(row);
- return (
-
- {row.cells.map((cell) => (
- |
- {cell.render("Cell")}
- |
- ))}
-
- );
- })}
-
-
-
- );
-
return (
- {Object.entries(msg).map(([when, messages], idx) => (
-
- ))}
+ {rows.length > 0 && (
+
+
+
+ {headerGroups.map((headerGroup) => (
+
+ {headerGroup.headers.map((column) => (
+ |
+ {column.render("Header")}
+ |
+ ))}
+
+ ))}
+
+
+ {rows.map((row) => {
+ prepareRow(row);
+ return (
+
+ {row.cells.map((cell) => (
+ |
+ {cell.render("Cell")}
+ |
+ ))}
+
+ );
+ })}
+
+
+
+ )}
);
}