summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket/pages/DashboardPage.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-09-19 08:36:25 -0400
committerJames Moger <james.moger@gitblit.com>2013-09-19 08:36:25 -0400
commita047669265c4090d7d0982f5654d4974a58ac12a (patch)
tree04f0b5f971d62e3c8cc55c0be7ea147597eca404 /src/main/java/com/gitblit/wicket/pages/DashboardPage.java
parent4f0f65fed0613cd69eba1cb8a80d0d18d0a79983 (diff)
downloadgitblit-a047669265c4090d7d0982f5654d4974a58ac12a.tar.gz
gitblit-a047669265c4090d7d0982f5654d4974a58ac12a.zip
Disable *most* activity graphs when web.generateActivityGraph=false
This setting originally only worked for the Summary page, but since that page was written, other pages have offered graphing. This setting will now disable Google Chart requests on the Dashboard, Activity, and Summary pages. This is related to issue-310.
Diffstat (limited to 'src/main/java/com/gitblit/wicket/pages/DashboardPage.java')
-rw-r--r--src/main/java/com/gitblit/wicket/pages/DashboardPage.java48
1 files changed, 26 insertions, 22 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/DashboardPage.java b/src/main/java/com/gitblit/wicket/pages/DashboardPage.java
index 0af46c71..18add502 100644
--- a/src/main/java/com/gitblit/wicket/pages/DashboardPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/DashboardPage.java
@@ -217,28 +217,32 @@ public abstract class DashboardPage extends RootPage {
frag.add(new Label("feedheader", MessageFormat.format(headerPattern,
daysBack, totalCommits, authorMetrics.size())));
- // build google charts
- GoogleCharts charts = new GoogleCharts();
-
- // active repositories pie chart
- GoogleChart chart = new GooglePieChart("chartRepositories", getString("gb.activeRepositories"),
- getString("gb.repository"), getString("gb.commits"));
- for (Metric metric : repositoryMetrics.values()) {
- chart.addValue(metric.name, metric.count);
- }
- chart.setShowLegend(false);
- charts.addChart(chart);
-
- // active authors pie chart
- chart = new GooglePieChart("chartAuthors", getString("gb.activeAuthors"),
- getString("gb.author"), getString("gb.commits"));
- for (Metric metric : authorMetrics.values()) {
- chart.addValue(metric.name, metric.count);
- }
- chart.setShowLegend(false);
- charts.addChart(chart);
+ if (GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {
+ // build google charts
+ GoogleCharts charts = new GoogleCharts();
+
+ // active repositories pie chart
+ GoogleChart chart = new GooglePieChart("chartRepositories", getString("gb.activeRepositories"),
+ getString("gb.repository"), getString("gb.commits"));
+ for (Metric metric : repositoryMetrics.values()) {
+ chart.addValue(metric.name, metric.count);
+ }
+ chart.setShowLegend(false);
+ charts.addChart(chart);
+
+ // active authors pie chart
+ chart = new GooglePieChart("chartAuthors", getString("gb.activeAuthors"),
+ getString("gb.author"), getString("gb.commits"));
+ for (Metric metric : authorMetrics.values()) {
+ chart.addValue(metric.name, metric.count);
+ }
+ chart.setShowLegend(false);
+ charts.addChart(chart);
- add(new HeaderContributor(charts));
- frag.add(new Fragment("charts", "chartsFragment", this));
+ add(new HeaderContributor(charts));
+ frag.add(new Fragment("charts", "chartsFragment", this));
+ } else {
+ frag.add(new Label("charts").setVisible(false));
+ }
}
}