Add OTA package upload functionality and UI enhancements
- Introduced a new endpoint for uploading OTA packages in backend/routes/ota.py. - Implemented file handling and MD5 checksum calculation for OTA packages. - Updated frontend API to support OTA package uploads with a new uploadOtaPackage function. - Enhanced the OTA management UI to include file upload options and improved layout. - Updated requirements.txt to include boto3 for S3 interactions. - Made various UI adjustments for better user experience and consistency.
This commit is contained in:
@@ -47,3 +47,21 @@ export function deleteOta(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传 OTA 升级包(Luxsin-X9)
|
||||
* @param {File} file
|
||||
* @param {string} model 设备型号
|
||||
*/
|
||||
export function uploadOtaPackage(file, model) {
|
||||
const formData = new FormData()
|
||||
formData.append('package_file', file)
|
||||
formData.append('model', model)
|
||||
return request({
|
||||
url: '/ota/upload-package',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
timeout: 300000
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user