diff --git a/Remotely_Agent/Resources/Remotely_ScreenCapture.exe b/Remotely_Agent/Resources/Remotely_ScreenCapture.exe index 8612c28e..2518b05f 100644 Binary files a/Remotely_Agent/Resources/Remotely_ScreenCapture.exe and b/Remotely_Agent/Resources/Remotely_ScreenCapture.exe differ diff --git a/Remotely_ScreenCast/Capture/BitBltCapture.cs b/Remotely_ScreenCast/Capture/BitBltCapture.cs index c4c1d77e..7d3897a7 100644 --- a/Remotely_ScreenCast/Capture/BitBltCapture.cs +++ b/Remotely_ScreenCast/Capture/BitBltCapture.cs @@ -19,18 +19,11 @@ namespace Remotely_ScreenCast.Capture public class BitBltCapture : ICapturer { public Bitmap CurrentFrame { get; set; } - public Size CurrentScreenSize - { - get - { - return CurrentBounds.Size; - } - } public Bitmap PreviousFrame { get; set; } public bool IsCapturing { get; set; } public bool CaptureFullscreen { get; set; } = true; public int PauseForMilliseconds { get; set; } - public EventHandler ScreenChanged { get; set; } + public EventHandler ScreenChanged { get; set; } public int SelectedScreen { get @@ -51,38 +44,27 @@ namespace Remotely_ScreenCast.Capture { selectedScreen = 0; } - CurrentBounds = Screen.AllScreens[selectedScreen].Bounds; - ScreenChanged?.Invoke(this, CurrentBounds.Size); + CurrentScreenBounds = Screen.AllScreens[selectedScreen].Bounds; + ScreenChanged?.Invoke(this, CurrentScreenBounds); } } - public Rectangle CurrentBounds { get; set; } = Screen.PrimaryScreen.Bounds; + public Rectangle CurrentScreenBounds { get; set; } = Screen.PrimaryScreen.Bounds; private int selectedScreen = 0; - - // Offsets are the left and top edge of the screen, in case multiple monitor setups - // create a situation where the edge of a monitor is in the negative. This must - // be converted to a 0-based max left/top to render images on the canvas properly. private Graphics graphic; private string desktopName; public BitBltCapture() { - CurrentFrame = new Bitmap(CurrentBounds.Width, CurrentBounds.Height, PixelFormat.Format32bppArgb); - PreviousFrame = new Bitmap(CurrentBounds.Width, CurrentBounds.Height, PixelFormat.Format32bppArgb); + CurrentFrame = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb); + PreviousFrame = new Bitmap(CurrentScreenBounds.Width, CurrentScreenBounds.Height, PixelFormat.Format32bppArgb); graphic = Graphics.FromImage(CurrentFrame); desktopName = Win32Interop.GetCurrentDesktop(); } - private void CursorIcon_OnChange(object sender, int e) - { - //AditClient.SocketMessageHandler.SendIconUpdate(e); - } - public void Capture() { - Console.WriteLine($"Using BitBlt Capturer."); var currentDesktop = Win32Interop.GetCurrentDesktop(); - Console.WriteLine($"Current Desktop: {currentDesktop}"); if (currentDesktop != desktopName) { desktopName = currentDesktop; @@ -97,7 +79,7 @@ namespace Remotely_ScreenCast.Capture try { - graphic.CopyFromScreen(0 + CurrentBounds.Left, 0 + CurrentBounds.Top, 0, 0, new Size(CurrentBounds.Width, CurrentBounds.Height)); + graphic.CopyFromScreen(0 + CurrentScreenBounds.Left, 0 + CurrentScreenBounds.Top, 0, 0, new Size(CurrentScreenBounds.Width, CurrentScreenBounds.Height)); } catch (Exception ex) { @@ -105,5 +87,11 @@ namespace Remotely_ScreenCast.Capture } } - } + public Point GetAbsoluteScreenCoordinatesFromPercentages(decimal percentX, decimal percentY) + { + var absoluteX = (CurrentScreenBounds.Width * percentX) + CurrentScreenBounds.Left; + var absoluteY = (CurrentScreenBounds.Height * percentY) + CurrentScreenBounds.Top; + return new Point((int)absoluteX, (int)absoluteY); + } + } } diff --git a/Remotely_ScreenCast/Capture/DXCapture.cs b/Remotely_ScreenCast/Capture/DXCapture.cs index d16ec89d..768abc30 100644 --- a/Remotely_ScreenCast/Capture/DXCapture.cs +++ b/Remotely_ScreenCast/Capture/DXCapture.cs @@ -21,15 +21,9 @@ namespace Remotely_ScreenCast.Capture { public Bitmap PreviousFrame { get; set; } public Bitmap CurrentFrame { get; set; } - public Size CurrentScreenSize - { - get - { - return new Size(width, height); - } - } + public Rectangle CurrentScreenBounds { get; private set; } public bool CaptureFullscreen { get; set; } = true; - public EventHandler ScreenChanged { get; set; } + public EventHandler ScreenChanged { get; set; } public int SelectedScreen { get @@ -93,12 +87,14 @@ namespace Remotely_ScreenCast.Capture output = adapter.GetOutput(selectedScreen); output1 = output.QueryInterface(); - // Width/Height of desktop to capture - var newWidth = output.Description.DesktopBounds.Right - output.Description.DesktopBounds.Left; - var newHeight = output.Description.DesktopBounds.Bottom - output.Description.DesktopBounds.Top; + // Width/Height of desktop to capture + var bounds = output.Description.DesktopBounds; + var newWidth = bounds.Right - bounds.Left; + var newHeight = bounds.Bottom - bounds.Top; + CurrentScreenBounds = new Rectangle(bounds.Left, bounds.Top, newWidth, newHeight); if (newWidth != width || newHeight != height) { - ScreenChanged?.Invoke(this, new Size(newWidth, newHeight)); + ScreenChanged?.Invoke(this, CurrentScreenBounds); } width = newWidth; height = newHeight; @@ -212,5 +208,11 @@ namespace Remotely_ScreenCast.Capture } } - } + public Point GetAbsoluteScreenCoordinatesFromPercentages(decimal percentX, decimal percentY) + { + var absoluteX = (CurrentScreenBounds.Width * percentX) + CurrentScreenBounds.Left; + var absoluteY = (CurrentScreenBounds.Height * percentY) + CurrentScreenBounds.Top; + return new Point((int)absoluteX, (int)absoluteY); + } + } } diff --git a/Remotely_ScreenCast/Capture/ICapturer.cs b/Remotely_ScreenCast/Capture/ICapturer.cs index 0aeb661d..c01968d1 100644 --- a/Remotely_ScreenCast/Capture/ICapturer.cs +++ b/Remotely_ScreenCast/Capture/ICapturer.cs @@ -10,12 +10,13 @@ namespace Remotely_ScreenCast.Capture public interface ICapturer { Bitmap CurrentFrame { get; set; } - Size CurrentScreenSize { get; } - + Rectangle CurrentScreenBounds { get; } Bitmap PreviousFrame { get; set; } bool CaptureFullscreen { get; set; } void Capture(); - EventHandler ScreenChanged { get; set; } + EventHandler ScreenChanged { get; set; } int SelectedScreen { get; set; } + + Point GetAbsoluteScreenCoordinatesFromPercentages(decimal percentX, decimal percentY); } } diff --git a/Remotely_ScreenCast/Models/Viewer.cs b/Remotely_ScreenCast/Models/Viewer.cs index b57c6eca..a28903ed 100644 --- a/Remotely_ScreenCast/Models/Viewer.cs +++ b/Remotely_ScreenCast/Models/Viewer.cs @@ -14,5 +14,6 @@ namespace Remotely_ScreenCapture.Models public ICapturer Capturer { get; set; } public int CurrentScreenIndex { get; set; } public bool DisconnectRequested { get; set; } + public bool HasControl { get; set; } } } diff --git a/Remotely_ScreenCast/Sockets/MessageHandlers.cs b/Remotely_ScreenCast/Sockets/MessageHandlers.cs index b843706e..eb4c7944 100644 --- a/Remotely_ScreenCast/Sockets/MessageHandlers.cs +++ b/Remotely_ScreenCast/Sockets/MessageHandlers.cs @@ -29,20 +29,56 @@ namespace Remotely_ScreenCapture.Sockets BeginScreenCasting(hubConnection, viewerID, requesterName, outgoingMessages); }); - hubConnection.On("KeyDown", (int keyCode) => + hubConnection.On("KeyDown", (int keyCode, string viewerID) => { - Win32Interop.SendKeyDown((User32.VirtualKeyShort)keyCode); + var viewer = Program.Viewers[viewerID]; + if (viewer.HasControl) + { + Win32Interop.SendKeyDown((User32.VirtualKeyShort)keyCode); + } }); - hubConnection.On("KeyUp", (int keyCode) => + hubConnection.On("KeyUp", (int keyCode, string viewerID) => { - Win32Interop.SendKeyUp((User32.VirtualKeyShort)keyCode); + var viewer = Program.Viewers[viewerID]; + if (viewer.HasControl) + { + Win32Interop.SendKeyUp((User32.VirtualKeyShort)keyCode); + } }); - hubConnection.On("KeyPress", (int keyCode) => + hubConnection.On("KeyPress", (int keyCode, string viewerID) => { - Win32Interop.SendKeyDown((User32.VirtualKeyShort)keyCode); - Win32Interop.SendKeyUp((User32.VirtualKeyShort)keyCode); + var viewer = Program.Viewers[viewerID]; + if (viewer.HasControl) + { + Win32Interop.SendKeyDown((User32.VirtualKeyShort)keyCode); + Win32Interop.SendKeyUp((User32.VirtualKeyShort)keyCode); + } + }); + + hubConnection.On("MouseMove", (decimal percentX, decimal percentY, string viewerID) => + { + var viewer = Program.Viewers[viewerID]; + if (viewer.HasControl) + { + var mousePoint = viewer.Capturer.GetAbsoluteScreenCoordinatesFromPercentages(percentX, percentY); + Win32Interop.SendMouseMove(mousePoint.X, mousePoint.Y); + } + }); + + hubConnection.On("ViewerDisconnected", (string viewerID) => + { + if (Program.Viewers.ContainsKey(viewerID)) + { + var viewer = Program.Viewers[viewerID]; + viewer.DisconnectRequested = true; + var success = false; + while (!success) + { + success = Program.Viewers.TryRemove(viewerID, out _); + } + } }); } @@ -74,7 +110,8 @@ namespace Remotely_ScreenCapture.Sockets CurrentScreenIndex = 0, DisconnectRequested = false, Name = requesterName, - ViewerConnectionID = viewerID + ViewerConnectionID = viewerID, + HasControl = Program.Mode == "unattended" }; @@ -89,7 +126,7 @@ namespace Remotely_ScreenCapture.Sockets Screen.AllScreens.Length, viewerID); - await outgoingMessages.SendScreenSize(capturer.CurrentScreenSize.Width, capturer.CurrentScreenSize.Height, viewerID); + await outgoingMessages.SendScreenSize(capturer.CurrentScreenBounds.Width, capturer.CurrentScreenBounds.Height, viewerID); capturer.ScreenChanged += async (sender, size) => { diff --git a/Remotely_Server/Pages/_DataGrid.cshtml b/Remotely_Server/Pages/_DataGrid.cshtml index e9128420..0244c159 100644 --- a/Remotely_Server/Pages/_DataGrid.cshtml +++ b/Remotely_Server/Pages/_DataGrid.cshtml @@ -1,8 +1,8 @@ 
- - + + Filter:
diff --git a/Remotely_Server/Services/RCBrowserSocketHub.cs b/Remotely_Server/Services/RCBrowserSocketHub.cs index dfc5aebd..d9606679 100644 --- a/Remotely_Server/Services/RCBrowserSocketHub.cs +++ b/Remotely_Server/Services/RCBrowserSocketHub.cs @@ -19,12 +19,7 @@ namespace Remotely_Server.Services this.DeviceHub = deviceHub; } public static ConcurrentDictionary OrganizationConnectionList { get; set; } = new ConcurrentDictionary(); - private DataService DataService { get; } - private IHubContext RCDeviceHub { get; } - private ApplicationConfig AppConfig { get; set; } - private IHubContext DeviceHub { get; } - private string ClientID { get @@ -32,6 +27,7 @@ namespace Remotely_Server.Services return Context.Items["ClientID"] as string; } } + private string ClientType { get @@ -39,6 +35,10 @@ namespace Remotely_Server.Services return Context.Items["ClientType"] as string; } } + + private DataService DataService { get; } + private IHubContext DeviceHub { get; } + private IHubContext RCDeviceHub { get; } private string RequesterName { get @@ -46,26 +46,79 @@ namespace Remotely_Server.Services return Context.Items["RequesterName"] as string; } } - public async Task GetIceConfiguration() + + public async Task CtrlAltDel(string serviceID) { - //await Clients.Caller.SendAsync("IceConfiguration", AppConfig.IceConfiguration); + await DeviceHub.Clients.Client(serviceID).SendAsync("CtrlAltDel"); } - public async Task SendRTCSessionToDevice(object offer, string clientType, string clientID) + + public async Task KeyDown(string key) { - if (clientType == "Normal") + await RCDeviceHub.Clients.Client(ClientID).SendAsync("KeyDown", key, Context.ConnectionId); + } + + public async Task KeyPress(string key) + { + await RCDeviceHub.Clients.Client(ClientID).SendAsync("KeyPress", key, Context.ConnectionId); + } + + public async Task KeyUp(string key) + { + await RCDeviceHub.Clients.Client(ClientID).SendAsync("KeyUp", key, Context.ConnectionId); + } + + public async Task LongPress() + { + await RCDeviceHub.Clients.Client(ClientID).SendAsync("LongPress", Context.ConnectionId); + } + + public async Task MouseDown(string button, double percentX, double percentY) + { + await RCDeviceHub.Clients.Client(ClientID).SendAsync("MouseDown", button, percentX, percentY, Context.ConnectionId); + } + + public async Task MouseMove(double percentX, double percentY) + { + await RCDeviceHub.Clients.Client(ClientID).SendAsync("MouseMove", percentX, percentY, Context.ConnectionId); + } + + public async Task MouseUp(string button, double percentX, double percentY) + { + await RCDeviceHub.Clients.Client(ClientID).SendAsync("MouseUp", button, percentX, percentY, Context.ConnectionId); + } + + public async Task MouseWheel(double deltaX, double deltaY) + { + await RCDeviceHub.Clients.Client(ClientID).SendAsync("MouseWheel", deltaX, deltaY, Context.ConnectionId); + } + + public override Task OnConnectedAsync() + { + if (Context.User.Identity.IsAuthenticated) { - clientID = RCDeviceSocketHub.AttendedSessionList[clientID]; + var user = DataService.GetUserByName(Context.User.Identity.Name); + OrganizationConnectionList.TryAdd(Context.ConnectionId, user); } - await RCDeviceHub.Clients.Client(clientID).SendAsync("RTCSession", offer, Context.ConnectionId); + return base.OnConnectedAsync(); } - public async Task SendIceCandidateToDevice(object candidate, string clientType, string clientID) + + public override async Task OnDisconnectedAsync(Exception exception) { - if (clientType == "Normal") + if (Context.User.Identity.IsAuthenticated) { - clientID = RCDeviceSocketHub.AttendedSessionList[clientID]; + await RCDeviceHub.Clients.Client(ClientID).SendAsync("ViewerDisconnected", Context.ConnectionId); + while (!OrganizationConnectionList.TryRemove(Context.ConnectionId, out var user)) + { + await Task.Delay(1000); + } } - await RCDeviceHub.Clients.Client(clientID).SendAsync("IceCandidate", candidate, Context.ConnectionId); } + + public async Task SelectScreen(int screenIndex) + { + await RCDeviceHub.Clients.Client(ClientID).SendAsync("SelectScreen", screenIndex, Context.ConnectionId); + } + public async Task SendScreenCastRequestToDevice(string clientID, string requesterName, string clientType) { if (clientType == "Normal") @@ -92,49 +145,20 @@ namespace Remotely_Server.Services Context.Items["RequesterName"] = requesterName; await RCDeviceHub.Clients.Client(clientID).SendAsync("GetScreenCast", Context.ConnectionId, requesterName); } - public async Task SelectScreen(int screenIndex) + public async Task SendSharedFileIDs(List fileIDs) { - await RCDeviceHub.Clients.Client(ClientID).SendAsync("SelectScreen", screenIndex, Context.ConnectionId); + await RCDeviceHub.Clients.Client(ClientID).SendAsync("SharedFileIDs", fileIDs, Context.ConnectionId); } - public async Task MouseMove(double percentX, double percentY) + + public async Task Tap() { - await RCDeviceHub.Clients.Client(ClientID).SendAsync("MouseMove", percentX, percentY, Context.ConnectionId); - } - public async Task MouseDown(string button, double percentX, double percentY) - { - await RCDeviceHub.Clients.Client(ClientID).SendAsync("MouseDown", button, percentX, percentY, Context.ConnectionId); - } - public async Task MouseUp(string button, double percentX, double percentY) - { - await RCDeviceHub.Clients.Client(ClientID).SendAsync("MouseUp", button, percentX, percentY, Context.ConnectionId); - } - public override Task OnConnectedAsync() - { - if (Context.User.Identity.IsAuthenticated) - { - var user = DataService.GetUserByName(Context.User.Identity.Name); - OrganizationConnectionList.TryAdd(Context.ConnectionId, user); - } - return base.OnConnectedAsync(); - } - public override async Task OnDisconnectedAsync(Exception exception) - { - if (Context.User.Identity.IsAuthenticated) - { - while (!OrganizationConnectionList.TryRemove(Context.ConnectionId, out var user)) - { - await Task.Delay(1000); - } - } + await RCDeviceHub.Clients.Client(ClientID).SendAsync("Tap", Context.ConnectionId); } + public async Task TouchDown() { await RCDeviceHub.Clients.Client(ClientID).SendAsync("TouchDown", Context.ConnectionId); } - public async Task LongPress() - { - await RCDeviceHub.Clients.Client(ClientID).SendAsync("LongPress", Context.ConnectionId); - } public async Task TouchMove(double moveX, double moveY) { await RCDeviceHub.Clients.Client(ClientID).SendAsync("TouchMove", moveX, moveY, Context.ConnectionId); @@ -143,33 +167,5 @@ namespace Remotely_Server.Services { await RCDeviceHub.Clients.Client(ClientID).SendAsync("TouchUp", Context.ConnectionId); } - public async Task Tap() - { - await RCDeviceHub.Clients.Client(ClientID).SendAsync("Tap", Context.ConnectionId); - } - public async Task MouseWheel(double deltaX, double deltaY) - { - await RCDeviceHub.Clients.Client(ClientID).SendAsync("MouseWheel", deltaX, deltaY, Context.ConnectionId); - } - public async Task KeyDown(string key) - { - await RCDeviceHub.Clients.Client(ClientID).SendAsync("KeyDown", key, Context.ConnectionId); - } - public async Task KeyUp(string key) - { - await RCDeviceHub.Clients.Client(ClientID).SendAsync("KeyUp", key, Context.ConnectionId); - } - public async Task KeyPress(string key) - { - await RCDeviceHub.Clients.Client(ClientID).SendAsync("KeyPress", key, Context.ConnectionId); - } - public async Task CtrlAltDel(string serviceID) - { - await DeviceHub.Clients.Client(serviceID).SendAsync("CtrlAltDel"); - } - public async Task SendSharedFileIDs(List fileIDs) - { - await RCDeviceHub.Clients.Client(ClientID).SendAsync("SharedFileIDs", fileIDs, Context.ConnectionId); - } } } diff --git a/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js b/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js index fe6dda48..e2343c93 100644 --- a/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js +++ b/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js @@ -105,22 +105,11 @@ export class RCBrowserSockets { UI.ScreenViewer.height = height; }); hubConnection.on("ScreenCapture", (buffer) => { - var decodedString = window.atob(buffer); - var len = decodedString.length; - var bytes = new Uint8ClampedArray(len); - for (var i = 0; i < len; i++) { - bytes[i] = decodedString.charCodeAt(i); - } - ; - var imageData = new ImageData(bytes, UI.ScreenViewer.width, UI.ScreenViewer.height); - UI.Screen2DContext.putImageData(imageData, 0, 0); - //var url = window.URL.createObjectURL(new Blob([buffer])); - //var img = document.createElement("img"); - //img.onload = function () { - // UI.Screen2DContext.drawImage(img, 0, 0, UI.ScreenViewer.width, UI.ScreenViewer.height); - // window.URL.revokeObjectURL(url); - //}; - //img.src = url; + var img = new Image(); + img.onload = () => { + UI.Screen2DContext.drawImage(img, 0, 0); + }; + img.src = "data:image/png;base64," + buffer; }); hubConnection.on("ConnectionFailed", () => { UI.ConnectButton.removeAttribute("disabled"); diff --git a/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js.map b/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js.map index 482ffeba..ec466c82 100644 --- a/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js.map +++ b/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.js.map @@ -1 +1 @@ -{"version":3,"file":"RCBrowserSockets.js","sourceRoot":"","sources":["RCBrowserSockets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,IAAI,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAEhC,MAAM,OAAO,gBAAgB;IAGzB,OAAO;QACH,IAAI,CAAC,UAAU,GAAG,IAAI,OAAO,CAAC,oBAAoB,EAAE;aAC/C,OAA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U,CAAC,IAAI,EAAE,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,aAAa,CAAC,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;YACtC,EAAE,CAAC,WAAW,CAAC,kCAAkC,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;QACH,aAAa,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,WAAmB,EAAE,EAAE;YACxD,EAAE,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC;YAC5C,aAAa,CAAC,QAAQ,GAAG,WAAW,CAAC;YACrC,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;YAChD,aAAa,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YAChC,IAAI,CAAC,6BAA6B,EAAE,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,aAAa,CAAC,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE;YACzC,EAAE,CAAC,WAAW,CAAC,2CAA2C,CAAC,CAAC;YAC5D,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QACpD,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"} \ No newline at end of file diff --git a/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts b/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts index 20ccba30..6d72cab3 100644 --- a/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts +++ b/Remotely_Server/wwwroot/scripts/RemoteControl/RCBrowserSockets.ts @@ -114,21 +114,11 @@ export class RCBrowserSockets { UI.ScreenViewer.height = height; }); hubConnection.on("ScreenCapture", (buffer) => { - var decodedString = window.atob(buffer); - var len = decodedString.length; - var bytes = new Uint8ClampedArray(len); - for (var i = 0; i < len; i++) { - bytes[i] = decodedString.charCodeAt(i); - }; - var imageData = new ImageData(bytes, UI.ScreenViewer.width, UI.ScreenViewer.height); - UI.Screen2DContext.putImageData(imageData, 0, 0); - //var url = window.URL.createObjectURL(new Blob([buffer])); - //var img = document.createElement("img"); - //img.onload = function () { - // UI.Screen2DContext.drawImage(img, 0, 0, UI.ScreenViewer.width, UI.ScreenViewer.height); - // window.URL.revokeObjectURL(url); - //}; - //img.src = url; + var img = new Image(); + img.onload = () => { + UI.Screen2DContext.drawImage(img, 0, 0); + } + img.src = "data:image/png;base64," + buffer; }); hubConnection.on("ConnectionFailed", () => { UI.ConnectButton.removeAttribute("disabled"); diff --git a/Remotely_Server/wwwroot/scripts/ResultsParser.js b/Remotely_Server/wwwroot/scripts/ResultsParser.js index e5204176..9aa7f403 100644 --- a/Remotely_Server/wwwroot/scripts/ResultsParser.js +++ b/Remotely_Server/wwwroot/scripts/ResultsParser.js @@ -11,9 +11,9 @@ export function CreateCommandHarness(context) { Total Devices: ${context.TargetDeviceIDs.length} | Completed: 0% | Errors: 0 | - - JSON - XML + + JSON + XML
`; @@ -29,9 +29,9 @@ export function AddPSCoreResultsHarness(result) {
Device: ${deviceName} | Had Errors: ${result.ErrorOutput.length > 1 ? "Yes" : "No"} | - +
-
+
Host Output:
${result.HostOutput.replace(/\n/g, "
").replace(/ /g, " ")}
Debug Output:
${result.DebugOutput.join("
").replace(/ /g, " ")}
Verbose Output:
${result.VerboseOutput.join("
").replace(/ /g, " ")}
@@ -57,7 +57,7 @@ export function AddCommandResultsHarness(result) {
Device: ${deviceName} | Had Errors: ${result.ErrorOutput.length > 1 ? "Yes" : "No"} | - +
Standard Output:
${result.StandardOutput.replace(/\n/g, "
").replace(/ /g, " ")}
diff --git a/Remotely_Server/wwwroot/scripts/ResultsParser.ts b/Remotely_Server/wwwroot/scripts/ResultsParser.ts index fa7ed9c2..72a98df1 100644 --- a/Remotely_Server/wwwroot/scripts/ResultsParser.ts +++ b/Remotely_Server/wwwroot/scripts/ResultsParser.ts @@ -15,9 +15,9 @@ export function CreateCommandHarness(context: CommandContext): HTMLDivElement { Total Devices: ${context.TargetDeviceIDs.length} | Completed: 0% | Errors: 0 | - - JSON - XML + + JSON + XML
`; @@ -35,9 +35,9 @@ export function AddPSCoreResultsHarness(result: PSCoreCommandResult) {
Device: ${deviceName} | Had Errors: ${result.ErrorOutput.length > 1 ? "Yes": "No"} | - +
-
+
Host Output:
${result.HostOutput.replace(/\n/g, "
").replace(/ /g, " ")}
Debug Output:
${result.DebugOutput.join("
").replace(/ /g, " ")}
Verbose Output:
${result.VerboseOutput.join("
").replace(/ /g, " ")}
@@ -64,7 +64,7 @@ export function AddCommandResultsHarness(result: GenericCommandResult) {
Device: ${deviceName} | Had Errors: ${result.ErrorOutput.length > 1 ? "Yes" : "No"} | - +
Standard Output:
${result.StandardOutput.replace(/\n/g, "
").replace(/ /g, " ")}