mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat: Update Reload Schema button
This commit is contained in:
parent
5bf144e6bc
commit
b6b22dc799
invokeai/frontend/web
@ -679,6 +679,7 @@
|
|||||||
"swapSizes": "Swap Sizes"
|
"swapSizes": "Swap Sizes"
|
||||||
},
|
},
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"reloadSchema": "Reload Schema",
|
||||||
"saveNodes": "Save Nodes",
|
"saveNodes": "Save Nodes",
|
||||||
"loadNodes": "Load Nodes"
|
"loadNodes": "Load Nodes"
|
||||||
}
|
}
|
||||||
|
@ -1,27 +1,19 @@
|
|||||||
import { HStack } from '@chakra-ui/react';
|
import { HStack } from '@chakra-ui/react';
|
||||||
import { useAppDispatch } from 'app/store/storeHooks';
|
|
||||||
import IAIButton from 'common/components/IAIButton';
|
|
||||||
import CancelButton from 'features/parameters/components/ProcessButtons/CancelButton';
|
import CancelButton from 'features/parameters/components/ProcessButtons/CancelButton';
|
||||||
import { memo, useCallback } from 'react';
|
import { memo } from 'react';
|
||||||
import { Panel } from 'reactflow';
|
import { Panel } from 'reactflow';
|
||||||
import { receivedOpenAPISchema } from 'services/api/thunks/schema';
|
|
||||||
import LoadNodesButton from '../ui/LoadNodesButton';
|
import LoadNodesButton from '../ui/LoadNodesButton';
|
||||||
import NodeInvokeButton from '../ui/NodeInvokeButton';
|
import NodeInvokeButton from '../ui/NodeInvokeButton';
|
||||||
|
import ReloadSchemaButton from '../ui/ReloadSchemaButton';
|
||||||
import SaveNodesButton from '../ui/SaveNodesButton';
|
import SaveNodesButton from '../ui/SaveNodesButton';
|
||||||
|
|
||||||
const TopCenterPanel = () => {
|
const TopCenterPanel = () => {
|
||||||
const dispatch = useAppDispatch();
|
|
||||||
|
|
||||||
const handleReloadSchema = useCallback(() => {
|
|
||||||
dispatch(receivedOpenAPISchema());
|
|
||||||
}, [dispatch]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Panel position="top-center">
|
<Panel position="top-center">
|
||||||
<HStack>
|
<HStack>
|
||||||
<NodeInvokeButton />
|
<NodeInvokeButton />
|
||||||
<CancelButton />
|
<CancelButton />
|
||||||
<IAIButton onClick={handleReloadSchema}>Reload Schema</IAIButton>
|
<ReloadSchemaButton />
|
||||||
<SaveNodesButton />
|
<SaveNodesButton />
|
||||||
<LoadNodesButton />
|
<LoadNodesButton />
|
||||||
</HStack>
|
</HStack>
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
import { useAppDispatch } from 'app/store/storeHooks';
|
||||||
|
import IAIIconButton from 'common/components/IAIIconButton';
|
||||||
|
import { useCallback } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { BiRefresh } from 'react-icons/bi';
|
||||||
|
import { receivedOpenAPISchema } from 'services/api/thunks/schema';
|
||||||
|
|
||||||
|
export default function ReloadSchemaButton() {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
|
const handleReloadSchema = useCallback(() => {
|
||||||
|
dispatch(receivedOpenAPISchema());
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<IAIIconButton
|
||||||
|
icon={<BiRefresh />}
|
||||||
|
fontSize={24}
|
||||||
|
tooltip={t('nodes.reloadSchema')}
|
||||||
|
aria-label={t('nodes.reloadSchema')}
|
||||||
|
onClick={handleReloadSchema}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user