Merge remote-tracking branch 'origin/master'
Showing
7 changed files
with
254 additions
and
6 deletions
@@ -51,7 +51,7 @@ public class ManagerCtrl { | @@ -51,7 +51,7 @@ public class ManagerCtrl { | ||
51 | if (userAuthLocal.getUserByname(user.getName()) != null) { | 51 | if (userAuthLocal.getUserByname(user.getName()) != null) { |
52 | return new BaseResponse(201, "用户已经存在"); | 52 | return new BaseResponse(201, "用户已经存在"); |
53 | } | 53 | } |
54 | - user.setPwd(MD5Util.encryption("123456")); | 54 | + user.setPwd(MD5Util.encryption("Yoho@9646")); |
55 | baseResponse = httpRestClient.defaultPost(HttpUriContants.USER_INSERT, user, BaseResponse.class); | 55 | baseResponse = httpRestClient.defaultPost(HttpUriContants.USER_INSERT, user, BaseResponse.class); |
56 | } else { | 56 | } else { |
57 | if ("admin".equals(user.getName())) { | 57 | if ("admin".equals(user.getName())) { |
1 | package com.ui.ctrl; | 1 | package com.ui.ctrl; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONArray; | 3 | import com.alibaba.fastjson.JSONArray; |
4 | +import com.ui.contants.HttpUriContants; | ||
4 | import com.ui.http.HttpRestClient; | 5 | import com.ui.http.HttpRestClient; |
6 | +import com.ui.model.BaseResponse; | ||
5 | import com.ui.model.req.BuildRequest; | 7 | import com.ui.model.req.BuildRequest; |
8 | +import com.ui.model.req.HostInfoReq; | ||
9 | +import com.ui.model.req.ProjectBuildReq; | ||
6 | import com.ui.project.ProjectEnvironment; | 10 | import com.ui.project.ProjectEnvironment; |
7 | import com.ui.project.ProjectOnline; | 11 | import com.ui.project.ProjectOnline; |
8 | import org.slf4j.Logger; | 12 | import org.slf4j.Logger; |
@@ -34,6 +38,13 @@ public class ProjectBuildCtrl { | @@ -34,6 +38,13 @@ public class ProjectBuildCtrl { | ||
34 | return new ModelAndView("project/project"); | 38 | return new ModelAndView("project/project"); |
35 | } | 39 | } |
36 | 40 | ||
41 | + @RequestMapping("/toHistory") | ||
42 | + public ModelAndView toHistory(Model model) { | ||
43 | + model.addAttribute("environments", ProjectEnvironment.getEnviroments()); | ||
44 | + model.addAttribute("projects", ProjectOnline.getProjectList()); | ||
45 | + return new ModelAndView("project/history"); | ||
46 | + } | ||
47 | + | ||
37 | /** | 48 | /** |
38 | * 获取所有项目 | 49 | * 获取所有项目 |
39 | * | 50 | * |
@@ -146,4 +157,17 @@ public class ProjectBuildCtrl { | @@ -146,4 +157,17 @@ public class ProjectBuildCtrl { | ||
146 | } | 157 | } |
147 | } | 158 | } |
148 | 159 | ||
160 | + @RequestMapping("/getHistory") | ||
161 | + @ResponseBody | ||
162 | + public BaseResponse getHistory(ProjectBuildReq req) throws Exception { | ||
163 | + if("all".equals(req.getEnvironment())){ | ||
164 | + req.setEnvironment(null); | ||
165 | + } | ||
166 | + if("all".equals(req.getCurrentProject())){ | ||
167 | + req.setCurrentProject(null); | ||
168 | + } | ||
169 | + BaseResponse response=httpRestClient.defaultPost("/projectBuild/getHistory", req, BaseResponse.class); | ||
170 | + return response; | ||
171 | + } | ||
172 | + | ||
149 | } | 173 | } |
@@ -48,7 +48,7 @@ public class UserCtrl { | @@ -48,7 +48,7 @@ public class UserCtrl { | ||
48 | } | 48 | } |
49 | if (u.getPwd().equals(MD5Util.encryption(user.getPwd()))) { | 49 | if (u.getPwd().equals(MD5Util.encryption(user.getPwd()))) { |
50 | session.setAttribute("user", user.getName()); | 50 | session.setAttribute("user", user.getName()); |
51 | - if("123456".equals(user.getPwd())){ | 51 | + if("Yoho@9646".equals(user.getPwd())){ |
52 | return new ModelAndView("user/modifypwd"); | 52 | return new ModelAndView("user/modifypwd"); |
53 | } | 53 | } |
54 | return new ModelAndView("dashBoard/dashBoard"); | 54 | return new ModelAndView("dashBoard/dashBoard"); |
1 | +<%@page language="java" contentType="text/html;charset=utf-8" %> | ||
2 | +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | ||
3 | + | ||
4 | +<% | ||
5 | + String path = request.getContextPath(); | ||
6 | + String basePath = request.getScheme() + "://" | ||
7 | + + request.getServerName() + ":" + request.getServerPort() | ||
8 | + + path + "/"; | ||
9 | +%> | ||
10 | + | ||
11 | +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
12 | +<html> | ||
13 | +<head> | ||
14 | + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
15 | + <link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/> | ||
16 | + <link rel="stylesheet" href="<%=basePath %>css/bootstrap-datetimepicker.css"/> | ||
17 | + <link href="<%=basePath %>js/bootstrap-plugin/css/bootstrap.table.css" rel="stylesheet" media="screen"/> | ||
18 | + <link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/> | ||
19 | + <link rel="stylesheet" href="<%=basePath %>css/fullcalendar.css"/> | ||
20 | + <link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/> | ||
21 | + <link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/> | ||
22 | + <link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/> | ||
23 | + <link rel="stylesheet" href="<%=basePath %>css/uniform.css"/> | ||
24 | + <link rel="stylesheet" href="<%=basePath %>css/select2.css"/> | ||
25 | + <link rel="stylesheet" href="<%=basePath %>js/jstree/themes/proton/style.css"/> | ||
26 | + <link rel="stylesheet" href="<%=basePath %>css/select2.css"/> | ||
27 | + <link rel="stylesheet" href="<%=basePath %>css/yoho.css"/> | ||
28 | + <script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script> | ||
29 | + <script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script> | ||
30 | + <script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script> | ||
31 | + <script src="<%=basePath %>/js/bootstrap.min.js"></script> | ||
32 | + <script src="<%=basePath %>/js/unicorn.js"></script> | ||
33 | + <script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8" | ||
34 | + type="text/javascript"></script> | ||
35 | + <script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8" | ||
36 | + type="text/javascript"></script> | ||
37 | + <script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script> | ||
38 | + <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.pagination.js" charset="UTF-8" | ||
39 | + type="text/javascript"></script> | ||
40 | + <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script> | ||
41 | + <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script> | ||
42 | + <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script> | ||
43 | + <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.panel.js" charset="UTF-8" type="text/javascript"></script> | ||
44 | + <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.alerts.js" charset="UTF-8" type="text/javascript"></script> | ||
45 | + <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.accordion.js" charset="UTF-8" | ||
46 | + type="text/javascript"></script> | ||
47 | + <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.breadcrumb.js" charset="UTF-8" | ||
48 | + type="text/javascript"></script> | ||
49 | + <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.validate.js" charset="UTF-8" | ||
50 | + type="text/javascript"></script> | ||
51 | + <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script> | ||
52 | + <script src="<%=basePath %>js/layer/layer.js" charset="UTF-8" type="text/javascript"></script> | ||
53 | + <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.select.js" charset="UTF-8" type="text/javascript"></script> | ||
54 | + <script src="<%=basePath %>js/jstree/jstree.min.js"></script> | ||
55 | + <script src="<%=basePath %>js/jquery.toaster.js"></script> | ||
56 | + <script> | ||
57 | + var contextPath = '<%=basePath %>'; | ||
58 | + </script> | ||
59 | + <title>YOHO!运维</title> | ||
60 | +</head> | ||
61 | +<body> | ||
62 | + | ||
63 | +<!-- 头部 --> | ||
64 | +<div id="head"> | ||
65 | +</div> | ||
66 | +<!-- 右侧具体内容 --> | ||
67 | +<div id="content"> | ||
68 | + | ||
69 | + <div id="breadcrumb"> | ||
70 | + <a href="#" title="Go to Home" class="tip-bottom"><i | ||
71 | + class="icon-home"></i> Home</a> <a href="#" class="current">发布历史</a> | ||
72 | + </div> | ||
73 | + | ||
74 | + <div class="container-fluid"> | ||
75 | + | ||
76 | + | ||
77 | + <div class="widget-box"> | ||
78 | + <div class="widget-title"> | ||
79 | + <h5>发布历史查询</h5> | ||
80 | + </div> | ||
81 | + <div class="widget-content nopadding"> | ||
82 | + <div class="widget-title" style="height: 53px;"> | ||
83 | + <div> | ||
84 | + <div class="form-inline" role="form" id="inBoxQueryDiv" | ||
85 | + style=" margin-top: 12px;margin-left: 25px;float: left;"> | ||
86 | + <div class="input-group" style="float: left;"> | ||
87 | + <span class="input-group-addon">环境:</span> | ||
88 | + <select id="environment" name="environment" class="form-control"> | ||
89 | + <option value="all" selected="selected"></option> | ||
90 | + <c:forEach items="${environments }" var="envi"> | ||
91 | + <option value="${envi }">${envi }</option> | ||
92 | + </c:forEach> | ||
93 | + </select> | ||
94 | + </div> | ||
95 | + <div class="input-group" style="float: left;"> | ||
96 | + <span class="input-group-addon">项目:</span> | ||
97 | + <select id="currentProject" name="currentProject" class="form-control"> | ||
98 | + <option value="all"></option> | ||
99 | + <c:forEach items="${projects }" var="project"> | ||
100 | + <option value="${project.name }">${project.name }</option> | ||
101 | + </c:forEach> | ||
102 | + </select> | ||
103 | + </div> | ||
104 | + <button id="searchBtn" class="btn btn-primary" style="margin-left: 18px;">搜索</button> | ||
105 | + </div> | ||
106 | + </div> | ||
107 | + </div> | ||
108 | + <div id="historyTable"> | ||
109 | + | ||
110 | + </div> | ||
111 | + </div> | ||
112 | + </div> | ||
113 | + </div> | ||
114 | +</div> | ||
115 | +<script src="<%=basePath %>script/common/genarate_left_panel.js"></script> | ||
116 | +<script> | ||
117 | + $("#li_project").addClass("active open"); | ||
118 | + $("#li_projectHistory").addClass("active");</script> | ||
119 | +<script> | ||
120 | + | ||
121 | + $(function () { | ||
122 | + //加载表格 | ||
123 | + $("#historyTable").table({ | ||
124 | + columnAutoWidth: false, | ||
125 | + url: "getHistory", | ||
126 | + striped: true, | ||
127 | + title: "发布历史列表", | ||
128 | + dataType: "json", | ||
129 | + pagination: true, | ||
130 | + pageSize: 10, | ||
131 | + loadFilter: function (data) { | ||
132 | + return defaultLoadFilter(data); | ||
133 | + }, | ||
134 | + columns: [{ | ||
135 | + title: "id", | ||
136 | + field: "localid", | ||
137 | + width: "5%" | ||
138 | + }, { | ||
139 | + title: "环境", | ||
140 | + field: "environment", | ||
141 | + width: "5%" | ||
142 | + }, { | ||
143 | + title: "操作", | ||
144 | + field: "operate", | ||
145 | + width: "5%" | ||
146 | + }, { | ||
147 | + title: "用户", | ||
148 | + field: "user", | ||
149 | + width: "5%" | ||
150 | + }, { | ||
151 | + title: "分支", | ||
152 | + field: "branch", | ||
153 | + width: "5%" | ||
154 | + }, { | ||
155 | + title: "当前项目", | ||
156 | + field: "currentProject", | ||
157 | + width: "10%" | ||
158 | + }, { | ||
159 | + title: "状态", | ||
160 | + field: "status", | ||
161 | + formatter : function(value, rowData, rowIndex) { | ||
162 | + if(value == 1){ | ||
163 | + return '正在进行'; | ||
164 | + } else if(value == 2){ | ||
165 | + return '正常结束'; | ||
166 | + }else if(value == 3){ | ||
167 | + return '强制取消'; | ||
168 | + }else if(value == 4){ | ||
169 | + return '出错取消'; | ||
170 | + }else{ | ||
171 | + return '其他'; | ||
172 | + } | ||
173 | + }, | ||
174 | + width: "10%" | ||
175 | + }, { | ||
176 | + title: "回滚文件", | ||
177 | + field: "rollbackfile", | ||
178 | + width: "10%" | ||
179 | + },{ | ||
180 | + title: "执行顺序", | ||
181 | + field: "projectOrder", | ||
182 | + width: "30%" | ||
183 | + },{ | ||
184 | + title: "时间", | ||
185 | + field: "createTime", | ||
186 | + width: "15%" | ||
187 | + }] | ||
188 | + }); | ||
189 | + | ||
190 | + }); | ||
191 | + | ||
192 | + //点击查询按钮 | ||
193 | + $("#searchBtn").click(function () { | ||
194 | + var currentProject = $("#currentProject").val(); | ||
195 | + var environment = $("#environment").val(); | ||
196 | + $("#historyTable").table("load", { | ||
197 | + 'currentProject': currentProject, | ||
198 | + 'environment': environment | ||
199 | + }); | ||
200 | + }); | ||
201 | + | ||
202 | +</script> | ||
203 | + |
@@ -187,6 +187,7 @@ | @@ -187,6 +187,7 @@ | ||
187 | <script src="<%=basePath%>script/project.js"></script> | 187 | <script src="<%=basePath%>script/project.js"></script> |
188 | <script src="<%=basePath %>script/common/genarate_left_panel.js"></script> | 188 | <script src="<%=basePath %>script/common/genarate_left_panel.js"></script> |
189 | <script type="text/javascript"> | 189 | <script type="text/javascript"> |
190 | + $("#li_project").addClass("active open"); | ||
190 | $("#li_projectRelease").addClass("active"); | 191 | $("#li_projectRelease").addClass("active"); |
191 | </script> | 192 | </script> |
192 | <script language="JavaScript"> | 193 | <script language="JavaScript"> |
@@ -20,7 +20,7 @@ innerHTML += "<li id='li_zkMonitor'><a id='li_zkMonitor_a' href=''><i class='ico | @@ -20,7 +20,7 @@ innerHTML += "<li id='li_zkMonitor'><a id='li_zkMonitor_a' href=''><i class='ico | ||
20 | innerHTML += "<li id='li_rabbitview'><a id='li_rabbitview_a' href=''><i class='icon icon-th'></i> <span>Rabbitmq监控</span></a></li>"; | 20 | innerHTML += "<li id='li_rabbitview'><a id='li_rabbitview_a' href=''><i class='icon icon-th'></i> <span>Rabbitmq监控</span></a></li>"; |
21 | innerHTML += "<li id='li_redisInfo'><a id='li_redisInfo_a' href=''><i class='icon icon-th'></i> <span>Redis监控</span></a></li>"; | 21 | innerHTML += "<li id='li_redisInfo'><a id='li_redisInfo_a' href=''><i class='icon icon-th'></i> <span>Redis监控</span></a></li>"; |
22 | innerHTML += "<li id='li_nginxview'><a id='li_nginxview_a' href=''><i class='icon icon-th'></i> <span>Nginx监控</span></a></li>"; | 22 | innerHTML += "<li id='li_nginxview'><a id='li_nginxview_a' href=''><i class='icon icon-th'></i> <span>Nginx监控</span></a></li>"; |
23 | -innerHTML += "<li id='li_projectRelease'><a id='li_projectRelease_a' href=''><i class='icon icon-th'></i> <span>项目发布</span></a></li>"; | 23 | + |
24 | 24 | ||
25 | /*Hystrix*/ | 25 | /*Hystrix*/ |
26 | innerHTML += "<li class='submenu' id='li_hystrix'><a id='a_hystrix' href='#'><i class='icon icon-th-list'></i> <span>Hystrix</span><span class='label'>2</span></a>"; | 26 | innerHTML += "<li class='submenu' id='li_hystrix'><a id='a_hystrix' href='#'><i class='icon icon-th-list'></i> <span>Hystrix</span><span class='label'>2</span></a>"; |
@@ -28,6 +28,12 @@ innerHTML += "<ul><li id='li_hystrix_aws'><a id='a_hystrix_aws' href=''>AWS</a>< | @@ -28,6 +28,12 @@ innerHTML += "<ul><li id='li_hystrix_aws'><a id='a_hystrix_aws' href=''>AWS</a>< | ||
28 | innerHTML += "<li id='li_hystrix_qcloud'><a id='a_hystrix_qcloud' href=''>QCloud</a></li>"; | 28 | innerHTML += "<li id='li_hystrix_qcloud'><a id='a_hystrix_qcloud' href=''>QCloud</a></li>"; |
29 | innerHTML += "</ul></li>"; | 29 | innerHTML += "</ul></li>"; |
30 | 30 | ||
31 | +/*project*/ | ||
32 | +innerHTML += "<li class='submenu' id='li_project'><a id='li_project_a' href='#'><i class='icon icon-th-list'></i> <span>项目发布</span><span class='label'>2</span></a><ul>"; | ||
33 | +innerHTML += "<li id='li_projectRelease'><a id='li_projectRelease_a' href=''><i class='icon icon-th'></i> <span>项目发布</span></a></li>"; | ||
34 | +innerHTML += "<li id='li_projectHistory'><a id='li_projectHistory_a' href=''><i class='icon icon-th'></i> <span>历史记录</span></a></li>"; | ||
35 | +innerHTML += "</ul></li>"; | ||
36 | + | ||
31 | /*switch*/ | 37 | /*switch*/ |
32 | innerHTML += "<li class='submenu' id='li_switch'><a id='li_switch_a' href='#'><i class='icon icon-th-list'></i> <span>关键切换</span><span class='label'>2</span></a>"; | 38 | innerHTML += "<li class='submenu' id='li_switch'><a id='li_switch_a' href='#'><i class='icon icon-th-list'></i> <span>关键切换</span><span class='label'>2</span></a>"; |
33 | innerHTML += "<ul><li id='li_nginxswitch'><a id='li_nginxswitch_a' href=''>nginx切换</a></li>"; | 39 | innerHTML += "<ul><li id='li_nginxswitch'><a id='li_nginxswitch_a' href=''>nginx切换</a></li>"; |
@@ -35,10 +41,9 @@ innerHTML += "<li id='li_dnsswitch'><a id='li_dnsswitch_a' href='#'>DNS切换</a | @@ -35,10 +41,9 @@ innerHTML += "<li id='li_dnsswitch'><a id='li_dnsswitch_a' href='#'>DNS切换</a | ||
35 | innerHTML += "</ul></li>"; | 41 | innerHTML += "</ul></li>"; |
36 | 42 | ||
37 | /*manage*/ | 43 | /*manage*/ |
38 | -innerHTML += "<li class='submenu' id='li_manager'><a id='li_manager_a' href='#'><i class='icon icon-th-list'></i> <span>管理员</span><span class='label'>3</span></a>"; | 44 | +innerHTML += "<li class='submenu' id='li_manager'><a id='li_manager_a' href='#'><i class='icon icon-th-list'></i> <span>管理员</span><span class='label'>2</span></a>"; |
39 | innerHTML += "<ul><li id='li_user'><a id='li_user_a' href=''>用户管理</a></li>"; | 45 | innerHTML += "<ul><li id='li_user'><a id='li_user_a' href=''>用户管理</a></li>"; |
40 | innerHTML += "<li id='li_module'><a id='li_module_a' href=''>模块管理</a></li>"; | 46 | innerHTML += "<li id='li_module'><a id='li_module_a' href=''>模块管理</a></li>"; |
41 | -innerHTML += "<li id='li_projectlist'><a id='li_projectlist_a' href=''>发布记录</a></li>"; | ||
42 | innerHTML += "</ul></li>"; | 47 | innerHTML += "</ul></li>"; |
43 | 48 | ||
44 | /*其他*/ | 49 | /*其他*/ |
@@ -67,7 +72,7 @@ document.getElementById("li_zkMonitor_a").setAttribute("href", path + "/zkTree/t | @@ -67,7 +72,7 @@ document.getElementById("li_zkMonitor_a").setAttribute("href", path + "/zkTree/t | ||
67 | document.getElementById("li_user_a").setAttribute("href", path + "/manage/toUser"); | 72 | document.getElementById("li_user_a").setAttribute("href", path + "/manage/toUser"); |
68 | document.getElementById("li_module_a").setAttribute("href", path + "/manage/toModule"); | 73 | document.getElementById("li_module_a").setAttribute("href", path + "/manage/toModule"); |
69 | document.getElementById("li_nginxswitch_a").setAttribute("href", path + "/nginxswitch/toNginxSwitch"); | 74 | document.getElementById("li_nginxswitch_a").setAttribute("href", path + "/nginxswitch/toNginxSwitch"); |
70 | -//document.getElementById("li_dnsswitch_a").setAttribute("href", path + "/dnspod/toDns"); | 75 | +document.getElementById("li_projectHistory_a").setAttribute("href", path + "/project/toHistory"); |
71 | document.getElementById("a_hystrix_aws").setAttribute("href", path + "/hystrix/aws"); | 76 | document.getElementById("a_hystrix_aws").setAttribute("href", path + "/hystrix/aws"); |
72 | document.getElementById("a_hystrix_qcloud").setAttribute("href", path + "/hystrix/qcloud"); | 77 | document.getElementById("a_hystrix_qcloud").setAttribute("href", path + "/hystrix/qcloud"); |
73 | 78 |
-
Please register or login to post a comment