feat: upload metadata 、ui size settings 276 320 530 、import flow (#1965)

# Description

Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration

# Snapshots:

Include snapshots for easier review.

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have already rebased the commits and make the commit message
conform to the project standard.
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] Any dependent changes have been merged and published in downstream
modules
This commit is contained in:
Dreammy23
2024-09-04 18:33:44 +08:00
committed by GitHub
7 changed files with 58 additions and 21 deletions

View File

@@ -26,8 +26,8 @@ import 'reactflow/dist/style.css';
const nodeTypes = { customNode: CanvasNode };
const edgeTypes = { buttonedge: ButtonEdge };
const Canvas: React.FC = () => {
const { t } = useTranslation();
const [messageApi, contextHolder] = message.useMessage();
@@ -43,7 +43,17 @@ const Canvas: React.FC = () => {
const [isSaveFlowModalOpen, setIsSaveFlowModalOpen] = useState(false);
const [isExportFlowModalOpen, setIsExportFlowModalOpen] = useState(false);
const [isImportModalOpen, setIsImportFlowModalOpen] = useState(false);
if (localStorage.getItem('importFlowData') ) {
const importFlowData = JSON.parse(localStorage.getItem('importFlowData') );
localStorage.removeItem('importFlowData')
setLoading(true);
const flowData = mapUnderlineToHump(importFlowData.flow_data);
setFlowInfo(importFlowData);
setNodes(flowData.nodes);
setEdges(flowData.edges);
setLoading(false);
}
async function getFlowData() {
setLoading(true);
const [_, data] = await apiInterceptors(getFlowById(id));