From e1f76105e788dba2df22e6e6e55722b3d88bd78e Mon Sep 17 00:00:00 2001 From: dushixiang Date: Fri, 12 Feb 2021 19:58:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=85=A5=E6=97=B6?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=97=A0=E6=B3=95=E8=BE=93=E5=87=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.sum | 1 + web/src/common/constants.js | 26 ++++++++++----------- web/src/components/access/Access.js | 10 +++++++- web/src/components/session/OnlineSession.js | 2 +- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/go.sum b/go.sum index 88fa70a..ffa85e4 100644 --- a/go.sum +++ b/go.sum @@ -184,6 +184,7 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E= github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= diff --git a/web/src/common/constants.js b/web/src/common/constants.js index 2d8289f..7c151b5 100644 --- a/web/src/common/constants.js +++ b/web/src/common/constants.js @@ -1,19 +1,19 @@ // prod -let wsPrefix; -if (window.location.protocol === 'https:') { - wsPrefix = 'wss:' -} else { - wsPrefix = 'ws:' -} - -export const server = ''; -export const wsServer = wsPrefix + window.location.host; -export const prefix = window.location.protocol + '//' + window.location.host; +// let wsPrefix; +// if (window.location.protocol === 'https:') { +// wsPrefix = 'wss:' +// } else { +// wsPrefix = 'ws:' +// } +// +// export const server = ''; +// export const wsServer = wsPrefix + window.location.host; +// export const prefix = window.location.protocol + '//' + window.location.host; // dev -// export const server = '//127.0.0.1:8088'; -// export const wsServer = 'ws://127.0.0.1:8088'; -// export const prefix = ''; +export const server = '//127.0.0.1:8088'; +export const wsServer = 'ws://127.0.0.1:8088'; +export const prefix = ''; export const PROTOCOL_COLORS = { 'rdp': 'red', diff --git a/web/src/components/access/Access.js b/web/src/components/access/Access.js index 5e063c9..e636a7c 100644 --- a/web/src/components/access/Access.js +++ b/web/src/components/access/Access.js @@ -47,7 +47,8 @@ class Access extends Component { uploadLoading: false, startTime: new Date(), fullScreen: false, - fullScreenBtnText: '进入全屏' + fullScreenBtnText: '进入全屏', + sink: undefined }; async componentDidMount() { @@ -434,6 +435,7 @@ class Access extends Component { containerWidth: width, containerHeight: height, keyboard: keyboard, + sink: sink }); } @@ -622,6 +624,9 @@ class Access extends Component { closable={true} // maskClosable={false} onClose={() => { + if (this.state.sink) { + this.state.sink.focus(); + } this.setState({ fileSystemVisible: false }); @@ -666,6 +671,9 @@ class Access extends Component { }} confirmLoading={this.state.confirmLoading} onCancel={() => { + if (this.state.sink) { + this.state.sink.focus(); + } this.setState({ clipboardVisible: false }) diff --git a/web/src/components/session/OnlineSession.js b/web/src/components/session/OnlineSession.js index cb5a0fe..9db32b7 100644 --- a/web/src/components/session/OnlineSession.js +++ b/web/src/components/session/OnlineSession.js @@ -280,7 +280,7 @@ class OnlineSession extends Component { return (
-