Kanagaraj M has uploaded a new change for review. Change subject: webadmin: Cluster compatibility check for volume advanced details ......................................................................
webadmin: Cluster compatibility check for volume advanced details 1.Cluster Services sub-tab will be hidden if a cluster with compatibility version less than 3.2 is selected. 2.When clicking the Brick advanced details button, if the cluster comp version is less than 3.2, an error message will be shown. Change-Id: I6c4bf5e581facca0397bf02159b0e892630c2739 Signed-off-by: Kanagaraj M <kmayi...@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Messages.java 3 files changed, 38 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/44/12944/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java index 2fc6a9c..33b4547 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java @@ -226,7 +226,10 @@ @Override protected void UpdateDetailsAvailability() { super.UpdateDetailsAvailability(); - getClusterServiceModel().setIsAvailable(((VDSGroup) getSelectedItem()).supportsGlusterService()); + VDSGroup vdsGroup = (VDSGroup) getSelectedItem(); + getClusterServiceModel().setIsAvailable(vdsGroup.supportsGlusterService() + && vdsGroup.getcompatibility_version() != null + && Version.v3_2.compareTo(vdsGroup.getcompatibility_version()) <= 0); } @Override diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java index 645190a..faca036 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java @@ -21,6 +21,7 @@ import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType; import org.ovirt.engine.core.common.businessentities.gluster.Mempool; import org.ovirt.engine.core.common.queries.VdcQueryReturnValue; +import org.ovirt.engine.core.compat.Version; import org.ovirt.engine.ui.frontend.AsyncQuery; import org.ovirt.engine.ui.frontend.Frontend; import org.ovirt.engine.ui.frontend.INewAsyncCallback; @@ -774,7 +775,36 @@ } private void showBrickAdvancedDetails() { - GlusterVolumeEntity volumeEntity = (GlusterVolumeEntity) getEntity(); + final GlusterVolumeEntity volumeEntity = (GlusterVolumeEntity) getEntity(); + AsyncDataProvider.GetClusterById(new AsyncQuery(this, new INewAsyncCallback() { + @Override + public void OnSuccess(Object target, Object returnValue) { + VDSGroup vdsGroup = (VDSGroup) returnValue; + if (vdsGroup.getcompatibility_version() != null + && Version.v3_2.compareTo(vdsGroup.getcompatibility_version()) <= 0) { + onShowBrickAdvancedDetails(volumeEntity); + } + else { + ConfirmationModel model = new ConfirmationModel(); + setWindow(model); + model.setTitle(ConstantsManager.getInstance().getConstants().advancedDetailsBrickTitle()); + model.setMessage(ConstantsManager.getInstance() + .getMessages() + .brickDetailsNotSupportedInClusterCompatibilityVersion(vdsGroup.getcompatibility_version() + .toString())); + model.setHashName("brick_details_not_supported"); //$NON-NLS-1$ + + UICommand command = new UICommand("Cancel", VolumeBrickListModel.this); //$NON-NLS-1$ + command.setTitle(ConstantsManager.getInstance().getConstants().close()); + command.setIsCancel(true); + model.getCommands().add(command); + } + } + }), volumeEntity.getClusterId()); + + } + + private void onShowBrickAdvancedDetails(GlusterVolumeEntity volumeEntity) { final GlusterBrickEntity brickEntity = (GlusterBrickEntity) getSelectedItem(); final BrickAdvancedDetailsModel brickModel = new BrickAdvancedDetailsModel(); diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Messages.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Messages.java index b2aa57f..30aff75 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Messages.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Messages.java @@ -255,4 +255,7 @@ @DefaultMessage("Custom({0})") String customSpmPriority(int priority); + + @DefaultMessage("Brick Details not supported for this Cluster''s compatibility version({0}).") + String brickDetailsNotSupportedInClusterCompatibilityVersion(String version); } -- To view, visit http://gerrit.ovirt.org/12944 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c4bf5e581facca0397bf02159b0e892630c2739 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Kanagaraj M <kmayi...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches