Files
CaddyManager/CaddyManager/Components/Pages/Caddy/CaddyReverseProxies/CaddyReverseProxyItem.razor.cs
ebolo b5cbad3664
All checks were successful
Caddy Manager CI build / docker (push) Successful in 5m28s
refactor(caddy): centralize reverse proxy editor dialogs
2026-07-26 13:29:46 +07:00

28 lines
1.1 KiB
C#

using CaddyManager.Contracts.Models.Caddy;
using Microsoft.AspNetCore.Components;
namespace CaddyManager.Components.Pages.Caddy.CaddyReverseProxies;
/// <summary>
/// Caddy reverse proxy item component that displays the Caddy configuration file name along with other information
/// such as the number of hostnames and ports and allows the user to edit it
/// </summary>
public partial class CaddyReverseProxyItem : ComponentBase
{
/// <summary>
/// Callback asking the main page to open the editor for this configuration. The page owns the dialog so that it
/// can refresh the whole list afterwards, which matters when the configuration is renamed or deleted.
/// </summary>
[Parameter]
public EventCallback<string> OnEditRequested { get; set; }
[Parameter]
public CaddyConfigurationInfo ConfigurationInfo { get; set; } = null!;
/// <summary>
/// Request the Caddy file editor dialog for this configuration
/// </summary>
/// <returns></returns>
private Task Edit() => OnEditRequested.InvokeAsync(ConfigurationInfo.FileName);
}