Minor improvments

This commit is contained in:
Pierre HUBERT 2024-10-08 22:24:00 +02:00
parent eafa8e6a4b
commit 138dd6c6b8
2 changed files with 6 additions and 6 deletions

View File

@ -57,7 +57,7 @@ pub async fn upload_firmware(
/// Download a firmware update /// Download a firmware update
pub async fn download_firmware(path: web::Path<SpecificOTAVersionPath>) -> HttpResult { pub async fn download_firmware(path: web::Path<SpecificOTAVersionPath>) -> HttpResult {
if !ota_manager::update_exists(path.platform, &path.version)? { if !ota_manager::update_exists(path.platform, &path.version)? {
return Ok(HttpResponse::NotFound().json("The requested firmware was not found!")); return Ok(HttpResponse::NotFound().json("The requested firmware update was not found!"));
} }
let firmware = ota_manager::get_ota_update(path.platform, &path.version)?; let firmware = ota_manager::get_ota_update(path.platform, &path.version)?;
@ -77,7 +77,7 @@ pub async fn download_firmware(path: web::Path<SpecificOTAVersionPath>) -> HttpR
/// Delete an uploaded firmware update /// Delete an uploaded firmware update
pub async fn delete_update(path: web::Path<SpecificOTAVersionPath>) -> HttpResult { pub async fn delete_update(path: web::Path<SpecificOTAVersionPath>) -> HttpResult {
if !ota_manager::update_exists(path.platform, &path.version)? { if !ota_manager::update_exists(path.platform, &path.version)? {
return Ok(HttpResponse::NotFound().json("The requested update was not found!")); return Ok(HttpResponse::NotFound().json("The requested firmware update was not found!"));
} }
ota_manager::delete_update(path.platform, &path.version)?; ota_manager::delete_update(path.platform, &path.version)?;

View File

@ -16,13 +16,13 @@ import { filesize } from "filesize";
import React from "react"; import React from "react";
import { OTAAPI, OTAUpdate } from "../api/OTAApi"; import { OTAAPI, OTAUpdate } from "../api/OTAApi";
import { UploadUpdateDialog } from "../dialogs/UploadUpdateDialog"; import { UploadUpdateDialog } from "../dialogs/UploadUpdateDialog";
import { useAlert } from "../hooks/context_providers/AlertDialogProvider";
import { useConfirm } from "../hooks/context_providers/ConfirmDialogProvider";
import { useLoadingMessage } from "../hooks/context_providers/LoadingMessageProvider";
import { useSnackbar } from "../hooks/context_providers/SnackbarProvider";
import { AsyncWidget } from "../widgets/AsyncWidget"; import { AsyncWidget } from "../widgets/AsyncWidget";
import { RouterLink } from "../widgets/RouterLink"; import { RouterLink } from "../widgets/RouterLink";
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer"; import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
import { useConfirm } from "../hooks/context_providers/ConfirmDialogProvider";
import { useAlert } from "../hooks/context_providers/AlertDialogProvider";
import { useLoadingMessage } from "../hooks/context_providers/LoadingMessageProvider";
import { useSnackbar } from "../hooks/context_providers/SnackbarProvider";
export function OTARoute(): React.ReactElement { export function OTARoute(): React.ReactElement {
const [list, setList] = React.useState<string[] | undefined>(); const [list, setList] = React.useState<string[] | undefined>();