mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): "blacklist" -> "denylist"
This commit is contained in:
parent
75d25dd5cc
commit
0ab62b0343
@ -21,15 +21,15 @@ import nodesReducer from 'features/nodes/store/nodesSlice';
|
||||
|
||||
import { socketioMiddleware } from './socketio/middleware';
|
||||
import { socketMiddleware } from 'services/events/middleware';
|
||||
import { canvasBlacklist } from 'features/canvas/store/canvasPersistBlacklist';
|
||||
import { galleryBlacklist } from 'features/gallery/store/galleryPersistBlacklist';
|
||||
import { generationBlacklist } from 'features/parameters/store/generationPersistBlacklist';
|
||||
import { lightboxBlacklist } from 'features/lightbox/store/lightboxPersistBlacklist';
|
||||
import { modelsBlacklist } from 'features/system/store/modelsPersistBlacklist';
|
||||
import { nodesBlacklist } from 'features/nodes/store/nodesPersistBlacklist';
|
||||
import { postprocessingBlacklist } from 'features/parameters/store/postprocessingPersistBlacklist';
|
||||
import { systemBlacklist } from 'features/system/store/systemPersistsBlacklist';
|
||||
import { uiBlacklist } from 'features/ui/store/uiPersistBlacklist';
|
||||
import { canvasDenylist } from 'features/canvas/store/canvasPersistDenylist';
|
||||
import { galleryDenylist } from 'features/gallery/store/galleryPersistDenylist';
|
||||
import { generationDenylist } from 'features/parameters/store/generationPersistDenylist';
|
||||
import { lightboxDenylist } from 'features/lightbox/store/lightboxPersistDenylist';
|
||||
import { modelsDenylist } from 'features/system/store/modelsPersistDenylist';
|
||||
import { nodesDenylist } from 'features/nodes/store/nodesPersistDenylist';
|
||||
import { postprocessingDenylist } from 'features/parameters/store/postprocessingPersistDenylist';
|
||||
import { systemDenylist } from 'features/system/store/systemPersistsDenylist';
|
||||
import { uiDenylist } from 'features/ui/store/uiPersistDenylist';
|
||||
|
||||
/**
|
||||
* redux-persist provides an easy and reliable way to persist state across reloads.
|
||||
@ -40,9 +40,9 @@ import { uiBlacklist } from 'features/ui/store/uiPersistBlacklist';
|
||||
* - Connection/processing status
|
||||
* - Availability of external libraries like ESRGAN/GFPGAN
|
||||
*
|
||||
* These can be blacklisted in redux-persist.
|
||||
* These can be denylisted in redux-persist.
|
||||
*
|
||||
* The necesssary nested persistors with blacklists are configured below.
|
||||
* The necesssary nested persistors with denylists are configured below.
|
||||
*/
|
||||
|
||||
const rootReducer = combineReducers({
|
||||
@ -66,18 +66,18 @@ const rootPersistConfig = getPersistConfig({
|
||||
storage,
|
||||
rootReducer,
|
||||
blacklist: [
|
||||
...canvasBlacklist,
|
||||
...galleryBlacklist,
|
||||
...generationBlacklist,
|
||||
...lightboxBlacklist,
|
||||
...modelsBlacklist,
|
||||
...nodesBlacklist,
|
||||
...postprocessingBlacklist,
|
||||
// ...resultsBlacklist,
|
||||
...canvasDenylist,
|
||||
...galleryDenylist,
|
||||
...generationDenylist,
|
||||
...lightboxDenylist,
|
||||
...modelsDenylist,
|
||||
...nodesDenylist,
|
||||
...postprocessingDenylist,
|
||||
// ...resultsDenylist,
|
||||
'results',
|
||||
...systemBlacklist,
|
||||
...uiBlacklist,
|
||||
// ...uploadsBlacklist,
|
||||
...systemDenylist,
|
||||
...uiDenylist,
|
||||
// ...uploadsDenylist,
|
||||
'uploads',
|
||||
'hotkeys',
|
||||
'config',
|
||||
|
@ -1,14 +0,0 @@
|
||||
import { CanvasState } from './canvasTypes';
|
||||
|
||||
/**
|
||||
* Canvas slice persist blacklist
|
||||
*/
|
||||
const itemsToBlacklist: (keyof CanvasState)[] = [
|
||||
'cursorPosition',
|
||||
'isCanvasInitialized',
|
||||
'doesCanvasNeedScaling',
|
||||
];
|
||||
|
||||
export const canvasBlacklist = itemsToBlacklist.map(
|
||||
(blacklistItem) => `canvas.${blacklistItem}`
|
||||
);
|
@ -0,0 +1,14 @@
|
||||
import { CanvasState } from './canvasTypes';
|
||||
|
||||
/**
|
||||
* Canvas slice persist denylist
|
||||
*/
|
||||
const itemsToDenylist: (keyof CanvasState)[] = [
|
||||
'cursorPosition',
|
||||
'isCanvasInitialized',
|
||||
'doesCanvasNeedScaling',
|
||||
];
|
||||
|
||||
export const canvasDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `canvas.${denylistItem}`
|
||||
);
|
@ -1,9 +1,9 @@
|
||||
import { GalleryState } from './gallerySlice';
|
||||
|
||||
/**
|
||||
* Gallery slice persist blacklist
|
||||
* Gallery slice persist denylist
|
||||
*/
|
||||
const itemsToBlacklist: (keyof GalleryState)[] = [
|
||||
const itemsToDenylist: (keyof GalleryState)[] = [
|
||||
'categories',
|
||||
'currentCategory',
|
||||
'currentImage',
|
||||
@ -12,6 +12,6 @@ const itemsToBlacklist: (keyof GalleryState)[] = [
|
||||
'intermediateImage',
|
||||
];
|
||||
|
||||
export const galleryBlacklist = itemsToBlacklist.map(
|
||||
(blacklistItem) => `gallery.${blacklistItem}`
|
||||
export const galleryDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `gallery.${denylistItem}`
|
||||
);
|
@ -1,12 +0,0 @@
|
||||
import { ResultsState } from './resultsSlice';
|
||||
|
||||
/**
|
||||
* Results slice persist blacklist
|
||||
*
|
||||
* Currently blacklisting results slice entirely, see persist config in store.ts
|
||||
*/
|
||||
const itemsToBlacklist: (keyof ResultsState)[] = [];
|
||||
|
||||
export const resultsBlacklist = itemsToBlacklist.map(
|
||||
(blacklistItem) => `results.${blacklistItem}`
|
||||
);
|
@ -0,0 +1,12 @@
|
||||
import { ResultsState } from './resultsSlice';
|
||||
|
||||
/**
|
||||
* Results slice persist denylist
|
||||
*
|
||||
* Currently denylisting results slice entirely, see persist config in store.ts
|
||||
*/
|
||||
const itemsToDenylist: (keyof ResultsState)[] = [];
|
||||
|
||||
export const resultsDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `results.${denylistItem}`
|
||||
);
|
@ -1,12 +0,0 @@
|
||||
import { UploadsState } from './uploadsSlice';
|
||||
|
||||
/**
|
||||
* Uploads slice persist blacklist
|
||||
*
|
||||
* Currently blacklisting uploads slice entirely, see persist config in store.ts
|
||||
*/
|
||||
const itemsToBlacklist: (keyof UploadsState)[] = [];
|
||||
|
||||
export const uploadsBlacklist = itemsToBlacklist.map(
|
||||
(blacklistItem) => `uploads.${blacklistItem}`
|
||||
);
|
@ -0,0 +1,12 @@
|
||||
import { UploadsState } from './uploadsSlice';
|
||||
|
||||
/**
|
||||
* Uploads slice persist denylist
|
||||
*
|
||||
* Currently denylisting uploads slice entirely, see persist config in store.ts
|
||||
*/
|
||||
const itemsToDenylist: (keyof UploadsState)[] = [];
|
||||
|
||||
export const uploadsDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `uploads.${denylistItem}`
|
||||
);
|
@ -1,10 +0,0 @@
|
||||
import { LightboxState } from './lightboxSlice';
|
||||
|
||||
/**
|
||||
* Lightbox slice persist blacklist
|
||||
*/
|
||||
const itemsToBlacklist: (keyof LightboxState)[] = ['isLightboxOpen'];
|
||||
|
||||
export const lightboxBlacklist = itemsToBlacklist.map(
|
||||
(blacklistItem) => `lightbox.${blacklistItem}`
|
||||
);
|
@ -0,0 +1,10 @@
|
||||
import { LightboxState } from './lightboxSlice';
|
||||
|
||||
/**
|
||||
* Lightbox slice persist denylist
|
||||
*/
|
||||
const itemsToDenylist: (keyof LightboxState)[] = ['isLightboxOpen'];
|
||||
|
||||
export const lightboxDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `lightbox.${denylistItem}`
|
||||
);
|
@ -1,13 +0,0 @@
|
||||
import { NodesState } from './nodesSlice';
|
||||
|
||||
/**
|
||||
* Nodes slice persist blacklist
|
||||
*/
|
||||
const itemsToBlacklist: (keyof NodesState)[] = [
|
||||
'schema',
|
||||
'invocationTemplates',
|
||||
];
|
||||
|
||||
export const nodesBlacklist = itemsToBlacklist.map(
|
||||
(blacklistItem) => `nodes.${blacklistItem}`
|
||||
);
|
@ -0,0 +1,10 @@
|
||||
import { NodesState } from './nodesSlice';
|
||||
|
||||
/**
|
||||
* Nodes slice persist denylist
|
||||
*/
|
||||
const itemsToDenylist: (keyof NodesState)[] = ['schema', 'invocationTemplates'];
|
||||
|
||||
export const nodesDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `nodes.${denylistItem}`
|
||||
);
|
@ -13,7 +13,7 @@ import {
|
||||
buildOutputFieldTemplates,
|
||||
} from './fieldTemplateBuilders';
|
||||
|
||||
const invocationBlacklist = ['Graph', 'Collect', 'LoadImage'];
|
||||
const invocationDenylist = ['Graph', 'Collect', 'LoadImage'];
|
||||
|
||||
export const parseSchema = (openAPI: OpenAPIV3.Document) => {
|
||||
// filter out non-invocation schemas, plus some tricky invocations for now
|
||||
@ -22,7 +22,7 @@ export const parseSchema = (openAPI: OpenAPIV3.Document) => {
|
||||
(schema, key) =>
|
||||
key.includes('Invocation') &&
|
||||
!key.includes('InvocationOutput') &&
|
||||
!invocationBlacklist.some((blacklistItem) => key.includes(blacklistItem))
|
||||
!invocationDenylist.some((denylistItem) => key.includes(denylistItem))
|
||||
) as (OpenAPIV3.ReferenceObject | InvocationSchemaObject)[];
|
||||
|
||||
const invocations = filteredSchemas.reduce<
|
||||
|
@ -1,10 +0,0 @@
|
||||
import { GenerationState } from './generationSlice';
|
||||
|
||||
/**
|
||||
* Generation slice persist blacklist
|
||||
*/
|
||||
const itemsToBlacklist: (keyof GenerationState)[] = [];
|
||||
|
||||
export const generationBlacklist = itemsToBlacklist.map(
|
||||
(blacklistItem) => `generation.${blacklistItem}`
|
||||
);
|
@ -0,0 +1,10 @@
|
||||
import { GenerationState } from './generationSlice';
|
||||
|
||||
/**
|
||||
* Generation slice persist denylist
|
||||
*/
|
||||
const itemsToDenylist: (keyof GenerationState)[] = [];
|
||||
|
||||
export const generationDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `generation.${denylistItem}`
|
||||
);
|
@ -1,10 +0,0 @@
|
||||
import { PostprocessingState } from './postprocessingSlice';
|
||||
|
||||
/**
|
||||
* Postprocessing slice persist blacklist
|
||||
*/
|
||||
const itemsToBlacklist: (keyof PostprocessingState)[] = [];
|
||||
|
||||
export const postprocessingBlacklist = itemsToBlacklist.map(
|
||||
(blacklistItem) => `postprocessing.${blacklistItem}`
|
||||
);
|
@ -0,0 +1,10 @@
|
||||
import { PostprocessingState } from './postprocessingSlice';
|
||||
|
||||
/**
|
||||
* Postprocessing slice persist denylist
|
||||
*/
|
||||
const itemsToDenylist: (keyof PostprocessingState)[] = [];
|
||||
|
||||
export const postprocessingDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `postprocessing.${denylistItem}`
|
||||
);
|
@ -1,10 +0,0 @@
|
||||
import { ModelsState } from './modelSlice';
|
||||
|
||||
/**
|
||||
* Models slice persist blacklist
|
||||
*/
|
||||
const itemsToBlacklist: (keyof ModelsState)[] = ['entities', 'ids'];
|
||||
|
||||
export const modelsBlacklist = itemsToBlacklist.map(
|
||||
(blacklistItem) => `models.${blacklistItem}`
|
||||
);
|
@ -0,0 +1,10 @@
|
||||
import { ModelsState } from './modelSlice';
|
||||
|
||||
/**
|
||||
* Models slice persist denylist
|
||||
*/
|
||||
const itemsToDenylist: (keyof ModelsState)[] = ['entities', 'ids'];
|
||||
|
||||
export const modelsDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `models.${denylistItem}`
|
||||
);
|
@ -1,9 +1,9 @@
|
||||
import { SystemState } from './systemSlice';
|
||||
|
||||
/**
|
||||
* System slice persist blacklist
|
||||
* System slice persist denylist
|
||||
*/
|
||||
const itemsToBlacklist: (keyof SystemState)[] = [
|
||||
const itemsToDenylist: (keyof SystemState)[] = [
|
||||
'currentIteration',
|
||||
'currentStatus',
|
||||
'currentStep',
|
||||
@ -23,6 +23,6 @@ const itemsToBlacklist: (keyof SystemState)[] = [
|
||||
'wasSchemaParsed',
|
||||
];
|
||||
|
||||
export const systemBlacklist = itemsToBlacklist.map(
|
||||
(blacklistItem) => `system.${blacklistItem}`
|
||||
export const systemDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `system.${denylistItem}`
|
||||
);
|
@ -1,10 +0,0 @@
|
||||
import { UIState } from './uiTypes';
|
||||
|
||||
/**
|
||||
* UI slice persist blacklist
|
||||
*/
|
||||
const itemsToBlacklist: (keyof UIState)[] = [];
|
||||
|
||||
export const uiBlacklist = itemsToBlacklist.map(
|
||||
(blacklistItem) => `ui.${blacklistItem}`
|
||||
);
|
@ -0,0 +1,10 @@
|
||||
import { UIState } from './uiTypes';
|
||||
|
||||
/**
|
||||
* UI slice persist denylist
|
||||
*/
|
||||
const itemsToDenylist: (keyof UIState)[] = [];
|
||||
|
||||
export const uiDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `ui.${denylistItem}`
|
||||
);
|
Loading…
Reference in New Issue
Block a user