mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add error_reason to UI if import fails
This commit is contained in:
parent
34b9ab3674
commit
d802900abe
@ -46,13 +46,14 @@ export const addModelInstallEventListener = () => {
|
|||||||
startAppListening({
|
startAppListening({
|
||||||
actionCreator: socketModelInstallError,
|
actionCreator: socketModelInstallError,
|
||||||
effect: (action, { dispatch }) => {
|
effect: (action, { dispatch }) => {
|
||||||
const { id } = action.payload.data;
|
const { id, error_type } = action.payload.data;
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
modelsApi.util.updateQueryData('getModelImports', undefined, (draft) => {
|
modelsApi.util.updateQueryData('getModelImports', undefined, (draft) => {
|
||||||
const modelImport = draft.find((m) => m.id === id);
|
const modelImport = draft.find((m) => m.id === id);
|
||||||
if (modelImport) {
|
if (modelImport) {
|
||||||
modelImport.status = 'error';
|
modelImport.status = 'error';
|
||||||
|
modelImport.error_reason = error_type
|
||||||
}
|
}
|
||||||
return draft;
|
return draft;
|
||||||
})
|
})
|
||||||
|
@ -12,7 +12,7 @@ const STATUSES = {
|
|||||||
cancelled: { colorScheme: 'orange', translationKey: 'queue.canceled' },
|
cancelled: { colorScheme: 'orange', translationKey: 'queue.canceled' },
|
||||||
};
|
};
|
||||||
|
|
||||||
const ImportQueueBadge = ({ status, detail }: { status?: ModelInstallStatus; detail?: string }) => {
|
const ImportQueueBadge = ({ status, errorReason }: { status?: ModelInstallStatus; errorReason?: string | null }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
@ -20,7 +20,7 @@ const ImportQueueBadge = ({ status, detail }: { status?: ModelInstallStatus; det
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip label={detail}>
|
<Tooltip label={errorReason}>
|
||||||
<Badge colorScheme={STATUSES[status].colorScheme}>{t(STATUSES[status].translationKey)}</Badge>
|
<Badge colorScheme={STATUSES[status].colorScheme}>{t(STATUSES[status].translationKey)}</Badge>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
|
@ -116,7 +116,7 @@ export const ImportQueueItem = (props: ModelListItemProps) => {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Box w="15%">
|
<Box w="15%">
|
||||||
<ImportQueueBadge status={model.status} />
|
<ImportQueueBadge status={model.status} errorReason={model.error_reason} />
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Box w="10%">
|
<Box w="10%">
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user