| | |
| | |
|
| | | import org.apache.wicket.PageParameters;
|
| | | import org.apache.wicket.markup.html.basic.Label;
|
| | | import org.apache.wicket.markup.html.image.ContextImage;
|
| | | import org.eclipse.jgit.lib.Repository;
|
| | | import org.wicketstuff.googlecharts.AbstractChartData;
|
| | | import org.wicketstuff.googlecharts.Chart;
|
| | | import org.wicketstuff.googlecharts.ChartAxis;
|
| | | import org.wicketstuff.googlecharts.ChartAxisType;
|
| | | import org.wicketstuff.googlecharts.ChartProvider;
|
| | | import org.wicketstuff.googlecharts.ChartType;
|
| | | import org.wicketstuff.googlecharts.IChartData;
|
| | | import org.wicketstuff.googlecharts.LineStyle;
|
| | | import org.wicketstuff.googlecharts.MarkerType;
|
| | | import org.wicketstuff.googlecharts.ShapeMarker;
|
| | |
|
| | | import com.codecommit.wicket.AbstractChartData;
|
| | | import com.codecommit.wicket.Chart;
|
| | | import com.codecommit.wicket.ChartAxis;
|
| | | import com.codecommit.wicket.ChartAxisType;
|
| | | import com.codecommit.wicket.ChartProvider;
|
| | | import com.codecommit.wicket.ChartType;
|
| | | import com.codecommit.wicket.IChartData;
|
| | | import com.codecommit.wicket.LineStyle;
|
| | | import com.codecommit.wicket.MarkerType;
|
| | | import com.codecommit.wicket.ShapeMarker;
|
| | | import com.gitblit.Constants.AccessRestrictionType;
|
| | | import com.gitblit.GitBlit;
|
| | | import com.gitblit.Keys;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | |
| | | }
|
| | |
|
| | | // repository description
|
| | | add(new Label("repositoryDescription", description));
|
| | | add(new Label("repositoryOwner", JGitUtils.getRepositoryOwner(r)));
|
| | | add(new Label("repositoryDescription", getRepositoryModel().description));
|
| | | add(new Label("repositoryOwner", getRepositoryModel().owner));
|
| | |
|
| | | add(WicketUtils.createTimestampLabel("repositoryLastChange", JGitUtils.getLastChange(r), getTimeZone()));
|
| | | if (metricsTotal == null) {
|
| | |
| | | } else {
|
| | | add(new Label("repositoryStats", MessageFormat.format("{0} commits and {1} tags in {2}", metricsTotal.count, metricsTotal.tag, TimeUtils.duration(metricsTotal.duration))));
|
| | | }
|
| | | |
| | | AccessRestrictionType accessRestriction = getRepositoryModel().accessRestriction;
|
| | | switch (accessRestriction) {
|
| | | case NONE:
|
| | | add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
|
| | | break;
|
| | | case PUSH:
|
| | | add(WicketUtils.newImage("accessRestrictionIcon", "lock_go_16x16.png", getAccessRestrictions().get(accessRestriction)));
|
| | | break;
|
| | | case CLONE:
|
| | | add(WicketUtils.newImage("accessRestrictionIcon", "lock_pull_16x16.png", getAccessRestrictions().get(accessRestriction)));
|
| | | break;
|
| | | case VIEW:
|
| | | add(WicketUtils.newImage("accessRestrictionIcon", "shield_16x16.png", getAccessRestrictions().get(accessRestriction)));
|
| | | break;
|
| | | default:
|
| | | add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
|
| | | }
|
| | | add(new Label("repositoryCloneUrl", GitBlit.self().getCloneUrl(repositoryName)));
|
| | |
|
| | | add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0));
|
| | | add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs));
|
| | | add(new BranchesPanel("branchesPanel", repositoryName, r, numberRefs));
|
| | | add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs));
|
| | |
|
| | | // Display an activity line graph
|
| | | insertActivityGraph(metrics);
|
| | |
| | | }
|
| | |
|
| | | private void insertActivityGraph(List<Metric> metrics) {
|
| | | if (GitBlit.self().settings().getBoolean(Keys.web.generateActivityGraph, true)) {
|
| | | if (metrics.size() > 0 && GitBlit.self().settings().getBoolean(Keys.web.generateActivityGraph, true)) {
|
| | | IChartData data = getChartData(metrics);
|
| | |
|
| | | ChartProvider provider = new ChartProvider(new Dimension(400, 100), ChartType.LINE, data);
|
| | |
| | | provider.addAxis(commitAxis);
|
| | |
|
| | | provider.setLineStyles(new LineStyle[] {new LineStyle(2, 4, 0), new LineStyle(0, 4, 1)});
|
| | | provider.addShapeMarker(new ShapeMarker(MarkerType.DIAMOND, Color.BLUE, 1, -1, 5));
|
| | | provider.addShapeMarker(new ShapeMarker(MarkerType.CIRCLE, Color.BLUE, 1, -1, 5));
|
| | |
|
| | | add(new Chart("commitsChart", provider));
|
| | | } else {
|
| | | add(new ContextImage("commitsChart", "blank.png"));
|
| | | add(WicketUtils.newBlankImage("commitsChart"));
|
| | | }
|
| | | }
|
| | |
|