anmolbabu has uploaded a new change for review. Change subject: webadmin : Start geo-rep session ......................................................................
webadmin : Start geo-rep session Added Start geo-rep session action to geo-rep sub-tab. Change-Id: I46fbd79f714175e3ad3ce76d858714c6fec3fdde Signed-off-by: Anmol Babu <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/gluster/SubTabVolumeGeoRepView.java 2 files changed, 18 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/38/32538/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.java index 85252d7..abb3144 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.java @@ -4,9 +4,13 @@ import java.util.Collections; import java.util.List; +import org.ovirt.engine.core.common.action.VdcActionParametersBase; +import org.ovirt.engine.core.common.action.VdcActionType; +import org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionStartParameters; import org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession; import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity; import org.ovirt.engine.ui.frontend.AsyncQuery; +import org.ovirt.engine.ui.frontend.Frontend; import org.ovirt.engine.ui.frontend.INewAsyncCallback; import org.ovirt.engine.ui.uicommonweb.Linq; import org.ovirt.engine.ui.uicommonweb.UICommand; @@ -175,7 +179,7 @@ } else if(command.equals(getRemoveSessionCommand())) { } else if(command.equals(getStartSessionCommand())) { - + onStartGeoRepSession(); } else if(command.equals(getStopSessionCommand())) { } else if(command.equals(getSessionOptionsCommand())) { @@ -193,6 +197,18 @@ return volumeEntity; } + public void onStartGeoRepSession() { + if (getSelectedItems() == null) { + return; + } + ArrayList<VdcActionParametersBase> selectedSessions = new ArrayList<VdcActionParametersBase>(); + for(Object selectedItem : getSelectedItems()) { + GlusterGeoRepSession selectedSession = (GlusterGeoRepSession) selectedItem; + selectedSessions.add(new GlusterVolumeGeoRepSessionStartParameters(selectedSession.getMasterVolumeId(), selectedSession.getSlaveVolumeName(), selectedSession.getSlaveHostName())); + } + Frontend.getInstance().runMultipleAction(VdcActionType.GlusterVolumeGeoRepStart, selectedSessions); + } + public void setVolumeEntity(GlusterVolumeEntity volumeEntity) { this.volumeEntity = volumeEntity; updateActionAvailability(volumeEntity); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/gluster/SubTabVolumeGeoRepView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/gluster/SubTabVolumeGeoRepView.java index 167425a..4d989da 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/gluster/SubTabVolumeGeoRepView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/gluster/SubTabVolumeGeoRepView.java @@ -63,7 +63,7 @@ getTable().addActionButton(new WebAdminButtonDefinition<GlusterGeoRepSession>(constants.startGeoRepSession()) { @Override protected UICommand resolveCommand() { - return null; + return getDetailModel().getStartSessionCommand(); } }); -- To view, visit http://gerrit.ovirt.org/32538 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I46fbd79f714175e3ad3ce76d858714c6fec3fdde Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: anmolbabu <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
