Skip to content

Commit 3b38a43

Browse files
Merge pull request #1704 from Fryguy/vnc-viewer
Fix missing VNC viewer
2 parents 49bf53b + 0ea58ba commit 3b38a43

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

client/app/services/consoles.service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function ConsolesFactory ($window, CollectionsApi, $timeout, $location, E
100100
}
101101

102102
function openVnc (results) {
103-
var url = '/ui/service/vendor/noVNC/vnc_auto.html' +
103+
var url = '/ui/service/vendor/noVNC/vnc_lite.html' +
104104
'?host=' + $location.host() +
105105
'&port=' + $location.port() +
106106
'&path=' + results.url +

config/webpack.dev.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ const CopyWebpackPlugin = require('copy-webpack-plugin')
77
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
88
const HtmlWebpackPlugin = require('html-webpack-plugin')
99

10+
// To download the noVNC viewer
11+
const SaveRemoteFilePlugin = require('save-remote-file-webpack-plugin')
12+
const execSync = require('child_process').execSync
13+
1014
const root = path.resolve(__dirname, '../client')
1115
const outputPath = process.env.BUILD_OUTPUT || '../../manageiq/public/ui/service'
1216
const dist = path.resolve(__dirname, outputPath)
@@ -183,6 +187,14 @@ module.exports = {
183187
].filter((x) => !!x),
184188
}),
185189

190+
// noVNC doesn't package the vnc_lite viewer that we need, so we have to
191+
// fetch it separately.
192+
new SaveRemoteFilePlugin({
193+
url: `https://raw.githubusercontent.com/novnc/noVNC/v${execSync(`yarn list --silent --pattern @novnc/novnc | cut -d '@' -f 3 | tr -d '\n'`, {encoding: 'utf-8'})}/vnc_lite.html`,
194+
filepath: 'vendor/noVNC/vnc_lite.html',
195+
hash: false
196+
}),
197+
186198
// Generate index.html from template with script/link tags for bundles
187199
new HtmlWebpackPlugin({
188200
base: '/',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
"sass": "~1.29.0",
120120
"sass-lint": "~1.13.1",
121121
"sass-loader": "~10.0.5",
122+
"save-remote-file-webpack-plugin": "^1.1.0",
122123
"shelljs": "~0.8.4",
123124
"sinon": "~9.2.1",
124125
"sinon-chai": "~3.5.0",

0 commit comments

Comments
 (0)