Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/proddy/EMS-ESP32 into idf4
- Loading branch information
Showing
38 changed files
with
381 additions
and
377 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
import { AxiosPromise } from 'axios'; | ||
import { FC } from 'react'; | ||
|
||
import { FileUploadConfig } from '../../api/endpoints'; | ||
import { MessageBox, SingleUpload, useFileUpload } from '../../components'; | ||
|
||
interface UploadFileProps { | ||
uploadGeneralFile: (file: File, config?: FileUploadConfig) => AxiosPromise<void>; | ||
} | ||
|
||
const GeneralFileUpload: FC<UploadFileProps> = ({ uploadGeneralFile }) => { | ||
const [uploadFile, cancelUpload, uploading, uploadProgress] = useFileUpload({ upload: uploadGeneralFile }); | ||
|
||
return ( | ||
<> | ||
{!uploading && ( | ||
<MessageBox | ||
message="Upload a new firmware (.bin) file or an exported settings or customizations (.json) file below. EMS-ESP will restart afterwards to apply the new changes." | ||
level="warning" | ||
my={2} | ||
/> | ||
)} | ||
<SingleUpload onDrop={uploadFile} onCancel={cancelUpload} uploading={uploading} progress={uploadProgress} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default GeneralFileUpload; |
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,26 @@ | ||
import { FC, useRef, useState } from 'react'; | ||
|
||
import * as SystemApi from '../../api/system'; | ||
import { SectionContent } from '../../components'; | ||
import { FileUploadConfig } from '../../api/endpoints'; | ||
|
||
import GeneralFileUpload from './GeneralFileUpload'; | ||
import RestartMonitor from './RestartMonitor'; | ||
|
||
const UploadFileForm: FC = () => { | ||
const [restarting, setRestarting] = useState<boolean>(); | ||
|
||
const uploadFile = useRef(async (file: File, config?: FileUploadConfig) => { | ||
const response = await SystemApi.uploadFile(file, config); | ||
setRestarting(true); | ||
return response; | ||
}); | ||
|
||
return ( | ||
<SectionContent title="Upload File" titleGutter> | ||
{restarting ? <RestartMonitor /> : <GeneralFileUpload uploadGeneralFile={uploadFile.current} />} | ||
</SectionContent> | ||
); | ||
}; | ||
|
||
export default UploadFileForm; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.