Prima configurazione e struttura

This commit is contained in:
2026-02-04 17:31:00 +01:00
parent 1a949051ca
commit ecafebae7f
66 changed files with 1153 additions and 645 deletions

View 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>

View 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>

View 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>

View File

@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Template.Maui"
x:Class="Template.Maui.App">
xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls"
android:Application.WindowSoftInputModeAdjust="Resize"
x:Class="SteUp.Maui.App">
<Application.Resources>
<ResourceDictionary>
<Color x:Key="PageBackgroundColor">#512bdf</Color>
<Color x:Key="PageBackgroundColor">#dff2ff</Color>
<Color x:Key="PrimaryTextColor">White</Color>
<Style TargetType="Label">
@@ -17,7 +18,7 @@
<Style TargetType="Button">
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
<Setter Property="BackgroundColor" Value="#2b0b98" />
<Setter Property="BackgroundColor" Value="#dff2ff" />
<Setter Property="Padding" Value="14,10" />
</Style>

View File

@@ -1,12 +1,15 @@
namespace Template.Maui
namespace SteUp.Maui
{
public partial class App : Application
public partial class App
{
public App()
{
InitializeComponent();
}
MainPage = new MainPage();
protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new MainPage());
}
}
}

View 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>());
}
}

View File

@@ -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
{

View 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;
}

View File

@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Template.Maui"
xmlns:shared="clr-namespace:Template.Shared;assembly=Template.Shared"
x:Class="Template.Maui.MainPage"
xmlns:shared="clr-namespace:SteUp.Shared;assembly=SteUp.Shared"
x:Class="SteUp.Maui.MainPage"
BackgroundColor="{DynamicResource PageBackgroundColor}">
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html">

View File

@@ -1,4 +1,4 @@
namespace Template.Maui
namespace SteUp.Maui
{
public partial class MainPage : ContentPage
{

View File

@@ -1,19 +1,17 @@
using CommunityToolkit.Maui;
using IntegryApiClient.MAUI;
using Microsoft.Extensions.Logging;
using Template.Maui.Services;
using Template.Shared;
using Template.Shared.Interfaces;
using MudBlazor.Services;
using SteUp.Maui.Core;
using SteUp.Maui.Core.Services;
using SteUp.Shared;
using SteUp.Shared.Core.Interface;
namespace Template.Maui
namespace SteUp.Maui
{
public static class MauiProgram
{
#if DEBUG
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
private const string AppToken = "4fef1843-793d-499b-a7ed-1edd8cac465c";
public static MauiApp CreateMauiApp()
{
@@ -22,21 +20,22 @@ namespace Template.Maui
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseIntegry(BaseRestServicesEndpoint)
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});
.UseIntegry(appToken: AppToken, useLoginAzienda: true)
.UseMauiCommunityToolkit()
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); });
builder.Services.AddMauiBlazorWebView();
builder.Services.AddBlazorBootstrap();
builder.Services.AddMudServices();
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
#endif
builder.Services.AddSingleton<IFormFactor, FormFactor>();
builder.AddAuthorizationCore();
builder.RegisterAppServices();
builder.RegisterIntegryServices();
builder.RegisterSystemService();
return builder.Build();
}

View File

@@ -2,7 +2,7 @@ using Android.App;
using Android.Content.PM;
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)]
public class MainActivity : MauiAppCompatActivity

View File

