Authored by mlge

java发布项目分类

... ... @@ -20,6 +20,8 @@ public class Project {
//项目支持的发布环境,add by craig.qin 2018/4/9
private List<String> supportEnvList=new ArrayList<>();
private String groupType;//类型--方便前端分类展示
public Project(){
}
... ... @@ -32,12 +34,13 @@ public class Project {
this.supportEnvList.addAll(ProjectOnline.getJavaEnvListALL());
}*/
public Project(String order, String name, String projectid, String group,String supportEnv){
public Project(String order, String name, String projectid, String group,String supportEnv, String groupType){
this.order = order;
this.name = name;
this.projectid = projectid;
this.group = group;
this.supportEnvList.addAll(Arrays.asList(supportEnv.split(",")));
this.groupType = groupType;
}
public Project(String order, String name, String projectid, String group,List<String> supportEnvs){
... ... @@ -84,4 +87,12 @@ public class Project {
public List<String> getSupportEnvList() {
return supportEnvList;
}
public String getGroupType() {
return groupType;
}
public void setGroupType(String groupType) {
this.groupType = groupType;
}
}
... ...
... ... @@ -22,37 +22,37 @@ public class ProjectOnline {
static{
// java 核心服务
JAVA_LIST.add(new Project("1","yohobuy-activity","129","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yohobuy-wechat","248","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yoho-sns","125","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yoho-erp-gateway","977","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yoho-message","123","yoho30","aws,qcloud,qcloud_gray,"+JAVA_ENV_QCLOUD_AZ2));
JAVA_LIST.add(new Project("1","uic","439","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yoho-users","134","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yohobuy-resources","122","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yohobuy-promotion","140","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yohobuy-product","143","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yohobuy-order","124","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yohobuy-brower","131","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yohobuy-bigdata","144","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yoho-gateway","126","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yohobuy-risk","932","yoho30",JAVA_ENV_ALL));
JAVA_LIST.add(new Project("1","yohobuy-activity","129","yoho30",JAVA_ENV_ALL, "java 核心服务"));
JAVA_LIST.add(new Project("1","yohobuy-wechat","248","yoho30",JAVA_ENV_ALL, "java 核心服务"));
JAVA_LIST.add(new Project("1","yoho-sns","125","yoho30",JAVA_ENV_ALL,"java 核心服务"));
JAVA_LIST.add(new Project("1","yoho-erp-gateway","977","yoho30",JAVA_ENV_ALL,"java 核心服务"));
JAVA_LIST.add(new Project("1","yoho-message","123","yoho30","aws,qcloud,qcloud_gray,"+JAVA_ENV_QCLOUD_AZ2,"java 核心服务"));
JAVA_LIST.add(new Project("1","uic","439","yoho30",JAVA_ENV_ALL,"java 核心服务"));
JAVA_LIST.add(new Project("1","yoho-users","134","yoho30",JAVA_ENV_ALL,"java 核心服务"));
JAVA_LIST.add(new Project("1","yohobuy-resources","122","yoho30",JAVA_ENV_ALL,"java 核心服务"));
JAVA_LIST.add(new Project("1","yohobuy-promotion","140","yoho30",JAVA_ENV_ALL,"java 核心服务"));
JAVA_LIST.add(new Project("1","yohobuy-product","143","yoho30",JAVA_ENV_ALL,"java 核心服务"));
JAVA_LIST.add(new Project("1","yohobuy-order","124","yoho30",JAVA_ENV_ALL,"java 核心服务"));
JAVA_LIST.add(new Project("1","yohobuy-brower","131","yoho30",JAVA_ENV_ALL,"java 核心服务"));
JAVA_LIST.add(new Project("1","yohobuy-bigdata","144","yoho30",JAVA_ENV_ALL,"java 核心服务"));
JAVA_LIST.add(new Project("1","yoho-gateway","126","yoho30",JAVA_ENV_ALL,"java 核心服务"));
JAVA_LIST.add(new Project("1","yohobuy-risk","932","yoho30",JAVA_ENV_ALL,"java 核心服务"));
//只有qcloud_gray: 媒体java (灰度)
JAVA_LIST.add(new Project("1", "yoho-now", "690", "YOHONow","qcloud_gray"));
JAVA_LIST.add(new Project("1","yoho-mars","737","media","qcloud_gray"));
JAVA_LIST.add(new Project("1","yohomars-platform","764","media","qcloud_gray"));
JAVA_LIST.add(new Project("1","yohonow-platform","775","media","qcloud_gray"));
JAVA_LIST.add(new Project("1", "yoho-now", "690", "YOHONow","qcloud_gray","媒体java (灰度)"));
JAVA_LIST.add(new Project("1","yoho-mars","737","media","qcloud_gray","媒体java (灰度)"));
JAVA_LIST.add(new Project("1","yohomars-platform","764","media","qcloud_gray","媒体java (灰度)"));
JAVA_LIST.add(new Project("1","yohonow-platform","775","media","qcloud_gray","媒体java (灰度)"));
//只有qcloud : java服务-单中心
JAVA_LIST.add(new Project("1","yoho-push","137","yoho30","qcloud"));
JAVA_LIST.add(new Project("1","cms_push","514","yoho30","qcloud"));
JAVA_LIST.add(new Project("1","yoho-social","353","yoho30","qcloud"));
JAVA_LIST.add(new Project("1","yohobuy-union","133","yoho30","qcloud"));
JAVA_LIST.add(new Project("1","yohobuy-crm","275","yoho30","qcloud"));
JAVA_LIST.add(new Project("1","yohobuy-task","138","yoho30","qcloud"));
JAVA_LIST.add(new Project("1","yoho-message-controller","684","yoho30","qcloud"));
JAVA_LIST.add(new Project("1","yoho-message-sender","685","yoho30","qcloud"));
JAVA_LIST.add(new Project("1","yoho-push","137","yoho30","qcloud","java服务-单中心"));
JAVA_LIST.add(new Project("1","cms_push","514","yoho30","qcloud","java服务-单中心"));
JAVA_LIST.add(new Project("1","yoho-social","353","yoho30","qcloud","java服务-单中心"));
JAVA_LIST.add(new Project("1","yohobuy-union","133","yoho30","qcloud","java服务-单中心"));
JAVA_LIST.add(new Project("1","yohobuy-crm","275","yoho30","qcloud","java服务-单中心"));
JAVA_LIST.add(new Project("1","yohobuy-task","138","yoho30","qcloud","java服务-单中心"));
JAVA_LIST.add(new Project("1","yoho-message-controller","684","yoho30","qcloud","java服务-单中心"));
JAVA_LIST.add(new Project("1","yoho-message-sender","685","yoho30","qcloud","java服务-单中心"));
//JAVA_LIST.add(new Project("1","yoho-cobar","461","yoho30"));
... ... @@ -61,19 +61,19 @@ public class ProjectOnline {
//JAVA_LIST.add(new Project("1","yoho-union-recomand","789","yoho30"));
//只有qcloud、 qcloud灰度。 线下店java服务
JAVA_LIST.add(new Project("1","yohobuy-shops","490","yoho30",JAVA_ENV_QCLOUD));
JAVA_LIST.add(new Project("1","yohobuy-portal-gateway","557","yoho30",JAVA_ENV_QCLOUD));
JAVA_LIST.add(new Project("1","yohobuy-extendstore","852","yoho30",JAVA_ENV_QCLOUD));
JAVA_LIST.add(new Project("1","yohobuy-shops","490","yoho30",JAVA_ENV_QCLOUD,"线下店java服务"));
JAVA_LIST.add(new Project("1","yohobuy-portal-gateway","557","yoho30",JAVA_ENV_QCLOUD,"线下店java服务"));
JAVA_LIST.add(new Project("1","yohobuy-extendstore","852","yoho30",JAVA_ENV_QCLOUD,"线下店java服务"));
JAVA_LIST.add(new Project("2","yoho-search-service","12","yoho-search","aws,qcloud,"+JAVA_ENV_QCLOUD_AZ2));
JAVA_LIST.add(new Project("2","yoho-search-consumer","8","yoho-search","aws,qcloud,"+JAVA_ENV_QCLOUD_AZ2));
JAVA_LIST.add(new Project("2","yoho-search-producer","7","yoho-search","aws,qcloud,"+JAVA_ENV_QCLOUD_AZ2));
JAVA_LIST.add(new Project("2","yohomars-search-service","554","yoho-search",JAVA_ENV_QCLOUD_AWS));
JAVA_LIST.add(new Project("2","yoho-search-adaptor","13","yoho-search","aws,qcloud"));
JAVA_LIST.add(new Project("2","yoho-search-service","12","yoho-search","aws,qcloud,"+JAVA_ENV_QCLOUD_AZ2,""));
JAVA_LIST.add(new Project("2","yoho-search-consumer","8","yoho-search","aws,qcloud,"+JAVA_ENV_QCLOUD_AZ2,""));
JAVA_LIST.add(new Project("2","yoho-search-producer","7","yoho-search","aws,qcloud,"+JAVA_ENV_QCLOUD_AZ2,""));
JAVA_LIST.add(new Project("2","yohomars-search-service","554","yoho-search",JAVA_ENV_QCLOUD_AWS,""));
JAVA_LIST.add(new Project("2","yoho-search-adaptor","13","yoho-search","aws,qcloud",""));
JAVA_LIST.add(new Project("3","yohobuy-platform","110","platform",JAVA_ENV_QCLOUD_AWS));
JAVA_LIST.add(new Project("3","yohobuy-platform","110","platform",JAVA_ENV_QCLOUD_AWS,""));
//把list转成map,放到最后
JAVA_MAP=JAVA_LIST.stream().collect(Collectors.toMap(Project::getName,Project->Project));
... ...
... ... @@ -197,7 +197,7 @@
<script src="<%=basePath %>/js/unicorn.js"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>script/common/genarate_left_panel.js?v=<%=ProjectConstant.MENU_VERSION %>"></script>
<script src="<%=basePath%>script/build/project.js?v=20180416"></script>
<script src="<%=basePath%>script/build/project.js?v=20180417"></script>
<script type="text/javascript">
$("#li_project").addClass("active open");
$("#li_projectRelease").addClass("active");
... ...
... ... @@ -42,46 +42,45 @@ function getProjects() {
var order1HTML = "<div class='ckbox ckbox-primary'>";
order1HTML += " <input name='project1all' type='checkbox' id='project1all' value='project1all' onclick='projectcheckall(this,\"project1\");'/>";
order1HTML += "<label for='project1all' style='width: 200px'>yoho30 全选</label></div>";
order1HTML += "<span style='display: none'>replace begin</span>";
var order2HTML = "<div class='ckbox ckbox-warning'>";
order2HTML += " <input name='project2all' type='checkbox' id='project2all' value='project2all' onclick='projectcheckall(this,\"project2\");'/>";
order2HTML += "<label for='project2all' style='width: 200px'>yoho-search 全选</label></div>";
order2HTML += "<div style='border:1px dashed ;padding-left: 8px'>";
var order3HTML = "<div class='ckbox ckbox-success'>";
order3HTML += " <input name='project3all' type='checkbox' id='project3all' value='project3all' onclick='projectcheckall(this,\"project3\");'/>";
order3HTML += "<label for='project3all' style='width: 200px'>platform 全选</label></div>";
var order1num = 1;
order3HTML += "<div style='border:1px dashed ;padding-left: 8px'>";
var order2num = 1;
var order3num = 1;
var order1HTMLMap = new Map();//div 名字 and 具体html内容
var order1HTMLMapCount = new Map();//计数的,控制换行
for (var i = 0; i < obj.length; i++) {
var order = obj[i].order;
var order = obj[i].order;//大分类
var name = obj[i].name;
var checkstr="";
if(default_releaseWorkJob_project!=null&&default_releaseWorkJob_project.indexOf(name+",")>=0){
checkstr = " checked ";
}
if ("1" == order) {
order1HTML += "<div class='ckbox ckbox-primary' style='display: inline'>";
order1HTML += " <input name='project1' type='checkbox' " + checkstr ;
order1HTML += " onclick='loadProjectEnvs()' ";
order1HTML += " id='" + name + "' value='" + name + "'/>";
order1HTML += "<label for='" + name + "' style='width: 200px'>" + name + "</label></div>";
if (order1num % 4 == 0) {
order1HTML += "</br>";
if ("1" == order) {//第一大类--java 核心服务
var groupType = obj[i].groupType;//再细分类别
var currentCount = order1HTMLMapCount[groupType];
var currentHtml = order1HTMLMap[groupType];//当前的html
if(currentCount == null || currentCount == 0){//div 的头部
currentCount = 0;
currentHtml= "<div style='border:1px dashed ;'> <fieldset><legend style='height:25px;margin-left:0px;margin-top:4px;margin-bottom: 4px;font-size: 14px; background-color: #c9cecf'>&nbsp;&nbsp;"+groupType+":</legend><div style='margin-left: 8px'>";
}
if("yohobuy-risk"==name){
var changeBr="</br>";
if(order1num % 4 == 0){
changeBr="";
}
order1HTML += "<span style='display: none'>replace end</span>"+changeBr;
order1num = 0;//重置
if (currentCount > 0 && currentCount % 4 == 0) {//换行
currentHtml += "</br>";
}
order1num += 1;
currentHtml += "<div class='ckbox ckbox-primary' style='display: inline'>";
currentHtml += " <input name='project1' type='checkbox' " + checkstr ;
currentHtml += " onclick='loadProjectEnvs()' ";
currentHtml += " id='" + name + "' value='" + name + "'/>";
currentHtml += "<label for='" + name + "' style='width: 200px'>" + name + "</label></div>";
order1HTMLMap[groupType] = currentHtml;//显示的内容
order1HTMLMapCount[groupType] = currentCount + 1;//计数器
}
if ("2" == order) {
order2HTML += "<div class='ckbox ckbox-warning' style='display: inline'>";
... ... @@ -105,14 +104,15 @@ function getProjects() {
order3HTML += "</br>";
}
order3num += 1;
}
}
order1HTML=order1HTML.replace("<span style='display: none'>replace begin</span>","<div style='border:1px dashed gray'>");
order1HTML=order1HTML.replace("<span style='display: none'>replace end</span>","</div>");
//循环遍历,给每一种类型结尾
for(var html1Map in order1HTMLMap){
order1HTMLMap[html1Map] += "</fieldset></div></div>";//div 结尾
order1HTML += order1HTMLMap[html1Map] +"</br>";
}
document.getElementById("project-div").innerHTML = order1HTML + "<hr>" + order2HTML + "<hr>" + order3HTML;
document.getElementById("project-div").innerHTML = order1HTML + "</br>" + order2HTML + "</div><hr>" + order3HTML +"</div>";
branchdefault();
} else {//回滚单选框
var order1HTML = "";
... ...