mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-09 16:19:47 +00:00
cleanup
- removing upload for now, should go somewhere else
This commit is contained in:
@@ -8,13 +8,12 @@ import EventListWrapper from './list/EventListWrapper';
|
|||||||
import { useDisclosure } from '@chakra-ui/hooks';
|
import { useDisclosure } from '@chakra-ui/hooks';
|
||||||
import SettingsModal from '../modals/SettingsModal';
|
import SettingsModal from '../modals/SettingsModal';
|
||||||
import SettingsIconBtn from 'common/components/buttons/SettingsIconBtn';
|
import SettingsIconBtn from 'common/components/buttons/SettingsIconBtn';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect } from 'react';
|
||||||
import DownloadIconBtn from 'common/components/buttons/DownloadIconBtn';
|
import DownloadIconBtn from 'common/components/buttons/DownloadIconBtn';
|
||||||
import { downloadEvents, uploadEvents } from 'app/api/ontimeApi';
|
import { downloadEvents } from 'app/api/ontimeApi';
|
||||||
|
|
||||||
export default function Editor() {
|
export default function Editor() {
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||||
const [file, setFile] = useState(null);
|
|
||||||
|
|
||||||
// Set window title
|
// Set window title
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -25,19 +24,6 @@ export default function Editor() {
|
|||||||
downloadEvents();
|
downloadEvents();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFile = (e) => {
|
|
||||||
setFile(e.target.files[0]);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleUpload = (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
console.log('gonna upload', file);
|
|
||||||
|
|
||||||
if (file && file.type === 'application/json') {
|
|
||||||
if (file.size < 1048576) uploadEvents(file);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SettingsModal isOpen={isOpen} onClose={onClose} />
|
<SettingsModal isOpen={isOpen} onClose={onClose} />
|
||||||
@@ -81,19 +67,7 @@ export default function Editor() {
|
|||||||
Info
|
Info
|
||||||
</Heading>
|
</Heading>
|
||||||
<NumberedText number={4} text={'Running Info'} />
|
<NumberedText number={4} text={'Running Info'} />
|
||||||
<div className={styles.content}>
|
<div className={styles.content}></div>
|
||||||
<form id='uploaddb' onSubmit={handleUpload}>
|
|
||||||
<input
|
|
||||||
type='file'
|
|
||||||
name='jsondb'
|
|
||||||
accept='.json'
|
|
||||||
onChange={handleFile}
|
|
||||||
/>
|
|
||||||
<button className='submit-btn' type='submit'>
|
|
||||||
Upload
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Box className={styles.settings}>
|
<Box className={styles.settings}>
|
||||||
|
|||||||
Reference in New Issue
Block a user