mirror of
https://github.com/alexhopeoconnor/dnsmasq-webui.git
synced 2026-10-13 15:31:17 +10:00
- Hosts: delete confirmation modal, shift range select, keyboard shortcuts, effective-name suffix tooltips, conditional modern header actions - Align EffectiveNames on rows with scoped domain= + pending preview; unified hosts API uses full DomainValues from config snapshot - Harden Blazor JS interop (safe helpers, IAsyncDisposable, disposal order) - Effective config: domain multi-value display/editor, parsers, tests - Misc: docs/testdata/docker script updates
23 lines
977 B
Plaintext
23 lines
977 B
Plaintext
@namespace DnsmasqWebUI.Components.EffectiveConfig
|
|
@using DnsmasqWebUI.Extensions.Interop
|
|
@inject IJSRuntime JSRuntime
|
|
|
|
<div class="d-flex align-items-center gap-1 @CssClass">
|
|
<code class="flex-grow-1 text-break @CodeCssClass">@Text</code>
|
|
<button type="button" class="btn btn-sm btn-outline-secondary py-0" @onclick="CopyAsync" title="@CopyTitle"><i class="bi bi-clipboard me-1" aria-hidden="true"></i>Copy</button>
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter] public string Text { get; set; } = "";
|
|
[Parameter] public string? CssClass { get; set; }
|
|
[Parameter] public string? CodeCssClass { get; set; }
|
|
[Parameter] public string CopyTitle { get; set; } = "Copy";
|
|
|
|
private async Task CopyAsync()
|
|
{
|
|
if (string.IsNullOrEmpty(Text)) return;
|
|
// window.copyToClipboard from wwwroot/js/copy-to-clipboard.js; swallow disconnect / clipboard failures.
|
|
await JSRuntime.InvokeVoidAsyncSafe("copyToClipboard", args: new object?[] { Text });
|
|
}
|
|
}
|