Authored by jack.xue

Merge branch 'master' of http://git.yoho.cn/ops/monitor-ui

@@ -45,6 +45,32 @@ public class HttpRestClient { @@ -45,6 +45,32 @@ public class HttpRestClient {
45 } 45 }
46 } 46 }
47 47
  48 + public <T> T get(String url, Class<T> responseType,Map<String, ?> map) {
  49 + try {
  50 + StringBuilder uri = new StringBuilder(url);
  51 + if(map != null){
  52 + uri.append("?");
  53 + for (Map.Entry<String, ?> entry : map.entrySet()) {
  54 + uri.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
  55 + }
  56 + return restTemplate.getForObject(uri.toString().substring(0, uri.length()-1), responseType);
  57 + }
  58 + return restTemplate.getForObject(url, responseType);
  59 + } catch (Exception e) {
  60 + logger.error("getForObject failed!url: "+url, e);
  61 + return null;
  62 + }
  63 + }
  64 +
  65 + public <T> T post(String url, Object request, Class<T> responseType) {
  66 + try {
  67 + return restTemplate.postForObject(url, request,responseType);
  68 + } catch (Exception e) {
  69 + logger.error("postForObject failed!url:"+url, e);
  70 + return null;
  71 + }
  72 + }
  73 +
48 public <T> T defaultGet(String uri, Class<T> responseType) { 74 public <T> T defaultGet(String uri, Class<T> responseType) {
49 try { 75 try {
50 return restTemplate.getForObject(systemConfig.getServiceUrl() + uri, responseType); 76 return restTemplate.getForObject(systemConfig.getServiceUrl() + uri, responseType);
  1 +package com.ui.model.req;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +@SuppressWarnings("serial")
  6 +public class BuildRequest implements Serializable {
  7 +
  8 + private String project;
  9 +
  10 + private String environment;
  11 +
  12 + private String operate;
  13 +
  14 + private String rollbackfile;
  15 +
  16 + private String messageid;
  17 +
  18 + private String tag;
  19 +
  20 + private String branch;
  21 +
  22 + public String getTag() {
  23 + return tag;
  24 + }
  25 +
  26 + public void setTag(String tag) {
  27 + this.tag = tag;
  28 + }
  29 +
  30 + public String getProject() {
  31 + return project;
  32 + }
  33 +
  34 + public void setProject(String project) {
  35 + this.project = project;
  36 + }
  37 +
  38 + public String getEnvironment() {
  39 + return environment;
  40 + }
  41 +
  42 + public void setEnvironment(String environment) {
  43 + this.environment = environment;
  44 + }
  45 +
  46 + public String getOperate() {
  47 + return operate;
  48 + }
  49 +
  50 + public void setOperate(String operate) {
  51 + this.operate = operate;
  52 + }
  53 +
  54 + public String getRollbackfile() {
  55 + return rollbackfile;
  56 + }
  57 +
  58 + public void setRollbackfile(String rollbackfile) {
  59 + this.rollbackfile = rollbackfile;
  60 + }
  61 +
  62 + public String getMessageid() {
  63 + return messageid;
  64 + }
  65 +
  66 + public void setMessageid(String messageid) {
  67 + this.messageid = messageid;
  68 + }
  69 +
  70 + public String getBranch() {
  71 + return branch;
  72 + }
  73 +
  74 + public void setBranch(String branch) {
  75 + this.branch = branch;
  76 + }
  77 +}
  1 +package com.ui.project;
  2 +
  3 +/**
  4 + * Created by zhengyouwei on 2016/6/29.
  5 + */
  6 +public class Project {
  7 +
  8 + private String order;//顺序
  9 +
  10 + private String name;
  11 +
  12 + private String projectid;
  13 +
  14 + private String group;
  15 +
  16 + public Project(){
  17 +
  18 + }
  19 +
  20 + public Project(String order, String name, String projectid, String group){
  21 + this.order = order;
  22 + this.name = name;
  23 + this.projectid = projectid;
  24 + this.group = group;
  25 + }
  26 +
  27 +
  28 + public String getOrder() {
  29 + return order;
  30 + }
  31 +
  32 + public void setOrder(String order) {
  33 + this.order = order;
  34 + }
  35 +
  36 + public String getName() {
  37 + return name;
  38 + }
  39 +
  40 + public void setName(String name) {
  41 + this.name = name;
  42 + }
  43 +
  44 + public String getProjectid() {
  45 + return projectid;
  46 + }
  47 +
  48 + public void setProjectid(String projectid) {
  49 + this.projectid = projectid;
  50 + }
  51 +
  52 + public String getGroup() {
  53 + return group;
  54 + }
  55 +
  56 + public void setGroup(String group) {
  57 + this.group = group;
  58 + }
  59 +}
  1 +package com.ui.project;
  2 +
  3 +import java.util.HashMap;
  4 +import java.util.HashSet;
  5 +import java.util.Map;
  6 +import java.util.Set;
  7 +
  8 +public class ProjectEnvironment {
  9 +
  10 + private static Map<String,String> map = new HashMap<>();
  11 +
  12 + static{
  13 + map.put("aws", "");
  14 + map.put("qcloud","");
  15 + map.put("qcloud_gray","");
  16 + map.put("test","http://192.168.102.220:8080/web/");
  17 + //map.put("dev");
  18 +
  19 + }
  20 +
  21 + public static Set<String> getEnviroments(){
  22 + return map.keySet();
  23 + }
  24 +
  25 + public static String getUrl(String envi){
  26 + return map.get(envi);
  27 + }
  28 +
  29 +}
  1 +package com.ui.project;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.HashMap;
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +public class ProjectOnline {
  9 +
  10 + private static List<Project> list = new ArrayList<Project>();
  11 +
  12 + private static Map<String,Project> map = new HashMap<String,Project>();
  13 +
  14 + static{
  15 + list.add(new Project("1","yoho-gateway","126","yoho30"));
  16 + list.add(new Project("1","yoho-users","134","yoho30"));
  17 + list.add(new Project("1","yoho-message","123","yoho30"));
  18 + list.add(new Project("1","yoho-sns","125","yoho30"));
  19 + list.add(new Project("1","yoho-push","137","yoho30"));
  20 + list.add(new Project("1","yohobuy-resources","122","yoho30"));
  21 + list.add(new Project("1","yohobuy-order","124","yoho30"));
  22 + list.add(new Project("1","yohobuy-promotion","140","yoho30"));
  23 + list.add(new Project("1","yohobuy-product","143","yoho30"));
  24 + list.add(new Project("1","yohobuy-union","133","yoho30"));
  25 + list.add(new Project("1","yohobuy-activity","129","yoho30"));
  26 + list.add(new Project("1","yohobuy-task","138","yoho30"));
  27 + list.add(new Project("1","yohobuy-wechat","248","yoho30"));
  28 + list.add(new Project("1","yohobuy-brower","131","yoho30"));
  29 +
  30 + list.add(new Project("2","yoho-search-service","12","yoho-search"));
  31 + list.add(new Project("2","yoho-search-consumer","8","yoho-search"));
  32 + list.add(new Project("2","yoho-search-producer","7","yoho-search"));
  33 +
  34 + list.add(new Project("3","yohobuy-platform","110","platform"));
  35 + list.add(new Project("3","yohobuy-bigdata","113","platform"));
  36 +
  37 + for(Project project :list){
  38 + map.put(project.getName(),project);
  39 + }
  40 +
  41 + }
  42 +
  43 +
  44 + public static List<Project> getProjectList() {
  45 + return list;
  46 + }
  47 +
  48 + public static Project getProject(String name){
  49 + return map.get(name);
  50 + }
  51 +
  52 +}
  1 +package com.ui.ctrl;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.ui.http.HttpRestClient;
  5 +import com.ui.model.req.BuildRequest;
  6 +import com.ui.project.ProjectEnvironment;
  7 +import com.ui.project.ProjectOnline;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Controller;
  10 +import org.springframework.ui.Model;
  11 +import org.springframework.web.bind.annotation.RequestBody;
  12 +import org.springframework.web.bind.annotation.RequestMapping;
  13 +import org.springframework.web.bind.annotation.RequestMethod;
  14 +import org.springframework.web.bind.annotation.ResponseBody;
  15 +import org.springframework.web.servlet.ModelAndView;
  16 +
  17 +import java.util.HashMap;
  18 +import java.util.Map;
  19 +
  20 +@Controller
  21 +@RequestMapping("/project")
  22 +public class ProjectBuildCtrl {
  23 +
  24 + @Autowired
  25 + private HttpRestClient httpRestClient;
  26 +
  27 + @RequestMapping(value = "projectbuild")
  28 + public ModelAndView projectbuild(Model model) {
  29 + model.addAttribute("environments", ProjectEnvironment.getEnviroments());
  30 + return new ModelAndView("jsp/project/project");
  31 + }
  32 +
  33 + /**
  34 + * 获取所有项目
  35 + *
  36 + * @return
  37 + */
  38 + @RequestMapping(value = "getProjects", method = RequestMethod.POST)
  39 + @ResponseBody
  40 + public String getProjects() {
  41 + try {
  42 + return JSONArray.toJSON(ProjectOnline.getProjectList()).toString();
  43 + } catch (Exception ex) {
  44 + return "failed";
  45 + }
  46 + }
  47 +
  48 + /**
  49 + * 校验tag
  50 + *
  51 + * @return
  52 + */
  53 + @RequestMapping(value = "checkTag", method = RequestMethod.POST)
  54 + @ResponseBody
  55 + public String checkTag(String projects, String tag, String enviromment) {
  56 + Map<String, String> map = new HashMap<>();
  57 + map.put("projects", projects);
  58 + map.put("tag", tag);
  59 + return httpRestClient.get(ProjectEnvironment.getUrl(enviromment) + "checkTag", String.class, map);
  60 +
  61 + }
  62 +
  63 + /**
  64 + * 校验branch
  65 + *
  66 + * @return
  67 + */
  68 + @RequestMapping(value = "checkBranch")
  69 + @ResponseBody
  70 + public String checkBranch(String projects, String branch, String environment) {
  71 + if (!("master".equals(branch) || "test".equals(branch) || "dev".equals(branch))) {
  72 + Map<String, String> map = new HashMap<>();
  73 + map.put("projects", projects);
  74 + map.put("branch", branch);
  75 + return httpRestClient.get(ProjectEnvironment.getUrl(environment) + "checkBranch", String.class, map);
  76 + }
  77 + return "1";
  78 +
  79 +
  80 + }
  81 +
  82 + /**
  83 + * 执行任务
  84 + *
  85 + * @param request
  86 + * @return
  87 + */
  88 + @RequestMapping(value = "build", method = RequestMethod.POST)
  89 + @ResponseBody
  90 + public String build(@RequestBody BuildRequest request) {
  91 + try {
  92 + return httpRestClient.post(ProjectEnvironment.getUrl(request.getEnvironment()) + "build", request, String.class);
  93 + } catch (Exception ex) {
  94 + return "failed";
  95 + }
  96 + }
  97 +
  98 + /**
  99 + * 获取执行结果
  100 + *
  101 + * @param messageid
  102 + * @return
  103 + */
  104 + @RequestMapping(value = "getbuildmsg", method = RequestMethod.POST)
  105 + @ResponseBody
  106 + public String getbuildmsg(String messageid, String project) {
  107 + try {
  108 + Map<String, String> map = new HashMap<>();
  109 + map.put("messageid", messageid);
  110 + map.put("project", project);
  111 + return httpRestClient.get(ProjectEnvironment.getUrl(messageid.split("_")[0]) + "getbuildmsg", String.class, map);
  112 +
  113 + } catch (Exception ex) {
  114 + return "failed";
  115 + }
  116 + }
  117 +
  118 + @RequestMapping(value = "cancelBuild")
  119 + @ResponseBody
  120 + public String cancelBuild(String id) {
  121 + try {
  122 + Map<String, String> map = new HashMap<>();
  123 + map.put("id", id);
  124 + return httpRestClient.get(ProjectEnvironment.getUrl(id.split("_")[0]) + "cancelBuild", String.class, map);
  125 + } catch (Exception ex) {
  126 + return "failed";
  127 + }
  128 + }
  129 +
  130 + @RequestMapping(value = "rollbackList", method = RequestMethod.POST)
  131 + @ResponseBody
  132 + public String rollbackList(String project, String environment) {
  133 + try {
  134 + Map<String, String> map = new HashMap<>();
  135 + map.put("project", project);
  136 + map.put("environment", environment);
  137 + return httpRestClient.get(ProjectEnvironment.getUrl(environment) + "rollbackList", String.class, map);
  138 + } catch (Exception ex) {
  139 + return "failed";
  140 + }
  141 + }
  142 +
  143 +}
1 package com.ui.ctrl; 1 package com.ui.ctrl;
2 2
  3 +import com.ui.contants.HttpUriContants;
  4 +import com.ui.http.HttpRestClient;
  5 +import com.ui.model.BaseResponse;
3 import org.slf4j.Logger; 6 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory; 7 import org.slf4j.LoggerFactory;
5 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
@@ -7,11 +10,6 @@ import org.springframework.stereotype.Controller; @@ -7,11 +10,6 @@ import org.springframework.stereotype.Controller;
7 import org.springframework.web.bind.annotation.RequestMapping; 10 import org.springframework.web.bind.annotation.RequestMapping;
8 import org.springframework.web.bind.annotation.ResponseBody; 11 import org.springframework.web.bind.annotation.ResponseBody;
9 12
10 -import com.ui.contants.HttpUriContants;  
11 -import com.ui.http.HttpRestClient;  
12 -import com.ui.model.BaseResponse;  
13 -import com.ui.model.req.RedisReq;  
14 -  
15 13
16 @Controller 14 @Controller
17 @RequestMapping("redisInfo") 15 @RequestMapping("redisInfo")
@@ -24,9 +22,9 @@ public class RedisInfoCtrl { @@ -24,9 +22,9 @@ public class RedisInfoCtrl {
24 22
25 @RequestMapping("/getRedisInfo") 23 @RequestMapping("/getRedisInfo")
26 @ResponseBody 24 @ResponseBody
27 - public BaseResponse getRedisInfo(RedisReq req){  
28 - log.info("getRedisInfo with param is {} ",req);  
29 - BaseResponse response=httpRestClient.defaultPost(HttpUriContants.GET_REDIS_INFO, req, BaseResponse.class); 25 + public BaseResponse getRedisInfo(){
  26 + log.info("into getRedisInfo");
  27 + BaseResponse response=httpRestClient.defaultPost(HttpUriContants.GET_REDIS_INFO, null, BaseResponse.class);
30 return response; 28 return response;
31 } 29 }
32 30
1 -monitor.service.url=http://127.0.0.1:8880/monitor  
  1 +monitor.service.url=http://127.0.0.1:8080/monitor
@@ -31,15 +31,21 @@ @@ -31,15 +31,21 @@
31 <link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/> 31 <link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/>
32 <link rel="stylesheet" href="<%=basePath %>css/fullcalendar.css"/> 32 <link rel="stylesheet" href="<%=basePath %>css/fullcalendar.css"/>
33 <link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/> 33 <link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
34 - <link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css" class="skin-color"/> 34 + <link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
35 <link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/> 35 <link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>
36 <link rel="stylesheet" href="<%=basePath %>css/uniform.css"/> 36 <link rel="stylesheet" href="<%=basePath %>css/uniform.css"/>
37 <link rel="stylesheet" href="<%=basePath %>css/select2.css"/> 37 <link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
38 <link rel="stylesheet" href="<%=basePath %>js/jstree/themes/proton/style.css"/> 38 <link rel="stylesheet" href="<%=basePath %>js/jstree/themes/proton/style.css"/>
39 <link rel="stylesheet" href="<%=basePath %>css/select2.css"/> 39 <link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
40 <link rel="stylesheet" href="<%=basePath %>css/yoho.css"/> 40 <link rel="stylesheet" href="<%=basePath %>css/yoho.css"/>
  41 + <script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script>
41 <script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script> 42 <script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script>
  43 + <script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script>
42 <script src="<%=basePath %>/js/bootstrap.min.js"></script> 44 <script src="<%=basePath %>/js/bootstrap.min.js"></script>
  45 + <script src="<%=basePath %>/js/jquery.flot.min.js"></script>
  46 + <script src="<%=basePath %>/js/jquery.flot.resize.min.js"></script>
  47 + <script src="<%=basePath %>/js/unicorn.js"></script>
  48 + <script src="<%=basePath %>/js/unicorn.dashboard.js"></script>
43 <script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8" 49 <script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8"
44 type="text/javascript"></script> 50 type="text/javascript"></script>
45 <script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8" 51 <script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"
@@ -104,6 +110,31 @@ @@ -104,6 +110,31 @@
104 <li class="" id="ProjectRelease"><a href="?page_type=projectRelease"><i 110 <li class="" id="ProjectRelease"><a href="?page_type=projectRelease"><i
105 class="icon icon-th"></i><span>项目发布</span></a> 111 class="icon icon-th"></i><span>项目发布</span></a>
106 </li> 112 </li>
  113 + <li class="submenu">
  114 + <a href="#"><i class="icon icon-th-list"></i> <span>其他</span></a>
  115 + <ul>
  116 + <li class="">
  117 + <a href="#" id="rabbitmqMenu"><i class="icon icon-th-list"></i> <span>rabbitmq dashboard</span></a>
  118 + <ul style="display:none" id="rabbitmqUl">
  119 + <li><a href="http://rabbit-aws.yohops.com/" target="_blank">aws交易</a></li>
  120 + <li><a href="http://rabbit-aws-common.yohops.com/" target="_blank">aws通用</a></li>
  121 + <li><a href="http://rabbit-qq.yohops.com/" target="_blank">qq交易</a></li>
  122 + <li><a href="http://rabbit-qq-common.yohops.com/" target="_blank">qq通用</a></li>
  123 + </ul>
  124 + </li>
  125 + <li class="">
  126 + <a href="#" id="monitorMenu"><i class="icon icon-th-list"></i> <span>微服务监控</span></a>
  127 + <ul style="display:none" id="monitorUl">
  128 + <li><a href="http://aws-monitor.yohops.com/" target="_blank">aws</a></li>
  129 + <li><a href="http://aws-monitor.yohops.com/" target="_blank">Qcloud</a></li>
  130 + </ul>
  131 + </li>
  132 + <li><a href="http://g.yohops.com" target="_blank">grafana dashboard</a></li>
  133 + <li><a href="http://zk.yohops.com" target="_blank">zookeeper dashboard</a></li>
  134 + <li><a href="http://dev.yohops.com" target="_blank">开发运维信息查询</a></li>
  135 + <li><a href="http://kibana.yoho.cn/" target="_blank">kibana</a></li>
  136 + </ul>
  137 + </li>
107 </ul> 138 </ul>
108 </div> 139 </div>
109 <!-- 右侧具体内容 --> 140 <!-- 右侧具体内容 -->
@@ -124,7 +155,7 @@ @@ -124,7 +155,7 @@
124 "qcnginx": '/jsp/mobject/qcnginx.jsp', 155 "qcnginx": '/jsp/mobject/qcnginx.jsp',
125 "nginxview": '/jsp/mobject/nginxview.jsp', 156 "nginxview": '/jsp/mobject/nginxview.jsp',
126 "projectRelease": '/jsp/project/projectRelease.jsp', 157 "projectRelease": '/jsp/project/projectRelease.jsp',
127 - "rabbitInfo": '/jsp/mobject/rabbitmq.jsp' 158 + "rabbitInfo": '/jsp/mobject/rabbitmq.jsp',
128 }; 159 };
129 var page_type = "<%=page_type %>"; 160 var page_type = "<%=page_type %>";
130 var page_url = "<%=page_url %>"; 161 var page_url = "<%=page_url %>";
@@ -171,6 +202,26 @@ @@ -171,6 +202,26 @@
171 }] 202 }]
172 }); 203 });
173 } 204 }
  205 +
  206 + $("#rabbitmqMenu").click(function(){
  207 +
  208 + if($("#rabbitmqUl").css('display')=="none"){
  209 + $("#rabbitmqUl").css('display','block');
  210 + $("#rabbitmqUl li").css('background','#CFCFCF');
  211 + }else{
  212 + $("#rabbitmqUl").css('display','none');
  213 + }
  214 + });
  215 +
  216 +$("#monitorMenu").click(function(){
  217 +
  218 + if($("#monitorUl").css('display')=="none"){
  219 + $("#monitorUl").css('display','block');
  220 + $("#monitorUl li").css('background','#CFCFCF');
  221 + }else{
  222 + $("#monitorUl").css('display','none');
  223 + }
  224 + });
