diff options
| author | Dhandapani <dhandapani@gluster.com> | 2011-07-26 20:19:01 +0530 |
|---|---|---|
| committer | Dhandapani <dhandapani@gluster.com> | 2011-07-26 20:19:01 +0530 |
| commit | 7d552c1aa335e048c2d23601e484a33ff6feeeb9 (patch) | |
| tree | bfc1d2c65e907a1829e9c60dac74ac090555203b /src/com.gluster.storage.management.gui | |
| parent | 5ad915c0323b79f940d1cca2548d6bca24c9e673 (diff) | |
| parent | d4e86cfcaf3252f450e5bbf32e6e71669296e051 (diff) | |
Merge branch 'master' of git@github.com:gluster/console
Diffstat (limited to 'src/com.gluster.storage.management.gui')
6 files changed, 124 insertions, 94 deletions
diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/GlusterDataModelManager.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/GlusterDataModelManager.java index 33132c64..afc0e7aa 100644 --- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/GlusterDataModelManager.java +++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/GlusterDataModelManager.java @@ -201,8 +201,17 @@ public class GlusterDataModelManager { updateDiscoveredServers(model); updateTasks(model); updateAlerts(model); + updateServerStatistics(model); } + private void updateServerStatistics(GlusterDataModel newModel) { + model.getCluster().setAggregatedCpuStats(newModel.getCluster().getAggregatedCpuStats()); + model.getCluster().setAggregatedNetworkStats(newModel.getCluster().getAggregatedNetworkStats()); + for(ClusterListener listener : listeners) { + listener.aggregatedStatsChanged(); + } + } + private void updateAlerts(GlusterDataModel newModel) { List<Alert> oldAlerts = model.getCluster().getAlerts(); List<Alert> newAlerts = newModel.getCluster().getAlerts(); diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/ChartsPreferencePage.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/ChartsPreferencePage.java index 2d16fcd2..850407d1 100644 --- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/ChartsPreferencePage.java +++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/ChartsPreferencePage.java @@ -20,28 +20,20 @@ package com.gluster.storage.management.gui.preferences; import org.eclipse.jface.preference.ComboFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; +import com.gluster.storage.management.gui.Activator; + /** * */ public class ChartsPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { public ChartsPreferencePage() { - } - - public ChartsPreferencePage(int style) { - super(style); - } - - public ChartsPreferencePage(String title, int style) { - super(title, style); - } - - public ChartsPreferencePage(String title, ImageDescriptor image, int style) { - super(title, image, style); + super(GRID); + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setDescription("Gluster Management Console"); } /* (non-Javadoc) @@ -57,8 +49,7 @@ public class ChartsPreferencePage extends FieldEditorPreferencePage implements I @Override protected void createFieldEditors() { String[][] entryNamesAndValues = new String[][] { - { "1d", "1d" }, { "1w", "1w" }, { "1m", "1m" }, { "1y", "1y" } }; - //{ "1 day", "1d" }, { "1 week", "1w" }, { "1 month", "1m" }, { "1 year", "1y" } }; + { "1 day", "1d" }, { "1 week", "1w" }, { "1 month", "1m" }, { "1 year", "1y" } }; addField(new ComboFieldEditor(PreferenceConstants.P_CPU_CHART_PERIOD, "CPU Usage chart period", entryNamesAndValues, getFieldEditorParent())); addField(new ComboFieldEditor(PreferenceConstants.P_MEM_CHART_PERIOD, "Memory Usage chart period", entryNamesAndValues, diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/ChartViewerComposite.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/ChartViewerComposite.java index 30982096..95f0277c 100644 --- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/ChartViewerComposite.java +++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/ChartViewerComposite.java @@ -18,8 +18,6 @@ *******************************************************************************/ package com.gluster.storage.management.gui.utils; -import java.lang.reflect.InvocationTargetException; -import java.util.Locale; import java.util.logging.Level; import java.util.logging.Logger; @@ -30,7 +28,6 @@ import org.eclipse.birt.chart.exception.ChartException; import org.eclipse.birt.chart.factory.GeneratedChartState; import org.eclipse.birt.chart.factory.Generator; import org.eclipse.birt.chart.model.Chart; -import org.eclipse.birt.chart.model.ChartWithAxes; import org.eclipse.birt.chart.model.ChartWithoutAxes; import org.eclipse.birt.chart.model.attribute.Anchor; import org.eclipse.birt.chart.model.attribute.AxisType; @@ -39,7 +36,6 @@ import org.eclipse.birt.chart.model.attribute.ChartDimension; import org.eclipse.birt.chart.model.attribute.FontDefinition; import org.eclipse.birt.chart.model.attribute.LineAttributes; import org.eclipse.birt.chart.model.attribute.LineStyle; -import org.eclipse.birt.chart.model.attribute.NumberFormatSpecifier; import org.eclipse.birt.chart.model.attribute.TickStyle; import org.eclipse.birt.chart.model.attribute.impl.BoundsImpl; import org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionImpl; @@ -72,16 +68,6 @@ import org.eclipse.birt.chart.model.type.impl.AreaSeriesImpl; import org.eclipse.birt.chart.model.type.impl.PieSeriesImpl; import org.eclipse.birt.core.framework.PlatformConfig; import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.TreeIterator; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EOperation; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.swt.events.ControlEvent; import org.eclipse.swt.events.ControlListener; import org.eclipse.swt.events.PaintEvent; @@ -92,7 +78,6 @@ import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Composite; import com.ibm.icu.util.Calendar; -import com.ibm.icu.util.ULocale; /** * @@ -139,12 +124,13 @@ public final class ChartViewerComposite extends Composite implements PaintListen * @param values * Values of each category in the pie chart Constructs a pie * chart viewer composite for given categories and values + * @param maxValue */ - public ChartViewerComposite(Composite parent, int style, Calendar[] categories, Double[] values, String unit, String timestampFormat) { + public ChartViewerComposite(Composite parent, int style, Calendar[] categories, Double[] values, String unit, String timestampFormat, double maxValue) { super(parent, style); init(); - createSingleAreaChart(categories, values, unit, timestampFormat); + createSingleAreaChart(categories, values, unit, timestampFormat, maxValue); addPaintListener(this); } @@ -170,17 +156,18 @@ public final class ChartViewerComposite extends Composite implements PaintListen }); } - private void createSingleAreaChart(Calendar[] timestamps, Double[] values, String unit, String timestampFormat) { - createAreaChart(timestamps, new Double[][] {values}, unit, timestampFormat); + private void createSingleAreaChart(Calendar[] timestamps, Double[] values, String unit, String timestampFormat, double maxValue) { + createAreaChart(timestamps, new Double[][] {values}, unit, timestampFormat, maxValue); } /** * Creates a line chart model as a reference implementation + * @param maxValue * * @return An instance of the simulated runtime chart model (containing * filled datasets) */ - private final void createAreaChart(Calendar[] timestamps, Double[][] values, final String unit, final String timestampFormat) { + private final void createAreaChart(Calendar[] timestamps, Double[][] values, final String unit, final String timestampFormat, double maxValue) { chart = ChartWithAxesImpl.create(); // Plot chart.getBlock().setBackground(ColorDefinitionImpl.WHITE()); @@ -206,12 +193,12 @@ public final class ChartViewerComposite extends Composite implements PaintListen lg.getOutline( ).setVisible( false ); lg.setAnchor( Anchor.NORTH_LITERAL ); - updateDataSet(timestamps, values, unit, timestampFormat); + updateDataSet(timestamps, values, unit, timestampFormat, maxValue); } - private void updateDataSet(Calendar[] timestamps, Double[][] values, final String unit, final String timestampFormat) { + private void updateDataSet(Calendar[] timestamps, Double[][] values, final String unit, final String timestampFormat, double maxValue) { Axis xAxisPrimary = setupXAxis(timestamps, timestampFormat); - Axis yAxisPrimary = setupYAxis(unit, xAxisPrimary); + Axis yAxisPrimary = setupYAxis(unit, xAxisPrimary, maxValue); configureXSeries(timestamps, xAxisPrimary); configureYSeries(values, yAxisPrimary); } @@ -253,9 +240,11 @@ public final class ChartViewerComposite extends Composite implements PaintListen sdX.getSeries().add(seCategory); } - private Axis setupYAxis(final String unit, Axis xAxisPrimary) { + private Axis setupYAxis(final String unit, Axis xAxisPrimary, double maxValue) { Axis yAxisPrimary = ((ChartWithAxesImpl)chart).getPrimaryOrthogonalAxis(xAxisPrimary); - yAxisPrimary.getScale().setMax(NumberDataElementImpl.create(100)); + if(maxValue > 0) { + yAxisPrimary.getScale().setMax(NumberDataElementImpl.create(maxValue)); + } yAxisPrimary.getScale().setMin(NumberDataElementImpl.create(0)); yAxisPrimary.setGapWidth(0); yAxisPrimary.getScale().setStep(20); @@ -396,26 +385,26 @@ public final class ChartViewerComposite extends Composite implements PaintListen } } - public void chartRefresh(Calendar[] timestamps, Double[][] values, String unit, String timestampFormat) - { - if ( !isDisposed( ) ) - { - final Generator gr = Generator.instance( ); - updateDataSet( timestamps, values, unit, timestampFormat); - - // Refresh - try - { - gr.refresh( generatedChartState ); - } - catch ( ChartException ex ) - { - // TODO: log the exception - ex.printStackTrace( ); - } - redraw( ); - } - } +// public void chartRefresh(Calendar[] timestamps, Double[][] values, String unit, String timestampFormat) +// { +// if ( !isDisposed( ) ) +// { +// final Generator gr = Generator.instance( ); +// updateDataSet( timestamps, values, unit, timestampFormat); +// +// // Refresh +// try +// { +// gr.refresh( generatedChartState ); +// } +// catch ( ChartException ex ) +// { +// // TODO: log the exception +// ex.printStackTrace( ); +// } +// redraw( ); +// } +// } /* * (non-Javadoc) diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/ClusterSummaryView.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/ClusterSummaryView.java index 40b0491d..b67cca30 100644 --- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/ClusterSummaryView.java +++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/ClusterSummaryView.java @@ -47,6 +47,8 @@ import com.gluster.storage.management.client.GlusterServersClient; import com.gluster.storage.management.core.constants.GlusterConstants; import com.gluster.storage.management.core.model.Alert; import com.gluster.storage.management.core.model.Cluster; +import com.gluster.storage.management.core.model.ClusterListener; +import com.gluster.storage.management.core.model.DefaultClusterListener; import com.gluster.storage.management.core.model.EntityGroup; import com.gluster.storage.management.core.model.GlusterDataModel; import com.gluster.storage.management.core.model.GlusterServer; @@ -74,7 +76,11 @@ public class ClusterSummaryView extends ViewPart { private final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); private ScrolledForm form; private Cluster cluster; + private Composite cpuChartSection; + private Composite networkChartSection; private GlusterDataModel model = GlusterDataModelManager.getInstance().getModel(); + private ClusterListener clusterListener; + private static final IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore(); private static final int CHART_WIDTH = 350; /* @@ -89,6 +95,28 @@ public class ClusterSummaryView extends ViewPart { } setPartName("Summary"); createSections(parent); + + clusterListener = new DefaultClusterListener() { + @Override + public void aggregatedStatsChanged() { + super.aggregatedStatsChanged(); + refreshCharts(); + } + }; + GlusterDataModelManager.getInstance().addClusterListener(clusterListener); + } + + @Override + public void dispose() { + super.dispose(); + GlusterDataModelManager.getInstance().removeClusterListener(clusterListener); + } + + private void refreshCharts() { + String cpuStatsPeriod = preferenceStore.getString(PreferenceConstants.P_CPU_CHART_PERIOD); + String networkStatsPeriod = preferenceStore.getString(PreferenceConstants.P_NETWORK_CHART_PERIOD); + refreshChartSection(cpuChartSection, cluster.getAggregatedCpuStats(), cpuStatsPeriod, "%", 100, 4, new CpuChartPeriodLinkListener(cpuStatsPeriod)); + refreshChartSection(networkChartSection, cluster.getAggregatedNetworkStats(), networkStatsPeriod, "KiB/s", -1, 4, new NetworkChartPeriodLinkListener(networkStatsPeriod)); } private int getServerCountByStatus(Cluster cluster, SERVER_STATUS status) { @@ -145,6 +173,7 @@ public class ClusterSummaryView extends ViewPart { protected String statsPeriod; protected String unit; protected int columnCount; + protected double maxValue; public String getStatsPeriod() { return this.statsPeriod; @@ -154,10 +183,11 @@ public class ClusterSummaryView extends ViewPart { this.statsPeriod = statsPeriod; } - public ChartPeriodLinkListener(String statsPeriod, String unit, int columnCount) { + public ChartPeriodLinkListener(String statsPeriod, String unit, double maxValue, int columnCount) { this.statsPeriod = statsPeriod; this.unit = unit; this.columnCount = columnCount; + this.maxValue = maxValue; } @Override @@ -165,16 +195,8 @@ public class ClusterSummaryView extends ViewPart { super.linkActivated(e); //GlusterDataModelManager.getInstance().initializeAlerts(cluster); Composite section = ((Hyperlink)e.getSource()).getParent().getParent(); - for(Control control : section.getChildren()) { - control.dispose(); - } - List<Calendar> timestamps = new ArrayList<Calendar>(); - List<Double> data = new ArrayList<Double>(); ServerStats stats = fetchStats(); - extractChartData(stats, timestamps, data, 2); - createAreaChart(section, timestamps.toArray(new Calendar[0]), data.toArray(new Double[0]), unit, getTimestampFormatForPeriod(statsPeriod)); - createChartLinks(section, columnCount, this); - section.layout(); + refreshChartSection(section, stats, statsPeriod, unit, maxValue, columnCount, this); } public abstract ChartPeriodLinkListener getInstance(String statsPeriod); @@ -187,20 +209,22 @@ public class ClusterSummaryView extends ViewPart { super(statsPeriod); } - private CpuChartPeriodLinkListener(String statsPeriod, String unit, int columnCount) { - super(statsPeriod, unit, columnCount); + private CpuChartPeriodLinkListener(String statsPeriod, String unit, double maxValue, int columnCount) { + super(statsPeriod, unit, maxValue, columnCount); } @Override protected ServerStats fetchStats() { IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore(); preferenceStore.setValue(PreferenceConstants.P_CPU_CHART_PERIOD, statsPeriod); - return new GlusterServersClient().getAggregatedCpuStats(statsPeriod); + ServerStats stats = new GlusterServersClient().getAggregatedCpuStats(statsPeriod); + cluster.setAggregatedCpuStats(stats); + return stats; } @Override public ChartPeriodLinkListener getInstance(String statsPeriod) { - return new CpuChartPeriodLinkListener(statsPeriod, "%", 4); + return new CpuChartPeriodLinkListener(statsPeriod, "%", 100, 4); } } @@ -209,20 +233,22 @@ public class ClusterSummaryView extends ViewPart { super(statsPeriod); } - private NetworkChartPeriodLinkListener(String statsPeriod, String unit, int columnCount) { - super(statsPeriod, unit, columnCount); + private NetworkChartPeriodLinkListener(String statsPeriod, String unit, double maxValue, int columnCount) { + super(statsPeriod, unit, maxValue, columnCount); } @Override protected ServerStats fetchStats() { IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore(); preferenceStore.setValue(PreferenceConstants.P_NETWORK_CHART_PERIOD, statsPeriod); - return new GlusterServersClient().getAggregatedNetworkStats(statsPeriod); + ServerStats stats = new GlusterServersClient().getAggregatedNetworkStats(statsPeriod); + cluster.setAggregatedNetworkStats(stats); + return stats; } @Override public ChartPeriodLinkListener getInstance(String statsPeriod) { - return new NetworkChartPeriodLinkListener(statsPeriod, "KiB/s", 4); + return new NetworkChartPeriodLinkListener(statsPeriod, "KiB/s", -1d, 4); } } @@ -253,8 +279,8 @@ public class ClusterSummaryView extends ViewPart { } } - private ChartViewerComposite createAreaChart(Composite section, Calendar timestamps[], Double values[], String unit, String timestampFormat) { - ChartViewerComposite chartViewerComposite = new ChartViewerComposite(section, SWT.NONE, timestamps, values, unit, timestampFormat); + private ChartViewerComposite createAreaChart(Composite section, Calendar timestamps[], Double values[], String unit, String timestampFormat, double maxValue) { + ChartViewerComposite chartViewerComposite = new ChartViewerComposite(section, SWT.NONE, timestamps, values, unit, timestampFormat, maxValue); GridData data = new GridData(SWT.FILL, SWT.FILL, false, false); data.widthHint = CHART_WIDTH; data.heightHint = 250; @@ -345,7 +371,7 @@ public class ClusterSummaryView extends ViewPart { parent.layout(); // IMP: lays out the form properly } - private void createAreaChartSection(ServerStats stats, String sectionTitle, int dataColumnIndex, String unit, String timestampFormat, ChartPeriodLinkListener listener) { + private Composite createAreaChartSection(ServerStats stats, String sectionTitle, int dataColumnIndex, String unit, String timestampFormat, ChartPeriodLinkListener listener, double maxValue) { Composite section = guiHelper.createSection(form, toolkit, sectionTitle, null, 1, false); List<Calendar> timestamps = new ArrayList<Calendar>(); @@ -353,17 +379,22 @@ public class ClusterSummaryView extends ViewPart { if (cluster.getServers().size() == 0) { toolkit.createLabel(section, "This section will be populated after at least\none server is added to the storage cloud."); - return; + return null; + } + + if(stats == null) { + toolkit.createLabel(section, "Server statistics not available. Try after some time!"); + return null; } extractChartData(stats, timestamps, data, dataColumnIndex); if(timestamps.size() == 0) { toolkit.createLabel(section, "Server statistics not available!\n Check if all services are running properly on the cluster servers."); - return; + return null; } - createAreaChart(section, timestamps.toArray(new Calendar[0]), data.toArray(new Double[0]), unit, timestampFormat); + createAreaChart(section, timestamps.toArray(new Calendar[0]), data.toArray(new Double[0]), unit, timestampFormat, maxValue); // Calendar[] timestamps = new Calendar[] { new CDateTime(1000l*1310468100), new CDateTime(1000l*1310468400), new CDateTime(1000l*1310468700), // new CDateTime(1000l*1310469000), new CDateTime(1000l*1310469300), new CDateTime(1000l*1310469600), new CDateTime(1000l*1310469900), @@ -375,6 +406,7 @@ public class ClusterSummaryView extends ViewPart { // Double[] values = new Double[] { 10d, 11.23d, 17.92d, 18.69d, 78.62d, 89.11d, 92.43d, 89.31d, 57.39d, 18.46d, 10.44d, 16.28d, 13.51d, 17.53d, 12.21, 20d, 21.43d, 16.45d, 14.86d, 15.27d }; // createLineChart(section, timestamps, values, "%"); createChartLinks(section, 4, listener); + return section; } private void createCPUUsageSection() { @@ -382,7 +414,7 @@ public class ClusterSummaryView extends ViewPart { String cpuStatsPeriod = preferenceStore.getString(PreferenceConstants.P_CPU_CHART_PERIOD); // in case of CPU usage, there are three elements in usage data: user, system and total. we use total. - createAreaChartSection(cluster.getAggregatedCpuStats(), "CPU Usage (Aggregated)", 2, "%", getTimestampFormatForPeriod(cpuStatsPeriod), new CpuChartPeriodLinkListener(cpuStatsPeriod)); + cpuChartSection = createAreaChartSection(cluster.getAggregatedCpuStats(), "CPU Usage (Aggregated)", 2, "%", getTimestampFormatForPeriod(cpuStatsPeriod), new CpuChartPeriodLinkListener(cpuStatsPeriod), 100); } private String getTimestampFormatForPeriod(String statsPeriod) { @@ -410,7 +442,7 @@ public class ClusterSummaryView extends ViewPart { String networkStatsPeriod = preferenceStore.getString(PreferenceConstants.P_NETWORK_CHART_PERIOD); // in case of network usage, there are three elements in usage data: received, transmitted and total. we use total. - createAreaChartSection(cluster.getAggregatedNetworkStats(), "Network Usage (Aggregated)", 2, "KiB/s", getTimestampFormatForPeriod(networkStatsPeriod), new NetworkChartPeriodLinkListener(networkStatsPeriod)); + networkChartSection = createAreaChartSection(cluster.getAggregatedNetworkStats(), "Network Usage (Aggregated)", 2, "KiB/s", getTimestampFormatForPeriod(networkStatsPeriod), new NetworkChartPeriodLinkListener(networkStatsPeriod), -1); } private void createRunningTasksSection() { @@ -453,4 +485,18 @@ public class ClusterSummaryView extends ViewPart { form.setFocus(); } } + + private void refreshChartSection(Composite section, ServerStats stats, String statsPeriod, String unit, double maxValue, int columnCount, ChartPeriodLinkListener linkListener) { + for(Control control : section.getChildren()) { + if(! control.isDisposed()) { + control.dispose(); + } + } + List<Calendar> timestamps = new ArrayList<Calendar>(); + List<Double> data = new ArrayList<Double>(); + extractChartData(stats, timestamps, data, 2); + createAreaChart(section, timestamps.toArray(new Calendar[0]), data.toArray(new Double[0]), unit, getTimestampFormatForPeriod(statsPeriod), maxValue); + createChartLinks(section, columnCount, linkListener); + section.layout(); + } } diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/GlusterServerSummaryView.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/GlusterServerSummaryView.java index e7ef1648..492b51f3 100644 --- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/GlusterServerSummaryView.java +++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/GlusterServerSummaryView.java @@ -116,7 +116,7 @@ public class GlusterServerSummaryView extends ViewPart { } private void createAreaChart(Composite section, Calendar timestamps[], Double values[], String unit) { - ChartViewerComposite chartViewerComposite = new ChartViewerComposite(section, SWT.NONE, timestamps, values, unit, "HH:mm"); + ChartViewerComposite chartViewerComposite = new ChartViewerComposite(section, SWT.NONE, timestamps, values, unit, "HH:mm", 100); GridData data = new GridData(SWT.FILL, SWT.FILL, false, false); data.widthHint = CHART_WIDTH; data.heightHint = 250; diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumeSummaryView.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumeSummaryView.java index 44440584..9879f2af 100644 --- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumeSummaryView.java +++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumeSummaryView.java @@ -96,9 +96,7 @@ public class VolumeSummaryView extends ViewPart { public void volumeChanged(Volume volume, Event event) { updateVolumeStatusLabel(); populateAccessControlText(); - Boolean isNFSExported = (volume.getOptions().getOption(Volume.OPTION_NFS_DISABLE).getValue() - .equals(GlusterConstants.OFF) ? true : false); - changeNFSStatus(isNFSExported); + changeNFSStatus(volume.isNfsEnabled()); toolbarManager.updateToolbar(volume); } }; @@ -394,10 +392,7 @@ public class VolumeSummaryView extends ViewPart { createCheckbox(nasProtocolsComposite, "Gluster", true, false); - boolean isNFSEnabled = (volume.getOptions().getOption(Volume.OPTION_NFS_DISABLE).getValue() - .equalsIgnoreCase(GlusterConstants.ON)) ? false : true; - - nfsCheckBox = createCheckbox(nasProtocolsComposite, "NFS", isNFSEnabled, true); + nfsCheckBox = createCheckbox(nasProtocolsComposite, "NFS", volume.isNfsEnabled(), true); nfsCheckBox.addSelectionListener(new SelectionAdapter() { @Override |
