diff options
| author | Selvasundaram <selvam@gluster.com> | 2011-08-23 12:39:07 +0530 |
|---|---|---|
| committer | Selvasundaram <selvam@gluster.com> | 2011-08-23 12:39:07 +0530 |
| commit | 7391ff3c84bee1fc85aeffcaea1943d05ef29043 (patch) | |
| tree | c9045230f9c3d179f641f51cc2f3c01f43f495e9 /src | |
| parent | 805df15c3e1f540fd94bf1f1937de66f459a0900 (diff) | |
Dynamic online offline servers count update on cluster summary view
Diffstat (limited to 'src')
| -rw-r--r-- | src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java index 6c121752..80879b4c 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java @@ -84,6 +84,8 @@ public class ClusterSummaryView extends ViewPart { private Composite tasksSection; private static final ChartUtil chartUtil = ChartUtil.getInstance(); private IPropertyChangeListener propertyChangeListener; + private Label onlineServerCountLabel; + private Label offlineServerCountLabel; /* * (non-Javadoc) @@ -136,6 +138,7 @@ public class ClusterSummaryView extends ViewPart { public void aggregatedStatsChanged() { super.aggregatedStatsChanged(); refreshCharts(); + populateOnlineOfflineServerCount(); } @Override @@ -198,19 +201,24 @@ public class ClusterSummaryView extends ViewPart { private void createServersSection() { Composite section = guiHelper.createSection(form, toolkit, "Servers", null, 2, false); + toolkit.createLabel(section, "Online : "); + onlineServerCountLabel = toolkit.createLabel(section, ""); + toolkit.createLabel(section, "Offline : "); + offlineServerCountLabel = toolkit.createLabel(section, ""); + populateOnlineOfflineServerCount(); + } + + private void populateOnlineOfflineServerCount() { int onlineServerCount = getServerCountByStatus(cluster, SERVER_STATUS.ONLINE); int offlineServerCount = getServerCountByStatus(cluster, SERVER_STATUS.OFFLINE); - - toolkit.createLabel(section, "Online : "); - Label label = toolkit.createLabel(section, "" + onlineServerCount); - label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN)); - - toolkit.createLabel(section, "Offline : "); - label = toolkit.createLabel(section, "" + offlineServerCount); - label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED)); + onlineServerCountLabel.setText("" + onlineServerCount); + onlineServerCountLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN)); + offlineServerCountLabel.setText("" + offlineServerCount); + offlineServerCountLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED)); } + private void createDiskSpaceSection() { Composite section = guiHelper.createSection(form, toolkit, "Disk Space", null, 3, false); if (cluster.getServers().size() == 0) { |
