Skip to content

Commit

Permalink
Update submodule.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Apr 21, 2023
1 parent 820cb53 commit cf39b88
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Desktop.Linux/Desktop.Linux.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
<EmbeddedResource Include="Assets\Remotely_Icon.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\immybot\submodules\RemoteControl\Immense.RemoteControl.Desktop\Immense.RemoteControl.Desktop.csproj" />
<ProjectReference Include="..\Desktop.Shared\Desktop.Shared.csproj" />
<ProjectReference Include="..\submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop.Shared\Immense.RemoteControl.Desktop.Shared.csproj" />
<ProjectReference Include="..\submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop\Immense.RemoteControl.Desktop.csproj" />
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions Desktop.Linux/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Diagnostics;
using Immense.RemoteControl.Desktop.Startup;
using Remotely.Shared.Utilities;
using Immense.RemoteControl.Desktop.Shared.Startup;

var version = typeof(Program).Assembly.GetName().Version?.ToString() ?? "0.0.0";
var logger = new FileLogger("Remotely_Desktop", version, "Program.cs");
Expand Down Expand Up @@ -62,6 +63,18 @@
orgIdProvider.OrganizationId = orgId;
}

var result = await provider.UseRemoteControlClient(
args,
"The remote control client for Remotely.",
serverUrl);

if (!result.IsSuccess)
{
logger.LogError(result.Exception, "Failed to remote control client.");
Environment.Exit(1);
}


Console.WriteLine("Press Ctrl + C to exit.");

var shutdownService = provider.GetRequiredService<IShutdownService>();
Expand Down
5 changes: 4 additions & 1 deletion Desktop.Win/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@
orgIdProvider.OrganizationId = orgId;
}

var result = await provider.UseRemoteControlClient(args, serverUrl);
var result = await provider.UseRemoteControlClient(
args,
"The remote control client for Remotely.",
serverUrl);

if (!result.IsSuccess)
{
Expand Down
28 changes: 14 additions & 14 deletions Remotely.sln
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Serve
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Shared", "submodules\Immense.RemoteControl\Immense.RemoteControl.Shared\Immense.RemoteControl.Shared.csproj", "{FEF0D431-EB2F-4C08-A125-8DF59AFDA525}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Desktop", "..\immybot\submodules\RemoteControl\Immense.RemoteControl.Desktop\Immense.RemoteControl.Desktop.csproj", "{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Immense.RemoteControl.Desktop", "submodules\Immense.RemoteControl\Immense.RemoteControl.Desktop\Immense.RemoteControl.Desktop.csproj", "{034984DC-4B47-42E9-8648-F258C40C7926}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -263,18 +263,18 @@ Global
{FEF0D431-EB2F-4C08-A125-8DF59AFDA525}.Release|x64.Build.0 = Release|Any CPU
{FEF0D431-EB2F-4C08-A125-8DF59AFDA525}.Release|x86.ActiveCfg = Release|Any CPU
{FEF0D431-EB2F-4C08-A125-8DF59AFDA525}.Release|x86.Build.0 = Release|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Debug|x64.ActiveCfg = Debug|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Debug|x64.Build.0 = Debug|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Debug|x86.ActiveCfg = Debug|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Debug|x86.Build.0 = Debug|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Release|Any CPU.Build.0 = Release|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Release|x64.ActiveCfg = Release|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Release|x64.Build.0 = Release|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Release|x86.ActiveCfg = Release|Any CPU
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9}.Release|x86.Build.0 = Release|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Debug|Any CPU.Build.0 = Debug|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Debug|x64.ActiveCfg = Debug|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Debug|x64.Build.0 = Debug|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Debug|x86.ActiveCfg = Debug|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Debug|x86.Build.0 = Debug|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Release|Any CPU.ActiveCfg = Release|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Release|Any CPU.Build.0 = Release|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Release|x64.ActiveCfg = Release|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Release|x64.Build.0 = Release|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Release|x86.ActiveCfg = Release|Any CPU
{034984DC-4B47-42E9-8648-F258C40C7926}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -289,7 +289,7 @@ Global
{7FA4456D-8695-4990-B20A-B897CF9DF0EF} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8}
{8CBED18D-64A8-44C0-8433-EE14E93B472A} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8}
{FEF0D431-EB2F-4C08-A125-8DF59AFDA525} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8}
{605F98CC-D1DE-4B34-B42D-5738EC4CB0D9} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8}
{034984DC-4B47-42E9-8648-F258C40C7926} = {48C738FB-359E-43DB-B338-FD7CB1CCF6A8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EAE10B28-119B-437C-9E68-06F0EE3F968A}
Expand Down
39 changes: 32 additions & 7 deletions Server/Services/RcImplementations/ViewerPageDataProvider.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using Immense.RemoteControl.Server.Abstractions;
using Immense.RemoteControl.Server.Areas.RemoteControl.Pages;
using Immense.RemoteControl.Server.Models;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Org.BouncyCastle.Ocsp;
using Remotely.Shared.Enums;
using Remotely.Shared.Models;
using System;
using System.Threading.Tasks;

namespace Remotely.Server.Services.RcImplementations
{
Expand All @@ -19,43 +21,66 @@ public ViewerPageDataProvider(IDataService dataService, IApplicationConfig appCo
_appConfig = appConfig;
}

public string GetUserDisplayName(PageModel pageModel)
public Task<string> GetUserDisplayName(PageModel pageModel)
{
if (string.IsNullOrWhiteSpace(pageModel?.User?.Identity?.Name))
{
return string.Empty;
return Task.FromResult(string.Empty);
}

var user = _dataService.GetUserByNameWithOrg(pageModel.User.Identity.Name);

if (user is null)
{
return string.Empty;
return Task.FromResult(string.Empty);
}

return user.UserOptions?.DisplayName ?? user.UserName ?? string.Empty;
var displayName = user.UserOptions?.DisplayName ?? user.UserName ?? string.Empty;
return Task.FromResult(displayName);
}

public ViewerPageTheme GetTheme(PageModel pageModel)
public Task<ViewerPageTheme> GetTheme(PageModel pageModel)
{
if (pageModel.User.Identity.IsAuthenticated)
{
var user = _dataService.GetUserByNameWithOrg(pageModel.User.Identity.Name);

return user.UserOptions.Theme switch
var userTheme = user.UserOptions.Theme switch
{
Theme.Light => ViewerPageTheme.Light,
Theme.Dark => ViewerPageTheme.Dark,
_ => ViewerPageTheme.Dark
};
return Task.FromResult(userTheme);
}

return _appConfig.Theme switch
var appTheme = _appConfig.Theme switch
{
Theme.Light => ViewerPageTheme.Light,
Theme.Dark => ViewerPageTheme.Dark,
_ => ViewerPageTheme.Dark
};
return Task.FromResult(appTheme);
}

public Task<string> GetPageTitle(PageModel pageModel)
{
return Task.FromResult("Remotely Remote Control");
}

public Task<string> GetProductName(PageModel pageModel)
{
return Task.FromResult("Remotely");
}

public Task<string> GetProductSubtitle(PageModel pageModel)
{
return Task.FromResult("Remote Control");
}

public Task<string> GetPageDescription(ViewerModel viewerModel)
{
return Task.FromResult("Open-source remote support tools.");
}
}
}

0 comments on commit cf39b88

Please sign in to comment.