Skip to content

Commit c87d748

Browse files
authored
File added
1 parent 9d6ff31 commit c87d748

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1628
-0
lines changed

BlazorFileUploadJWT.sln

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.33516.290
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorFileUploadJWT.Server", "BlazorFileUploadJWT\Server\BlazorFileUploadJWT.Server.csproj", "{D3CE60B5-CC34-464E-B97B-265A12037AA4}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorFileUploadJWT.Client", "BlazorFileUploadJWT\Client\BlazorFileUploadJWT.Client.csproj", "{36721C0B-A9F3-46CD-B7EF-2E78163EFCA2}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorFileUploadJWT.Shared", "BlazorFileUploadJWT\Shared\BlazorFileUploadJWT.Shared.csproj", "{837E2B9F-016F-4105-9AC8-D7B4EB8BECDA}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{D3CE60B5-CC34-464E-B97B-265A12037AA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{D3CE60B5-CC34-464E-B97B-265A12037AA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{D3CE60B5-CC34-464E-B97B-265A12037AA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{D3CE60B5-CC34-464E-B97B-265A12037AA4}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{36721C0B-A9F3-46CD-B7EF-2E78163EFCA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{36721C0B-A9F3-46CD-B7EF-2E78163EFCA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{36721C0B-A9F3-46CD-B7EF-2E78163EFCA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{36721C0B-A9F3-46CD-B7EF-2E78163EFCA2}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{837E2B9F-016F-4105-9AC8-D7B4EB8BECDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{837E2B9F-016F-4105-9AC8-D7B4EB8BECDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{837E2B9F-016F-4105-9AC8-D7B4EB8BECDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{837E2B9F-016F-4105-9AC8-D7B4EB8BECDA}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {7DDD89F5-160D-4FBB-A2BE-0425AAD229B1}
36+
EndGlobalSection
37+
EndGlobal
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Router AppAssembly="@typeof(App).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
5+
</Found>
6+
<NotFound>
7+
<PageTitle>Not found</PageTitle>
8+
<LayoutView Layout="@typeof(MainLayout)">
9+
<p role="alert">Sorry, there's nothing at this address.</p>
10+
</LayoutView>
11+
</NotFound>
12+
</Router>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.22" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.22" PrivateAssets="all" />
12+
<PackageReference Include="Syncfusion.Blazor.Inputs" Version="23.1.39" />
13+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="23.1.39" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\Shared\BlazorFileUploadJWT.Shared.csproj" />
18+
</ItemGroup>
19+
20+
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@page "/counter"
2+
3+
<PageTitle>Counter</PageTitle>
4+
5+
<h1>Counter</h1>
6+
7+
<p role="status">Current count: @currentCount</p>
8+
9+
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
10+
11+
@code {
12+
private int currentCount = 0;
13+
14+
private void IncrementCount()
15+
{
16+
currentCount++;
17+
}
18+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@page "/fetchdata"
2+
@using BlazorFileUploadJWT.Shared
3+
@inject HttpClient Http
4+
5+
<PageTitle>Weather forecast</PageTitle>
6+
7+
<h1>Weather forecast</h1>
8+
9+
<p>This component demonstrates fetching data from the server.</p>
10+
11+
@if (forecasts == null)
12+
{
13+
<p><em>Loading...</em></p>
14+
}
15+
else
16+
{
17+
<table class="table">
18+
<thead>
19+
<tr>
20+
<th>Date</th>
21+
<th>Temp. (C)</th>
22+
<th>Temp. (F)</th>
23+
<th>Summary</th>
24+
</tr>
25+
</thead>
26+
<tbody>
27+
@foreach (var forecast in forecasts)
28+
{
29+
<tr>
30+
<td>@forecast.Date.ToShortDateString()</td>
31+
<td>@forecast.TemperatureC</td>
32+
<td>@forecast.TemperatureF</td>
33+
<td>@forecast.Summary</td>
34+
</tr>
35+
}
36+
</tbody>
37+
</table>
38+
}
39+
40+
@code {
41+
private WeatherForecast[]? forecasts;
42+
43+
protected override async Task OnInitializedAsync()
44+
{
45+
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast");
46+
}
47+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@page "/"
2+
3+
@using Syncfusion.Blazor.Inputs
4+
5+
<PageTitle>File Uplaod JWT</PageTitle>
6+
7+
<SfUploader ID="UploadFiles">
8+
<UploaderEvents FileSelected="onFileSelect" BeforeRemove="onRemove"></UploaderEvents>
9+
<UploaderAsyncSettings SaveUrl="api/FileAction/Save" RemoveUrl="api/FileAction/Remove">
10+
</UploaderAsyncSettings>
11+
</SfUploader>
12+
13+
@code {
14+
15+
private void onFileSelect(SelectedEventArgs args)
16+
{
17+
args.CurrentRequest = new List<object> { new { Authorization = "test123" } };
18+
}
19+
20+
private void onRemove(BeforeRemoveEventArgs args)
21+
{
22+
args.CurrentRequest = new List<object> { new { Authorization = "test123" } };
23+
}
24+
25+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using BlazorFileUploadJWT.Client;
2+
using Microsoft.AspNetCore.Components.Web;
3+
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
4+
using Syncfusion.Blazor;
5+
6+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
7+
builder.RootComponents.Add<App>("#app");
8+
builder.RootComponents.Add<HeadOutlet>("head::after");
9+
10+
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
11+
builder.Services.AddSyncfusionBlazor();
12+
await builder.Build().RunAsync();
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:44864",
7+
"sslPort": 44338
8+
}
9+
},
10+
"profiles": {
11+
"BlazorFileUploadJWT": {
12+
"commandName": "Project",
13+
"dotnetRunMessages": true,
14+
"launchBrowser": true,
15+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
16+
"applicationUrl": "https://localhost:7165;http://localhost:5076",
17+
"environmentVariables": {
18+
"ASPNETCORE_ENVIRONMENT": "Development"
19+
}
20+
},
21+
"IIS Express": {
22+
"commandName": "IISExpress",
23+
"launchBrowser": true,
24+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
25+
"environmentVariables": {
26+
"ASPNETCORE_ENVIRONMENT": "Development"
27+
}
28+
}
29+
}
30+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@inherits LayoutComponentBase
2+
3+
<div class="page">
4+
<div class="sidebar">
5+
<NavMenu />
6+
</div>
7+
8+
<main>
9+
<div class="top-row px-4">
10+
<a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
11+
</div>
12+
13+
<article class="content px-4">
14+
@Body
15+
</article>
16+
</main>
17+
</div>
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
.page {
2+
position: relative;
3+
display: flex;
4+
flex-direction: column;
5+
}
6+
7+
main {
8+
flex: 1;
9+
}
10+
11+
.sidebar {
12+
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
13+
}
14+
15+
.top-row {
16+
background-color: #f7f7f7;
17+
border-bottom: 1px solid #d6d5d5;
18+
justify-content: flex-end;
19+
height: 3.5rem;
20+
display: flex;
21+
align-items: center;
22+
}
23+
24+
.top-row ::deep a, .top-row ::deep .btn-link {
25+
white-space: nowrap;
26+
margin-left: 1.5rem;
27+
text-decoration: none;
28+
}
29+
30+
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31+
text-decoration: underline;
32+
}
33+
34+
.top-row ::deep a:first-child {
35+
overflow: hidden;
36+
text-overflow: ellipsis;
37+
}
38+
39+
@media (max-width: 640.98px) {
40+
.top-row:not(.auth) {
41+
display: none;
42+
}
43+
44+
.top-row.auth {
45+
justify-content: space-between;
46+
}
47+
48+
.top-row ::deep a, .top-row ::deep .btn-link {
49+
margin-left: 0;
50+
}
51+
}
52+
53+
@media (min-width: 641px) {
54+
.page {
55+
flex-direction: row;
56+
}
57+
58+
.sidebar {
59+
width: 250px;
60+
height: 100vh;
61+
position: sticky;
62+
top: 0;
63+
}
64+
65+
.top-row {
66+
position: sticky;
67+
top: 0;
68+
z-index: 1;
69+
}
70+
71+
.top-row.auth ::deep a:first-child {
72+
flex: 1;
73+
text-align: right;
74+
width: 0;
75+
}
76+
77+
.top-row, article {
78+
padding-left: 2rem !important;
79+
padding-right: 1.5rem !important;
80+
}
81+
}

0 commit comments

Comments
 (0)