Faas semi worfking
This commit is contained in:
@ -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>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user