From 138dd6c6b829cc05b8bfccc732746bce1edb9f20 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 8 Oct 2024 22:24:00 +0200 Subject: [PATCH] Minor improvments --- central_backend/src/server/web_api/ota_controller.rs | 4 ++-- central_frontend/src/routes/OTARoute.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/central_backend/src/server/web_api/ota_controller.rs b/central_backend/src/server/web_api/ota_controller.rs index 291a05c..b4ea83a 100644 --- a/central_backend/src/server/web_api/ota_controller.rs +++ b/central_backend/src/server/web_api/ota_controller.rs @@ -57,7 +57,7 @@ pub async fn upload_firmware( /// Download a firmware update pub async fn download_firmware(path: web::Path) -> HttpResult { 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)?; @@ -77,7 +77,7 @@ pub async fn download_firmware(path: web::Path) -> HttpR /// Delete an uploaded firmware update pub async fn delete_update(path: web::Path) -> HttpResult { 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)?; diff --git a/central_frontend/src/routes/OTARoute.tsx b/central_frontend/src/routes/OTARoute.tsx index 2734978..bb80beb 100644 --- a/central_frontend/src/routes/OTARoute.tsx +++ b/central_frontend/src/routes/OTARoute.tsx @@ -16,13 +16,13 @@ import { filesize } from "filesize"; import React from "react"; import { OTAAPI, OTAUpdate } from "../api/OTAApi"; 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 { RouterLink } from "../widgets/RouterLink"; 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 { const [list, setList] = React.useState();