Files
dashboard/frontend/src/api/ota.js
T
yangy 1a6c96da8c 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.
2026-05-15 17:34:54 +08:00

68 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import request from '@/utils/request'
/**
* OTA 列表
* @param {Object} params
* @param {number} [params.skip]
* @param {number} [params.limit]
* @param {number} [params.verCode]
* @param {string} [params.verName]
* @param {string} [params.model]
* @param {number} [params.status] 0 | 1
*/
export function getOtaList(params) {
return request({
url: '/ota/',
method: 'get',
params
})
}
export function getOta(id) {
return request({
url: `/ota/${id}`,
method: 'get'
})
}
export function createOta(data) {
return request({
url: '/ota/',
method: 'post',
data
})
}
export function updateOta(id, data) {
return request({
url: `/ota/${id}`,
method: 'put',
data
})
}
export function deleteOta(id) {
return request({
url: `/ota/${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
})
}