mirror of
https://github.com/alexhopeoconnor/dnsmasq-webui.git
synced 2026-10-03 22:12:00 +10:00
Fix RestartTimeoutSeconds default; order-aware multi-value diff in save modal
- DnsmasqOptions: set RestartTimeoutSeconds default to 30 to match XML comment and original reload timeout (avoids halving timeout for restart/reload). - Save modal: multi-value diff no longer uses set-only Except(); when lists have same items but different order (or duplicate count), show 'Order or duplicates changed' with before/after so reorders (e.g. server=) are visible.
This commit is contained in:
@@ -122,16 +122,28 @@
|
||||
</div>
|
||||
@if (isMultiValue)
|
||||
{
|
||||
var added = (newList ?? Array.Empty<string>()).Except(oldList ?? Array.Empty<string>()).ToList();
|
||||
var removed = (oldList ?? Array.Empty<string>()).Except(newList ?? Array.Empty<string>()).ToList();
|
||||
var oldSeq = oldList ?? Array.Empty<string>();
|
||||
var newSeq = newList ?? Array.Empty<string>();
|
||||
var added = newSeq.Except(oldSeq).ToList();
|
||||
var removed = oldSeq.Except(newSeq).ToList();
|
||||
var orderOrDuplicatesChanged = added.Count == 0 && removed.Count == 0 && !oldSeq.SequenceEqual(newSeq, StringComparer.Ordinal);
|
||||
<div class="ec-save-modal-multidiff ps-3 mt-1 small">
|
||||
@foreach (var val in removed)
|
||||
@if (orderOrDuplicatesChanged)
|
||||
{
|
||||
<div class="text-muted text-decoration-line-through">− @val</div>
|
||||
<div class="text-muted">Order or duplicates changed:</div>
|
||||
<div class="text-muted text-decoration-line-through">Before: @string.Join(", ", oldSeq)</div>
|
||||
<div class="text-success">After: @string.Join(", ", newSeq)</div>
|
||||
}
|
||||
@foreach (var val in added)
|
||||
else
|
||||
{
|
||||
<div class="text-success">+ @val</div>
|
||||
@foreach (var val in removed)
|
||||
{
|
||||
<div class="text-muted text-decoration-line-through">− @val</div>
|
||||
}
|
||||
@foreach (var val in added)
|
||||
{
|
||||
<div class="text-success">+ @val</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class DnsmasqOptions
|
||||
// --- Timeouts (seconds) for the commands above ---
|
||||
|
||||
/// <summary>Timeout in seconds for <see cref="RestartCommand"/> / <see cref="ReloadCommand"/>. Default 30.</summary>
|
||||
public int RestartTimeoutSeconds { get; set; } = 15;
|
||||
public int RestartTimeoutSeconds { get; set; } = 30;
|
||||
|
||||
/// <summary>Timeout in seconds for <see cref="StatusCommand"/>. Default 5.</summary>
|
||||
public int StatusTimeoutSeconds { get; set; } = 5;
|
||||
|
||||
Reference in New Issue
Block a user