Prima configurazione e struttura
This commit is contained in:
10
.idea/.idea.SteUp/.idea/deploymentTargetSelector.xml
generated
Normal file
10
.idea/.idea.SteUp/.idea/deploymentTargetSelector.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="deploymentTargetSelector">
|
||||||
|
<selectionStates>
|
||||||
|
<SelectionState runConfigName="SteUp.Maui">
|
||||||
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
|
</SelectionState>
|
||||||
|
</selectionStates>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
9
.idea/.idea.SteUp/.idea/libraries/androidx_collection_collection_jvm.xml
generated
Normal file
9
.idea/.idea.SteUp/.idea/libraries/androidx_collection_collection_jvm.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="androidx.collection.collection-jvm">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.collection.jvm/1.5.0.1/jar/androidx.collection.collection-jvm.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
9
.idea/.idea.SteUp/.idea/libraries/androidx_lifecycle_lifecycle_common_jvm.xml
generated
Normal file
9
.idea/.idea.SteUp/.idea/libraries/androidx_lifecycle_lifecycle_common_jvm.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="androidx.lifecycle.lifecycle-common-jvm">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$USER_HOME$/.nuget/packages/xamarin.androidx.lifecycle.common.jvm/2.8.7.3/jar/androidx.lifecycle.lifecycle-common-jvm.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:local="clr-namespace:Template.Maui"
|
xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls"
|
||||||
x:Class="Template.Maui.App">
|
android:Application.WindowSoftInputModeAdjust="Resize"
|
||||||
|
x:Class="SteUp.Maui.App">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
|
||||||
<Color x:Key="PageBackgroundColor">#512bdf</Color>
|
<Color x:Key="PageBackgroundColor">#dff2ff</Color>
|
||||||
<Color x:Key="PrimaryTextColor">White</Color>
|
<Color x:Key="PrimaryTextColor">White</Color>
|
||||||
|
|
||||||
<Style TargetType="Label">
|
<Style TargetType="Label">
|
||||||
@@ -17,7 +18,7 @@
|
|||||||
<Style TargetType="Button">
|
<Style TargetType="Button">
|
||||||
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
|
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
|
||||||
<Setter Property="FontFamily" Value="OpenSansRegular" />
|
<Setter Property="FontFamily" Value="OpenSansRegular" />
|
||||||
<Setter Property="BackgroundColor" Value="#2b0b98" />
|
<Setter Property="BackgroundColor" Value="#dff2ff" />
|
||||||
<Setter Property="Padding" Value="14,10" />
|
<Setter Property="Padding" Value="14,10" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
namespace Template.Maui
|
namespace SteUp.Maui
|
||||||
{
|
{
|
||||||
public partial class App : Application
|
public partial class App
|
||||||
{
|
{
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
MainPage = new MainPage();
|
protected override Window CreateWindow(IActivationState? activationState)
|
||||||
|
{
|
||||||
|
return new Window(new MainPage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
35
SteUp.Maui/Core/CoreModule.cs
Normal file
35
SteUp.Maui/Core/CoreModule.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
|
using SteUp.Maui.Core.Services;
|
||||||
|
using SteUp.Maui.Core.System.Network;
|
||||||
|
using SteUp.Shared.Core.Interface;
|
||||||
|
using SteUp.Shared.Core.Interface.IntegryApi;
|
||||||
|
using SteUp.Shared.Core.Interface.System.Network;
|
||||||
|
using SteUp.Shared.Core.Services;
|
||||||
|
|
||||||
|
namespace SteUp.Maui.Core;
|
||||||
|
|
||||||
|
public static class CoreModule
|
||||||
|
{
|
||||||
|
public static void RegisterAppServices(this MauiAppBuilder builder)
|
||||||
|
{
|
||||||
|
builder.Services.AddSingleton<IFormFactor, FormFactor>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RegisterIntegryServices(this MauiAppBuilder builder)
|
||||||
|
{
|
||||||
|
builder.Services.AddScoped<IIntegryApiService, IntegryApiService>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RegisterSystemService(this MauiAppBuilder builder)
|
||||||
|
{
|
||||||
|
builder.Services.AddSingleton<INetworkService, NetworkService>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddAuthorizationCore(this MauiAppBuilder builder)
|
||||||
|
{
|
||||||
|
builder.Services.AddAuthorizationCore();
|
||||||
|
builder.Services.AddScoped<AppAuthenticationStateProvider>();
|
||||||
|
builder.Services.AddScoped<AuthenticationStateProvider>(provider =>
|
||||||
|
provider.GetRequiredService<AppAuthenticationStateProvider>());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Template.Shared.Interfaces;
|
using SteUp.Shared.Core.Interface;
|
||||||
|
|
||||||
namespace Template.Maui.Services;
|
namespace SteUp.Maui.Core.Services;
|
||||||
|
|
||||||
public class FormFactor : IFormFactor
|
public class FormFactor : IFormFactor
|
||||||
{
|
{
|
||||||
12
SteUp.Maui/Core/System/Network/NetworkService.cs
Normal file
12
SteUp.Maui/Core/System/Network/NetworkService.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using SteUp.Shared.Core.Interface.System.Network;
|
||||||
|
|
||||||
|
namespace SteUp.Maui.Core.System.Network;
|
||||||
|
|
||||||
|
public class NetworkService : INetworkService
|
||||||
|
{
|
||||||
|
public bool ConnectionAvailable { get; set; }
|
||||||
|
|
||||||
|
public bool IsNetworkAvailable() =>
|
||||||
|
Connectivity.Current.NetworkAccess == NetworkAccess.Internet;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:local="clr-namespace:Template.Maui"
|
xmlns:shared="clr-namespace:SteUp.Shared;assembly=SteUp.Shared"
|
||||||
xmlns:shared="clr-namespace:Template.Shared;assembly=Template.Shared"
|
x:Class="SteUp.Maui.MainPage"
|
||||||
x:Class="Template.Maui.MainPage"
|
|
||||||
BackgroundColor="{DynamicResource PageBackgroundColor}">
|
BackgroundColor="{DynamicResource PageBackgroundColor}">
|
||||||
|
|
||||||
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html">
|
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Template.Maui
|
namespace SteUp.Maui
|
||||||
{
|
{
|
||||||
public partial class MainPage : ContentPage
|
public partial class MainPage : ContentPage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
|
using CommunityToolkit.Maui;
|
||||||
using IntegryApiClient.MAUI;
|
using IntegryApiClient.MAUI;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Template.Maui.Services;
|
using MudBlazor.Services;
|
||||||
using Template.Shared;
|
using SteUp.Maui.Core;
|
||||||
using Template.Shared.Interfaces;
|
using SteUp.Maui.Core.Services;
|
||||||
|
using SteUp.Shared;
|
||||||
|
using SteUp.Shared.Core.Interface;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace SteUp.Maui
|
||||||
{
|
{
|
||||||
public static class MauiProgram
|
public static class MauiProgram
|
||||||
{
|
{
|
||||||
#if DEBUG
|
private const string AppToken = "4fef1843-793d-499b-a7ed-1edd8cac465c";
|
||||||
private const string BaseRestServicesEndpoint = "https://devservices.studioml.it/ems-api/";
|
|
||||||
//private const string BaseRestServicesEndpoint = "http://192.168.2.23:8080/ems-api/";
|
|
||||||
#else
|
|
||||||
private const string BaseRestServicesEndpoint = "https://services.studioml.it/ems-api/";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public static MauiApp CreateMauiApp()
|
public static MauiApp CreateMauiApp()
|
||||||
{
|
{
|
||||||
@@ -22,21 +20,22 @@ namespace Template.Maui
|
|||||||
var builder = MauiApp.CreateBuilder();
|
var builder = MauiApp.CreateBuilder();
|
||||||
builder
|
builder
|
||||||
.UseMauiApp<App>()
|
.UseMauiApp<App>()
|
||||||
.UseIntegry(BaseRestServicesEndpoint)
|
.UseIntegry(appToken: AppToken, useLoginAzienda: true)
|
||||||
.ConfigureFonts(fonts =>
|
.UseMauiCommunityToolkit()
|
||||||
{
|
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); });
|
||||||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
|
||||||
});
|
|
||||||
|
|
||||||
builder.Services.AddMauiBlazorWebView();
|
builder.Services.AddMauiBlazorWebView();
|
||||||
builder.Services.AddBlazorBootstrap();
|
builder.Services.AddMudServices();
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
builder.Services.AddBlazorWebViewDeveloperTools();
|
builder.Services.AddBlazorWebViewDeveloperTools();
|
||||||
builder.Logging.AddDebug();
|
builder.Logging.AddDebug();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
builder.Services.AddSingleton<IFormFactor, FormFactor>();
|
builder.AddAuthorizationCore();
|
||||||
|
builder.RegisterAppServices();
|
||||||
|
builder.RegisterIntegryServices();
|
||||||
|
builder.RegisterSystemService();
|
||||||
|
|
||||||
return builder.Build();
|
return builder.Build();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Android.App;
|
|||||||
using Android.Content.PM;
|
using Android.Content.PM;
|
||||||
using Android.OS;
|
using Android.OS;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace SteUp.Maui
|
||||||
{
|
{
|
||||||
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
|
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
|
||||||
public class MainActivity : MauiAppCompatActivity
|
public class MainActivity : MauiAppCompatActivity
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Android.App;
|
using Android.App;
|
||||||
using Android.Runtime;
|
using Android.Runtime;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace SteUp.Maui
|
||||||
{
|
{
|
||||||
[Application]
|
[Application]
|
||||||
public class MainApplication : MauiApplication
|
public class MainApplication : MauiApplication
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="colorPrimary">#512BD4</color>
|
<color name="colorPrimary">#ec4c41</color>
|
||||||
<color name="colorPrimaryDark">#2B0B98</color>
|
<color name="colorPrimaryDark">#d02315</color>
|
||||||
<color name="colorAccent">#2B0B98</color>
|
<color name="colorAccent">#d02315</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Foundation;
|
using Foundation;
|
||||||
using Template.Maui;
|
using SteUp.Maui;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace SteUp.Maui
|
||||||
{
|
{
|
||||||
[Register("AppDelegate")]
|
[Register("AppDelegate")]
|
||||||
public class AppDelegate : MauiUIApplicationDelegate
|
public class AppDelegate : MauiUIApplicationDelegate
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using ObjCRuntime;
|
using ObjCRuntime;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace SteUp.Maui
|
||||||
{
|
{
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System;
|
|||||||
using Microsoft.Maui;
|
using Microsoft.Maui;
|
||||||
using Microsoft.Maui.Hosting;
|
using Microsoft.Maui.Hosting;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace SteUp.Maui
|
||||||
{
|
{
|
||||||
internal class Program : MauiApplication
|
internal class Program : MauiApplication
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest package="maui-application-id-placeholder" version="0.0.0" api-version="8" xmlns="http://tizen.org/ns/packages">
|
<manifest package="maui-application-id-placeholder" version="0.0.0" api-version="8" xmlns="http://tizen.org/ns/packages">
|
||||||
<profile name="common" />
|
<profile name="common" />
|
||||||
<ui-application appid="maui-application-id-placeholder" exec="Template.Maui.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
|
<ui-application appid="maui-application-id-placeholder" exec="SteUp.Maui.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
|
||||||
<label>maui-application-title-placeholder</label>
|
<label>maui-application-title-placeholder</label>
|
||||||
<icon>maui-appicon-placeholder</icon>
|
<icon>maui-appicon-placeholder</icon>
|
||||||
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
|
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using Microsoft.UI.Xaml;
|
|||||||
// To learn more about WinUI, the WinUI project structure,
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
namespace Template.Maui.WinUI
|
namespace SteUp.Maui.WinUI
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides application-specific behavior to supplement the default Application class.
|
/// Provides application-specific behavior to supplement the default Application class.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<assemblyIdentity version="1.0.0.0" name="Template.Maui.WinUI.app"/>
|
<assemblyIdentity version="1.0.0.0" name="SteUp.Maui.WinUI.app"/>
|
||||||
|
|
||||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
<windowsSettings>
|
<windowsSettings>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Foundation;
|
using Foundation;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace SteUp.Maui
|
||||||
{
|
{
|
||||||
[Register("AppDelegate")]
|
[Register("AppDelegate")]
|
||||||
public class AppDelegate : MauiUIApplicationDelegate
|
public class AppDelegate : MauiUIApplicationDelegate
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using ObjCRuntime;
|
using ObjCRuntime;
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace Template.Maui
|
namespace SteUp.Maui
|
||||||
{
|
{
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 456 456" width="456" height="456"><defs><image width="456" height="456" id="img1" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcgAAAHIAQMAAADwb+ipAAAAAXNSR0IB2cksfwAAAANQTFRF0CMV+YebYAAAAGhJREFUeJztyzENAAAMA6DVv+l5aHrCT64V0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN05zNB6OcAcm2KNubAAAAAElFTkSuQmCC"/></defs><style></style><use href="#img1" x="0" y="0"/></svg>
|
||||||
<svg width="456" height="456" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<rect x="0" y="0" width="456" height="456" fill="#512BD4" />
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 229 B After Width: | Height: | Size: 493 B |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 171 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 33 KiB |
@@ -1,12 +1,12 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>$(TargetFrameworks);net8.0-android</TargetFrameworks>
|
<TargetFrameworks>$(TargetFrameworks);net9.0-android</TargetFrameworks>
|
||||||
<TargetFrameworks>$(TargetFrameworks);net8.0-ios</TargetFrameworks>
|
<TargetFrameworks>$(TargetFrameworks);net9.0-ios</TargetFrameworks>
|
||||||
<TargetFrameworks>$(TargetFrameworks);net8.0-maccatalyst</TargetFrameworks>
|
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-maccatalyst</TargetFrameworks>-->
|
||||||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
|
<!-- <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>-->
|
||||||
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
|
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
|
||||||
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
|
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
|
||||||
|
|
||||||
<!-- Note for MacCatalyst:
|
<!-- Note for MacCatalyst:
|
||||||
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
|
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
|
||||||
@@ -24,22 +24,22 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
<!-- Display name -->
|
<!-- Display name -->
|
||||||
<ApplicationTitle>SteUp.Maui</ApplicationTitle>
|
<ApplicationTitle>SteUP</ApplicationTitle>
|
||||||
|
|
||||||
<!-- App Identifier -->
|
<!-- App Identifier -->
|
||||||
<ApplicationId>it.integry.SteUp.maui</ApplicationId>
|
<ApplicationId>it.integry.SteUp</ApplicationId>
|
||||||
|
|
||||||
<!-- Versions -->
|
<!-- Versions -->
|
||||||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
||||||
<ApplicationVersion>1</ApplicationVersion>
|
<ApplicationVersion>1</ApplicationVersion>
|
||||||
|
|
||||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
|
||||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">-->
|
||||||
14.0
|
<!-- 14.0-->
|
||||||
</SupportedOSPlatformVersion>
|
<!-- </SupportedOSPlatformVersion>-->
|
||||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
|
||||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
|
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>-->
|
||||||
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
|
<!-- <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>-->
|
||||||
<!--slower build, faster runtime in DEBUG-->
|
<!--slower build, faster runtime in DEBUG-->
|
||||||
<!-- <_MauiForceXamlCForDebug Condition="'$(Configuration)' == 'Debug'">true</_MauiForceXamlCForDebug> -->
|
<!-- <_MauiForceXamlCForDebug Condition="'$(Configuration)' == 'Debug'">true</_MauiForceXamlCForDebug> -->
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
|
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
|
||||||
<DefineConstants>$(DefineConstants);PLATFORM</DefineConstants>
|
<DefineConstants>$(DefineConstants);PLATFORM</DefineConstants>
|
||||||
<SupportedOSPlatformVersion>26.0</SupportedOSPlatformVersion>
|
<SupportedOSPlatformVersion>26.0</SupportedOSPlatformVersion>
|
||||||
<TargetPlatformVersion>34</TargetPlatformVersion>
|
<TargetPlatformVersion>35</TargetPlatformVersion>
|
||||||
|
|
||||||
<!--<EmbedAssembliesIntoApk Condition="'$(Configuration)' == 'Debug'">true</EmbedAssembliesIntoApk>
|
<!--<EmbedAssembliesIntoApk Condition="'$(Configuration)' == 'Debug'">true</EmbedAssembliesIntoApk>
|
||||||
<AndroidPackageFormats Condition="'$(Configuration)' == 'Release'">aab</AndroidPackageFormats>
|
<AndroidPackageFormats Condition="'$(Configuration)' == 'Release'">aab</AndroidPackageFormats>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
<DefineConstants>$(DefineConstants);APPLE;PLATFORM</DefineConstants>
|
<DefineConstants>$(DefineConstants);APPLE;PLATFORM</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(TargetFramework)'=='net8.0-ios'">
|
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios'">
|
||||||
<CodesignKey>Apple Development: Massimo Fausto Morelli (6C2CUM53BT)</CodesignKey>
|
<CodesignKey>Apple Development: Massimo Fausto Morelli (6C2CUM53BT)</CodesignKey>
|
||||||
<CodesignProvision>VS: WildCard Development</CodesignProvision>
|
<CodesignProvision>VS: WildCard Development</CodesignProvision>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -95,10 +95,10 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- App Icon -->
|
<!-- App Icon -->
|
||||||
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
|
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#d02315"/>
|
||||||
|
|
||||||
<!-- Splash Screen -->
|
<!-- Splash Screen -->
|
||||||
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
|
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#d02315" BaseSize="128,128"/>
|
||||||
|
|
||||||
<!-- Images -->
|
<!-- Images -->
|
||||||
<MauiImage Include="Resources\Images\*"/>
|
<MauiImage Include="Resources\Images\*"/>
|
||||||
@@ -112,11 +112,14 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="IntegryApiClient.MAUI" Version="1.0.2" />
|
<PackageReference Include="CommunityToolkit.Maui" Version="12.2.0"/>
|
||||||
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.91" />
|
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
|
||||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.91" />
|
<PackageReference Include="IntegryApiClient.MAUI" Version="1.2.3"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.91" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.12" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.120"/>
|
||||||
|
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.120"/>
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.120"/>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.12" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -2,23 +2,24 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
<meta name="viewport"
|
||||||
<title>Template.Maui</title>
|
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"/>
|
||||||
|
<title>SteUp.Maui</title>
|
||||||
<base href="/"/>
|
<base href="/"/>
|
||||||
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap"
|
||||||
|
rel="stylesheet">
|
||||||
|
|
||||||
|
<link href="_content/SteUp.Shared/css/bootstrap/bootstrap.min.css" rel="stylesheet">
|
||||||
|
<link href="_content/SteUp.Shared/css/bootstrap/bootstrap-icons.min.css" rel="stylesheet"/>
|
||||||
|
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet"/>
|
||||||
|
|
||||||
<link href="_content/Template.Shared/css/bootstrap/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
<link rel="stylesheet" href="_content/SteUp.Shared/css/remixicon/remixicon.css"/>
|
||||||
<link href="_content/Template.Shared/css/bootstrap/bootstrap-icons.min.css" rel="stylesheet" />
|
<link rel="stylesheet" href="_content/SteUp.Shared/css/app.css"/>
|
||||||
<link href="_content/Blazor.Bootstrap/blazor.bootstrap.css" rel="stylesheet" />
|
<link rel="stylesheet" href="_content/SteUp.Shared/css/default-theme.css"/>
|
||||||
|
<link rel="stylesheet" href="SteUp.Maui.styles.css"/>
|
||||||
<link rel="stylesheet" href="_content/Template.Shared/css/remixicon/remixicon.css" />
|
|
||||||
<link rel="stylesheet" href="_content/Template.Shared/css/app.css" />
|
|
||||||
<link rel="stylesheet" href="_content/Template.Shared/css/default-theme.css" />
|
|
||||||
<link rel="stylesheet" href="Template.Maui.styles.css" />
|
|
||||||
<link rel="icon" type="image/png" href="favicon.png"/>
|
<link rel="icon" type="image/png" href="favicon.png"/>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -26,7 +27,11 @@
|
|||||||
|
|
||||||
<div class="status-bar-safe-area"></div>
|
<div class="status-bar-safe-area"></div>
|
||||||
|
|
||||||
<div id="app">Loading...</div>
|
<div id="app">
|
||||||
|
<div class="spinner-container">
|
||||||
|
<span class="loader"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="blazor-error-ui">
|
<div id="blazor-error-ui">
|
||||||
An unhandled error has occurred.
|
An unhandled error has occurred.
|
||||||
@@ -35,14 +40,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="_framework/blazor.webview.js" autostart="false"></script>
|
<script src="_framework/blazor.webview.js" autostart="false"></script>
|
||||||
<script src="_content/Template.Shared/js/bootstrap/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
<script src="_content/SteUp.Shared/js/bootstrap/bootstrap.bundle.min.js"></script>
|
||||||
<!-- Add chart.js reference if chart components are used in your application. -->
|
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
|
||||||
<!--<script src="_content/Template.Shared/js/bootstrap/chart.umd.js" integrity="sha512-gQhCDsnnnUfaRzD8k1L5llCCV6O9HN09zClIzzeJ8OJ9MpGmIlCxm+pdCkqTwqJ4JcjbojFr79rl2F1mzcoLMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>-->
|
<script src="_content/SteUp.Shared/js/main.js"></script>
|
||||||
<!-- Add chartjs-plugin-datalabels.min.js reference if chart components with data label feature is used in your application. -->
|
|
||||||
<!--<script src="_content/Template.Shared/js/bootstrap/chartjs-plugin-datalabels.min.js" integrity="sha512-JPcRR8yFa8mmCsfrw4TNte1ZvF1e3+1SdGMslZvmrzDYxS69J7J49vkFL8u6u8PlPJK+H3voElBtUCzaXj+6ig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>-->
|
|
||||||
<!-- Add sortable.js reference if SortableList component is used in your application. -->
|
|
||||||
<!--<script src="_content/Template.Shared/js/bootstrap/Sortable.min.js"></script>-->
|
|
||||||
<script src="_content/Blazor.Bootstrap/blazor.bootstrap.js"></script>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,170 @@
|
|||||||
@inherits LayoutComponentBase
|
@using System.Globalization
|
||||||
|
@using SteUp.Shared.Core.Interface.IntegryApi
|
||||||
|
@using SteUp.Shared.Core.Interface.System.Network
|
||||||
|
@inherits LayoutComponentBase
|
||||||
|
@inject INetworkService NetworkService
|
||||||
|
@inject IIntegryApiService IntegryApiService
|
||||||
|
|
||||||
|
<MudThemeProvider Theme="_currentTheme" @ref="@_mudThemeProvider" @bind-IsDarkMode="@IsDarkMode" />
|
||||||
|
<MudPopoverProvider/>
|
||||||
|
<MudDialogProvider/>
|
||||||
|
<MudSnackbarProvider/>
|
||||||
|
|
||||||
<div class="page">
|
<div class="page">
|
||||||
@*<div class="sidebar">
|
|
||||||
<NavMenu />
|
|
||||||
</div>*@
|
|
||||||
|
|
||||||
<NavMenu/>
|
<NavMenu/>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<article class="content px-4">
|
<article>
|
||||||
@Body
|
@Body
|
||||||
</article>
|
</article>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private MudThemeProvider _mudThemeProvider = null!;
|
||||||
|
private bool IsDarkMode { get; set; }
|
||||||
|
private string _mainContentClass = "";
|
||||||
|
|
||||||
|
//Connection state
|
||||||
|
private bool _isNetworkAvailable;
|
||||||
|
private bool _servicesIsDown;
|
||||||
|
private bool _showWarning;
|
||||||
|
|
||||||
|
private DateTime _lastApiCheck = DateTime.MinValue;
|
||||||
|
private const int DelaySeconds = 90;
|
||||||
|
|
||||||
|
private CancellationTokenSource? _cts;
|
||||||
|
|
||||||
|
private bool ServicesIsDown
|
||||||
|
{
|
||||||
|
get => _servicesIsDown;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_servicesIsDown == value) return;
|
||||||
|
_servicesIsDown = value;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool IsNetworkAvailable
|
||||||
|
{
|
||||||
|
get => _isNetworkAvailable;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_isNetworkAvailable == value) return;
|
||||||
|
_isNetworkAvailable = value;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool ShowWarning
|
||||||
|
{
|
||||||
|
get => _showWarning;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_showWarning == value) return;
|
||||||
|
_showWarning = value;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly MudTheme _currentTheme = new()
|
||||||
|
{
|
||||||
|
PaletteLight = new PaletteLight()
|
||||||
|
{
|
||||||
|
Primary = "#ec4c41",
|
||||||
|
Secondary = "#002339",
|
||||||
|
Tertiary = "#dff2ff",
|
||||||
|
TextPrimary = "#000"
|
||||||
|
},
|
||||||
|
PaletteDark = new PaletteDark
|
||||||
|
{
|
||||||
|
Primary = "#ec4c41",
|
||||||
|
Secondary = "#002339",
|
||||||
|
Tertiary = "#dff2ff",
|
||||||
|
Surface = "#000406",
|
||||||
|
Background = "#000406",
|
||||||
|
TextPrimary = "#fff",
|
||||||
|
GrayDark = "#E0E0E0"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
|
{
|
||||||
|
// if (firstRender)
|
||||||
|
// {
|
||||||
|
// var isDarkMode = LocalStorage.GetString("isDarkMode");
|
||||||
|
|
||||||
|
// if (isDarkMode == null && _mudThemeProvider != null)
|
||||||
|
// {
|
||||||
|
// IsDarkMode = await _mudThemeProvider.GetSystemPreference();
|
||||||
|
// await _mudThemeProvider.WatchSystemPreference(OnSystemPreferenceChanged);
|
||||||
|
// LocalStorage.SetString("isDarkMode", IsDarkMode.ToString());
|
||||||
|
// StateHasChanged();
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// IsDarkMode = bool.Parse(isDarkMode!);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (IsDarkMode)
|
||||||
|
// {
|
||||||
|
// _mainContentClass += "is-dark";
|
||||||
|
// StateHasChanged();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task OnSystemPreferenceChanged(bool newValue)
|
||||||
|
{
|
||||||
|
IsDarkMode = newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
_cts = new CancellationTokenSource();
|
||||||
|
_ = CheckConnectionState(_cts.Token);
|
||||||
|
|
||||||
|
var culture = new CultureInfo("it-IT", false);
|
||||||
|
|
||||||
|
CultureInfo.CurrentCulture = culture;
|
||||||
|
CultureInfo.CurrentUICulture = culture;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task CheckConnectionState(CancellationToken token)
|
||||||
|
{
|
||||||
|
return Task.Run(async () =>
|
||||||
|
{
|
||||||
|
while (!token.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
var isNetworkAvailable = NetworkService.IsNetworkAvailable();
|
||||||
|
var servicesDown = ServicesIsDown;
|
||||||
|
|
||||||
|
if (isNetworkAvailable && (DateTime.UtcNow - _lastApiCheck).TotalSeconds >= DelaySeconds)
|
||||||
|
{
|
||||||
|
servicesDown = !await IntegryApiService.SystemOk();
|
||||||
|
_lastApiCheck = DateTime.UtcNow;
|
||||||
|
}
|
||||||
|
|
||||||
|
await InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
IsNetworkAvailable = isNetworkAvailable;
|
||||||
|
ServicesIsDown = servicesDown;
|
||||||
|
|
||||||
|
await Task.Delay(1500, token);
|
||||||
|
ShowWarning = !(IsNetworkAvailable && !ServicesIsDown);
|
||||||
|
NetworkService.ConnectionAvailable = !ShowWarning;
|
||||||
|
});
|
||||||
|
|
||||||
|
await Task.Delay(500, token);
|
||||||
|
}
|
||||||
|
}, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
_cts?.Cancel();
|
||||||
|
_cts?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<div class="container">
|
|
||||||
<nav>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
|
|
||||||
<span>Home</span>
|
|
||||||
<i class="ri-home-5-line"/>
|
|
||||||
</NavLink>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a href="#" id="workout">
|
|
||||||
<span>Workout</span>
|
|
||||||
<i class="ri-empathize-line"/>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a href="#" id="logbook">
|
|
||||||
<span>Logbook</span>
|
|
||||||
<i class="ri-health-book-line"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a href="#" id="settings">
|
|
||||||
<span>Impostazioni</span>
|
|
||||||
<i class="ri-settings-5-line"/>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
|
||||||
list-style-type: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
|
||||||
max-width: 100%;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
background-color: var(--ligther-color);
|
|
||||||
margin: 0;
|
|
||||||
display: flex;
|
|
||||||
border-radius: 40px 40px 0px 0px;
|
|
||||||
box-shadow: rgb(50 50 93 / 25%) 0 50px 100px 10px,
|
|
||||||
rgb(0 0 0 / 30%) 0 30px 60px -30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav ul {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0;
|
|
||||||
flex: 0 0 25%;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav :where(li a) {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav ul li a {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column-reverse;
|
|
||||||
padding: 1em;
|
|
||||||
line-height: 1.4;
|
|
||||||
-webkit-transition: all .3s ease-out;
|
|
||||||
transition: all .3s ease-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav ul li a:hover {
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
nav ul li a i {
|
|
||||||
font-size: 1.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav ul li a span {
|
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* animations */
|
|
||||||
|
|
||||||
nav li.active a::before, nav li.active a::after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav li.active a::before {
|
|
||||||
top: 5%;
|
|
||||||
width: calc(100% - 0px);
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav li.active a {
|
|
||||||
color: var(--ligther-color);
|
|
||||||
}
|
|
||||||
@@ -1,38 +1,72 @@
|
|||||||
<nav class="navbar navbar-expand justify-content-center">
|
<div class="container animated-navbar @(IsVisible ? "show-nav" : "hide-nav") @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
|
||||||
<div class="container-fluid">
|
<nav class="navbar @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
|
||||||
<ul class="navbar-nav nav-justified w-100 text-center">
|
<div class="container-navbar">
|
||||||
|
<ul class="navbar-nav flex-row nav-justified align-items-center w-100 text-center">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<NavLink class="nav-link " href="workout" Match="NavLinkMatch.All">
|
<NavLink class="nav-link" href="Users" Match="NavLinkMatch.All">
|
||||||
<div class="d-flex flex-column">
|
<div class="d-flex flex-column">
|
||||||
<i class="ri-empathize-line"/>
|
<i class="ri-group-line"></i>
|
||||||
@* <span>Workout</span> *@
|
<span>Test</span>
|
||||||
</div>
|
</div>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
|
<NavLink class="nav-link" href="Calendar" Match="NavLinkMatch.All">
|
||||||
<div class="d-flex flex-column">
|
<div class="d-flex flex-column">
|
||||||
<i class="ri-home-5-line"/>
|
<i class="ri-calendar-todo-line"></i>
|
||||||
@* <span>Home</span> *@
|
<span>Home</span>
|
||||||
</div>
|
</div>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<NavLink class="nav-link" href="logbook" Match="NavLinkMatch.All">
|
<NavLink class="nav-link" href="Calendar" Match="NavLinkMatch.All">
|
||||||
<div class="d-flex flex-column">
|
<div class="d-flex flex-column">
|
||||||
<i class="ri-health-book-line"></i>
|
<i class="ri-calendar-todo-line"></i>
|
||||||
@* <span>Log Book</span> *@
|
<span>Altro</span>
|
||||||
</div>
|
</div>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</li>
|
</li>
|
||||||
@* <li class="nav-item"> *@
|
|
||||||
@* <NavLink class="nav-link d-flex flex-column" href="settings" Match="NavLinkMatch.All"> *@
|
|
||||||
@* <i class="ri-settings-5-line"/> *@
|
|
||||||
@* <span>Impostazioni</span> *@
|
|
||||||
@* </NavLink> *@
|
|
||||||
@* </li> *@
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@if (PlusVisible)
|
||||||
|
{
|
||||||
|
@* <MudMenu PopoverClass="custom_popover" AnchorOrigin="Origin.TopLeft" TransformOrigin="Origin.BottomRight"> *@
|
||||||
|
@* <ActivatorContent> *@
|
||||||
|
@* <MudFab Class="custom-plus-button" Color="Color.Surface" Size="Size.Medium" IconSize="Size.Medium" IconColor="Color.Primary" StartIcon="@Icons.Material.Filled.Add"/> *@
|
||||||
|
@* </ActivatorContent> *@
|
||||||
|
@* <ChildContent> *@
|
||||||
|
@* <MudMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="() => CreateUser()">Nuovo contatto</MudMenuItem> *@
|
||||||
|
@* <MudMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="() => CreateActivity()">Nuova attivit<69></MudMenuItem> *@
|
||||||
|
@* </ChildContent> *@
|
||||||
|
@* </MudMenu> *@
|
||||||
|
}
|
||||||
</nav>
|
</nav>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code
|
||||||
|
{
|
||||||
|
private bool IsVisible { get; set; } = true;
|
||||||
|
private bool PlusVisible { get; set; } = true;
|
||||||
|
|
||||||
|
protected override Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
NavigationManager.LocationChanged += (_, args) =>
|
||||||
|
{
|
||||||
|
var location = args.Location.Remove(0, NavigationManager.BaseUri.Length);
|
||||||
|
|
||||||
|
var newIsVisible = new List<string> { "Home" }
|
||||||
|
.Contains(location);
|
||||||
|
|
||||||
|
var newPlusVisible = new List<string> { "Home" }
|
||||||
|
.Contains(location);
|
||||||
|
|
||||||
|
if (IsVisible == newIsVisible && PlusVisible == newPlusVisible) return;
|
||||||
|
|
||||||
|
IsVisible = newIsVisible;
|
||||||
|
PlusVisible = newPlusVisible;
|
||||||
|
StateHasChanged();
|
||||||
|
};
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<div class="spinner-container @(FullScreen ? "" : "not-fullScreen")">
|
||||||
|
<span class="loader"></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code
|
||||||
|
{
|
||||||
|
[Parameter] public bool FullScreen { get; set; } = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
.spinner-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
height: calc(100vh - 10.1rem);
|
||||||
|
align-items: center;
|
||||||
|
color: var(--mud-palette-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.not-fullScreen {
|
||||||
|
height: auto !important;
|
||||||
|
padding: 2rem 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader {
|
||||||
|
width: 50px;
|
||||||
|
aspect-ratio: 1;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 8px solid #0000;
|
||||||
|
border-right-color: var(--mud-palette-secondary);
|
||||||
|
position: relative;
|
||||||
|
animation: l24 1s infinite linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader:before,
|
||||||
|
.loader:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
inset: -8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: inherit;
|
||||||
|
animation: inherit;
|
||||||
|
animation-duration: 2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader:after {
|
||||||
|
animation-duration: 4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes l24 {
|
||||||
|
100% {
|
||||||
|
transform: rotate(1turn)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
@page "/counter"
|
|
||||||
|
|
||||||
<h1>Counter</h1>
|
|
||||||
|
|
||||||
<p role="status">Current count: @currentCount</p>
|
|
||||||
|
|
||||||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private int currentCount = 0;
|
|
||||||
|
|
||||||
private void IncrementCount()
|
|
||||||
{
|
|
||||||
currentCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
@page "/device-form-factor"
|
|
||||||
@using Template.Shared.Interfaces
|
|
||||||
@inject IFormFactor FormFactor
|
|
||||||
|
|
||||||
<PageTitle>Form Factor</PageTitle>
|
|
||||||
|
|
||||||
<h1>Device Form Factor</h1>
|
|
||||||
|
|
||||||
<p>You are running on:</p>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>Form Factor: @factor</li>
|
|
||||||
<li>Platform: @platform</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<em>This component is defined in the Template.Shared library.</em>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private string factor => FormFactor.GetFormFactor();
|
|
||||||
private string platform => FormFactor.GetPlatform();
|
|
||||||
}
|
|
||||||
@@ -1,15 +1,4 @@
|
|||||||
@page "/"
|
@page "/home"
|
||||||
|
@attribute [Authorize]
|
||||||
|
|
||||||
<h1>Hello, world!</h1>
|
<h3>Home</h3>
|
||||||
|
|
||||||
Welcome to your new app.
|
|
||||||
|
|
||||||
<Modal @ref="modal" title="Full screen" Fullscreen="ModalFullscreen.Always">
|
|
||||||
<BodyTemplate>...</BodyTemplate>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
<Button Color="ButtonColor.Primary" @onclick="() => modal.ShowAsync()">Full screen</Button>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private Modal modal = default!;
|
|
||||||
}
|
|
||||||
1
SteUp.Shared/Components/Pages/Home.razor.css
Normal file
1
SteUp.Shared/Components/Pages/Home.razor.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
@page "/settings"
|
|
||||||
<h3>Impostazioni</h3>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
|
|
||||||
}
|
|
||||||
13
SteUp.Shared/Components/Pages/Index.razor
Normal file
13
SteUp.Shared/Components/Pages/Index.razor
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
@page "/"
|
||||||
|
@using SteUp.Shared.Components.Layout.Spinner
|
||||||
|
@attribute [Authorize]
|
||||||
|
|
||||||
|
<SpinnerLayout FullScreen="true"/>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
NavigationManager.NavigateTo("/home");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
@page "/logbook"
|
|
||||||
@using Template.Shared.Components.SingleElements
|
|
||||||
<h3 class="page-title">Log book</h3>
|
|
||||||
|
|
||||||
<NoDataAvailable ImageSource="_content/Template.Shared/images/log-book.svg"
|
|
||||||
Text="Nessun log book memorizzato"/>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
|
|
||||||
}
|
|
||||||
6
SteUp.Shared/Components/Pages/Login.razor
Normal file
6
SteUp.Shared/Components/Pages/Login.razor
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
@page "/login"
|
||||||
|
<h3>Login</h3>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
|
||||||
|
}
|
||||||
1
SteUp.Shared/Components/Pages/Login.razor.css
Normal file
1
SteUp.Shared/Components/Pages/Login.razor.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
@page "/weather"
|
|
||||||
|
|
||||||
<h1>Weather</h1>
|
|
||||||
|
|
||||||
<p>This component demonstrates showing data.</p>
|
|
||||||
|
|
||||||
@if (forecasts == null)
|
|
||||||
{
|
|
||||||
<p><em>Loading...</em></p>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<table class="table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Date</th>
|
|
||||||
<th>Temp. (C)</th>
|
|
||||||
<th>Temp. (F)</th>
|
|
||||||
<th>Summary</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach (var forecast in forecasts)
|
|
||||||
{
|
|
||||||
<tr>
|
|
||||||
<td>@forecast.Date.ToShortDateString()</td>
|
|
||||||
<td>@forecast.TemperatureC</td>
|
|
||||||
<td>@forecast.TemperatureF</td>
|
|
||||||
<td>@forecast.Summary</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
}
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private WeatherForecast[]? forecasts;
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
// Simulate asynchronous loading to demonstrate a loading indicator
|
|
||||||
await Task.Delay(500);
|
|
||||||
|
|
||||||
var startDate = DateOnly.FromDateTime(DateTime.Now);
|
|
||||||
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
|
|
||||||
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
|
||||||
{
|
|
||||||
Date = startDate.AddDays(index),
|
|
||||||
TemperatureC = Random.Shared.Next(-20, 55),
|
|
||||||
Summary = summaries[Random.Shared.Next(summaries.Length)]
|
|
||||||
}).ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
private class WeatherForecast
|
|
||||||
{
|
|
||||||
public DateOnly Date { get; set; }
|
|
||||||
public int TemperatureC { get; set; }
|
|
||||||
public string? Summary { get; set; }
|
|
||||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
@page "/workout"
|
|
||||||
@using Template.Shared.Components.SingleElements
|
|
||||||
<h3 class="page-title">Workout</h3>
|
|
||||||
|
|
||||||
<NoDataAvailable ImageSource="_content/Template.Shared/images/man-doing-squats.svg"
|
|
||||||
Text="Nessun workout disponibile"/>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,48 @@
|
|||||||
|
@using SteUp.Shared.Components.SingleElements.Modal.ExceptionModal
|
||||||
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
|
<ErrorBoundary @ref="ErrorBoundary">
|
||||||
|
<ChildContent>
|
||||||
|
<CascadingAuthenticationState>
|
||||||
<Router AppAssembly="@typeof(Routes).Assembly">
|
<Router AppAssembly="@typeof(Routes).Assembly">
|
||||||
<Found Context="routeData">
|
<Found Context="routeData">
|
||||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
|
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
|
||||||
|
<Authorizing>
|
||||||
|
<p>Authorizing page</p>
|
||||||
|
</Authorizing>
|
||||||
|
<NotAuthorized>
|
||||||
|
@if (context.User.Identity?.IsAuthenticated != true)
|
||||||
|
{
|
||||||
|
NavigationManager.NavigateTo("/login");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<p role="alert">You are not authorized to access this resource.</p>
|
||||||
|
}
|
||||||
|
</NotAuthorized>
|
||||||
|
</AuthorizeRouteView>
|
||||||
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
|
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
|
||||||
</Found>
|
</Found>
|
||||||
|
<NotFound>
|
||||||
|
<PageTitle>Not found</PageTitle>
|
||||||
|
<LayoutView>
|
||||||
|
<p role="alert">Sorry, there's nothing at this address.</p>
|
||||||
|
</LayoutView>
|
||||||
|
</NotFound>
|
||||||
</Router>
|
</Router>
|
||||||
|
</CascadingAuthenticationState>
|
||||||
|
</ChildContent>
|
||||||
|
|
||||||
|
<ErrorContent>
|
||||||
|
<ExceptionModal @ref="ExceptionModal"
|
||||||
|
Exception="@context"
|
||||||
|
ErrorBoundary="@ErrorBoundary"
|
||||||
|
OnRetry="() => ErrorBoundary?.Recover()"/>
|
||||||
|
</ErrorContent>
|
||||||
|
</ErrorBoundary>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
|
||||||
|
private ErrorBoundary? ErrorBoundary { get; set; }
|
||||||
|
private ExceptionModal ExceptionModal { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
<div class="container container-modal">
|
||||||
|
<div class="c-modal">
|
||||||
|
<div class="exception-header mb-2">
|
||||||
|
<i class="ri-emotion-unhappy-line"></i>
|
||||||
|
<span>Ops</span>
|
||||||
|
</div>
|
||||||
|
<div class="text">
|
||||||
|
@if (Exception != null)
|
||||||
|
{
|
||||||
|
<code>@Message</code>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="button-container">
|
||||||
|
<div @onclick="OnRetryClick" class="card-button">
|
||||||
|
<span>Riprova</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div @onclick="OnContinueClick" class="card-button">
|
||||||
|
<span>Continua</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter] public Exception? Exception { get; set; }
|
||||||
|
[Parameter] public EventCallback OnRetry { get; set; }
|
||||||
|
[Parameter] public ErrorBoundary? ErrorBoundary { get; set; }
|
||||||
|
|
||||||
|
private string Message { get; set; } = "";
|
||||||
|
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
if (Exception == null) return;
|
||||||
|
|
||||||
|
if (Exception.Message.Contains("Failed to connect to"))
|
||||||
|
{
|
||||||
|
var ipPort = Exception.Message.Split("to /")[1];
|
||||||
|
|
||||||
|
Message = $"Impossibile collegarsi al server ({ipPort})";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Message = Exception.Message;
|
||||||
|
}
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task OnRetryClick()
|
||||||
|
{
|
||||||
|
await OnRetry.InvokeAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task OnContinueClick()
|
||||||
|
{
|
||||||
|
NavigationManager.NavigateTo("/");
|
||||||
|
await OnRetry.InvokeAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
.container-modal {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.c-modal {
|
||||||
|
border-radius: 16px;
|
||||||
|
box-shadow: var(--exception-box-shadow);
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-container {
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 1.5rem 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-size: medium;
|
||||||
|
font-weight: 500;
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-button {
|
||||||
|
text-align: center;
|
||||||
|
background-color: transparent;
|
||||||
|
padding: .3rem 1rem;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--bs-primary-text-emphasis);
|
||||||
|
}
|
||||||
|
|
||||||
|
.exception-header {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.exception-header > i {
|
||||||
|
font-size: 3rem;
|
||||||
|
line-height: normal;
|
||||||
|
color: var(--bs-danger);
|
||||||
|
}
|
||||||
|
|
||||||
|
.exception-header > span {
|
||||||
|
font-size: x-large;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
color: var(--bs-gray-dark);
|
||||||
|
}
|
||||||
13
SteUp.Shared/Core/Authorization/Enum/KeyGroupEnum.cs
Normal file
13
SteUp.Shared/Core/Authorization/Enum/KeyGroupEnum.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
namespace SteUp.Shared.Core.Authorization.Enum;
|
||||||
|
|
||||||
|
public enum KeyGroupEnum
|
||||||
|
{
|
||||||
|
UtenteAziendale = 2,
|
||||||
|
Cliente = 3,
|
||||||
|
Agenti = 5,
|
||||||
|
AmministratoreAziendale = 9,
|
||||||
|
Tecnico = 22,
|
||||||
|
ResponsabileDiReparto = 23,
|
||||||
|
ResponsabileAmministrativo = 29,
|
||||||
|
Programmatore = 30
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Template.Shared.Interfaces;
|
namespace SteUp.Shared.Core.Interface;
|
||||||
|
|
||||||
public interface IFormFactor
|
public interface IFormFactor
|
||||||
{
|
{
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace SteUp.Shared.Core.Interface.IntegryApi;
|
||||||
|
|
||||||
|
public interface IIntegryApiService
|
||||||
|
{
|
||||||
|
Task<bool> SystemOk();
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace SteUp.Shared.Core.Interface.System.Network;
|
||||||
|
|
||||||
|
public interface INetworkService
|
||||||
|
{
|
||||||
|
public bool ConnectionAvailable { get; set; }
|
||||||
|
|
||||||
|
public bool IsNetworkAvailable();
|
||||||
|
}
|
||||||
56
SteUp.Shared/Core/Services/AppAuthenticationStateProvider.cs
Normal file
56
SteUp.Shared/Core/Services/AppAuthenticationStateProvider.cs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
using System.Security.Claims;
|
||||||
|
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account;
|
||||||
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
|
|
||||||
|
namespace SteUp.Shared.Core.Services;
|
||||||
|
|
||||||
|
public class AppAuthenticationStateProvider : AuthenticationStateProvider
|
||||||
|
{
|
||||||
|
private readonly IUserSession _userSession;
|
||||||
|
private readonly IUserAccountService _userAccountService;
|
||||||
|
|
||||||
|
|
||||||
|
public AppAuthenticationStateProvider(IUserSession userSession, IUserAccountService userAccountService)
|
||||||
|
{
|
||||||
|
_userSession = userSession;
|
||||||
|
_userAccountService = userAccountService;
|
||||||
|
|
||||||
|
userAccountService.ExpiredUserSession += (_, _) =>
|
||||||
|
NotifyAuthenticationStateChanged(LoadAuthenticationState());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task<AuthenticationState> GetAuthenticationStateAsync()
|
||||||
|
{
|
||||||
|
return await LoadAuthenticationState();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task SignOut()
|
||||||
|
{
|
||||||
|
await _userAccountService.Logout();
|
||||||
|
NotifyAuthenticationState();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void NotifyAuthenticationState()
|
||||||
|
{
|
||||||
|
NotifyAuthenticationStateChanged(LoadAuthenticationState());
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<AuthenticationState> LoadAuthenticationState()
|
||||||
|
{
|
||||||
|
if (!await _userSession.IsLoggedIn() || !await _userSession.IsRefreshTokenValid())
|
||||||
|
{
|
||||||
|
return new AuthenticationState(
|
||||||
|
new ClaimsPrincipal(
|
||||||
|
new ClaimsIdentity()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
var claimIdentity = new ClaimsIdentity(_userSession.JwtToken!.Claims, "jwt");
|
||||||
|
var user = new ClaimsPrincipal(claimIdentity);
|
||||||
|
|
||||||
|
|
||||||
|
var authenticationState = new AuthenticationState(user);
|
||||||
|
return authenticationState;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
SteUp.Shared/Core/Services/IntegryApiService.cs
Normal file
22
SteUp.Shared/Core/Services/IntegryApiService.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account;
|
||||||
|
using IntegryApiClient.Core.Domain.RestClient.Contacts;
|
||||||
|
using SteUp.Shared.Core.Interface.IntegryApi;
|
||||||
|
|
||||||
|
namespace SteUp.Shared.Core.Services;
|
||||||
|
|
||||||
|
public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUserSession userSession)
|
||||||
|
: IIntegryApiService
|
||||||
|
{
|
||||||
|
public async Task<bool> SystemOk()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await integryApiRestClient.Get<object>("system/ok");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.AspNetCore.Components.Web;
|
using Microsoft.AspNetCore.Components.Web;
|
||||||
|
|
||||||
namespace Template.Shared;
|
namespace SteUp.Shared;
|
||||||
|
|
||||||
public static class InteractiveRenderSettings
|
public static class InteractiveRenderSettings
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -11,13 +11,21 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Blazor.Bootstrap" Version="3.0.0" />
|
<PackageReference Include="IntegryApiClient.Core" Version="1.2.3"/>
|
||||||
<PackageReference Include="IntegryApiClient.Core" Version="1.0.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.12"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.8" />
|
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
|
||||||
|
<PackageReference Include="MudBlazor" Version="8.15.0" />
|
||||||
|
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.14.0"/>
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.12"/>
|
||||||
|
<PackageReference Include="Microsoft.Maui.Essentials" Version="9.0.120"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="wwwroot\js\bootstrap\"/>
|
<Folder Include="wwwroot\js\bootstrap\"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<UpToDateCheckInput Remove="Components\Layout\Overlay\SpinnerOverlay.razor" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,10 +1,19 @@
|
|||||||
@using System.Net.Http
|
@using System.Net.Http
|
||||||
@using System.Net.Http.Json
|
@using System.Net.Http.Json
|
||||||
|
@using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account
|
||||||
|
@using IntegryApiClient.Core.Domain.Abstraction.Contracts.Storage
|
||||||
@using Microsoft.AspNetCore.Components.Forms
|
@using Microsoft.AspNetCore.Components.Forms
|
||||||
@using Microsoft.AspNetCore.Components.Routing
|
@using Microsoft.AspNetCore.Components.Routing
|
||||||
@using Microsoft.AspNetCore.Components.Web
|
@using Microsoft.AspNetCore.Components.Web
|
||||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||||
@using Microsoft.JSInterop
|
@using Microsoft.JSInterop
|
||||||
@using Template.Shared.Components
|
@using SteUp.Shared.Components
|
||||||
@using BlazorBootstrap;
|
@using Microsoft.AspNetCore.Authorization
|
||||||
|
@using Microsoft.AspNetCore.Components.Authorization
|
||||||
|
@using MudBlazor
|
||||||
@using static InteractiveRenderSettings
|
@using static InteractiveRenderSettings
|
||||||
|
|
||||||
|
@inject NavigationManager NavigationManager
|
||||||
|
@inject IUserSession UserSession
|
||||||
|
@inject ILocalStorage LocalStorage
|
||||||
|
@inject ISnackbar Snackbar
|
||||||
@@ -1,46 +1,98 @@
|
|||||||
html, body {
|
html { overflow: hidden; }
|
||||||
font-family: 'Poppins', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
||||||
|
.page, article, main { height: 100% !important; overflow: hidden; }
|
||||||
|
|
||||||
|
#app { height: 100vh; }
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
font-family: "Nunito", sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 1.8;
|
line-height: 1.8;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
* { font-family: "Nunito", sans-serif !important; }
|
||||||
|
|
||||||
|
.mud-button-label { font-weight: 700 !important; }
|
||||||
|
|
||||||
a, .btn-link {
|
a, .btn-link {
|
||||||
/*color: #006bb7;*/
|
/*color: #006bb7;*/
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
article {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*ServicesIsDown" : "SystemOk" : "NetworkKo*/
|
||||||
|
|
||||||
|
.Connection {
|
||||||
|
padding: 0 .75rem;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 1rem;
|
||||||
|
font-size: larger;
|
||||||
|
transition: all 0.5s ease;
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-35px);
|
||||||
|
min-height: 35px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Connection.ServicesIsDown, .Connection.NetworkKo {
|
||||||
|
background-color: var(--mud-palette-error);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Connection.SystemOk {
|
||||||
|
background-color: var(--mud-palette-success);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Connection.Show {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.Connection.Hide ~ .page {
|
||||||
|
transition: all 0.5s ease;
|
||||||
|
transform: translateY(-35px);
|
||||||
|
}
|
||||||
|
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: var(--primary-color);
|
background-color: var(--primary-color);
|
||||||
border-color: var(--darker-color);
|
border-color: var(--darker-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
|
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; }
|
||||||
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding-top: 1.1rem;
|
padding-top: 1rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 90vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1:focus {
|
.content::-webkit-scrollbar { width: 3px; }
|
||||||
outline: none;
|
|
||||||
|
.content::-webkit-scrollbar-thumb {
|
||||||
|
background: #bbb;
|
||||||
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.valid.modified:not([type=checkbox]) {
|
h1:focus { outline: none; }
|
||||||
outline: 1px solid #26b050;
|
|
||||||
}
|
|
||||||
|
|
||||||
.invalid {
|
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
|
||||||
outline: 1px solid #e50000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.validation-message {
|
.invalid { outline: 1px solid #e50000; }
|
||||||
color: #e50000;
|
|
||||||
}
|
.validation-message { color: #e50000; }
|
||||||
|
|
||||||
#blazor-error-ui {
|
#blazor-error-ui {
|
||||||
background: lightyellow;
|
background: lightyellow;
|
||||||
@@ -67,18 +119,134 @@ h1:focus {
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blazor-error-boundary::after {
|
.blazor-error-boundary::after { content: "An error has occurred." }
|
||||||
content: "An error has occurred."
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-bar-safe-area {
|
.status-bar-safe-area { display: none; }
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-title {
|
.page-title {
|
||||||
/*text-align: center;*/
|
|
||||||
font-size: x-large;
|
font-size: x-large;
|
||||||
color: var(--darker-color);
|
font-weight: 800;
|
||||||
|
margin: 0;
|
||||||
|
line-height: normal;
|
||||||
|
color: var(--mud-palette-text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-mudfab {
|
||||||
|
position: fixed !important;
|
||||||
|
bottom: 4rem;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
right: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom_popover {
|
||||||
|
border-radius: 5px !important;
|
||||||
|
background-color: var(--mud-palette-drawer-background) !important;
|
||||||
|
box-shadow: 4px 4px 20px 0px rgba(0, 0, 0, 0.26), 0px 0px 0px 1px rgb(255 255 255 / 25%) !important;
|
||||||
|
color: var(--mud-palette-text-primary) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom_popover .mud-divider { border-color: var(--mud-palette-text-primary) !important; }
|
||||||
|
|
||||||
|
.custom_popover .mud-list-padding { padding: 3px 0px 3px 0px !important; }
|
||||||
|
|
||||||
|
.custom_popover .mud-list-item { padding: 5px 12px 5px 12px; }
|
||||||
|
|
||||||
|
.custom_popover .mud-menu-item-text { font-weight: 600; }
|
||||||
|
|
||||||
|
.custom_popover .mud-list-item-icon {
|
||||||
|
min-width: fit-content !important;
|
||||||
|
padding-right: 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
border: .05rem solid var(--card-border-color);
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Spinner*/
|
||||||
|
|
||||||
|
.spinner-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100vh;
|
||||||
|
align-items: center;
|
||||||
|
color: var(--mud-palette-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.not-fullScreen {
|
||||||
|
height: auto !important;
|
||||||
|
padding: 2rem 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader {
|
||||||
|
width: 50px;
|
||||||
|
aspect-ratio: 1;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 8px solid #0000;
|
||||||
|
border-right-color: var(--mud-palette-secondary);
|
||||||
|
position: relative;
|
||||||
|
animation: l24 1s infinite linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader:before,
|
||||||
|
.loader:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
inset: -8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: inherit;
|
||||||
|
animation: inherit;
|
||||||
|
animation-duration: 2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader:after { animation-duration: 4s; }
|
||||||
|
|
||||||
|
@keyframes l24 {
|
||||||
|
100% { transform: rotate(1turn) }
|
||||||
|
}
|
||||||
|
|
||||||
|
/*MudBlazor Personalization*/
|
||||||
|
|
||||||
|
.mud-button-group-horizontal:not(.mud-button-group-rtl) > .mud-button-root:not(:last-child), .mud-button-group-horizontal:not(.mud-button-group-rtl) > :not(:last-child) .mud-button-root {
|
||||||
|
border-top-right-radius: 0 !important;
|
||||||
|
border-bottom-right-radius: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mud-button-group-horizontal:not(.mud-button-group-rtl) > .mud-button-root:not(:first-child), .mud-button-group-horizontal:not(.mud-button-group-rtl) > :not(:first-child) .mud-button-root {
|
||||||
|
border-top-left-radius: 0 !important;
|
||||||
|
border-bottom-left-radius: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customDialog-form .mud-dialog-content {
|
||||||
|
padding: 0 .75rem;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-item-select { padding: 6px 16px; }
|
||||||
|
|
||||||
|
.custom-item-select .mud-typography-body1 {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: .9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding-right: var(--m-page-x) !important;
|
||||||
|
padding-left: var(--m-page-x) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lm-container {
|
||||||
|
padding-right: calc(var(--m-page-x) * 0.5) !important;
|
||||||
|
padding-left: calc(var(--m-page-x) * 0.5) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mud-message-box > .mud-dialog-title > h6 { font-weight: 800 !important; }
|
||||||
|
|
||||||
|
.mud-dialog-actions button {
|
||||||
|
margin-left: .5rem !important;
|
||||||
|
margin-right: .5rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@supports (-webkit-touch-callout: none) {
|
@supports (-webkit-touch-callout: none) {
|
||||||
@@ -87,18 +255,23 @@ h1:focus {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
height: env(safe-area-inset-top);
|
height: env(safe-area-inset-top);
|
||||||
background-color: #f7f7f7;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
background-color: var(--mud-palette-surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal { padding-top: env(safe-area-inset-top); }
|
||||||
|
|
||||||
|
.safe-area-bottom { margin-bottom: env(safe-area-inset-bottom) !important; }
|
||||||
|
|
||||||
|
.pb-safe-area { padding-bottom: env(safe-area-inset-bottom) !important; }
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
padding-top: env(safe-area-inset-top);
|
margin-top: env(safe-area-inset-top);
|
||||||
height: 100vh;
|
height: calc(100vh - env(safe-area-inset-top));
|
||||||
}
|
}
|
||||||
|
|
||||||
.flex-column, .navbar-brand {
|
.flex-column, .navbar-brand { padding-left: env(safe-area-inset-left); }
|
||||||
padding-left: env(safe-area-inset-left);
|
|
||||||
}
|
.customDialog-form .mud-dialog-content { margin-top: env(safe-area-inset-top); }
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
:root {
|
:root {
|
||||||
--primary-color: #5352ed;
|
--primary-color: #ec4c41;
|
||||||
--ligther-color: #f7f7ff;
|
--ligther-color: #f7f7ff;
|
||||||
--darker-color: hsl(240, 81%, 30%);
|
--darker-color: #d02315;
|
||||||
}
|
}
|
||||||
@@ -10,14 +10,14 @@
|
|||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
<link href="_content/Template.Shared/css/bootstrap/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
<link href="_content/SteUp.Shared/css/bootstrap/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||||
<link href="_content/Template.Shared/css/bootstrap/bootstrap-icons.min.css" rel="stylesheet" />
|
<link href="_content/SteUp.Shared/css/bootstrap/bootstrap-icons.min.css" rel="stylesheet" />
|
||||||
<link href="_content/Blazor.Bootstrap/blazor.bootstrap.css" rel="stylesheet" />
|
<link href="_content/Blazor.Bootstrap/blazor.bootstrap.css" rel="stylesheet" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="_content/Template.Shared/css/remixicon/remixicon.css" />
|
<link rel="stylesheet" href="_content/SteUp.Shared/css/remixicon/remixicon.css" />
|
||||||
<link rel="stylesheet" href="_content/Template.Shared/css/app.css" />
|
<link rel="stylesheet" href="_content/SteUp.Shared/css/app.css" />
|
||||||
<link rel="stylesheet" href="_content/Template.Shared/css/default-theme.css" />
|
<link rel="stylesheet" href="_content/SteUp.Shared/css/default-theme.css" />
|
||||||
<link rel="stylesheet" href="Template.Web.styles.css" />
|
<link rel="stylesheet" href="SteUp.Web.styles.css" />
|
||||||
|
|
||||||
<HeadOutlet @rendermode="InteractiveServer" />
|
<HeadOutlet @rendermode="InteractiveServer" />
|
||||||
</head>
|
</head>
|
||||||
@@ -26,13 +26,13 @@
|
|||||||
<Routes @rendermode="InteractiveServer" />
|
<Routes @rendermode="InteractiveServer" />
|
||||||
|
|
||||||
<script src="_framework/blazor.web.js"></script>
|
<script src="_framework/blazor.web.js"></script>
|
||||||
<script src="_content/Template.Shared/js/bootstrap/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
<script src="_content/SteUp.Shared/js/bootstrap/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||||
<!-- Add chart.js reference if chart components are used in your application. -->
|
<!-- Add chart.js reference if chart components are used in your application. -->
|
||||||
<!--<script src="_content/Template.Shared/js/bootstrap/chart.umd.js" integrity="sha512-gQhCDsnnnUfaRzD8k1L5llCCV6O9HN09zClIzzeJ8OJ9MpGmIlCxm+pdCkqTwqJ4JcjbojFr79rl2F1mzcoLMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>-->
|
<!--<script src="_content/SteUp.Shared/js/bootstrap/chart.umd.js" integrity="sha512-gQhCDsnnnUfaRzD8k1L5llCCV6O9HN09zClIzzeJ8OJ9MpGmIlCxm+pdCkqTwqJ4JcjbojFr79rl2F1mzcoLMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>-->
|
||||||
<!-- Add chartjs-plugin-datalabels.min.js reference if chart components with data label feature is used in your application. -->
|
<!-- Add chartjs-plugin-datalabels.min.js reference if chart components with data label feature is used in your application. -->
|
||||||
<!--<script src="_content/Template.Shared/js/bootstrap/chartjs-plugin-datalabels.min.js" integrity="sha512-JPcRR8yFa8mmCsfrw4TNte1ZvF1e3+1SdGMslZvmrzDYxS69J7J49vkFL8u6u8PlPJK+H3voElBtUCzaXj+6ig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>-->
|
<!--<script src="_content/SteUp.Shared/js/bootstrap/chartjs-plugin-datalabels.min.js" integrity="sha512-JPcRR8yFa8mmCsfrw4TNte1ZvF1e3+1SdGMslZvmrzDYxS69J7J49vkFL8u6u8PlPJK+H3voElBtUCzaXj+6ig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>-->
|
||||||
<!-- Add sortable.js reference if SortableList component is used in your application. -->
|
<!-- Add sortable.js reference if SortableList component is used in your application. -->
|
||||||
<!--<script src="_content/Template.Shared/js/bootstrap/Sortable.min.js"></script>-->
|
<!--<script src="_content/SteUp.Shared/js/bootstrap/Sortable.min.js"></script>-->
|
||||||
<script src="_content/Blazor.Bootstrap/blazor.bootstrap.js"></script>
|
<script src="_content/Blazor.Bootstrap/blazor.bootstrap.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
@page "/Error"
|
@page "/Error"
|
||||||
@using System.Diagnostics
|
|
||||||
|
|
||||||
<PageTitle>Error</PageTitle>
|
<PageTitle>Error</PageTitle>
|
||||||
|
|
||||||
@@ -25,12 +24,11 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[CascadingParameter]
|
|
||||||
private HttpContext? HttpContext { get; set; }
|
|
||||||
|
|
||||||
private string? RequestId { get; set; }
|
private string? RequestId { get; set; }
|
||||||
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||||
|
|
||||||
protected override void OnInitialized() =>
|
protected override void OnInitialized()
|
||||||
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
|
{
|
||||||
|
RequestId = Guid.NewGuid().ToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,6 @@
|
|||||||
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||||
@using Microsoft.JSInterop
|
@using Microsoft.JSInterop
|
||||||
@using Template.Web
|
@using SteUp.Web
|
||||||
@using Template.Shared.Components
|
@using SteUp.Shared.Components
|
||||||
@using Template.Shared
|
@using SteUp.Shared
|
||||||
|
|||||||
@@ -1,43 +1,30 @@
|
|||||||
using IntegryApiClient.Blazor;
|
using IntegryApiClient.Blazor;
|
||||||
using Template.Web.Components;
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
using Template.Shared.Interfaces;
|
using Microsoft.AspNetCore.Components.Web;
|
||||||
using Template.Web.Services;
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||||
|
using MudBlazor.Services;
|
||||||
|
using SteUp.Shared.Components;
|
||||||
|
using SteUp.Shared.Core.Interface;
|
||||||
|
using SteUp.Shared.Core.Services;
|
||||||
|
using SteUp.Web.Services;
|
||||||
|
|
||||||
#if DEBUG
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||||
const string BaseRestServicesEndpoint = "https://devservices.studioml.it/ems-api/";
|
|
||||||
//const string BaseRestServicesEndpoint = "http://192.168.2.23:8080/ems-api/";
|
|
||||||
#else
|
|
||||||
const string BaseRestServicesEndpoint = "https://services.studioml.it/ems-api/";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
builder.Services.AddMudServices();
|
||||||
|
builder.Services.AddAuthorizationCore();
|
||||||
|
|
||||||
// Add services to the container.
|
const string appToken = "4fef1843-793d-499b-a7ed-1edd8cac465c";
|
||||||
builder.Services.AddRazorComponents()
|
builder.Services.UseIntegry(appToken: appToken, useLoginAzienda: true);
|
||||||
.AddInteractiveServerComponents();
|
|
||||||
|
|
||||||
builder.Services.AddBlazorBootstrap();
|
|
||||||
builder.Services.UseIntegry(BaseRestServicesEndpoint);
|
|
||||||
|
|
||||||
builder.Services.AddScoped<IFormFactor, FormFactor>();
|
builder.Services.AddScoped<IFormFactor, FormFactor>();
|
||||||
|
|
||||||
var app = builder.Build();
|
builder.Services.AddScoped<AppAuthenticationStateProvider>();
|
||||||
|
builder.Services.AddScoped<AuthenticationStateProvider>(provider => provider.GetRequiredService<AppAuthenticationStateProvider>());
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
builder.RootComponents.Add<Routes>("#app");
|
||||||
if (!app.Environment.IsDevelopment())
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||||
{
|
|
||||||
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
|
||||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
||||||
app.UseHsts();
|
|
||||||
}
|
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
||||||
|
|
||||||
app.UseStaticFiles();
|
var host = builder.Build();
|
||||||
app.UseAntiforgery();
|
await host.RunAsync();
|
||||||
|
|
||||||
app.MapRazorComponents<App>()
|
|
||||||
.AddInteractiveServerRenderMode()
|
|
||||||
.AddAdditionalAssemblies(typeof(Template.Shared._Imports).Assembly);
|
|
||||||
|
|
||||||
app.Run();
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Template.Shared.Interfaces;
|
using SteUp.Shared.Core.Interface;
|
||||||
|
|
||||||
namespace Template.Web.Services;
|
namespace SteUp.Web.Services;
|
||||||
|
|
||||||
public class FormFactor : IFormFactor
|
public class FormFactor : IFormFactor
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="IntegryApiClient.Blazor" Version="1.0.9" />
|
<PackageReference Include="IntegryApiClient.Blazor" Version="1.2.3"/>
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.12"/>
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.12"/>
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.12"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user