anmolbabu has uploaded a new change for review. Change subject: webadmin : Show yellow up arrow when one or more bricks of a volume are down ......................................................................
webadmin : Show yellow up arrow when one or more bricks of a volume are down Show yellow up arrow when one or more bricks of a volume are down Signed-off-by: Anmol Babu <[email protected]> Change-Id: Iddaf1676bf9bf2c3aa0d4381e5057e21d4c8512e Signed-off-by: Anmol Babu <[email protected]> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationResources.java A frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/images/Arrow_Up_Yellow.png M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/VolumeStatusCell.java 4 files changed, 31 insertions(+), 12 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/11/19611/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java index e74763c..0ff83e7 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java @@ -1528,6 +1528,9 @@ @DefaultStringValue("Down") String down(); + @DefaultStringValue("One or more bricks are down!!!") + String brickWarning(); + @DefaultStringValue("Powering Up") String poweringUp(); diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationResources.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationResources.java index fe01973..5f4e3d8 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationResources.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationResources.java @@ -238,4 +238,7 @@ @Source("images/comboBoxDropDownIcon.png") ImageResource comboBoxDropDownIcon(); + + @Source("images/Arrow_Up_Yellow.png") + ImageResource volumeBrickWarning(); } diff --git a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/images/Arrow_Up_Yellow.png b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/images/Arrow_Up_Yellow.png new file mode 100644 index 0000000..a06d1cf --- /dev/null +++ b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/images/Arrow_Up_Yellow.png Binary files differ diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/VolumeStatusCell.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/VolumeStatusCell.java index defb0ec..31e40eb 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/VolumeStatusCell.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/VolumeStatusCell.java @@ -1,5 +1,6 @@ package org.ovirt.engine.ui.webadmin.widget.table.column; +import org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity; import org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus; import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity; import org.ovirt.engine.ui.webadmin.ApplicationConstants; @@ -34,20 +35,32 @@ ImageResource statusImage = null; String tooltip; - switch (status) { - case DOWN: - statusImage = resources.downImage(); - tooltip = constants.down(); - break; - case UP: - statusImage = resources.upImage(); - tooltip = constants.up(); - break; - default: - statusImage = resources.downImage(); - tooltip = constants.down(); + Boolean brickWarn = false; + + for(GlusterBrickEntity brick : volume.getBricks()) { + if(brick.getStatus() == GlusterStatus.DOWN) { + brickWarn = true; + } } + if (!brickWarn) { + switch (status) { + case DOWN: + statusImage = resources.downImage(); + tooltip = constants.down(); + break; + case UP: + statusImage = resources.upImage(); + tooltip = constants.up(); + break; + default: + statusImage = resources.downImage(); + tooltip = constants.down(); + } + } else { + statusImage = resources.volumeBrickWarning(); + tooltip = constants.brickWarning(); + } // Generate the HTML for the image: SafeHtml statusImageHtml = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(statusImage).getHTML()); -- To view, visit http://gerrit.ovirt.org/19611 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iddaf1676bf9bf2c3aa0d4381e5057e21d4c8512e 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
