mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): add redux events for queue cleared & batch enqueued socket events
This commit is contained in:
parent
3bd5521641
commit
9eb091f873
@ -1,5 +1,6 @@
|
|||||||
import { createAction } from '@reduxjs/toolkit';
|
import { createAction } from '@reduxjs/toolkit';
|
||||||
import type {
|
import type {
|
||||||
|
BatchEnqueuedEvent,
|
||||||
BulkDownloadCompleteEvent,
|
BulkDownloadCompleteEvent,
|
||||||
BulkDownloadFailedEvent,
|
BulkDownloadFailedEvent,
|
||||||
BulkDownloadStartedEvent,
|
BulkDownloadStartedEvent,
|
||||||
@ -21,6 +22,7 @@ import type {
|
|||||||
ModelInstallStartedEvent,
|
ModelInstallStartedEvent,
|
||||||
ModelLoadCompleteEvent,
|
ModelLoadCompleteEvent,
|
||||||
ModelLoadStartedEvent,
|
ModelLoadStartedEvent,
|
||||||
|
QueueClearedEvent,
|
||||||
QueueItemStatusChangedEvent,
|
QueueItemStatusChangedEvent,
|
||||||
} from 'services/events/types';
|
} from 'services/events/types';
|
||||||
|
|
||||||
@ -57,6 +59,8 @@ export const socketModelInstallError = createSocketAction<ModelInstallErrorEvent
|
|||||||
export const socketModelInstallCancelled = createSocketAction<ModelInstallCancelledEvent>('ModelInstallCancelledEvent');
|
export const socketModelInstallCancelled = createSocketAction<ModelInstallCancelledEvent>('ModelInstallCancelledEvent');
|
||||||
export const socketQueueItemStatusChanged =
|
export const socketQueueItemStatusChanged =
|
||||||
createSocketAction<QueueItemStatusChangedEvent>('QueueItemStatusChangedEvent');
|
createSocketAction<QueueItemStatusChangedEvent>('QueueItemStatusChangedEvent');
|
||||||
|
export const socketQueueCleared = createSocketAction<QueueClearedEvent>('QueueClearedEvent');
|
||||||
|
export const socketBatchEnqueued = createSocketAction<BatchEnqueuedEvent>('BatchEnqueuedEvent');
|
||||||
export const socketBulkDownloadStarted = createSocketAction<BulkDownloadStartedEvent>('BulkDownloadStartedEvent');
|
export const socketBulkDownloadStarted = createSocketAction<BulkDownloadStartedEvent>('BulkDownloadStartedEvent');
|
||||||
export const socketBulkDownloadComplete = createSocketAction<BulkDownloadCompleteEvent>('BulkDownloadCompleteEvent');
|
export const socketBulkDownloadComplete = createSocketAction<BulkDownloadCompleteEvent>('BulkDownloadCompleteEvent');
|
||||||
export const socketBulkDownloadError = createSocketAction<BulkDownloadFailedEvent>('BulkDownloadFailedEvent');
|
export const socketBulkDownloadError = createSocketAction<BulkDownloadFailedEvent>('BulkDownloadFailedEvent');
|
||||||
|
@ -4,6 +4,7 @@ import { $queueId } from 'app/store/nanostores/queueId';
|
|||||||
import type { AppDispatch } from 'app/store/store';
|
import type { AppDispatch } from 'app/store/store';
|
||||||
import { toast } from 'features/toast/toast';
|
import { toast } from 'features/toast/toast';
|
||||||
import {
|
import {
|
||||||
|
socketBatchEnqueued,
|
||||||
socketBulkDownloadComplete,
|
socketBulkDownloadComplete,
|
||||||
socketBulkDownloadError,
|
socketBulkDownloadError,
|
||||||
socketBulkDownloadStarted,
|
socketBulkDownloadStarted,
|
||||||
@ -26,6 +27,7 @@ import {
|
|||||||
socketModelInstallStarted,
|
socketModelInstallStarted,
|
||||||
socketModelLoadComplete,
|
socketModelLoadComplete,
|
||||||
socketModelLoadStarted,
|
socketModelLoadStarted,
|
||||||
|
socketQueueCleared,
|
||||||
socketQueueItemStatusChanged,
|
socketQueueItemStatusChanged,
|
||||||
} from 'services/events/actions';
|
} from 'services/events/actions';
|
||||||
import type { ClientToServerEvents, ServerToClientEvents } from 'services/events/types';
|
import type { ClientToServerEvents, ServerToClientEvents } from 'services/events/types';
|
||||||
@ -116,6 +118,12 @@ export const setEventListeners = ({ socket, dispatch }: SetEventListenersArg) =>
|
|||||||
socket.on('queue_item_status_changed', (data) => {
|
socket.on('queue_item_status_changed', (data) => {
|
||||||
dispatch(socketQueueItemStatusChanged({ data }));
|
dispatch(socketQueueItemStatusChanged({ data }));
|
||||||
});
|
});
|
||||||
|
socket.on('queue_cleared', (data) => {
|
||||||
|
dispatch(socketQueueCleared({ data }));
|
||||||
|
});
|
||||||
|
socket.on('batch_enqueued', (data) => {
|
||||||
|
dispatch(socketBatchEnqueued({ data }));
|
||||||
|
});
|
||||||
socket.on('bulk_download_started', (data) => {
|
socket.on('bulk_download_started', (data) => {
|
||||||
dispatch(socketBulkDownloadStarted({ data }));
|
dispatch(socketBulkDownloadStarted({ data }));
|
||||||
});
|
});
|
||||||
|
@ -24,6 +24,8 @@ export type DownloadCancelledEvent = S['DownloadCancelledEvent'];
|
|||||||
export type DownloadErrorEvent = S['DownloadErrorEvent'];
|
export type DownloadErrorEvent = S['DownloadErrorEvent'];
|
||||||
|
|
||||||
export type QueueItemStatusChangedEvent = S['QueueItemStatusChangedEvent'];
|
export type QueueItemStatusChangedEvent = S['QueueItemStatusChangedEvent'];
|
||||||
|
export type QueueClearedEvent = S['QueueClearedEvent'];
|
||||||
|
export type BatchEnqueuedEvent = S['BatchEnqueuedEvent'];
|
||||||
|
|
||||||
export type BulkDownloadStartedEvent = S['BulkDownloadStartedEvent'];
|
export type BulkDownloadStartedEvent = S['BulkDownloadStartedEvent'];
|
||||||
export type BulkDownloadCompleteEvent = S['BulkDownloadCompleteEvent'];
|
export type BulkDownloadCompleteEvent = S['BulkDownloadCompleteEvent'];
|
||||||
@ -58,6 +60,8 @@ export type ServerToClientEvents = {
|
|||||||
model_install_cancelled: (payload: ModelInstallCancelledEvent) => void;
|
model_install_cancelled: (payload: ModelInstallCancelledEvent) => void;
|
||||||
model_load_complete: (payload: ModelLoadCompleteEvent) => void;
|
model_load_complete: (payload: ModelLoadCompleteEvent) => void;
|
||||||
queue_item_status_changed: (payload: QueueItemStatusChangedEvent) => void;
|
queue_item_status_changed: (payload: QueueItemStatusChangedEvent) => void;
|
||||||
|
queue_cleared: (payload: QueueClearedEvent) => void;
|
||||||
|
batch_enqueued: (payload: BatchEnqueuedEvent) => void;
|
||||||
bulk_download_started: (payload: BulkDownloadStartedEvent) => void;
|
bulk_download_started: (payload: BulkDownloadStartedEvent) => void;
|
||||||
bulk_download_complete: (payload: BulkDownloadCompleteEvent) => void;
|
bulk_download_complete: (payload: BulkDownloadCompleteEvent) => void;
|
||||||
bulk_download_error: (payload: BulkDownloadFailedEvent) => void;
|
bulk_download_error: (payload: BulkDownloadFailedEvent) => void;
|
||||||
|
Loading…
Reference in New Issue
Block a user