Procházet zdrojové kódy

MudBlazor bugfix

feature/blazor-frontend
nemanja.grkovic před 3 roky
rodič
revize
4229d4c5f3

+ 2
- 0
IdentityProvider/Properties/launchSettings.json Zobrazit soubor

"profiles": { "profiles": {
"IIS Express": { "IIS Express": {
"commandName": "IISExpress", "commandName": "IISExpress",
"launchBrowser": true,

"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
}, },

+ 1
- 0
NemAnCore/NemAnBlazor.csproj Zobrazit soubor

<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="6.0.8" /> <PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="6.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.7" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.7" PrivateAssets="all" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.7" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="6.0.14" />
<PackageReference Include="protobuf-net.Grpc" Version="1.0.171" /> <PackageReference Include="protobuf-net.Grpc" Version="1.0.171" />
</ItemGroup> </ItemGroup>



+ 5
- 8
NemAnCore/Pages/Login.razor Zobrazit soubor

@inject ITrackClientService SearchService @inject ITrackClientService SearchService
@using System.Security.Claims @using System.Security.Claims
@inject Blazored.LocalStorage.ILocalStorageService localStorage @inject Blazored.LocalStorage.ILocalStorageService localStorage


<AuthorizeView> <AuthorizeView>
<Authorized> <Authorized>
<p>Dobrodosli @context.User.Claims.FirstOrDefault(x => x.Type == "name")?.Value.ToUpper()</p> <p>Dobrodosli @context.User.Claims.FirstOrDefault(x => x.Type == "name")?.Value.ToUpper()</p>


<PageTitle>Index</PageTitle> <PageTitle>Index</PageTitle>


<h1>Pozdrav Diligent!</h1>


Dobrodošli u našu NemAn aplikaciju.

<MudText Typo="Typo.h3" GutterBottom="true">Pozdrav Diligent!</MudText>
<MudText Class="mb-8">
Dobrodošli u našu NemAn aplikaciju.
</MudText>







+ 2
- 0
NemAnCore/Program.cs Zobrazit soubor

using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MudBlazor.Services;
using NemAnBlazor; using NemAnBlazor;
using NemAnBlazor.Services; using NemAnBlazor.Services;
using NemAnBlazor.Services.Interfaces; using NemAnBlazor.Services.Interfaces;
}); });
builder.Services.AddAuthorizationCore(); builder.Services.AddAuthorizationCore();
//builder.Services.AddScoped<AuthenticationStateProvider, AuthClientService>(); //builder.Services.AddScoped<AuthenticationStateProvider, AuthClientService>();
builder.Services.AddMudServices();


builder.Services.AddScoped<ITrackClientService, TrackClientService>(); builder.Services.AddScoped<ITrackClientService, TrackClientService>();
builder.Services.AddScoped<IAuthClientService, AuthClientService>(); builder.Services.AddScoped<IAuthClientService, AuthClientService>();

+ 26
- 12
NemAnCore/Shared/MainLayout.razor Zobrazit soubor

@inherits LayoutComponentBase @inherits LayoutComponentBase


<div class="page">
<div style="background: green ;" class="sidebar">
<MudThemeProvider />
<MudDialogProvider />
<MudSnackbarProvider />

<MudLayout>
<MudAppBar Elevation="0">
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@((e) => DrawerToggle())" />
</MudAppBar>
<MudDrawer @bind-Open="_drawerOpen" Elevation="1">
<MudDrawerHeader>
<MudText Typo="Typo.h6">Spotify</MudText>
</MudDrawerHeader>
<NavMenu /> <NavMenu />
</div>
</MudDrawer>
<MudMainContent>
<MudContainer MaxWidth="MaxWidth.Large" Class="my-16 pt-16">
@Body
</MudContainer>
</MudMainContent>
</MudLayout>


<main>
<div class="top-row px-4">
<a href="https://docs.microsoft.com/aspnet/" target="_blank">Logout</a>
</div>
@code {
bool _drawerOpen = true;


<article class="content px-4">
@Body
</article>
</main>
</div>
void DrawerToggle()
{
_drawerOpen = !_drawerOpen;
}
}

+ 5
- 28
NemAnCore/Shared/NavMenu.razor Zobrazit soubor

<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">Spotify</a>
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>

<div class="@NavMenuCssClass" @onclick="ToggleNavMenu" >
<nav class="flex-column" >
<div class="nav-item px-3">
<NavLink class="nav-link" href="home" Match="NavLinkMatch.All">
<span class="oi oi-home" aria-hidden="true"></span> Home
</NavLink>
</div>
@* <div class="nav-item px-3">
<NavLink class="nav-link" href="callback">
<span class="oi oi-plus" aria-hidden="true"></span> Counter
</NavLink>
</div>*@
<div class="nav-item px-3">
<NavLink class="nav-link" href="search">
<span class="oi oi-list-rich" aria-hidden="true"></span> Search
</NavLink>
</div>
</nav>
</div>
<MudNavMenu>
<MudNavLink Href="" Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.Home">Dashboard</MudNavLink>
<MudNavLink Href="home" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Add">Home</MudNavLink>
<MudNavLink Href="search" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.List">Search</MudNavLink>
</MudNavMenu>


@code { @code {
private bool collapseNavMenu = true; private bool collapseNavMenu = true;

+ 1
- 0
NemAnCore/_Imports.razor Zobrazit soubor

@using NemAnBlazor.Shared @using NemAnBlazor.Shared
@using System.Web @using System.Web
@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.AspNetCore.Components.Authorization
@using MudBlazor

+ 3
- 0
NemAnCore/wwwroot/index.html Zobrazit soubor

<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" /> <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" /> <link href="css/app.css" rel="stylesheet" />
<link href="NemAnBlazor.styles.css" rel="stylesheet" /> <link href="NemAnBlazor.styles.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
</head> </head>


<body> <body>
<a class="dismiss">🗙</a> <a class="dismiss">🗙</a>
</div> </div>
<script src="_framework/blazor.webassembly.js"></script> <script src="_framework/blazor.webassembly.js"></script>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
</body> </body>


</html> </html>

Načítá se…
Zrušit
Uložit