Sahina Bose has uploaded a new change for review. Change subject: webadmin: Bricks sub-tab under Hosts ......................................................................
webadmin: Bricks sub-tab under Hosts Adding a Bricks sub tab under Hosts to show list of bricks associated with the selected host Change-Id: Ic67c2aba2a5cd90832e6aa8c63c016ccef96ee50 Signed-off-by: Sahina Bose <sab...@redhat.com> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostBricksListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.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/gin/ClientGinjectorExtension.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/PresenterModule.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/HostModule.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/place/ApplicationPlaces.java A frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/host/SubTabHostBrickPresenter.java A frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostBrickView.java 11 files changed, 262 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/89/19989/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java index 8f360fc..64c541c 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.MissingResourceException; + import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.EventNotificationEntity; import org.ovirt.engine.core.common.TimeZoneType; @@ -49,7 +50,10 @@ import org.ovirt.engine.core.common.businessentities.VmTemplateStatus; import org.ovirt.engine.core.common.businessentities.VolumeFormat; import org.ovirt.engine.core.common.businessentities.VolumeType; +import org.ovirt.engine.core.common.businessentities.permissions; +import org.ovirt.engine.core.common.businessentities.tags; import org.ovirt.engine.core.common.businessentities.comparators.NameableComparator; +import org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity; import org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService; import org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity; import org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService; @@ -62,8 +66,6 @@ import org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface; import org.ovirt.engine.core.common.businessentities.network.VnicProfile; import org.ovirt.engine.core.common.businessentities.network.VnicProfileView; -import org.ovirt.engine.core.common.businessentities.permissions; -import org.ovirt.engine.core.common.businessentities.tags; import org.ovirt.engine.core.common.interfaces.SearchType; import org.ovirt.engine.core.common.mode.ApplicationMode; import org.ovirt.engine.core.common.queries.CommandVersionsInfo; @@ -1272,6 +1274,17 @@ Frontend.RunQuery(VdcQueryType.GetGlusterHooks, new GlusterParameters(clusterId), aQuery); } + public static void getGlusterBricksForServer(AsyncQuery aQuery, Guid serverId) { + aQuery.converterCallback = new IAsyncConverter() { + @Override + public Object Convert(Object source, AsyncQuery _asyncQuery) + { + return source != null ? source : new ArrayList<GlusterBrickEntity>(); + } + }; + Frontend.RunQuery(VdcQueryType.GetGlusterVolumeBricksByServerId, new IdQueryParameters(serverId), aQuery); + } + public static void getGlusterHook(AsyncQuery aQuery, Guid hookId, boolean includeServerHooks) { aQuery.converterCallback = new IAsyncConverter() { @Override diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostBricksListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostBricksListModel.java new file mode 100644 index 0000000..2d30f6b --- /dev/null +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostBricksListModel.java @@ -0,0 +1,87 @@ +package org.ovirt.engine.ui.uicommonweb.models.hosts; + +import java.util.List; + +import org.ovirt.engine.core.common.businessentities.VDS; +import org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity; +import org.ovirt.engine.core.common.mode.ApplicationMode; +import org.ovirt.engine.ui.frontend.AsyncQuery; +import org.ovirt.engine.ui.frontend.INewAsyncCallback; +import org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider; +import org.ovirt.engine.ui.uicommonweb.models.SearchableListModel; +import org.ovirt.engine.ui.uicompat.ConstantsManager; +import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs; + +@SuppressWarnings("unused") +public class HostBricksListModel extends SearchableListModel +{ + + @Override + public VDS getEntity() + { + return (VDS) super.getEntity(); + } + + public void setEntity(VDS value) + { + super.setEntity(value); + } + + public HostBricksListModel() + { + setTitle(ConstantsManager.getInstance().getConstants().hostBricksTitle()); + setHashName("host_bricks"); // $//$NON-NLS-1$ + setAvailableInModes(ApplicationMode.GlusterOnly); + } + + @Override + protected void onEntityChanged() + { + super.onEntityChanged(); + getSearchCommand().execute(); + } + + @Override + protected void entityPropertyChanged(Object sender, PropertyChangedEventArgs e) + { + super.entityPropertyChanged(sender, e); + + if (e.PropertyName.equals("status")) //$NON-NLS-1$ + { + getSearchCommand().execute(); + } + } + + @Override + public void search() + { + if (getEntity() != null) + { + super.search(); + } + } + + @Override + protected void syncSearch() + { + if (getEntity() == null) + { + return; + } + + AsyncDataProvider.getGlusterBricksForServer(new AsyncQuery(this, new INewAsyncCallback() { + + @Override + public void onSuccess(Object model, Object returnValue) { + List<GlusterBrickEntity> glusterBricks = (List<GlusterBrickEntity>) returnValue; + setItems(glusterBricks); + } + }), getEntity().getId()); + + } + + @Override + protected String getListName() { + return "HostBricksListModel"; //$NON-NLS-1$ + } +} diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java index ca88676..0aab5ae 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java @@ -306,6 +306,16 @@ this.glusterSwiftModel = glusterSwiftModel; } + private HostBricksListModel hostBricksListModel; + + public HostBricksListModel getHostBricksListModel() { + return hostBricksListModel; + } + + public void setHostBricksListModel(HostBricksListModel hostBricksListModel) { + this.hostBricksListModel = hostBricksListModel; + } + protected Object[] getSelectedKeys() { if (getSelectedItems() == null) @@ -1500,6 +1510,7 @@ generalModel.getRequestGOToEventsTabEvent().addListener(this); setGlusterSwiftModel(new HostGlusterSwiftListModel()); + setHostBricksListModel(new HostBricksListModel()); ObservableCollection<EntityModel> list = new ObservableCollection<EntityModel>(); list.add(generalModel); @@ -1510,6 +1521,7 @@ list.add(getHostEventListModel()); list.add(new HostHooksListModel()); list.add(getGlusterSwiftModel()); + list.add(getHostBricksListModel()); list.add(new PermissionListModel()); setDetailModels(list); } @@ -1520,6 +1532,7 @@ VDS vds = (VDS) getSelectedItem(); getGlusterSwiftModel().setIsAvailable(vds != null && vds.getVdsGroupSupportsGlusterService() && GlusterFeaturesUtil.isGlusterSwiftSupported(vds.getVdsGroupCompatibilityVersion())); + getHostBricksListModel().setIsAvailable(vds != null && vds.getVdsGroupSupportsGlusterService()); } @Override diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java index d90d7fb..07cc185 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java @@ -382,6 +382,9 @@ @DefaultStringValue("Host Hooks") String hostHooksTitle(); + @DefaultStringValue("Gluster Bricks") + String hostBricksTitle(); + @DefaultStringValue("Edit Management Network") String editManagementNetworkTitle(); 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 685b1ae..2d347b5 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 @@ -199,6 +199,7 @@ @DefaultStringValue("Network Label") String networkLabel(); + @Override @DefaultStringValue("Comment") String commentLabel(); @@ -408,6 +409,9 @@ @DefaultStringValue("Gluster Swift") String hostGlusterSwiftSubTabLabel(); + + @DefaultStringValue("Gluster Bricks") + String hostBricksSubTabLabel(); @DefaultStringValue("Permissions") String hostPermissionSubTabLabel(); @@ -2053,6 +2057,13 @@ @DefaultStringValue("Restart Swift") String restartGlusterSwiftInHost(); + // Host Bricks + @DefaultStringValue("Volume") + String volumeName(); + + @DefaultStringValue("Brick Directory") + String brickDirectory(); + // Group @DefaultStringValue("Group Name") String groupNameGroup(); @@ -2945,6 +2956,7 @@ @DefaultStringValue("free") String free(); + @Override @DefaultStringValue("Unknown") String unknown(); @@ -3190,6 +3202,7 @@ @DefaultStringValue("For allowing PK authentication, copy the following PK to host under .ssh/authorized_keys") String publicKeyUsage(); + @Override @DefaultStringValue("Network") String networkProfilePopup(); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/ClientGinjectorExtension.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/ClientGinjectorExtension.java index 48dcf8d..9aefb1c 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/ClientGinjectorExtension.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/ClientGinjectorExtension.java @@ -62,6 +62,7 @@ import org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeEventListModel; import org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeGeneralModel; import org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeParameterListModel; +import org.ovirt.engine.ui.uicommonweb.models.hosts.HostBricksListModel; import org.ovirt.engine.ui.uicommonweb.models.hosts.HostEventListModel; import org.ovirt.engine.ui.uicommonweb.models.hosts.HostGeneralModel; import org.ovirt.engine.ui.uicommonweb.models.hosts.HostHardwareGeneralModel; @@ -274,6 +275,8 @@ SearchableDetailModelProvider<AuditLog, HostListModel, HostEventListModel> getSubTabHostEventModelProvider(); + SearchableDetailModelProvider<GlusterBrickEntity, HostListModel, HostBricksListModel> getSubTabHostBricksModelProvider(); + // Pool DetailModelProvider<PoolListModel, PoolGeneralModel> getSubTabPoolGeneralModelProvider(); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/PresenterModule.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/PresenterModule.java index 12957b4..ce65c29 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/PresenterModule.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/PresenterModule.java @@ -143,6 +143,7 @@ import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.gluster.SubTabVolumePermissionPresenter; import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.gluster.VolumeSubTabPanelPresenter; import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.HostSubTabPanelPresenter; +import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostBrickPresenter; import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostEventPresenter; import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostGeneralPresenter; import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostGlusterSwiftPresenter; @@ -353,6 +354,7 @@ import org.ovirt.engine.ui.webadmin.section.main.view.tab.gluster.SubTabVolumePermissionView; import org.ovirt.engine.ui.webadmin.section.main.view.tab.gluster.VolumeSubTabPanelView; import org.ovirt.engine.ui.webadmin.section.main.view.tab.host.HostSubTabPanelView; +import org.ovirt.engine.ui.webadmin.section.main.view.tab.host.SubTabHostBrickView; import org.ovirt.engine.ui.webadmin.section.main.view.tab.host.SubTabHostEventView; import org.ovirt.engine.ui.webadmin.section.main.view.tab.host.SubTabHostGeneralView; import org.ovirt.engine.ui.webadmin.section.main.view.tab.host.SubTabHostGlusterSwiftView; @@ -700,6 +702,10 @@ SubTabHostEventPresenter.ViewDef.class, SubTabHostEventView.class, SubTabHostEventPresenter.ProxyDef.class); + bindPresenter(SubTabHostBrickPresenter.class, + SubTabHostBrickPresenter.ViewDef.class, + SubTabHostBrickView.class, + SubTabHostBrickPresenter.ProxyDef.class); // VirtualMachine bindPresenter(VirtualMachineSubTabPanelPresenter.class, diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/HostModule.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/HostModule.java index e021155..283ca32 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/HostModule.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/HostModule.java @@ -7,6 +7,7 @@ import org.ovirt.engine.core.common.businessentities.VDS; import org.ovirt.engine.core.common.businessentities.VM; import org.ovirt.engine.core.common.businessentities.permissions; +import org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity; import org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService; import org.ovirt.engine.core.compat.StringHelper; import org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget; @@ -27,6 +28,7 @@ import org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel; import org.ovirt.engine.ui.uicommonweb.models.gluster.HostGlusterSwiftListModel; import org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel; +import org.ovirt.engine.ui.uicommonweb.models.hosts.HostBricksListModel; import org.ovirt.engine.ui.uicommonweb.models.hosts.HostEventListModel; import org.ovirt.engine.ui.uicommonweb.models.hosts.HostGeneralModel; import org.ovirt.engine.ui.uicommonweb.models.hosts.HostHardwareGeneralModel; @@ -164,6 +166,15 @@ @Provides @Singleton + public SearchableDetailModelProvider<GlusterBrickEntity, HostListModel, HostBricksListModel> getHostBricksListProvider(EventBus eventBus, + Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider) { + return new SearchableDetailTabModelProvider<GlusterBrickEntity, HostListModel, HostBricksListModel>( + eventBus, defaultConfirmPopupProvider, + HostListModel.class, + HostBricksListModel.class); + } + @Provides + @Singleton public SearchableDetailModelProvider<HostInterfaceLineModel, HostListModel, HostInterfaceListModel> getHostInterfaceListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<DetachConfirmationPopupPresenterWidget> detachConfirmPopupProvider, diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/place/ApplicationPlaces.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/place/ApplicationPlaces.java index cfe157d..422a4aa 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/place/ApplicationPlaces.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/place/ApplicationPlaces.java @@ -175,6 +175,9 @@ public static final String hostGlusterSwiftSubTabPlace = hostMainTabPlace + SUB_TAB_PREFIX + "gluster_swift"; //$NON-NLS-1$ + public static final String hostBricksSubTabPlace = hostMainTabPlace + SUB_TAB_PREFIX + + "host_bricks"; //$NON-NLS-1$ + public static final String hostPermissionSubTabPlace = hostMainTabPlace + SUB_TAB_PREFIX + "permissions"; //$NON-NLS-1$ diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/host/SubTabHostBrickPresenter.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/host/SubTabHostBrickPresenter.java new file mode 100644 index 0000000..3b42448 --- /dev/null +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/host/SubTabHostBrickPresenter.java @@ -0,0 +1,59 @@ +package org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host; + +import org.ovirt.engine.core.common.businessentities.VDS; +import org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity; +import org.ovirt.engine.ui.common.place.PlaceRequestFactory; +import org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter; +import org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider; +import org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData; +import org.ovirt.engine.ui.uicommonweb.models.hosts.HostBricksListModel; +import org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel; +import org.ovirt.engine.ui.webadmin.ApplicationConstants; +import org.ovirt.engine.ui.webadmin.place.ApplicationPlaces; +import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.HostSelectionChangeEvent; + +import com.google.gwt.event.shared.EventBus; +import com.google.inject.Inject; +import com.gwtplatform.mvp.client.TabData; +import com.gwtplatform.mvp.client.annotations.NameToken; +import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit; +import com.gwtplatform.mvp.client.annotations.ProxyEvent; +import com.gwtplatform.mvp.client.annotations.TabInfo; +import com.gwtplatform.mvp.client.proxy.PlaceManager; +import com.gwtplatform.mvp.client.proxy.PlaceRequest; +import com.gwtplatform.mvp.client.proxy.TabContentProxyPlace; + +public class SubTabHostBrickPresenter extends AbstractSubTabPresenter<VDS, HostListModel, HostBricksListModel, SubTabHostBrickPresenter.ViewDef, SubTabHostBrickPresenter.ProxyDef> { + + @ProxyCodeSplit + @NameToken(ApplicationPlaces.hostBricksSubTabPlace) + public interface ProxyDef extends TabContentProxyPlace<SubTabHostBrickPresenter> { + } + + public interface ViewDef extends AbstractSubTabPresenter.ViewDef<VDS> { + } + + @TabInfo(container = HostSubTabPanelPresenter.class) + static TabData getTabData(ApplicationConstants applicationConstants, + SearchableDetailModelProvider<GlusterBrickEntity, HostListModel, HostBricksListModel> modelProvider) { + return new ModelBoundTabData(applicationConstants.hostBricksSubTabLabel(), 4, modelProvider); + } + + @Inject + public SubTabHostBrickPresenter(EventBus eventBus, ViewDef view, ProxyDef proxy, + PlaceManager placeManager, SearchableDetailModelProvider<GlusterBrickEntity, HostListModel, HostBricksListModel> modelProvider) { + super(eventBus, view, proxy, placeManager, modelProvider, + HostSubTabPanelPresenter.TYPE_SetTabContent); + } + + @Override + protected PlaceRequest getMainTabRequest() { + return PlaceRequestFactory.get(ApplicationPlaces.hostMainTabPlace); + } + + @ProxyEvent + public void onHostSelectionChange(HostSelectionChangeEvent event) { + updateMainTabSelection(event.getSelectedItems()); + } + +} diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostBrickView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostBrickView.java new file mode 100644 index 0000000..7a69611 --- /dev/null +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostBrickView.java @@ -0,0 +1,49 @@ +package org.ovirt.engine.ui.webadmin.section.main.view.tab.host; + +import javax.inject.Inject; + +import org.ovirt.engine.core.common.businessentities.VDS; +import org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity; +import org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider; +import org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip; +import org.ovirt.engine.ui.uicommonweb.models.hosts.HostBricksListModel; +import org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel; +import org.ovirt.engine.ui.webadmin.ApplicationConstants; +import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostBrickPresenter; +import org.ovirt.engine.ui.webadmin.section.main.view.AbstractSubTabTableView; +import org.ovirt.engine.ui.webadmin.widget.table.column.BrickStatusColumn; + +public class SubTabHostBrickView extends AbstractSubTabTableView<VDS, GlusterBrickEntity, HostListModel, HostBricksListModel> + implements SubTabHostBrickPresenter.ViewDef { + + @Inject + public SubTabHostBrickView(SearchableDetailModelProvider<GlusterBrickEntity, HostListModel, HostBricksListModel> modelProvider, ApplicationConstants constants) { + super(modelProvider); + initTable(constants); + initWidget(getTable()); + } + + void initTable(ApplicationConstants constants) { + getTable().enableColumnResizing(); + + getTable().addColumn(new BrickStatusColumn(), constants.empty(), "30px"); //$NON-NLS-1$ + + TextColumnWithTooltip<GlusterBrickEntity> volNameColumn = new TextColumnWithTooltip<GlusterBrickEntity>() { + @Override + public String getValue(GlusterBrickEntity object) { + return object.getVolumeName(); + } + }; + getTable().addColumn(volNameColumn, constants.volumeName()); //$NON-NLS-1$ + + TextColumnWithTooltip<GlusterBrickEntity> brickDirColumn = new TextColumnWithTooltip<GlusterBrickEntity>() { + @Override + public String getValue(GlusterBrickEntity object) { + return object.getBrickDirectory(); + } + }; + getTable().addColumn(brickDirColumn, constants.brickDirectoryBricks(), "220px"); //$NON-NLS-1$ + + } + +} -- To view, visit http://gerrit.ovirt.org/19989 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic67c2aba2a5cd90832e6aa8c63c016ccef96ee50 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Sahina Bose <sab...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches