summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhandapani <dhandapani@gluster.com>2011-10-11 17:42:25 +0530
committerDhandapani <dhandapani@gluster.com>2011-10-13 08:26:44 +0530
commit3d18310608655c73fc8f6fae8e7df90da0cff7a7 (patch)
tree3f3ed383323801ccc2d5ae6ff0fa633869a8f1eb
parent43c3bb921682277d87d672f2af8264c4914e6d87 (diff)
UI Changes
- CPU/Memory/Disk Usage alerts set to 80% - Displayed Offline volumes in alert section
-rw-r--r--src/com.gluster.storage.management.console/icons/tango/22x22/offline-volume.pngbin0 -> 1034 bytes
-rw-r--r--src/com.gluster.storage.management.console/icons/tango/32x32/log-rotate.pngbin0 -> 1839 bytes
-rw-r--r--src/com.gluster.storage.management.console/plugin.xml2
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/AlertsManager.java3
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/IImageKeys.java1
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/ResetVolumeOptionsAction.java6
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/preferences/PreferenceInitializer.java6
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java3
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/VolumesSummaryView.java23
-rw-r--r--src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Alert.java4
10 files changed, 38 insertions, 10 deletions
diff --git a/src/com.gluster.storage.management.console/icons/tango/22x22/offline-volume.png b/src/com.gluster.storage.management.console/icons/tango/22x22/offline-volume.png
new file mode 100644
index 00000000..fa3a64f9
--- /dev/null
+++ b/src/com.gluster.storage.management.console/icons/tango/22x22/offline-volume.png
Binary files differ
diff --git a/src/com.gluster.storage.management.console/icons/tango/32x32/log-rotate.png b/src/com.gluster.storage.management.console/icons/tango/32x32/log-rotate.png
new file mode 100644
index 00000000..a1ceebbf
--- /dev/null
+++ b/src/com.gluster.storage.management.console/icons/tango/32x32/log-rotate.png
Binary files differ
diff --git a/src/com.gluster.storage.management.console/plugin.xml b/src/com.gluster.storage.management.console/plugin.xml
index 6983b9dd..95615346 100644
--- a/src/com.gluster.storage.management.console/plugin.xml
+++ b/src/com.gluster.storage.management.console/plugin.xml
@@ -528,7 +528,7 @@
<action
class="com.gluster.storage.management.console.actions.VolumeLogRotateAction"
definitionId="com.gluster.storage.management.console.commands.LogRotate"
- icon="icons/tango/32x32/download-log.png"
+ icon="icons/tango/32x32/log-rotate.png"
id="com.gluster.storage.management.console.actions.LogRotateAction"
label="L&amp;og Rotate"
menubarPath="com.gluster.storage.management.console.menu.volume/volume"
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/AlertsManager.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/AlertsManager.java
index 40a64498..a5b3a4e6 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/AlertsManager.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/AlertsManager.java
@@ -191,6 +191,9 @@ public class AlertsManager {
for (Volume volume : cluster.getVolumes()) {
if (volume.getStatus() == VOLUME_STATUS.OFFLINE) {
+ volumeAlerts.add(new Alert(ALERT_TYPES.OFFLINE_VOLUME_ALERT, volume.getName(),
+ Alert.ALERT_TYPE_STR[ALERT_TYPES.OFFLINE_VOLUME_ALERT.ordinal()] + " [" + volume.getName()
+ + "]"));
continue;
}
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/IImageKeys.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/IImageKeys.java
index 89b19f3f..cecdb002 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/IImageKeys.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/IImageKeys.java
@@ -42,6 +42,7 @@ public interface IImageKeys {
public static final String BRICKS_16x16 = "icons/tango/16x16/bricks.png";
public static final String BRICK_ONLINE_16x16 = "icons/tango/16x16/online-brick.png";
public static final String BRICK_OFFLINE_16x16 = "icons/tango/16x16/offline-brick.png";
+ public static final String VOLUME_OFFLINE_22x22 = "icons/tango/22x22/offline-volume.png";
public static final String SERVERS_16x16 = "icons/tango/16x16/servers.png";
public static final String SERVER_16x16 = "icons/tango/16x16/server.png";
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/ResetVolumeOptionsAction.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/ResetVolumeOptionsAction.java
index 99a7c887..cd2b3ff5 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/ResetVolumeOptionsAction.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/ResetVolumeOptionsAction.java
@@ -53,6 +53,10 @@ public class ResetVolumeOptionsAction extends AbstractActionDelegate {
@Override
public void selectionChanged(IAction action, ISelection selection) {
volume = GUIHelper.getInstance().getSelectedEntity(getWindow(), Volume.class);
- action.setEnabled(volume.getOptions().size() > 0);
+ if (volume != null) {
+ action.setEnabled(volume.getOptions().size() > 0);
+ } else {
+ action.setEnabled(false);
+ }
}
}
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/preferences/PreferenceInitializer.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/preferences/PreferenceInitializer.java
index 3c192f62..72e62447 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/preferences/PreferenceInitializer.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/preferences/PreferenceInitializer.java
@@ -42,13 +42,13 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
store.setDefault(PreferenceConstants.P_DATA_SYNC_INTERVAL, 300);
// Default CPU utilisation threshold
- store.setDefault(PreferenceConstants.P_SERVER_CPU_CRITICAL_THRESHOLD, 95);
+ store.setDefault(PreferenceConstants.P_SERVER_CPU_CRITICAL_THRESHOLD, 80);
// Default Memory threshold
- store.setDefault(PreferenceConstants.P_SERVER_MEMORY_USAGE_THRESHOLD, 90);
+ store.setDefault(PreferenceConstants.P_SERVER_MEMORY_USAGE_THRESHOLD, 80);
// Default disk free space threshold
- store.setDefault(PreferenceConstants.P_DISK_SPACE_USAGE_THRESHOLD, 90);
+ store.setDefault(PreferenceConstants.P_DISK_SPACE_USAGE_THRESHOLD, 80);
// Default period for server statistics charts
store.setDefault(PreferenceConstants.P_CPU_CHART_PERIOD, "1d");
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 6187d5ad..b459c361 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
@@ -278,6 +278,9 @@ public class ClusterSummaryView extends ViewPart {
case CPU_USAGE_ALERT:
alertImage = guiHelper.getImage(IImageKeys.SERVER_WARNING_22x22);
break;
+ case OFFLINE_VOLUME_ALERT:
+ alertImage = guiHelper.getImage(IImageKeys.VOLUME_OFFLINE_22x22);
+ break;
}
lblAlert.setImage(alertImage);
lblAlert.setText(alert.getMessage());
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/VolumesSummaryView.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/VolumesSummaryView.java
index b5604643..376345e6 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/VolumesSummaryView.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/VolumesSummaryView.java
@@ -22,6 +22,7 @@ package com.gluster.storage.management.console.views;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
@@ -102,6 +103,7 @@ public class VolumesSummaryView extends ViewPart {
public void volumeChanged(Volume volume, Event event) {
super.volumeChanged(volume, event);
updateSummarySection();
+ updateAlertSection();
}
private void updateSummarySection() {
@@ -140,6 +142,11 @@ public class VolumesSummaryView extends ViewPart {
guiHelper.clearSection(tasksSection);
populateTasks();
}
+
+ private void updateAlertSection() {
+ guiHelper.clearSection(alertsSection);
+ populateAlertSection();
+ }
};
GlusterDataModelManager.getInstance().addClusterListener(clusterListener);
}
@@ -166,7 +173,8 @@ public class VolumesSummaryView extends ViewPart {
private void populateAlertSection() {
for (Alert alert : cluster.getAlerts()) {
- if (alert.getType() == Alert.ALERT_TYPES.OFFLINE_VOLUME_BRICKS_ALERT) {
+ if (alert.getType() == Alert.ALERT_TYPES.OFFLINE_VOLUME_BRICKS_ALERT
+ || alert.getType() == Alert.ALERT_TYPES.OFFLINE_VOLUME_ALERT) {
addAlertLabel(alertsSection, alert);
}
}
@@ -176,8 +184,17 @@ public class VolumesSummaryView extends ViewPart {
private void addAlertLabel(Composite section, Alert alert) {
CLabel lblAlert = new CLabel(section, SWT.NONE);
- lblAlert.setImage((alert.getType() == Alert.ALERT_TYPES.DISK_USAGE_ALERT) ? guiHelper
- .getImage(IImageKeys.LOW_DISK_SPACE_22x22) : guiHelper.getImage(IImageKeys.BRICK_OFFLINE_22x22));
+
+ Image alertImage = null;
+ switch (alert.getType()) {
+ case OFFLINE_VOLUME_BRICKS_ALERT:
+ alertImage = guiHelper.getImage(IImageKeys.BRICK_OFFLINE_22x22);
+ break;
+ case OFFLINE_VOLUME_ALERT:
+ alertImage = guiHelper.getImage(IImageKeys.VOLUME_OFFLINE_22x22);
+ break;
+ }
+ lblAlert.setImage(alertImage);
lblAlert.setText(alert.getMessage());
lblAlert.redraw();
}
diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Alert.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Alert.java
index a29c150b..ceb3e77e 100644
--- a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Alert.java
+++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Alert.java
@@ -5,11 +5,11 @@ import org.eclipse.osgi.internal.signedcontent.Base64;
public class Alert extends Entity {
public enum ALERT_TYPES {
- CPU_USAGE_ALERT, MEMORY_USAGE_ALERT, DISK_USAGE_ALERT, OFFLINE_VOLUME_BRICKS_ALERT, OFFLINE_SERVERS_ALERT
+ CPU_USAGE_ALERT, MEMORY_USAGE_ALERT, DISK_USAGE_ALERT, OFFLINE_VOLUME_BRICKS_ALERT, OFFLINE_SERVERS_ALERT, OFFLINE_VOLUME_ALERT
};
public static final String[] ALERT_TYPE_STR = { "High CPU Usage", "High Memory Usage", "Low Disk Space",
- "Offline Brick", "Offline Server" };
+ "Offline Brick", "Offline Server", "Offline Volume" };
// protected String id;
protected ALERT_TYPES type;