用户管理模块
1、调整页面字段查询及优化页面 2、增加cgi 接口请求 调整http url检索条件
This commit is contained in:
@@ -373,4 +373,53 @@ public class HttpClientUtil {
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* CGI get 获取消息
|
||||
* @param destUrl 业务地址
|
||||
* @param params 参数列表
|
||||
* @return 查询结果数据json
|
||||
*/
|
||||
public static String getCGI(String destUrl, Map<String, Object> params, HttpServletRequest req) throws IOException {
|
||||
String result = null;
|
||||
Response response=null;
|
||||
String url = "";
|
||||
try {
|
||||
URIBuilder uriBuilder = new URIBuilder(destUrl);
|
||||
if(params!=null) {
|
||||
for (String param : params.keySet()) {
|
||||
if(!StringUtil.isBlank(param)&¶ms.get(param)!=null) {
|
||||
uriBuilder.addParameter(param, params.get(param).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
System.err.println(uriBuilder);
|
||||
url=uriBuilder.toString();
|
||||
//创建连接
|
||||
WebTarget wt = ClientUtil.getWebTarger(url);
|
||||
logger.info("getMsg url:"+url);
|
||||
//获取响应结果
|
||||
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
|
||||
response= header.get();
|
||||
int status = response.getStatus();
|
||||
if (status == HttpStatus.SC_OK) {
|
||||
result= response.readEntity(String.class);
|
||||
result = galaxyMessageFormat(result);
|
||||
logger.info("获取消息成功,相应内容如下: " + result);
|
||||
|
||||
} else {
|
||||
logger.error("获取消息失败,相应内容如下: " + result);
|
||||
throw new MaatConvertException(status+"");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("获取消息失败,相应内容如下: " + result);
|
||||
logger.error("获取消息失败 ", e);
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:");
|
||||
}finally {
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,9 +57,9 @@ public class UserManageController extends BaseController{
|
||||
@RequiresPermissions(value={"user:manage:config"})
|
||||
public String delete(Integer isValid
|
||||
,String ids
|
||||
,RedirectAttributes redirectAttributes){
|
||||
,RedirectAttributes redirectAttributes,HttpServletRequest request){
|
||||
try{
|
||||
userManageService.delete(isValid,ids);
|
||||
userManageService.delete(isValid,ids,request);
|
||||
addMessage(redirectAttributes,"delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("Delete failed",e);
|
||||
@@ -151,17 +151,16 @@ public class UserManageController extends BaseController{
|
||||
UserManage user=new UserManage();
|
||||
IpReuseIpCfg ipReuseIpCfg=ipReuseIpCfgService.getIpByIp(ip);
|
||||
//根据ip调用接口获取数据
|
||||
//user=userManageService.getUserList(ip, request);
|
||||
//user=userManageService.getUser(ip, request);
|
||||
if(ipReuseIpCfg!=null){
|
||||
user.setServerIp(ipReuseIpCfg.getDestIpAddress());
|
||||
user.setRemarks(ipReuseIpCfg.getCfgDesc());
|
||||
userManageList.add(user);
|
||||
}
|
||||
}
|
||||
return userManageList;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "view")
|
||||
/* @RequestMapping(value = "view")
|
||||
@RequiresPermissions(value={"user:manage:config"})
|
||||
public String view(String serverIp,String userName,HttpServletResponse response,Model model){
|
||||
UserManage user=new UserManage();
|
||||
@@ -174,5 +173,5 @@ public class UserManageController extends BaseController{
|
||||
}
|
||||
model.addAttribute("user", user);
|
||||
return "/cfg/maintenance/userManage/userView";
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -65,19 +65,29 @@ public class UserManageService extends BaseService{
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
entity.setIsValid(Constants.VALID_NO);
|
||||
userManageDao.insert(entity);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
//cgi接口添加
|
||||
/*String[] ipArray = entity.getServerIp().split(",");
|
||||
for(String ip :ipArray){
|
||||
//循环调用接口增加
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("server_ip", ip);
|
||||
params.put("user_name", entity.getUserName());
|
||||
params.put("user_pwd", entity.getUserPwd());
|
||||
LogRecvData<UserManage> fromJson=getUrl(params,Constants.NTC_IP_REUSE_USER_CREATE,request);
|
||||
//返回处理
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
}else{
|
||||
}
|
||||
String url="?cmd=UserCreate&server_ip="+ip+"&user_name="+entity.getUserName()+"&user_pwd="+entity.getUserPwd();
|
||||
System.out.println(url);
|
||||
}*/
|
||||
}*/
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
}else{
|
||||
try {
|
||||
entity.setEditTime(createTime);
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
//获取修改之前数据
|
||||
@@ -87,8 +97,14 @@ public class UserManageService extends BaseService{
|
||||
/*String[] ipArray = olduser.getServerIp().split(",");
|
||||
for(String ip :ipArray){
|
||||
//循环调用接口删除
|
||||
String url="?cmd=UserDelete&server_ip="+ip+"&user_name="+olduser.getUserName();
|
||||
System.out.println(url);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("server_ip", ip);
|
||||
params.put("user_name", olduser.getUserName());
|
||||
LogRecvData<UserManage> fromJson=getUrl(params,Constants.NTC_IP_REUSE_USER_DELETE,request);
|
||||
//返回处理
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
}else{
|
||||
}
|
||||
}*/
|
||||
if(StringUtil.isEmpty(entity.getUserName())){
|
||||
entity.setUserName(olduser.getUserName());
|
||||
@@ -96,59 +112,65 @@ public class UserManageService extends BaseService{
|
||||
if(StringUtil.isEmpty(entity.getUserPwd())){
|
||||
entity.setUserPwd(olduser.getUserPwd());
|
||||
}
|
||||
/*String[] newIpArray = entity.getServerIp().split(",");
|
||||
/* String[] newIpArray = entity.getServerIp().split(",");
|
||||
for(String newIp :newIpArray){
|
||||
//循环调用接口添加
|
||||
String url="?cmd=UserCreate&server_ip="+newIp+"&user_name="+entity.getUserName()+"&user_pwd="+entity.getUserPwd();
|
||||
System.out.println(url);
|
||||
}*/
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("server_ip", newIp);
|
||||
params.put("user_name", entity.getUserName());
|
||||
params.put("user_pwd", entity.getUserPwd());
|
||||
LogRecvData<UserManage> fromJson=getUrl(params,Constants.NTC_IP_REUSE_USER_CREATE,request);
|
||||
//返回处理
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
}else{
|
||||
}
|
||||
}*/
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
}
|
||||
}
|
||||
public LogRecvData<UserManage> getUrl(Map<String, Object> params,String urlType,HttpServletRequest request){
|
||||
LogRecvData<UserManage> fromJson = new LogRecvData<UserManage>();
|
||||
try{
|
||||
String url ="URL"+ urlType ;
|
||||
String recv = HttpClientUtil.getCGI(url, params, request);
|
||||
logger.info("查询结果:" + recv);
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<UserManage>>(){}.getType());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("查询失败", e);
|
||||
}
|
||||
return fromJson;
|
||||
}
|
||||
|
||||
//根据vpn服务器ip获取用户vpn服务器ip信息
|
||||
/* //根据vpn服务器ip获取用户vpn服务器ip信息
|
||||
public UserManage getUser(String serverIp,HttpServletRequest request){
|
||||
UserManage user=new UserManage();
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("server_ip", serverIp);
|
||||
try{
|
||||
String url ="URL"+ Constants.NTC_IP_REUSE_USER_LIST;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
String url ="URL"+ Constants.NTC_IP_REUSE_USER_LIST ;
|
||||
//String recv = HttpClientUtil.getCGI(url, params, request);
|
||||
String recv="{\"data\":{\"list\":[{\"userName\":\"zhangsan\",\"createOn\":\"2018-11-01 14:51:12 \",\"updatedOn\":\"2018-11-02 10:54:07 \",\"outgoingUnicastPackets\":\"537,962\",\"outgoingUnicastTotalSize\":\"278,885\",\"outgoingBroadcastPackets\":\"51,130,890\""
|
||||
+ ",\"outgoingBroadcastTotalSize\":\"4781,154\",\"incomingUnicastPackets\":\"454,121\",\"incomingUnicastTotalSize\":\"45,565\",\"incomingBroadcastPackets\":\"454,4545\""
|
||||
+ ",\"incomingBroadcastTotalSize\":\"4781,154\",\"numberOfLogins\":\"124\"}]}}";
|
||||
recv=HttpClientUtil.galaxyMessageFormat(recv);
|
||||
logger.info("查询结果:" + recv);
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<UserManage> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<UserManage>>(){}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
|
||||
}
|
||||
user=fromJson.getData().getList().get(0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("查询失败", e);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
//根据vpn服务器ip,用户名获取用户信息
|
||||
public UserManage getUserManage(String serverIp,String userName,HttpServletRequest request){
|
||||
UserManage user=new UserManage();
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("server_ip", serverIp);
|
||||
params.put("user_name", userName);
|
||||
try{
|
||||
String url ="URL"+ Constants.NTC_IP_REUSE_USER_GET;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
logger.info("查询结果:" + recv);
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<UserManage> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<UserManage>>(){}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("查询失败", e);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
}*/
|
||||
/**
|
||||
*
|
||||
* @param isAudit
|
||||
@@ -156,7 +178,8 @@ public class UserManageService extends BaseService{
|
||||
* @param ids compileIds
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void delete(Integer isValid,String ids){
|
||||
public void delete(Integer isValid,String ids,HttpServletRequest request){
|
||||
/*try{*/
|
||||
String[] idArray = ids.split(",");
|
||||
List<UserManage> userList=new ArrayList<UserManage>();
|
||||
for(String id :idArray){
|
||||
@@ -172,16 +195,27 @@ public class UserManageService extends BaseService{
|
||||
userManageDao.update(entity);
|
||||
}
|
||||
//cgi接口删除旧数据
|
||||
for (int i = 0; i < userList.size(); i++) {
|
||||
/* for (int i = 0; i < userList.size(); i++) {
|
||||
String[] ipArray = userList.get(i).getServerIp().split(",");
|
||||
for(String ip :ipArray){
|
||||
//循环调用接口删除
|
||||
String url="?cmd=UserDelete&server_ip="+ip+"&user_name="+userList.get(i).getUserName();
|
||||
System.out.println(url);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("server_ip", ip);
|
||||
params.put("user_name",userList.get(i).getUserName());
|
||||
LogRecvData<UserManage> fromJson=getUrl(params,Constants.NTC_IP_REUSE_USER_DELETE,request);
|
||||
//返回处理
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
}else{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("查询失败", e);
|
||||
}*/
|
||||
}
|
||||
|
||||
public List<UserManage> findUsers() {
|
||||
return userManageDao.findUsers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1319,14 +1319,14 @@ transfer_bytes=\u4F20\u8F93\u6570\u636E\u5B57\u8282
|
||||
user_info=\u7528\u6237\u4FE1\u606F
|
||||
user_list=\u7528\u6237\u5217\u8868
|
||||
equal_password=\u5BC6\u7801\u4E0D\u4E00\u81F4\uFF01
|
||||
outgoing_unicast_packets=\u8F93\u51FA\u5355\u5305
|
||||
outgoing_unicast_total_size=\u8F93\u51FA\u5355\u64AD\u603B\u5927\u5C0F
|
||||
outgoing_broadcast_packets=\u8F93\u51FA\u5E7F\u64AD\u6570\u636E\u5305
|
||||
outgoing_broadcast_total_size=\u8F93\u51FA\u5E7F\u64AD\u603B\u5927\u5C0F
|
||||
incoming_unicast_packets=\u8F93\u5165\u5355\u5305
|
||||
incoming_unicast_total_size=\u8F93\u5165\u5355\u64AD\u603B\u5927\u5C0F
|
||||
incoming_broadcast_packets=\u8F93\u5165\u5E7F\u64AD\u6570\u636E\u5305
|
||||
incoming_broadcast_total_size=\u8F93\u5165\u5E7F\u64AD\u603B\u5927\u5C0F
|
||||
outgoing_unicast_packets=\u4E0A\u4F20\u6570\u636E\u5305\u6570
|
||||
outgoing_unicast_total_size=\u4E0A\u4F20\u6570\u636E\u5305\u6570\u603B\u91CF
|
||||
outgoing_broadcast_packets=\u4E0A\u4F20\u5B57\u8282\u6570
|
||||
outgoing_broadcast_total_size=\u4E0A\u4F20\u5B57\u8282\u6570\u603B\u91CF
|
||||
incoming_unicast_packets=\u4E0B\u8F7D\u6570\u636E\u5305\u6570
|
||||
incoming_unicast_total_size=\u4E0B\u8F7D\u6570\u636E\u5305\u6570\u603B\u91CF
|
||||
incoming_broadcast_packets=\u4E0B\u8F7D\u5B57\u8282\u6570
|
||||
incoming_broadcast_total_size=\u4E0B\u8F7D\u5B57\u8282\u6570\u603B\u91CF
|
||||
address_pool=\u5730\u5740\u6C60
|
||||
ip_total=IP\u603B\u6570
|
||||
available_ip_total=\u53EF\u7528IP\u6570
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
|
||||
<script type="text/javascript">
|
||||
function showVpnIp(id,serverIp){
|
||||
$("#vpn_modal").modal({
|
||||
backdrop:"static",
|
||||
keyboard:false,
|
||||
show:true
|
||||
});
|
||||
$("#serverIpId").val(serverIp);
|
||||
$("#serverIpName").val(serverIp);
|
||||
$("#userId").val(id);
|
||||
}
|
||||
|
||||
var saveIp=function(){
|
||||
if($("#serverIpId").val()==""){
|
||||
top.$.jBox.tip("<spring:message code='vpn_ip'/> <spring:message code='required'/>","");
|
||||
return ;
|
||||
}
|
||||
$("#vpn_modal").modal('hide');
|
||||
$("#importForm1").submit();
|
||||
}
|
||||
</script>
|
||||
<div class="modal fade" id="vpn_modal" tabindex="-1" role="dialog" aria-labelledby="mo" aria-hidden="true">
|
||||
<form id="importForm1" action="${ctx}/maintenance/userManage/save" method="post" enctype="multipart/form-data" style="margin-top: 10%;" class="form-horizontal"
|
||||
onsubmit="loading('<spring:message code='loading'/>');">
|
||||
<input type="hidden" id="importTip" value="<spring:message code='import_tip_excel'/>">
|
||||
<div class="modal-dialog" role="document" style="width:700px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
<spring:message code="vpn_ip" />
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" id="userId" name="id" />
|
||||
<div class="form-group" style="margin-top: 15px;">
|
||||
<label class="control-label col-md-3">
|
||||
<spring:message code="vpn_ip" />
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<sys:treeselect id="serverIp" name="serverIp"
|
||||
value="${user.serverIp}" labelName="user.serverIp"
|
||||
notAllowSelectParent="true" enableSearch="true"
|
||||
notAllowSelectRoot="true" checkedPS="ps" unCheckedPS="ps"
|
||||
labelValue="${user.serverIp}" title="vpn_ip"
|
||||
url="/maintenance/userManage/treeData?isLeafShow=false&cfgType=3&specific=true" extId="0"
|
||||
checked="true" cssClass="form-control required" />
|
||||
</div>
|
||||
<span class="help-inline"><font color="red">*</font> </span>
|
||||
<div for="user.serverIp"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn red" onclick="saveIp()">
|
||||
<spring:message code="ok" />
|
||||
</button>
|
||||
<button type="button" class="btn" data-dismiss="modal">
|
||||
<spring:message code="close" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -57,107 +57,55 @@
|
||||
success:function(data){
|
||||
$("#userTable tbody").empty("");
|
||||
var html = ""
|
||||
html = "<div style='width:98%;overflow: auto;margin-top: 10px;height: 417px;margin-left: 1%;'>"
|
||||
html+="<table class='table table-bordered table-condensed text-nowrap' style='width: 100%;'>";
|
||||
html+="<thead>";
|
||||
html+="<th><spring:message code="user_name"/></th><th><spring:message code="vpn_ip"/></th><th><spring:message code="create_time"/></th><th><spring:message code="last_login"/></th><th><spring:message code="num_logins"/></th>";
|
||||
html+="<th><spring:message code="outgoing_unicast_packets"/></th><th><spring:message code="outgoing_unicast_total_size"/></th><th><spring:message code="outgoing_broadcast_packets"/></th>";
|
||||
html+="<th><spring:message code="outgoing_broadcast_total_size"/></th><th><spring:message code="incoming_unicast_packets"/></th><th><spring:message code="incoming_unicast_total_size"/></th>";
|
||||
html+="<th><spring:message code="incoming_broadcast_packets"/></th><th><spring:message code="incoming_broadcast_total_size"/></th>";
|
||||
html+="</thead>";
|
||||
html+="<tbody>";
|
||||
for(i=0;i<data.length;i++){
|
||||
html+="<tr>";
|
||||
if(i==0){
|
||||
html+="<td class='taskStatus' rowspan='"+data.length+"'>"+userName;
|
||||
html+="</td>";
|
||||
}
|
||||
html+="<td class='taskStatus'>";
|
||||
html+="<a style='text-decoration: none;' href='${ctx}/maintenance/userManage/view?userName="+userName;
|
||||
html+="&serverIp="+data[i].serverIp+"'>"+data[i].serverIp;
|
||||
html+="</a></td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].numLogins==null?"":data[i].numLogins);
|
||||
html+="<td class='taskStatus'>"+data[i].serverIp+"</td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].createOn==null?"":data[i].createOn);
|
||||
html+="</td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].lastLogin==null?"":data[i].lastLogin);
|
||||
html+="<td class='taskStatus'>"+(data[i].updatedOn==null?"":data[i].updatedOn);
|
||||
html+="</td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].transferPackets==null?"":data[i].transferPackets);
|
||||
html+="<td class='taskStatus'>"+(data[i].numberOfLogins==null?"":data[i].numberOfLogins);
|
||||
html+="</td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].transferBytes==null?"":data[i].transferBytes);
|
||||
html+="<td class='taskStatus'>"+(data[i].outgoingUnicastPackets==null?"":data[i].outgoingUnicastPackets);
|
||||
html+="</td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].remarks==null?"":data[i].remarks);
|
||||
html+="<td class='taskStatus'>"+(data[i].outgoingUnicastTotalSize==null?"":data[i].outgoingUnicastTotalSize);
|
||||
html+="</td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].outgoingBroadcastPackets==null?"":data[i].outgoingBroadcastPackets);
|
||||
html+="</td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].outgoingBroadcastTotalSize==null?"":data[i].outgoingBroadcastTotalSize);
|
||||
html+="</td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].incomingUnicastPackets==null?"":data[i].incomingUnicastPackets);
|
||||
html+="</td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].incomingUnicastTotalSize==null?"":data[i].incomingUnicastTotalSize);
|
||||
html+="</td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].incomingBroadcastPackets==null?"":data[i].incomingBroadcastPackets);
|
||||
html+="</td>";
|
||||
html+="<td class='taskStatus'>"+(data[i].incomingBroadcastTotalSize==null?"":data[i].incomingBroadcastTotalSize);
|
||||
html+="</td>";
|
||||
html+="</tr>";
|
||||
}
|
||||
$("#userTable tbody").prepend(html);
|
||||
openWindow('light');
|
||||
html+="</tbody>";
|
||||
html+="</table>";
|
||||
html+="</div>";
|
||||
top.$.jBox(html,{width: $(document).width()*0.6,height: 480,title:"<spring:message code="user_info"/>", buttons:{"<spring:message code="close"/>":true}});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addVpnIp(id,serverIp,userName){
|
||||
$("#spUserName").text(userName)
|
||||
$("#serverIpId").val(serverIp);
|
||||
$("#serverIpName").val(serverIp);
|
||||
$("#userId").val(id);
|
||||
openWindow('light2');
|
||||
}
|
||||
function saveIp(){
|
||||
if($("#serverIpId").val()==null || $("#serverIpId").val()==''){
|
||||
top.$.jBox.tip("<spring:message code='vpn_ip'/> <spring:message code='required'/>","");
|
||||
}else{
|
||||
window.location.href="${ctx}/maintenance/userManage/save?id="+$("#userId").val()+"&serverIp="+$("#serverIpId").val();
|
||||
$("#submitIp").attr('disabled',"true");
|
||||
}
|
||||
}
|
||||
function openWindow(type){
|
||||
document.getElementById(type).style.display='block';
|
||||
document.getElementById('fade').style.display='block';
|
||||
}
|
||||
function closeWindow(type){
|
||||
document.getElementById(type).style.display='none';
|
||||
document.getElementById('fade').style.display='none';
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
.black_overlay{
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0%;
|
||||
left: 0%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #0c0c0c1f;
|
||||
z-index:1001;
|
||||
-moz-opacity: 0.8;
|
||||
opacity:.80;
|
||||
filter: alpha(opacity=80);
|
||||
}
|
||||
.white_content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 20%;
|
||||
left: 20%;
|
||||
width: 60%;
|
||||
height: 480px;
|
||||
border: 1px solid 42403e52;
|
||||
background-color: white;
|
||||
z-index:1002;
|
||||
overflow: auto;
|
||||
-moz-box-shadow: 2px 2px 10px #909090;
|
||||
-webkit-box-shadow: 2px 2px 10px #909090;
|
||||
box-shadow:2px 2px 10px #909090;
|
||||
}
|
||||
.white_vpn{
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 15%;
|
||||
left: 25%;
|
||||
width: 615px;
|
||||
height: 230px;
|
||||
border: 1px solid 42403e52;
|
||||
background-color: white;
|
||||
z-index:1002;
|
||||
overflow: auto;
|
||||
-moz-box-shadow: 2px 2px 10px #909090;
|
||||
-webkit-box-shadow: 2px 2px 10px #909090;
|
||||
box-shadow:2px 2px 10px #909090;
|
||||
}
|
||||
.input_w{
|
||||
width: 350px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page-content">
|
||||
@@ -290,92 +238,33 @@
|
||||
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.id}" isValid="${cfg.isValid}" value="0" >
|
||||
</td>
|
||||
<td>${indexCfg.userName }</td>
|
||||
<td><a href="javascript:dictDetail('${indexCfg.serverIp}','${indexCfg.userName}')">${indexCfg.serverIp }</a></td>
|
||||
<td class="no_substr" title="${indexCfg.serverIp }"><a href="javascript:dictDetail('${indexCfg.serverIp}','${indexCfg.userName}')">
|
||||
<c:if test="${fn:length(indexCfg.serverIp)>28}">
|
||||
${fn:substring(indexCfg.serverIp,0,20)}..
|
||||
</c:if>
|
||||
<c:if test="${fn:length(indexCfg.serverIp)<=28}">
|
||||
${indexCfg.serverIp }
|
||||
</c:if>
|
||||
</a></td>
|
||||
<td>${indexCfg.remarks }</td>
|
||||
<td>${indexCfg.creatorName }</td>
|
||||
<td><fmt:formatDate value="${indexCfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${indexCfg.editorName }</td>
|
||||
<td><fmt:formatDate value="${indexCfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td class="no_substr">
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-primary" href="#"><i class="icon-cogs"></i> <spring:message code="operation"/></a>
|
||||
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="javascript:addVpnIp('${indexCfg.id}','${indexCfg.serverIp}','${indexCfg.userName}')"><i class="fa fa-plus"></i><spring:message code="add"/> <spring:message code="vpn_ip"/></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<td>
|
||||
<a href="javascript:showVpnIp('${indexCfg.id}','${indexCfg.serverIp}')"><i class="fa fa-plus"></i> <spring:message code="vpn_ip"/></a>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<c:set var="importPath" value="/ntc/iplist/list?functionId=${cfg.functionId}"/>
|
||||
<!-- 模板导入,start -->
|
||||
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||
<div id="light" class="white_content">
|
||||
<div class="jbox-title-panel" style="border-bottom: 1px solid #b9b9b9;height: 40px;width: 100%;padding: 11px;">
|
||||
<span style="font-size: 16px;"><spring:message code="user_list"/></span>
|
||||
<a href="javascript:void(0)" onClick="closeWindow('light')" style="text-decoration: none;color: #777777;float: right;" > X</a>
|
||||
</div>
|
||||
<div style='font-size: 14px;height: 405px;overflow: auto;' align='center'>
|
||||
<table id="userTable" class='table table-bordered table-condensed' style='width:98%;margin-top: 10px;' >
|
||||
<thead style="font-weight:bold;">
|
||||
<td><spring:message code="user_name"/></td>
|
||||
<td><spring:message code="vpn_ip"/></td>
|
||||
<td><spring:message code="num_logins"/></td>
|
||||
<td><spring:message code="last_login"/></td>
|
||||
<td><spring:message code="transfer_packets"/></td>
|
||||
<td><spring:message code="transfer_bytes"/></td>
|
||||
<td><spring:message code="desc"/></td>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div style="border-top: 1px solid #b9b9b9;padding: 4px;background: #eee;height: 35px;">
|
||||
<button onclick="closeWindow('light');" style="float: right;"><spring:message code="close"/></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="light2" class="white_vpn">
|
||||
<div class="jbox-title-panel" style="border-bottom: 1px solid #b9b9b9;height: 40px;width: 100%;padding: 11px;">
|
||||
<span style="font-size: 16px;"><spring:message code="vpn_ip"/></span>
|
||||
<a href="javascript:void(0)" onClick="closeWindow('light2')" style="text-decoration: none;color: #777777;float: right;" > X</a>
|
||||
</div>
|
||||
<input type="hidden" id="userId"/>
|
||||
<table border="0" style="width: 80%;line-height: 35px;margin-top: 15px;margin-left: 40px;">
|
||||
<tr>
|
||||
<td align="right"><spring:message code="user_name" /> </td>
|
||||
<td width="320px;" ><span id='spUserName'></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><spring:message code="vpn_ip" /> </td>
|
||||
<td width="320px;">
|
||||
<sys:treeselect id="serverIp" name="serverIp"
|
||||
value="${user.serverIp}" labelName="user.serverIp"
|
||||
notAllowSelectParent="true" enableSearch="true"
|
||||
notAllowSelectRoot="true" checkedPS="ps" unCheckedPS="ps"
|
||||
labelValue="${user.serverIp}" title="vpn_ip"
|
||||
url="/maintenance/userManage/treeData?isLeafShow=false&cfgType=3&specific=true" extId="0"
|
||||
checked="true" cssClass="form-control required" />
|
||||
</td>
|
||||
<td width="30px;"><span class="help-inline"><font color="red" id='red'>*</font> </span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="form-actions" style="margin-top: 30px;">
|
||||
<button type="submit" class="btn green" id="submitIp" onClick="return saveIp()" style="margin-left: 70px;" >
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
<button type="button" class="btn default" onClick="closeWindow('light2')">
|
||||
<spring:message code="cancel" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fade" class="black_overlay"></div>
|
||||
<!-- vpn服务器Ip模板,start -->
|
||||
<%@include file="/WEB-INF/views/cfg/maintenance/userManage/addIpModal.jsp" %>
|
||||
</body>
|
||||
</html>
|
||||
@@ -203,7 +203,7 @@
|
||||
|
||||
<!-- 筛选搜索内容栏默认隐藏-->
|
||||
<div class="col-md-12 filter-action-select-panle hide" >
|
||||
<%-- <div class="row">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
@@ -263,7 +263,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
</div> --%>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
|
||||
Reference in New Issue
Block a user