From 9a39c9e50e20de88db3dbdfbe832bb70a3dd43e5 Mon Sep 17 00:00:00 2001 From: Kevin BEAUGRAND <9513635+kbeaugrand@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:18:32 +0200 Subject: [PATCH] Visual changes on IoT Edge pages (#504) * Visual changes on EdgeDeviceDetailPage * Added an error snackbar Co-authored-by: Audrey Serra --- .../Edge_Devices/EdgeDeviceDetailPage.razor | 322 +++++++++--------- 1 file changed, 170 insertions(+), 152 deletions(-) diff --git a/src/AzureIoTHub.Portal/Client/Pages/Edge_Devices/EdgeDeviceDetailPage.razor b/src/AzureIoTHub.Portal/Client/Pages/Edge_Devices/EdgeDeviceDetailPage.razor index 8266aa7d3..0affc480a 100644 --- a/src/AzureIoTHub.Portal/Client/Pages/Edge_Devices/EdgeDeviceDetailPage.razor +++ b/src/AzureIoTHub.Portal/Client/Pages/Edge_Devices/EdgeDeviceDetailPage.razor @@ -13,163 +13,173 @@ Edge Device Details - - +@if (loading) +{ + + + + + +} +else +{ + - @if (loading) - { - - + + + + + @Gateway.DeviceId + + + + Connect + + + + @if (processingDelete) + { + + Processing + + } + else + { + Delete edge device + } + @if (processingUpdate) + { + + Processing + + } + else + { + Save Changes + } - } - else - { - - - - - @Gateway.DeviceId - - - Connect - - - - - - - - - - - Edge Device Details - - - - - - - - - - - - - - Status - - - @if (Gateway.Status == "Enabled") - { - The device can connect to the platform. - } - else - { - The device cannot connect to the platform. - } - - - - - - Runtime response - - @if (Gateway.RuntimeResponse == "running") - { - - } - else - { - - - - } - - - - - - - - - - - - - Last deployment - - - - - - - - - + + + + + + + + + Edge Device Details + + + + + + + + + + + + + + + Status + + + @if (Gateway.Status == "Enabled") + { + The device can connect to the platform. + } + else + { + The device cannot connect to the platform. + } + - - - - - - - @if (processingDelete) - { - - - Processing - - } - else - { - Delete Edge Device - } - - @if (processingUpdate) - { - - - Processing - - } - else - { - Save Changes - } - - - - - - - - - - - - - - Module Name - Version - Status - - - - @context.ModuleName - @context.Version - @context.Status - - logs - reboot - - - - - } + + + Runtime response + + @if (Gateway.RuntimeResponse == "running") + { + + } + else + { + + + + } + + + + + + + + + + + + + + + + Last deployment + + + + + + + + + + + + + + + + + + + + Modules + + + + + + + + + + Module Name + Version + Status + + + + @context.ModuleName + @context.Version + @context.Status + + logs + reboot + + + + + + + + + + + - - + +} @code { [Parameter] @@ -207,6 +217,14 @@ { Snackbar.Add($"Device {Gateway.DeviceId} has been successfully updated!", Severity.Success); } + else if (result.StatusCode == System.Net.HttpStatusCode.BadRequest) + { + Snackbar.Add("One or more validation errors occurred", Severity.Error); + } + else + { + Snackbar.Add("Something unexpected occurred", Severity.Warning); + } processingUpdate = false; }