@@ -1,7 +1,7 @@
using Android.App;
using Android.Runtime;
namespace Template.Maui
namespace SteUp.Maui
{
[Application]
public class MainApplication : MauiApplication

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#512BD4</color>
<color name="colorPrimaryDark">#2B0B98</color>
<color name="colorAccent">#2B0B98</color>
<color name="colorPrimary">#ec4c41</color>
<color name="colorPrimaryDark">#d02315</color>
<color name="colorAccent">#d02315</color>
</resources>

View File

@@ -1,7 +1,7 @@
using Foundation;
using Template.Maui;
using SteUp.Maui;
namespace Template.Maui
namespace SteUp.Maui
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate

View File

@@ -1,7 +1,7 @@
using ObjCRuntime;
using UIKit;
namespace Template.Maui
namespace SteUp.Maui
{
public class Program
{

View File

@@ -2,7 +2,7 @@ using System;
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
namespace Template.Maui
namespace SteUp.Maui
{
internal class Program : MauiApplication
{

View File

@@ -1,7 +1,7 @@
<?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">
<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>
<icon>maui-appicon-placeholder</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />

View File

@@ -3,7 +3,7 @@ using Microsoft.UI.Xaml;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Template.Maui.WinUI
namespace SteUp.Maui.WinUI
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<windowsSettings>

View File

@@ -1,6 +1,6 @@
using Foundation;
namespace Template.Maui
namespace SteUp.Maui
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate

View File

@@ -1,7 +1,7 @@
using ObjCRuntime;
using UIKit;
namespace Template.Maui
namespace SteUp.Maui
{
public class Program
{

View File

@@ -1,4 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>
<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>

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

View File

@@ -1,126 +1,129 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworks);net8.0-android</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks);net8.0-ios</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks);net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.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 -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<PropertyGroup>
<TargetFrameworks>$(TargetFrameworks);net9.0-android</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks);net9.0-ios</TargetFrameworks>
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-maccatalyst</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 -->
<!-- <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.
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
<OutputType>Exe</OutputType>
<RootNamespace>SteUp.Maui</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<EnableDefaultCssItems>false</EnableDefaultCssItems>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<RootNamespace>SteUp.Maui</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<EnableDefaultCssItems>false</EnableDefaultCssItems>
<Nullable>enable</Nullable>
<!-- Display name -->
<ApplicationTitle>SteUp.Maui</ApplicationTitle>
<!-- Display name -->
<ApplicationTitle>SteUP</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>it.integry.SteUp.maui</ApplicationId>
<!-- App Identifier -->
<ApplicationId>it.integry.SteUp</ApplicationId>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
14.0
</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<!--slower build, faster runtime in DEBUG-->
<!-- <_MauiForceXamlCForDebug Condition="'$(Configuration)' == 'Debug'">true</_MauiForceXamlCForDebug> -->
</PropertyGroup>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">-->
<!-- 14.0-->
<!-- </SupportedOSPlatformVersion>-->
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>-->
<!-- <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>-->
<!--slower build, faster runtime in DEBUG-->
<!-- <_MauiForceXamlCForDebug Condition="'$(Configuration)' == 'Debug'">true</_MauiForceXamlCForDebug> -->
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<DefineConstants>$(DefineConstants);PLATFORM</DefineConstants>
<SupportedOSPlatformVersion>26.0</SupportedOSPlatformVersion>
<TargetPlatformVersion>34</TargetPlatformVersion>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<DefineConstants>$(DefineConstants);PLATFORM</DefineConstants>
<SupportedOSPlatformVersion>26.0</SupportedOSPlatformVersion>
<TargetPlatformVersion>35</TargetPlatformVersion>
<!--<EmbedAssembliesIntoApk Condition="'$(Configuration)' == 'Debug'">true</EmbedAssembliesIntoApk>
<AndroidPackageFormats Condition="'$(Configuration)' == 'Release'">aab</AndroidPackageFormats>
<AndroidLinkTool>r8</AndroidLinkTool>
<AndroidLinkTool>proguard</AndroidLinkTool>-->
<!--<EmbedAssembliesIntoApk Condition="'$(Configuration)' == 'Debug'">true</EmbedAssembliesIntoApk>
<AndroidPackageFormats Condition="'$(Configuration)' == 'Release'">aab</AndroidPackageFormats>
<AndroidLinkTool>r8</AndroidLinkTool>
<AndroidLinkTool>proguard</AndroidLinkTool>-->
</PropertyGroup>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android' AND '$(Configuration)' == 'Debug'">
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android' AND '$(Configuration)' == 'Debug'">
<!--these help speed up android builds-->
<!--
<RuntimeIdentifier>android-arm64</RuntimeIdentifier>
<AndroidEnableProfiler>true</AndroidEnableProfiler>
<AndroidPackageFormat>aab</AndroidPackageFormat>
-->
</PropertyGroup>
<!--these help speed up android builds-->
<!--
<RuntimeIdentifier>android-arm64</RuntimeIdentifier>
<AndroidEnableProfiler>true</AndroidEnableProfiler>
<AndroidPackageFormat>aab</AndroidPackageFormat>
-->
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' AND '$(Configuration)' == 'Debug'">
<!--forces the simulator to pickup entitlements-->
<EnableCodeSigning>true</EnableCodeSigning>
<CodesignRequireProvisioningProfile>true</CodesignRequireProvisioningProfile>
<DisableCodesignVerification>true</DisableCodesignVerification>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' AND '$(Configuration)' == 'Debug'">
<!--forces the simulator to pickup entitlements-->
<EnableCodeSigning>true</EnableCodeSigning>
<CodesignRequireProvisioningProfile>true</CodesignRequireProvisioningProfile>
<DisableCodesignVerification>true</DisableCodesignVerification>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<SupportedOSPlatformVersion>14.2</SupportedOSPlatformVersion>
<DefineConstants>$(DefineConstants);APPLE;PLATFORM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<SupportedOSPlatformVersion>14.2</SupportedOSPlatformVersion>
<DefineConstants>$(DefineConstants);APPLE;PLATFORM</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net8.0-ios'">
<CodesignKey>Apple Development: Massimo Fausto Morelli (6C2CUM53BT)</CodesignKey>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios'">
<CodesignKey>Apple Development: Massimo Fausto Morelli (6C2CUM53BT)</CodesignKey>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
</PropertyGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<!--
<BundleResource Include="Platforms\iOS\PrivacyInfo.xcprivacy" LogicalName="PrivacyInfo.xcprivacy" />
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<!--
<BundleResource Include="Platforms\iOS\PrivacyInfo.xcprivacy" LogicalName="PrivacyInfo.xcprivacy" />
<CustomEntitlements Include="keychain-access-groups" Type="StringArray" Value="%24(AppIdentifierPrefix)$(ApplicationId)" Visible="false" />
<CustomEntitlements Include="aps-environment" Type="string" Value="development" Condition="'$(Configuration)' == 'Debug'" Visible="false" />
<CustomEntitlements Include="aps-environment" Type="string" Value="production" Condition="'$(Configuration)' == 'Release'" Visible="false" />
-->
</ItemGroup>
<CustomEntitlements Include="keychain-access-groups" Type="StringArray" Value="%24(AppIdentifierPrefix)$(ApplicationId)" Visible="false" />
<CustomEntitlements Include="aps-environment" Type="string" Value="development" Condition="'$(Configuration)' == 'Debug'" Visible="false" />
<CustomEntitlements Include="aps-environment" Type="string" Value="production" Condition="'$(Configuration)' == 'Release'" Visible="false" />
-->
</ItemGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#d02315"/>
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#d02315" BaseSize="128,128"/>
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<!-- Images -->
<MauiImage Include="Resources\Images\*"/>
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208"/>
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*"/>
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="IntegryApiClient.MAUI" Version="1.0.2" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.91" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.91" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.91" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="12.2.0"/>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0"/>
<PackageReference Include="IntegryApiClient.MAUI" Version="1.2.3"/>
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.12" />
<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>
<ProjectReference Include="..\SteUp.Shared\SteUp.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SteUp.Shared\SteUp.Shared.csproj"/>
</ItemGroup>
</Project>

View File

@@ -1,48 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<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" />
<title>Template.Maui</title>
<base href="/" />
<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"/>
<title>SteUp.Maui</title>
<base href="/"/>
<link rel="preconnect" href="https://fonts.googleapis.com">
<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 href="_content/Template.Shared/css/bootstrap/bootstrap-icons.min.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/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="stylesheet" href="_content/SteUp.Shared/css/remixicon/remixicon.css"/>
<link rel="stylesheet" href="_content/SteUp.Shared/css/app.css"/>
<link rel="stylesheet" href="_content/SteUp.Shared/css/default-theme.css"/>
<link rel="stylesheet" href="SteUp.Maui.styles.css"/>
<link rel="icon" type="image/png" href="favicon.png"/>
</head>
<body>
<div class="status-bar-safe-area"></div>
<div class="status-bar-safe-area"></div>
<div id="app">Loading...</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
<div id="app">
<div class="spinner-container">
<span class="loader"></span>
</div>
</div>
<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>
<!-- 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>-->
<!-- 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>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webview.js" autostart="false"></script>
<script src="_content/SteUp.Shared/js/bootstrap/bootstrap.bundle.min.js"></script>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_content/SteUp.Shared/js/main.js"></script>
</body>

View File

@@ -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="sidebar">
<NavMenu />
</div>*@
<NavMenu/>
<main>
<article class="content px-4">
<article>
@Body
</article>
</main>
</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();
}
}

View File

@@ -21,29 +21,29 @@ main {
align-items: center;
}
.top-row ::deep a, .top-row ::deep .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
}
.top-row ::deep a, .top-row ::deep .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
}
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}
.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
@media (max-width: 640.98px) {
.top-row {
justify-content: space-between;
}
.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
}
@media (min-width: 641px) {
@@ -64,11 +64,11 @@ main {
z-index: 1;
}
.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}
.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}
.top-row, article {
padding-left: 2rem !important;

View File

@@ -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 {
}

View File

@@ -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);
}

