提交 98215d91 编写于 作者: Y You Yong

modify the cat mobile page

上级 e9692e95
......@@ -5,7 +5,7 @@ public enum JspFile {
GRAPHS("/jsp/report/event_graphs.jsp"),
MOBILE("/jsp/report/mobile.jsp");
MOBILE("/jsp/report/event_mobile.jsp");
private String m_path;
......
......@@ -13,6 +13,8 @@ public class JspViewer extends BaseJspViewer<ReportPage, Action, Context, Model>
return JspFile.VIEW.getPath();
case GRAPHS:
return JspFile.GRAPHS.getPath();
case MOBILE:
return JspFile.MOBILE.getPath();
}
throw new RuntimeException("Unknown action: " + action);
......
......@@ -5,7 +5,9 @@ public enum Action implements com.site.web.mvc.Action {
THREAD("thread"),
DETAIL("detail");
DETAIL("detail"),
MOBILE("mobile");
private String m_name;
......
......@@ -17,6 +17,7 @@ import com.dianping.cat.report.page.model.spi.ModelPeriod;
import com.dianping.cat.report.page.model.spi.ModelRequest;
import com.dianping.cat.report.page.model.spi.ModelResponse;
import com.dianping.cat.report.page.model.spi.ModelService;
import com.google.gson.Gson;
import com.site.lookup.annotation.Inject;
import com.site.lookup.util.StringUtils;
import com.site.web.mvc.PageHandler;
......@@ -144,7 +145,13 @@ public class Handler implements PageHandler<Context> {
report = getAllIpReport(payload);
model.setReport(report);
model.setLongDate(payload.getDate());
model.setAllStatistics(new ProblemStatistics().displayByAllIps(report, payload));
ProblemStatistics allStatistics = new ProblemStatistics().displayByAllIps(report, payload);
model.setAllStatistics(allStatistics);
if (payload.getAction() == Action.MOBILE) {
Gson gson = new Gson();
String response = gson.toJson(allStatistics);
model.setMobileResponse(response);
}
} else {
switch (payload.getAction()) {
case GROUP:
......
......@@ -6,7 +6,9 @@ public enum JspFile {
THREAD("/jsp/report/problemThread.jsp"),
DETAIL("/jsp/report/problemDetail.jsp")
DETAIL("/jsp/report/problemDetail.jsp"),
MOBILE("/jsp/report/problem_mobile.jsp");
;
private String m_path;
......
......@@ -15,6 +15,8 @@ public class JspViewer extends BaseJspViewer<ReportPage, Action, Context, Model>
return JspFile.THREAD.getPath();
case DETAIL:
return JspFile.DETAIL.getPath();
case MOBILE:
return JspFile.MOBILE.getPath();
}
throw new RuntimeException("Unknown action: " + action);
......
......@@ -34,6 +34,8 @@ public class Model extends AbstractReportModel<Action, Context> {
private ProblemStatistics m_allStatistics;
private String m_mobileResponse;
public Model(Context ctx) {
super(ctx);
}
......@@ -187,4 +189,12 @@ public class Model extends AbstractReportModel<Action, Context> {
m_threshold = threshold;
}
public String getMobileResponse() {
return m_mobileResponse;
}
public void setMobileResponse(String mobileResponse) {
m_mobileResponse = mobileResponse;
}
}
......@@ -5,7 +5,7 @@ public enum JspFile {
GRAPHS("/jsp/report/transaction_graphs.jsp"),
MOBILE("/jsp/report/mobile.jsp");
MOBILE("/jsp/report/transaction_mobile.jsp");
private String m_path;
......
<%@ page session="false" language="java" pageEncoding="UTF-8" %>
<%@ page contentType="text/html; charset=utf-8"%>
<jsp:useBean id="model" type="com.dianping.cat.report.page.event.Model" scope="request" />
${model.mobileResponse}
\ No newline at end of file
<%@ page session="false" language="java" pageEncoding="UTF-8" %>
<%@ page contentType="text/html; charset=utf-8"%>
<jsp:useBean id="model" type="com.dianping.cat.report.page.heartbeat.Model" scope="request" />
${model.mobileResponse}
\ No newline at end of file
<%@ page session="false" language="java" pageEncoding="UTF-8" %>
<%@ page contentType="text/html; charset=utf-8"%>
<jsp:useBean id="model" type="com.dianping.cat.report.page.problem.Model" scope="request" />
${model.mobileResponse}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册