refactor(agent): remove obsolete compatibility paths
This commit is contained in:
@@ -172,11 +172,9 @@ internal sealed class TrayApplicationContext : ApplicationContext
|
||||
DataDirectory = dataDirectory,
|
||||
Remote = source.Remote,
|
||||
Reporting = source.Reporting,
|
||||
RemoteConfigurationFile = source.RemoteConfigurationFile,
|
||||
EnableValidationOperations = source.EnableValidationOperations,
|
||||
EnableListenerEvents = source.EnableListenerEvents,
|
||||
PreventAutoLock = source.PreventAutoLock,
|
||||
EnableDataSync = source.EnableDataSync,
|
||||
DataSyncIntervalSeconds = source.DataSyncIntervalSeconds,
|
||||
DataSyncBatchLimit = source.DataSyncBatchLimit,
|
||||
DataSyncOverlapRows = source.DataSyncOverlapRows,
|
||||
@@ -288,12 +286,6 @@ internal sealed class TrayApplicationContext : ApplicationContext
|
||||
{
|
||||
EnsureConfiguration();
|
||||
var settings = options!;
|
||||
if (!string.IsNullOrWhiteSpace(settings.RemoteConfigurationFile))
|
||||
{
|
||||
var remotePath = ResolvePath(settings.RemoteConfigurationFile, Path.GetDirectoryName(configPath)!, "remote.json");
|
||||
var remoteConfiguration = RemoteNodeConfigurationStore.LoadAsync(remotePath).GetAwaiter().GetResult();
|
||||
settings = WithRemoteForSettings(settings, remoteConfiguration.Remote, remoteConfiguration.Reporting);
|
||||
}
|
||||
if (ServiceSettingsEditor.Show(settings) is not { } edited) return;
|
||||
WriteCredentials(edited.CredentialFile, edited.AccessToken!, edited.EnableValidationOperations);
|
||||
WriteJson(configPath, edited);
|
||||
@@ -306,29 +298,6 @@ internal sealed class TrayApplicationContext : ApplicationContext
|
||||
}
|
||||
}
|
||||
|
||||
private static ServiceOptions WithRemoteForSettings(ServiceOptions source, RemoteAgentOptions? remote, ReportingConfig reporting) => new()
|
||||
{
|
||||
ListenUrl = source.ListenUrl,
|
||||
AllowExternal = source.AllowExternal,
|
||||
AllowedHosts = source.AllowedHosts ?? [],
|
||||
AllowedOrigins = source.AllowedOrigins ?? [],
|
||||
AccessToken = source.AccessToken,
|
||||
CredentialFile = source.CredentialFile,
|
||||
DataDirectory = source.DataDirectory,
|
||||
Remote = remote,
|
||||
Reporting = reporting,
|
||||
RemoteConfigurationFile = null,
|
||||
EnableValidationOperations = source.EnableValidationOperations,
|
||||
EnableListenerEvents = source.EnableListenerEvents,
|
||||
PreventAutoLock = source.PreventAutoLock,
|
||||
EnableDataSync = source.EnableDataSync,
|
||||
DataSyncIntervalSeconds = source.DataSyncIntervalSeconds,
|
||||
DataSyncBatchLimit = source.DataSyncBatchLimit,
|
||||
DataSyncOverlapRows = source.DataSyncOverlapRows,
|
||||
DataSyncQueueMaxItems = source.DataSyncQueueMaxItems,
|
||||
DataSyncQueueMaxBytes = source.DataSyncQueueMaxBytes
|
||||
};
|
||||
|
||||
private void SetStatus(string message)
|
||||
{
|
||||
StatusItem.Text = message.Length > 60 ? message[..60] : message;
|
||||
@@ -618,7 +587,6 @@ internal static class ServiceSettingsEditor
|
||||
DataDirectory = current.DataDirectory,
|
||||
Remote = remoteOptions,
|
||||
Reporting = reportingOptions,
|
||||
RemoteConfigurationFile = null,
|
||||
EnableValidationOperations = validation.Checked,
|
||||
EnableListenerEvents = listenerEvents.Checked,
|
||||
PreventAutoLock = preventAutoLock.Checked
|
||||
|
||||
Reference in New Issue
Block a user