Skip to content

Commit 805b70c

Browse files
Dharmishtha PatelDharmishtha Patel
authored andcommitted
Refactor
1 parent 32856db commit 805b70c

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

src/ServiceControl.Config/UI/AdvancedOptions/ServiceControlAdvancedView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
Visibility="{Binding InMaintenanceMode, Converter={StaticResource boolToVis}}"
5555
Margin="0,0,0,20"
5656
>
57-
This instance is in database maintenance mode. All message processing is disabled and the REST API is unavailable.<LineBreak />ServicePulse and ServiceInsight cannot connect to this instance while it is in maintenance mode.<LineBreak />Launch <Hyperlink Command="{Binding OpenUrl}" CommandParameter="{Binding StorageUrl}">
57+
This instance is in database maintenance mode. All message processing is disabled and the REST API is unavailable.<LineBreak />ServicePulse and ServiceInsight cannot connect to this instance while it is in maintenance mode.<LineBreak />Launch <Hyperlink Command="{Binding OpenUrl}" CommandParameter="{Binding RavenStudioUrl}">
5858
RavenDB Management Studio
5959
<Hyperlink.ContextMenu>
6060
<ContextMenu>
6161
<MenuItem Command="{Binding CopyToClipboard}"
62-
CommandParameter="{Binding StorageUrl}"
62+
CommandParameter="{Binding RavenStudioUrl}"
6363
Header="Copy to Clipboard" />
6464
</ContextMenu>
6565
</Hyperlink.ContextMenu>

src/ServiceControl.Config/UI/AdvancedOptions/ServiceControlAdvancedViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ForceUpgradeAuditInstanceCommand forceUpgradeAuditCommand
2828
)
2929
{
3030
ServiceControlInstance = (ServiceControlBaseService)instance;
31-
DisplayName = "ADVANCED OPTIONS";
31+
DisplayName = "MAINTENANCE MODE";
3232

3333
StartServiceInMaintenanceModeCommand = ReactiveCommand.CreateFromTask<ServiceControlAdvancedViewModel>(async _ =>
3434
{
@@ -81,7 +81,7 @@ ForceUpgradeAuditInstanceCommand forceUpgradeAuditCommand
8181

8282
public bool InMaintenanceMode => ServiceControlInstance.InMaintenanceMode;
8383

84-
public string StorageUrl => $"http://localhost:{ServiceControlInstance.DatabaseMaintenancePort ?? 33334}/studio/index.html#databases";
84+
public string RavenStudioUrl => ServiceControlInstance.RavenStudioUrl;
8585

8686
public bool IsRunning
8787
{

src/ServiceControlInstaller.Engine/Instances/ServiceControlBaseService.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,13 @@ protected ServiceControlBaseService(IWindowsServiceController service)
2828

2929
public bool InMaintenanceMode { get; set; }
3030
public ReportCard ReportCard { get; set; }
31-
32-
/// <summary>
33-
/// Raven management URL
34-
/// </summary>
35-
public string StorageUrl
31+
32+
public string RavenStudioUrl
3633
{
3734
get
3835
{
39-
string host = HostName switch
40-
{
41-
"*" or "+" => "localhost",
42-
_ => HostName,
43-
};
44-
return $"http://{host}:{DatabaseMaintenancePort}/studio/index.html#databases";
36+
var port = DatabaseMaintenancePort ?? 33334;
37+
return $"http://localhost:{port}/studio/index.html#databases";
4538
}
4639
}
4740

0 commit comments

Comments
 (0)