"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "moskito-webui/src/main/java/net/anotheria/moskito/webui/dashboards/action/ShowDashboardAction.java" between
moskito-moskito-2.8.9.tar.gz and moskito-moskito-2.9.0.tar.gz

About: MoSKito (Monitoring System Kit) is a framework for java application monitoring. Sources.

ShowDashboardAction.java  (moskito-moskito-2.8.9):ShowDashboardAction.java  (moskito-moskito-2.9.0)
skipping to change at line 67 skipping to change at line 67
Map<String, GraphDataBean> graphData = new HashMap<>(); Map<String, GraphDataBean> graphData = new HashMap<>();
//set default values, allow to exit previously. //set default values, allow to exit previously.
request.setAttribute("gaugesPresent", gaugesPresent); request.setAttribute("gaugesPresent", gaugesPresent);
request.setAttribute("chartsPresent", chartsPresent); request.setAttribute("chartsPresent", chartsPresent);
request.setAttribute("thresholdsPresent", thresholdsPresent); request.setAttribute("thresholdsPresent", thresholdsPresent);
request.setAttribute("producersPresent", producersPresent); request.setAttribute("producersPresent", producersPresent);
request.setAttribute("showHelp", !(gaugesPresent || chartsPresent || thresholdsPresent || producersPresent)); request.setAttribute("showHelp", !(gaugesPresent || chartsPresent || thresholdsPresent || producersPresent));
DashboardConfig selectedDashboardConfig = getDashboardAPI().getDa if (dashboardName==null)
shboardConfig(dashboardName);
if (dashboardName == null || selectedDashboardConfig == null) {
dashboardName = getDashboardAPI().getDefaultDashboardName (); dashboardName = getDashboardAPI().getDefaultDashboardName ();
if (dashboardName == null) { // no dashboards present if (dashboardName==null){
return actionMapping.success(); //there are no configured dashboards
} return actionMapping.success();
request.setAttribute("selectedDashboard", dashboardName); }
DashboardConfig selectedDashboardConfig = getDashboardAPI().getDa
shboardConfig(dashboardName);
if (selectedDashboardConfig == null) {
throw new Exception("Dashboard '"+dashboardName+"' not fo
und.");
} }
request.setAttribute("selectedDashboard", dashboardName);
DashboardAO dashboard = getDashboardAPI().getDashboard(dashboardN ame); DashboardAO dashboard = getDashboardAPI().getDashboard(dashboardN ame);
List<ThresholdStatusBean> thresholdStatusBeans = getThresholdBean s(dashboard.getThresholds()); List<ThresholdStatusBean> thresholdStatusBeans = getThresholdBean s(dashboard.getThresholds());
List<GaugeBean> gaugeBeans = getGaugeBeans(dashboard.getGauges()) ; List<GaugeBean> gaugeBeans = getGaugeBeans(dashboard.getGauges()) ;
List<DashboardChartBean> dashboardChartAOList = getChartBeans(das hboard.getCharts()); List<DashboardChartBean> dashboardChartAOList = getChartBeans(das hboard.getCharts());
List<ProducerDecoratorBean> decoratedProducers = getDecoratedProd ucerBeans(dashboard.getProducers(), request, graphData); List<ProducerDecoratorBean> decoratedProducers = getDecoratedProd ucerBeans(dashboard.getProducers(), request, graphData);
// Getting configured dashboard widgets // Getting configured dashboard widgets
List<DashboardWidget> widgets = new LinkedList<>(); List<DashboardWidget> widgets = new LinkedList<>();
for (String widgetName : selectedDashboardConfig.getWidgets()) { for (String widgetName : selectedDashboardConfig.getWidgets()) {
skipping to change at line 194 skipping to change at line 198
} }
return new ArrayList<>(); return new ArrayList<>();
} }
private List<GaugeBean> getGaugeBeans(List<GaugeAO> gaugeAOList) throws A PIException { private List<GaugeBean> getGaugeBeans(List<GaugeAO> gaugeAOList) throws A PIException {
List<GaugeBean> ret = new ArrayList<>(); List<GaugeBean> ret = new ArrayList<>();
if (gaugeAOList == null || gaugeAOList.size() == 0) if (gaugeAOList == null || gaugeAOList.size() == 0)
return ret; return ret;
List<DashboardAO> dashboardAOList = new ArrayList<>();
for(String name : getDashboardAPI().getDashboardNames()) {
dashboardAOList.add(getDashboardAPI().getDashboard(name))
;
}
for (GaugeAO gaugeAO : gaugeAOList) { for (GaugeAO gaugeAO : gaugeAOList) {
String dashboardNames = ""; String dashboardNames = getDashboardAPI().getDashboardNam
for(DashboardAO dashboardAO: dashboardAOList) { esWhichDoNotIncludeThisGauge(gaugeAO.getName());
if (dashboardAO.getGauges() == null || !dashboard
AO.getGauges().contains(gaugeAO)) {
dashboardNames += dashboardAO.getName()+"
,";
}
}
if (dashboardNames.length() > 0)
dashboardNames = dashboardNames.substring(0, dash
boardNames.length()-1);
ret.add(new GaugeBean(gaugeAO, dashboardNames)); ret.add(new GaugeBean(gaugeAO, dashboardNames));
} }
return ret; return ret;
} }
private List<DashboardChartBean> getChartBeans(List<DashboardChartAO> das hboardChartAOList) throws APIException { private List<DashboardChartBean> getChartBeans(List<DashboardChartAO> das hboardChartAOList) throws APIException {
List<DashboardChartBean> ret = new ArrayList<>(); List<DashboardChartBean> ret = new ArrayList<>();
if (dashboardChartAOList == null || dashboardChartAOList.size() = = 0) if (dashboardChartAOList == null || dashboardChartAOList.size() = = 0)
return ret; return ret;
List<DashboardAO> dashboardAOList = new ArrayList<>();
for(String name : getDashboardAPI().getDashboardNames()) {
dashboardAOList.add(getDashboardAPI().getDashboard(name))
;
}
for (DashboardChartAO dashboardChartAO : dashboardChartAOList) { for (DashboardChartAO dashboardChartAO : dashboardChartAOList) {
String dashboardNames = ""; String dashboardNames = getDashboardAPI().getDashboardNam
for(DashboardAO dashboardAO: dashboardAOList) { esWhichDoNotIncludeThisChart(dashboardChartAO.getCaption());
if (dashboardAO.getCharts() == null || !dashboard
AO.getCharts().contains(dashboardChartAO)) {
dashboardNames += dashboardAO.getName()+"
,";
}
}
if (dashboardNames.length() > 0)
dashboardNames = dashboardNames.substring(0, dash
boardNames.length()-1);
ret.add(new DashboardChartBean(dashboardChartAO, dashboar dNames)); ret.add(new DashboardChartBean(dashboardChartAO, dashboar dNames));
} }
return ret; return ret;
} }
/** /**
* Creates Dashboard REST API url for given dashboard. * Creates Dashboard REST API url for given dashboard.
* Used at UI. * Used at UI.
* *
* @param request {@link HttpServletRequest} * @param request {@link HttpServletRequest}
* @param dashboardName dashboard name * @param dashboardName dashboard name
* @return Dashboard REST API url, including context path * @return Dashboard REST API url, including context path
 End of changes. 8 change blocks. 
40 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)