diff --git a/MP-TAB3/Components/MachineBlock.razor b/MP-TAB3/Components/MachineBlock.razor
index 98c6765a..06879b3d 100644
--- a/MP-TAB3/Components/MachineBlock.razor
+++ b/MP-TAB3/Components/MachineBlock.razor
@@ -249,10 +249,15 @@ else
@if (showDraw && RecMSE != null)
{
-
-
-
- @* *@
-
- @* *@
+ if (isMobile)
+ {
+
Mobile
+
+ }
+ else
+ {
+ DESKTOP
+
+ }
+ @* *@
}
\ No newline at end of file
diff --git a/MP-TAB3/Components/MachineBlock.razor.cs b/MP-TAB3/Components/MachineBlock.razor.cs
index 4de27c7b..30c96bf3 100644
--- a/MP-TAB3/Components/MachineBlock.razor.cs
+++ b/MP-TAB3/Components/MachineBlock.razor.cs
@@ -5,6 +5,7 @@ using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using NLog;
+using System;
namespace MP_TAB3.Components
{
@@ -37,16 +38,6 @@ namespace MP_TAB3.Components
#endregion Public Properties
- private bool showDraw { get; set; } = false;
-
- ///
- /// Toggle visibilità button
- ///
- protected void ToggleDraw()
- {
- showDraw = !showDraw;
- }
-
#region Public Methods
///
@@ -93,15 +84,10 @@ namespace MP_TAB3.Components
#region Protected Fields
protected string baseCss = "sem";
-
protected int currMaxVal = 1000;
-
protected List innerCircleVals = new List();
-
protected int kaFactor = 60 / 2;
-
protected int maxVal = 1000;
-
protected List outerCircleVals = new List();
#endregion Protected Fields
@@ -158,9 +144,10 @@ namespace MP_TAB3.Components
if (firstRender)
{
//await getWDim();
- StateHasChanged();
+ await InvokeAsync(StateHasChanged);
}
isLoading = RecMSE == null;
+ isMobile = await JSRuntime.InvokeAsync("isDevice");
await Task.Delay(1);
//return base.OnAfterRenderAsync(firstRender);
}
@@ -244,6 +231,14 @@ namespace MP_TAB3.Components
NavMan.NavigateTo($"machine-detail");
}
+ ///
+ /// Toggle visibilità button
+ ///
+ protected void ToggleDraw()
+ {
+ showDraw = !showDraw;
+ }
+
#endregion Protected Methods
#region Private Fields
@@ -254,6 +249,17 @@ namespace MP_TAB3.Components
#endregion Private Fields
+ #region Private Properties
+
+ ///
+ /// Boolean Mobile vs Desktop
+ ///
+ private bool isMobile { get; set; }
+
+ private bool showDraw { get; set; } = false;
+
+ #endregion Private Properties
+
#region Private Methods
private string cssComStatus(string semaforo, DateTime? lastUpdateN)
diff --git a/MP-TAB3/Pages/_Layout.cshtml b/MP-TAB3/Pages/_Layout.cshtml
index b94fbe6b..dda9ce01 100644
--- a/MP-TAB3/Pages/_Layout.cshtml
+++ b/MP-TAB3/Pages/_Layout.cshtml
@@ -36,6 +36,7 @@
🗙
+
diff --git a/MP-TAB3/wwwroot/lib/Utils.js b/MP-TAB3/wwwroot/lib/Utils.js
new file mode 100644
index 00000000..951d5960
--- /dev/null
+++ b/MP-TAB3/wwwroot/lib/Utils.js
@@ -0,0 +1,3 @@
+function isDevice() {
+ return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent);
+}
\ No newline at end of file