@openreplay/tracker-assist
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -0,1 +1,5 @@ | ||
## 6.0.1 | ||
- few small fixes for reconnects | ||
## 6.0.0 | ||
@@ -2,0 +6,0 @@ |
@@ -27,3 +27,3 @@ import type { Properties } from 'csstype'; | ||
private readonly noSecureMode; | ||
readonly version = "6.0.0"; | ||
readonly version = "6.0.1"; | ||
private socket; | ||
@@ -30,0 +30,0 @@ private peer; |
@@ -25,3 +25,3 @@ "use strict"; | ||
this.noSecureMode = noSecureMode; | ||
this.version = '6.0.0'; | ||
this.version = '6.0.1'; | ||
this.socket = null; | ||
@@ -138,3 +138,3 @@ this.peer = null; | ||
} | ||
this.agents[id].onControlReleased = this.options.onRemoteControlStart((_a = this.agents[id]) === null || _a === void 0 ? void 0 : _a.agentInfo); | ||
this.agents[id] = Object.assign(Object.assign({}, this.agents[id]), { onControlReleased: this.options.onRemoteControlStart((_a = this.agents[id]) === null || _a === void 0 ? void 0 : _a.agentInfo) }); | ||
this.emit('control_granted', id); | ||
@@ -169,3 +169,3 @@ annot = new AnnotationCanvas_js_1.default(); | ||
}; | ||
this.remoteControl = new RemoteControl_js_1.default(this.options, onGrand, (id, isDenied) => onRelease(id, isDenied)); | ||
this.remoteControl = new RemoteControl_js_1.default(this.options, onGrand, (id, isDenied) => onRelease(id, isDenied), (id) => this.emit('control_busy', id)); | ||
const onAcceptRecording = () => { | ||
@@ -214,13 +214,15 @@ socket.emit('recording_accepted'); | ||
}; | ||
this.assistDemandedRestart = true; | ||
this.app.stop(); | ||
setTimeout(() => { | ||
this.app.start().then(() => { this.assistDemandedRestart = false; }) | ||
.then(() => { | ||
var _a; | ||
(_a = this.remoteControl) === null || _a === void 0 ? void 0 : _a.reconnect([id,]); | ||
}) | ||
.catch(e => app.debug.error(e)); | ||
// TODO: check if it's needed; basically allowing some time for the app to finish everything before starting again | ||
}, 500); | ||
if (this.app.active()) { | ||
this.assistDemandedRestart = true; | ||
this.app.stop(); | ||
setTimeout(() => { | ||
this.app.start().then(() => { this.assistDemandedRestart = false; }) | ||
.then(() => { | ||
var _a; | ||
(_a = this.remoteControl) === null || _a === void 0 ? void 0 : _a.reconnect([id,]); | ||
}) | ||
.catch(e => app.debug.error(e)); | ||
// TODO: check if it's needed; basically allowing some time for the app to finish everything before starting again | ||
}, 400); | ||
} | ||
}); | ||
@@ -236,13 +238,15 @@ socket.on('AGENTS_CONNECTED', (ids) => { | ||
}); | ||
this.assistDemandedRestart = true; | ||
this.app.stop(); | ||
setTimeout(() => { | ||
this.app.start().then(() => { this.assistDemandedRestart = false; }) | ||
.then(() => { | ||
var _a; | ||
(_a = this.remoteControl) === null || _a === void 0 ? void 0 : _a.reconnect(ids); | ||
}) | ||
.catch(e => app.debug.error(e)); | ||
// TODO: check if it's needed; basically allowing some time for the app to finish everything before starting again | ||
}, 500); | ||
if (this.app.active()) { | ||
this.assistDemandedRestart = true; | ||
this.app.stop(); | ||
setTimeout(() => { | ||
this.app.start().then(() => { this.assistDemandedRestart = false; }) | ||
.then(() => { | ||
var _a; | ||
(_a = this.remoteControl) === null || _a === void 0 ? void 0 : _a.reconnect(ids); | ||
}) | ||
.catch(e => app.debug.error(e)); | ||
// TODO: check if it's needed; basically allowing some time for the app to finish everything before starting again | ||
}, 400); | ||
} | ||
}); | ||
@@ -426,5 +430,4 @@ socket.on('AGENT_DISCONNECTED', (id) => { | ||
} | ||
// UI | ||
if (!callUI) { | ||
callUI = new CallWindow_js_1.default(app.debug.error, this.options.callUITemplate); | ||
callUI = new CallWindow_js_1.default(console.log, this.options.callUITemplate); | ||
callUI.setVideoToggleCallback(updateVideoFeed); | ||
@@ -473,2 +476,3 @@ } | ||
}).catch(reason => { | ||
console.log(reason); | ||
app.debug.log(reason); | ||
@@ -475,0 +479,0 @@ }); |
@@ -50,3 +50,5 @@ "use strict"; | ||
const assistSection = doc.getElementById('or-assist'); | ||
assistSection === null || assistSection === void 0 ? void 0 : assistSection.classList.remove('status-connecting'); | ||
setTimeout(() => { | ||
assistSection === null || assistSection === void 0 ? void 0 : assistSection.classList.remove('status-connecting'); | ||
}, 0); | ||
//iframe.style.height = doc.body.scrollHeight + 'px'; | ||
@@ -99,2 +101,7 @@ //iframe.style.width = doc.body.scrollWidth + 'px'; | ||
} | ||
setTimeout(() => { | ||
const assistSection = doc.getElementById('or-assist'); | ||
assistSection === null || assistSection === void 0 ? void 0 : assistSection.classList.remove('status-connecting'); | ||
this.adjustIframeSize(); | ||
}, 250); | ||
}); | ||
@@ -101,0 +108,0 @@ //this.toggleVideoUI(false) |
@@ -11,6 +11,7 @@ import type { Options as AssistOptions } from './Assist'; | ||
private readonly onRelease; | ||
private readonly onBusy; | ||
private mouse; | ||
status: RCStatus; | ||
private agentID; | ||
constructor(options: AssistOptions, onGrand: (id: string) => string | undefined, onRelease: (id?: string | null, isDenied?: boolean) => void); | ||
constructor(options: AssistOptions, onGrand: (id: string) => string | undefined, onRelease: (id?: string | null, isDenied?: boolean) => void, onBusy: (id?: string) => void); | ||
reconnect(ids: string[]): void; | ||
@@ -17,0 +18,0 @@ private confirm; |
@@ -19,6 +19,7 @@ "use strict"; | ||
class RemoteControl { | ||
constructor(options, onGrand, onRelease) { | ||
constructor(options, onGrand, onRelease, onBusy) { | ||
this.options = options; | ||
this.onGrand = onGrand; | ||
this.onRelease = onRelease; | ||
this.onBusy = onBusy; | ||
this.mouse = null; | ||
@@ -29,2 +30,5 @@ this.status = RCStatus.Disabled; | ||
this.requestControl = (id) => { | ||
if (this.status === RCStatus.Enabled) { | ||
return this.onBusy(id); | ||
} | ||
if (this.agentID !== null) { | ||
@@ -31,0 +35,0 @@ this.releaseControl(); |
@@ -27,3 +27,3 @@ import type { Properties } from 'csstype'; | ||
private readonly noSecureMode; | ||
readonly version = "6.0.0"; | ||
readonly version = "6.0.1"; | ||
private socket; | ||
@@ -30,0 +30,0 @@ private peer; |
@@ -23,3 +23,3 @@ import { connect, } from 'socket.io-client'; | ||
this.noSecureMode = noSecureMode; | ||
this.version = '6.0.0'; | ||
this.version = '6.0.1'; | ||
this.socket = null; | ||
@@ -136,3 +136,3 @@ this.peer = null; | ||
} | ||
this.agents[id].onControlReleased = this.options.onRemoteControlStart((_a = this.agents[id]) === null || _a === void 0 ? void 0 : _a.agentInfo); | ||
this.agents[id] = Object.assign(Object.assign({}, this.agents[id]), { onControlReleased: this.options.onRemoteControlStart((_a = this.agents[id]) === null || _a === void 0 ? void 0 : _a.agentInfo) }); | ||
this.emit('control_granted', id); | ||
@@ -167,3 +167,3 @@ annot = new AnnotationCanvas(); | ||
}; | ||
this.remoteControl = new RemoteControl(this.options, onGrand, (id, isDenied) => onRelease(id, isDenied)); | ||
this.remoteControl = new RemoteControl(this.options, onGrand, (id, isDenied) => onRelease(id, isDenied), (id) => this.emit('control_busy', id)); | ||
const onAcceptRecording = () => { | ||
@@ -212,13 +212,15 @@ socket.emit('recording_accepted'); | ||
}; | ||
this.assistDemandedRestart = true; | ||
this.app.stop(); | ||
setTimeout(() => { | ||
this.app.start().then(() => { this.assistDemandedRestart = false; }) | ||
.then(() => { | ||
var _a; | ||
(_a = this.remoteControl) === null || _a === void 0 ? void 0 : _a.reconnect([id,]); | ||
}) | ||
.catch(e => app.debug.error(e)); | ||
// TODO: check if it's needed; basically allowing some time for the app to finish everything before starting again | ||
}, 500); | ||
if (this.app.active()) { | ||
this.assistDemandedRestart = true; | ||
this.app.stop(); | ||
setTimeout(() => { | ||
this.app.start().then(() => { this.assistDemandedRestart = false; }) | ||
.then(() => { | ||
var _a; | ||
(_a = this.remoteControl) === null || _a === void 0 ? void 0 : _a.reconnect([id,]); | ||
}) | ||
.catch(e => app.debug.error(e)); | ||
// TODO: check if it's needed; basically allowing some time for the app to finish everything before starting again | ||
}, 400); | ||
} | ||
}); | ||
@@ -234,13 +236,15 @@ socket.on('AGENTS_CONNECTED', (ids) => { | ||
}); | ||
this.assistDemandedRestart = true; | ||
this.app.stop(); | ||
setTimeout(() => { | ||
this.app.start().then(() => { this.assistDemandedRestart = false; }) | ||
.then(() => { | ||
var _a; | ||
(_a = this.remoteControl) === null || _a === void 0 ? void 0 : _a.reconnect(ids); | ||
}) | ||
.catch(e => app.debug.error(e)); | ||
// TODO: check if it's needed; basically allowing some time for the app to finish everything before starting again | ||
}, 500); | ||
if (this.app.active()) { | ||
this.assistDemandedRestart = true; | ||
this.app.stop(); | ||
setTimeout(() => { | ||
this.app.start().then(() => { this.assistDemandedRestart = false; }) | ||
.then(() => { | ||
var _a; | ||
(_a = this.remoteControl) === null || _a === void 0 ? void 0 : _a.reconnect(ids); | ||
}) | ||
.catch(e => app.debug.error(e)); | ||
// TODO: check if it's needed; basically allowing some time for the app to finish everything before starting again | ||
}, 400); | ||
} | ||
}); | ||
@@ -424,5 +428,4 @@ socket.on('AGENT_DISCONNECTED', (id) => { | ||
} | ||
// UI | ||
if (!callUI) { | ||
callUI = new CallWindow(app.debug.error, this.options.callUITemplate); | ||
callUI = new CallWindow(console.log, this.options.callUITemplate); | ||
callUI.setVideoToggleCallback(updateVideoFeed); | ||
@@ -471,2 +474,3 @@ } | ||
}).catch(reason => { | ||
console.log(reason); | ||
app.debug.log(reason); | ||
@@ -473,0 +477,0 @@ }); |
@@ -48,3 +48,5 @@ import attachDND from './dnd.js'; | ||
const assistSection = doc.getElementById('or-assist'); | ||
assistSection === null || assistSection === void 0 ? void 0 : assistSection.classList.remove('status-connecting'); | ||
setTimeout(() => { | ||
assistSection === null || assistSection === void 0 ? void 0 : assistSection.classList.remove('status-connecting'); | ||
}, 0); | ||
//iframe.style.height = doc.body.scrollHeight + 'px'; | ||
@@ -97,2 +99,7 @@ //iframe.style.width = doc.body.scrollWidth + 'px'; | ||
} | ||
setTimeout(() => { | ||
const assistSection = doc.getElementById('or-assist'); | ||
assistSection === null || assistSection === void 0 ? void 0 : assistSection.classList.remove('status-connecting'); | ||
this.adjustIframeSize(); | ||
}, 250); | ||
}); | ||
@@ -99,0 +106,0 @@ //this.toggleVideoUI(false) |
@@ -11,6 +11,7 @@ import type { Options as AssistOptions } from './Assist'; | ||
private readonly onRelease; | ||
private readonly onBusy; | ||
private mouse; | ||
status: RCStatus; | ||
private agentID; | ||
constructor(options: AssistOptions, onGrand: (id: string) => string | undefined, onRelease: (id?: string | null, isDenied?: boolean) => void); | ||
constructor(options: AssistOptions, onGrand: (id: string) => string | undefined, onRelease: (id?: string | null, isDenied?: boolean) => void, onBusy: (id?: string) => void); | ||
reconnect(ids: string[]): void; | ||
@@ -17,0 +18,0 @@ private confirm; |
@@ -16,6 +16,7 @@ import Mouse from './Mouse.js'; | ||
export default class RemoteControl { | ||
constructor(options, onGrand, onRelease) { | ||
constructor(options, onGrand, onRelease, onBusy) { | ||
this.options = options; | ||
this.onGrand = onGrand; | ||
this.onRelease = onRelease; | ||
this.onBusy = onBusy; | ||
this.mouse = null; | ||
@@ -26,2 +27,5 @@ this.status = RCStatus.Disabled; | ||
this.requestControl = (id) => { | ||
if (this.status === RCStatus.Enabled) { | ||
return this.onBusy(id); | ||
} | ||
if (this.agentID !== null) { | ||
@@ -28,0 +32,0 @@ this.releaseControl(); |
{ | ||
"name": "@openreplay/tracker-assist", | ||
"description": "Tracker plugin for screen assistance through the WebRTC", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "WebRTC", |
173894
3901