Sahina Bose has uploaded a new change for review. Change subject: webadmin: UI button to refresh geo-rep sessions ......................................................................
webadmin: UI button to refresh geo-rep sessions Added a button in the Geo-replication sub-tab that will enable users to invoke syncing of geo-replication sessions for a volume with Gluster backend. Change-Id: Ia15b611a0a5ceae6678062f7f789d0642aa757f9 Signed-off-by: Sahina Bose <[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/ApplicationConstants.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/gluster/SubTabVolumeGeoRepView.java 3 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/93/39593/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 82cff9c..d184e93 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,12 @@ import java.util.Collections; import java.util.List; +import org.ovirt.engine.core.common.action.VdcActionType; +import org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters; 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; @@ -24,6 +27,7 @@ private UICommand stopSessionCommand; private UICommand sessionOptionsCommand; private UICommand viewSessionDetailsCommand; + private UICommand refreshSessionsCommand; @Override @@ -41,6 +45,7 @@ setStopSessionCommand(new UICommand("stopSession", this));//$NON-NLS-1$ setSessionOptionsCommand(new UICommand("sessionOptions", this));//$NON-NLS-1$ setViewSessionDetailsCommand(new UICommand("viewSessionDetails", this));//$NON-NLS-1$ + setRefreshSessionsCommand(new UICommand("refreshSessions", this));//$NON-NLS-1$ } public UICommand getViewSessionDetailsCommand() { @@ -89,6 +94,14 @@ public void setSessionOptionsCommand(UICommand optionsCommand) { this.sessionOptionsCommand = optionsCommand; + } + + public UICommand getRefreshSessionsCommand() { + return refreshSessionsCommand; + } + + public void setRefreshSessionsCommand(UICommand optionsCommand) { + this.refreshSessionsCommand = optionsCommand; } @Override @@ -148,6 +161,7 @@ getStopSessionCommand().setIsAvailable(false); getSessionOptionsCommand().setIsAvailable(false); getViewSessionDetailsCommand().setIsAvailable(false); + getRefreshSessionsCommand().setIsAvailable(true); } @Override @@ -165,6 +179,8 @@ } else if(command.equals(getViewSessionDetailsCommand())) { + } else if (command.equals(getRefreshSessionsCommand())) { + refreshSessions(); } } @@ -172,6 +188,11 @@ } + private void refreshSessions() { + Frontend.getInstance().runAction(VdcActionType.RefreshGeoRepSessions, + new GlusterVolumeParameters(getEntity().getId())); + } + @Override public GlusterVolumeEntity getEntity() { 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 eeff2f0..302f510 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 @@ -136,6 +136,9 @@ @DefaultStringValue("View Details") String geoRepSessionDetails(); + @DefaultStringValue("Sync") + String geoRepSessionSync(); + @DefaultStringValue("Permissions") String volumePermissionSubTabLabel(); 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 28a404d..5844408 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 @@ -98,5 +98,14 @@ return null; } }); + + getTable().addActionButton( + new WebAdminButtonDefinition<GlusterGeoRepSession>(constants + .geoRepSessionSync()) { + @Override + protected UICommand resolveCommand() { + return getDetailModel().getRefreshSessionsCommand(); + } + }); } } -- To view, visit https://gerrit.ovirt.org/39593 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia15b611a0a5ceae6678062f7f789d0642aa757f9 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5-gluster Gerrit-Owner: Sahina Bose <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
