...
|
...
|
@@ -2,6 +2,7 @@ package com.ui.ctrl; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.ui.common.TagTypeEnum;
|
|
|
import com.ui.contants.HttpUriContants;
|
|
|
import com.ui.http.HttpRestClient;
|
...
|
...
|
@@ -46,6 +47,64 @@ public class HostInfoCtrl { |
|
|
return mv;
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/toHostTopoList")
|
|
|
public ModelAndView toHostTopoList() {
|
|
|
ModelAndView mv = new ModelAndView();
|
|
|
mv.setViewName("host/hostTopoList");
|
|
|
return mv;
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/toHostTopoSub")
|
|
|
public ModelAndView toHostTopoSub(String id) {
|
|
|
ModelAndView mv = new ModelAndView();
|
|
|
mv.setViewName("host/hostTopo");
|
|
|
|
|
|
|
|
|
int divMarginTop=100;
|
|
|
int divPadding=60;
|
|
|
int divLevel=0;
|
|
|
int divMiddle=200;
|
|
|
int countInRow=6;
|
|
|
|
|
|
List<Map<String,Object>> echartDataList=new ArrayList<>();
|
|
|
Map<String,Object> pTmp=null;
|
|
|
//lb
|
|
|
/*Map<String,Object> pTmp=new HashMap<>();
|
|
|
pTmp.put("name","lb");
|
|
|
pTmp.put("x",divMiddle);
|
|
|
pTmp.put("y",divMarginTop+divPadding*(divLevel++));
|
|
|
pTmp.put("fixed",true);
|
|
|
pTmp.put("symbolSize",new Integer[]{120,50});
|
|
|
pTmp.put("itemStyle",JSON.parseObject("{normal:{color:'#169fe6'}}"));
|
|
|
echartDataList.add(pTmp);*/
|
|
|
//nginx
|
|
|
pTmp=new HashMap<>();
|
|
|
pTmp.put("name","nginx");
|
|
|
pTmp.put("x",divMiddle);
|
|
|
pTmp.put("y",divMarginTop+divPadding*(divLevel++));
|
|
|
pTmp.put("fixed",true);
|
|
|
pTmp.put("symbolSize",new Integer[]{120,50});
|
|
|
pTmp.put("itemStyle",JSON.parseObject("{normal:{color:'#169fe6'}}"));
|
|
|
echartDataList.add(pTmp);
|
|
|
|
|
|
//yoho-gateway
|
|
|
pTmp=new HashMap<>();
|
|
|
pTmp.put("name","gateway");
|
|
|
pTmp.put("x",divMiddle);
|
|
|
pTmp.put("y",divMarginTop+divPadding*(divLevel++));
|
|
|
pTmp.put("fixed",true);
|
|
|
pTmp.put("symbolSize",new Integer[]{120,50});
|
|
|
pTmp.put("itemStyle",JSON.parseObject("{normal:{color:'#169fe6'}}"));
|
|
|
echartDataList.add(pTmp);
|
|
|
|
|
|
|
|
|
|
|
|
Gson gson = new Gson();
|
|
|
String jsonString=gson.toJson( echartDataList,ArrayList.class);
|
|
|
mv.addObject("echartDataList",jsonString);
|
|
|
return mv;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据标签类别,查询该类别下的属于tag
|
|
|
* @param type
|
...
|
...
|
|