-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ins & index action buttons.
feat: build dump creation button. perf: improved index list card style. feat: add ins form modal drag tag style. perf: improved lang selector style. feat: init some function pages with their header links.
- Loading branch information
Showing
20 changed files
with
310 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useCurrentInstance } from '@/hooks/useCurrentInstance'; | ||
import { useMeiliClient } from '@/hooks/useMeiliClient'; | ||
import { Button } from '@nextui-org/react'; | ||
import { useCallback } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { showTaskSubmitNotification } from '@/utils/text'; | ||
import { Modal } from '@douyinfe/semi-ui'; | ||
|
||
export const DumpButton = () => { | ||
const { t } = useTranslation('instance'); | ||
const currentInstance = useCurrentInstance(); | ||
const client = useMeiliClient(); | ||
|
||
const onClickDump = useCallback(() => { | ||
Modal.confirm({ | ||
title: t('instance:dump.dialog.title'), | ||
centered: true, | ||
content: <p>{t('instance:dump.dialog.tip', { name: currentInstance.name })}</p>, | ||
onOk: async () => { | ||
showTaskSubmitNotification(await client.createDump()); | ||
}, | ||
okText: t('confirm'), | ||
cancelText: t('cancel'), | ||
}); | ||
}, [client, currentInstance.name, t]); | ||
|
||
return ( | ||
<Button onClick={onClickDump} color="default" variant="light" size="sm"> | ||
<div className="i-lucide:archive-restore w-1em h-1em"></div> | ||
Dump | ||
</Button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.