Migrate remaining legacy operator workflows
This commit is contained in:
@@ -54,6 +54,8 @@ public sealed partial class MainWindow : Window
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
LogNativeOperatorStartup();
|
||||
EnsureCloseConfirmationAttached();
|
||||
InitializeManualOperatorDataRuntime();
|
||||
InitializeDatabaseRuntime();
|
||||
InitializePlayoutRuntime();
|
||||
@@ -100,6 +102,7 @@ public sealed partial class MainWindow : Window
|
||||
private async void OnRootLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Root.Loaded -= OnRootLoaded;
|
||||
EnsureCloseConfirmationAttached();
|
||||
ResizeWindow();
|
||||
await InitializeWebViewAsync();
|
||||
|
||||
@@ -230,6 +233,11 @@ public sealed partial class MainWindow : Window
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (request is not null &&
|
||||
TryHandleLegacyComparisonImportRequest(request.Type, request.Payload))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (request?.Type)
|
||||
{
|
||||
@@ -371,6 +379,9 @@ public sealed partial class MainWindow : Window
|
||||
case "request-manual-operator-data-status":
|
||||
HandleManualOperatorStatusRequest(request.Payload);
|
||||
break;
|
||||
case "import-legacy-manual-operator-data":
|
||||
_ = HandleLegacyManualOperatorImportAsync(request.Payload);
|
||||
break;
|
||||
case "request-manual-net-sell-data":
|
||||
_ = HandleManualNetSellReadAsync(request.Payload);
|
||||
break;
|
||||
@@ -416,16 +427,6 @@ public sealed partial class MainWindow : Window
|
||||
retryable: false,
|
||||
outcomeUnknown: false);
|
||||
break;
|
||||
case "open-external" when request.Payload.ValueKind == JsonValueKind.Object:
|
||||
if (request.Payload.TryGetProperty("url", out var value) &&
|
||||
Uri.TryCreate(value.GetString(), UriKind.Absolute, out var uri))
|
||||
{
|
||||
_ = OpenExternalUriAsync(uri);
|
||||
}
|
||||
break;
|
||||
case "reload":
|
||||
ReloadBrowserSafely();
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (JsonException exception)
|
||||
@@ -2262,6 +2263,8 @@ public sealed partial class MainWindow : Window
|
||||
if (_databaseRuntime is null)
|
||||
{
|
||||
var message = _databaseInitializationError ?? "데이터베이스가 설정되지 않았습니다.";
|
||||
ObserveNativeDatabaseState(DataSourceKind.Oracle, DatabaseHealthState.NotConfigured);
|
||||
ObserveNativeDatabaseState(DataSourceKind.MariaDb, DatabaseHealthState.NotConfigured);
|
||||
PostDatabaseStatus(new[]
|
||||
{
|
||||
CreateUnavailableStatus("oracle", message),
|
||||
@@ -2274,6 +2277,10 @@ public sealed partial class MainWindow : Window
|
||||
{
|
||||
var statuses = await _databaseRuntime.HealthService
|
||||
.CheckAllAsync(cancellationToken);
|
||||
foreach (var status in statuses)
|
||||
{
|
||||
ObserveNativeDatabaseState(status.Source, status.State);
|
||||
}
|
||||
|
||||
PostDatabaseStatus(statuses.Select(status => new
|
||||
{
|
||||
@@ -2292,6 +2299,8 @@ public sealed partial class MainWindow : Window
|
||||
}
|
||||
catch
|
||||
{
|
||||
ObserveNativeDatabaseState(DataSourceKind.Oracle, DatabaseHealthState.Unhealthy);
|
||||
ObserveNativeDatabaseState(DataSourceKind.MariaDb, DatabaseHealthState.Unhealthy);
|
||||
PostDatabaseStatus(new[]
|
||||
{
|
||||
CreateUnavailableStatus("oracle", "Oracle 상태 확인에 실패했습니다."),
|
||||
@@ -2335,6 +2344,7 @@ public sealed partial class MainWindow : Window
|
||||
CancelRequest(Volatile.Read(ref _namedPlaylistReadCancellation));
|
||||
CancelRequest(Volatile.Read(ref _namedPlaylistWriteCancellation));
|
||||
CancelRequest(Volatile.Read(ref _playlistPagePlanCancellation));
|
||||
CancelRequest(Volatile.Read(ref _legacyComparisonImportCancellation));
|
||||
CancelOperatorCatalogReadsForPlayout();
|
||||
CancelManualFinancialReadsForPlayout();
|
||||
}
|
||||
@@ -2579,6 +2589,7 @@ public sealed partial class MainWindow : Window
|
||||
InvalidateOperatorCatalogBrowserRequests();
|
||||
InvalidateManualOperatorBrowserRequests();
|
||||
InvalidateManualFinancialBrowserRequests();
|
||||
InvalidateLegacyComparisonImportRequest();
|
||||
if (Volatile.Read(ref _playoutCommandInFlight) != 0)
|
||||
{
|
||||
// Navigation or a renderer failure destroys the JavaScript request
|
||||
@@ -2589,6 +2600,8 @@ public sealed partial class MainWindow : Window
|
||||
|
||||
private void OnClosed(object sender, WindowEventArgs args)
|
||||
{
|
||||
DetachCloseConfirmation();
|
||||
LogNativeOperatorShutdown();
|
||||
var wasWebViewReady = _webViewReady;
|
||||
_webViewReady = false;
|
||||
_lifetimeCancellation.Cancel();
|
||||
@@ -2637,6 +2650,7 @@ public sealed partial class MainWindow : Window
|
||||
ShutdownOperatorCatalogRuntime();
|
||||
ShutdownManualFinancialRuntime();
|
||||
ShutdownManualOperatorDataRuntime();
|
||||
ShutdownLegacyComparisonImportRuntime();
|
||||
DataQueryExecutor.Reset();
|
||||
|
||||
if (!wasWebViewReady)
|
||||
|
||||
Reference in New Issue
Block a user