Authored by qinchao

docker发布

... ... @@ -182,8 +182,10 @@ public class DockerBuildCtrl {
@RequestMapping("/toEditDockerInfo")
public ModelAndView toEditDockerInfos(Map model) {
return new ModelAndView("project/editDockerInfo",model);
public ModelAndView toEditDockerInfos(Model model) {
model.addAttribute("projectTypes", ProjectEnvironment.getDockerProjectTypes());
model.addAttribute("projectJobTypes", httpRestClient.defaultGet("/dockerProject/getDockerProjectJobType",BaseResponse.class).getData());
return new ModelAndView("project/editDockerInfo");
}
... ...
... ... @@ -310,6 +310,7 @@
var btn = $(this);
this.prop("disabled", "disabled");
var projectType=$("#dockerInfoForm #projectType").val();
var projectName=$("#dockerInfoForm #projectName").val();
var projectGitGroup=$("#dockerInfoForm #projectGitGroup").val();
var projectJobType=$("#dockerInfoForm #projectJobType").val();
... ... @@ -322,6 +323,7 @@
var dockerOnlineImageStore=$("#dockerInfoForm #dockerOnlineImageStore").val();
var autodeployflag=$("#dockerInfoForm #autodeployflag").val();
var port=$("#dockerInfoForm #port").val();
if(projectName == null || projectName == ""){
$("#dockerInfoForm #messageAlert").alerts({
content : "请输入项目名称!",
... ... @@ -410,14 +412,7 @@
return;
}
if(port == null || port == ""){
$("#dockerInfoForm #messageAlert").alerts({
content : "请输入 port!",
type : "danger"
});
btn.removeAttr("disabled");
return;
}
var param ={
id: dockerInfoId,
projectName:projectName,
... ... @@ -431,8 +426,9 @@
dockerOnlineNameSpace:dockerOnlineNameSpace,
dockerOnlineImageStore:dockerOnlineImageStore,
port:port,
autodeployflag:autodeployflag
}
autodeployflag:autodeployflag,
projectType:projectType
};
$.ajax({
url: contextPath + 'dockerBuild/saveDockerInfo',
... ...
<%@page language="java" contentType="text/html;charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<form class="form-horizontal" id="dockerInfoForm" name="dockerInfoForm">
<div class="form-group" >
... ... @@ -10,6 +11,17 @@
</div>
<div class="form-group" >
<label class="col-sm-2 control-label" style="width:280px"> <span style="color:red">*</span>项目类型:</label>
<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>
</c:forEach>
</select>
</div>
</div>
<div class="form-group" >
<label class="col-sm-2 control-label" style="width:280px"> <span style="color:red">*</span>项目git所属组:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="projectGitGroup" name="projectGitGroup" size="40" />
... ... @@ -20,9 +32,9 @@
<label class="col-sm-2 control-label" style="width:280px"> <span style="color:red">*</span>项目job类型:</label>
<div class="col-sm-8">
<select id="projectJobType" name="projectJobType" class="form-control" style = "width:450px;" >
<option value="Docker-Deploy-Node">Docker-Deploy-Node</option>
<option value="Docker-Deploy-Java">Docker-Deploy-Java</option>
<option value="Docker-Deploy-GitHook">Docker-Deploy-GitHook</option>
<c:forEach items="${projectJobTypes }" var="projJobType" >
<option value="${projJobType }">${projJobType }</option>
</c:forEach>
</select>
</div>
</div>
... ... @@ -75,7 +87,7 @@
<div class="form-group" >
<label class="col-sm-2 control-label" style="width:280px"> <span style="color:red">*</span>线上命名空间:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="dockerOnlineNameSpace" name="dockerOnlineNameSpace" size="40" />
<input type="text" class="form-control" id="dockerOnlineNameSpace" name="dockerOnlineNameSpace" value="default" size="40" />
</div>
</div>
... ...