Display the list of OTA updates in the frontend
This commit is contained in:
@ -10,7 +10,7 @@ use actix_multipart::form::MultipartForm;
|
||||
use actix_web::{web, HttpResponse};
|
||||
|
||||
pub async fn supported_platforms() -> HttpResult {
|
||||
Ok(HttpResponse::Ok().json(vec![OTAPlatform::Wt32Eth01]))
|
||||
Ok(HttpResponse::Ok().json(OTAPlatform::supported_platforms()))
|
||||
}
|
||||
|
||||
#[derive(Debug, MultipartForm)]
|
||||
@ -53,6 +53,11 @@ pub async fn upload_firmware(
|
||||
Ok(HttpResponse::Accepted().body("OTA update successfully saved."))
|
||||
}
|
||||
|
||||
/// Get the list of all OTA updates
|
||||
pub async fn list_all_ota() -> HttpResult {
|
||||
Ok(HttpResponse::Ok().json(ota_manager::get_all_ota_updates()?))
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct ListOTAPath {
|
||||
platform: OTAPlatform,
|
||||
|
Reference in New Issue
Block a user