|
|
<%--
|
|
|
Created by IntelliJ IDEA.
|
|
|
User: meiling.ge
|
|
|
Date: 2017/10/24
|
|
|
Time: 16:14
|
|
|
To change this template use File | Settings | File Templates.
|
|
|
--%>
|
|
|
<%@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/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/bootstrap-responsive.min.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"/>
|
|
|
<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/select2/dist/js/select2.full.js"></script>
|
|
|
<script src="<%=basePath %>js/jstree/jstree.min.js"></script>
|
|
|
<script src="<%=basePath %>js/jquery.toaster.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">管理员</a>
|
|
|
</div>
|
|
|
|
|
|
<div class="container-fluid">
|
|
|
<div class="widget-box">
|
|
|
<div class="widget-title">
|
|
|
<h5>告警开关配置</h5>
|
|
|
</div>
|
|
|
<div class="widget-content nopadding">
|
|
|
<div class="widget-title" style="height: 53px;">
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div id="taskTable" class="panel panel-default">
|
|
|
<div class="widget-content">告警开关列表</div>
|
|
|
<div class="panel-body" tablerole="body">
|
|
|
<table class="table table-striped table-bordered table-hover" >
|
|
|
<thead class="thin-border-bottom">
|
|
|
<tr>
|
|
|
<th align="center">告警系统</th>
|
|
|
<th align="center">告警类型</th>
|
|
|
<th align="center">开关当前状态</th>
|
|
|
<th align="center">操作</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
|
|
<tr>
|
|
|
<td align="center" width="10%">运维ops</td>
|
|
|
<td align="center" width="10%">短信<a href="#"></a></td>
|
|
|
<td align="center" width="10%">
|
|
|
<c:choose>
|
|
|
<c:when test="${smsSwitchValue == 'false' }">
|
|
|
off
|
|
|
</c:when>
|
|
|
<c:otherwise>
|
|
|
on
|
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
|
</td>
|
|
|
<td align="center" width="10%">
|
|
|
<c:choose>
|
|
|
<c:when test="${smsSwitchValue == 'false' }">
|
|
|
<button onclick="switchValue('smsSwitchValue','on')" class="btn btn-xs btn-success">打开</button>
|
|
|
</c:when>
|
|
|
<c:otherwise>
|
|
|
<button onclick="switchValue('smsSwitchValue','off')" class="btn btn-xs btn-success">关闭</button>
|
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
<td align="center" width="10%">运维ops<a href="#"></a></td>
|
|
|
<td align="center" width="10%">语音<a href="#"></a></td>
|
|
|
<td align="center" width="10%">
|
|
|
<c:choose>
|
|
|
<c:when test="${voiceSwitchValue == 'false' }">
|
|
|
off
|
|
|
</c:when>
|
|
|
<c:otherwise>
|
|
|
on
|
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
|
<td align="center"width="10%">
|
|
|
<c:choose>
|
|
|
<c:when test="${voiceSwitchValue == 'false' }"><%--关闭状态--%>
|
|
|
<button onclick="switchValue('voiceSwitchValue','on')" class="btn btn-xs btn-success">打开</button>
|
|
|
</c:when>
|
|
|
<c:otherwise>
|
|
|
<button onclick="switchValue('voiceSwitchValue','off')" class="btn btn-xs btn-success">关闭</button>
|
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
<td align="center" width="10%">监控dev<a href="#"></a></td>
|
|
|
<td align="center" width="10%">短信<a href="#"></a></td>
|
|
|
<td align="center" width="10%">
|
|
|
<c:choose>
|
|
|
<c:when test="${devSmsSwitchValue == 'false' }">
|
|
|
off
|
|
|
</c:when>
|
|
|
<c:otherwise>
|
|
|
on
|
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
|
</td>
|
|
|
<td align="center" width="10%">
|
|
|
<c:choose>
|
|
|
<c:when test="${devSmsSwitchValue == 'false' }">
|
|
|
<button onclick="switchValue('devSmsSwitchValue','on')" class="btn btn-xs btn-success">打开</button>
|
|
|
</c:when>
|
|
|
<c:otherwise>
|
|
|
<button onclick="switchValue('devSmsSwitchValue','off')" class="btn btn-xs btn-success">关闭</button>
|
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
|
|
|
<div class="modal-dialog">
|
|
|
<div class="modal-content"style="width: 140%">
|
|
|
<div class="modal-header">
|
|
|
<button type="button" class="close" data-dismiss="modal"
|
|
|
aria-hidden="true">×</button>
|
|
|
<h4 class="modal-title" id="myModalLabel"></h4>
|
|
|
</div>
|
|
|
<div class="modal-body" style="height: 680px;;overflow :auto" >
|
|
|
<form id="taskForm" class="form-horizontal">
|
|
|
<input type="hidden" name="id">
|
|
|
<div class="form-group">
|
|
|
<label class="col-sm-2 control-label"> <span style="color:red">*</span>数据源:</label>
|
|
|
<div class="col-sm-8">
|
|
|
<select id="influxdbs" name="influxdbs" class="form-control" autocomplete="off"style="width:296px">
|
|
|
<option value="aws,qcloud"> aws,qcloud</option>
|
|
|
<option value="aws"> aws</option>
|
|
|
<option value="qcloud"> qcloud</option>
|
|
|
</select>
|
|
|
</div>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
|
<button type="button" class="btn btn-danger" data-dismiss="modal" onclick="clearData()">关闭</button>
|
|
|
<button type="button" class="btn btn-success" value="Validate" onclick="saveTask()">提交</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- /.modal-content -->
|
|
|
</div>
|
|
|
<!-- /.modal -->
|
|
|
</div>
|
|
|
|
|
|
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
|
|
|
<script>
|
|
|
$("#li_manager").addClass("active open");
|
|
|
$("#li_alarmSwitch").addClass("active");
|
|
|
</script>
|
|
|
<script type="text/javascript">
|
|
|
function switchValue(switchName,value) {
|
|
|
$.ajax({
|
|
|
url: contextPath + "OpsSmsOnOff/switchAlarm",
|
|
|
type: 'post',
|
|
|
async:false,//同步请求
|
|
|
data: {
|
|
|
switchName: switchName,
|
|
|
value: value
|
|
|
},
|
|
|
success: function (data) {
|
|
|
if (!data || data.code != 200) {
|
|
|
alert('切换失败!'+data.message);
|
|
|
}else{
|
|
|
alert('切换成功!');
|
|
|
window.location.href = contextPath + "/OpsSmsOnOff/toAlarmSwitch";
|
|
|
}
|
|
|
},
|
|
|
error: function (data) {
|
|
|
alert('系统异常');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|
|
|
|
...
|
...
|
|