mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
dashboard command remove the useless tomcat table. #696
This commit is contained in:
@@ -296,7 +296,7 @@ public class DashboardCommand extends AnnotatedCommand {
|
||||
}
|
||||
|
||||
String drawRuntimeInfoAndTomcatInfo(int width, int height) {
|
||||
TableElement table = new TableElement(1, 1);
|
||||
TableElement resultTable = new TableElement(1, 1);
|
||||
|
||||
TableElement runtimeInfoTable = new TableElement(1, 1).rightCellPadding(1);
|
||||
runtimeInfoTable
|
||||
@@ -304,11 +304,12 @@ public class DashboardCommand extends AnnotatedCommand {
|
||||
|
||||
addRuntimeInfo(runtimeInfoTable);
|
||||
|
||||
TableElement tomcatInfoTable = new TableElement(1, 1).rightCellPadding(1);
|
||||
TableElement tomcatInfoTable = null;
|
||||
|
||||
try {
|
||||
// 如果请求tomcat信息失败,则不显示tomcat信息
|
||||
if (NetUtils.request("http://localhost:8006").isSuccess()) {
|
||||
tomcatInfoTable = new TableElement(1, 1).rightCellPadding(1);
|
||||
tomcatInfoTable
|
||||
.add(new RowElement().style(Decoration.bold.fg(Color.black).bg(Color.white)).add("Tomcat", ""));
|
||||
addTomcatInfo(tomcatInfoTable);
|
||||
@@ -317,8 +318,13 @@ public class DashboardCommand extends AnnotatedCommand {
|
||||
logger.error(null, "get Tomcat Info error!", t);
|
||||
}
|
||||
|
||||
table.row(runtimeInfoTable, tomcatInfoTable);
|
||||
return RenderUtil.render(table, width, height);
|
||||
if (tomcatInfoTable != null) {
|
||||
resultTable.row(runtimeInfoTable, tomcatInfoTable);
|
||||
} else {
|
||||
resultTable = runtimeInfoTable;
|
||||
}
|
||||
|
||||
return RenderUtil.render(resultTable, width, height);
|
||||
}
|
||||
|
||||
static class MemoryEntry {
|
||||
|
||||
Reference in New Issue
Block a user