174 </script> 225 </script>
175 </body> 226 </body>
176 </html> 227 </html>
1 var dataString ='<chart charttopmargin="0" chartBottomMargin="0" chartleftmargin="0" chartrightmargin="0" bordercolor="#FFFFFF" border="0" borderAlpha="0" borderThickness="0" canvasBorderThickness="0" canvasBorderColor="#FFFFFF" showFormBtn="0">\n\ 1 var dataString ='<chart charttopmargin="0" chartBottomMargin="0" chartleftmargin="0" chartrightmargin="0" bordercolor="#FFFFFF" border="0" borderAlpha="0" borderThickness="0" canvasBorderThickness="0" canvasBorderColor="#FFFFFF" showFormBtn="0">\n\
2 <dataset plotborderAlpha="0" >\n\ 2 <dataset plotborderAlpha="0" >\n\
  3 +<set x="12" y="80" width="120" height="40" name="AWS" color="62D0FE" id="AWS" tooltext= "AWS" />\n\
3 <set x="8" y="70" width="120" height="40" name="172.31.19.49:6379" color="62D0FE" id="172.31.19.49:6379" />\n\ 4 <set x="8" y="70" width="120" height="40" name="172.31.19.49:6379" color="62D0FE" id="172.31.19.49:6379" />\n\
4 -<set x="16" y="70" width="120" height="40" name="172.31.24.61:6379" color="62D0FE" id="172.31.24.61:6379" />\n\  
5 <set x="4" y="55" width="55" height="40" name="172.31.19.49:16379" color="62D0FE" id="172.31.19.49:16379" />\n\ 5 <set x="4" y="55" width="55" height="40" name="172.31.19.49:16379" color="62D0FE" id="172.31.19.49:16379" />\n\
6 <set x="8" y="55" width="55" height="40" name="172.31.19.49:26379" color="62D0FE" id="172.31.19.49:26379" />\n\ 6 <set x="8" y="55" width="55" height="40" name="172.31.19.49:26379" color="62D0FE" id="172.31.19.49:26379" />\n\
  7 +<set x="16" y="70" width="120" height="40" name="172.31.24.61:6379" color="62D0FE" id="172.31.24.61:6379" />\n\
