Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ops
/
monitor-ui
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
mlge
7 years ago
Commit
0805830145ec4c51133e59c9106d5232770d4cc2
2 parents
be72391c
5998d6aa
master
...
dev_addtag_ui
dev_deploy_image_ui
dev_host_topo_ui
dev_nginx_checkbox
dev_nginx_ui
dev_switch_nginx
dev_ui_topo
feature/add-footer-div-20220127
monitor-ui-fyzh
no message
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
354 additions
and
287 deletions
monitor-ui-common/src/main/java/com/ui/User/UserOperateEnum.java
monitor-ui-common/src/main/java/com/ui/cloud/task/FetchAutoScalingTask.java
monitor-ui-common/src/main/java/com/ui/contants/ProjectConstant.java
monitor-ui-common/src/main/java/com/ui/project/ProjectEnvironment.java
monitor-ui-common/src/main/java/com/ui/project/ProjectOnline.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/AutoScalingCtrl.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/DockerBuildCtrl.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/NodeBuildCtrl.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/NodeMonitorCtrl.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/OuterIntfCtrl.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/PhpBuildCtrl.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/ProjectBuildCtrl.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/SmsUpctrl.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/WorkSystemCtrl.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/app/AppNodeBuildCtrl.java
monitor-ui-ctrl/src/main/java/com/ui/ctrl/app/AppPhpBuildCtrl.java
monitor-ui-web/src/main/resources/META-INF/spring/spring-web-context.xml
monitor-ui-web/src/main/resources/productdocker/jobzkcfg.yml
monitor-ui-web/src/main/webapp/jsp/dashBoard/dashBoard.jsp
monitor-ui-web/src/main/webapp/jsp/dockerLog/dockerLog.jsp
monitor-ui-web/src/main/webapp/jsp/javaApiMonitor/javaApiMonitor.jsp
monitor-ui-web/src/main/webapp/jsp/javaMonitor/javaMonitor.jsp
monitor-ui-web/src/main/webapp/jsp/javaapi/javaApi.jsp
monitor-ui-web/src/main/webapp/jsp/manager/taskConfigure.jsp
monitor-ui-web/src/main/webapp/jsp/project/docker_build.jsp
monitor-ui-web/src/main/webapp/jsp/project/docker_project.jsp
monitor-ui-web/src/main/webapp/jsp/project/internal_domain.jsp
monitor-ui-web/src/main/webapp/jsp/redisoperate/redisclear.jsp
monitor-ui-web/src/main/webapp/jsp/sqloperate/sqloperate.jsp
monitor-ui-web/src/main/webapp/jsp/switch/java_restart.jsp
monitor-ui-web/src/main/webapp/jsp/switch/switch_search.jsp
monitor-ui-web/src/main/webapp/script/common/genarate_left_panel.js
monitor-ui-common/src/main/java/com/ui/User/UserOperateEnum.java
View file @
0805830
...
...
@@ -101,6 +101,7 @@ public enum UserOperateEnum {
//docker发布
dockerBuild_mirrorAndDeploy
(
"/dockerBuild/mirrorAndDeploy"
,
"docker发布"
,
true
),
dockerBuild_rollback
(
"/dockerBuild/rollback"
,
"docker回滚"
,
true
),
dockerBuild_switchDockerNodeAz2
(
"/dockerBuild/switchDockerNodeAz2"
,
"docker-node nginx灰度环境切换"
,
true
),
outer_gitWebHook
(
"/outer/gitWebHook"
,
"docker自动发布"
,
true
),
outer_updateJenkinsStatus
(
"/outer/updateJenkinsStatus"
,
"docker工单发布更新Jenkins"
,
true
),
...
...
monitor-ui-common/src/main/java/com/ui/cloud/task/FetchAutoScalingTask.java
View file @
0805830
...
...
@@ -26,14 +26,14 @@ public class FetchAutoScalingTask {
/**
* 每5分钟取一次,时间点为0或者5结尾,与另外一个定时任务岔开
*/
@Scheduled
(
cron
=
"0/30 * * * * ?"
)
/*
@Scheduled(cron = "0/30 * * * * ?")
public void awsFetchAutoScaling() {
BaseResponse groups=autoScalingLoader.remoteLoadAutoScalingGroup(1);
if(groups==null){
logger.error("FetchAutoScalingTask awsFetchAutoScaling result is null");
}
autoScalingFactory.setAutoScalingGroups(1, groups);
}
}
*/
/**
* 每5分钟取一次,时间点为3或者8结尾,与另外一个定时任务岔开
...
...
monitor-ui-common/src/main/java/com/ui/contants/ProjectConstant.java
View file @
0805830
...
...
@@ -7,6 +7,11 @@ package com.ui.contants;
public
class
ProjectConstant
{
//左侧菜单的版本号控制
public
static
final
String
MENU_VERSION
=
"20180423-003"
;
public
static
final
String
DEPLOY_IP
=
"10.66.80.23"
;
}
...
...
monitor-ui-common/src/main/java/com/ui/project/ProjectEnvironment.java
View file @
0805830
package
com
.
ui
.
project
;
import
com.ui.contants.ProjectConstant
;
import
java.util.*
;
public
class
ProjectEnvironment
{
...
...
@@ -13,10 +15,10 @@ public class ProjectEnvironment {
private
static
Map
<
String
,
String
>
dockerProjectTypeMap
=
new
LinkedHashMap
<>();
static
{
map
.
put
(
"aws"
,
"http://172.31.16.167:8883/web/"
);
map
.
put
(
"qcloud"
,
"http://172.31.16.167:8883/web/"
);
map
.
put
(
"qcloud_gray"
,
"http://172.31.16.167:8883/web/"
);
map
.
put
(
"aws_gray"
,
"http://172.31.16.167:8883/web/"
);
map
.
put
(
"aws"
,
"http://"
+
ProjectConstant
.
DEPLOY_IP
+
":8883/web/"
);
map
.
put
(
"qcloud"
,
"http://"
+
ProjectConstant
.
DEPLOY_IP
+
":8883/web/"
);
map
.
put
(
"qcloud_gray"
,
"http://"
+
ProjectConstant
.
DEPLOY_IP
+
":8883/web/"
);
map
.
put
(
"aws_gray"
,
"http://"
+
ProjectConstant
.
DEPLOY_IP
+
":8883/web/"
);
dockerProjectTypeMap
.
put
(
"web"
,
"web"
);
dockerProjectTypeMap
.
put
(
"media"
,
"media"
);
...
...
@@ -34,7 +36,7 @@ public class ProjectEnvironment {
if
(
map
.
containsKey
(
envi
)){
return
map
.
get
(
envi
);
}
else
{
return
"http://
172.31.16.167
:8883/web/"
;
return
"http://
"
+
ProjectConstant
.
DEPLOY_IP
+
"
:8883/web/"
;
}
}
...
...
monitor-ui-common/src/main/java/com/ui/project/ProjectOnline.java
View file @
0805830
package
com
.
ui
.
project
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
public
class
ProjectOnline
{
private
static
List
<
String
>
JAVA_ENV_LIST
=
new
ArrayList
<>();
//private static List<String> JAVA_ENV_LIST_QCLOUD = Arrays.asList("qcloud", "qcloud_gray");
//private static List<String> JAVA_ENV_LIST_AWS= Arrays.asList( "aws","aws_gray");
private
final
static
String
JAVA_ENV_AWS
=
"aws,aws_gray"
;
private
final
static
String
JAVA_ENV_QCLOUD
=
"qcloud,qcloud_gray"
;
private
final
static
String
JAVA_ENV_QCLOUD_AZ2
=
"qcloudaz2"
;
private
final
static
String
JAVA_ENV_QCLOUD_AWS
=
JAVA_ENV_AWS
+
","
+
JAVA_ENV_QCLOUD
;
//默认值
public
final
static
String
JAVA_ENV_ALL
=
JAVA_ENV_AWS
+
","
+
JAVA_ENV_QCLOUD
+
","
+
JAVA_ENV_QCLOUD_AZ2
;
public
final
static
String
JAVA_ENV_ALL
=
JAVA_ENV_QCLOUD
+
","
+
JAVA_ENV_QCLOUD_AZ2
;
private
static
List
<
Project
>
JAVA_LIST
=
new
ArrayList
<>();
private
static
Map
<
String
,
Project
>
JAVA_MAP
=
new
HashMap
<>();
//private static List<Project> PHP_LIST = new ArrayList<Project>();
//private static List<Project> NODE_LIST = new ArrayList<Project>();
static
{
// java 核心服务
JAVA_LIST
.
add
(
new
Project
(
"1"
,
"yohobuy-activity"
,
"129"
,
"yoho30"
,
JAVA_ENV_ALL
,
"java 核心服务"
));
JAVA_LIST
.
add
(
new
Project
(
"1"
,
"yohobuy-wechat"
,
"248"
,
"yoho30"
,
JAVA_ENV_ALL
,
"java 核心服务"
));
JAVA_LIST
.
add
(
new
Project
(
"1"
,
"yoho-sns"
,
"125"
,
"yoho30"
,
JAVA_ENV_ALL
,
"java 核心服务"
));
JAVA_LIST
.
add
(
new
Project
(
"1"
,
"yoho-erp-gateway"
,
"977"
,
"yoho30"
,
JAVA_ENV_ALL
,
"java 核心服务"
));
JAVA_LIST
.
add
(
new
Project
(
"1"
,
"yoho-message"
,
"123"
,
"yoho30"
,
"aws,qcloud,qcloud_gray,"
+
JAVA_ENV_QCLOUD_AZ2
,
"java 核心服务"
));
JAVA_LIST
.
add
(
new
Project
(
"1"
,
"yoho-message"
,
"123"
,
"yoho30"
,
JAVA_ENV_ALL
,
"java 核心服务"
));
JAVA_LIST
.
add
(
new
Project
(
"1"
,
"uic"
,
"439"
,
"yoho30"
,
JAVA_ENV_ALL
,
"java 核心服务"
));
JAVA_LIST
.
add
(
new
Project
(
"1"
,
"yoho-users"
,
"134"
,
"yoho30"
,
JAVA_ENV_ALL
,
"java 核心服务"
));
JAVA_LIST
.
add
(
new
Project
(
"1"
,
"yohobuy-resources"
,
"122"
,
"yoho30"
,
JAVA_ENV_ALL
,
"java 核心服务"
));
...
...
@@ -68,13 +62,14 @@ public class ProjectOnline {
JAVA_LIST
.
add
(
new
Project
(
"2"
,
"yoho-search-service"
,
"12"
,
"yoho-search"
,
"aws,qcloud,"
+
JAVA_ENV_QCLOUD_AZ2
,
""
));
JAVA_LIST
.
add
(
new
Project
(
"2"
,
"yoho-search-consumer"
,
"8"
,
"yoho-search"
,
"aws,qcloud,"
+
JAVA_ENV_QCLOUD_AZ2
,
""
));
JAVA_LIST
.
add
(
new
Project
(
"2"
,
"yoho-search-producer"
,
"7"
,
"yoho-search"
,
"aws,qcloud,"
+
JAVA_ENV_QCLOUD_AZ2
,
""
));
JAVA_LIST
.
add
(
new
Project
(
"2"
,
"yohomars-search-service"
,
"554"
,
"yoho-search"
,
JAVA_ENV_QCLOUD_AWS
,
""
));
JAVA_LIST
.
add
(
new
Project
(
"2"
,
"yoho-search-adaptor"
,
"13"
,
"yoho-search"
,
"aws,qcloud"
,
""
));
JAVA_LIST
.
add
(
new
Project
(
"2"
,
"yoho-search-service"
,
"12"
,
"yoho-search"
,
"qcloud,"
+
JAVA_ENV_QCLOUD_AZ2
,
""
));
JAVA_LIST
.
add
(
new
Project
(
"2"
,
"yoho-search-consumer"
,
"8"
,
"yoho-search"
,
"qcloud,"
+
JAVA_ENV_QCLOUD_AZ2
,
""
));
JAVA_LIST
.
add
(
new
Project
(
"2"
,
"yoho-search-producer"
,
"7"
,
"yoho-search"
,
"qcloud,"
+
JAVA_ENV_QCLOUD_AZ2
,
""
));
JAVA_LIST
.
add
(
new
Project
(
"2"
,
"yoho-search-adaptor"
,
"13"
,
"yoho-search"
,
"qcloud,"
+
JAVA_ENV_QCLOUD_AZ2
,
""
));
JAVA_LIST
.
add
(
new
Project
(
"2"
,
"yohomars-search-service"
,
"554"
,
"yoho-search"
,
JAVA_ENV_QCLOUD
,
""
));
JAVA_LIST
.
add
(
new
Project
(
"3"
,
"yohobuy-platform"
,
"110"
,
"platform"
,
JAVA_ENV_QCLOUD
_AWS
,
""
));
JAVA_LIST
.
add
(
new
Project
(
"3"
,
"yohobuy-platform"
,
"110"
,
"platform"
,
JAVA_ENV_QCLOUD
,
""
));
//把list转成map,放到最后
JAVA_MAP
=
JAVA_LIST
.
stream
().
collect
(
Collectors
.
toMap
(
Project:
:
getName
,
Project
->
Project
));
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/AutoScalingCtrl.java
View file @
0805830
...
...
@@ -9,6 +9,7 @@ import com.ui.cloud.QcloudModifyScalingGroupReq;
import
com.ui.cloud.model.AutoScalingGroup
;
import
com.ui.cloud.task.AutoScalingFactory
;
import
com.ui.contants.HttpUriContants
;
import
com.ui.contants.ProjectConstant
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.AutoScalingInfoReq
;
import
com.ui.model.BaseResponse
;
...
...
@@ -46,8 +47,8 @@ public class AutoScalingCtrl {
@Autowired
private
AutoScalingFactory
autoScalingFactory
;
private
String
DEPLOY_URL
=
"http://172.31.16.167:8883/"
;
private
String
NODE_DEPLOY_URL
=
"http://172.31.16.167:8883/node/"
;
private
String
DEPLOY_URL
=
"http://"
+
ProjectConstant
.
DEPLOY_IP
+
":8883/"
;
private
String
NODE_DEPLOY_URL
=
"http://"
+
ProjectConstant
.
DEPLOY_IP
+
":8883/node/"
;
private
Map
<
String
,
BaseResponse
>
msgMap
=
new
HashMap
<>();
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/DockerBuildCtrl.java
View file @
0805830
...
...
@@ -73,7 +73,7 @@ public class DockerBuildCtrl {
public
ModelAndView
toBuildView
(
Model
model
,
String
project_id
,
String
project_name
,
String
environment_name
,
String
clusters_name
,
String
clusters_text
,
String
operate_name
,
String
branch_name
,
String
rollbackImageStore
,
String
workid_name
,
String
buildIds
,
String
failMsg
,
HttpSession
session
)
{
String
workid_name
,
String
buildIds
,
String
failMsg
,
HttpSession
session
,
String
az2AutoSwitchOnlineCheck
)
{
List
<
Map
<
String
,
String
>>
buildInfoList
=
new
ArrayList
<>();
Map
mapIds
=
new
HashMap
<>();
mapIds
.
put
(
"ids"
,
project_id
);
...
...
@@ -101,6 +101,12 @@ public class DockerBuildCtrl {
buildInfoList
.
add
(
map
);
}
model
.
addAttribute
(
"az2AutoSwitchOnlineCheck"
,
StringUtils
.
isBlank
(
az2AutoSwitchOnlineCheck
)?
""
:
az2AutoSwitchOnlineCheck
);
if
(
StringUtils
.
isNotBlank
(
az2AutoSwitchOnlineCheck
)){
model
.
addAttribute
(
"az2AutoSwitchOnlineCheck_project"
,
project_name
);
}
else
{
model
.
addAttribute
(
"az2AutoSwitchOnlineCheck_project"
,
""
);
}
model
.
addAttribute
(
"environment_name"
,
environment_name
);
model
.
addAttribute
(
"clusters_name"
,
clusters_name
);
...
...
@@ -117,6 +123,31 @@ public class DockerBuildCtrl {
}
/**
* 把node项目的az2区域切换到gray
*
* @return
*/
@RequestMapping
(
value
=
"/switchDockerNodeAz2"
)
@ResponseBody
public
BaseResponse
switchDockerNodeAz2
(
String
project_name
,
String
onlineOrGray
)
{
String
projectType
;
if
(
"yohoblk-wap"
.
equals
(
project_name
)){
projectType
=
"blk"
;
}
else
if
(
"yohobuywap-node"
.
equals
(
project_name
)){
projectType
=
"wap"
;
}
else
if
(
"yohobuy-node"
.
equals
(
project_name
)){
projectType
=
"pc"
;
}
else
{
return
new
BaseResponse
(
201
,
"不支持参数:"
+
project_name
);
}
Map
map
=
new
HashMap
<>();
map
.
put
(
"projectType"
,
projectType
);
map
.
put
(
"onlineOrGray"
,
onlineOrGray
);
BaseResponse
response
=
httpRestClient
.
defaultGet
(
"/pch5DockerSwitch/switchDockerAz2"
,
BaseResponse
.
class
,
map
);
return
response
;
}
/**
* 获取所有项目
*
* @return
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/NodeBuildCtrl.java
View file @
0805830
package
com
.
ui
.
ctrl
;
import
com.ui.contants.HttpUriContants
;
import
com.ui.contants.ProjectConstant
;
import
com.ui.ctrl.util.ReleaseCheck
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.BaseResponse
;
...
...
@@ -40,7 +41,7 @@ public class NodeBuildCtrl {
private
final
String
AZ2_Auto_Switch_Online_CHECK
=
"az2AutoSwitchOnlineCheck"
;
private
String
URL
=
"http://
172.31.16.167
:8883/node/"
;
private
String
URL
=
"http://
"
+
ProjectConstant
.
DEPLOY_IP
+
"
:8883/node/"
;
@RequestMapping
(
"/toProject"
)
public
ModelAndView
toProject
(
Model
model
,
String
workJobId
)
{
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/NodeMonitorCtrl.java
View file @
0805830
package
com
.
ui
.
ctrl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.ui.contants.ProjectConstant
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.BaseResponse
;
import
com.ui.model.domain.PythonEnv
;
...
...
@@ -27,7 +28,7 @@ public class NodeMonitorCtrl {
@Autowired
private
HttpRestClient
httpRestClient
;
private
String
NODE_URL
=
"http://
172.31.16.167
:8883/node/"
;
private
String
NODE_URL
=
"http://
"
+
ProjectConstant
.
DEPLOY_IP
+
"
:8883/node/"
;
// private String NODE_URL = "http://127.0.0.1:8883/node/";
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/OuterIntfCtrl.java
View file @
0805830
...
...
@@ -10,6 +10,7 @@ import com.ui.model.MonitAlarmInfo;
import
com.ui.model.WebHooksReleaseBO
;
import
com.ui.model.alarm.CommonAlarmData
;
import
com.ui.model.alarm.CommonData
;
import
com.ui.model.domain.QcloudSmsUp
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.math.NumberUtils
;
...
...
@@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
/**
...
...
@@ -36,6 +38,8 @@ import java.util.*;
@RequestMapping
(
"/outer"
)
public
class
OuterIntfCtrl
{
SimpleDateFormat
time
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Logger
log
=
LoggerFactory
.
getLogger
(
OuterIntfCtrl
.
class
);
@Autowired
...
...
@@ -220,7 +224,6 @@ public class OuterIntfCtrl {
@RequestMapping
(
"/bigDataKeyInfoReport"
)
@ResponseBody
public
BaseResponse
bigDataKeyInfoReport
(
@RequestBody
com
.
alibaba
.
fastjson
.
JSONObject
jsonObject
)
throws
Exception
{
log
.
info
(
"bigDataKeyInfoReport content is {}"
,
jsonObject
);
return
httpClient
.
defaultPost
(
"/bigdata/bigDataKeyInfoReport"
,
jsonObject
,
BaseResponse
.
class
);
}
...
...
@@ -341,4 +344,26 @@ public class OuterIntfCtrl {
return
new
BaseResponse
();
}
/**
*短信收到后确定
*/
@RequestMapping
(
"/smsConfirm"
)
@ResponseBody
public
BaseResponse
smsConfirm
()
{
QcloudSmsUp
qcloudSmsUp
=
new
QcloudSmsUp
();
qcloudSmsUp
.
setMobile
(
"188888888"
);
qcloudSmsUp
.
setText
(
"confirm"
);
qcloudSmsUp
.
setSign
(
"YOHO运维"
);
//qcloudSmsUp.setTime(time.format(new Date()));
httpClient
.
defaultPost
(
"/smsup/smsUp"
,
qcloudSmsUp
,
BaseResponse
.
class
);
return
new
BaseResponse
();
}
@RequestMapping
(
"/collectNginxAgentLog"
)
@ResponseBody
public
BaseResponse
collectNginxAgentLog
(
@RequestBody
com
.
alibaba
.
fastjson
.
JSONObject
jsonObject
)
throws
Exception
{
log
.
info
(
"collectNginxAgentLog content is {}"
,
jsonObject
);
return
httpClient
.
defaultPost
(
"/nginxsync/collectNginxAgentLog"
,
jsonObject
,
BaseResponse
.
class
);
}
}
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/PhpBuildCtrl.java
View file @
0805830
package
com
.
ui
.
ctrl
;
import
com.ui.contants.HttpUriContants
;
import
com.ui.contants.ProjectConstant
;
import
com.ui.ctrl.util.ReleaseCheck
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.BaseResponse
;
...
...
@@ -35,7 +36,7 @@ public class PhpBuildCtrl {
@Autowired
private
ReleaseCheck
releaseCheck
;
private
String
URL
=
"http://
172.31.16.167
:8883/php/"
;
private
String
URL
=
"http://
"
+
ProjectConstant
.
DEPLOY_IP
+
"
:8883/php/"
;
//private String URL = "http://127.0.0.1:8883/php/";
@RequestMapping
(
"/toProject"
)
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/ProjectBuildCtrl.java
View file @
0805830
...
...
@@ -227,7 +227,7 @@ public class ProjectBuildCtrl {
* 修改人:craig.qin
*
* 最终执行的方法是 project-boot 工程里的JavaBuildCtrl(web) -> build.do
* 执行的ip是http:/
/172.31.16.167:8883/web/
* 执行的ip是http:/
* @return
*/
@RequestMapping
(
value
=
"build"
,
method
=
RequestMethod
.
POST
)
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/SmsUpctrl.java
deleted
100644 → 0
View file @
be72391
package
com
.
ui
.
ctrl
;
import
com.alibaba.fastjson.JSON
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.BaseResponse
;
import
com.ui.model.domain.QcloudSmsUp
;
import
com.ui.model.domain.QcloudSmsUpResp
;
import
com.ui.model.domain.QcloudVoiceUp
;
import
com.ui.model.req.SmsUp
;
import
org.apache.http.Header
;
import
org.apache.http.HttpRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.util.Map
;
/**
* Created by zhengyouwei on 2016/12/16.
*/
@Controller
public
class
SmsUpctrl
{
public
final
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
@Autowired
private
HttpRestClient
httpRestClient
;
/**
* 语音上行
*
* @param qcloudVoiceUp
* @return
*/
@RequestMapping
(
"/deliverMessageVoice"
)
@ResponseBody
public
QcloudSmsUpResp
voiceUp
(
@RequestBody
QcloudVoiceUp
qcloudVoiceUp
)
{
logger
.
info
(
"qcloud voice up {}"
,
JSON
.
toJSONString
(
qcloudVoiceUp
));
httpRestClient
.
defaultPost
(
"/smsup/voiceUp"
,
qcloudVoiceUp
,
BaseResponse
.
class
);
return
new
QcloudSmsUpResp
(
0
,
""
);
}
/**
* 短信上行
*
* @return
*/
@RequestMapping
(
"/deliverMessagetxt"
)
@ResponseBody
public
QcloudSmsUpResp
smsUp
(
@RequestBody
QcloudSmsUp
qcloudSmsUp
)
{
logger
.
info
(
"qcloud sms up {}"
,
JSON
.
toJSONString
(
qcloudSmsUp
));
httpRestClient
.
defaultPost
(
"/smsup/smsUp"
,
qcloudSmsUp
,
BaseResponse
.
class
);
return
new
QcloudSmsUpResp
(
0
,
""
);
}
}
monitor-ui-ctrl/src/main/java/com/ui/ctrl/WorkSystemCtrl.java
View file @
0805830
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ui.contants.HttpUriContants
;
import
com.ui.contants.ProjectConstant
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.BaseResponse
;
import
com.ui.model.domain.DockerProjectModel
;
...
...
@@ -111,7 +112,7 @@ public class WorkSystemCtrl {
if
(
Platform
.
JAVA
.
equals
(
platform
))
{
return
ProjectOnline
.
getJavaList
();
}
else
if
(
Platform
.
PHP
.
equals
(
platform
))
{
String
result
=
httpRestClient
.
get
(
"http://
172.31.16.167
:8883/php/getProjects"
,
String
.
class
,
null
);
String
result
=
httpRestClient
.
get
(
"http://
"
+
ProjectConstant
.
DEPLOY_IP
+
"
:8883/php/getProjects"
,
String
.
class
,
null
);
return
JSON
.
parseObject
(
result
,
List
.
class
);
}
else
if
(
Platform
.
NODE
.
equals
(
platform
))
{
String
result
=
nodeBuildCtrl
.
getProjects
();
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/app/AppNodeBuildCtrl.java
View file @
0805830
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import
com.ui.app.common.ErrorCode
;
import
com.ui.app.req.*
;
import
com.ui.app.resp.NodeBuildState
;
import
com.ui.contants.ProjectConstant
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.BaseResponse
;
import
com.ui.model.domain.BuildMessage
;
...
...
@@ -37,7 +38,7 @@ public class AppNodeBuildCtrl {
@Autowired
private
HttpRestClient
httpClient
;
private
String
NODE_URL
=
"http://
172.31.16.167
:8883/node/"
;
private
String
NODE_URL
=
"http://
"
+
ProjectConstant
.
DEPLOY_IP
+
"
:8883/node/"
;
/**
* 获取项目列表
...
...
monitor-ui-ctrl/src/main/java/com/ui/ctrl/app/AppPhpBuildCtrl.java
View file @
0805830
...
...
@@ -6,6 +6,7 @@ import com.ui.app.common.ErrorCode;
import
com.ui.app.req.*
;
import
com.ui.app.resp.NodeBuildResp
;
import
com.ui.app.resp.NodeBuildState
;
import
com.ui.contants.ProjectConstant
;
import
com.ui.http.HttpRestClient
;
import
com.ui.model.BaseResponse
;
import
com.ui.model.domain.BuildMessage
;
...
...
@@ -37,7 +38,7 @@ public class AppPhpBuildCtrl {
@Autowired
private
HttpRestClient
httpClient
;
private
String
PHP_URL
=
"http://
172.31.16.167
:8883/php/"
;
private
String
PHP_URL
=
"http://
"
+
ProjectConstant
.
DEPLOY_IP
+
"
:8883/php/"
;
/**
* 获取项目列表
...
...
monitor-ui-web/src/main/resources/META-INF/spring/spring-web-context.xml
View file @
0805830
...
...
@@ -79,7 +79,6 @@
<!-- 登录验证 -->
<mvc:interceptor>
<mvc:mapping
path=
"/**"
/>
<mvc:exclude-mapping
path=
"/bigdata/**"
/>
<mvc:exclude-mapping
path=
"/hystrix/**"
/>
<mvc:exclude-mapping
path=
"/user/**"
/>
<mvc:exclude-mapping
path=
"/img/**"
/>
...
...
@@ -90,8 +89,6 @@
<mvc:exclude-mapping
path=
"/sql_format/**"
/>
<mvc:exclude-mapping
path=
"/dashboard/**"
/>
<mvc:exclude-mapping
path=
"/app_**/**"
/>
<mvc:exclude-mapping
path=
"/deliverMessageVoice/**"
/>
<mvc:exclude-mapping
path=
"/deliverMessagetxt/**"
/>
<mvc:exclude-mapping
path=
"/systemTest/**"
/>
<mvc:exclude-mapping
path=
"/recvMonitAlarm"
/>
<mvc:exclude-mapping
path=
"/awsapi/sns"
/>
...
...
monitor-ui-web/src/main/resources/productdocker/jobzkcfg.yml
View file @
0805830
cluster_aws
:
name
:
aws_zkAddress
connectString
:
172.31.50.193:2181,172.31.50.191:2181,172.31.50.192:2181,172.31.50.190:2181,172.31.50.194:2181
cluster_qcloud
:
name
:
qcloud_zkAddress
connectString
:
10.66.4.3:2181,10.66.4.4:2181,10.66.4.5:2181,10.66.4.8:2181,10.66.4.9:2181
cluster_qcloudaz2
:
name
:
qcloudaz2_zkAddress
connectString
:
10.66.105.4:2181,10.66.105.12:2181,10.66.105.37:2181,10.66.105.30:2181,10.66.105.47:2181
cluster_platform
:
name
:
platform_zkAddress
connectString
:
10.66.50.140:2181
...
...
monitor-ui-web/src/main/webapp/jsp/dashBoard/dashBoard.jsp
View file @
0805830
...
...
@@ -113,4 +113,8 @@
<script
src=
"<%=basePath %>script/common/genarate_left_panel.js?v=<%=ProjectConstant.MENU_VERSION %>"
></script>
<script
type=
"text/javascript"
>
$
(
"#li_dashboard"
).
addClass
(
"active"
);
if
(
"admin"
==
"${sessionScope.user.name}"
){
$
(
"#changepwd_a"
).
show
();
}
</script>
...
...
monitor-ui-web/src/main/webapp/jsp/dockerLog/dockerLog.jsp
View file @
0805830
...
...
@@ -365,7 +365,7 @@
for
(
var
i
in
logData
){
var
html
=
"<tr>"
+
"<td style='width: 25%'>Time: "
+
logData
[
i
].
timestamp
+
"</br>Topic name: "
+
logData
[
i
].
topic_name
+
"</br>Source: "
+
logData
[
i
].
source
+
"</br>Filename: "
+
logData
[
i
].
fileName
+
"</td>"
+
"<td style='width: 75%
'
> "
+
logData
[
i
].
content
+
"</td></tr>"
;
"<td style='width: 75%
;word-wrap: break-word; word-break:break-all;'
> "
+
logData
[
i
].
content
+
"</td></tr>"
;
logtableBodyHtml
+=
html
;
}
if
(
logtableBodyHtml
==
""
){
...
...
monitor-ui-web/src/main/webapp/jsp/javaApiMonitor/javaApiMonitor.jsp
View file @
0805830
...
...
@@ -35,20 +35,27 @@
</div>
<div
class=
"widget-content nopadding"
>
<div
class=
"widget-title"
style=
"height: 400px;"
>
<div
class=
"col-sm-5 control-label"
role=
"form"
id=
"chartterDiv"
<
%--
<
div
class=
"col-sm-5 control-label"
role=
"form"
id=
"chartterDiv"
style=
" margin-top: 12px;margin-left: 10px;"
>
<div
id=
"costAwsCharts"
class=
"input-group"
style=
"height: 380px;width: 760px"
>
</div>
</div>
</div>
--%>
<div
class=
"col-sm-5 control-label"
role=
"form"
id=
"chartterDiv1"
style=
" margin-top: 12px;margin-left: 25px;float: left;"
>
<div
id=
"costQcloudCharts"
class=
"input-group"
style=
"height: 380px;width: 760px;margin-left: 100px"
>
</div>
</div>
<div
class=
"col-sm-5 control-label"
role=
"form"
id=
"chartterDiv4"
style=
" margin-top: 12px;margin-left: 25px;float: left;"
>
<div
id=
"timesQcloudCharts"
class=
"input-group"
style=
"height: 380px;width: 760px;margin-left: 100px"
>
</div>
</div>
</div>
<div
class=
"widget-title"
style=
"height: 400px;"
>
<
%--
<
div
class=
"widget-title"
style=
"height: 400px;"
>
<div
class=
"col-sm-5 control-label"
role=
"form"
id=
"chartterDiv3"
style=
" margin-top: 12px;margin-left: 10px;"
>
<div
id=
"timesAwsCharts"
class=
"input-group"
style=
"height: 380px;width: 760px"
>
...
...
@@ -60,7 +67,7 @@
style=
"height: 380px;width: 760px;margin-left: 100px"
>
</div>
</div>
</div>
</div>
--%>
</div>
</div>
...
...
@@ -252,9 +259,9 @@
$
(
function
()
{
//更新曲线图
getLineDate
(
1
,
1
);
//
getLineDate(1, 1);
getLineDate
(
1
,
2
);
getLineDate
(
2
,
1
);
//
getLineDate(2, 1);
getLineDate
(
2
,
2
);
// $("#searchApiName").select({
...
...
monitor-ui-web/src/main/webapp/jsp/javaMonitor/javaMonitor.jsp
View file @
0805830
...
...
@@ -35,18 +35,28 @@
</div>
<div
class=
"widget-content nopadding"
>
<div
class=
"widget-title"
style=
"height: 400px;"
>
<
%--
<div
class=
"col-sm-5 control-label"
role=
"form"
id=
"chartterDiv"
style=
" margin-top: 12px;margin-left: 10px;"
>
<div
id=
"costAwsCharts"
class=
"input-group"
style=
"height: 380px;width: 760px"
>
</div>
</div>
--%>
<div
class=
"col-sm-5 control-label"
role=
"form"
id=
"chartterDiv1"
style=
" margin-top: 12px;margin-left: 25px;float: left;"
>
<div
id=
"costQcloudCharts"
class=
"input-group"
style=
"height: 380px;width: 760px;margin-left: 100px"
>
</div>
</div>
<div
class=
"col-sm-5 control-label"
role=
"form"
id=
"chartterDiv4"
style=
" margin-top: 12px;margin-left: 25px;float: left;"
>
<div
id=
"timesQcloudCharts"
class=
"input-group"
style=
"height: 380px;width: 760px;margin-left: 100px"
>
</div>
</div>
</div>
<
%--
<div
class=
"widget-title"
style=
"height: 400px;"
>
<div
class=
"col-sm-5 control-label"
role=
"form"
id=
"chartterDiv3"
...
...
@@ -61,6 +71,7 @@
</div>
</div>
</div>
--%>
</div>
</div>
...
...
@@ -234,10 +245,10 @@
json2
.
series
=
qcData
;
if
(
type
==
1
)
{
$
(
'#costAwsCharts'
).
highcharts
(
json1
);
//
$('#costAwsCharts').highcharts(json1);
$
(
'#costQcloudCharts'
).
highcharts
(
json2
);
}
else
{
$
(
'#timesAwsCharts'
).
highcharts
(
json1
);
//
$('#timesAwsCharts').highcharts(json1);
$
(
'#timesQcloudCharts'
).
highcharts
(
json2
);
}
}
...
...
monitor-ui-web/src/main/webapp/jsp/javaapi/javaApi.jsp
View file @
0805830
...
...
@@ -79,17 +79,6 @@
</div>
<div
class=
"widget-content"
>
<div
class=
"row api_info_container"
>
<
%--
<div
class=
"api_info_item col-xs-3 "
>
--%>
<
%--
<div
class=
"panel panel-default"
>
--%>
<
%--
<div
class=
"panel-heading"
>
gateway
</div>
--%>
<
%--
<div
class=
"panel-body"
>
--%>
<
%--
<h3><span
class=
"label label-default"
>
AWS状态
</span>
--%>
<
%--
<span
class=
"label label-default"
>
Gcloud状态
</span>
--%>
<
%--
</h3>
--%>
<
%--
<span>
更新时间
</span>
--%>
<
%--
</div>
--%>
<
%--
</div>
--%>
<
%--
</div>
--%>
</div>
</div>
</div>
...
...
@@ -133,7 +122,7 @@
var
api_info_item_panel
=
$
(
' <div class="panel panel-default">'
);
var
api_info_item_panel_title
=
$
(
'<div class="item_java_api_title panel-heading">'
+
val
.
typeName
+
'<span style="font-size: medium;float: right;padding-top: 15px"><span id="span_time_'
+
val
.
typeId
+
'"></span></span></div>'
);
var
api_info_item_panel_body
=
$
(
'<div class="panel-body">'
);
api_info_item_panel_body
.
append
(
'<button class="btn_java_api btn btn-lg btn-default" id="btn_1_1_'
+
val
.
typeId
+
'">AWS <span class="badge"></span></button>'
);
//
api_info_item_panel_body.append('<button class="btn_java_api btn btn-lg btn-default" id="btn_1_1_' + val.typeId + '">AWS <span class="badge"></span></button>');
api_info_item_panel_body
.
append
(
'<button class="btn_java_api btn btn-lg btn-default" id="btn_2_21_'
+
val
.
typeId
+
'">QCloud <span class="badge"></span></button>'
);
api_info_item_panel_body
.
append
(
'<button class="btn_java_api btn btn-lg btn-default" id="btn_2_22_'
+
val
.
typeId
+
'">QCloudaz2 <span class="badge"></span></button>'
);
api_info_item_panel_body
.
append
(
'<button class="btn_java_api btn btn-lg btn-default" id="btn_0_0_'
+
val
.
typeId
+
'">Custom <span class="badge"></span></button>'
);
...
...
monitor-ui-web/src/main/webapp/jsp/manager/taskConfigure.jsp
View file @
0805830
...
...
@@ -221,8 +221,9 @@
<select
class=
"form-control"
id=
"alarmType"
name=
"alarmType"
style=
"width:300px"
>
<option
value=
3
>
单个influxdb超过阈值则告警
</option>
<option
value=
1
>
单个influxdb未出现想要的数据则告警
</option>
<option
value=
2
>
多个influxdb都未出现想要的数据
则告警
</option>
<option
value=
5
>
单个influxdb未出现或者次数小于阈值
则告警
</option>
<option
value=
4
>
出现则告警,且单条记录单独告警
</option>
<option
value=
2
>
多个influxdb都未出现想要的数据则告警
</option>
</select>
<
%--
<input
type=
"text"
class=
"form-control"
id=
"alarmType"
name=
"alarmType"
...
...
@@ -363,6 +364,8 @@
return
"单个influxdb超过阈值则告警"
;
}
else
if
(
rowData
.
alarmType
==
4
){
return
"出现则告警,且单条记录单独告警"
}
else
if
(
rowData
.
alarmType
==
5
){
return
"单个influxdb未出现或者次数小于阈值则告警"
}
return
rowData
.
alarmType
;
}
...
...
monitor-ui-web/src/main/webapp/jsp/project/docker_build.jsp
View file @
0805830
...
...
@@ -84,6 +84,9 @@
<div>
<div
class=
"form-inline"
role=
"form"
style=
" margin-top: 12px;margin-left: 25px;float: left;"
>
<!-- 用来判断az2是否需要切换到online-->
<input
type=
"hidden"
id=
"az2AutoSwitchOnlineCheck"
readonly=
"readonly"
value=
"${az2AutoSwitchOnlineCheck}"
/>
<input
type=
"hidden"
id=
"az2AutoSwitchOnlineCheck_project"
readonly=
"readonly"
value=
"${az2AutoSwitchOnlineCheck_project}"
/>
<div
class=
"input-group"
style=
"float: left;"
>
<span
class=
"input-group-addon"
>
操作:
</span>
<input
type=
"text"
id=
"operate_name"
name=
"operate_name"
class=
"form-control"
...
...
@@ -307,6 +310,50 @@
if
(
data
.
data
!=
null
&&
data
.
data
.
result
==
true
){
clearInterval
(
intervalIndex
);
writeToText
(
textareaId
,
"查询服务启动完成..........over!"
);
if
(
"az2AutoSwitchOnlineCheck"
==
$
(
"#az2AutoSwitchOnlineCheck"
).
val
()){
writeToText
(
textareaId
,
"gray环境发布master分支完成,开始关闭灰度!"
);
//自动切换到online
var
dialog
=
$
(
"<div>"
).
appendTo
(
$
(
"body"
));
dialog
.
dialog
({
title
:
"关闭灰度"
,
backdrop
:
"static"
,
content
:
"gray环境发布master分支完成,开始关闭灰度,确定关闭?"
,
buttons
:
[{
text
:
"否"
,
className
:
"btn-danger"
,
onclick
:
function
()
{
dialog
.
dialog
(
"hide"
);
}
},
{
text
:
"是"
,
className
:
"btn-success"
,
onclick
:
function
()
{
dialog
.
dialog
(
"hide"
);
$
.
ajax
({
type
:
"post"
,
url
:
contextPath
+
"/dockerBuild/switchDockerNodeAz2"
,
data
:
{
project_name
:
$
(
"#az2AutoSwitchOnlineCheck_project"
).
val
(),
onlineOrGray
:
"online"
},
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
code
==
200
){
writeToText
(
textareaId
,
"已关闭灰度!"
);
}
else
{
localAlert
(
"错误"
,
"关闭灰度失败:"
+
resp
.
message
);
}
},
error
:
function
(){
localAlert
(
"错误"
,
"关闭灰度环境异常"
);
}
});
}
}]
});
}
}
else
{
writeToText
(
textareaId
,
"............查询次数............"
+
count
+
"......当前状态---->"
+
data
.
data
.
resultMessage
);
}
...
...
monitor-ui-web/src/main/webapp/jsp/project/docker_project.jsp
View file @
0805830
...
...
@@ -232,6 +232,8 @@
<script
src=
"<%=basePath%>js/select2.min.js"
></script>
<script
src=
"<%=basePath%>js/custom.js"
></script>
<script
src=
"<%=basePath %>/js/unicorn.js"
></script>
<script
src=
"<%=basePath %>js/layer/v311/layer.js"
type=
"text/javascript"
></script>
<script
src=
"<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js"
charset=
"UTF-8"
type=
"text/javascript"
></script>
<script
src=
"<%=basePath %>script/common/genarate_left_panel.js?v=<%=ProjectConstant.MENU_VERSION %>"
></script>
<script
type=
"text/javascript"
>
$
(
"#li_project"
).
addClass
(
"active open"
);
...
...
@@ -580,7 +582,7 @@
function
deployOrRollback
()
{
var
operate
=
$
(
"input[name='operate']:checked"
).
val
();
if
(
"Deploy"
==
operate
)
{
//发布
mirrorAnd
Deploy
();
begin
Deploy
();
}
else
{
rollback
();
}
...
...
@@ -623,19 +625,18 @@
});
}
function
mirrorAndDeploy
()
{
function
mirrorAndDeploy
(
param
)
{
$
(
"#confirmBtn"
).
attr
(
"disabled"
,
"disabled"
);
$
(
"#cancelBtn"
).
attr
(
"disabled"
,
"disabled"
);
var
param
=
{};
param
.
operate_name
=
$
(
"input[name='operate_name']"
).
val
();
param
.
project_id
=
$
(
"input[name='project_id']"
).
val
();
param
.
project_name
=
$
(
"input[name='project_name']"
).
val
();
param
.
environment_name
=
$
(
"input[name='environment_name']"
).
val
();
param
.
branch_name
=
$
(
"input[name='branch_name']"
).
val
();
param
.
workid_name
=
$
(
"input[name='workid_name']"
).
val
();
param
.
clusters_name
=
$
(
"input[name='clusters_name']"
).
val
();
param
.
clusters_text
=
$
(
"input[name='clusters_text']"
).
val
();
var
layerMirror
=
layer
.
open
(
{
type
:
3
,
//area: ['800px', '500px'],
content
:
"镜像制作中"
,
time
:
0
//不自动关闭
});
$
.
ajax
({
url
:
contextPath
+
"dockerBuild/mirrorAndDeploy"
,
type
:
"post"
,
...
...
@@ -648,6 +649,7 @@
param
.
failMsg
=
response
.
message
;
GobalStandardPost
(
contextPath
+
"dockerBuild/toBuildView"
,
param
);
}
else
{
layer
.
close
(
layerMirror
);
//失败
if
(
response
==
null
){
mirrorFail
(
"制作镜像失败!"
);
...
...
@@ -658,11 +660,90 @@
}
},
error
:
function
(
e
)
{
layer
.
close
(
layerMirror
);
mirrorFail
(
e
);
}
});
}
function
beginDeploy
(){
var
param
=
{};
param
.
operate_name
=
$
(
"input[name='operate_name']"
).
val
();
param
.
project_id
=
$
(
"input[name='project_id']"
).
val
();
param
.
project_name
=
$
(
"input[name='project_name']"
).
val
();
param
.
environment_name
=
$
(
"input[name='environment_name']"
).
val
();
param
.
branch_name
=
$
(
"input[name='branch_name']"
).
val
();
param
.
workid_name
=
$
(
"input[name='workid_name']"
).
val
();
param
.
clusters_name
=
$
(
"input[name='clusters_name']"
).
val
();
param
.
clusters_text
=
$
(
"input[name='clusters_text']"
).
val
();
//三个node项目发布灰度环境时,如果发master分支,自动加到online,如果非master分支,自动断开
param
.
az2AutoSwitchOnlineCheck
=
""
;
if
(
param
.
environment_name
.
indexOf
(
"gray"
)
>
0
&&
(
"yohoblk-wap"
==
param
.
project_name
||
"yohobuywap-node"
==
param
.
project_name
||
"yohobuy-node"
==
param
.
project_name
)){
$
(
'#confirmSubmitDivId'
).
modal
(
'hide'
);
var
dialog
=
$
(
"<div>"
).
appendTo
(
$
(
"body"
));
var
alertContent
=
"发布开始前会自动启用az2-"
+
param
.
project_name
+
"灰度环境,确定发布?"
;
if
(
"master"
==
param
.
branch_name
){
alertContent
=
"发布成功后会自动关闭az2-"
+
param
.
project_name
+
"灰度环境,确定发布?"
;
param
.
az2AutoSwitchOnlineCheck
=
"az2AutoSwitchOnlineCheck"
;
}
dialog
.
dialog
({
title
:
"你确定执行发布吗"
,
backdrop
:
"static"
,
content
:
alertContent
,
buttons
:
[{
text
:
"否"
,
className
:
"btn-danger"
,
onclick
:
function
()
{
dialog
.
dialog
(
"hide"
);
$
(
'#confirmSubmitDivId'
).
modal
(
'show'
);
}
},
{
text
:
"是"
,
className
:
"btn-success"
,
onclick
:
function
()
{
dialog
.
dialog
(
"hide"
);
var
layerSwitch
=
layer
.
open
(
{
type
:
3
,
//area: ['800px', '500px'],
content
:
" 切换中"
,
time
:
0
//不自动关闭
});
$
.
ajax
({
type
:
"post"
,
url
:
contextPath
+
"/dockerBuild/switchDockerNodeAz2"
,
data
:
{
project_name
:
param
.
project_name
,
onlineOrGray
:
"gray"
},
dataType
:
"json"
,
success
:
function
(
resp
){
layer
.
close
(
layerSwitch
);
if
(
resp
.
code
==
200
){
mirrorAndDeploy
(
param
);
}
else
{
localAlert
(
"错误"
,
"az2切换灰度环境失败:"
+
resp
.
message
);
}
},
error
:
function
(){
layer
.
close
(
layerSwitch
);
localAlert
(
"错误"
,
"az2切换灰度环境异常"
);
}
});
}
}]
});
}
else
{
mirrorAndDeploy
(
param
);
}
}
function
mirrorFail
(
msg
)
{
console
.
log
(
msg
);
$
(
"#confirmBtn"
).
removeAttr
(
"disabled"
);
...
...
monitor-ui-web/src/main/webapp/jsp/project/internal_domain.jsp
View file @
0805830
...
...
@@ -92,8 +92,11 @@
</li>
<li
id=
"yohoops-az2-li"
onclick=
"searchKeysBefore('yohoops','az2')"
><strong>
yohoops.org.:az2
</strong>
</li>
<li
id=
"yohoops-az3-li"
onclick=
"searchKeysBefore('yohoops','az3')"
><strong>
yohoops.org.:az3
</strong>
</li>
<li
id=
"yohoops-onekey-li"
onclick=
"searchKeysBefore('yohoops','onekey')"
><strong>
yohoops.org.:onekey
</strong>
</li>
<!-- <li id="yohobuy-aws-li" onclick="searchKeysBefore('yohobuy','aws')"><strong>yohobuy.com.:aws</strong>
</li>
<li id="yohobuy-qcloud-li" onclick="searchKeysBefore('yohobuy','qcloud')"><strong>yohobuy.com.:qcloud</strong>
...
...
monitor-ui-web/src/main/webapp/jsp/redisoperate/redisclear.jsp
View file @
0805830
...
...
@@ -83,7 +83,7 @@
<div
class=
"form-inline"
role=
"form"
style=
"margin: 12px; ;"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
>
prefix:
</span>
<input
id=
"prefixInput"
class=
"form-control"
>
<input
id=
"prefixInput"
class=
"form-control"
style=
"width:500px;"
>
</input>
</div>
<button
id=
"btnSearch"
class=
"btn btn-danger"
style=
"margin-left: 10px"
onclick=
"btnClear()"
>
...
...
@@ -131,8 +131,30 @@
text
:
"是"
,
className
:
"btn-success"
,
onclick
:
function
()
{
$
(
dialog
).
dialog
(
"hide"
);
goClear
(
pre
);
var
frontParam
=
{};
frontParam
.
dataSourceInfo
=
_PAGE_REDIS_SOURCE
;
frontParam
.
keyPrefix
=
pre
;
$
.
post
({
url
:
contextPath
+
"redisClear/clear"
,
data
:
frontParam
,
dataType
:
"json"
,
success
:
function
(
resp
)
{
$
(
dialog
).
dialog
(
"hide"
);
if
(
resp
!=
null
&&
resp
.
code
==
200
)
{
localAlert
(
'清除缓存成功'
,
resp
.
data
);
}
else
{
localAlert
(
'清除缓存失败'
,
resp
.
message
);
}
},
error
:
function
(
e
)
{
$
(
dialog
).
dialog
(
"hide"
);
localAlert
(
'清除缓存失败'
,
resp
.
message
);
console
.
log
(
e
);
}
});
}
}]
});
...
...
@@ -140,28 +162,6 @@
}
function
goClear
(
pre
){
var
frontParam
=
{};
frontParam
.
dataSourceInfo
=
_PAGE_REDIS_SOURCE
;
frontParam
.
keyPrefix
=
pre
;
$
.
post
({
url
:
contextPath
+
"redisClear/clear"
,
data
:
frontParam
,
dataType
:
"json"
,
success
:
function
(
resp
)
{
if
(
resp
!=
null
&&
resp
.
code
==
200
)
{
localAlert
(
'清除缓存成功'
,
resp
.
data
);
}
else
{
localAlert
(
'清除缓存失败'
,
resp
.
message
);
}
},
error
:
function
(
e
)
{
localAlert
(
'清除缓存失败'
,
resp
.
message
);
console
.
log
(
e
);
}
});
}
function
checkRate
(
nubmer
)
{
...
...
monitor-ui-web/src/main/webapp/jsp/sqloperate/sqloperate.jsp
View file @
0805830
...
...
@@ -346,6 +346,7 @@
return
;
}
$
(
"#resultDiv"
).
html
(
"<span style='color:red'>SQL:"
+
param
.
queryContent
+
"</span>"
);
$
(
"#jobsTable"
).
hide
();
//发送请求到后台,获取数据源下的所有table信息
$
.
ajax
({
type
:
'post'
,
...
...
monitor-ui-web/src/main/webapp/jsp/switch/java_restart.jsp
View file @
0805830
...
...
@@ -85,11 +85,11 @@
<div
class=
"widget-title"
style=
"height: 53px;"
>
<div>
<button
id=
"awsRestart"
class=
"btn btn-primary"
style=
"margin-top: 12px;margin-left: 100px;"
<
%--
<
button
id=
"awsRestart"
class=
"btn btn-primary"
style=
"margin-top: 12px;margin-left: 100px;"
onclick=
"restart('all','aws','')"
>
aws重启
</button>
--%>
<button
id=
"qcloudRestart"
class=
"btn btn-primary"
style=
"margin-top: 12px;margin-left: 100px;"
onclick=
"restart('all','qcloud','')"
>
qcloud重启
...
...
@@ -139,7 +139,7 @@
title
:
"项目名称"
,
field
:
"name"
,
width
:
"10%"
},
{
}
/*
, {
title: "aws",
field: "name",
formatter: function (value, rowData, rowIndex) {
...
...
@@ -147,7 +147,7 @@
return div;
},
width: "35%"
},
{
}
*/
,
{
title
:
"qcloud"
,
field
:
"name"
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
...
...
@@ -170,15 +170,15 @@
field
:
"op"
,
formatter
:
function
(
value
,
rowData
,
rowIndex
)
{
var
div
=
$
(
"<div>"
);
$
(
"<button onclick=\"restart(\'"
+
rowData
.
name
+
"\',\'aws\',\'\')\">"
).
addClass
(
"btn btn-xs btn-primary"
).
html
(
"aws重启"
).
appendTo
(
div
);
div
.
append
(
" "
);
/*$("<button onclick=\"restart(\'" + rowData.name + "\',\'aws\',\'\')\">").addClass("btn btn-xs btn-primary").html("aws重启").appendTo(div);
div.append(" ");*/
$
(
"<button onclick=\"restart(\'"
+
rowData
.
name
+
"\',\'qcloud\',\'\')\">"
).
addClass
(
"btn btn-xs btn-primary"
).
html
(
"qq重启"
).
appendTo
(
div
);
div
.
append
(
" "
);
$
(
"<button onclick=\"restart(\'"
+
rowData
.
name
+
"\',\'qcloudaz2\',\'\')\">"
).
addClass
(
"btn btn-xs btn-primary"
).
html
(
"az2重启"
).
appendTo
(
div
);
div
.
append
(
"</br>"
);
div
.
append
(
"</br>"
);
$
(
"<button onclick=\"stop(\'"
+
rowData
.
name
+
"\',\'aws\',\'\')\">"
).
addClass
(
"btn btn-xs btn-primary"
).
html
(
"aws停止"
).
appendTo
(
div
);
div
.
append
(
" "
);
/* $("<button onclick=\"stop(\'" + rowData.name + "\',\'aws\',\'\')\">").addClass("btn btn-xs btn-primary").html("aws停止").appendTo(div);
div.append(" ");*/
$
(
"<button onclick=\"stop(\'"
+
rowData
.
name
+
"\',\'qcloud\',\'\')\">"
).
addClass
(
"btn btn-xs btn-primary"
).
html
(
"qq停止"
).
appendTo
(
div
);
div
.
append
(
" "
);
$
(
"<button onclick=\"stop(\'"
+
rowData
.
name
+
"\',\'qcloudaz2\',\'\')\">"
).
addClass
(
"btn btn-xs btn-primary"
).
html
(
"az2停止"
).
appendTo
(
div
);
...
...
@@ -247,8 +247,8 @@
});
$
(
"#aws_"
+
name
).
html
(
""
);
$
(
"#aws_"
+
name
).
append
(
aws_div
);
/*$("#aws_" + name).html("");
$("#aws_" + name).append(aws_div);*/
$
(
"#qcloud_"
+
name
).
html
(
""
);
$
(
"#qcloud_"
+
name
).
append
(
qcloud_div
);
...
...
monitor-ui-web/src/main/webapp/jsp/switch/switch_search.jsp
View file @
0805830
...
...
@@ -76,138 +76,57 @@
<div
class=
"container-fluid"
>
<div
class=
"widget-box"
>
<div
class=
"widget-title"
style=
"height: 50px;"
>
<h5
style=
"display: inline"
>
aws
搜索流量切换
</h5>
<h5
style=
"display: inline"
>
qcloud
搜索流量切换
</h5>
</div>
<div
class=
"panel-body"
>
<button
class=
"btn btn-sm btn-primary"
onclick=
"reloadTable('
aws
')"
>
onclick=
"reloadTable('
qcloud
')"
>
<em
class=
"icon-cogs bigger-110"
></em>
刷新
</button>
<button
class=
"btn btn-sm btn-primary"
onclick=
"switchSearch('
aws
')"
>
onclick=
"switchSearch('
qcloud
')"
>
<em
class=
"icon-cogs bigger-110"
></em>
aws
搜索流量切换
qcloud
搜索流量切换
</button>
<button
class=
"btn btn-sm btn-danger"
onclick=
"commit('
aws
')"
>
onclick=
"commit('
qcloud
')"
>
<em
class=
"icon-cogs bigger-110"
></em>
提交至域名服务器
</button>
<h3
class=
"header smaller"
></h3>
<table
id=
"
aws
DetailTable"
></table>
<table
id=
"
qcloud
DetailTable"
></table>
</div>
<h3
class=
"header smaller"
></h3>
<div
class=
"widget-title"
style=
"height: 50px;"
>
<h5
style=
"display: inline"
>
qcloud
搜索流量切换
</h5>
<h5
style=
"display: inline"
>
az2
搜索流量切换
</h5>
</div>
<div
class=
"panel-body"
>
<button
class=
"btn btn-sm btn-primary"
onclick=
"reloadTable('
qcloud
')"
>
onclick=
"reloadTable('
az2
')"
>
<em
class=
"icon-cogs bigger-110"
></em>
刷新
</button>
<button
class=
"btn btn-sm btn-primary"
onclick=
"switchSearch('
qcloud
')"
>
onclick=
"switchSearch('
az2
')"
>
<em
class=
"icon-cogs bigger-110"
></em>
qcloud
搜索流量切换
az2
搜索流量切换
</button>
<button
class=
"btn btn-sm btn-danger"
onclick=
"commit('
qcloud
')"
>
onclick=
"commit('
az2
')"
>
<em
class=
"icon-cogs bigger-110"
></em>
提交至域名服务器
</button>
<h3
class=
"header smaller"
></h3>
<table
id=
"
qcloud
DetailTable"
></table>
<table
id=
"
az2
DetailTable"
></table>
</div>
<
%--
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"col-xs-11"
>
<!-- PAGE CONTENT BEGINS -->
<div
class=
"row"
>
<div
class=
"col-xs-12 col-sm-12 widget-container-span"
>
<div
class=
"tabbable"
>
<ul
class=
"nav nav-tabs"
id=
"myTab"
>
<li
class=
"active"
style=
"width: 110px"
>
<a
data-toggle=
"tab"
href=
"#home"
>
<em
class=
"green icon-cloud bigger-110"
></em>
aws
</a>
</li>
<li
style=
"width: 110px"
>
<a
data-toggle=
"tab"
href=
"#profile"
>
<em
class=
"green icon-cloud bigger-110"
></em>
qq
</a>
</li>
</ul>
<div
class=
"tab-content"
>
<div
id=
"home"
class=
"tab-pane in active"
>
<button
class=
"btn btn-sm btn-primary"
onclick=
"reloadTable('aws')"
>
<em
class=
"icon-cogs bigger-110"
></em>
刷新
</button>
<button
class=
"btn btn-sm btn-primary"
onclick=
"switchSearch('aws')"
>
<em
class=
"icon-cogs bigger-110"
></em>
aws搜索流量切换
</button>
<button
class=
"btn btn-sm btn-danger"
onclick=
"commit('aws')"
>
<em
class=
"icon-cogs bigger-110"
></em>
提交至域名服务器
</button>
<h3
class=
"header smaller red"
></h3>
<table
id=
"awsDetailTable"
></table>
</div>
<div
id=
"profile"
class=
"tab-pane"
>
<button
class=
"btn btn-sm btn-primary"
onclick=
"reloadTable('qcloud')"
>
<em
class=
"icon-cogs bigger-110"
></em>
刷新
</button>
<button
class=
"btn btn-sm btn-primary"
onclick=
"switchSearch('qcloud')"
>
<em
class=
"icon-cogs bigger-110"
></em>
qcloud搜索流量切换
</button>
<button
class=
"btn btn-sm btn-danger"
onclick=
"commit('qcloud')"
>
<em
class=
"icon-cogs bigger-110"
></em>
提交至域名服务器
</button>
<h3
class=
"header smaller red"
></h3>
<table
id=
"qcloudDetailTable"
></table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
--%>
</div>
</div>
...
...
@@ -226,12 +145,12 @@
<script>
var
a
ws
_search_record_ids
=
""
;
var
a
z2
_search_record_ids
=
""
;
var
qcloud_search_record_ids
=
""
;
$
(
function
()
{
//加载表格
$
(
"#awsDetailTable"
).
table
({
//title: "aws搜索流量列表",
$
(
"#az2DetailTable"
).
table
({
//title: "az2搜索流量列表",
dataType
:
"json"
,
pagination
:
false
,
pageSize
:
10
,
...
...
@@ -239,7 +158,7 @@
url
:
contextPath
+
"internalDns/selectAll"
,
queryParams
:{
domain
:
'yohoops.org.'
,
environment
:
'a
ws
'
,
environment
:
'a
z2
'
,
tag
:
'search'
},
striped
:
true
,
...
...
@@ -279,12 +198,12 @@
return
style
;
},
onLoadSuccess
:
function
(
data
)
{
a
ws
_search_record_ids
=
""
;
a
z2
_search_record_ids
=
""
;
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
){
if
(
aws_search_record_ids
.
length
>
0
){
aws_search_record_ids
+=
","
;
if
(
az2_search_record_ids
.
length
>
0
){
az2_search_record_ids
+=
","
;
}
a
ws
_search_record_ids
+=
data
[
i
].
id
a
z2
_search_record_ids
+=
data
[
i
].
id
}
}
});
...
...
@@ -391,10 +310,13 @@
//搜索dns配置:即再name前面添加冒号,则不生效
function
switchSearch
(
cloud
)
{
var
record_ids
=
""
;
if
(
"aws"
==
cloud
){
record_ids
=
aws_search_record_ids
;
}
else
{
if
(
"az2"
==
cloud
){
record_ids
=
az2_search_record_ids
;
}
else
if
(
"qcloud"
==
cloud
){
record_ids
=
qcloud_search_record_ids
;
}
else
{
alert
(
"参数不合法:cloud = "
+
cloud
);
return
;
}
$
.
ajax
({
url
:
contextPath
+
"/internalDns/updateNameForSearch"
,
...
...
@@ -411,8 +333,8 @@
//刷新table
function
reloadTable
(
cloud
){
if
(
"aws"
==
cloud
){
$
(
"#awsDetailTable"
).
table
(
"load"
);
if
(
"az2"
==
cloud
){
$
(
"#az2DetailTable"
).
table
(
"load"
);
}
else
{
$
(
"#qcloudDetailTable"
).
table
(
"load"
);
}
...
...
monitor-ui-web/src/main/webapp/script/common/genarate_left_panel.js
View file @
0805830
...
...
@@ -44,7 +44,7 @@ function GobalStandardPost(url,args){
var
innerHTML
=
"<h5 style='color: #E0EEE0;font-style:oblique;font-weight:900;font-size:200%;margin-left: 45px;margin-top: 20px;'>YOHO</h5>"
;
innerHTML
+=
"<div id='user-nav'>"
;
innerHTML
+=
"<ul class='nav btn-group'>"
;
//innerHTML += "<li class='btn btn-inverse'><a id='changepwd_a
' href='#'><i class='icon icon-cog'></i> <span class='text'>changePWD</span></a></li>";
innerHTML
+=
"<li class='btn btn-inverse'><a id='changepwd_a' style='display: none
' href='#'><i class='icon icon-cog'></i> <span class='text'>changePWD</span></a></li>"
;
innerHTML
+=
"<li class='btn btn-inverse'><a id='logout_a' href='#'><i class='icon icon-share-alt'></i> <span class='text'>Logout</span></a></li>"
;
innerHTML
+=
"</ul>"
;
innerHTML
+=
"</div>"
;
...
...
@@ -205,7 +205,7 @@ document.getElementById("li_phpRelease_a").setAttribute("href", path + "/phpBuil
document
.
getElementById
(
"li_nodeRelease_a"
).
setAttribute
(
"href"
,
path
+
"/nodeBuild/toProject"
);
document
.
getElementById
(
"li_dockerRelease_a"
).
setAttribute
(
"href"
,
path
+
"/dockerBuild/toProject"
);
document
.
getElementById
(
"logout_a"
).
setAttribute
(
"href"
,
path
+
"/user/logout"
);
//
document.getElementById("changepwd_a").setAttribute("href", path + "/user/toupdatePwd");
document
.
getElementById
(
"changepwd_a"
).
setAttribute
(
"href"
,
path
+
"/user/toupdatePwd"
);
document
.
getElementById
(
"li_sms_a"
).
setAttribute
(
"href"
,
path
+
"/sms/toSmsLog"
);
document
.
getElementById
(
"li_search_compare_a"
).
setAttribute
(
"href"
,
path
+
"/searchCompare/getComparePage"
);
document
.
getElementById
(
"li_zkMonitor_a"
).
setAttribute
(
"href"
,
path
+
"/zkCfgCommon/tozkMonitorList"
);
...
...
Please
register
or
login
to post a comment