Skip to content

Commit

Permalink
Merge pull request #45 from jumpserver/pr@dev@perf_use_player
Browse files Browse the repository at this point in the history
perf: sass替换node-sass;使用gua播放器时增加terminal类型的判断
  • Loading branch information
huailei000 authored Jun 20, 2023
2 parents 228c28a + 288f3d7 commit 5bf22e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jumperver_video_player",
"version": "0.1.8",
"version": "0.1.9",
"author": "OrangeM21 <[email protected]>",
"description": "An electron-vue project",
"license": null,
Expand Down Expand Up @@ -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",
Expand Down
16 changes: 11 additions & 5 deletions src/renderer/components/mainPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default {
filename: '',
fullscreenLoading: false,
version: Number,
jsonData: ''
jsonData: {}
}
},
methods: {
Expand Down Expand Up @@ -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) {
Expand All @@ -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('请先上传文件')
Expand Down

0 comments on commit 5bf22e6

Please sign in to comment.