mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-22 20:42:24 +00:00
Partial .net9 upgrade
This commit is contained in:
@@ -10,11 +10,14 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FluentAssertions" Version="7.0.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="7.1.0" AllowedVersions="[5.0.0,7.*.*)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||
<PackageReference Include="MudBlazor" Version="8.2.0" />
|
||||
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
|
||||
<PackageReference Include="xunit" Version="2.9.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
|
||||
<PackageReference Include="xunit" Version="2.9.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@@ -8,7 +8,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class AddPeerDialog
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
public IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
protected HashSet<PeerId> Peers { get; } = [];
|
||||
|
||||
|
@@ -14,7 +14,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
protected IDialogService DialogService { get; set; } = default!;
|
||||
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
protected HashSet<string> Tags { get; } = [];
|
||||
|
||||
|
@@ -8,7 +8,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class AddTorrentFileDialog
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
protected IReadOnlyList<IBrowserFile> Files { get; set; } = [];
|
||||
|
||||
|
@@ -18,7 +18,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
protected IKeyboardService KeyboardService { get; set; } = default!;
|
||||
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string? Url { get; set; }
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<MudGrid>
|
||||
<MudItem xs="12">
|
||||
<MudSwitch Label="Additional Options" @bind-Value="Expanded" LabelPosition="LabelPosition.End" />
|
||||
<MudSwitch Label="Additional Options" @bind-Value="Expanded" LabelPlacement="Placement.End" />
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
<MudCollapse Expanded="Expanded">
|
||||
|
@@ -1,6 +1,7 @@
|
||||
using Lantean.QBitTorrentClient;
|
||||
using Lantean.QBTMud.Models;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
|
||||
namespace Lantean.QBTMud.Components.Dialogs
|
||||
{
|
||||
|
@@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class AddTrackerDialog
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
protected HashSet<string> Trackers { get; } = [];
|
||||
|
||||
|
@@ -10,7 +10,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
private string _savePath = string.Empty;
|
||||
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Inject]
|
||||
protected IApiClient ApiClient { get; set; } = default!;
|
||||
|
@@ -10,7 +10,7 @@
|
||||
var column = Columns[i];
|
||||
var index = i;
|
||||
<MudItem xs="7">
|
||||
<MudCheckBox T="bool" ValueChanged="@(c => SetSelected(c, column.Id))" Label="@column.Header" LabelPosition="LabelPosition.End" Value="@(SelectedColumnsInternal.Contains(column.Id))" />
|
||||
<MudCheckBox T="bool" ValueChanged="@(c => SetSelected(c, column.Id))" Label="@column.Header" LabelPlacement="Placement.End" Value="@(SelectedColumnsInternal.Contains(column.Id))" />
|
||||
</MudItem>
|
||||
<MudItem xs="3">
|
||||
<MudTextField T="string" Value="@(GetValue(column.Width, column.Id))" ValueChanged="@(c => SetWidth(c, column.Id))" Label="Width" Variant="Variant.Text" HelperText="px" Adornment="Adornment.End" AdornmentIcon="@Icons.Material.Outlined.WidthNormal" OnAdornmentClick="@(c => SetWidth("auto", column.Id))" />
|
||||
|
@@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class ColumnOptionsDialog<T>
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
[EditorRequired]
|
||||
|
@@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class ConfirmDialog
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string Content { get; set; } = default!;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
<MudGrid>
|
||||
<MudItem xs="12">
|
||||
<MudCheckBox Label="Also permanently delete the files" @bind-Value="DeleteFiles" LabelPosition="LabelPosition.End" />
|
||||
<MudCheckBox Label="Also permanently delete the files" @bind-Value="DeleteFiles" LabelPlacement="Placement.End" />
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</DialogContent>
|
||||
|
@@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class DeleteDialog
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public int Count { get; set; }
|
||||
|
@@ -6,7 +6,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class ExceptionDialog
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public Exception? Exception { get; set; }
|
||||
|
@@ -11,7 +11,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
private static readonly IReadOnlyList<PropertyInfo> _properties = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public);
|
||||
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
protected IReadOnlyList<PropertyInfo> Columns => _properties;
|
||||
|
||||
|
@@ -14,7 +14,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
protected IDialogService DialogService { get; set; } = default!;
|
||||
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public IEnumerable<string> Hashes { get; set; } = [];
|
||||
|
@@ -14,7 +14,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
protected IDialogService DialogService { get; set; } = default!;
|
||||
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public IEnumerable<string> Hashes { get; set; } = [];
|
||||
|
@@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class MultipleFieldDialog
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string Label { get; set; } = default!;
|
||||
|
@@ -8,7 +8,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class NumericFieldDialog<T> where T : struct, INumber<T>
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string? Label { get; set; }
|
||||
|
@@ -30,7 +30,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
protected ILocalStorageService LocalStorage { get; set; } = default!;
|
||||
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string? Hash { get; set; }
|
||||
|
@@ -10,7 +10,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
private readonly List<string> _unsavedRuleNames = [];
|
||||
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Inject]
|
||||
protected IDialogService DialogService { get; set; } = default!;
|
||||
|
@@ -8,7 +8,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class ShareRatioDialog
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string? Label { get; set; }
|
||||
|
@@ -8,7 +8,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class SliderFieldDialog<T> where T : struct, INumber<T>
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string? Label { get; set; }
|
||||
|
@@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class StringFieldDialog
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string? Label { get; set; }
|
||||
|
@@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class SubMenuDialog
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public UIAction? ParentAction { get; set; }
|
||||
|
@@ -7,7 +7,7 @@ namespace Lantean.QBTMud.Components.Dialogs
|
||||
public partial class TorrentOptionsDialog
|
||||
{
|
||||
[CascadingParameter]
|
||||
public MudDialogInstance MudDialog { get; set; } = default!;
|
||||
IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
[EditorRequired]
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<ContextMenu @ref="StatusContextMenu" Dense="true" AdjustmentY="-60">
|
||||
<ContextMenu @ref="StatusContextMenu" Dense="true" AdjustmentY="-60" FullWidth="false">
|
||||
@TorrentControls(_statusType)
|
||||
</ContextMenu>
|
||||
|
||||
|
@@ -63,7 +63,7 @@ namespace Lantean.QBTMud.Components
|
||||
public QBitTorrentClient.Models.Preferences? Preferences { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public MudDialogInstance? MudDialog { get; set; }
|
||||
public IMudDialogInstance? MudDialog { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public UIAction? ParentAction { get; set; }
|
||||
@@ -441,7 +441,7 @@ namespace Lantean.QBTMud.Components
|
||||
thereAreFirstLastPiecePrio = true;
|
||||
}
|
||||
|
||||
if (torrent.Progress != 1.0) // not downloaded
|
||||
if (torrent.Progress > 0.999999) // not downloaded
|
||||
{
|
||||
allAreDownloaded = false;
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
MaxHeight="@MaxHeight"
|
||||
AnchorOrigin="@AnchorOrigin"
|
||||
TransformOrigin="TransformOrigin"
|
||||
RelativeWidth="@FullWidth"
|
||||
RelativeWidth="@(FullWidth ? DropdownWidth.Relative : DropdownWidth.Adaptive)"
|
||||
OverflowBehavior="OverflowBehavior.FlipAlways"
|
||||
Style="@_popoverStyle"
|
||||
@ontouchend:preventDefault>
|
||||
|
@@ -7,12 +7,6 @@ using MudBlazor.Utilities;
|
||||
|
||||
namespace Lantean.QBTMud.Components.UI
|
||||
{
|
||||
// This is a very hacky approach but works for now.
|
||||
// This needs to inherit from MudMenu because MudMenuItem needs a MudMenu passed to it to control the close of the menu when an item is clicked.
|
||||
// MudPopover isn't ideal for this because that is designed to be used relative to an activator which in these cases it isn't.
|
||||
// Ideally this should be changed to use something like the way the DialogService works.
|
||||
|
||||
// Or - rework this to have a hidden MudMenu and hook into the OpenChanged event to monitor when the MudMenuItem closes it.
|
||||
public partial class ContextMenu : MudComponentBase
|
||||
{
|
||||
private bool _open;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<div class="@Classname">
|
||||
<div @onclick="EventUtil.AsNonRenderingEventHandler<MouseEventArgs>(OnClickHandler)" class="@LinkClassname" @onlongpress="OnLongPressInternal" @oncontextmenu="OnContextMenuInternal" @oncontextmenu:preventDefault>
|
||||
<div @onclick="this.AsNonRenderingEventHandler<MouseEventArgs>(OnClickHandler)" class="@LinkClassname" @onlongpress="OnLongPressInternal" @oncontextmenu="OnContextMenuInternal" @oncontextmenu:preventDefault>
|
||||
@if (!string.IsNullOrEmpty(Icon))
|
||||
{
|
||||
<MudIcon Icon="@Icon" Color="@IconColor" Class="@IconClassname" />
|
||||
|
@@ -12,13 +12,13 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
|
||||
<PackageReference Include="ByteSize" Version="2.1.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.0" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.0" />
|
||||
<PackageReference Include="MudBlazor" Version="7.15.0" />
|
||||
<PackageReference Include="MudBlazor.ThemeManager" Version="2.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.1" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.1" />
|
||||
<PackageReference Include="MudBlazor" Version="8.2.0" />
|
||||
<PackageReference Include="MudBlazor.ThemeManager" Version="3.0.0" />
|
||||
<!-- added to fix vuln in dependency -->
|
||||
<PackageReference Include="System.Text.Json" Version="9.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="9.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Error" Color="Color.Default" OnClick="ToggleErrorDrawer" />
|
||||
</MudBadge>
|
||||
}
|
||||
<MudSwitch T="bool" Label="Dark Mode" LabelPosition="LabelPosition.End" Value="IsDarkMode" ValueChanged="DarkModeChanged" Class="pl-3" />
|
||||
<MudSwitch T="bool" Label="Dark Mode" LabelPlacement="Placement.End" Value="IsDarkMode" ValueChanged="DarkModeChanged" Class="pl-3" />
|
||||
<Menu @ref="Menu" />
|
||||
</MudAppBar>
|
||||
<MudDrawer Open="ErrorDrawerOpen" ClipMode="DrawerClipMode.Docked" Elevation="2" Anchor="Anchor.Right">
|
||||
|
@@ -49,7 +49,7 @@ namespace Lantean.QBTMud.Pages
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
return DoLogin("admin", "eBGJzbjkJ");
|
||||
return DoLogin("admin", "cIYfeJr49");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1,7 +1,7 @@
|
||||
@page "/"
|
||||
@layout ListLayout
|
||||
|
||||
<ContextMenu @ref="ContextMenu" Dense="true" AdjustmentX="@(DrawerOpen ? -235 : 0)">
|
||||
<ContextMenu @ref="ContextMenu" Dense="true" FullWidth="false">
|
||||
<MudMenuItem Icon="@Icons.Material.Outlined.Info" IconColor="Color.Inherit" OnClick="ShowTorrentContextMenu">View torrent details</MudMenuItem>
|
||||
<MudDivider />
|
||||
<TorrentActions RenderType="RenderType.MenuItems" Hashes="GetContextMenuTargetHashes()" PrimaryHash="@(ContextMenuItem?.Hash)" Torrents="MainData.Torrents" Preferences="Preferences" />
|
||||
|
11
nuget.config
Normal file
11
nuget.config
Normal file
@@ -0,0 +1,11 @@
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<!-- Define package sources here -->
|
||||
</packageSources>
|
||||
<packageSourceMapping>
|
||||
<!-- Optional source mapping -->
|
||||
</packageSourceMapping>
|
||||
<packageVersionOverride>
|
||||
<package id="FluentAssertions" allowedVersions="[7.0.0,8.0.0)" />
|
||||
</packageVersionOverride>
|
||||
</configuration>
|
Reference in New Issue
Block a user