fix: Implement object equality for CaddyConfigurationInfo to enable list selection
All checks were successful
Caddy Manager CI build / docker (push) Successful in 1m0s
All checks were successful
Caddy Manager CI build / docker (push) Successful in 1m0s
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
@using CaddyManager.Models.Caddy
|
@using CaddyManager.Models.Caddy
|
||||||
@attribute [StreamRendering]
|
@attribute [StreamRendering]
|
||||||
|
|
||||||
<MudListItem T="CaddyConfigurationInfo" Text="@ConfigurationInfo.FileName" OnClick="Edit" OnClickPreventDefault="true">
|
<MudListItem T="CaddyConfigurationInfo" Text="@ConfigurationInfo.FileName" Value="@ConfigurationInfo" OnClick="Edit" OnClickPreventDefault="true">
|
||||||
<MudStack Row AlignItems="AlignItems.Center" Class="pl-2">
|
<MudStack Row AlignItems="AlignItems.Center" Class="pl-2">
|
||||||
<MudIcon Icon="@Icons.Custom.FileFormats.FileCode"></MudIcon>
|
<MudIcon Icon="@Icons.Custom.FileFormats.FileCode"></MudIcon>
|
||||||
<MudText>@ConfigurationInfo.FileName</MudText>
|
<MudText>@ConfigurationInfo.FileName</MudText>
|
||||||
|
|||||||
@@ -29,4 +29,16 @@ public class CaddyConfigurationInfo
|
|||||||
/// Aggregated ports for the reverse proxy hostname from all configurations.
|
/// Aggregated ports for the reverse proxy hostname from all configurations.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<int> AggregatedReverseProxyPorts { get; set; } = [];
|
public List<int> AggregatedReverseProxyPorts { get; set; } = [];
|
||||||
|
|
||||||
|
public override bool Equals(object? obj)
|
||||||
|
{
|
||||||
|
if (obj is not CaddyConfigurationInfo other)
|
||||||
|
return false;
|
||||||
|
return FileName == other.FileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return FileName.GetHashCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user