f3386d0278
Single /deployment/topology page replaces /deployment/instances (legacy URL preserved as a secondary @page directive) and the /admin/areas* CRUD pages. TreeView with Site → Area → Instance, V1–V7 visual guide (bi-building / bi-diagram-3 / bi-box), always-visible empty containers, search dim, F2 inline area rename, and right-click context menus per node kind (Add Area, Move to Area…, lifecycle actions, etc.). Adds AreaService.MoveAreaAsync with cycle prevention, same-site enforcement, and name-collision check at the new parent. Instance rename intentionally out of scope — UniqueName is the site-side actor identity, requires its own design pass.
54 lines
2.2 KiB
Plaintext
54 lines
2.2 KiB
Plaintext
@if (IsVisible)
|
|
{
|
|
<div class="modal show d-block" tabindex="-1" style="background: rgba(0,0,0,0.4);">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h6 class="modal-title">Move '@InstanceName' to…</h6>
|
|
<button type="button" class="btn-close" @onclick="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<select class="form-select form-select-sm" @bind="_targetAreaId">
|
|
@foreach (var opt in AreaOptions)
|
|
{
|
|
<option value="@opt.Id">@opt.Label</option>
|
|
}
|
|
</select>
|
|
@if (!string.IsNullOrEmpty(ErrorMessage)) { <div class="text-danger small mt-1">@ErrorMessage</div> }
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button class="btn btn-outline-secondary btn-sm" @onclick="Close">Cancel</button>
|
|
<button class="btn btn-primary btn-sm" @onclick="Submit">Move</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
@code {
|
|
[Parameter] public bool IsVisible { get; set; }
|
|
[Parameter] public EventCallback<bool> IsVisibleChanged { get; set; }
|
|
[Parameter] public int InstanceId { get; set; }
|
|
[Parameter] public string InstanceName { get; set; } = string.Empty;
|
|
[Parameter] public int? CurrentAreaId { get; set; }
|
|
[Parameter] public IEnumerable<(int? Id, string Label)> AreaOptions { get; set; } = Array.Empty<(int?, string)>();
|
|
[Parameter] public string? ErrorMessage { get; set; }
|
|
[Parameter] public EventCallback<(int InstanceId, int? NewAreaId)> OnSubmit { get; set; }
|
|
|
|
private bool _wasVisible;
|
|
private int? _targetAreaId;
|
|
|
|
protected override void OnParametersSet()
|
|
{
|
|
if (IsVisible && !_wasVisible)
|
|
{
|
|
_targetAreaId = CurrentAreaId;
|
|
}
|
|
_wasVisible = IsVisible;
|
|
}
|
|
|
|
private async Task Close() => await IsVisibleChanged.InvokeAsync(false);
|
|
|
|
private async Task Submit() => await OnSubmit.InvokeAsync((InstanceId, _targetAreaId));
|
|
}
|