mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Remote machine name now gets added to browser tab's title.
This commit is contained in:
parent
6aad89e01d
commit
1617865049
@ -1,5 +1,5 @@
|
||||
# Remotely
|
||||
[](https://dev.azure.com/translucency/Remotely/_build/latest?definitionId=5&branchName=master)
|
||||
[](https://dev.azure.com/translucency/Remotely/_build/latest?definitionId=13)
|
||||
|
||||
A remote control and remote scripting solution, built with .NET Core and SignalR Core.
|
||||
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
2019.06.27.2150
|
||||
2019.07.03.1652
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user