View File

@@ -1,38 +1,72 @@
<nav class="navbar navbar-expand justify-content-center">
<div class="container-fluid">
<ul class="navbar-nav nav-justified w-100 text-center">
<div class="container animated-navbar @(IsVisible ? "show-nav" : "hide-nav") @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
<nav class="navbar @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
<div class="container-navbar">
<ul class="navbar-nav flex-row nav-justified align-items-center w-100 text-center">
<li class="nav-item">
<NavLink class="nav-link" href="Users" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-group-line"></i>
<span>Test</span>
</div>
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="Calendar" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-calendar-todo-line"></i>
<span>Home</span>
</div>
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="Calendar" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-calendar-todo-line"></i>
<span>Altro</span>
</div>
</NavLink>
</li>
</ul>
</div>
<li class="nav-item">
<NavLink class="nav-link " href="workout" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-empathize-line"/>
@* <span>Workout</span> *@
</div>
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-home-5-line"/>
@* <span>Home</span> *@
</div>
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="logbook" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-health-book-line"></i>
@* <span>Log Book</span> *@
</div>
</NavLink>
</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>
</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>
</div>
</nav>
@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;
}
}

View File

@@ -0,0 +1,8 @@
<div class="spinner-container @(FullScreen ? "" : "not-fullScreen")">
<span class="loader"></span>
</div>
@code
{
[Parameter] public bool FullScreen { get; set; } = true;
}

