Moti Asayag has uploaded a new change for review.

Change subject: webadmin: Add updates indication for all hosts
......................................................................

webadmin: Add updates indication for all hosts

With the 'check updates available' functionality, it is
now possible to report for available updates not only for
ovirt-node, but also for non ovirt-nodes as well.

Change-Id: I64383dd699e357703cba80907fa8542ad8050e10
Bug-Url: https://bugzilla.redhat.com/1157368
Signed-off-by: Moti Asayag <masa...@redhat.com>
---
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabHostView.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/cell/HostStatusCell.java
2 files changed, 15 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/63/40563/1

diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabHostView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabHostView.java
index 660c029..d0f6587 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabHostView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabHostView.java
@@ -4,7 +4,6 @@
 import java.util.LinkedList;
 import java.util.List;
 
-import com.google.gwt.user.client.ui.HasHorizontalAlignment;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSStatus;
 import org.ovirt.engine.core.common.businessentities.VdsSpmStatus;
@@ -47,6 +46,7 @@
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.safehtml.shared.SafeHtml;
 import com.google.gwt.safehtml.shared.SafeHtmlUtils;
+import com.google.gwt.user.client.ui.HasHorizontalAlignment;
 import com.google.inject.Inject;
 
 public class MainTabHostView extends AbstractMainTabWithDetailsTableView<VDS, 
HostListModel<Void>> implements MainTabHostPresenter.ViewDef {
@@ -103,7 +103,7 @@
     void initTable() {
         getTable().enableColumnResizing();
 
-        getTable().addColumn(new HostStatusColumn<VDS>(), constants.empty(), 
"30px"); //$NON-NLS-1$
+        getTable().addColumn(new HostStatusColumn<VDS>(), constants.empty(), 
"60px"); //$NON-NLS-1$
 
         AbstractTextColumn<VDS> nameColumn = new AbstractTextColumn<VDS>() {
             @Override
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/cell/HostStatusCell.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/cell/HostStatusCell.java
index 1dd2793..3d1116d 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/cell/HostStatusCell.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/cell/HostStatusCell.java
@@ -69,13 +69,9 @@
             statusImage = resources.downImage();
         }
 
-        // Find the image corresponding to the alert:
-        ImageResource alertImage = resources.alertImage();
-
         // Generate the HTML for the images:
         SafeHtml statusImageHtml =
                 
SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(statusImage).getHTML());
-        SafeHtml alertImageHtml = 
SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(alertImage).getHTML());
 
         // Generate the HTML for the cell including the exclamation mark only 
if
         // power management is not enabled or there are network configuration
@@ -86,8 +82,20 @@
                 vds.getNetConfigDirty() == null ? false : 
vds.getNetConfigDirty().booleanValue();
         boolean showPMAlert = vds.getVdsGroupSupportsVirtService() && 
!vds.isPmEnabled();
         if (showPMAlert || getnet_config_dirty) {
-            sb.append(alertImageHtml);
+            // Append the image corresponding to the alert
+            appendImage(sb, resources.alertImage());
         }
+
+        if (vds.isUpdateAvailable()) {
+            //sb.appendHtmlConstant("</div>"); //$NON-NLS-1$
+            appendImage(sb, resources.updateAvailableImage());
+        }
+
         sb.appendHtmlConstant("</div>"); //$NON-NLS-1$
     }
+
+    public void appendImage(SafeHtmlBuilder sb, ImageResource imageResource) {
+        SafeHtml imageHtml = 
SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(imageResource).getHTML());
+        sb.append(imageHtml);
+    }
 }


-- 
To view, visit https://gerrit.ovirt.org/40563
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64383dd699e357703cba80907fa8542ad8050e10
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <masa...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to