Authored by qinchao

docker类型重新分类

package com.ui.project;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.*;
public class ProjectEnvironment {
private static String[] dockerEnvironments = {"yoho-online","yoho-gray"};
private static String[] dockerProjectTypes = {"node","java","php","ops","other"};
//private static String[] dockerProjectTypes = {"node","java","php","ops","other"};
private static Map<String,String> map = new HashMap<>();
private static Map<String,String> dockerProjectTypeMap=new LinkedHashMap<>();
static{
map.put("aws", "http://172.31.16.167:8883/web/");
map.put("qcloud","http://172.31.16.167:8883/web/");
map.put("qcloud_gray","http://172.31.16.167:8883/web/");
map.put("aws_gray","http://172.31.16.167:8883/web/");
dockerProjectTypeMap.put("web","web");
dockerProjectTypeMap.put("media","media");
dockerProjectTypeMap.put("ci","核心系统ci");
dockerProjectTypeMap.put("ops","ops");
}
public static Set<String> getEnviroments(){
... ... @@ -35,8 +38,8 @@ public class ProjectEnvironment {
return dockerEnvironments;
}
public static String[] getDockerProjectTypes(){
return dockerProjectTypes;
public static Map<String,String> getDockerProjectTypeMap(){
return dockerProjectTypeMap;
}
}
... ...
... ... @@ -40,7 +40,7 @@ public class DockerBuildCtrl {
}
model.addAttribute("environments", ProjectEnvironment.getDockerEnvironments());
model.addAttribute("projectTypes", ProjectEnvironment.getDockerProjectTypes());
model.addAttribute("projectTypes", ProjectEnvironment.getDockerProjectTypeMap());
return new ModelAndView("project/docker_project");
}
... ... @@ -199,7 +199,7 @@ public class DockerBuildCtrl {
@RequestMapping(value = "/toDockerInfoList")
public ModelAndView toDockerInfoList(Model model,DockerJenkinsReq dockerJenkinsReq) {
model.addAttribute("projectTypes", ProjectEnvironment.getDockerProjectTypes());
model.addAttribute("projectTypes", ProjectEnvironment.getDockerProjectTypeMap());
model.addAttribute("projectJobTypes", httpRestClient.defaultGet("/dockerProject/getDockerProjectJobType",BaseResponse.class).getData());
return new ModelAndView("project/docker_info");
}
... ... @@ -220,7 +220,7 @@ public class DockerBuildCtrl {
@RequestMapping("/toEditDockerInfo")
public ModelAndView toEditDockerInfos(Model model) {
model.addAttribute("projectTypes", ProjectEnvironment.getDockerProjectTypes());
model.addAttribute("projectTypes", ProjectEnvironment.getDockerProjectTypeMap());
model.addAttribute("projectJobTypes", httpRestClient.defaultGet("/dockerProject/getDockerProjectJobType",BaseResponse.class).getData());
return new ModelAndView("project/editDockerInfo");
}
... ...
... ... @@ -101,7 +101,7 @@
<select id="projectType_search" class="form-control">
<option value="" selected="selected">所有类型</option>
<c:forEach items="${projectTypes }" var="projType" >
<option value="${projType }">${projType }</option>
<option value="${projType.key }">${projType.value }</option>
</c:forEach>
</select>
</div>
... ... @@ -164,14 +164,14 @@
formatter : function(value, rowData, rowIndex) {
return rowIndex + 1;
}
},{
}/*,{
title : "项目类型",
field : "projectType",
width : "10%"
},{
}*/,{
title : "项目名称",
field : "projectName",
width : "10%"
width : "15%"
}, {
title : "项目git所属组",
field : "projectGitGroup",
... ... @@ -183,7 +183,7 @@
}, {
title : "docker项目名称",
field : "dockerProjectName",
width : "10%"
width : "15%"
},{
title : "自动发布",
field : "autodeployflag",
... ... @@ -195,12 +195,12 @@
return "否";
}
}
},{
}/*,{
title : "灰度集群",
field : "dockerGrayClusterId",
width : "10%",
},{
}*/,{
title : "线上集群",
field : "dockerOnlineClusterId",
width : "10%",
... ...
... ... @@ -83,11 +83,11 @@
<div class="col-sm-8">
<c:forEach items="${projectTypes }" var="projType" varStatus="projTypeStatus">
<div class="rdio rdio-default" style='display: inline'>
<input type="radio" name="projectTypes" id="${projType }" value="${projType }"
<input type="radio" name="projectTypes" id="${projType.key }" value="${projType.key }"
onclick="getProjects()"
<c:if test="${projTypeStatus.index==0}">checked="checked"</c:if>
/>
<label for="${projType }">${projType }</label>&nbsp;&nbsp;&nbsp;
<label for="${projType.key }">${projType.value }</label>&nbsp;&nbsp;&nbsp;
</div>
</c:forEach>
</div>
... ...
... ... @@ -15,7 +15,7 @@
<div class="col-sm-8">
<select id="projectType" name="projectType" class="form-control" style = "width:450px;" >
<c:forEach items="${projectTypes }" var="projType" >
<option value="${projType }">${projType }</option>
<option value="${projType.key }">${projType.value }</option>
</c:forEach>
</select>
</div>
... ...