1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Update spice-html5

This commit is contained in:
catborise 2020-01-23 15:49:43 +03:00
parent 34394c2b5e
commit 562fe5c3dc
36 changed files with 59278 additions and 1325 deletions
static/js/spice-html5

View file

@ -19,6 +19,11 @@
along with spice-html5. If not, see <http://www.gnu.org/licenses/>.
*/
import { Constants } from './enums.js';
import { DEBUG } from './utils.js';
import { SpiceConn } from './spiceconn.js';
import { SpiceMsgPortInit } from './spicemsg.js';
/*----------------------------------------------------------------------------
** SpicePortConn
** Drive the Spice Port Channel
@ -34,7 +39,7 @@ SpicePortConn.prototype = Object.create(SpiceConn.prototype);
SpicePortConn.prototype.process_channel_message = function(msg)
{
if (msg.type == SPICE_MSG_PORT_INIT)
if (msg.type == Constants.SPICE_MSG_PORT_INIT)
{
if (this.port_name === null)
{
@ -47,7 +52,7 @@ SpicePortConn.prototype.process_channel_message = function(msg)
DEBUG > 0 && console.log('SPICE port: Port', this.port_name, 'is already initialized.');
}
else if (msg.type == SPICE_MSG_PORT_EVENT)
else if (msg.type == Constants.SPICE_MSG_PORT_EVENT)
{
DEBUG > 0 && console.log('SPICE port: Port event received for', this.portName, msg);
var event = new CustomEvent('spice-port-event', {
@ -62,7 +67,7 @@ SpicePortConn.prototype.process_channel_message = function(msg)
window.dispatchEvent(event);
return true;
}
else if (msg.type == SPICE_MSG_SPICEVMC_DATA)
else if (msg.type == Constants.SPICE_MSG_SPICEVMC_DATA)
{
DEBUG > 0 && console.log('SPICE port: Data received in port', this.portName, msg);
var event = new CustomEvent('spice-port-data', {
@ -83,3 +88,7 @@ SpicePortConn.prototype.process_channel_message = function(msg)
return false;
};
export {
SpicePortConn,
};