Tomas Jelinek has uploaded a new change for review. Change subject: webadmin,userportal: set up Proxy property to SPICE ......................................................................
webadmin,userportal: set up Proxy property to SPICE This patch reads the SpiceProxy property from vdc_options and sets it to the Proxy property of SPICE client(both cab and xpi). If the SpiceProxy is not set than nothing is set to the client. Change-Id: If269869413eae577fb243bffe849548f90ff8f4a Signed-off-by: Tomas Jelinek <tjeli...@redhat.com> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java 3 files changed, 30 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/93/12093/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java index 43b9ca2..a2c6a1a 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/SpiceInterfaceImpl.java @@ -61,6 +61,7 @@ ClientAgentType cat = new ClientAgentType(); private String spiceBaseURL; private boolean smartcardEnabled = false; + private String spiceProxy = null; // the user can choose to disable the smartcard even when it is enabled, but can not choose to enable it, when it is disabled private boolean smartcardEnabledOverridden = false; @@ -548,6 +549,7 @@ var smartcardEnabled = !!th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::passSmartcardOption()(); var colorDepth = th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::colorDepthAsInt()(); var disableEffects = th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::disbaleEffectsAsString()(); + var spiceProxy = th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::getSpiceProxy()(); var model = this; //alert("Smartcard ["+smartcardEnabled+"] disableEffects ["+disableEffects+"], wanOptionsEnabled ["+wanOptionsEnabled+"], colorDepth ["+colorDepth+"], Host IP ["+hostIp+"], port ["+port+"], fullScreen ["+fullScreen+"], password ["+password+"], numberOfMonitors ["+numberOfMonitors+"], Usb Listen Port ["+usbListenPort+"], Admin Console ["+adminConsole+"], Guest HostName ["+guestHostName+"], Secure Port ["+securePort+"], Ssl Chanels ["+sslChanels+"], cipherSuite ["+cipherSuite+"], Host Subject ["+hostSubject+"], Title [" + title+"], Hot Key ["+hotKey+"], Menu ["+menu+"], GuestID [" + guestID+"], version ["+version+"]"); @@ -581,6 +583,10 @@ if (wanOptionsEnabled) { client.DisableEffects = disableEffects; client.ColorDepth = colorDepth; + } + // set it only if the proxy is defined in VDC_OPTIONS + if (spiceProxy != null) { + client.Proxy = spiceProxy } client.connect(); @@ -655,6 +661,7 @@ var wanOptionsEnabled = th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::getIsWanOptionsEnabled()(); var colorDepth = th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::colorDepthAsInt()(); var disableEffects = th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::disbaleEffectsAsString()(); + var spiceProxy = th...@org.ovirt.engine.ui.common.uicommon.SpiceInterfaceImpl::getSpiceProxy()(); var codebase = spiceCabURL + "#version=" + version; var model = this; var id = "SpiceX_" + guestHostName; @@ -699,6 +706,11 @@ if (wanOptionsEnabled) { client.DisableEffects = disableEffects; client.ColorDepth = colorDepth; + } + + // only if the proxy is defined in VDC_OPTIONS + if (spiceProxy != null) { + client.Proxy = spiceProxy } client.attachEvent('ondisconnected', onDisconnected); @@ -808,4 +820,11 @@ return this.smartcardEnabledOverridden; } + public String getSpiceProxy() { + return spiceProxy; + } + + public void setSpiceProxy(String spiceProxy) { + this.spiceProxy = spiceProxy; + } } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java index fd67c01..a87b0c3 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ISpice.java @@ -145,9 +145,11 @@ public void setSmartcardEnabled(boolean enabled); - public boolean isSmartcardEnabled(); + boolean isSmartcardEnabled(); - public void setOverrideEnabledSmartcard(boolean enabled); + void setOverrideEnabledSmartcard(boolean enabled); - public boolean isSmartcardEnabledOverridden(); + boolean isSmartcardEnabledOverridden(); + + void setSpiceProxy(String spiceProxy); } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java index 84b927a..5855321 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java @@ -369,6 +369,12 @@ .getMessages() .pressKeyToReleaseCursor(releaseCursorKeysTranslated)))); + + // setup spice proxy + String spiceProxy = (String) AsyncDataProvider.GetConfigValuePreConverted(ConfigurationValues.SpiceProxy); + spiceProxy = "".equals(spiceProxy) ? null : spiceProxy; + getspice().setSpiceProxy(spiceProxy); + // If 'AdminConsole' is true, send true; otherwise, false should be sent only for VMs with SPICE driver // installed. getspice().setAdminConsole(getConfigurator().getSpiceAdminConsole() ? true : !getEntity().getHasSpiceDriver()); -- To view, visit http://gerrit.ovirt.org/12093 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If269869413eae577fb243bffe849548f90ff8f4a Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Tomas Jelinek <tjeli...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches