Skip to content

Commit

Permalink
Merge 69ff942 into 33bb6dd
Browse files Browse the repository at this point in the history
  • Loading branch information
neozhu authored Dec 29, 2024
2 parents 33bb6dd + 69ff942 commit 5e2da0e
Show file tree
Hide file tree
Showing 64 changed files with 635 additions and 501 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ By incorporating robust offline capabilities, CleanAspire empowers developers to
version: '3.8'
services:
apiservice:
image: blazordevlab/cleanaspire-api:0.0.57
image: blazordevlab/cleanaspire-api:0.0.58
environment:
- ASPNETCORE_ENVIRONMENT=Development
- AllowedHosts=*
Expand All @@ -110,7 +110,7 @@ services:


blazorweb:
image: blazordevlab/cleanaspire-webapp:0.0.57
image: blazordevlab/cleanaspire-webapp:0.0.58
environment:
- ASPNETCORE_ENVIRONMENT=Production
- AllowedHosts=*
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/App.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Router AppAssembly="@typeof(App).Assembly">

<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


<div class="d-flex justify-content-between">
<div class="d-flex align-center gap-2">
<MudBreadcrumbs Items="@BreadcrumbItems"></MudBreadcrumbs>
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Components/Carousel.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="swiper-container">

<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<MudCard Elevation="24">
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Components/CarouselReverse.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="swiper-container-reverse">

<div class="swiper-container-reverse">
<div class="swiper-wrapper">
<div class="swiper-slide">
<MudCard Elevation="24">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<MudDialog>

<MudDialog>
<DialogContent>
<MudText>@ContentText</MudText>
</DialogContent>
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Components/FileSizeFormatter.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<span>@FormattedSize</span>

<span>@FormattedSize</span>

