Frank Kobzik has uploaded a new change for review. Change subject: frontend: console native execution in iframes ......................................................................
frontend: console native execution in iframes currently when user runs a console using 'native' invocation, the request is made in a new tab. this patch changes the behavior and opens requests in iframes instead. this is more convenient as the execution doesn't open a new tab for every vm involved. Change-Id: I042213dd16fdab94b431ea0564a3780b79234e69 Signed-off-by: Frantisek Kobzik <[email protected]> Bug-Url: https://bugzilla.redhat.com/1052077 --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ConsoleModel.java 1 file changed, 14 insertions(+), 19 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/03/23203/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ConsoleModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ConsoleModel.java index 4170f5d..6b6b176 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ConsoleModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ConsoleModel.java @@ -1,5 +1,12 @@ package org.ovirt.engine.ui.uicommonweb.models.vms; +import com.google.gwt.dom.client.FormElement; +import com.google.gwt.user.client.ui.FlowPanel; +import com.google.gwt.user.client.ui.FormPanel; +import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent; +import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler; +import com.google.gwt.user.client.ui.RootPanel; +import com.google.gwt.user.client.ui.TextArea; import org.ovirt.engine.core.common.businessentities.VM; import org.ovirt.engine.core.common.businessentities.VMStatus; import org.ovirt.engine.core.common.queries.HasAdElementReconnectPermissionParameters; @@ -17,15 +24,6 @@ import org.ovirt.engine.ui.uicompat.Event; import org.ovirt.engine.ui.uicompat.EventDefinition; import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs; - -import com.google.gwt.dom.client.FormElement; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.FormPanel; -import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent; -import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler; -import com.google.gwt.user.client.ui.NamedFrame; -import com.google.gwt.user.client.ui.RootPanel; -import com.google.gwt.user.client.ui.TextArea; public abstract class ConsoleModel extends EntityModel { public static final String EjectLabel = "[" + ConstantsManager.getInstance().getConstants().eject() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ @@ -272,32 +270,29 @@ } public static void makeConsoleConfigRequest(String fileName, String contentType, String configFileContent) { - // open form always in a new window - final FormPanel formPanel = new FormPanel(new NamedFrame("_blank")); //$NON-NLS-1$ - formPanel.setMethod(FormPanel.METHOD_POST); - final FlowPanel innerPanel = new FlowPanel(); innerPanel.add(buildTextArea("contenttype", contentType));//$NON-NLS-1$ innerPanel.add(buildTextArea("content", configFileContent));//$NON-NLS-1$ innerPanel.add(buildTextArea("encodingtype", "plain"));//$NON-NLS-1$ $NON-NLS-2$ + final FormPanel formPanel = new FormPanel(); //$NON-NLS-1$ + formPanel.setMethod(FormPanel.METHOD_POST); + formPanel.getElement().setId("conform" + Double.valueOf(Math.random()).toString());//$NON-NLS-1$ formPanel.setWidget(innerPanel); formPanel.setAction(GET_ATTACHMENT_SERVLET_URL + fileName); - formPanel.setVisible(false); - - final FormElement form = FormElement.as(formPanel.getElement()); formPanel.setEncoding(FormPanel.ENCODING_URLENCODED); - RootPanel.getBodyElement().appendChild(form); + formPanel.setVisible(false); // clean-up after form submit formPanel.addSubmitCompleteHandler(new SubmitCompleteHandler() { @Override public void onSubmitComplete(SubmitCompleteEvent event) { - RootPanel.getBodyElement().removeChild(form); + RootPanel.get().remove(formPanel); } }); - form.submit(); + RootPanel.get().add(formPanel); + FormElement.as(formPanel.getElement()).submit(); } private static TextArea buildTextArea(String name, String value) { -- To view, visit http://gerrit.ovirt.org/23203 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I042213dd16fdab94b431ea0564a3780b79234e69 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.3 Gerrit-Owner: Frank Kobzik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
