mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): add logging for session events
This commit is contained in:
parent
575943d0ad
commit
eaf67b2150
@ -39,13 +39,13 @@ import { addSetDefaultSettingsListener } from 'app/store/middleware/listenerMidd
|
|||||||
import { addSocketConnectedEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected';
|
import { addSocketConnectedEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketConnected';
|
||||||
import { addSocketDisconnectedEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketDisconnected';
|
import { addSocketDisconnectedEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketDisconnected';
|
||||||
import { addGeneratorProgressEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketGeneratorProgress';
|
import { addGeneratorProgressEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketGeneratorProgress';
|
||||||
import { addGraphExecutionStateCompleteEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketGraphExecutionStateComplete';
|
|
||||||
import { addInvocationCompleteEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationComplete';
|
import { addInvocationCompleteEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationComplete';
|
||||||
import { addInvocationErrorEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationError';
|
import { addInvocationErrorEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationError';
|
||||||
import { addInvocationStartedEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationStarted';
|
import { addInvocationStartedEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationStarted';
|
||||||
import { addModelInstallEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketModelInstall';
|
import { addModelInstallEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketModelInstall';
|
||||||
import { addModelLoadEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketModelLoad';
|
import { addModelLoadEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketModelLoad';
|
||||||
import { addSocketQueueItemStatusChangedEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketQueueItemStatusChanged';
|
import { addSocketQueueItemStatusChangedEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketQueueItemStatusChanged';
|
||||||
|
import { addSessionEventListeners } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketSessionEvents';
|
||||||
import { addStagingAreaImageSavedListener } from 'app/store/middleware/listenerMiddleware/listeners/stagingAreaImageSaved';
|
import { addStagingAreaImageSavedListener } from 'app/store/middleware/listenerMiddleware/listeners/stagingAreaImageSaved';
|
||||||
import { addUpdateAllNodesRequestedListener } from 'app/store/middleware/listenerMiddleware/listeners/updateAllNodesRequested';
|
import { addUpdateAllNodesRequestedListener } from 'app/store/middleware/listenerMiddleware/listeners/updateAllNodesRequested';
|
||||||
import { addUpscaleRequestedListener } from 'app/store/middleware/listenerMiddleware/listeners/upscaleRequested';
|
import { addUpscaleRequestedListener } from 'app/store/middleware/listenerMiddleware/listeners/upscaleRequested';
|
||||||
@ -99,7 +99,7 @@ addCommitStagingAreaImageListener(startAppListening);
|
|||||||
|
|
||||||
// Socket.IO
|
// Socket.IO
|
||||||
addGeneratorProgressEventListener(startAppListening);
|
addGeneratorProgressEventListener(startAppListening);
|
||||||
addGraphExecutionStateCompleteEventListener(startAppListening);
|
addSessionEventListeners(startAppListening);
|
||||||
addInvocationCompleteEventListener(startAppListening);
|
addInvocationCompleteEventListener(startAppListening);
|
||||||
addInvocationErrorEventListener(startAppListening);
|
addInvocationErrorEventListener(startAppListening);
|
||||||
addInvocationStartedEventListener(startAppListening);
|
addInvocationStartedEventListener(startAppListening);
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
import { logger } from 'app/logging/logger';
|
|
||||||
import type { AppStartListening } from 'app/store/middleware/listenerMiddleware';
|
|
||||||
import { socketGraphExecutionStateComplete } from 'services/events/actions';
|
|
||||||
|
|
||||||
const log = logger('socketio');
|
|
||||||
|
|
||||||
export const addGraphExecutionStateCompleteEventListener = (startAppListening: AppStartListening) => {
|
|
||||||
startAppListening({
|
|
||||||
actionCreator: socketGraphExecutionStateComplete,
|
|
||||||
effect: (action) => {
|
|
||||||
log.debug(action.payload, 'Session complete');
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
@ -0,0 +1,26 @@
|
|||||||
|
import { logger } from 'app/logging/logger';
|
||||||
|
import type { AppStartListening } from 'app/store/middleware/listenerMiddleware';
|
||||||
|
import { socketSessionCanceled, socketSessionComplete, socketSessionStarted } from 'services/events/actions';
|
||||||
|
|
||||||
|
const log = logger('socketio');
|
||||||
|
|
||||||
|
export const addSessionEventListeners = (startAppListening: AppStartListening) => {
|
||||||
|
startAppListening({
|
||||||
|
actionCreator: socketSessionStarted,
|
||||||
|
effect: (action) => {
|
||||||
|
log.debug(action.payload, 'Session started');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
startAppListening({
|
||||||
|
actionCreator: socketSessionComplete,
|
||||||
|
effect: (action) => {
|
||||||
|
log.debug(action.payload, 'Session complete');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
startAppListening({
|
||||||
|
actionCreator: socketSessionCanceled,
|
||||||
|
effect: (action) => {
|
||||||
|
log.debug(action.payload, 'Session canceled');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
@ -6,12 +6,12 @@ import {
|
|||||||
socketConnected,
|
socketConnected,
|
||||||
socketDisconnected,
|
socketDisconnected,
|
||||||
socketGeneratorProgress,
|
socketGeneratorProgress,
|
||||||
socketGraphExecutionStateComplete,
|
|
||||||
socketInvocationComplete,
|
socketInvocationComplete,
|
||||||
socketInvocationStarted,
|
socketInvocationStarted,
|
||||||
socketModelLoadComplete,
|
socketModelLoadComplete,
|
||||||
socketModelLoadStarted,
|
socketModelLoadStarted,
|
||||||
socketQueueItemStatusChanged,
|
socketQueueItemStatusChanged,
|
||||||
|
socketSessionComplete,
|
||||||
} from 'services/events/actions';
|
} from 'services/events/actions';
|
||||||
|
|
||||||
import type { Language, SystemState } from './types';
|
import type { Language, SystemState } from './types';
|
||||||
@ -128,7 +128,7 @@ export const systemSlice = createSlice({
|
|||||||
/**
|
/**
|
||||||
* Graph Execution State Complete
|
* Graph Execution State Complete
|
||||||
*/
|
*/
|
||||||
builder.addCase(socketGraphExecutionStateComplete, (state) => {
|
builder.addCase(socketSessionComplete, (state) => {
|
||||||
state.denoiseProgress = null;
|
state.denoiseProgress = null;
|
||||||
state.status = 'CONNECTED';
|
state.status = 'CONNECTED';
|
||||||
});
|
});
|
||||||
|
@ -49,7 +49,7 @@ export const socketSessionStarted = createAction<{
|
|||||||
data: SessionStartedEvent;
|
data: SessionStartedEvent;
|
||||||
}>('socket/socketSessionStarted');
|
}>('socket/socketSessionStarted');
|
||||||
|
|
||||||
export const socketGraphExecutionStateComplete = createAction<{
|
export const socketSessionComplete = createAction<{
|
||||||
data: SessionCompleteEvent;
|
data: SessionCompleteEvent;
|
||||||
}>('socket/socketGraphExecutionStateComplete');
|
}>('socket/socketGraphExecutionStateComplete');
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ import {
|
|||||||
socketDownloadProgress,
|
socketDownloadProgress,
|
||||||
socketDownloadStarted,
|
socketDownloadStarted,
|
||||||
socketGeneratorProgress,
|
socketGeneratorProgress,
|
||||||
socketGraphExecutionStateComplete,
|
|
||||||
socketInvocationComplete,
|
socketInvocationComplete,
|
||||||
socketInvocationError,
|
socketInvocationError,
|
||||||
socketInvocationStarted,
|
socketInvocationStarted,
|
||||||
@ -29,6 +28,7 @@ import {
|
|||||||
socketModelLoadStarted,
|
socketModelLoadStarted,
|
||||||
socketQueueItemStatusChanged,
|
socketQueueItemStatusChanged,
|
||||||
socketSessionCanceled,
|
socketSessionCanceled,
|
||||||
|
socketSessionComplete,
|
||||||
socketSessionStarted,
|
socketSessionStarted,
|
||||||
} from 'services/events/actions';
|
} from 'services/events/actions';
|
||||||
import type { ClientToServerEvents, ServerToClientEvents } from 'services/events/types';
|
import type { ClientToServerEvents, ServerToClientEvents } from 'services/events/types';
|
||||||
@ -93,7 +93,7 @@ export const setEventListeners = (arg: SetEventListenersArg) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on('session_complete', (data) => {
|
socket.on('session_complete', (data) => {
|
||||||
dispatch(socketGraphExecutionStateComplete({ data }));
|
dispatch(socketSessionComplete({ data }));
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('session_canceled', (data) => {
|
socket.on('session_canceled', (data) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user