View File

@@ -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)
}
}

View File

@@ -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++;
}
}

View File

@@ -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();
}

View File

@@ -1,15 +1,4 @@
@page "/"
@page "/home"
@attribute [Authorize]
<h1>Hello, world!</h1>
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!;
}
<h3>Home</h3>

View File

@@ -0,0 +1 @@

View File

@@ -1,6 +0,0 @@
@page "/settings"
<h3>Impostazioni</h3>
@code {
}

View 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");
}
}

View File

@@ -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 {
}

View File

@@ -0,0 +1,6 @@
@page "/login"
<h3>Login</h3>
@code {
}

View File

@@ -0,0 +1 @@

View File

@@ -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);
}
}

View File

@@ -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 {
}

View File

@@ -1,6 +1,48 @@
<Router AppAssembly="@typeof(Routes).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
</Router>
@using SteUp.Shared.Components.SingleElements.Modal.ExceptionModal
@inject NavigationManager NavigationManager
<ErrorBoundary @ref="ErrorBoundary">
<ChildContent>
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Routes).Assembly">
<Found Context="routeData">
<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"/>
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView>
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</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; }
}

View File

@@ -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();
}
}

View File

@@ -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);
}

View 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
}

View File

@@ -1,4 +1,4 @@
namespace Template.Shared.Interfaces;
namespace SteUp.Shared.Core.Interface;
public interface IFormFactor
{

View File

@@ -0,0 +1,6 @@
namespace SteUp.Shared.Core.Interface.IntegryApi;
public interface IIntegryApiService
{
Task<bool> SystemOk();
}

View File

@@ -0,0 +1,8 @@
namespace SteUp.Shared.Core.Interface.System.Network;
public interface INetworkService
{
public bool ConnectionAvailable { get; set; }
public bool IsNetworkAvailable();
}

View 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;
}
}

