mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Revert "feat(ui): add warning socket event handling"
This reverts commit e7a61e631a42190e4b64e0d5e22771c669c5b30c.
This commit is contained in:
parent
b51e9a6bdb
commit
e0c998d192
@ -551,7 +551,6 @@
|
|||||||
},
|
},
|
||||||
"toast": {
|
"toast": {
|
||||||
"serverError": "Server Error",
|
"serverError": "Server Error",
|
||||||
"serverWarning": "Server Warning",
|
|
||||||
"disconnected": "Disconnected from Server",
|
"disconnected": "Disconnected from Server",
|
||||||
"connected": "Connected to Server",
|
"connected": "Connected to Server",
|
||||||
"canceled": "Processing Canceled",
|
"canceled": "Processing Canceled",
|
||||||
|
@ -73,7 +73,6 @@ import { addImageCategoriesChangedListener } from './listeners/imageCategoriesCh
|
|||||||
import { addControlNetImageProcessedListener } from './listeners/controlNetImageProcessed';
|
import { addControlNetImageProcessedListener } from './listeners/controlNetImageProcessed';
|
||||||
import { addControlNetAutoProcessListener } from './listeners/controlNetAutoProcess';
|
import { addControlNetAutoProcessListener } from './listeners/controlNetAutoProcess';
|
||||||
import { addUpdateImageUrlsOnConnectListener } from './listeners/updateImageUrlsOnConnect';
|
import { addUpdateImageUrlsOnConnectListener } from './listeners/updateImageUrlsOnConnect';
|
||||||
import { addInvocationWarningEventListener } from './listeners/socketio/socketInvocationWarning';
|
|
||||||
|
|
||||||
export const listenerMiddleware = createListenerMiddleware();
|
export const listenerMiddleware = createListenerMiddleware();
|
||||||
|
|
||||||
@ -150,7 +149,6 @@ addGeneratorProgressListener();
|
|||||||
addGraphExecutionStateCompleteListener();
|
addGraphExecutionStateCompleteListener();
|
||||||
addInvocationCompleteListener();
|
addInvocationCompleteListener();
|
||||||
addInvocationErrorListener();
|
addInvocationErrorListener();
|
||||||
addInvocationWarningEventListener();
|
|
||||||
addInvocationStartedListener();
|
addInvocationStartedListener();
|
||||||
addSocketConnectedListener();
|
addSocketConnectedListener();
|
||||||
addSocketDisconnectedListener();
|
addSocketDisconnectedListener();
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
import { startAppListening } from '../..';
|
|
||||||
import { log } from 'app/logging/useLogger';
|
|
||||||
import {
|
|
||||||
appSocketInvocationWarning,
|
|
||||||
socketInvocationWarning,
|
|
||||||
} from 'services/events/actions';
|
|
||||||
|
|
||||||
const moduleLog = log.child({ namespace: 'socketio' });
|
|
||||||
|
|
||||||
export const addInvocationWarningEventListener = () => {
|
|
||||||
startAppListening({
|
|
||||||
actionCreator: socketInvocationWarning,
|
|
||||||
effect: (action, { dispatch, getState }) => {
|
|
||||||
moduleLog.warn(
|
|
||||||
action.payload,
|
|
||||||
`Invocation warning (${action.payload.data.node.type})`
|
|
||||||
);
|
|
||||||
dispatch(appSocketInvocationWarning(action.payload));
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
@ -23,7 +23,6 @@ import {
|
|||||||
appSocketInvocationComplete,
|
appSocketInvocationComplete,
|
||||||
appSocketInvocationError,
|
appSocketInvocationError,
|
||||||
appSocketInvocationStarted,
|
appSocketInvocationStarted,
|
||||||
appSocketInvocationWarning,
|
|
||||||
appSocketSubscribed,
|
appSocketSubscribed,
|
||||||
appSocketUnsubscribed,
|
appSocketUnsubscribed,
|
||||||
} from 'services/events/actions';
|
} from 'services/events/actions';
|
||||||
@ -335,20 +334,6 @@ export const systemSlice = createSlice({
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* Invocation Warning
|
|
||||||
*/
|
|
||||||
builder.addCase(appSocketInvocationWarning, (state, action) => {
|
|
||||||
const { data } = action.payload;
|
|
||||||
state.toastQueue.push(
|
|
||||||
makeToast({
|
|
||||||
title: t('toast.serverWarning'),
|
|
||||||
description: data.warning,
|
|
||||||
status: 'warning',
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Graph Execution State Complete
|
* Graph Execution State Complete
|
||||||
*/
|
*/
|
||||||
|
@ -6,7 +6,6 @@ export const tabMap = [
|
|||||||
'nodes',
|
'nodes',
|
||||||
// 'postprocessing',
|
// 'postprocessing',
|
||||||
// 'training',
|
// 'training',
|
||||||
'prompt',
|
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export type InvokeTabName = (typeof tabMap)[number];
|
export type InvokeTabName = (typeof tabMap)[number];
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
InvocationCompleteEvent,
|
InvocationCompleteEvent,
|
||||||
InvocationErrorEvent,
|
InvocationErrorEvent,
|
||||||
InvocationStartedEvent,
|
InvocationStartedEvent,
|
||||||
InvocationWarningEvent,
|
|
||||||
} from 'services/events/types';
|
} from 'services/events/types';
|
||||||
|
|
||||||
// Common socket action payload data
|
// Common socket action payload data
|
||||||
@ -132,24 +131,6 @@ export const appSocketInvocationError = createAction<
|
|||||||
BaseSocketPayload & { data: InvocationErrorEvent }
|
BaseSocketPayload & { data: InvocationErrorEvent }
|
||||||
>('socket/appSocketInvocationError');
|
>('socket/appSocketInvocationError');
|
||||||
|
|
||||||
/**
|
|
||||||
* Socket.IO Invocation Warning
|
|
||||||
*
|
|
||||||
* Do not use. Only for use in middleware.
|
|
||||||
*/
|
|
||||||
export const socketInvocationWarning = createAction<
|
|
||||||
BaseSocketPayload & { data: InvocationWarningEvent }
|
|
||||||
>('socket/socketInvocationWarning');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Socket.IO Invocation Warning
|
|
||||||
*
|
|
||||||
* Do not use. Only for use in middleware.
|
|
||||||
*/
|
|
||||||
export const appSocketInvocationWarning = createAction<
|
|
||||||
BaseSocketPayload & { data: InvocationWarningEvent }
|
|
||||||
>('socket/appSocketInvocationWarning');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Socket.IO Graph Execution State Complete
|
* Socket.IO Graph Execution State Complete
|
||||||
*
|
*
|
||||||
|
@ -63,18 +63,6 @@ export type InvocationErrorEvent = {
|
|||||||
error: string;
|
error: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* A `invocation_warning` socket.io event.
|
|
||||||
*
|
|
||||||
* @example socket.on('invocation_warning', (data: InvocationWarningEvent) => { ... }
|
|
||||||
*/
|
|
||||||
export type InvocationWarningEvent = {
|
|
||||||
graph_execution_state_id: string;
|
|
||||||
node: BaseNode;
|
|
||||||
source_node_id: string;
|
|
||||||
warning: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A `invocation_started` socket.io event.
|
* A `invocation_started` socket.io event.
|
||||||
*
|
*
|
||||||
@ -107,7 +95,6 @@ export type ServerToClientEvents = {
|
|||||||
generator_progress: (payload: GeneratorProgressEvent) => void;
|
generator_progress: (payload: GeneratorProgressEvent) => void;
|
||||||
invocation_complete: (payload: InvocationCompleteEvent) => void;
|
invocation_complete: (payload: InvocationCompleteEvent) => void;
|
||||||
invocation_error: (payload: InvocationErrorEvent) => void;
|
invocation_error: (payload: InvocationErrorEvent) => void;
|
||||||
invocation_warning: (payload: InvocationWarningEvent) => void;
|
|
||||||
invocation_started: (payload: InvocationStartedEvent) => void;
|
invocation_started: (payload: InvocationStartedEvent) => void;
|
||||||
graph_execution_state_complete: (
|
graph_execution_state_complete: (
|
||||||
payload: GraphExecutionStateCompleteEvent
|
payload: GraphExecutionStateCompleteEvent
|
||||||
|
@ -11,7 +11,6 @@ import {
|
|||||||
socketConnected,
|
socketConnected,
|
||||||
socketDisconnected,
|
socketDisconnected,
|
||||||
socketSubscribed,
|
socketSubscribed,
|
||||||
socketInvocationWarning,
|
|
||||||
} from '../actions';
|
} from '../actions';
|
||||||
import { ClientToServerEvents, ServerToClientEvents } from '../types';
|
import { ClientToServerEvents, ServerToClientEvents } from '../types';
|
||||||
import { Logger } from 'roarr';
|
import { Logger } from 'roarr';
|
||||||
@ -95,13 +94,6 @@ export const setEventListeners = (arg: SetEventListenersArg) => {
|
|||||||
dispatch(socketInvocationError({ data, timestamp: getTimestamp() }));
|
dispatch(socketInvocationError({ data, timestamp: getTimestamp() }));
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* Invocation warning
|
|
||||||
*/
|
|
||||||
socket.on('invocation_warning', (data) => {
|
|
||||||
dispatch(socketInvocationWarning({ data, timestamp: getTimestamp() }));
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invocation complete
|
* Invocation complete
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user