Skip to content

Commit

Permalink
Updated home page into TgDownloaderBlazor
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianMorozov committed Mar 4, 2024
1 parent e95115d commit 63b71eb
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 27 deletions.
1 change: 0 additions & 1 deletion Clients/TgDownloaderBlazor/Pages/Error.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;

namespace TgDownloaderBlazor.Pages;
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
Expand Down
53 changes: 46 additions & 7 deletions Clients/TgDownloaderBlazor/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,49 @@

<PageTitle>@TgLocale.AppTitleBlazor</PageTitle>

<h1>@AppUtils.AppVersionTitle</h1>

@*
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
<RadzenButton Click="ButtonIncrement" Text="Click me"></RadzenButton>
*@
<RadzenStack>
@* Buttons *@
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="12" SizeMD="6">
<RadzenButton style="width: 100%; " Icon="refresh" Click="ResetToDefault" Text="@TgLocale.HomeResetToDefault"></RadzenButton>
</RadzenColumn>
<RadzenColumn Size="12" SizeMD="6">
<RadzenButton style="width: 100%; " Icon="save" Click="SaveToXml" Text="@TgLocale.HomeSaveToXml"></RadzenButton>
</RadzenColumn>
</RadzenRow>
@* Titles *@
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="12" SizeMD="2">
<RadzenText Text="@TgLocale.SettingName" TextStyle="TextStyle.DisplayH6" style="margin: 0"/>
</RadzenColumn>
<RadzenColumn Size="12" SizeMD="1">
<RadzenText Text="@TgLocale.SettingCheck" TextStyle="TextStyle.DisplayH6" style="margin: 0" />
</RadzenColumn>
<RadzenColumn Size="12" SizeMD="9">
<RadzenText Text="@TgLocale.SettingValue" TextStyle="TextStyle.DisplayH6" style="margin: 0" />
</RadzenColumn>
</RadzenRow>
@* Values *@
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="12" SizeMD="2">
<RadzenText Text="@TgLocale.FileSession" TextStyle="TextStyle.Body1" style="margin: 0" />
</RadzenColumn>
<RadzenColumn Size="12" SizeMD="1">
<RadzenCheckBox Value="@TgAppSettings.AppXml.IsExistsFileSession" Disabled="true"/>
</RadzenColumn>
<RadzenColumn Size="12" SizeMD="9">
<RadzenTextBox @bind-Value="@TgAppSettings.AppXml.FileSession" style="width: 100%; " />
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="12" SizeMD="2">
<RadzenText Text="@TgLocale.FileStorage" TextStyle="TextStyle.Body1" style="margin: 0" />
</RadzenColumn>
<RadzenColumn Size="12" SizeMD="1">
<RadzenCheckBox Value="@TgAppSettings.AppXml.IsExistsFileStorage" Disabled="true"/>
</RadzenColumn>
<RadzenColumn Size="12" SizeMD="9">
<RadzenTextBox @bind-Value="@TgAppSettings.AppXml.FileStorage" style="width: 100%; " />
</RadzenColumn>
</RadzenRow>
</RadzenStack>
14 changes: 7 additions & 7 deletions Clients/TgDownloaderBlazor/Pages/Index.razor.cs
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
// 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

using System;

namespace TgDownloaderBlazor.Pages;

public sealed partial class Index
{
#region Public and private fields, properties, constructor

private int currentCount = 0;
public TgAppSettingsHelper TgAppSettings => TgAppSettingsHelper.Instance;

#endregion

#region Public and private methods

private void IncrementCount()
private async Task ResetToDefault(MouseEventArgs arg)
{
currentCount++;
await Task.Delay(TimeSpan.FromMilliseconds(1));
TgAppSettings.DefaultXmlSettings();
}

private async Task ButtonIncrement(MouseEventArgs arg)
private async Task SaveToXml(MouseEventArgs arg)
{
await Task.Delay(TimeSpan.FromMilliseconds(1));
currentCount++;
TgAppSettings.StoreXmlSettingsUnsafe();
TgAppSettings.LoadXmlSettings();
}

#endregion
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion Clients/TgDownloaderBlazor/TgDownloaderBlazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<UserSecretsId>acec7ca6-caa9-470e-96aa-3f14f080d6bd</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Clients/TgDownloaderConsole/TgDownloaderConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<Platforms>AnyCPU;x64;x86</Platforms>
<ApplicationIcon>applicationIcon.ico</ApplicationIcon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>applicationIcon.ico</ApplicationIcon>
<Platforms>AnyCPU;x64;x86</Platforms>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
</PropertyGroup>
<ItemGroup>
<Content Include="applicationIcon.ico" />
Expand Down
2 changes: 1 addition & 1 deletion Core/TgDownloader/TgDownloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Core/TgEfCore/TgEfCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Core/TgLocalization/TgLocalization.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CodingSeb.Localization" Version="1.3.0" />
Expand Down
2 changes: 1 addition & 1 deletion Core/TgStorage/TgStorage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Tests/TgAssertCoreTests/TgAssertCoreTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Tests/TgDownloaderTest/TgDownloaderTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Tests/TgEfCoreTests/TgEfCoreTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Tests/TgStorageTest/TgStorageTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<Version>0.4.100.0</Version>
<Version>0.4.110.0</Version>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>
<ItemGroup>
Expand Down

0 comments on commit 63b71eb

Please sign in to comment.