|
|
<%@page language="java" contentType="text/html;charset=utf-8" %>
|
|
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
|
|
|
|
|
<%
|
|
|
String path = request.getContextPath();
|
|
|
String basePath = request.getScheme() + "://"
|
|
|
+ request.getServerName() + ":" + request.getServerPort()
|
|
|
+ path + "/";
|
|
|
%>
|
|
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/bootstrap-datetimepicker.css"/>
|
|
|
<link href="<%=basePath %>js/bootstrap-plugin/css/bootstrap.table.css" rel="stylesheet" media="screen"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/fullcalendar.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/uniform.css"/>
|
|
|
<%--<link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>js/select2/dist/css/select2.css"/>--%>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/select2-4.0.3.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>js/jstree/themes/proton/style.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/yoho.css"/>
|
|
|
<script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>/js/bootstrap.min.js"></script>
|
|
|
<script src="<%=basePath %>/js/unicorn.js"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.pagination.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.panel.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.alerts.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.accordion.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.breadcrumb.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.validate.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/layer/layer.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.select.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/jstree/jstree.min.js"></script>
|
|
|
<script src="<%=basePath %>js/jquery.toaster.js"></script>
|
|
|
<script src="<%=basePath%>js/select2-4.0.3.min.js"></script>
|
|
|
<%--<%–<script src="<%=basePath%>js/select2.min.js"></script>–%>
|
|
|
<script src="<%=basePath %>js/select2/dist/js/select2.full.js"></script>--%>
|
|
|
<script>
|
|
|
var contextPath = '<%=basePath %>';
|
|
|
</script>
|
|
|
<title>YOHO!运维</title>
|
|
|
</head>
|
|
|
<body>
|
|
|
|
|
|
<!-- 头部 -->
|
|
|
<div id="head">
|
|
|
</div>
|
|
|
<!-- 右侧具体内容 -->
|
|
|
<div id="content">
|
|
|
|
|
|
<div id="breadcrumb">
|
|
|
<a href="#" title="Go to Home" class="tip-bottom"><i
|
|
|
class="icon-home"></i> Home</a> <a href="#" class="current">DOCKER配置</a>
|
|
|
</div>
|
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
|
|
|
|
|
<div class="widget-box">
|
|
|
<div class="widget-title">
|
|
|
<h5>Docker信息查询</h5>
|
|
|
</div>
|
|
|
<div class="widget-content nopadding">
|
|
|
<div class="widget-title" style="height: 106px;">
|
|
|
<div>
|
|
|
<div class="form-inline" role="form"
|
|
|
style=" margin-top: 12px;margin-left: 25px;float: left;">
|
|
|
<div class="input-group" style="float: left;">
|
|
|
<span class="input-group-addon">项目名称:</span>
|
|
|
<input type="text" id="projectName_search" name="projectName_search" class="form-control" placeholder="" style="width: 180px"/>
|
|
|
</div>
|
|
|
<div class="input-group" style="float: left;">
|
|
|
<span class="input-group-addon">Docker项目名称:</span>
|
|
|
<input type="text" id="dockerProjectName_search" name="dockerProjectName_search" class="form-control" placeholder="" style="width: 180px"/>
|
|
|
</div>
|
|
|
<div class="input-group" style="float: left;">
|
|
|
<span class="input-group-addon">项目job类型:</span>
|
|
|
<select id="projectJobType_search" class="form-control">
|
|
|
<option value="" selected="selected">所有类型</option>
|
|
|
<option value="Docker-Deploy-Node">Docker-Deploy-Node</option>
|
|
|
<option value="Docker-Deploy-Java">Docker-Deploy-Java</option>
|
|
|
</select>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<button id="searchDockerInfoBtn" class="btn btn-primary" style="margin-left: 18px;">搜索</button>
|
|
|
<button id="addDockerBtn" class="btn btn-success" style="margin-left: 18px;">新增</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div id="dockerInfoTable">
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</body>
|
|
|
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
|
|
|
<script>
|
|
|
$("#li_config").addClass("active open");
|
|
|
$("#li_docker_project_info").addClass("active");
|
|
|
</script>
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
|
|
|
|
//加载表格
|
|
|
$("#dockerInfoTable").table({
|
|
|
columnAutoWidth : false,
|
|
|
url : "getDockerInfoList",
|
|
|
striped : true,
|
|
|
title : "Docker信息列表",
|
|
|
dataType : "json",
|
|
|
pagination : true,
|
|
|
pageSize : 50,
|
|
|
loadFilter : function(data) {
|
|
|
return defaultLoadFilter(data);
|
|
|
},
|
|
|
columns : [
|
|
|
{
|
|
|
title : " 序号 " ,
|
|
|
width : "3%",
|
|
|
formatter : function(value, rowData, rowIndex) {
|
|
|
return rowIndex + 1;
|
|
|
}
|
|
|
},{
|
|
|
title : "项目名称",
|
|
|
field : "projectName",
|
|
|
width : "12%"
|
|
|
}, {
|
|
|
title : "项目git所属组",
|
|
|
field : "projectGitGroup",
|
|
|
width : "10%"
|
|
|
}, {
|
|
|
title : "项目job类型",
|
|
|
field : "projectJobType",
|
|
|
width : "5%"
|
|
|
}, {
|
|
|
title : "docker项目名称",
|
|
|
field : "dockerProjectName",
|
|
|
width : "12%"
|
|
|
},{
|
|
|
title : "操作",
|
|
|
field : "op",
|
|
|
formatter : function(value, rowData, rowIndex) {
|
|
|
var div = $("<div>");
|
|
|
var editBtn = $("<button>").addClass("btn btn-xs btn-success").html("修改").appendTo(div);
|
|
|
editBtn.click(function() {
|
|
|
editDockerInfo(rowData.id);
|
|
|
});
|
|
|
div.append(" ");
|
|
|
var delBtn = $("<button>").addClass("btn btn-xs btn-danger").html("删除").appendTo(div);
|
|
|
delBtn.click(function() {
|
|
|
var dialog = $("<div>").appendTo($("body"));
|
|
|
dialog.dialog({
|
|
|
title : "删除",
|
|
|
backdrop : "static",
|
|
|
content : "你确定要删除吗?",
|
|
|
buttons : [{
|
|
|
text : "否",
|
|
|
className : "btn-danger",
|
|
|
onclick : function() {
|
|
|
$(dialog).dialog("hide");
|
|
|
}
|
|
|
}, {
|
|
|
text : "是",
|
|
|
className : "btn-success",
|
|
|
onclick : function() {
|
|
|
$(dialog).dialog("hide");
|
|
|
$.ajax({
|
|
|
url : "delDockerInfoById.do",
|
|
|
type : 'post',
|
|
|
async : false,
|
|
|
data : {
|
|
|
id : rowData.id
|
|
|
},
|
|
|
dataType : "json",
|
|
|
success : function(data) {
|
|
|
if (!data || data.code != 200) {
|
|
|
localAlert('删除失败',data.message);
|
|
|
}
|
|
|
$("#dockerInfoTable").table("load");
|
|
|
},
|
|
|
error: function (data) {
|
|
|
localAlert('系统异常',data.message);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
});
|
|
|
return div;
|
|
|
},
|
|
|
width : "8%"
|
|
|
}]
|
|
|
});
|
|
|
$("#addDockerBtn").click(function() {
|
|
|
editDockerInfo(0);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
//点击查询按钮
|
|
|
$("#searchDockerInfoBtn").click(function () {
|
|
|
var projectName = $("#projectName_search").val();
|
|
|
var dockerProjectName = $("#dockerProjectName_search").val();
|
|
|
var projectJobType = $("#projectJobType_search").val();
|
|
|
|
|
|
$("#dockerInfoTable").table("load", {
|
|
|
'projectName': projectName,
|
|
|
'dockerProjectName':dockerProjectName,
|
|
|
'projectJobType':projectJobType
|
|
|
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
//打开新增或修改页面
|
|
|
function editDockerInfo(dockerInfoId) {
|
|
|
paramObj.dockerInfoId = dockerInfoId;
|
|
|
var dialog = $("<div>").appendTo($("body"));
|
|
|
dialog.dialog({
|
|
|
size : "modal-lg",
|
|
|
title : (dockerInfoId == 0 ? "新增" : "修改") + "Docker项目信息",
|
|
|
backdrop : "static",
|
|
|
href : "toEditDockerInfo",
|
|
|
buttons : [{
|
|
|
text : "关闭",
|
|
|
className : "btn-danger",
|
|
|
onclick : function() {
|
|
|
$(dialog).dialog("hide");
|
|
|
}
|
|
|
}, {
|
|
|
text : "提交",
|
|
|
className : "btn-success",
|
|
|
onclick : function() {
|
|
|
//check信息
|
|
|
var btn = $(this);
|
|
|
this.prop("disabled", "disabled");
|
|
|
|
|
|
var projectName=$("#dockerInfoForm #projectName").val();
|
|
|
var projectGitGroup=$("#dockerInfoForm #projectGitGroup").val();
|
|
|
var projectJobType=$("#dockerInfoForm #projectJobType").val();
|
|
|
var dockerProjectName=$("#dockerInfoForm #dockerProjectName").val();
|
|
|
var dockerGrayClusterId=$("#dockerInfoForm #dockerGrayClusterId").val();
|
|
|
var dockerGrayNameSpace=$("#dockerInfoForm #dockerGrayNameSpace").val();
|
|
|
var dockerGrayImageStore=$("#dockerInfoForm #dockerGrayImageStore").val();
|
|
|
var dockerOnlineClusterId=$("#dockerInfoForm #dockerOnlineClusterId").val();
|
|
|
var dockerOnlineNameSpace=$("#dockerInfoForm #dockerOnlineNameSpace").val();
|
|
|
var dockerOnlineImageStore=$("#dockerInfoForm #dockerOnlineImageStore").val();
|
|
|
var port=$("#dockerInfoForm #port").val();
|
|
|
if(projectName == null || projectName == ""){
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : "请输入项目名称!",
|
|
|
type : "danger"
|
|
|
});
|
|
|
btn.removeAttr("disabled");
|
|
|
return;
|
|
|
}
|
|
|
if(projectGitGroup == null || projectGitGroup == ""){
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : "请输入项目git所属组!",
|
|
|
type : "danger"
|
|
|
});
|
|
|
btn.removeAttr("disabled");
|
|
|
return;
|
|
|
}
|
|
|
if(dockerProjectName == null || dockerProjectName == ""){
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : "请输入docker项目名称!",
|
|
|
type : "danger"
|
|
|
});
|
|
|
btn.removeAttr("disabled");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if(dockerProjectName == null || dockerProjectName == ""){
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : "请输入docker项目名称!",
|
|
|
type : "danger"
|
|
|
});
|
|
|
btn.removeAttr("disabled");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if(dockerGrayClusterId == null || dockerGrayClusterId == ""){
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : "请输入dockerGrayClusterId!",
|
|
|
type : "danger"
|
|
|
});
|
|
|
btn.removeAttr("disabled");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if(dockerGrayNameSpace == null || dockerGrayNameSpace == ""){
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : "请输入 dockerGrayNameSpace!",
|
|
|
type : "danger"
|
|
|
});
|
|
|
btn.removeAttr("disabled");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if(dockerGrayImageStore == null || dockerGrayImageStore == ""){
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : "请输入 dockerGrayImageStore!",
|
|
|
type : "danger"
|
|
|
});
|
|
|
btn.removeAttr("disabled");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if(dockerOnlineClusterId == null || dockerOnlineClusterId == ""){
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : "请输入 dockerOnlineClusterId!",
|
|
|
type : "danger"
|
|
|
});
|
|
|
btn.removeAttr("disabled");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if(dockerOnlineNameSpace == null || dockerOnlineNameSpace == ""){
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : "请输入 dockerOnlineNameSpace!",
|
|
|
type : "danger"
|
|
|
});
|
|
|
btn.removeAttr("disabled");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if(dockerOnlineImageStore == null || dockerOnlineImageStore == ""){
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : "请输入 dockerOnlineImageStore!",
|
|
|
type : "danger"
|
|
|
});
|
|
|
btn.removeAttr("disabled");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if(port == null || port == ""){
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : "请输入 port!",
|
|
|
type : "danger"
|
|
|
});
|
|
|
btn.removeAttr("disabled");
|
|
|
return;
|
|
|
}
|
|
|
var param ={
|
|
|
id: dockerInfoId,
|
|
|
projectName:projectName,
|
|
|
projectGitGroup:projectGitGroup,
|
|
|
projectJobType:projectJobType,
|
|
|
dockerProjectName:dockerProjectName,
|
|
|
dockerGrayClusterId:dockerGrayClusterId,
|
|
|
dockerGrayNameSpace:dockerGrayNameSpace,
|
|
|
dockerGrayImageStore:dockerGrayImageStore,
|
|
|
dockerOnlineClusterId:dockerOnlineClusterId,
|
|
|
dockerOnlineNameSpace:dockerOnlineNameSpace,
|
|
|
dockerOnlineImageStore:dockerOnlineImageStore,
|
|
|
port:port
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
url: contextPath + 'dockerBuild/saveDockerInfo',
|
|
|
type: 'POST',
|
|
|
dataType: 'json',
|
|
|
contentType: "application/json",
|
|
|
data: JSON.stringify(param),
|
|
|
async:false,
|
|
|
success: function (data) {
|
|
|
if (!data || data.code != 200) {
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content: data.message,
|
|
|
type: "danger"
|
|
|
});
|
|
|
return;
|
|
|
} else {
|
|
|
$("#dockerInfoTable").table("load");
|
|
|
$(dialog).dialog("hide");
|
|
|
}
|
|
|
},
|
|
|
error: function (data) {
|
|
|
localAlert('系统异常', data.message);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/* $("#dockerInfoForm").form("submit", {
|
|
|
submitUrl : "saveDockerInfo.do",
|
|
|
submitData : {
|
|
|
id: dockerInfoId,
|
|
|
projectName:projectName,
|
|
|
projectGitGroup:projectGitGroup,
|
|
|
projectJobType:projectJobType,
|
|
|
dockerProjectName:dockerProjectName,
|
|
|
dockerGrayClusterId:dockerGrayClusterId,
|
|
|
dockerGrayNameSpace:dockerGrayNameSpace,
|
|
|
dockerGrayImageStore:dockerGrayImageStore,
|
|
|
dockerOnlineClusterId:dockerOnlineClusterId,
|
|
|
dockerOnlineNameSpace:dockerOnlineNameSpace,
|
|
|
dockerOnlineImageStore:dockerOnlineImageStore
|
|
|
|
|
|
},
|
|
|
onBeforeSubmit : function() {
|
|
|
if (!$(this).form("validate")) {
|
|
|
btn.removeAttr("disabled");
|
|
|
return false;
|
|
|
}
|
|
|
},
|
|
|
success : function(data) {
|
|
|
if (!data || data.code != 200) {
|
|
|
btn.removeAttr("disabled");
|
|
|
$("#dockerInfoForm #messageAlert").alerts({
|
|
|
content : data.message,
|
|
|
type : "danger"
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
$("#dockerInfoTable").table("load");
|
|
|
$(dialog).dialog("hide");
|
|
|
}
|
|
|
});*/
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
...
|
...
|
|