Cleanup before refactor
This commit is contained in:
@@ -48,6 +48,24 @@
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="appsettings.json" />
|
||||
<None Remove="appsettings.Development.json" />
|
||||
|
||||
<Content Include="appsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
|
||||
<Content Include="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
<DependentUpon>appsettings.json</DependentUpon>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- App Icon -->
|
||||
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4"/>
|
||||
@@ -71,6 +89,10 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.9"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.9"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.9"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.9"/>
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)"/>
|
||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)"/>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="$(MauiVersion)"/>
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
using Bimix.UI.Mobile.Services;
|
||||
using System.Reflection;
|
||||
using Bimix.UI.Mobile.Services;
|
||||
using Bimix.UI.Shared.Extensions;
|
||||
using Bimix.UI.Shared.Interfaces;
|
||||
using Bimix.UI.Shared.Services;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Maui.Controls.Hosting;
|
||||
using Microsoft.Maui.Devices;
|
||||
using Microsoft.Maui.Hosting;
|
||||
using MudBlazor.Services;
|
||||
using ZXing.Net.Maui.Controls;
|
||||
|
||||
@@ -17,6 +24,11 @@ public static class MauiProgram
|
||||
.UseBarcodeReader()
|
||||
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); });
|
||||
|
||||
builder.Configuration
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: false)
|
||||
.AddJsonFile($"appsettings.Development.json", optional: true, reloadOnChange: false)
|
||||
.AddEnvironmentVariables();
|
||||
|
||||
builder.Services.AddMauiBlazorWebView();
|
||||
builder.Services.AddMudServices();
|
||||
|
||||
@@ -29,6 +41,8 @@ public static class MauiProgram
|
||||
builder.Services.AddSingleton<IScannerService, NoOpScannerService>();
|
||||
}
|
||||
|
||||
builder.Services.AddScoped<AuthService>();
|
||||
|
||||
var baseUrl = GetApiBaseUrl();
|
||||
builder.Services.AddSharedServices(baseUrl);
|
||||
|
||||
@@ -36,6 +50,7 @@ public static class MauiProgram
|
||||
#if DEBUG
|
||||
builder.Services.AddBlazorWebViewDeveloperTools();
|
||||
builder.Logging.AddDebug();
|
||||
builder.Logging.SetMinimumLevel(LogLevel.Debug);
|
||||
#endif
|
||||
return builder.Build();
|
||||
}
|
||||
@@ -43,11 +58,10 @@ public static class MauiProgram
|
||||
private static string GetApiBaseUrl()
|
||||
{
|
||||
#if IOS
|
||||
// iOS symulator - użyj swojego IP
|
||||
return "http://192.168.13.44:7142/"; // Zastąp swoim IP
|
||||
// iOS symulator
|
||||
return "http://192.168.29.140:7142/";
|
||||
#else
|
||||
return "https://localhost:7142/";
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
5
Bimix.UI.Mobile/appsettings.Development.json
Normal file
5
Bimix.UI.Mobile/appsettings.Development.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"GoogleAuth": {
|
||||
"ClientId": "1037727384847-t1l2au6du34kdckamro81guklk17cjah.apps.googleusercontent.com"
|
||||
}
|
||||
}
|
||||
5
Bimix.UI.Mobile/appsettings.json
Normal file
5
Bimix.UI.Mobile/appsettings.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"GoogleAuth": {
|
||||
"ClientId": "1037727384847-t1l2au6du34kdckamro81guklk17cjah.apps.googleusercontent.com"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user