Alona Kaplan has uploaded a new change for review. Change subject: webadmin: add gateway to edit network from setup networks dialog (wip) ......................................................................
webadmin: add gateway to edit network from setup networks dialog (wip) When editing an IP configuration, we need to enable the gateway field for all networks, not only ovirtmgmt. If the user chose static IP, then the gateway field should be added and be editable. If DHCP was chosen then the gateway field should be visible and display the gateway configured via DHCP. Change-Id: Ie87f8fa3827b216483b553a8e36011382930585c Signed-off-by: Alona Kaplan <alkap...@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostManagementNetworkModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/LogicalNetworkModel.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostBondPopupView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.ui.xml M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostManagementPopupView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/SetupNetworksInterfacePopupView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/panels/ItemInfoPopup.java 11 files changed, 39 insertions(+), 12 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/68/15168/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceModel.java index fe0ad19..64bdc67 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostInterfaceModel.java @@ -222,6 +222,18 @@ this.originalNetParams = originalNetParams; } + private EntityModel privateGateway; + + public EntityModel getGateway() + { + return privateGateway; + } + + private void setGateway(EntityModel value) + { + privateGateway = value; + } + public HostInterfaceModel() { this(false); } @@ -231,6 +243,7 @@ setSetupNetworkMode(compactMode); setAddress(new EntityModel()); setSubnet(new EntityModel()); + setGateway(new EntityModel()); setNetwork(new ListModel()); getNetwork().getSelectedItemChangedEvent().addListener(this); setName(new EntityModel()); @@ -267,6 +280,7 @@ setBootProtocol(originalNetParams.getBootProtocol()); getAddress().setEntity(originalNetParams.getAddress()); getSubnet().setEntity(originalNetParams.getSubnet()); + getGateway().setEntity(originalNetParams.getGateway()); } } @@ -313,6 +327,7 @@ getAddress().setIsValid(true); getSubnet().setIsValid(true); + getGateway().setIsValid(true); } private void updateCanSpecify() @@ -321,6 +336,7 @@ boolean isChangable = bootProtocolsAvailable && getIsStaticAddress(); getAddress().setIsChangable(isChangable); getSubnet().setIsChangable(isChangable); + getGateway().setIsChangable(isChangable); } public boolean validate() @@ -329,14 +345,16 @@ getAddress().setIsValid(true); getSubnet().setIsValid(true); + getGateway().setIsValid(true); Network net = (Network) getNetwork().getSelectedItem(); if (getIsStaticAddress()) { getAddress().validateEntity(new IValidation[] { new NotEmptyValidation(), new IpAddressValidation() }); getSubnet().validateEntity(new IValidation[] { new NotEmptyValidation(), new SubnetMaskValidation() }); + getGateway().validateEntity(new IValidation[] { new IpAddressValidation() }); } - return getNetwork().getIsValid() && getAddress().getIsValid() && getSubnet().getIsValid(); + return getNetwork().getIsValid() && getAddress().getIsValid() && getSubnet().getIsValid() && getGateway().getIsValid(); } } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostManagementNetworkModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostManagementNetworkModel.java index 2698ae8..6005c5d 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostManagementNetworkModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostManagementNetworkModel.java @@ -298,6 +298,7 @@ getAddress().setIsValid(true); getSubnet().setIsValid(true); + getGateway().setIsValid(true); if (getIsStaticAddress()) { diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java index dac225a..956071e 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostSetupNetworksModel.java @@ -308,6 +308,7 @@ networkDialogModel.setOriginalNetParams(netToBeforeSyncParams.get(logicalNetwork.getName())); networkDialogModel.getAddress().setEntity(entity.getAddress()); networkDialogModel.getSubnet().setEntity(entity.getSubnet()); + networkDialogModel.getGateway().setEntity(entity.getGateway()); networkDialogModel.getName().setIsAvailable(false); networkDialogModel.getBondingOptions().setIsAvailable(false); @@ -330,6 +331,7 @@ entity.setBootProtocol(networkDialogModel.getBootProtocol()); entity.setAddress((String) networkDialogModel.getAddress().getEntity()); entity.setSubnet((String) networkDialogModel.getSubnet().getEntity()); + entity.setGateway((String) networkDialogModel.getGateway().getEntity()); if ((Boolean) networkDialogModel.getIsToSync().getEntity()) { HostSetupNetworksModel.this.networksToSync.add(logicalNetwork.getName()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/LogicalNetworkModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/LogicalNetworkModel.java index 26c2799..8b6600b 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/LogicalNetworkModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/LogicalNetworkModel.java @@ -127,14 +127,12 @@ netParams.setBootProtocol(nicEntity.getBootProtocol()); netParams.setAddress(nicEntity.getAddress()); netParams.setSubnet(nicEntity.getSubnet()); + netParams.setGateway(nicEntity.getGateway()); } else { netParams.setBootProtocol(vlanNic.getEntity().getBootProtocol()); netParams.setAddress(vlanNic.getEntity().getAddress()); netParams.setSubnet(vlanNic.getEntity().getSubnet()); - } - - if (isManagement()) { - netParams.setGateway(!hasVlan() ? nicEntity.getGateway() : vlanNic.getEntity().getGateway()); + netParams.setGateway(vlanNic.getEntity().getGateway()); } getSetupModel().getNetworkToLastDetachParams().put(getName(), netParams); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java index 6f09656..142e393 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java @@ -2018,8 +2018,8 @@ @DefaultStringValue("Subnet Mask") String subnetMaskHostPopup(); - @DefaultStringValue("Default Gateway") - String defaultGwHostPopup(); + @DefaultStringValue("Gateway") + String gwHostPopup(); @DefaultStringValue("Verify connectivity between Host and Engine") String checkConHostPopup(); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostBondPopupView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostBondPopupView.java index 2d8d0cb..36c8a03 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostBondPopupView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostBondPopupView.java @@ -166,7 +166,7 @@ bootProtocolLabel.asEditor().getSubEditor().setValue(" "); //$NON-NLS-1$ address.setLabel(constants.ipHostPopup() + ":"); //$NON-NLS-1$ subnet.setLabel(constants.subnetMaskHostPopup() + ":"); //$NON-NLS-1$ - gateway.setLabel(constants.defaultGwHostPopup() + ":"); //$NON-NLS-1$ + gateway.setLabel(constants.gwHostPopup() + ":"); //$NON-NLS-1$ checkConnectivity.setLabel(constants.checkConHostPopup()); info.setHTML(constants.changesTempHostPopup()); commitChanges.setLabel(constants.saveNetConfigHostPopup()); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.java index c39714f..8bf84f7 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.java @@ -79,6 +79,10 @@ @Path(value = "subnet.entity") EntityModelTextBoxEditor subnet; + @UiField + @Path(value = "gateway.entity") + EntityModelTextBoxEditor gateway; + @UiField(provided = true) @Path(value = "checkConnectivity.entity") EntityModelCheckBoxEditor checkConnectivity; @@ -165,6 +169,7 @@ customEditor.setLabel(constants.customModeHostPopup() + ":"); //$NON-NLS-1$ address.setLabel(constants.ipHostPopup() + ":"); //$NON-NLS-1$ subnet.setLabel(constants.subnetMaskHostPopup() + ":"); //$NON-NLS-1$ + gateway.setLabel(constants.gwHostPopup() + ":"); //$NON-NLS-1$ checkConnectivity.setLabel(constants.checkConHostPopup() + ":"); //$NON-NLS-1$ info.setHTML(constants.changesTempHostPopup()); isToSync.setLabel(constants.syncNetwork()); @@ -232,6 +237,8 @@ isToSync.setVisible(false); isToSyncInfo.setVisible(false); + + gateway.setVisible(false); } @Override diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.ui.xml b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.ui.xml index 1077925..f9d5544 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.ui.xml +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInterfacePopupView.ui.xml @@ -27,6 +27,7 @@ <we:EnumRadioEditor ui:field="bootProtocol" /> <e:EntityModelTextBoxEditor ui:field="address" /> <e:EntityModelTextBoxEditor ui:field="subnet" /> + <e:EntityModelTextBoxEditor ui:field="gateway" /> <g:HorizontalPanel> <e:EntityModelCheckBoxEditor ui:field="isToSync" /> <d:InfoIcon ui:field="isToSyncInfo"/> diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostManagementPopupView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostManagementPopupView.java index 5ed539c..48af599 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostManagementPopupView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostManagementPopupView.java @@ -170,7 +170,7 @@ customEditor.setLabel(constants.customModeHostPopup() + ":"); //$NON-NLS-1$ address.setLabel(constants.ipHostPopup() + ":"); //$NON-NLS-1$ subnet.setLabel(constants.subnetMaskHostPopup() + ":"); //$NON-NLS-1$ - gateway.setLabel(constants.defaultGwHostPopup() + ":"); //$NON-NLS-1$ + gateway.setLabel(constants.gwHostPopup() + ":"); //$NON-NLS-1$ checkConnectivity.setLabel(constants.checkConHostPopup()); //$NON-NLS-1$ info.setHTML(constants.changesTempHostPopup()); isToSync.setLabel(constants.syncNetwork()); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/SetupNetworksInterfacePopupView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/SetupNetworksInterfacePopupView.java index 685391f..2d93455 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/SetupNetworksInterfacePopupView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/SetupNetworksInterfacePopupView.java @@ -30,6 +30,8 @@ bondingModeEditor.setVisible(false); commitChanges.setVisible(false); + gateway.setVisible(true); + isToSync.setVisible(true); if (object.getIsToSync().getIsChangable()){ isToSyncInfo.setVisible(true); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/panels/ItemInfoPopup.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/panels/ItemInfoPopup.java index 436533d..5b2b1d5 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/panels/ItemInfoPopup.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/panels/ItemInfoPopup.java @@ -133,9 +133,7 @@ if (bootProtocol == NetworkBootProtocol.STATIC_IP) { addRow(constants.addressItemInfo(), entity.getAddress()); addRow(constants.subnetItemInfo(), entity.getSubnet()); - if (entity.getIsManagement()) { - addRow(constants.gatewayItemInfo(), entity.getGateway()); - } + addRow(constants.gatewayItemInfo(), entity.getGateway()); } if (nic instanceof BondNetworkInterfaceModel) { addRow(constants.bondOptionsItemInfo(), entity.getBondOptions()); -- To view, visit http://gerrit.ovirt.org/15168 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie87f8fa3827b216483b553a8e36011382930585c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alona Kaplan <alkap...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches