mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): format model API response data
This commit is contained in:
@ -21,6 +21,13 @@ export const ModelMetadata = () => {
|
|||||||
return MODEL_TYPE_TRIGGER_PHRASE.includes(data.type);
|
return MODEL_TYPE_TRIGGER_PHRASE.includes(data.type);
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
|
const apiResponseFormatted = useMemo(() => {
|
||||||
|
if (!data?.source_api_response) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return JSON.parse(data.source_api_response);
|
||||||
|
}, [data?.source_api_response]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex flexDir="column" height="full" gap="3">
|
<Flex flexDir="column" height="full" gap="3">
|
||||||
{shouldShowTriggerPhraseSettings && (
|
{shouldShowTriggerPhraseSettings && (
|
||||||
@ -28,7 +35,7 @@ export const ModelMetadata = () => {
|
|||||||
<TriggerPhrases />
|
<TriggerPhrases />
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
<DataViewer label="metadata" data={data?.source_api_response || {}} />
|
<DataViewer label="metadata" data={apiResponseFormatted} />
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user