feat: add interface exporting API

pull/109/head
huoyong.msb 4 years ago
parent deab116a5a
commit 8e83757c1f

@ -0,0 +1,6 @@
### 2021-01-28
* 修复TS错误
* 增加`content-type`的显示 关联 [issue #766](https://github.com/thx/rap2-delos/issues/766)
* 增加接口导出功能,导出后可导入到任何仓库
* 修复社区中的各种问题

@ -9,7 +9,9 @@ import { useSelector } from 'react-redux'
import { RootState } from 'actions/types'
import History from '@material-ui/icons/History'
import HistoryLogDrawer from './HistoryLogDrawer'
import CloudDownload from '@material-ui/icons/CloudDownload'
import { ENTITY_TYPE } from 'utils/consts'
import { serve } from 'relatives/services/constant'
const useStyles = makeStyles((theme: Theme) =>
createStyles({
@ -50,6 +52,7 @@ function InterfaceEditorToolbar(props: Props) {
handleMoveInterface,
handleSaveInterfaceAndProperties,
handleUnlockInterface,
itfId,
} = props
const loading = useSelector((state: RootState) => state.loading)
@ -93,6 +96,17 @@ function InterfaceEditorToolbar(props: Props) {
}
return (
<div className="InterfaceEditorToolbar">
<Tooltip title="导出的备份文件,可以导入到其它项目,或本项目">
<Button
className={`${classes.button} guide-2`}
variant="contained"
onClick={() => window.open(`${serve}/interface/backup/JSONData/${itfId}`)}
size="small"
>
<CloudDownload className={classes.rightIcon} />
</Button>
</Tooltip>
<Tooltip title="查看该接口中的所有改动历史">
<Button
className={`${classes.button} guide-2`}

Loading…
Cancel
Save