generated from root/miduo_server
Merge branch 'whb' into jieling
commit
4f98606c22
|
|
@ -37,7 +37,6 @@ public class GmController {
|
||||||
@RequestMapping(value = "/sendGm", method = {RequestMethod.POST, RequestMethod.GET})
|
@RequestMapping(value = "/sendGm", method = {RequestMethod.POST, RequestMethod.GET})
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
int publishNotice(HttpServletRequest request) throws Exception {
|
int publishNotice(HttpServletRequest request) throws Exception {
|
||||||
|
|
||||||
List<ServerInfo> allServerInfo = serverInfoDao.getAllServerInfo();
|
List<ServerInfo> allServerInfo = serverInfoDao.getAllServerInfo();
|
||||||
List<String> serverList = new ArrayList<>();
|
List<String> serverList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
@ -45,15 +44,14 @@ public class GmController {
|
||||||
serverList.add(serverInfo.getServer_id());
|
serverList.add(serverInfo.getServer_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
String content = request.getParameter("content1");
|
String content = request.getParameter("content");
|
||||||
String[] serverId = request.getParameterValues("serverId[]");
|
String[] serverId = request.getParameterValues("serverId[]");
|
||||||
String cmd = content;
|
String cmd = content;
|
||||||
for (String s:serverId){
|
for (String s:serverId){
|
||||||
System.out.println(s);
|
System.out.println(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (String str : serverId) {
|
||||||
/*for (String str : serverId) {
|
|
||||||
|
|
||||||
if (!serverList.contains(str)) {
|
if (!serverList.contains(str)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -82,7 +80,7 @@ public class GmController {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<!--_meta 作为公共模版分离出去-->
|
<!--_meta 作为公共模版分离出去-->
|
||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html xmlns:th="http://www.springframework.org/schema/jdbc">
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
|
<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
|
||||||
|
|
@ -62,18 +62,42 @@
|
||||||
发送GM
|
发送GM
|
||||||
<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont"></i></a>
|
<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont"></i></a>
|
||||||
</nav>
|
</nav>
|
||||||
<div id="all">
|
<div class="page-container">
|
||||||
|
|
||||||
</div>
|
<div class="row cl">
|
||||||
<div id="my">
|
<label class="form-label col-xs-4 col-sm-2">
|
||||||
|
<span class="c-red">*</span>
|
||||||
|
服务器id:</label>
|
||||||
|
<div>
|
||||||
|
<input type='checkbox' id='selectAll' >全选
|
||||||
|
</div>
|
||||||
|
<div class="formControls col-xs-8 col-sm-9">
|
||||||
|
<div th:each="obj:${serverInfo}" >
|
||||||
|
<input th:text="${obj.server_id}" type='checkbox' name='serverId' th:value="${obj.server_id}" />
|
||||||
|
<span th:text="${obj.name}"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row cl">
|
||||||
|
<label class="form-label col-xs-4 col-sm-2">
|
||||||
|
<span class="c-red" >*</span>
|
||||||
|
内容:</label>
|
||||||
|
<div class="formControls col-xs-8 col-sm-9">
|
||||||
|
<input type="text" name="content" placeholder="" value="" class="input-text"/>
|
||||||
|
<span class="ROLEID"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
<div class="row cl" style="text-align: center">
|
||||||
<div id="text">
|
<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
|
||||||
|
<button class="btn btn-primary radius" style="font-size: 15px" onclick="sub()"><i class="Hui-iconfont" ></i>
|
||||||
</div>
|
提交
|
||||||
<div id="sub">
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<iframe name='sendGM' id="sendGM" style='display: none'></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -90,31 +114,17 @@
|
||||||
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
|
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
|
||||||
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/messages_zh.js"></script>
|
<script type="text/javascript" src="../static/lib/jquery.validation/1.14.0/messages_zh.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" th:inline = "javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var ms = [[${serverInfo}]];
|
|
||||||
var m = document.getElementById("my");
|
|
||||||
var a = document.getElementById("all");
|
|
||||||
var t = document.getElementById("text");
|
|
||||||
var s = document.getElementById("sub");
|
|
||||||
m.innerHTML += "<form id='form' >";
|
|
||||||
a.innerHTML += "<input type='checkbox' id='selectAll' > "+"全选"
|
|
||||||
for(var i=0;i<ms.length;i++){
|
|
||||||
m.innerHTML += "<input style='' id='server' type='checkbox' name='serverId' value='"+ms[i].server_id+"'>"+ms[i].name+"    ";
|
|
||||||
}
|
|
||||||
t.innerHTML +="内容: "+"<input type='text' name='content' style='width: 95%;height: 40px' ; >"
|
|
||||||
s.innerHTML += "<input type='button' value='提交' onclick='sub()'>";
|
|
||||||
m.innerHTML += "</form>";
|
|
||||||
|
|
||||||
function sub() {
|
function sub() {
|
||||||
var strSel=[];
|
var strSel=[];
|
||||||
var content = $('input[name^="content"]').map(function(){3
|
var content = $('input[name^="content"]').map(function(){
|
||||||
return this.value
|
return this.value
|
||||||
}).get();
|
}).get();
|
||||||
|
|
||||||
$("[name='serverId']:checked").each(function(index, element) {
|
$("[name='serverId']:checked").each(function(index, element) {
|
||||||
strSel.push($(this).val());
|
strSel.push($(this).val());
|
||||||
});
|
});
|
||||||
|
console.log(strSel)
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -125,7 +135,7 @@
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data === 0) {
|
if (data === 0) {
|
||||||
layer.msg('发送成功',{icon: 6,time:2000,end:function(){
|
layer.msg('发送成功',{icon: 6,time:2000,end:function(){
|
||||||
location.reload();
|
window.location.href = "toMailPage?type=4"
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
if (data === 1) {
|
if (data === 1) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue