Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
diptanu committed Oct 23, 2024
1 parent eaea8e9 commit ffb9330
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions server/ui/src/components/tables/InvocationOutputTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
Typography,
Box,
Alert,
Button,
TextField,
InputAdornment,
} from '@mui/material';
Expand Down Expand Up @@ -91,54 +90,6 @@ const InvocationOutputTable: React.FC<InvocationOutputTableProps> = ({ indexifyS
});
}, [searchTerms, handleSearch]);

const viewLogs = async (fnName: string, logType: 'stdout' | 'stderr') => {
try {
const url = `${indexifyServiceURL}/namespaces/${namespace}/compute_graphs/${computeGraph}/invocations/${invocationId}/fn/${fnName}/logs/${logType}`;
const response = await axios.get(url, {
responseType: 'text',
headers: {
'accept': 'text/plain'
}
});

const logContent = response.data;

if (!logContent || logContent.trim() === '') {
toast.info(`No ${logType} logs found for ${fnName}.`);
return;
}

const newWindow = window.open('', '_blank');
if (newWindow) {
newWindow.document.write(`
<html>
<head>
<title>${fnName} - ${logType} Log</title>
<style>
body { font-family: monospace; white-space: pre-wrap; word-wrap: break-word; }
</style>
</head>
<body>${logContent}</body>
</html>
`);
newWindow.document.close();
} else {
toast.error('Unable to open new window. Please check your browser settings.');
}
} catch (error) {
if (axios.isAxiosError(error) && error.response) {
if (error.response.status === 404) {
toast.info(`No ${logType} logs found for ${fnName}.`);
} else {
toast.error(`Failed to fetch ${logType} logs for ${fnName}. Please try again later.`);
}
} else {
toast.error(`An unexpected error occurred while fetching ${logType} logs for ${fnName}.`);
}
console.error(`Error fetching ${logType} logs:`, error);
}
};

const handleAccordionChange = (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => {
const target = event.target as HTMLElement;
if (target.classList.contains('MuiAccordionSummary-expandIconWrapper') ||
Expand Down

0 comments on commit ffb9330

Please sign in to comment.