diff --git a/MP-TAB-SERV/Components/MachineBlock.razor.cs b/MP-TAB-SERV/Components/MachineBlock.razor.cs index 2affe087..5fe42ba1 100644 --- a/MP-TAB-SERV/Components/MachineBlock.razor.cs +++ b/MP-TAB-SERV/Components/MachineBlock.razor.cs @@ -16,7 +16,6 @@ namespace MP_TAB_SERV.Components [Parameter] public bool FullMode { get; set; } = true; - public int Height { get; set; } = 0; [Parameter] public int keepAliveMin { get; set; } = 5; @@ -27,8 +26,12 @@ namespace MP_TAB_SERV.Components [Parameter] public bool showCard { get; set; } + [Parameter] public int Width { get; set; } = 0; + [Parameter] + public int Height { get; set; } = 0; + #endregion Public Properties #region Public Methods @@ -98,20 +101,6 @@ namespace MP_TAB_SERV.Components #endregion Public Methods - #region Public Classes - - public class WindowDimension - { - #region Public Properties - - public int Height { get; set; } - public int Width { get; set; } - - #endregion Public Properties - } - - #endregion Public Classes - #region Protected Fields protected string baseCss = "sem"; @@ -161,18 +150,12 @@ namespace MP_TAB_SERV.Components #region Protected Methods - protected async Task getWDim() - { - var dimension = await JSRuntime.InvokeAsync("getWindowDimensions"); - Height = dimension.Height; - Width = dimension.Width; - } protected override async Task OnAfterRenderAsync(bool firstRender) {//await Task.Delay(500); if (firstRender) { - await getWDim(); + //await getWDim(); StateHasChanged(); } isLoading = RecMSE == null; diff --git a/MP-TAB-SERV/Components/ProdConfirm.razor b/MP-TAB-SERV/Components/ProdConfirm.razor index 29c04616..e578efcf 100644 --- a/MP-TAB-SERV/Components/ProdConfirm.razor +++ b/MP-TAB-SERV/Components/ProdConfirm.razor @@ -137,10 +137,10 @@ else *@ }
-
+
Dati Globali ODL
-
+
@**@ diff --git a/MP-TAB-SERV/Pages/StatusMap.razor b/MP-TAB-SERV/Pages/StatusMap.razor index 3915a969..fe8c718c 100644 --- a/MP-TAB-SERV/Pages/StatusMap.razor +++ b/MP-TAB-SERV/Pages/StatusMap.razor @@ -15,17 +15,21 @@ } else { -
- -
- - + @if (Width < 640) + { + +
+ +
+ + +
-
+ } @foreach (var item in ListMSE) {
- +
} } diff --git a/MP-TAB-SERV/Pages/StatusMap.razor.cs b/MP-TAB-SERV/Pages/StatusMap.razor.cs index ec53794d..0f5a097f 100644 --- a/MP-TAB-SERV/Pages/StatusMap.razor.cs +++ b/MP-TAB-SERV/Pages/StatusMap.razor.cs @@ -1,8 +1,10 @@ using global::Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; using MP.Data.Conf; using MP.Data.DatabaseModels; using MP.Data.Services; using NLog; +using System.Runtime.ExceptionServices; namespace MP_TAB_SERV.Pages { @@ -28,6 +30,8 @@ namespace MP_TAB_SERV.Pages [Inject] protected MessageService MServ { get; set; } = null!; + [Inject] + protected IJSRuntime JSRuntime{ get; set; } = null!; protected bool ShowCard { @@ -86,6 +90,10 @@ namespace MP_TAB_SERV.Pages protected override async Task OnAfterRenderAsync(bool firstRender) { + if (firstRender) + { + await getWDim(); + } if (ListMSE != null) { // salvo in LocalStorage... @@ -134,5 +142,24 @@ namespace MP_TAB_SERV.Pages } #endregion Private Methods + + protected int Width { get; set; } = 0; + protected int Height { get; set; } = 0; + + public class WindowDimension + { + #region Public Properties + + public int Height { get; set; } + public int Width { get; set; } + + #endregion Public Properties + } + protected async Task getWDim() + { + var dimension = await JSRuntime.InvokeAsync("getWindowDimensions"); + Height = dimension.Height; + Width = dimension.Width; + } } } \ No newline at end of file