summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket/pages/ActivityPage.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/ActivityPage.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/ActivityPage.java')
-rw-r--r--src/main/java/com/gitblit/wicket/pages/ActivityPage.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/ActivityPage.java b/src/main/java/com/gitblit/wicket/pages/ActivityPage.java
index 413403b4..a436813e 100644
--- a/src/main/java/com/gitblit/wicket/pages/ActivityPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/ActivityPage.java
@@ -27,6 +27,7 @@ import java.util.Set;
import org.apache.wicket.PageParameters;
import org.apache.wicket.behavior.HeaderContributor;
import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.panel.Fragment;
import com.gitblit.GitBlit;
import com.gitblit.Keys;
@@ -36,8 +37,8 @@ import com.gitblit.models.RepositoryModel;
import com.gitblit.utils.ActivityUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.CacheControl;
-import com.gitblit.wicket.PageRegistration;
import com.gitblit.wicket.CacheControl.LastModified;
+import com.gitblit.wicket.PageRegistration;
import com.gitblit.wicket.PageRegistration.DropDownMenuItem;
import com.gitblit.wicket.PageRegistration.DropDownMenuRegistration;
import com.gitblit.wicket.WicketUtils;
@@ -111,8 +112,13 @@ public class ActivityPage extends RootPage {
daysBack, totalCommits, totalAuthors)));
// create the activity charts
- GoogleCharts charts = createCharts(recentActivity);
- add(new HeaderContributor(charts));
+ if (GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {
+ GoogleCharts charts = createCharts(recentActivity);
+ add(new HeaderContributor(charts));
+ add(new Fragment("chartsPanel", "chartsFragment", this));
+ } else {
+ add(new Label("chartsPanel").setVisible(false));
+ }
// add activity panel
add(new ActivityPanel("activityPanel", recentActivity));