chore: lint
This commit is contained in:
@@ -76,16 +76,16 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
|
|||||||
const handleBinaryCallback = useCallback(({ data, mimetype }: any) => {
|
const handleBinaryCallback = useCallback(({ data, mimetype }: any) => {
|
||||||
const base64String = Buffer.from(data).toString('base64');
|
const base64String = Buffer.from(data).toString('base64');
|
||||||
const imageSrc = `data:${mimetype};base64,${base64String}`;
|
const imageSrc = `data:${mimetype};base64,${base64String}`;
|
||||||
|
|
||||||
setLog((prevState) =>
|
setLog((prevState) =>
|
||||||
prevState + '\n' + '---------- Binary output data received ----------' + '\n'
|
prevState + '\n' + '---------- Binary output data received ----------' + '\n'
|
||||||
+ `mimetype: ${mimetype}` + '\n' + 'Image is rendered below:' + '\n'
|
+ `mimetype: ${mimetype}` + '\n' + 'Image is rendered below:' + '\n'
|
||||||
+ '------------------------------------------------');
|
+ '------------------------------------------------');
|
||||||
|
|
||||||
setBinaryData(imageSrc);
|
setBinaryData(imageSrc);
|
||||||
scrollLogToBottom();
|
scrollLogToBottom();
|
||||||
}, [log, scrollLogToBottom]);
|
}, [log, scrollLogToBottom]);
|
||||||
|
|
||||||
|
|
||||||
const handleCustomValueChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleCustomValueChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
setCustomValue(event.target.value);
|
setCustomValue(event.target.value);
|
||||||
@@ -164,55 +164,54 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
|
|||||||
padding: '10px',
|
padding: '10px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
||||||
{
|
{
|
||||||
binaryData ? (
|
binaryData ? (
|
||||||
<div style={{ marginBottom: '20px' }}>
|
<div style={{ marginBottom: '20px' }}>
|
||||||
<Typography variant="body1" gutterBottom>Screenshot</Typography>
|
<Typography variant="body1" gutterBottom>Screenshot</Typography>
|
||||||
<img src={binaryData} alt="Binary Output" style={{ maxWidth: '100%' }} />
|
<img src={binaryData} alt="Binary Output" style={{ maxWidth: '100%' }} />
|
||||||
</div>
|
</div>
|
||||||
) : tableData.length > 0 ? (
|
) : tableData.length > 0 ? (
|
||||||
<>
|
<>
|
||||||
<TableContainer component={Paper}>
|
<TableContainer component={Paper}>
|
||||||
<Table sx={{ minWidth: 650 }} stickyHeader aria-label="output data table">
|
<Table sx={{ minWidth: 650 }} stickyHeader aria-label="output data table">
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
{columns.map((column) => (
|
|
||||||
<TableCell key={column}>{column}</TableCell>
|
|
||||||
))}
|
|
||||||
</TableRow>
|
|
||||||
</TableHead>
|
|
||||||
<TableBody>
|
|
||||||
{tableData.slice(0, Math.min(5, tableData.length)).map((row, index) => (
|
|
||||||
<TableRow key={index}>
|
|
||||||
{columns.map((column) => (
|
{columns.map((column) => (
|
||||||
<TableCell key={column}>{row[column]}</TableCell>
|
<TableCell key={column}>{column}</TableCell>
|
||||||
))}
|
))}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
))}
|
</TableHead>
|
||||||
</TableBody>
|
<TableBody>
|
||||||
</Table>
|
{tableData.slice(0, Math.min(5, tableData.length)).map((row, index) => (
|
||||||
</TableContainer>
|
<TableRow key={index}>
|
||||||
<span style={{ marginLeft: '15px', marginTop: '10px', fontSize: '12px' }}>Additional rows of data will be extracted once you finish recording. </span>
|
{columns.map((column) => (
|
||||||
</>
|
<TableCell key={column}>{row[column]}</TableCell>
|
||||||
) : (
|
))}
|
||||||
<Grid container justifyContent="center" alignItems="center" style={{ height: '100%' }}>
|
</TableRow>
|
||||||
<Grid item>
|
))}
|
||||||
{hasScrapeListAction || hasScrapeSchemaAction || hasScreenshotAction ? (
|
</TableBody>
|
||||||
<>
|
</Table>
|
||||||
|
</TableContainer>
|
||||||
|
<span style={{ marginLeft: '15px', marginTop: '10px', fontSize: '12px' }}>Additional rows of data will be extracted once you finish recording. </span>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<Grid container justifyContent="center" alignItems="center" style={{ height: '100%' }}>
|
||||||
|
<Grid item>
|
||||||
|
{hasScrapeListAction || hasScrapeSchemaAction || hasScreenshotAction ? (
|
||||||
|
<>
|
||||||
|
<Typography variant="h6" gutterBottom align="left">
|
||||||
|
You've successfully trained the robot to perform actions! Click on the button below to get a preview of the data your robot will extract.
|
||||||
|
</Typography>
|
||||||
|
<SidePanelHeader />
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
<Typography variant="h6" gutterBottom align="left">
|
<Typography variant="h6" gutterBottom align="left">
|
||||||
You've successfully trained the robot to perform actions! Click on the button below to get a preview of the data your robot will extract.
|
It looks like you have not selected anything for extraction yet. Once you do, the robot will show a preview of your selections here.
|
||||||
</Typography>
|
</Typography>
|
||||||
<SidePanelHeader />
|
)}
|
||||||
</>
|
</Grid>
|
||||||
) : (
|
|
||||||
<Typography variant="h6" gutterBottom align="left">
|
|
||||||
It looks like you have not selected anything for extraction yet. Once you do, the robot will show a preview of your selections here.
|
|
||||||
</Typography>
|
|
||||||
)}
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
)}
|
||||||
)}
|
|
||||||
<div style={{ float: 'left', clear: 'both' }} ref={logEndRef} />
|
<div style={{ float: 'left', clear: 'both' }} ref={logEndRef} />
|
||||||
</div>
|
</div>
|
||||||
</SwipeableDrawer>
|
</SwipeableDrawer>
|
||||||
|
|||||||
Reference in New Issue
Block a user