View 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;
}
}
}

View File

@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
namespace Template.Shared;
namespace SteUp.Shared;
public static class InteractiveRenderSettings
{

View File

@@ -1,23 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
<ItemGroup>
<SupportedPlatform Include="browser"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Blazor.Bootstrap" Version="3.0.0" />
<PackageReference Include="IntegryApiClient.Core" Version="1.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.8" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="IntegryApiClient.Core" Version="1.2.3"/>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.12"/>
<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>
<Folder Include="wwwroot\js\bootstrap\" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\js\bootstrap\"/>
</ItemGroup>
<ItemGroup>
<UpToDateCheckInput Remove="Components\Layout\Overlay\SpinnerOverlay.razor" />
</ItemGroup>
</Project>

View File

@@ -1,10 +1,19 @@
@using System.Net.Http
@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.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using Template.Shared.Components
@using BlazorBootstrap;
@using SteUp.Shared.Components
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using MudBlazor
@using static InteractiveRenderSettings
@inject NavigationManager NavigationManager
@inject IUserSession UserSession
@inject ILocalStorage LocalStorage
@inject ISnackbar Snackbar

View File

@@ -1,46 +1,98 @@
html, body {
font-family: 'Poppins', 'Helvetica Neue', Helvetica, Arial, sans-serif;
html { overflow: hidden; }
.page, article, main { height: 100% !important; overflow: hidden; }
#app { height: 100vh; }
html, body {
font-family: "Nunito", sans-serif;
font-size: 14px;
font-weight: 400;
line-height: 1.8;
color: black;
}
* { font-family: "Nunito", sans-serif !important; }
.mud-button-label { font-weight: 700 !important; }
a, .btn-link {
/*color: #006bb7;*/
text-decoration: none;
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 {
color: #fff;
background-color: var(--primary-color);
border-color: var(--darker-color);
}
.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;
}
.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; }
.content {
padding-top: 1.1rem;
padding-top: 1rem;
display: flex;
align-items: center;
flex-direction: column;
height: 90vh;
}
h1:focus {
outline: none;
.content::-webkit-scrollbar { width: 3px; }
.content::-webkit-scrollbar-thumb {
background: #bbb;
border-radius: 2px;
}
.valid.modified:not([type=checkbox]) {
outline: 1px solid #26b050;
}
h1:focus { outline: none; }
.invalid {
outline: 1px solid #e50000;
}
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.validation-message {
color: #e50000;
}
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }
#blazor-error-ui {
background: lightyellow;
@@ -67,18 +119,134 @@ h1:focus {
color: white;
}
.blazor-error-boundary::after {
content: "An error has occurred."
}
.blazor-error-boundary::after { content: "An error has occurred." }
.status-bar-safe-area {
display: none;
}
.status-bar-safe-area { display: none; }
.page-title {
/*text-align: center;*/
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) {
@@ -87,18 +255,23 @@ h1:focus {
position: fixed;
top: 0;
height: env(safe-area-inset-top);
background-color: #f7f7f7;
width: 100%;
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 {
padding-top: env(safe-area-inset-top);
height: 100vh;
margin-top: env(safe-area-inset-top);
height: calc(100vh - env(safe-area-inset-top));
}
.flex-column, .navbar-brand {
padding-left: env(safe-area-inset-left);
}
.flex-column, .navbar-brand { padding-left: env(safe-area-inset-left); }
.customDialog-form .mud-dialog-content { margin-top: env(safe-area-inset-top); }
}

View File

@@ -1,5 +1,5 @@
:root {
--primary-color: #5352ed;
--primary-color: #ec4c41;
--ligther-color: #f7f7ff;
--darker-color: hsl(240, 81%, 30%);
--darker-color: #d02315;
}

View File

@@ -10,14 +10,14 @@
<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="_content/Template.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.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link href="_content/SteUp.Shared/css/bootstrap/bootstrap-icons.min.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/Template.Shared/css/app.css" />
<link rel="stylesheet" href="_content/Template.Shared/css/default-theme.css" />
<link rel="stylesheet" href="Template.Web.styles.css" />
<link rel="stylesheet" href="_content/SteUp.Shared/css/remixicon/remixicon.css" />
<link rel="stylesheet" href="_content/SteUp.Shared/css/app.css" />
<link rel="stylesheet" href="_content/SteUp.Shared/css/default-theme.css" />
<link rel="stylesheet" href="SteUp.Web.styles.css" />
<HeadOutlet @rendermode="InteractiveServer" />
</head>
@@ -26,13 +26,13 @@
<Routes @rendermode="InteractiveServer" />
<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. -->
<!--<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. -->
<!--<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. -->
<!--<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>
</body>

View File

@@ -1,5 +1,4 @@
@page "/Error"
@using System.Diagnostics
<PageTitle>Error</PageTitle>
@@ -24,13 +23,12 @@
and restarting the app.
</p>
@code{
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
@code {
private string? RequestId { get; set; }
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
protected override void OnInitialized() =>
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
protected override void OnInitialized()
{
RequestId = Guid.NewGuid().ToString();
}
}

View File

@@ -6,6 +6,6 @@
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using Template.Web
@using Template.Shared.Components
@using Template.Shared
@using SteUp.Web
@using SteUp.Shared.Components
@using SteUp.Shared

View File

@@ -1,43 +1,30 @@
using IntegryApiClient.Blazor;
using Template.Web.Components;
using Template.Shared.Interfaces;
using Template.Web.Services;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Web;
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
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 = WebAssemblyHostBuilder.CreateDefault(args);
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMudServices();
builder.Services.AddAuthorizationCore();
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddBlazorBootstrap();
builder.Services.UseIntegry(BaseRestServicesEndpoint);
const string appToken = "4fef1843-793d-499b-a7ed-1edd8cac465c";
builder.Services.UseIntegry(appToken: appToken, useLoginAzienda: true);
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.
if (!app.Environment.IsDevelopment())
{
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();
}
builder.RootComponents.Add<Routes>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
app.UseHttpsRedirection();
builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
app.UseStaticFiles();
app.UseAntiforgery();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies(typeof(Template.Shared._Imports).Assembly);
app.Run();
var host = builder.Build();
await host.RunAsync();

View File

@@ -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
{

View File

@@ -1,17 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IntegryApiClient.Blazor" Version="1.0.9" />
</ItemGroup>
<ItemGroup>
<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>
<ProjectReference Include="..\SteUp.Shared\SteUp.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SteUp.Shared\SteUp.Shared.csproj"/>
</ItemGroup>
</Project>