Skip to content

Commit faedc25

Browse files
committed
update dashboard and api project
1 parent 5d109c8 commit faedc25

34 files changed

Lines changed: 301 additions & 142 deletions

.dockerignore

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
**/.dockerignore
2-
**/.env
3-
**/.git
4-
**/.gitignore
5-
**/.project
6-
**/.settings
7-
**/.toolstarget
8-
**/.vs
9-
**/.vscode
10-
**/.idea
11-
**/*.*proj.user
12-
**/*.dbmdl
13-
**/*.jfm
14-
**/azds.yaml
15-
**/bin
16-
**/charts
17-
**/docker-compose*
18-
**/Dockerfile*
19-
**/node_modules
20-
**/npm-debug.log
21-
**/obj
22-
**/secrets.dev.yaml
23-
**/values.dev.yaml
24-
LICENSE
1+
**/.dockerignore
2+
**/.env
3+
**/.git
4+
**/.gitignore
5+
**/.project
6+
**/.settings
7+
**/.toolstarget
8+
**/.vs
9+
**/.vscode
10+
**/.idea
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
2525
README.md

DisBot.API/DisBot.API.csproj

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<RootNamespace>API</RootNamespace>
8+
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
89
</PropertyGroup>
910

1011
<ItemGroup>
@@ -15,11 +16,11 @@
1516
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.0" />
1617
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.0" />
1718
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
18-
<PackageReference Include="NetCord" Version="1.0.0-alpha.448" />
19-
<PackageReference Include="NetCord.Hosting" Version="1.0.0-alpha.448" />
20-
<PackageReference Include="NetCord.Hosting.AspNetCore" Version="1.0.0-alpha.448" />
21-
<PackageReference Include="NetCord.Hosting.Services" Version="1.0.0-alpha.448" />
22-
<PackageReference Include="NetCord.Services" Version="1.0.0-alpha.448" />
19+
<PackageReference Include="NetCord" Version="1.0.0-alpha.484" />
20+
<PackageReference Include="NetCord.Hosting" Version="1.0.0-alpha.484" />
21+
<PackageReference Include="NetCord.Hosting.AspNetCore" Version="1.0.0-alpha.484" />
22+
<PackageReference Include="NetCord.Hosting.Services" Version="1.0.0-alpha.484" />
23+
<PackageReference Include="NetCord.Services" Version="1.0.0-alpha.484" />
2324
<PackageReference Include="Npgsql" Version="10.0.2" />
2425
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0-rc.2" />
2526
<PackageReference Include="Scalar.AspNetCore" Version="2.14.3" />
@@ -33,4 +34,10 @@
3334
<ProjectReference Include="..\DisBot.Shared\DisBot.Shared.csproj" />
3435
</ItemGroup>
3536

37+
<ItemGroup>
38+
<Content Include="..\.dockerignore">
39+
<Link>.dockerignore</Link>
40+
</Content>
41+
</ItemGroup>
42+
3643
</Project>

DisBot.API/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
88
ARG BUILD_CONFIGURATION=Release
99
WORKDIR /src
1010
COPY ["DisBot.API/DisBot.API.csproj", "DisBot.API/"]
11+
COPY ["DisBot.Shared/DisBot.Shared.csproj", "DisBot.Shared/"]
1112
RUN dotnet restore "DisBot.API/DisBot.API.csproj"
1213
COPY . .
1314
WORKDIR "/src/DisBot.API"

DisBot.Dashboard/App.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<Router AppAssembly="@typeof(App).Assembly" NotFoundPage="typeof(Pages.NotFound)">
1+
@using DisBot.Dashboard.UI.Layout
2+
@using DisBot.Dashboard.UI.Pages
3+
<Router AppAssembly="@typeof(App).Assembly" NotFoundPage="typeof(NotFound)">
24
<Found Context="routeData">
35
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
46
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>

DisBot.Dashboard/DisBot.Dashboard.csproj

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,36 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12+
<PackageReference Include="LucideBlazor" Version="1.0.4"/>
13+
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="10.0.3"/>
1214
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.0"/>
1315
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.0" PrivateAssets="all"/>
16+
<PackageReference Include="Riok.Mapperly" Version="5.0.0-next.2"/>
17+
<PackageReference Include="ShadcnBlazor" Version="1.0.14"/>
18+
<PackageReference Include="ShadcnBlazor.Extras" Version="1.0.14"/>
1419
</ItemGroup>
1520

1621
<ItemGroup>
1722
<_ContentIncludedByDefault Remove="wwwroot\sample-data\weather.json" />
1823
<_ContentIncludedByDefault Remove="wwwroot\css\app.css" />
24+
<_ContentIncludedByDefault Remove="Layout\MainLayout.razor" />
25+
</ItemGroup>
26+
27+
<ItemGroup>
28+
<ProjectReference Include="..\DisBot.Shared\DisBot.Shared.csproj" />
29+
</ItemGroup>
30+
31+
<ItemGroup>
32+
<Folder Include="Styles\" />
33+
<Folder Include="UI\Components\" />
34+
</ItemGroup>
35+
36+
<ItemGroup>
37+
<AdditionalFiles Include="UI\Layout\MainLayout.razor" />
38+
<AdditionalFiles Include="UI\Pages\Counter.razor" />
39+
<AdditionalFiles Include="UI\Pages\Home.razor" />
40+
<AdditionalFiles Include="UI\Pages\NotFound.razor" />
41+
<AdditionalFiles Include="UI\Pages\Weather.razor" />
1942
</ItemGroup>
2043

2144
<ItemGroup>

DisBot.Dashboard/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
88
ARG BUILD_CONFIGURATION=Release
99
WORKDIR /src
1010
COPY ["DisBot.Dashboard/DisBot.Dashboard.csproj", "DisBot.Dashboard/"]
11+
COPY ["DisBot.Shared/DisBot.Shared.csproj", "DisBot.Shared/"]
1112
RUN dotnet restore "DisBot.Dashboard/DisBot.Dashboard.csproj"
1213
COPY . .
1314
WORKDIR "/src/DisBot.Dashboard"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Diagnostics.CodeAnalysis;
2+
using Riok.Mapperly.Abstractions;
3+
using Shared.Models.Http.Requests;
4+
using Shared.Models.Http.Responses.User;
5+
6+
namespace DisBot.Dashboard.Mappers;
7+
8+
[Mapper]
9+
[SuppressMessage("Mapper", "RMG020:No members are mapped in an object mapping")]
10+
[SuppressMessage("Mapper", "RMG012:No members are mapped in an object mapping")]
11+
public static partial class UserMapper
12+
{
13+
public static partial UpdateUserDto ToUpdate(UserDto dto);
14+
}

DisBot.Dashboard/Pages/Counter.razor

Lines changed: 0 additions & 19 deletions
This file was deleted.

DisBot.Dashboard/Pages/Weather.razor

Lines changed: 0 additions & 60 deletions
This file was deleted.

DisBot.Dashboard/Program.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
using Microsoft.AspNetCore.Components.Web;
21
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
3-
using DisBot.Dashboard;
2+
using DisBot.Dashboard.Startup;
43

5-
var builder = WebAssemblyHostBuilder.CreateDefault(args);
6-
builder.RootComponents.Add<App>("#app");
7-
builder.RootComponents.Add<HeadOutlet>("head::after");
4+
public static class Program
5+
{
6+
public static async Task Main(String[] args)
7+
{
8+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
89

9-
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
10+
builder.PerformPreBuild();
1011

11-
await builder.Build().RunAsync();
12+
await builder.Build().RunAsync();
13+
}
14+
}

0 commit comments

Comments
 (0)