-
-
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 Sources page into TgDownloaderBlazor
- Loading branch information
1 parent
6fa8568
commit d886de9
Showing
114 changed files
with
2,503 additions
and
974 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,30 @@ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md | ||
!**/.gitignore | ||
!.git/HEAD | ||
!.git/config | ||
!.git/packed-refs | ||
!.git/refs/heads/** |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Router AppAssembly="@typeof(App).Assembly"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(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> |
13 changes: 13 additions & 0 deletions
13
Clients/TgDownloaderBlazor/Common/TgLayoutComponentBase.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,13 @@ | ||
// 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.Common; | ||
|
||
public class TgLayoutComponentBase : LayoutComponentBase | ||
{ | ||
#region Public and private fields, properties, constructor | ||
|
||
[Inject] protected NavigationManager UriHelper { get; set; } = default!; | ||
|
||
#endregion | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// 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.Common; | ||
|
||
public abstract class TgPageComponentBase : ComponentBase | ||
{ | ||
#region Public and private fields, properties, constructor | ||
|
||
[Inject] protected IJSRuntime JsRuntime { get; set; } = default!; | ||
[Inject] protected NavigationManager UriHelper { get; set; } = default!; | ||
[Inject] protected DialogService DialogService { get; set; } = default!; | ||
[Inject] protected TooltipService TooltipService { get; set; } = default!; | ||
[Inject] protected ContextMenuService ContextMenuService { get; set; } = default!; | ||
[Inject] protected NotificationService NotificationService { get; set; } = default!; | ||
[Inject] public IDbContextFactory<TgEfContext> DbFactory { get; set; } = default!; | ||
|
||
protected virtual TgLocaleHelper TgLocale => TgLocaleHelper.Instance; | ||
protected virtual bool IsLoading { get; set; } = true; | ||
|
||
#endregion | ||
} |
23 changes: 23 additions & 0 deletions
23
Clients/TgDownloaderBlazor/Common/TgPageComponentEnumerable.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,23 @@ | ||
// 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.Common; | ||
|
||
public abstract class TgPageComponentEnumerable<TEntity> : TgPageComponentBase where TEntity : TgEfEntityBase, new() | ||
{ | ||
#region Public and private fields, properties, constructor | ||
|
||
protected RadzenDataGrid<TEntity> Grid { get; set; } = new(); | ||
protected string SearchString { get; set; } = string.Empty; | ||
protected IEnumerable<TEntity> Items { get; set; } = new List<TEntity>(); | ||
protected int ItemsCount { get; set; } | ||
protected string ItemsSummaryString => $"{TgLocale.FoundRows}: {ItemsCount}"; | ||
|
||
#endregion | ||
|
||
#region Public and private methods | ||
|
||
// | ||
|
||
#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,21 @@ | ||
// 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.Common; | ||
|
||
public abstract class TgPageComponentItem<TEntity> : TgPageComponentBase where TEntity : TgEfEntityBase, new() | ||
{ | ||
#region Public and private fields, properties, constructor | ||
|
||
[Parameter] public string Uid { get; set; } = string.Empty; | ||
protected TEntity Item { get; set; } = new(); | ||
protected string ItemSummaryString => Item.ToDebugString(); | ||
|
||
#endregion | ||
|
||
#region Public and private methods | ||
|
||
// | ||
|
||
#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,24 @@ | ||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["Clients/TgDownloaderBlazor/TgDownloaderBlazor.csproj", "Clients/TgDownloaderBlazor/"] | ||
RUN dotnet restore "./Clients/TgDownloaderBlazor/TgDownloaderBlazor.csproj" | ||
COPY . . | ||
WORKDIR "/src/Clients/TgDownloaderBlazor" | ||
RUN dotnet build "./TgDownloaderBlazor.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "./TgDownloaderBlazor.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "TgDownloaderBlazor.dll"] |
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
Clients/TgDownloaderBlazor/Features/Apps/AppComponent.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,63 @@ | ||
@page "/apps" | ||
@inherits TgPageComponentEnumerable<TgEfAppEntity> | ||
|
||
<PageTitle>@TgLocale.MenuMainApps</PageTitle> | ||
|
||
@if (IsLoading) | ||
{ | ||
<p><em>Loading...</em></p> | ||
} | ||
else | ||
{ | ||
<RadzenStack> | ||
<RadzenRow AlignItems="AlignItems.Center"> | ||
<RadzenColumn Size="12" SizeMD="6"> | ||
<RadzenText Text="@TgLocale.MenuMainApps" TextStyle="TextStyle.H4" TagName="TagName.H1" style="margin: 0" /> | ||
</RadzenColumn> | ||
@* | ||
<RadzenColumn Size="12" SizeMD="6"> | ||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.End" Gap="0.5rem"> | ||
<RadzenSplitButton Icon="get_app" Text="Export" Click="@ExportClick" Variant="Variant.Flat" Shade="Shade.Lighter"> | ||
<RadzenSplitButtonItem Text="Excel" Value="xlsx" /> | ||
<RadzenSplitButtonItem Text="CSV" Value="csv" /> | ||
</RadzenSplitButton> | ||
<RadzenButton Icon="add_circle_outline" Text="Add" Click="@AddButtonClick" Variant="Variant.Flat" /> | ||
</RadzenStack> | ||
</RadzenColumn> | ||
*@ | ||
</RadzenRow> | ||
<RadzenRow> | ||
<RadzenLabel Text="@ItemsSummaryString"></RadzenLabel> | ||
</RadzenRow> | ||
@* <RadzenTextBox Placeholder="Search ..." style="display: block; width: 100%" @oninput="@SearchString" /> *@ | ||
@* | ||
<RadzenDataGrid @ref="Grid" ColumnWidth="200px" | ||
Data="@Items" TItem="TgEfAppEntity" LoadData="@GridLoadData" Count="@ItemsCount" | ||
AllowFiltering="true" FilterMode="FilterMode.Advanced" AllowPaging="true" AllowSorting="true" | ||
ShowPagingSummary="true" PageSizeOptions=@(new int[]{5, 10, 20, 30}) | ||
RowDoubleClick="@EditRow" | ||
> | ||
*@ | ||
<RadzenRow> | ||
<RadzenColumn SizeMD=12> | ||
<RadzenDataGrid @ref="Grid" ColumnWidth="200px" | ||
Data="@Items" TItem="TgEfAppEntity" LoadData="@GridLoadData" Count="@ItemsCount" > | ||
<Columns> | ||
<RadzenDataGridColumn TItem="TgEfAppEntity" Property=@nameof(TgEfAppEntity.ApiHash) Title="@TgLocale.MenuClientApiHash" /> | ||
<RadzenDataGridColumn TItem="TgEfAppEntity" Property=@nameof(TgEfAppEntity.ApiId) Title="@TgLocale.MenuClientApiId" /> | ||
<RadzenDataGridColumn TItem="TgEfAppEntity" Property=@nameof(TgEfAppEntity.PhoneNumber) Title="@TgLocale.MenuClientPhoneNumber" /> | ||
<RadzenDataGridColumn TItem="TgEfAppEntity" Property="Proxy.HostName" Title="@TgLocale.MenuClientProxy" /> | ||
@* <RadzenDataGridColumn TItem="TgEfAppEntity" Filterable="false" Sortable="false" Width="70px" TextAlign="TextAlign.Center"> | ||
<Template Context="app"> | ||
<RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Size="ButtonSize.Medium" | ||
Shade="Shade.Lighter" Variant="Variant.Flat" | ||
Click=@(args => GridDeleteButtonClick(args, app)) @onclick:stopPropagation="true" /> | ||
</Template> | ||
</RadzenDataGridColumn> *@ | ||
</Columns> | ||
</RadzenDataGrid> | ||
</RadzenColumn> | ||
</RadzenRow> | ||
</RadzenStack> | ||
} |
Oops, something went wrong.