UI: add job details page and auto-refresh in JobHistory\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This commit is contained in:
2026-05-16 14:52:51 +02:00
parent 2585734f6a
commit 424a2fc6d5
2 changed files with 75 additions and 7 deletions
+4 -7
View File
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from "react";
import { useNavigate } from "react-router";
interface Props {
ticker: string;
@@ -29,6 +30,8 @@ export default function JobHistory({ ticker }: Props) {
useEffect(() => {
fetchJobs();
const id = setInterval(fetchJobs, 8000);
return () => clearInterval(id);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [ticker]);
@@ -68,13 +71,7 @@ export default function JobHistory({ ticker }: Props) {
<div className="flex items-center gap-2">
<a href={`/api/jobs/${j.id}`} target="_blank" rel="noreferrer" className="text-sm text-blue-600 hover:underline">API</a>
<button
onClick={() => {
if (selected?.id === j.id) {
setSelected(null);
return;
}
fetchDetails(j.id);
}}
onClick={() => navigate(`/jobs/${j.id}`)}
className="text-sm text-gray-700 underline"
>
Details