anmolbabu has uploaded a new change for review.

Change subject: webadmin : Order the Add Block Host List
......................................................................

webadmin : Order the Add Block Host List

Order the Add Block Host List

Change-Id: Idcc47e29a5e54ff2bd76bb71fe8a56ebf4ff28ab
Bug-url: https://bugzilla.redhat.com/show_bug.cgi?id=1044124
Signed-off-by: Anmol Babu <anb...@redhat.com>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
3 files changed, 16 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/30/39430/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
index ba37486..2868afa 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
@@ -368,7 +368,7 @@
                             }
                         }
 
-                        volumeBrickModel.getServers().setItems(hostList);
+                        volumeBrickModel.setHostList(hostList);
                     }
                 };
                 AsyncDataProvider.getHostListByCluster(_asyncQueryInner, 
cluster.getName());
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickModel.java
index 2d4f38e..552dded 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickModel.java
@@ -1,11 +1,14 @@
 package org.ovirt.engine.ui.uicommonweb.models.gluster;
 
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
 import org.ovirt.engine.core.common.businessentities.VDS;
+import 
org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity;
 import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType;
 import org.ovirt.engine.ui.uicommonweb.UICommand;
@@ -661,6 +664,17 @@
         return true;
     }
 
+    public void setHostList(List<VDS> hosts) {
+        final LexoNumericComparator lexoNumeric = new LexoNumericComparator();
+        Collections.sort(hosts, new Comparator<VDS>() {
+            @Override
+            public int compare(VDS host0, VDS host1) {
+                return lexoNumeric.compare(host0.getHostName(), 
host1.getHostName());
+            }
+        });
+        getServers().setItems(hosts);
+    }
+
     @Override
     public void executeCommand(UICommand command) {
         super.executeCommand(command);
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
index bdcf241..3b78dbf 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
@@ -327,7 +327,7 @@
                         iterator.remove();
                     }
                 }
-                volumeBrickModel.getServers().setItems(hostList);
+                volumeBrickModel.setHostList(hostList);
             }
         };
         AsyncDataProvider.getHostListByCluster(_asyncQuery, 
getCluster().getSelectedItem().getName());


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idcc47e29a5e54ff2bd76bb71fe8a56ebf4ff28ab
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5-gluster
Gerrit-Owner: anmolbabu <anb...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to