Arik Hadas has uploaded a new change for review.

Change subject: webadmin: locked vm icon
......................................................................

webadmin: locked vm icon

Until now, the in-memory lock status for a given VM was not exposed in
the UI. This patch changes the status icon to have an indication when
the VM is exclusively locked.

We add an icon of a lock which overlay the regular status icon of the
VM, in case it is exclusively locked.

Change-Id: I121c5e65eb3bdc740b1b0aaf05f5e12591a86e46
Signed-off-by: Arik Hadas <aha...@redhat.com>
---
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationResources.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationTemplates.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/cell/VmStatusCell.java
A 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/images/vmStatus/vm_locked_overlay_icon.png
4 files changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/54/40754/1

diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationResources.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationResources.java
index c3b9225..9ceede1 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationResources.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationResources.java
@@ -374,6 +374,9 @@
     @Source("images/vmType/vm_server_stateless_changes.png")
     ImageResource serverStatelessChanges();
 
+    @Source("images/vmStatus/vm_locked_overlay_icon.png")
+    ImageResource vmLocked();
+
     // custom statuses
     @Source("images/vmStatus/running.png")
     ImageResource vmStatusRunning();
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationTemplates.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationTemplates.java
index facb382..94ec68e 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationTemplates.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationTemplates.java
@@ -106,6 +106,10 @@
     @Template("<div id=\"{1}\" style=\"text-align: center;\">{0}</div>")
     SafeHtml statusTemplate(SafeHtml statusImage, String id);
 
+    @Template("<span><span style='position: fixed; display: inline-block; 
vertical-align: top; height: 14px; line-height: 14px;'>{1}</span>"
+            + "<span style='position: relative; white-space: normal; height: 
14px; line-height: 14px;'>{0}</span></span>")
+    SafeHtml lockedStatusTemplate(SafeHtml lockImage, SafeHtml statusImage);
+
     @Template("<button type='button' tabindex='-1' style='float: right; 
height: 20px;'>"
             +
             "<span style='position: relative; left: 0px; top: -5px; width: 
100%; font-family: arial; font-size: 10px;'>{0}</span></button>")
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/cell/VmStatusCell.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/cell/VmStatusCell.java
index 8f4c950..dc1fca9 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/cell/VmStatusCell.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/cell/VmStatusCell.java
@@ -90,6 +90,14 @@
         SafeHtml statusImageHtml =
                 
SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(statusImage).getHTML());
 
+        if (vm.getLockInfo() != null && vm.getLockInfo().isExclusive()) {
+            ImageResource lockImageResource = resources.vmLocked();
+            // Get the image html
+            AbstractImagePrototype imagePrototype = 
AbstractImagePrototype.create(lockImageResource);
+            SafeHtml lockImageHtml = 
SafeHtmlUtils.fromTrustedString(imagePrototype.getHTML());
+            statusImageHtml = templates.lockedStatusTemplate(lockImageHtml, 
statusImageHtml);
+        }
+
         // Find the image corresponding to the alert
         SafeHtml alertImageHtml = getResourceImage(vm);
 
@@ -122,4 +130,5 @@
             return SafeHtmlUtils.fromTrustedString(html);
         }
     }
+
 }
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/images/vmStatus/vm_locked_overlay_icon.png
 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/images/vmStatus/vm_locked_overlay_icon.png
new file mode 100644
index 0000000..fb9094e
--- /dev/null
+++ 
b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/images/vmStatus/vm_locked_overlay_icon.png
Binary files differ


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

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

Reply via email to