mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Close window on remote control disconnect if originating from API call.
This commit is contained in:
parent
10f7a40419
commit
8a1a642d2b
@ -102,7 +102,7 @@ namespace Remotely.Server.API
|
||||
else
|
||||
{
|
||||
var rcSession = RCDeviceSocketHub.SessionInfoList.Values.FirstOrDefault(x=>x.DeviceID == targetDevice.Value.ID && !existingSessions.Any(y=>y.Key != x.RCSocketID));
|
||||
return Ok($"{HttpContext.Request.Scheme}://{Request.Host}/RemoteControl?clientID={rcSession.RCSocketID}&serviceID={targetDevice.Key}");
|
||||
return Ok($"{HttpContext.Request.Scheme}://{Request.Host}/RemoteControl?clientID={rcSession.RCSocketID}&serviceID={targetDevice.Key}&fromApi=true");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -81,6 +81,9 @@ export function ApplyInputHandlers(sockets) {
|
||||
DisconnectButton.addEventListener("click", (ev) => {
|
||||
ConnectButton.removeAttribute("disabled");
|
||||
RemoteControl.RCBrowserSockets.Connection.stop();
|
||||
if (location.search.includes("fromApi=true")) {
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
document.querySelectorAll("#sessionIDInput, #nameInput").forEach(x => {
|
||||
x.addEventListener("keypress", (ev) => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -86,6 +86,9 @@ export function ApplyInputHandlers(sockets: RCBrowserSockets) {
|
||||
DisconnectButton.addEventListener("click", (ev) => {
|
||||
ConnectButton.removeAttribute("disabled");
|
||||
RemoteControl.RCBrowserSockets.Connection.stop();
|
||||
if (location.search.includes("fromApi=true")) {
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
document.querySelectorAll("#sessionIDInput, #nameInput").forEach(x => {
|
||||
x.addEventListener("keypress", (ev: KeyboardEvent) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user