+
-
@@ -75,76 +81,131 @@ function Gallery({ user, workspace }: { user: string; workspace: string }) {
function SidePanelContent({ node }: { node: Node
}) {
const [status, setStatus] = useState(node.data.status);
const [view, setView] = useQueryState('view');
- const nodeName = useMemo(() => {
- if (!node.type) return undefined;
- switch (node.type) {
- case 'dataset':
- return node.data?.datasetData?.name;
- case 'augmentation':
- return node.data?.augmentationData?.name;
- case 'network':
- return node.data?.networkData?.label;
- case 'finetune':
- const sourceLabel =
- node.data?.finetuneData?.sourceNetworkLabel ?? undefined;
- return sourceLabel
- ? `${sourceLabel} finetune_id: ${node.id}`
- : undefined;
- case 'inference':
- const outputPath = node.data?.inferenceData?.outputPath ?? undefined;
- return outputPath ? `inference ${outputPath}` : undefined;
- default:
- return undefined;
- }
- }, [node]);
if (!node.data) return null;
if (!node.type) return null;
return (
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ View the logs of the job execution.
+
+
+
+
+
+
+
+
+
+ View the error logs of the job execution.
+
+
+
+
+
+
+
+
+
+
+
+ Preview the images generated by the augmentation process.
+ {node.type !== 'augmentation' &&
+ ' Only available for augmentation nodes.'}
+
+
+
+
+
+
+
+
+
+
+
+ View the tensorboard of the training.
+ Only available for busy network or finetune nodes.
+
+
+
+
+
);
}
function NodeInfo({
- name,
type,
nodeData,
+ status,
+ setStatus,
}: {
- name: string | undefined;
type: string;
nodeData: NodeData;
+ status: NodeStatus;
+ setStatus: (status: NodeStatus) => void;
}) {
- const [status, setStatus] = useState(nodeData.status);
const [message, setMessage] = useState(nodeData.message);
+ const nodeName = useMemo(() => {
+ if (!type) return undefined;
+ switch (type) {
+ case 'dataset':
+ return nodeData.datasetData?.name;
+ case 'augmentation':
+ return nodeData.augmentationData?.name;
+ case 'network':
+ return nodeData.networkData?.label;
+ case 'finetune':
+ const sourceLabel =
+ nodeData.finetuneData?.sourceNetworkLabel ?? undefined;
+ return sourceLabel ? `${sourceLabel} finetune` : 'finetune';
+ case 'inference':
+ const outputPath = nodeData.inferenceData?.outputPath ?? '';
+
+ return outputPath;
+ default:
+ return undefined;
+ }
+ }, [type, nodeData]);
const { data: jobData } = api.job.checkStatus.useQuery(
{ jobId: nodeData.jobId ?? '' },
@@ -177,17 +238,20 @@ function NodeInfo({
setStatus('busy');
setMessage(`Job ${nodeData.jobId ?? 'Err'} last checked at ${date}`);
}
- }, [jobData, status, nodeData.jobId]);
+ }, [jobData, status, nodeData.jobId, setStatus]);
return (
- <>
-
-
-
{name ?? 'node'}
+
+
+
{nodeName ?? 'node'}
{message}
- >
+
);
}