mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-14 09:25:47 +01:00
Add Config saver
This commit is contained in:
18
components/Config/SaveConfig.tsx
Normal file
18
components/Config/SaveConfig.tsx
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { Anchor, Button, ThemeIcon, Tooltip } from '@mantine/core';
|
||||||
|
import fileDownload from 'js-file-download';
|
||||||
|
import { Dropzone, DropzoneStatus, IMAGE_MIME_TYPE } from '@mantine/dropzone';
|
||||||
|
import { Download } from 'tabler-icons-react';
|
||||||
|
|
||||||
|
export default function SaveConfigComponent(props: any) {
|
||||||
|
function onClick(e: any) {
|
||||||
|
const services = localStorage.getItem('services');
|
||||||
|
if (services) {
|
||||||
|
fileDownload(JSON.stringify(JSON.parse(services), null, '\t'), 'services.json');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Button leftIcon={<Download/>} variant='outline' onClick={onClick}>
|
||||||
|
Download your config
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user