|
@@ -9,7 +9,17 @@ import { Button, Menu, MenuButton, MenuDivider, MenuItem, MenuList, useToast } f
|
|
import { actions, agent } from '@renderer/core/agent'
|
|
import { actions, agent } from '@renderer/core/agent'
|
|
import { feedback_url, homepage_url } from '@root/common/constants'
|
|
import { feedback_url, homepage_url } from '@root/common/constants'
|
|
import React from 'react'
|
|
import React from 'react'
|
|
-import { BiCog, BiExit, BiHomeCircle, BiInfoCircle, BiMessageDetail, BiRefresh, BiSliderAlt } from 'react-icons/bi'
|
|
|
|
|
|
+import {
|
|
|
|
+ BiCog,
|
|
|
|
+ BiExit,
|
|
|
|
+ BiHomeCircle,
|
|
|
|
+ BiInfoCircle,
|
|
|
|
+ BiMessageDetail,
|
|
|
|
+ BiRefresh,
|
|
|
|
+ BiSliderAlt,
|
|
|
|
+ BiExport,
|
|
|
|
+ BiImport,
|
|
|
|
+} from 'react-icons/bi'
|
|
|
|
|
|
interface Props {
|
|
interface Props {
|
|
|
|
|
|
@@ -69,6 +79,36 @@ const ConfigMenu = (props: Props) => {
|
|
|
|
|
|
<MenuDivider/>
|
|
<MenuDivider/>
|
|
|
|
|
|
|
|
+ <MenuItem
|
|
|
|
+ icon={<BiExport/>}
|
|
|
|
+ onClick={async () => {
|
|
|
|
+ let r = await actions.exportData()
|
|
|
|
+ if (r === false) {
|
|
|
|
+ toast({
|
|
|
|
+ status: 'error',
|
|
|
|
+ description: lang.fail,
|
|
|
|
+ isClosable: true,
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ toast({
|
|
|
|
+ status: 'success',
|
|
|
|
+ description: lang.export_done,
|
|
|
|
+ isClosable: true,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ {lang.export}
|
|
|
|
+ </MenuItem>
|
|
|
|
+ <MenuItem
|
|
|
|
+ icon={<BiImport/>}
|
|
|
|
+ onClick={() => agent.broadcast('show_preferences')}
|
|
|
|
+ >
|
|
|
|
+ {lang.import}
|
|
|
|
+ </MenuItem>
|
|
|
|
+
|
|
|
|
+ <MenuDivider/>
|
|
|
|
+
|
|
<MenuItem
|
|
<MenuItem
|
|
icon={<BiSliderAlt/>}
|
|
icon={<BiSliderAlt/>}
|
|
onClick={() => agent.broadcast('show_preferences')}
|
|
onClick={() => agent.broadcast('show_preferences')}
|