PWA Fundvelo der Caritas.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using BlazorGeolocation;
  2. using cwebplusApp;
  3. using cwebplusApp.Shared;
  4. using cwebplusApp.Shared.Services;
  5. using FisSst.BlazorMaps.DependencyInjection;
  6. using MatBlazor;
  7. using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
  8. using Microsoft.Extensions.DependencyInjection;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Net.Http;
  12. using System.Threading.Tasks;
  13. using TG.Blazor.IndexedDB;
  14. namespace CaritasPWA {
  15. public class Program {
  16. public static async Task Main(string[] args) {
  17. var builder = WebAssemblyHostBuilder.CreateDefault(args);
  18. builder.RootComponents.Add<App>("app");
  19. builder.Services.AddMatBlazor();
  20. builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
  21. builder.Services.AddScoped<IBicycleRestService, BicycleRestService>();
  22. builder.Services.AddSingleton<AppState>();
  23. builder.Services.AddSingleton<PageHistoryManager>();
  24. builder.Services.AddSingleton<ReportDataProvider>();
  25. builder.Services.AddSingleton<OnlineStatusProvider>();
  26. builder.Services.AddSingleton<ScrollLockRemover>();
  27. builder.Services.AddScoped<ReportRepositoryService>();
  28. builder.Services.AddScoped<Toaster>();
  29. builder.Services.AddScoped<UserDataProvider>();
  30. builder.Services.AddScoped<MasterDataService>();
  31. builder.Services.AddScoped<BlazorGeolocationService>();
  32. builder.Services.AddLocalization();
  33. builder.Services.AddBlazorLeafletMaps();
  34. builder.Services.AddMatToaster(config => {
  35. config.Position = MatToastPosition.BottomCenter;
  36. config.PreventDuplicates = true;
  37. config.NewestOnTop = true;
  38. config.MaxDisplayedToasts = 5;
  39. config.ShowCloseButton = true;
  40. config.ShowProgressBar = true;
  41. config.MaximumOpacity = 100;
  42. config.VisibleStateDuration = 5000;
  43. config.ShowTransitionDuration = 300;
  44. config.HideTransitionDuration = 150;
  45. });
  46. builder.Services.AddIndexedDB(dbStore => {
  47. dbStore.DbName = "CwebPlusAppDB";
  48. dbStore.Version = 1;
  49. dbStore.Stores.Add(new StoreSchema {
  50. Name = "FoundReportRepositoryItems",
  51. PrimaryKey = new IndexSpec { Name = "id", KeyPath = "id", Auto = true },
  52. Indexes = new List<IndexSpec> {
  53. new IndexSpec{Name="serverRefNbr", KeyPath = "serverRefNbr", Auto=false},
  54. new IndexSpec{Name="status", KeyPath = "status", Auto=false}
  55. }
  56. });
  57. dbStore.Stores.Add(new StoreSchema {
  58. Name = "MissingReportRepositoryItems",
  59. PrimaryKey = new IndexSpec { Name = "id", KeyPath = "id", Auto = true },
  60. Indexes = new List<IndexSpec> {
  61. new IndexSpec{Name="serverRefNbr", KeyPath = "serverRefNbr", Auto=false},
  62. new IndexSpec{Name="status", KeyPath = "status", Auto=false}
  63. }
  64. });
  65. });
  66. await builder.Build().RunAsync();
  67. }
  68. }
  69. }