Remote machine name now gets added to browser tab's title.

This commit is contained in:
Jared Goodwin 2019-07-03 21:24:00 -07:00
parent 6aad89e01d
commit 1617865049
10 changed files with 31 additions and 9 deletions

View File

View File

@ -1,5 +1,5 @@
# Remotely
[![Build Status](https://dev.azure.com/translucency/Remotely/_apis/build/status/Remotely-GitHub?branchName=master)](https://dev.azure.com/translucency/Remotely/_build/latest?definitionId=5&branchName=master)
[![Build status](https://dev.azure.com/translucency/Remotely/_apis/build/status/Remotely-All)](https://dev.azure.com/translucency/Remotely/_build/latest?definitionId=13)
A remote control and remote scripting solution, built with .NET Core and SignalR Core.

View File

@ -46,6 +46,8 @@ namespace Remotely.ScreenCast.Core.Capture
conductor.InvokeViewerAdded(viewer);
}
await conductor.CasterSocket.SendMachineName(Environment.MachineName, viewerID);
await conductor.CasterSocket.SendScreenCount(
capturer.SelectedScreen,
capturer.GetScreenCount(),

View File

@ -64,6 +64,10 @@ namespace Remotely.ScreenCast.Core.Sockets
await Connection.SendAsync("ReceiveDeviceInfo", serviceID, machineName);
}
public async Task SendMachineName(string machineName, string viewerID)
{
await Connection.SendAsync("SendMachineName", machineName, viewerID);
}
public async Task SendScreenCapture(byte[] captureBytes, string viewerID, int left, int top, int width, int height, DateTime captureTime)
{
await Connection.SendAsync("SendScreenCapture", captureBytes, viewerID, left, top, width, height, captureTime);
@ -93,11 +97,14 @@ namespace Remotely.ScreenCast.Core.Sockets
return Task.CompletedTask;
};
Connection.On("ClipboardTransfer", (string transferText) =>
Connection.On("ClipboardTransfer", (string transferText, string viewerID) =>
{
try
{
Conductor.InvokeClipboardTransfer(transferText);
if (Conductor.Viewers.TryGetValue(viewerID, out var viewer) && viewer.HasControl)
{
Conductor.InvokeClipboardTransfer(transferText);
}
}
catch (Exception ex)
{
@ -229,9 +236,12 @@ namespace Remotely.ScreenCast.Core.Sockets
}
});
Connection.On("ToggleAudio", (bool toggleOn) =>
Connection.On("ToggleAudio", (bool toggleOn, string viewerID) =>
{
Conductor.InvokeAudioToggled(toggleOn);
if (Conductor.Viewers.TryGetValue(viewerID, out var viewer) && viewer.HasControl)
{
Conductor.InvokeAudioToggled(toggleOn);
}
});

View File

@ -1 +1 @@
2019.06.27.2150
2019.07.03.1652

View File

@ -199,11 +199,11 @@ namespace Remotely.Server.Services
}
public async Task SendToggleAudio(bool toggleOn)
{
await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("ToggleAudio", toggleOn);
await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("ToggleAudio", toggleOn, Context.ConnectionId);
}
public async Task SendClipboardTransfer(string transferText)
{
await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("ClipboardTransfer", transferText);
await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("ClipboardTransfer", transferText, Context.ConnectionId);
}
public async Task Tap(double percentX, double percentY)
{

View File

@ -192,6 +192,10 @@ namespace Remotely.Server.Services
MachineName = machineName;
MachineNameToSessionIDLookup[MachineName] = Context.ConnectionId;
}
public async Task SendMachineName(string machineName, string viewerID)
{
await RCBrowserHub.Clients.Client(viewerID).SendAsync("ReceiveMachineName", machineName);
}
public async Task SendAudioSample(byte[] buffer, List<string> viewerIDs)
{
await RCBrowserHub.Clients.Clients(viewerIDs).SendAsync("AudioSample", buffer);

View File

@ -153,6 +153,9 @@ export class RCBrowserSockets {
UI.StatusMessage.innerHTML = "The host has disconnected.";
this.Connection.stop();
});
hubConnection.on("ReceiveMachineName", (machineName) => {
document.title = `${machineName} - Remotely Session`;
});
hubConnection.on("RelaunchedScreenCasterReady", (newClientID) => {
RemoteControl.ClientID = newClientID;
this.Connection.stop();

File diff suppressed because one or more lines are too long

View File

@ -161,6 +161,9 @@ export class RCBrowserSockets {
UI.StatusMessage.innerHTML = "The host has disconnected.";
this.Connection.stop();
});
hubConnection.on("ReceiveMachineName", (machineName: string) => {
document.title = `${machineName} - Remotely Session`;
});
hubConnection.on("RelaunchedScreenCasterReady", (newClientID: string) => {
RemoteControl.ClientID = newClientID;
this.Connection.stop();