Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[JENKINS-22295] Added fake URL so that graph detail view uses selecte…
…d graph type.
  • Loading branch information
uhafner committed May 9, 2016
1 parent ed66289 commit ea79d2b6d28c9bf36ed58864d55d8922ce1bd5fc
@@ -181,7 +181,7 @@ public Object getTrendDetails() {
* @return the details
*/
public Object getTrendDetails(final StaplerRequest request, final StaplerResponse response) {
return new TrendDetails(getProject(), getTrendGraph(request, response, "../../"));
return new TrendDetails(getProject(), getTrendGraph(request, response, "../../"), getTrendGraphId());
}

/**
@@ -3,7 +3,6 @@
import org.kohsuke.stapler.StaplerRequest;

import hudson.model.AbstractProject;

import hudson.util.Graph;

/**
@@ -14,6 +13,7 @@
public class TrendDetails {
/** The graph to display. */
private final Graph trendGraph;
private final String id;
/** The project of the graph. */
private final AbstractProject<?, ?> project;

@@ -24,10 +24,14 @@ public class TrendDetails {
* the project of the graph
* @param trendGraph
* the graph
* @param id
* the ID of the trend graph
*/
public TrendDetails(final AbstractProject<?, ?> project, final Graph trendGraph) {
public TrendDetails(final AbstractProject<?, ?> project, final Graph trendGraph,
final String id) {
this.project = project;
this.trendGraph = trendGraph;
this.id = id;
}

/**
@@ -41,6 +45,15 @@ public Graph getTrendGraph(final StaplerRequest request) {
return trendGraph;
}

/**
* Returns the ID of the selected trend graph.
*
* @return ID of the selected trend graph
*/
public String getTrendGraphId() {
return id;
}

/**
* Returns the abstractProject.
*
@@ -5,7 +5,9 @@
<l:layout norefresh="true">
<st:include it="${it.project}" page="sidepanel.jelly" />
<l:main-panel>
<img src="trendGraph/png?width=800&amp;height=600" lazymap="trendGraph/map?width=800&amp;height=600"/>
<!-- Note that the parameter url=${trendGraphId} is not used by the graph: it
has been added to provide different URLs so that the images are not cached by the browser. -->
<img src="trendGraph/png?width=800&amp;height=600&amp;url=${it.trendGraphId}" lazymap="trendGraph/map?width=800&amp;height=600&amp;url=${it.trendGraphId}"/>
</l:main-panel>
</l:layout>
</j:jelly>

0 comments on commit ea79d2b

Please sign in to comment.