Skip to content

Commit

Permalink
added novnc to its own bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
ohadlevy committed Apr 30, 2019
1 parent 4ee934a commit 50bdc2f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config/webpack.vendor.js
Expand Up @@ -67,5 +67,5 @@ module.exports = [
'jstz',
'urijs',
'uuid',
'@novnc/novnc/core/rfb.js',
// '@novnc/novnc/core/rfb.js',
];
25 changes: 14 additions & 11 deletions webpack/assets/javascripts/bundle_novnc.js
@@ -1,5 +1,3 @@
import RFB from '@novnc/novnc/core/rfb';

let rfb;
const StatusLevelLookup = {
failed: 'danger',
Expand Down Expand Up @@ -59,16 +57,21 @@ $(document).on('ContentLoad', () => {
const url = `${protocol}://${host}:${port}`;
const password = $('#vnc').attr('data-password');

rfb = new RFB(vncScreen.get(0), url, {
credentials: {
password,
},
});
import(/* webpackChunkName: "noVNC" */ '@novnc/novnc/core/rfb').then(
module => {
showStatus('disconnected', __('Loading...'));
const RFB = module.default;

rfb.addEventListener('connect', connectFinished);
rfb.addEventListener('disconnect', disconnectFinished);
rfb.addEventListener('securityfailure', securityFailed);
rfb = new RFB(vncScreen.get(0), url, {
credentials: {
password,
},
});

showStatus('disconnected', __('Loading...'));
rfb.addEventListener('connect', connectFinished);
rfb.addEventListener('disconnect', disconnectFinished);
rfb.addEventListener('securityfailure', securityFailed);
}
);
}
});

0 comments on commit 50bdc2f

Please sign in to comment.