PWA Fundvelo der Caritas.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.AddScoped<ReportRepositoryService>();
  27. builder.Services.AddScoped<Toaster>();
  28. builder.Services.AddScoped<UserDataProvider>();
  29. builder.Services.AddScoped<MasterDataService>();
  30. builder.Services.AddScoped<BlazorGeolocationService>();
  31. builder.Services.AddLocalization();
  32. builder.Services.AddBlazorLeafletMaps();
  33. builder.Services.AddMatToaster(config => {
  34. config.Position = MatToastPosition.BottomCenter;
  35. config.PreventDuplicates = true;
  36. config.NewestOnTop = true;
  37. config.MaxDisplayedToasts = 5;
  38. config.ShowCloseButton = true;
  39. config.ShowProgressBar = true;
  40. config.MaximumOpacity = 100;
  41. config.VisibleStateDuration = 5000;
  42. config.ShowTransitionDuration = 300;
  43. config.HideTransitionDuration = 150;
  44. });
  45. builder.Services.AddIndexedDB(dbStore => {
  46. dbStore.DbName = "CwebPlusAppDB";
  47. dbStore.Version = 1;
  48. dbStore.Stores.Add(new StoreSchema {
  49. Name = "FoundReportRepositoryItems",
  50. PrimaryKey = new IndexSpec { Name = "id", KeyPath = "id", Auto = true },
  51. Indexes = new List<IndexSpec> {
  52. new IndexSpec{Name="serverRefNbr", KeyPath = "serverRefNbr", Auto=false},
  53. new IndexSpec{Name="status", KeyPath = "status", Auto=false}
  54. }
  55. });
  56. dbStore.Stores.Add(new StoreSchema {
  57. Name = "MissingReportRepositoryItems",
  58. PrimaryKey = new IndexSpec { Name = "id", KeyPath = "id", Auto = true },
  59. Indexes = new List<IndexSpec> {
  60. new IndexSpec{Name="serverRefNbr", KeyPath = "serverRefNbr", Auto=false},
  61. new IndexSpec{Name="status", KeyPath = "status", Auto=false}
  62. }
  63. });
  64. });
  65. await builder.Build().RunAsync();
  66. }
  67. }
  68. }