7 <set x="12" y="55" width="55" height="40" name="172.31.24.61:16379" color="62D0FE" id="172.31.24.61:16379" />\n\ 8 <set x="12" y="55" width="55" height="40" name="172.31.24.61:16379" color="62D0FE" id="172.31.24.61:16379" />\n\
8 <set x="16" y="55" width="55" height="40" name="172.31.24.61:26379" color="62D0FE" id="172.31.24.61:26379" />\n\ 9 <set x="16" y="55" width="55" height="40" name="172.31.24.61:26379" color="62D0FE" id="172.31.24.61:26379" />\n\
9 -<set x="12" y="80" width="120" height="40" name="AWS" color="62D0FE" id="AWS" tooltext= "AWS" />\n\  
10 <set x="30" y="70" width="120" height="40" name="10.66.4.2:6379" id="10.66.4.2:6379" color="62D0FE"/>\n\ 10 <set x="30" y="70" width="120" height="40" name="10.66.4.2:6379" id="10.66.4.2:6379" color="62D0FE"/>\n\
11 <set x="20" y="55" width="55" height="40" name="10.66.4.2:16379" color="62D0FE" id="10.66.4.2:16379" />\n\ 11 <set x="20" y="55" width="55" height="40" name="10.66.4.2:16379" color="62D0FE" id="10.66.4.2:16379" />\n\
12 <set x="24" y="55" width="55" height="40" name="10.66.4.2:26379" color="62D0FE" id="10.66.4.2:26379" />\n\ 12 <set x="24" y="55" width="55" height="40" name="10.66.4.2:26379" color="62D0FE" id="10.66.4.2:26379" />\n\
@@ -55,13 +55,13 @@ @@ -55,13 +55,13 @@
55 var initDashBoard = function (data) { 55 var initDashBoard = function (data) {
56 var div_dash = $(".api_info_container"); 56 var div_dash = $(".api_info_container");
57 $.each(data, function (idx, val) { 57 $.each(data, function (idx, val) {
58 - var api_info_item = $('<div class="api_info_item col-xs-4 ">'); 58 + var api_info_item = $('<div class="api_info_item col-xs-3 ">');
59 var api_info_item_panel = $(' <div class="panel panel-default">'); 59 var api_info_item_panel = $(' <div class="panel panel-default">');
60 var api_info_item_panel_title = $('<div class="item_java_api_title panel-heading">' + val.typeName + '<span style="font-size: medium;float: right;padding-top: 15px"><span id="span_time_' + val.typeId + '"></span></span></div>'); 60 var api_info_item_panel_title = $('<div class="item_java_api_title panel-heading">' + val.typeName + '<span style="font-size: medium;float: right;padding-top: 15px"><span id="span_time_' + val.typeId + '"></span></span></div>');
61 var api_info_item_panel_body = $('<div class="panel-body">'); 61 var api_info_item_panel_body = $('<div class="panel-body">');
62 api_info_item_panel_body.append('<button class="btn_java_api btn btn-lg btn-default" id="btn_1_' + val.typeId + '">AWS &nbsp;<span class="badge"></span></button>'); 62 api_info_item_panel_body.append('<button class="btn_java_api btn btn-lg btn-default" id="btn_1_' + val.typeId + '">AWS &nbsp;<span class="badge"></span></button>');
63 api_info_item_panel_body.append('<button class="btn_java_api btn btn-lg btn-default" id="btn_2_' + val.typeId + '">QCloud &nbsp;<span class="badge"></span></button>'); 63 api_info_item_panel_body.append('<button class="btn_java_api btn btn-lg btn-default" id="btn_2_' + val.typeId + '">QCloud &nbsp;<span class="badge"></span></button>');
64 - api_info_item_panel_body.append('<button class="btn_java_api btn btn-lg btn-default" id="btn_3_' + val.typeId + '">其他 &nbsp;<span class="badge"></span></button>'); 64 +// api_info_item_panel_body.append('<button class="btn_java_api btn btn-lg btn-default" id="btn_3_' + val.typeId + '">其他 &nbsp;<span class="badge"></span></button>');
65 // api_info_item_panel_body.append('<h5 >更新时间:<span id="span_time_'+val.typeId+'"></span></h5>'); 65 // api_info_item_panel_body.append('<h5 >更新时间:<span id="span_time_'+val.typeId+'"></span></h5>');
66 api_info_item_panel.append(api_info_item_panel_title) 66 api_info_item_panel.append(api_info_item_panel_title)
67 .append(api_info_item_panel_body); 67 .append(api_info_item_panel_body);
@@ -112,6 +112,8 @@ @@ -112,6 +112,8 @@
112 112
113 $.each(data.data, function (idx, val) { 113 $.each(data.data, function (idx, val) {
114 console.log($("#btn_" + val.cloudType + "_" + val.serviceType)); 114 console.log($("#btn_" + val.cloudType + "_" + val.serviceType));
  115 + if(val.cloudType!=1&&val.cloudType!=2)//目前只有腾讯aws
  116 + return;
115 var btn = $("#btn_" + val.cloudType + "_" + val.serviceType); 117 var btn = $("#btn_" + val.cloudType + "_" + val.serviceType);
116 if (val.updateTime != undefined && val.updateTime != "") { 118 if (val.updateTime != undefined && val.updateTime != "") {
117 119
@@ -149,12 +149,12 @@ @@ -149,12 +149,12 @@
149 $.each(apps, function (idx, val) { 149 $.each(apps, function (idx, val) {
150 var span; 150 var span;
151 if (toggle == 1) { 151 if (toggle == 1) {
152 - span = $("<button class='btn btn-success btn-xs tag_javaapp has-popover' >").attr("id", "span_" + serviceId + "_" + val.moId).html(val.moHostIp); 152 + span = $("<button class='btn btn-default btn-xs tag_javaapp has-popover' >").attr("id", "span_" + serviceId + "_" + val.moId).html(val.moHostIp);
153 span.attr("data-toggle", "popover"); 153 span.attr("data-toggle", "popover");
154 span.attr("data-placement", "bottom"); 154 span.attr("data-placement", "bottom");
155 span.attr("data-html", "true"); 155 span.attr("data-html", "true");
156 // span.attr("title", "message"); 156 // span.attr("title", "message");
157 - // span.attr("data-content", "message"); 157 + span.attr("data-content", "unkown");
158 } else { 158 } else {
159 span = $("<button class='btn btn-inverse btn-xs tag_javaapp' >").attr("id", "span_no_" + serviceId + "_" + val.moId).html(val.moHostIp); 159 span = $("<button class='btn btn-inverse btn-xs tag_javaapp' >").attr("id", "span_no_" + serviceId + "_" + val.moId).html(val.moHostIp);
160 } 160 }
@@ -173,16 +173,16 @@ @@ -173,16 +173,16 @@
173 var content = "start: " + statusObj.startTime + " "; 173 var content = "start: " + statusObj.startTime + " ";
174 content += "end: " + statusObj.endTime + " "; 174 content += "end: " + statusObj.endTime + " ";
175 content += "cost: " + statusObj.costTime + "ms<br>"; 175 content += "cost: " + statusObj.costTime + "ms<br>";
176 - 176 + $("#" + id).removeClass('btn-default');
177 if (statusObj.status == 0) { 177 if (statusObj.status == 0) {
178 content += "exception: " + statusObj.exception; 178 content += "exception: " + statusObj.exception;
179 - if ($("#" + id).hasClass('btn-success')) { 179 + if (!$("#" + id).hasClass('btn-danger')) {
180 $("#" + id).removeClass('btn-success'); 180 $("#" + id).removeClass('btn-success');
181 $("#" + id).addClass('btn-danger'); 181 $("#" + id).addClass('btn-danger');
182 } 182 }
183 } 183 }
184 else { 184 else {
185 - if ($("#" + id).hasClass('btn-danger')) { 185 + if (!$("#" + id).hasClass('btn-success')) {
186 $("#" + id).removeClass('btn-danger'); 186 $("#" + id).removeClass('btn-danger');
187 $("#" + id).addClass('btn-success'); 187 $("#" + id).addClass('btn-success');
188 } 188 }
@@ -10,8 +10,8 @@ @@ -10,8 +10,8 @@
10 <div class="widget-title"> 10 <div class="widget-title">
11 <h5>项目发布</h5> 11 <h5>项目发布</h5>
12 </div> 12 </div>
13 - <iframe src="http://ops-deploy.yohoops.org/web/projectbuild" id="iframepage" frameborder="0" scrolling="yes" width="100%" height="800px"></iframe> 13 + <iframe src="http://123.206.79.151/web/projectbuild" id="iframepage" frameborder="0" scrolling="yes" width="100%" height="800px"></iframe>
14 </div> 14 </div>
15 15
16 </div> 16 </div>
17 -  
  17 +
@@ -24,12 +24,11 @@ @@ -24,12 +24,11 @@
24 <div id="chartdiv" align="center" style="width:800px;"> 24 <div id="chartdiv" align="center" style="width:800px;">
25 FusionCharts. 25 FusionCharts.
26 </div> 26 </div>
27 -  
28 - <script type="text/javascript">  
29 - var chart = new FusionCharts("<%=basePath %>/js/charts/DragNode.swf", "ChartId", "1650", "650", "0");  
30 - chart.setXMLData(dataString );  
31 - chart.render("chartdiv");  
32 - </script>  
33 </div> 27 </div>
34 </div> 28 </div>
35 </div> 29 </div>
  30 +<script type="text/javascript">
  31 + var chart = new FusionCharts("<%=basePath %>/js/charts/DragNode.swf", "ChartId", "1650", "650", "0");
  32 + chart.setXMLData(dataString );
  33 + chart.render("chartdiv");
  34 +</script>
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 <div class="row api_info_container"> 15 <div class="row api_info_container">
16 <div class="api_info_item col-xs-10 "> 16 <div class="api_info_item col-xs-10 ">
17 <div class="panel panel-default"> 17 <div class="panel panel-default">
18 - <div class="item_java_api_title panel-heading" style="text-align: center">AWS-Zookeeper集群(最近更新时间:<span id="zkAwsTime">15分钟以前</span>)</div> 18 + <div class="item_java_api_title panel-heading" style="text-align: center">AWS-Zookeeper集群(最近更新时间:<span id="zkAwsTime">2分钟以前</span>)</div>
19 <div class="panel-body" style="height: 180px; padding-top: 60px;text-align: center;" id="zkAwsDiv"> 19 <div class="panel-body" style="height: 180px; padding-top: 60px;text-align: center;" id="zkAwsDiv">
20 20
21 </div> 21 </div>
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 </div> 23 </div>
24 <div class="api_info_item col-xs-10 "> 24 <div class="api_info_item col-xs-10 ">
25 <div class="panel panel-default"> 25 <div class="panel panel-default">
26 - <div class="item_java_api_title panel-heading" style="text-align: center">QCloud-Zookeeper集群(最近更新时间:<span id="zkQCloudTime">15分钟以前</span>)</div> 26 + <div class="item_java_api_title panel-heading" style="text-align: center">QCloud-Zookeeper集群(最近更新时间:<span id="zkQCloudTime">2分钟以前</span>)</div>
27 <div class="panel-body" style="height: 180px; padding-top: 80px;text-align: center;" id="zkQCloudDiv"> 27 <div class="panel-body" style="height: 180px; padding-top: 80px;text-align: center;" id="zkQCloudDiv">
28 28
29 </div> 29 </div>