Authored by qinchao

docker发布

@@ -182,8 +182,10 @@ public class DockerBuildCtrl { @@ -182,8 +182,10 @@ public class DockerBuildCtrl {
182 182
183 183
184 @RequestMapping("/toEditDockerInfo") 184 @RequestMapping("/toEditDockerInfo")
185 - public ModelAndView toEditDockerInfos(Map model) {  
186 - return new ModelAndView("project/editDockerInfo",model); 185 + public ModelAndView toEditDockerInfos(Model model) {
  186 + model.addAttribute("projectTypes", ProjectEnvironment.getDockerProjectTypes());
  187 + model.addAttribute("projectJobTypes", httpRestClient.defaultGet("/dockerProject/getDockerProjectJobType",BaseResponse.class).getData());
  188 + return new ModelAndView("project/editDockerInfo");
187 } 189 }
188 190
189 191
@@ -310,6 +310,7 @@ @@ -310,6 +310,7 @@
310 var btn = $(this); 310 var btn = $(this);
311 this.prop("disabled", "disabled"); 311 this.prop("disabled", "disabled");
312 312
  313 + var projectType=$("#dockerInfoForm #projectType").val();
313 var projectName=$("#dockerInfoForm #projectName").val(); 314 var projectName=$("#dockerInfoForm #projectName").val();
314 var projectGitGroup=$("#dockerInfoForm #projectGitGroup").val(); 315 var projectGitGroup=$("#dockerInfoForm #projectGitGroup").val();
315 var projectJobType=$("#dockerInfoForm #projectJobType").val(); 316 var projectJobType=$("#dockerInfoForm #projectJobType").val();
@@ -322,6 +323,7 @@ @@ -322,6 +323,7 @@
322 var dockerOnlineImageStore=$("#dockerInfoForm #dockerOnlineImageStore").val(); 323 var dockerOnlineImageStore=$("#dockerInfoForm #dockerOnlineImageStore").val();
323 var autodeployflag=$("#dockerInfoForm #autodeployflag").val(); 324 var autodeployflag=$("#dockerInfoForm #autodeployflag").val();
324 var port=$("#dockerInfoForm #port").val(); 325 var port=$("#dockerInfoForm #port").val();
  326 +
325 if(projectName == null || projectName == ""){ 327 if(projectName == null || projectName == ""){
326 $("#dockerInfoForm #messageAlert").alerts({ 328 $("#dockerInfoForm #messageAlert").alerts({
327 content : "请输入项目名称!", 329 content : "请输入项目名称!",
@@ -410,14 +412,7 @@ @@ -410,14 +412,7 @@
410 return; 412 return;
411 } 413 }
412 414
413 - if(port == null || port == ""){  
414 - $("#dockerInfoForm #messageAlert").alerts({  
415 - content : "请输入 port!",  
416 - type : "danger"  
417 - });  
418 - btn.removeAttr("disabled");  
419 - return;  
420 - } 415 +
421 var param ={ 416 var param ={
422 id: dockerInfoId, 417 id: dockerInfoId,
423 projectName:projectName, 418 projectName:projectName,
@@ -431,8 +426,9 @@ @@ -431,8 +426,9 @@
431 dockerOnlineNameSpace:dockerOnlineNameSpace, 426 dockerOnlineNameSpace:dockerOnlineNameSpace,
432 dockerOnlineImageStore:dockerOnlineImageStore, 427 dockerOnlineImageStore:dockerOnlineImageStore,
433 port:port, 428 port:port,
434 - autodeployflag:autodeployflag  
435 - } 429 + autodeployflag:autodeployflag,
  430 + projectType:projectType
  431 + };
436 432
437 $.ajax({ 433 $.ajax({
438 url: contextPath + 'dockerBuild/saveDockerInfo', 434 url: contextPath + 'dockerBuild/saveDockerInfo',
1 <%@page language="java" contentType="text/html;charset=utf-8" %> 1 <%@page language="java" contentType="text/html;charset=utf-8" %>
  2 +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
2 <form class="form-horizontal" id="dockerInfoForm" name="dockerInfoForm"> 3 <form class="form-horizontal" id="dockerInfoForm" name="dockerInfoForm">
3 4
4 <div class="form-group" > 5 <div class="form-group" >
@@ -10,6 +11,17 @@ @@ -10,6 +11,17 @@
10 </div> 11 </div>
11 12
12 <div class="form-group" > 13 <div class="form-group" >
  14 + <label class="col-sm-2 control-label" style="width:280px"> <span style="color:red">*</span>项目类型:</label>
  15 + <div class="col-sm-8">
  16 + <select id="projectType" name="projectType" class="form-control" style = "width:450px;" >
  17 + <c:forEach items="${projectTypes }" var="projType" >
  18 + <option value="${projType }">${projType }</option>
  19 + </c:forEach>
  20 + </select>
  21 + </div>
  22 + </div>
  23 +
  24 + <div class="form-group" >
13 <label class="col-sm-2 control-label" style="width:280px"> <span style="color:red">*</span>项目git所属组:</label> 25 <label class="col-sm-2 control-label" style="width:280px"> <span style="color:red">*</span>项目git所属组:</label>
14 <div class="col-sm-8"> 26 <div class="col-sm-8">
15 <input type="text" class="form-control" id="projectGitGroup" name="projectGitGroup" size="40" /> 27 <input type="text" class="form-control" id="projectGitGroup" name="projectGitGroup" size="40" />
@@ -20,9 +32,9 @@ @@ -20,9 +32,9 @@
20 <label class="col-sm-2 control-label" style="width:280px"> <span style="color:red">*</span>项目job类型:</label> 32 <label class="col-sm-2 control-label" style="width:280px"> <span style="color:red">*</span>项目job类型:</label>
21 <div class="col-sm-8"> 33 <div class="col-sm-8">
22 <select id="projectJobType" name="projectJobType" class="form-control" style = "width:450px;" > 34 <select id="projectJobType" name="projectJobType" class="form-control" style = "width:450px;" >
23 - <option value="Docker-Deploy-Node">Docker-Deploy-Node</option>  
24 - <option value="Docker-Deploy-Java">Docker-Deploy-Java</option>  
25 - <option value="Docker-Deploy-GitHook">Docker-Deploy-GitHook</option> 35 + <c:forEach items="${projectJobTypes }" var="projJobType" >
  36 + <option value="${projJobType }">${projJobType }</option>
  37 + </c:forEach>
26 </select> 38 </select>
27 </div> 39 </div>
28 </div> 40 </div>
@@ -75,7 +87,7 @@ @@ -75,7 +87,7 @@
75 <div class="form-group" > 87 <div class="form-group" >
76 <label class="col-sm-2 control-label" style="width:280px"> <span style="color:red">*</span>线上命名空间:</label> 88 <label class="col-sm-2 control-label" style="width:280px"> <span style="color:red">*</span>线上命名空间:</label>
77 <div class="col-sm-8"> 89 <div class="col-sm-8">
78 - <input type="text" class="form-control" id="dockerOnlineNameSpace" name="dockerOnlineNameSpace" size="40" /> 90 + <input type="text" class="form-control" id="dockerOnlineNameSpace" name="dockerOnlineNameSpace" value="default" size="40" />
79 </div> 91 </div>
80 </div> 92 </div>
81 93