From 288f3d7d178b78bdeec25bb3e507c1c40a9ccd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Tue, 20 Jun 2023 16:49:35 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20sass=E6=9B=BF=E6=8D=A2node-sass?= =?UTF-8?q?=EF=BC=9B=E4=BD=BF=E7=94=A8gua=E6=92=AD=E6=94=BE=E5=99=A8?= =?UTF-8?q?=E6=97=B6=E5=A2=9E=E5=8A=A0terminal=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- src/renderer/components/mainPage.vue | 16 +++++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index b99bcfb..296308c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jumperver_video_player", - "version": "0.1.8", + "version": "0.1.9", "author": "OrangeM21 ", "description": "An electron-vue project", "license": null, @@ -130,8 +130,8 @@ "mocha": "^5.2.0", "multispinner": "^0.2.1", "node-loader": "^0.6.0", - "node-sass": "^4.9.2", - "sass-loader": "^7.0.3", + "sass": "^1.63.4", + "sass-loader": "^10.2.0", "style-loader": "^0.21.0", "url-loader": "^1.0.1", "vue-devtools": "^5.1.4", diff --git a/src/renderer/components/mainPage.vue b/src/renderer/components/mainPage.vue index 668bae2..de377d5 100644 --- a/src/renderer/components/mainPage.vue +++ b/src/renderer/components/mainPage.vue @@ -55,7 +55,7 @@ export default { filename: '', fullscreenLoading: false, version: Number, - jsonData: '' + jsonData: {} } }, methods: { @@ -107,15 +107,13 @@ export default { fs.readFile(jsonPath, 'utf-8', (_, basicData) => { try { this.jsonData = JSON.parse(basicData) + this.isUsingGuaPlayer() } catch (e) { this.$message.error('Json解析错误') } - if (this.jsonData.protocol === 'rdp' || this.jsonData.protocol === 'vnc') { - this.type = '2' - } }) } - return this.delay(5000).then(() => { + return this.delay(1000).then(() => { this.fullscreenLoading = false this.isPushed = true if (this.version === 1) { @@ -127,6 +125,14 @@ export default { this.$message.error('压缩和录像文件不符, 请重试') }) }, + isUsingGuaPlayer () { + const { terminal = {}, protocol = '' } = this.jsonData + const types = ['lion', 'guacamole', 'razor', 'xrdp'] + const protocols = ['rdp', 'vnc'] + if ((terminal.type && types.includes(terminal.type)) || protocols.includes(protocol)) { + this.type = '2' + } + }, play: function () { if (!this.isPushed) { this.$message.error('请先上传文件')