604bfe919c
Apply comprehensive fixes from code reviews including: - Extract shared utilities (SqlFormatHelper, CellValueConverter, DbDestinationBase) - Add interface abstractions (IAuthenticationService, IDatabaseMigrator, IMisQueryBuilder) - Implement SecureStore for encrypted secrets storage - Fix error handling with proper HTTP status codes and logging - Optimize double enumeration in DevEtlRegistry - Add DataSync.Dev README for developer onboarding - Extract filter panel base classes to reduce duplication - Update code review docs to mark all issues as fixed
102 lines
2.8 KiB
Plaintext
102 lines
2.8 KiB
Plaintext
@namespace JdeScoping.Client.Components.Admin
|
|
@using JdeScoping.Client.Helpers
|
|
@inject IJSRuntime JS
|
|
|
|
@if (Visible)
|
|
{
|
|
<div class="sql-modal-overlay" @onclick="Close">
|
|
<div class="sql-modal-content" @onclick:stopPropagation="true">
|
|
<div class="sql-modal-header">
|
|
<RadzenText TextStyle="TextStyle.H5" class="rz-m-0">@Title</RadzenText>
|
|
<RadzenButton Icon="close" ButtonStyle="ButtonStyle.Light" Size="ButtonSize.Small" Click="Close" />
|
|
</div>
|
|
<div class="sql-modal-body">
|
|
<pre>@FormattedSql</pre>
|
|
</div>
|
|
<div class="sql-modal-footer">
|
|
<RadzenButton Text="Copy to Clipboard" Icon="content_copy" ButtonStyle="ButtonStyle.Secondary" Click="CopyToClipboard" class="rz-mr-2" />
|
|
<RadzenButton Text="Close" Click="Close" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
<style>
|
|
.sql-modal-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: rgba(0, 0, 0, 0.5);
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
z-index: 1000;
|
|
}
|
|
|
|
.sql-modal-content {
|
|
background: white;
|
|
border-radius: 8px;
|
|
width: 80vw;
|
|
max-width: 1200px;
|
|
max-height: 80vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
.sql-modal-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 1rem 1.5rem;
|
|
border-bottom: 1px solid #dee2e6;
|
|
}
|
|
|
|
.sql-modal-body {
|
|
flex: 1;
|
|
overflow: auto;
|
|
padding: 1.5rem;
|
|
background: #f8f9fa;
|
|
}
|
|
|
|
.sql-modal-body pre {
|
|
margin: 0;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
|
font-size: 0.875rem;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.sql-modal-footer {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
padding: 1rem 1.5rem;
|
|
border-top: 1px solid #dee2e6;
|
|
}
|
|
</style>
|
|
|
|
@code {
|
|
[Parameter] public bool Visible { get; set; }
|
|
[Parameter] public EventCallback<bool> VisibleChanged { get; set; }
|
|
[Parameter] public string? Title { get; set; }
|
|
[Parameter] public string? Sql { get; set; }
|
|
|
|
private string FormattedSql => SqlFormatHelper.FormatSql(Sql);
|
|
|
|
private async Task CopyToClipboard()
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(Sql))
|
|
{
|
|
await JS.InvokeVoidAsync("navigator.clipboard.writeText", Sql);
|
|
}
|
|
}
|
|
|
|
private async Task Close()
|
|
{
|
|
await VisibleChanged.InvokeAsync(false);
|
|
}
|
|
}
|