diff --git a/packages/frinx-dashboard/src/api/uniflow/uniflow-api.ts b/packages/frinx-dashboard/src/api/uniflow/uniflow-api.ts index add80ba3c..b31a6f3de 100644 --- a/packages/frinx-dashboard/src/api/uniflow/uniflow-api.ts +++ b/packages/frinx-dashboard/src/api/uniflow/uniflow-api.ts @@ -235,3 +235,8 @@ export async function deleteWorkflowInstance(workflowId: string): Promise> { + const data = await sendGetRequest(`/external/postgres/${path}`); + return data as Record; +} diff --git a/packages/frinx-dashboard/src/uniflow-app.tsx b/packages/frinx-dashboard/src/uniflow-app.tsx index c85ad8f29..f883d1649 100644 --- a/packages/frinx-dashboard/src/uniflow-app.tsx +++ b/packages/frinx-dashboard/src/uniflow-app.tsx @@ -29,6 +29,7 @@ import { deleteSchedule, getSchedule, registerSchedule, + getExternalStorage, } from './api/uniflow/uniflow-api'; const callbacks = { @@ -58,6 +59,7 @@ const callbacks = { deleteSchedule, getSchedule, registerSchedule, + getExternalStorage, }; type UniflowComponents = Omit & { diff --git a/packages/frinx-workflow-ui/src/pages/executed-workflow-detail/executed-workflow-detail-tabs/external-storage-modal.tsx b/packages/frinx-workflow-ui/src/pages/executed-workflow-detail/executed-workflow-detail-tabs/external-storage-modal.tsx new file mode 100644 index 000000000..9aef31b47 --- /dev/null +++ b/packages/frinx-workflow-ui/src/pages/executed-workflow-detail/executed-workflow-detail-tabs/external-storage-modal.tsx @@ -0,0 +1,45 @@ +// @flow +import { + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalHeader, + ModalOverlay, + Textarea, +} from '@chakra-ui/react'; +import React, { VoidFunctionComponent, useState, useEffect } from 'react'; +import callbackUtils from '../../../utils/callback-utils'; + +type Props = { + storagePath: string; + isOpen: boolean; + onClose: () => void; + title: string; +}; + +const ExternalStorageModal: VoidFunctionComponent = ({ isOpen, onClose, storagePath, title }) => { + const [payload, setPayload] = useState(null); + + useEffect(() => { + const getExternalStorage = callbackUtils.getExternalStorageCallback(); + getExternalStorage(storagePath).then((res) => { + setPayload(JSON.stringify(res, null, 2)); + }); + }, [storagePath]); + + return ( + + + + {title} + + + {payload != null &&