diff options
author | Shireesh Anjal <anjalshireesh@gmail.com> | 2011-10-18 04:18:25 -0700 |
---|---|---|
committer | Shireesh Anjal <anjalshireesh@gmail.com> | 2011-10-18 04:18:25 -0700 |
commit | 0b5eefadf28f5e3df93bae3c8dca7c8a3f1119eb (patch) | |
tree | 10ac3c92c0603c3c51476cc6938c264ab9a74f0a | |
parent | 25a1d358bb97bf696c9f916d0bafb20898c54a02 (diff) | |
parent | 927e038bbcb1f0c52db5f694bc68c4c61d515650 (diff) |
Merge pull request #290 from Dhandapani/master
UI Changes :
- CPU/Memory/Disk Usage alerts set to 80%
- Display Offline volumes in alert section
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 Binary files differnew file mode 100644 index 00000000..fa3a64f9 --- /dev/null +++ b/src/com.gluster.storage.management.console/icons/tango/22x22/offline-volume.png 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 Binary files differnew file mode 100644 index 00000000..a1ceebbf --- /dev/null +++ b/src/com.gluster.storage.management.console/icons/tango/32x32/log-rotate.png 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&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; |