Authored by qinchao

发布-通告镜像-

... ... @@ -12,6 +12,8 @@ import java.util.List;
@Data
public class Project {
private String deployType ;//部署方式,1.git 拉分支的方式 ,2. image 镜像的方式
private String order;//顺序
private String name;
... ...
... ... @@ -14,6 +14,9 @@ public class ProjectEnvironment {
//docker相关
private static Map<String,String> dockerProjectTypeMap=new LinkedHashMap<>();
//项目发布的方式
private static Map<String,String> projectDeployTypeMap=new LinkedHashMap<>();
static{
map.put("aws", "http://"+ ProjectConstant.DEPLOY_IP+":8883/web/");
map.put("qcloud","http://"+ ProjectConstant.DEPLOY_IP+":8883/web/");
... ... @@ -26,6 +29,9 @@ public class ProjectEnvironment {
dockerProjectTypeMap.put("ops","ops");
dockerProjectTypeMap.put("erp","erp");
projectDeployTypeMap.put("git","Git分支");
projectDeployTypeMap.put("image","Docker镜像");
}
... ... @@ -50,5 +56,9 @@ public class ProjectEnvironment {
return dockerProjectTypeMap;
}
public static Map<String,String> getProjectDeployTypeMap(){
return projectDeployTypeMap;
}
}
... ...
... ... @@ -60,6 +60,7 @@ public class WorkSystemCtrl {
model.addAttribute("platforms", Platform.getPlatforms());
//model.addAttribute("dockerEnvironments", ProjectEnvironment.getDockerEnvironments(null));
model.addAttribute("projectTypes", ProjectEnvironment.getDockerProjectTypeMap());
model.addAttribute("projectDeployTypes", ProjectEnvironment.getProjectDeployTypeMap());
BaseResponse<List<User>> resp = httpRestClient.exchangeForget(HttpUriContants.GET_All_USER, new ParameterizedTypeReference<BaseResponse<List<User>>>() {
}, null);
model.addAttribute("verifiers",resp.getData());//审核人列表
... ...
... ... @@ -23,6 +23,14 @@
var contextPath = '<%=basePath %>';
</script>
<title>添加工单</title>
<style>
.select2-selection.select2-selection--single {
min-height:40px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
line-height:38px;
}
</style>
</head>
<body style="background-color: #444444;font-size: 14px">
... ... @@ -118,10 +126,21 @@
</div>
<div class="form-group">
<label class="col-sm-1 control-label"><strong>Branch输入:</strong></label>
<div class="col-sm-8">
<input id="inputBranch" name="branch" type="text" value="master" class="form-control"
style="width: 300px"/>
<label class="col-sm-1 control-label"><strong>发布方式:</strong></label>
<div class="col-sm-1" style="width: 110px;" >
<select id="projectDeployType" name="projectDeployType" onchange="deployTypeOnchange(this.value)">
<c:forEach items="${projectDeployTypes }" var="projectDeployType" varStatus="projectDeloyTypeStatus">
<option value="${projectDeployType.key }">${projectDeployType.value }</option>
</c:forEach>
</select>
</div>
<div class="col-sm-7">
<div id="git_deploy_type_div" class="deploy_type_div_class">
<input id="inputBranch" name="branch" type="text" value="master" class="form-control"/>
</div>
<div id="image_deploy_type_div" class="deploy_type_div_class" style="display: none">
<div id="image_content_deploy_div"></div>
</div>
</div>
</div>
... ... @@ -233,6 +252,36 @@
$("#verifier").select2({
});
$("#projectDeployType").select2({
width:"110px"
});
//发布方式选择
function deployTypeOnchange(val){
$(".deploy_type_div_class").hide();
$("#"+val+"_deploy_type_div").show();
if(val=="image"){
$("#image_content_deploy_div").html="";
//加载项目的镜像
var project = $("input[name='project']:checked").val();
var list=[];
if(project){
list=["image1","image2"];
}
var innerHTMLContext = "<select id='imagesList' data-placeholder='Choose One' style='width:400px;'>";
for (var i = 0; i < list.length; i++) {
innerHTMLContext += "<option value='" + list[i] + "'>" + list[i] + "</option>";
}
innerHTMLContext += "</select>";
console.log(innerHTMLContext);
document.getElementById("image_content_deploy_div").innerHTML = innerHTMLContext;
$('#imagesList').select2({
minimumResultsForSearch: -1
});
}
}
function toAddReleaseWork() {
$.ajax({
url: contextPath + 'workSystem/checkRole?type=release',
... ...