code quality improvements and improved file error handling
This commit is contained in:
@@ -14,16 +14,24 @@ const SystemFileUpload = ({ name, selectedFile }: SystemFileUploadProps) => {
|
||||
|
||||
const handleFileUploadClick = () => {
|
||||
if (!selectedFile) return;
|
||||
uploadSettings(selectedFile, {
|
||||
timeoutMs: 30000,
|
||||
fieldName: "upload",
|
||||
});
|
||||
const settings = {
|
||||
file: selectedFile,
|
||||
opts: {
|
||||
timeoutMs: 30000,
|
||||
fieldName: "upload",
|
||||
uploadUrl: "http://192.168.75.11/upload/software-update/2'",
|
||||
},
|
||||
};
|
||||
uploadSettings(settings);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="py-8 w-full">
|
||||
<div className="border-b border-gray-600">
|
||||
<h2>Software Update file upload</h2>
|
||||
</div>
|
||||
<FormGroup>
|
||||
<div className="flex-1 flex justify-end md:w-2/3">
|
||||
<div className="flex-1 flex md:w-2/3 my-5">
|
||||
<input
|
||||
type="file"
|
||||
name="softwareUpdate"
|
||||
|
||||
Reference in New Issue
Block a user