-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Filter section into TgDownloaderBlazor
- Loading branch information
1 parent
1fe9883
commit 9b0aa4d
Showing
57 changed files
with
514 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"dotnet-ef": { | ||
"version": "8.0.2", | ||
"commands": [ | ||
"dotnet-ef" | ||
] | ||
} | ||
} | ||
} |
24 changes: 0 additions & 24 deletions
24
Clients/TgDownloaderBlazor/Components/Pages/HomeComponent.razor.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
24 changes: 24 additions & 0 deletions
24
Clients/TgDownloaderBlazor/Features/Home/HomeComponent.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// This is an independent project of an individual developer. Dear PVS-Studio, please check it. | ||
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com | ||
|
||
namespace TgDownloaderBlazor.Features.Home; | ||
|
||
public sealed partial class HomeComponent : TgPageComponent | ||
{ | ||
#region Public and private fields, properties, constructor | ||
|
||
public static string AppVersionTitle { get; set; } = string.Empty; | ||
public static string AppVersionShort { get; set; } = string.Empty; | ||
public static string AppVersionFull { get; set; } = string.Empty; | ||
|
||
public HomeComponent() | ||
{ | ||
AppVersionTitle = $"{TgLocale.AppTitleBlazor} " + | ||
$"v{TgCommonUtils.GetTrimVersion(Assembly.GetExecutingAssembly().GetName().Version)}"; | ||
AppVersionShort = $"v{TgCommonUtils.GetTrimVersion(Assembly.GetExecutingAssembly().GetName().Version)}"; | ||
AppVersionFull = $"{TgLocale.AppVersion}: {AppVersionShort}"; | ||
|
||
} | ||
|
||
#endregion | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@page "/Header" | ||
@inherits TgPageComponent | ||
|
||
<nav class="navbar mb-5 shadow"> | ||
<a class="navbar-brand" href="/"> | ||
@* <img src="/images/logo.png"></img> *@ | ||
</a> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace TgDownloaderBlazor.Features.Layout; | ||
|
||
public sealed partial class Header : TgPageComponent | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...zor/Components/Layout/MainLayout.razor.cs → ...lazor/Features/Layout/MainLayout.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Blazor/Components/Layout/NavMenu.razor.cs → ...erBlazor/Features/Layout/NavMenu.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
40 changes: 40 additions & 0 deletions
40
Clients/TgDownloaderBlazor/Features/Pages/FilterComponent.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@page "/filters" | ||
@inject IDbContextFactory<TgEfContext> DbFactory | ||
@inherits TgPageComponent | ||
|
||
<PageTitle>@TgLocale.MenuMainFilters</PageTitle> | ||
|
||
<h1>@TgLocale.MenuMainFilters</h1> | ||
|
||
@if (!Items.Any()) | ||
{ | ||
<p><em>Loading...</em></p> | ||
} | ||
else | ||
{ | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>@TgLocale.FieldIsEnabled</th> | ||
<th>@TgLocale.FieldFilterType</th> | ||
<th>@TgLocale.FieldName</th> | ||
<th>@TgLocale.FieldMask</th> | ||
<th>@TgLocale.FieldSize</th> | ||
<th>@TgLocale.FieldSizeType</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach (var item in Items) | ||
{ | ||
<tr> | ||
<td>@item.IsEnabled</td> | ||
<td>@item.FilterType</td> | ||
<td>@item.Name</td> | ||
<td>@item.Mask</td> | ||
<td>@item.Size</td> | ||
<td>@item.SizeType</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
} |
25 changes: 25 additions & 0 deletions
25
Clients/TgDownloaderBlazor/Features/Pages/FilterComponent.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// This is an independent project of an individual developer. Dear PVS-Studio, please check it. | ||
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com | ||
|
||
namespace TgDownloaderBlazor.Features.Pages; | ||
|
||
public partial class FilterComponent : TgPageComponent | ||
{ | ||
#region Public and private fields, properties, constructor | ||
|
||
private IList<TgEfFilterEntity> Items { get; set; } = new List<TgEfFilterEntity>(); | ||
|
||
#endregion | ||
|
||
#region Public and private methods | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
await base.OnInitializedAsync(); | ||
|
||
await using var dbContext = await DbFactory.CreateDbContextAsync(); | ||
Items = dbContext.FilterRepo.GetEnumerable(0).ToList(); | ||
} | ||
|
||
#endregion | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@using TgDownloaderBlazor.Features.Layout | ||
<Router AppAssembly="typeof(Program).Assembly"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" /> | ||
<FocusOnNavigate RouteData="routeData" Selector="h1" /> | ||
</Found> | ||
<NotFound> | ||
<PageTitle>Not found</PageTitle> | ||
<LayoutView Layout="@typeof(MainLayout)"> | ||
<p role="alert">Sorry, there's nothing at this address.'</p> | ||
</LayoutView> | ||
</NotFound> | ||
</Router> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.