Faas semi worfking

This commit is contained in:
2025-08-30 23:52:37 -04:00
parent 2778cbc512
commit 67bce24899
23 changed files with 1089 additions and 135 deletions

View File

@ -15,7 +15,7 @@ import {
Tooltip,
} from '@mantine/core';
import {
IconPlay,
IconPlayerPlay,
IconSettings,
IconTrash,
IconRocket,
@ -49,7 +49,9 @@ export const FunctionList: React.FC<FunctionListProps> = ({
setLoading(true);
setError(null);
const response = await functionApi.list();
setFunctions(response.data.functions || []);
// Ensure we have a valid array
const functionsArray = response.data?.functions || [];
setFunctions(functionsArray);
} catch (err) {
console.error('Failed to load functions:', err);
setError('Failed to load functions');
@ -210,13 +212,15 @@ export const FunctionList: React.FC<FunctionListProps> = ({
</Table.Td>
<Table.Td>
<Text size="sm">
{func.owner.name}
<Text size="xs" c="dimmed">({func.owner.type})</Text>
{func.owner?.name || 'Unknown'}
{func.owner?.type && (
<Text size="xs" c="dimmed">({func.owner.type})</Text>
)}
</Text>
</Table.Td>
<Table.Td>
<Text size="sm">
{new Date(func.created_at).toLocaleDateString()}
{func.created_at ? new Date(func.created_at).toLocaleDateString() : 'N/A'}
</Text>
</Table.Td>
<Table.Td>
@ -228,7 +232,7 @@ export const FunctionList: React.FC<FunctionListProps> = ({
size="sm"
onClick={() => onExecuteFunction(func)}
>
<IconPlay size={16} />
<IconPlayerPlay size={16} />
</ActionIcon>
</Tooltip>
<Menu position="bottom-end">
@ -268,4 +272,4 @@ export const FunctionList: React.FC<FunctionListProps> = ({
)}
</Paper>
);
};
};