Skip to content

Commit 14f1c33

Browse files
Cleanup
1 parent 0d15d1d commit 14f1c33

File tree

6 files changed

+9
-21
lines changed

6 files changed

+9
-21
lines changed

src/Certify.Core/Management/CertifyManager/CertifyManager.ServerType.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
@@ -23,6 +23,7 @@ private async Task<ICollection<string>> GetTargetServiceTypes()
2323
{
2424
list.Add(StandardServerTypes.Nginx.ToString());
2525
}
26+
2627
return list;
2728
}
2829

src/Certify.Core/Management/CertifyManager/CertifyManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public async Task Init()
205205
/// </summary>
206206
private void SetupJobs()
207207
{
208-
// 1 shot init of async startup dependencyies (e.g. initial connection to mgmt hub instance)
208+
// one shot init of async startup dependencies (e.g. initial connection to mgmt hub instance)
209209
_initTimer = new System.Timers.Timer(2 * 1000); // 2 seconds
210210
_initTimer.Elapsed += async (s, e) =>
211211
{

src/Certify.Server/Certify.Server.Hub.Api/Controllers/internal/HubController.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,10 @@ public async Task<IActionResult> GetHubInfo()
152152

153153
hubInfo.InstanceId = hubprefs.InstanceId;
154154

155-
// TODO: there is probably be a better place to set this
156-
_mgmtStateProvider.SetManagementHubInstanceId(hubInfo.InstanceId);
157-
158155
var versionInfo = await _client.GetAppVersion();
159156

160157
hubInfo.Version = new Models.Hub.VersionInfo { Version = versionInfo, Product = "Certify Management Hub" };
161158

162-
hubInfo.HubEndpoint = "api/internal/managementhub";
163-
164159
return new OkObjectResult(hubInfo);
165160
}
166161
}

src/Certify.Server/Certify.Server.HubService/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
// setup public/hub api
123123
builder.Services.AddSingleton<Certify.Management.ICertifyManager, Certify.Management.CertifyManager>();
124124

125-
builder.Services.AddTransient(typeof(ICertifyInternalApiClient), typeof(CertifyHubService));
125+
builder.Services.AddTransient(typeof(ICertifyInternalApiClient), typeof(CertifyDirectHubService));
126126

127127
// setup server core
128128
builder.Services.AddSingleton<IInstanceManagementStateProvider, InstanceManagementStateProvider>();

src/Certify.Server/Certify.Server.HubService/Services/DirectManagementServerClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public DirectManagementServerClient(ICertifyManager certifyManager, IServiceProv
4848
{
4949
_certifyManager = certifyManager;
5050
_managementHub = instanceManagementHub;
51+
5152
_instanceInfo = certifyManager.GetManagedInstanceInfo();
5253
}
5354

src/Certify.UI.Shared/Controls/Settings/ManagementHub.xaml.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,14 @@ private async void UserControl_Loaded(object sender, RoutedEventArgs e)
4949

5050
private async void Join_Click(object sender, System.Windows.RoutedEventArgs e)
5151
{
52-
var credentialsCheckResult = await EditModel.MainViewModel.CheckManagementHubCredentials(EditModel.ManagementHubAPIUrl, EditModel.ClientID, EditModel.ClientSecret);
53-
54-
if (credentialsCheckResult.IsSuccess)
52+
var result = await EditModel.MainViewModel.JoinManagementHub(EditModel.ManagementHubAPIUrl, EditModel.ClientID, EditModel.ClientSecret);
53+
if (result.IsSuccess)
5554
{
56-
var result = await EditModel.MainViewModel.JoinManagementHub(EditModel.ManagementHubAPIUrl, EditModel.ClientID, EditModel.ClientSecret);
57-
if (result.IsSuccess)
58-
{
59-
MessageBox.Show("Successfully joined Management Hub.");
60-
}
61-
else
62-
{
63-
MessageBox.Show("Failed to join Management Hub.");
64-
}
55+
MessageBox.Show("Successfully joined Management Hub.");
6556
}
6657
else
6758
{
68-
MessageBox.Show(credentialsCheckResult.Message);
59+
MessageBox.Show(result.Message);
6960
}
7061
}
7162
}

0 commit comments

Comments
 (0)