Authored by qinchao

nginx切换调整

@@ -7,10 +7,13 @@ import java.util.Map; @@ -7,10 +7,13 @@ import java.util.Map;
7 import java.util.stream.Collectors; 7 import java.util.stream.Collectors;
8 8
9 public class ProjectOnline { 9 public class ProjectOnline {
10 - private final static String JAVA_ENV_QCLOUD="qcloud,qcloud_gray"; 10 + private final static String JAVA_ENV_QCLOUD_AZ1="qcloud";
11 private final static String JAVA_ENV_QCLOUD_AZ2="qcloudaz2"; 11 private final static String JAVA_ENV_QCLOUD_AZ2="qcloudaz2";
12 private final static String JAVA_ENV_QCLOUD_AZ3="qcloudaz3"; 12 private final static String JAVA_ENV_QCLOUD_AZ3="qcloudaz3";
13 - public final static String JAVA_ENV_ALL=JAVA_ENV_QCLOUD+","+JAVA_ENV_QCLOUD_AZ2+","+JAVA_ENV_QCLOUD_AZ3; 13 + public final static String JAVA_ENV_ALL=JAVA_ENV_QCLOUD_AZ1+","+JAVA_ENV_QCLOUD_AZ2+","+JAVA_ENV_QCLOUD_AZ3;
  14 +
  15 + ///// 暂时只有media有
  16 + private final static String JAVA_ENV_QCLOUD_ENV_GRAY="qcloud_gray";
14 17
15 private static List<Project> JAVA_LIST = new ArrayList<>(); 18 private static List<Project> JAVA_LIST = new ArrayList<>();
16 private static Map<String,Project> JAVA_MAP = new HashMap<>(); 19 private static Map<String,Project> JAVA_MAP = new HashMap<>();
@@ -34,21 +37,21 @@ public class ProjectOnline { @@ -34,21 +37,21 @@ public class ProjectOnline {
34 JAVA_LIST.add(new Project("1","yohobuy-risk","932","yoho30",JAVA_ENV_ALL,"java 核心服务")); 37 JAVA_LIST.add(new Project("1","yohobuy-risk","932","yoho30",JAVA_ENV_ALL,"java 核心服务"));
35 38
36 //只有qcloud : java服务-单中心 39 //只有qcloud : java服务-单中心
37 - JAVA_LIST.add(new Project("1","yoho-push","137","yoho30","qcloud","java服务-单中心"));  
38 - JAVA_LIST.add(new Project("1","cms_push","514","yoho30","qcloud","java服务-单中心"));  
39 - JAVA_LIST.add(new Project("1","yoho-social","353","yoho30","qcloud,qcloud_gray","java服务-单中心"));  
40 - JAVA_LIST.add(new Project("1","yohobuy-union","133","yoho30","qcloud","java服务-单中心"));  
41 - JAVA_LIST.add(new Project("1","yohobuy-crm","275","yoho30","qcloud","java服务-单中心"));  
42 - JAVA_LIST.add(new Project("1","yohobuy-task","138","yoho30","qcloud","java服务-单中心"));  
43 - JAVA_LIST.add(new Project("1","yoho-message-controller","684","yoho30","qcloud","java服务-单中心"));  
44 - JAVA_LIST.add(new Project("1","yoho-message-sender","685","yoho30","qcloud","java服务-单中心")); 40 + JAVA_LIST.add(new Project("1","yoho-push","137","yoho30",JAVA_ENV_QCLOUD_AZ1,"java服务-单中心"));
  41 + JAVA_LIST.add(new Project("1","cms_push","514","yoho30",JAVA_ENV_QCLOUD_AZ1,"java服务-单中心"));
  42 + JAVA_LIST.add(new Project("1","yoho-social","353","yoho30",JAVA_ENV_QCLOUD_AZ1,"java服务-单中心"));
  43 + JAVA_LIST.add(new Project("1","yohobuy-union","133","yoho30",JAVA_ENV_QCLOUD_AZ1,"java服务-单中心"));
  44 + JAVA_LIST.add(new Project("1","yohobuy-crm","275","yoho30",JAVA_ENV_QCLOUD_AZ1,"java服务-单中心"));
  45 + JAVA_LIST.add(new Project("1","yohobuy-task","138","yoho30",JAVA_ENV_QCLOUD_AZ1,"java服务-单中心"));
  46 + JAVA_LIST.add(new Project("1","yoho-message-controller","684","yoho30",JAVA_ENV_QCLOUD_AZ1,"java服务-单中心"));
  47 + JAVA_LIST.add(new Project("1","yoho-message-sender","685","yoho30",JAVA_ENV_QCLOUD_AZ1,"java服务-单中心"));
45 48
46 49
47 - //只有qcloud_gray: 媒体java (灰度)  
48 - JAVA_LIST.add(new Project("1", "yoho-now", "690", "YOHONow","qcloud_gray","媒体java (灰度)"));  
49 - JAVA_LIST.add(new Project("1","yoho-mars","737","media","qcloud_gray","媒体java (灰度)"));  
50 - JAVA_LIST.add(new Project("1","yohomars-platform","764","media","qcloud_gray","媒体java (灰度)"));  
51 - JAVA_LIST.add(new Project("1","yohonow-platform","775","media","qcloud_gray","媒体java (灰度)")); 50 + //只有灰度环境: 媒体java (灰度)
  51 + JAVA_LIST.add(new Project("1", "yoho-now", "690", "YOHONow",JAVA_ENV_QCLOUD_ENV_GRAY,"媒体java (灰度)"));
  52 + JAVA_LIST.add(new Project("1","yoho-mars","737","media",JAVA_ENV_QCLOUD_ENV_GRAY,"媒体java (灰度)"));
  53 + JAVA_LIST.add(new Project("1","yohomars-platform","764","media",JAVA_ENV_QCLOUD_ENV_GRAY,"媒体java (灰度)"));
  54 + JAVA_LIST.add(new Project("1","yohonow-platform","775","media",JAVA_ENV_QCLOUD_ENV_GRAY,"媒体java (灰度)"));
52 55
53 56
54 //JAVA_LIST.add(new Project("1","yoho-cobar","461","yoho30")); 57 //JAVA_LIST.add(new Project("1","yoho-cobar","461","yoho30"));
@@ -57,20 +60,20 @@ public class ProjectOnline { @@ -57,20 +60,20 @@ public class ProjectOnline {
57 //JAVA_LIST.add(new Project("1","yoho-union-recomand","789","yoho30")); 60 //JAVA_LIST.add(new Project("1","yoho-union-recomand","789","yoho30"));
58 61
59 //只有qcloud、 qcloud灰度。 线下店java服务 62 //只有qcloud、 qcloud灰度。 线下店java服务
60 - JAVA_LIST.add(new Project("1","yohobuy-shops","490","yoho30",JAVA_ENV_QCLOUD,"线下店java服务"));  
61 - JAVA_LIST.add(new Project("1","yohobuy-portal-gateway","557","yoho30",JAVA_ENV_QCLOUD,"线下店java服务"));  
62 - JAVA_LIST.add(new Project("1","yohobuy-extendstore","852","yoho30",JAVA_ENV_QCLOUD,"线下店java服务")); 63 + JAVA_LIST.add(new Project("1","yohobuy-shops","490","yoho30",JAVA_ENV_QCLOUD_AZ1+","+JAVA_ENV_QCLOUD_ENV_GRAY,"线下店java服务"));
  64 + JAVA_LIST.add(new Project("1","yohobuy-portal-gateway","557","yoho30",JAVA_ENV_QCLOUD_AZ1+","+JAVA_ENV_QCLOUD_ENV_GRAY,"线下店java服务"));
  65 + JAVA_LIST.add(new Project("1","yohobuy-extendstore","852","yoho30",JAVA_ENV_QCLOUD_AZ1+","+JAVA_ENV_QCLOUD_ENV_GRAY,"线下店java服务"));
63 66
64 67
65 68
66 - JAVA_LIST.add(new Project("2","yoho-search-service","12","yoho-search","qcloud,"+JAVA_ENV_QCLOUD_AZ2,""));  
67 - JAVA_LIST.add(new Project("2","yoho-search-consumer","8","yoho-search","qcloud,"+JAVA_ENV_QCLOUD_AZ2,""));  
68 - JAVA_LIST.add(new Project("2","yoho-search-producer","7","yoho-search","qcloud,"+JAVA_ENV_QCLOUD_AZ2,""));  
69 - JAVA_LIST.add(new Project("2","yoho-search-adaptor","13","yoho-search","qcloud,"+JAVA_ENV_QCLOUD_AZ2,""));  
70 - JAVA_LIST.add(new Project("2","yohomars-search-service","554","yoho-search",JAVA_ENV_QCLOUD,"")); 69 + JAVA_LIST.add(new Project("2","yoho-search-service","12","yoho-search",JAVA_ENV_QCLOUD_AZ1+","+JAVA_ENV_QCLOUD_AZ2,""));
  70 + JAVA_LIST.add(new Project("2","yoho-search-consumer","8","yoho-search",JAVA_ENV_QCLOUD_AZ1+","+JAVA_ENV_QCLOUD_AZ2,""));
  71 + JAVA_LIST.add(new Project("2","yoho-search-producer","7","yoho-search",JAVA_ENV_QCLOUD_AZ1+","+JAVA_ENV_QCLOUD_AZ2,""));
  72 + JAVA_LIST.add(new Project("2","yoho-search-adaptor","13","yoho-search",JAVA_ENV_QCLOUD_AZ1+","+JAVA_ENV_QCLOUD_AZ2,""));
  73 + JAVA_LIST.add(new Project("2","yohomars-search-service","554","yoho-search",JAVA_ENV_QCLOUD_AZ1,""));
71 74
72 75
73 - JAVA_LIST.add(new Project("3","yohobuy-platform","110","platform",JAVA_ENV_QCLOUD,"")); 76 + JAVA_LIST.add(new Project("3","yohobuy-platform","110","platform",JAVA_ENV_QCLOUD_AZ1,""));
74 77
75 //把list转成map,放到最后 78 //把list转成map,放到最后
76 JAVA_MAP=JAVA_LIST.stream().collect(Collectors.toMap(Project::getName,Project->Project)); 79 JAVA_MAP=JAVA_LIST.stream().collect(Collectors.toMap(Project::getName,Project->Project));
@@ -81,7 +81,14 @@ @@ -81,7 +81,14 @@
81 onclick="changeservers()" 81 onclick="changeservers()"
82 checked="checked" 82 checked="checked"
83 /> 83 />
84 - <label for="${envi }">${envi }</label> 84 + <c:choose>
  85 + <c:when test="${fn:indexOf(envi,'az3')>=0 }">
  86 + <label for="${envi }">${envi }(灰度)</label>
  87 + </c:when>
  88 + <c:otherwise>
  89 + <label for="${envi }">${envi }</label>
  90 + </c:otherwise>
  91 + </c:choose>
85 </div> 92 </div>
86 </c:forEach> 93 </c:forEach>
87 </c:if> 94 </c:if>
@@ -434,7 +434,7 @@ @@ -434,7 +434,7 @@
434 env_HTML += "</br>"; 434 env_HTML += "</br>";
435 } 435 }
436 var show_label=env; 436 var show_label=env;
437 - if(env=='az2'){ 437 + if(env!=null&&env.indexOf('az3')>=0){
438 show_label=env+'(灰度)'; 438 show_label=env+'(灰度)';
439 } 439 }
440 env_HTML += "<div class='ckbox ckbox-primary' style='display: inline'>"; 440 env_HTML += "<div class='ckbox ckbox-primary' style='display: inline'>";
@@ -7,6 +7,16 @@ $(document).ready(function () { @@ -7,6 +7,16 @@ $(document).ready(function () {
7 * @param resp 7 * @param resp
8 */ 8 */
9 function drawData(resp) { 9 function drawData(resp) {
  10 + if(resp==null){
  11 + layer.msg("获取数据异常", {icon: 2});
  12 + return;
  13 + }
  14 +
  15 + if(200!=resp.code){
  16 + console.log(resp);
  17 + layer.msg("获取数据错误"+resp.message, {icon: 20});
  18 + return ;
  19 + }
10 var data = resp.data; 20 var data = resp.data;
11 21
12 var canvas = document.getElementById('canvas'); 22 var canvas = document.getElementById('canvas');