@code {
[Parameter]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@inherits MudBaseButton

@inherits MudBaseButton

<MudButton OnClick="OnClickAsync" StartIcon="@StartIcon" Disabled="@IsDisabled" IconColor="@IconColor" Variant="@Variant" Color="@Color" Size="@Size">
@if (_loading)
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Components/MudEnumSelect.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@typeparam TEnum
@using System.Reflection
@using System.ComponentModel
@using System.Reflection

@inherits MudSelect<TEnum>

@{
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Components/OfflineSyncStatus.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@inject OfflineSyncService OfflineSyncService

@inject OfflineSyncService OfflineSyncService

<div class="d-flex justify-center align-center flex-row gap-2">
@if (OfflineSyncService.CurrentStatus == SyncStatus.Idle)
Expand Down
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Components/PasswordInput.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using System.Linq.Expressions

<MudTextField InputType="@InputType"
T="string"
Value="@Value"
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Components/Thumbnail.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="d-flex align-content-center align-center gap-2">

<div class="d-flex align-content-center align-center gap-2">
@if (IsImage)
{
<MudImage ObjectFit="ObjectFit.ScaleDown" Src="@Url()" Width="50" Height="50" Class="rounded-lg"></MudImage>
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Components/WebpushrSetup.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@code {

@code {
protected override async Task OnInitializedAsync()
{
var online = await OnlineStatusInterop.GetOnlineStatusAsync();
Expand Down
10 changes: 7 additions & 3 deletions src/CleanAspire.ClientApp/DependencyInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using CleanAspire.ClientApp.Configurations;
using CleanAspire.ClientApp.Services.Identity;
using CleanAspire.ClientApp.Services.JsInterop;
using CleanAspire.ClientApp.Services.Proxies;
using CleanAspire.Api.Client;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.Kiota.Abstractions.Authentication;
Expand All @@ -18,6 +17,8 @@
using Microsoft.Kiota.Serialization.Json;
using Microsoft.Kiota.Serialization.Multipart;
using Microsoft.Kiota.Serialization.Text;
using CleanAspire.ClientApp.Services.PushNotifications;
using CleanAspire.ClientApp.Services.Products;

namespace CleanAspire.ClientApp;

Expand Down Expand Up @@ -52,18 +53,21 @@ public static void TryAddMudBlazor(this IServiceCollection services, IConfigurat

public static void AddCoreServices(this IServiceCollection services, IConfiguration configuration)
{

// Cookie and Authentication Handlers
services.AddTransient<CookieHandler>();
services.AddTransient<WebpushrAuthHandler>();

// Singleton Services
// Scoped Services
services.AddScoped<WebpushrOptionsCache>();
services.AddScoped<UserProfileStore>();
services.AddScoped<OnlineStatusInterop>();
services.AddScoped<OfflineModeState>();
services.AddScoped<IndexedDbCache>();
services.AddScoped<ProductCacheService>();
services.AddScoped<ProductServiceProxy>();
services.AddScoped<OfflineSyncService>();
services.AddScoped<WebpushrService>();
services.AddScoped<IWebpushrService, WebpushrService>();

// Configuration
var clientAppSettings = configuration.GetSection(ClientAppSettings.KEY).Get<ClientAppSettings>();
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Layout/Appbar.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<MudAppBar Elevation="0" Fixed="false">

<MudAppBar Elevation="0" Fixed="false">

<MudIcon>
<MudBlazorLogo></MudBlazorLogo>
Expand Down
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Layout/ApplicationLayout.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using CleanAspire.ClientApp.Layout.Redirections

@using Microsoft.AspNetCore.Components.Authorization

@inherits LayoutComponentBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using CleanAspire.ClientApp.Layout.Redirections

@using Microsoft.AspNetCore.Components.Authorization

@inherits LayoutComponentBase
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Layout/MainLayout.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@inherits LayoutComponentBase

@inherits LayoutComponentBase

<PageTitle>@L[AppSettings.AppName]</PageTitle>

Expand Down
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Layout/MudBlazorLogo.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


<?xml version="1.0" encoding="utf-8" ?>
<svg class="@Class" style="@Style" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none">
<!-- 外部圆圈 (线条填充为渐变,背景透明) -->
Expand Down
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Layout/Navbar.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using CleanAspire.ClientApp.Services.Navigation

<MudPaper Elevation="1" Square="true">
<MudToolBar Class="gap-2" Style="height:50px">
<MudButton StartIcon="@Icons.Material.Filled.Home" Href="/" Variant="Variant.Text">@L["Home"]</MudButton>
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Layout/RedirectToLogin.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication

@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
@inject NavigationManager Navigation

@code {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@code {

@code {

protected override void OnAfterRender(bool firstRender)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@code {

@code {

protected override void OnAfterRender(bool firstRender)
{
Expand Down
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Layout/UserMenu.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using CleanAspire.ClientApp.Services.Identity

@using Microsoft.AspNetCore.Components.Authorization
@inject ISignInManagement IdentityManagement
@inject LayoutService LayoutService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/account/forgetpassword"
@using System.ComponentModel.DataAnnotations

<PageTitle>@L["Forgot Password?"]</PageTitle>
<MudPaper Elevation="3" Class="pa-8" Width="100%" MaxWidth="500px">
<div class="d-flex flex-row align-center gap-3 my-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

@using System.ComponentModel.DataAnnotations
@using System.Text.Json

<PageTitle>@L["Confirm password reset"]</PageTitle>
<MudPaper Elevation="3" Class="pa-8" Width="100%" MaxWidth="500px">
<div class="d-flex flex-row align-center gap-3 my-3">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/account/forgetpasswordsuccessful"


<PageTitle>@L["Check Your Inbox"]</PageTitle>
<MudPaper Elevation="3" Class="pa-8" Width="100%" MaxWidth="500px">
<div class="d-flex flex-row align-center gap-3 my-3">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "/external-login"

@inject ISignInManagement SignInManagement

<PageTitle>@L["external login"]</PageTitle>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using Microsoft.Kiota.Abstractions

@using Microsoft.Kiota.Abstractions
<div class="d-flex flex-column gap-2">
<MudText Typo="Typo.h4">@L["Change email"]</MudText>
<MudDivider />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@inject OfflineModeState OfflineModeState

@inject OfflineModeState OfflineModeState
<div class="d-flex flex-column gap-2">
<MudText Typo="Typo.h4">@L["Offline Mode"]</MudText>
<MudDivider />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/account/profile"


<PageTitle>@L["Profile"]</PageTitle>
<div class="d-flex flex-column justify-center gap-2">
<MudText Typo="Typo.h4" Align="Align.Center">@L["Personal info"]</MudText>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using CleanAspire.ClientApp.Components.Autocompletes

@using Microsoft.Kiota.Abstractions

<EditForm Model="@model" class="d-flex flex-grow-1" OnValidSubmit="OnValidSubmit">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "/profile/setting"

<PageTitle>@L["Setting"]</PageTitle>
<MudText Typo="Typo.h2">@L["Settings"]</MudText>
<MudTabs Outlined="true" Position="Position.Left" Class="mt-3" Border="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using Net.Codecrete.QrCodeGenerator

@using Net.Codecrete.QrCodeGenerator
<div class="d-flex flex-column gap-2">
<MudText Typo="Typo.h4">@L["Two-factor authentication"]</MudText>
<MudDivider />
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@layout ApplicationLayout

@layout ApplicationLayout
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Pages/Account/SignIn.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@inject ISignInManagement SignInManagement
@using System.ComponentModel.DataAnnotations
@using CleanAspire.ClientApp.Services.Identity

<PageTitle>@L["Sign In"]</PageTitle>
<MudPaper Elevation="3" Class="pa-8" Width="100%" MaxWidth="500px">
<div class="d-flex flex-row align-center gap-3 my-3">
Expand Down
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Pages/Account/SignUp.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@using System.ComponentModel.DataAnnotations
@using CleanAspire.ClientApp.Components.Autocompletes


<PageTitle>@L["Signup"]</PageTitle>
<MudPaper Elevation="3" Class="pa-8" Width="100%" MaxWidth="500px">
<div class="d-flex flex-row align-center gap-3 my-3">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/account/confirm-email"


<PageTitle>@L["Confirm Verification"]</PageTitle>
<MudPaper Elevation="3" Class="pa-8" Width="100%" MaxWidth="500px">
<div class="d-flex flex-row align-center gap-3 my-3">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/account/signupsuccessful"


<PageTitle>@L["Signup Successful"]</PageTitle>
<MudPaper Elevation="3" Class="pa-8" Width="100%" MaxWidth="500px">
<div class="d-flex flex-row align-center gap-3 my-3">
Expand Down
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Pages/Authentication.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "/authentication/{action}"

@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
<RemoteAuthenticatorView Action="@Action" />

Expand Down
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Pages/Counter.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/counter"


<PageTitle>Counter</PageTitle>

<h1>Counter</h1>
Expand Down
5 changes: 3 additions & 2 deletions src/CleanAspire.ClientApp/Pages/Home.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@page "/"
@using Microsoft.Kiota.Abstractions
@using System.Text
@using System.Net.Http.Headers
@using System.Text

@using Microsoft.Kiota.Abstractions
@inject IHttpClientFactory HttpClientFactory
<PageTitle>Home</PageTitle>

Expand Down
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Pages/PrivacyPolicy.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "/privacy-policy"

@layout MainLayout
<MudPaper Class="pa-4">
<MudText Typo="Typo.h4" GutterBottom="true">Privacy Policy</MudText>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@using CleanAspire.ClientApp.Components.Autocompletes
@using CleanAspire.ClientApp.Services.Proxies
@using CleanAspire.ClientApp.Services.Products

@inject ProductServiceProxy ProductServiceProxy
<MudDialog>
<DialogContent>
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Pages/Products/Edit.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@page "/products/edit/{Id}"
@using CleanAspire.ClientApp.Components.Autocompletes
@using CleanAspire.ClientApp.Components.Breadcrumbs
@using CleanAspire.ClientApp.Services.Proxies
@using CleanAspire.ClientApp.Services.Products

@inject ProductServiceProxy ProductServiceProxy

<PageTitle>@Title</PageTitle>
Expand Down
5 changes: 3 additions & 2 deletions src/CleanAspire.ClientApp/Pages/Products/Index.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
@page "/products/index"
@using CleanAspire.ClientApp.Pages.Products.Components
@using CleanAspire.ClientApp.Services.Proxies
@using System.Globalization
@using CleanAspire.ClientApp.Pages.Products.Components
@using CleanAspire.ClientApp.Services.Products

@inject ProductServiceProxy ProductServiceProxy

<PageTitle>@Title</PageTitle>
Expand Down
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Pages/TermsOfService.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "/terms-of-service"

@layout MainLayout
<MudPaper Class="pa-4">
<MudText Typo="Typo.h4" GutterBottom="true">Terms of Service</MudText>
Expand Down
1 change: 1 addition & 0 deletions src/CleanAspire.ClientApp/Pages/Weather.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "/weather"

@inject HttpClient Http

<PageTitle>Weather</PageTitle>
Expand Down
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Pages/_Imports.razor
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@layout ApplicationLayout

@layout ApplicationLayout
3 changes: 2 additions & 1 deletion src/CleanAspire.ClientApp/Routes.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Router AppAssembly="@typeof(App).Assembly">

<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
Expand Down
Loading

0 comments on commit 5e2da0e

Please sign in to comment.