fix: resolve merge conflicts
This commit is contained in:
@@ -375,7 +375,7 @@ const RobotCreate: React.FC = () => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Typography variant="body2" color="text.secondary" mb={3}>
|
<Typography variant="body2" color="text.secondary" mb={3}>
|
||||||
Turn websites into LLM-ready Markdown or clean HTML content for AI apps.
|
Turn websites into LLM-ready Markdown & clean HTML for AI apps.
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Box sx={{ width: '100%', maxWidth: 700, mb: 2 }}>
|
<Box sx={{ width: '100%', maxWidth: 700, mb: 2 }}>
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [tab, setTab] = React.useState<string>('output');
|
const [tab, setTab] = React.useState<string>('output');
|
||||||
const [markdownContent, setMarkdownContent] = useState<string>('');
|
const [markdownContent, setMarkdownContent] = useState<string>('');
|
||||||
|
const [htmlContent, setHtmlContent] = useState<string>('');
|
||||||
|
|
||||||
const [schemaData, setSchemaData] = useState<any[]>([]);
|
const [schemaData, setSchemaData] = useState<any[]>([]);
|
||||||
const [schemaColumns, setSchemaColumns] = useState<string[]>([]);
|
const [schemaColumns, setSchemaColumns] = useState<string[]>([]);
|
||||||
@@ -65,14 +66,25 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe
|
|||||||
}, [interpretationInProgress]);
|
}, [interpretationInProgress]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setMarkdownContent('');
|
||||||
|
setHtmlContent('');
|
||||||
|
|
||||||
if (row.serializableOutput?.markdown && Array.isArray(row.serializableOutput.markdown)) {
|
if (row.serializableOutput?.markdown && Array.isArray(row.serializableOutput.markdown)) {
|
||||||
const markdownData = row.serializableOutput.markdown[0];
|
const markdownData = row.serializableOutput.markdown[0];
|
||||||
if (markdownData && markdownData.content) {
|
if (markdownData?.content) {
|
||||||
setMarkdownContent(markdownData.content);
|
setMarkdownContent(markdownData.content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (row.serializableOutput?.html && Array.isArray(row.serializableOutput.html)) {
|
||||||
|
const htmlData = row.serializableOutput.html[0];
|
||||||
|
if (htmlData?.content) {
|
||||||
|
setHtmlContent(htmlData.content);
|
||||||
|
}
|
||||||
|
}
|
||||||
}, [row.serializableOutput]);
|
}, [row.serializableOutput]);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (row.status === 'running' || row.status === 'queued' || row.status === 'scheduled') {
|
if (row.status === 'running' || row.status === 'queued' || row.status === 'scheduled') {
|
||||||
setSchemaData([]);
|
setSchemaData([]);
|
||||||
@@ -663,68 +675,75 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe
|
|||||||
const hasData = schemaData.length > 0 || listData.length > 0 || legacyData.length > 0;
|
const hasData = schemaData.length > 0 || listData.length > 0 || legacyData.length > 0;
|
||||||
const hasScreenshots = row.binaryOutput && Object.keys(row.binaryOutput).length > 0;
|
const hasScreenshots = row.binaryOutput && Object.keys(row.binaryOutput).length > 0;
|
||||||
const hasMarkdown = markdownContent.length > 0;
|
const hasMarkdown = markdownContent.length > 0;
|
||||||
|
const hasHTML = htmlContent.length > 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ width: '100%' }}>
|
<Box sx={{ width: '100%' }}>
|
||||||
<TabContext value={tab}>
|
<TabContext value={tab}>
|
||||||
<TabPanel value='output' sx={{ width: '100%', maxWidth: '900px' }}>
|
<TabPanel value='output' sx={{ width: '100%', maxWidth: '900px' }}>
|
||||||
{hasMarkdown ? (
|
{hasMarkdown || hasHTML ? (
|
||||||
<Box>
|
<>
|
||||||
<Accordion defaultExpanded sx={{ mb: 2 }}>
|
{hasMarkdown && (
|
||||||
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
<Accordion defaultExpanded sx={{ mb: 2 }}>
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center' }}>
|
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
||||||
<Typography variant='h6'>
|
<Typography variant='h6'>Markdown</Typography>
|
||||||
Markdown Output
|
</AccordionSummary>
|
||||||
</Typography>
|
<AccordionDetails>
|
||||||
</Box>
|
<Paper sx={{ p: 2, maxHeight: '500px', overflow: 'auto' }}>
|
||||||
</AccordionSummary>
|
<Typography component="pre" sx={{ whiteSpace: 'pre-wrap', fontFamily: 'monospace' }}>
|
||||||
<AccordionDetails>
|
{markdownContent}
|
||||||
<Paper
|
</Typography>
|
||||||
sx={{
|
</Paper>
|
||||||
p: 2,
|
|
||||||
maxHeight: '500px',
|
<Box sx={{ mt: 2 }}>
|
||||||
overflow: 'auto',
|
|
||||||
backgroundColor: (theme) => theme.palette.mode === 'dark' ? '#1e1e1e' : '#f5f5f5'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
component="pre"
|
|
||||||
sx={{
|
|
||||||
whiteSpace: 'pre-wrap',
|
|
||||||
wordBreak: 'break-word',
|
|
||||||
fontFamily: 'monospace',
|
|
||||||
fontSize: '0.875rem'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{markdownContent}
|
|
||||||
</Typography>
|
|
||||||
</Paper>
|
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 2, mt: 2 }}>
|
|
||||||
<Box>
|
|
||||||
<Button
|
<Button
|
||||||
component="a"
|
|
||||||
onClick={() => downloadMarkdown(markdownContent, 'output.md')}
|
onClick={() => downloadMarkdown(markdownContent, 'output.md')}
|
||||||
sx={{
|
sx={{ color: '#FF00C3', textTransform: 'none' }}
|
||||||
color: '#FF00C3',
|
|
||||||
textTransform: 'none',
|
|
||||||
p: 0,
|
|
||||||
minWidth: 'auto',
|
|
||||||
backgroundColor: 'transparent',
|
|
||||||
'&:hover': {
|
|
||||||
backgroundColor: 'transparent',
|
|
||||||
textDecoration: 'underline',
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Download Markdown
|
Download
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</AccordionDetails>
|
||||||
</AccordionDetails>
|
</Accordion>
|
||||||
</Accordion>
|
)}
|
||||||
</Box>
|
|
||||||
|
{hasHTML && (
|
||||||
|
<Accordion defaultExpanded sx={{ mb: 2 }}>
|
||||||
|
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
||||||
|
<Typography variant='h6'>HTML</Typography>
|
||||||
|
</AccordionSummary>
|
||||||
|
<AccordionDetails>
|
||||||
|
<Paper sx={{ p: 2, maxHeight: '500px', overflow: 'auto' }}>
|
||||||
|
<Typography
|
||||||
|
component="pre"
|
||||||
|
sx={{ whiteSpace: 'pre-wrap', fontFamily: 'monospace' }}
|
||||||
|
>
|
||||||
|
{htmlContent}
|
||||||
|
</Typography>
|
||||||
|
</Paper>
|
||||||
|
|
||||||
|
<Box sx={{ mt: 2 }}>
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
const blob = new Blob([htmlContent], { type: 'text/html;charset=utf-8;' });
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = url;
|
||||||
|
link.download = "output.html";
|
||||||
|
link.click();
|
||||||
|
setTimeout(() => URL.revokeObjectURL(url), 100);
|
||||||
|
}}
|
||||||
|
sx={{ color: '#FF00C3', textTransform: 'none' }}
|
||||||
|
>
|
||||||
|
Download
|
||||||
|
</Button>
|
||||||
|
</Box>
|
||||||
|
</AccordionDetails>
|
||||||
|
</Accordion>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
// Traditional robot output
|
// Extract robot output
|
||||||
<>
|
<>
|
||||||
{row.status === 'running' || row.status === 'queued' ? (
|
{row.status === 'running' || row.status === 'queued' ? (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user