vpn 用户管理修改新增修改和删除逻辑
ip地址池增加存在可用ip地址池才在策略展示
This commit is contained in:
@@ -5,7 +5,9 @@ import java.io.IOException;
|
|||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import javax.ws.rs.client.Client;
|
import javax.ws.rs.client.Client;
|
||||||
@@ -16,8 +18,10 @@ import javax.ws.rs.core.MediaType;
|
|||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.UriBuilder;
|
import javax.ws.rs.core.UriBuilder;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.http.client.ClientProtocolException;
|
import org.apache.http.client.ClientProtocolException;
|
||||||
import org.apache.http.client.utils.HttpClientUtils;
|
import org.apache.http.client.utils.HttpClientUtils;
|
||||||
|
import org.eclipse.jetty.util.ajax.JSON;
|
||||||
import org.glassfish.jersey.media.multipart.FormDataMultiPart;
|
import org.glassfish.jersey.media.multipart.FormDataMultiPart;
|
||||||
import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
|
import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -624,6 +628,61 @@ public class ConfigServiceUtil {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
public static Map getCGIInfo(String url,String cmd,Map<String, Object> params) {
|
||||||
|
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||||
|
params.put("cmd", cmd);
|
||||||
|
String recv = getCGI(url, params);
|
||||||
|
if (StringUtils.isNotBlank(recv)) {
|
||||||
|
resultMap = (Map<String, Object>) JSON.parse(recv);
|
||||||
|
}
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
public static String getCGI(String url, Map<String, Object> params) throws MaatConvertException{
|
||||||
|
// if(StringUtils.isBlank(searchCondition.getSearchService())){
|
||||||
|
// throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||||
|
// }
|
||||||
|
Response response=null;
|
||||||
|
String result = null;
|
||||||
|
try {
|
||||||
|
UriBuilder builder=UriBuilder.fromPath(url);
|
||||||
|
if(params!=null) {
|
||||||
|
for (String param : params.keySet()) {
|
||||||
|
if(!StringUtil.isBlank(param)&¶ms.get(param)!=null) {
|
||||||
|
builder.queryParam(param,params.get(param).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
URI uri=builder.build();
|
||||||
|
logger.info("cgi url:"+uri.toString());
|
||||||
|
//创建连接
|
||||||
|
ClientUtil.initClient();
|
||||||
|
Client client=ClientUtil.getClient();
|
||||||
|
WebTarget wt = client.target(uri);
|
||||||
|
Builder header = wt.request();
|
||||||
|
try {
|
||||||
|
response= header.get();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new MaatConvertException("<spring:message code=\"cgi_service_failed\"/>");
|
||||||
|
}
|
||||||
|
if(response !=null && response.getStatus() == 200){
|
||||||
|
result= response.readEntity(String.class);
|
||||||
|
logger.info("cgi info:"+result);
|
||||||
|
}else{
|
||||||
|
if(response!= null) {
|
||||||
|
throw new MaatConvertException("<spring:message code=\"cgi_service_failed\"/>:"+response.readEntity(String.class));
|
||||||
|
}else {
|
||||||
|
throw new MaatConvertException("<spring:message code=\"cgi_service_failed\"/>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw e;
|
||||||
|
} finally {
|
||||||
|
if (response != null) {
|
||||||
|
response.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置全量更新指令下发
|
* 配置全量更新指令下发
|
||||||
|
|||||||
@@ -753,4 +753,6 @@ public final class Constants {
|
|||||||
|
|
||||||
// IP复用模块调用相关CGI接口URL
|
// IP复用模块调用相关CGI接口URL
|
||||||
public static final String IP_REUSE_CALL_CGI_URL = Configurations.getStringProperty("ip_reuse_call_cgi_url","");
|
public static final String IP_REUSE_CALL_CGI_URL = Configurations.getStringProperty("ip_reuse_call_cgi_url","");
|
||||||
|
public static final String ALL_IP_GET = Configurations.getStringProperty("allIpGet","AllIpGet");
|
||||||
|
public static final String IP_NUM_GET = Configurations.getStringProperty("ipNumGet","IpNumGet");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,46 +373,4 @@ 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();
|
|
||||||
result= response.readEntity(String.class);
|
|
||||||
//调用处理数据方法
|
|
||||||
logger.info("获取消息成功,相应内容如下: " + result);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error("获取消息失败,相应内容如下: " + result);
|
|
||||||
logger.error("获取消息失败 ", e);
|
|
||||||
throw new MaatConvertException("<spring:message code=\"cgi_service_failed\"/>:");
|
|
||||||
}finally {
|
|
||||||
if (response != null) {
|
|
||||||
response.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
package com.nis.web.controller.configuration.maintenance;
|
package com.nis.web.controller.configuration.maintenance;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.eclipse.jetty.util.ajax.JSON;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
@@ -16,11 +21,15 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.basics.IpReuseIpCfg;
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
import com.nis.domain.configuration.BaseIpCfg;
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
import com.nis.domain.configuration.IpAddrPoolCfg;
|
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||||
import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
||||||
|
import com.nis.domain.configuration.UserManage;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
import com.nis.web.service.configuration.IpAddrPoolCfgService;
|
import com.nis.web.service.configuration.IpAddrPoolCfgService;
|
||||||
@@ -182,4 +191,17 @@ public class IpAddrPoolController extends BaseController{
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping(value = {"/getCGIInfo"})
|
||||||
|
public Map<String,Object> getUserInfo(Integer addrPoolId,String cmd,HttpServletRequest request,HttpServletResponse response){
|
||||||
|
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("cmd", cmd);
|
||||||
|
params.put("addr_pool_id", addrPoolId);
|
||||||
|
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
||||||
|
resultMap=ConfigServiceUtil.getCGIInfo(url, cmd, params);
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,15 +69,39 @@ public class UserManageController extends BaseController{
|
|||||||
public String delete(Integer isValid
|
public String delete(Integer isValid
|
||||||
,String ids
|
,String ids
|
||||||
,RedirectAttributes redirectAttributes,HttpServletRequest request){
|
,RedirectAttributes redirectAttributes,HttpServletRequest request){
|
||||||
|
String deleteSuccessIp="";
|
||||||
try{
|
try{
|
||||||
userManageService.delete(isValid,ids,request);
|
for (String id : ids.split(",")) {
|
||||||
addMessage(redirectAttributes,"delete_success");
|
UserManage user=userManageService.getUserById(id);
|
||||||
|
if(user != null && !StringUtil.isEmpty(user.getServerIp())) {
|
||||||
|
boolean lastIp=false;
|
||||||
|
int deleteIpLenth=1;
|
||||||
|
String serverIp=user.getServerIp().substring(0, user.getServerIp().length()-1);
|
||||||
|
int serverIpNum=user.getServerIp().split(",").length;
|
||||||
|
for (String ip : user.getServerIp().split(",")) {
|
||||||
|
try {
|
||||||
|
if(deleteIpLenth == serverIpNum) {
|
||||||
|
lastIp=true;
|
||||||
|
}
|
||||||
|
userManageService.delete(-1,user,ip,lastIp);
|
||||||
|
deleteIpLenth++;
|
||||||
|
} catch (MaatConvertException e) {
|
||||||
|
logger.error("用户vpn新增失败",e);
|
||||||
|
throw e;
|
||||||
|
}catch (Exception e) {
|
||||||
|
logger.error("用户vpn新增失败",e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addMessage(redirectAttributes,"success","delete_success");
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("Delete failed",e);
|
logger.error("Delete failed",e);
|
||||||
if(e instanceof MaatConvertException) {
|
if(e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,e.getMessage());
|
addMessage(redirectAttributes,"error","cgi_service_failed");
|
||||||
}else {
|
}else {
|
||||||
addMessage(redirectAttributes,"delete_failed");
|
addMessage(redirectAttributes,"error","delete_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,43 +117,127 @@ public class UserManageController extends BaseController{
|
|||||||
Date createTime=new Date();
|
Date createTime=new Date();
|
||||||
String errorIp="";
|
String errorIp="";
|
||||||
String errorType="";
|
String errorType="";
|
||||||
|
String addIp="";
|
||||||
|
String addSuccessIp="";
|
||||||
|
String deleteIp="";
|
||||||
|
String deleteSuccessIp="";
|
||||||
|
boolean isExistUser=false;
|
||||||
|
try {
|
||||||
|
String[] ipArray =entity.getServerIp().split(",");
|
||||||
|
String serverIp =entity.getServerIp();
|
||||||
if(entity.getId()==null){
|
if(entity.getId()==null){
|
||||||
|
addIp=serverIp;
|
||||||
entity.setCreateTime(createTime);
|
entity.setCreateTime(createTime);
|
||||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||||
entity.setIsValid(Constants.VALID_NO);
|
entity.setIsValid(Constants.VALID_YES);
|
||||||
String[] ipArray =entity.getServerIp().split(",");
|
|
||||||
for (String ip : ipArray) {
|
for (String ip : ipArray) {
|
||||||
userManageService.saveip(entity,ip,model,request);
|
try {
|
||||||
|
if(!StringUtil.isEmpty(ip)) {
|
||||||
|
if(!isExistUser) {
|
||||||
|
entity.setServerIp(ip+",");
|
||||||
|
userManageService.saveip(entity,ip);
|
||||||
|
//用户第一个vpn创建成功之后即可走update
|
||||||
|
isExistUser=true;
|
||||||
|
}else {
|
||||||
|
entity.setServerIp(addSuccessIp+ip+",");
|
||||||
|
userManageService.updateip(entity,ip);
|
||||||
}
|
}
|
||||||
UserManage oldUser=userManageService.getUserByLoginName(entity.getUserName());
|
addSuccessIp+=addSuccessIp+",";
|
||||||
if(oldUser!=null){
|
}
|
||||||
String[] ips=oldUser.getServerIp().split(",");
|
} catch (MaatConvertException e) {
|
||||||
String erorIp =userManageService.getMessageIp(ipArray, ips);
|
logger.error("用户vpn新增失败",e);
|
||||||
if(!StringUtil.isEmpty(erorIp)){
|
throw e;
|
||||||
errorType="create";
|
}catch (Exception e) {
|
||||||
errorIp=entity.getUserName()+" "+erorIp;
|
logger.error("用户vpn新增失败",e);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
entity.setEditTime(createTime);
|
entity.setEditTime(createTime);
|
||||||
entity.setEditorId(entity.getCurrentUser().getId());
|
entity.setEditorId(entity.getCurrentUser().getId());
|
||||||
String[] ipArray =entity.getServerIp().split(",");
|
|
||||||
UserManage oldUser=userManageService.getUserById(String.valueOf(entity.getId()));
|
UserManage oldUser=userManageService.getUserById(String.valueOf(entity.getId()));
|
||||||
int num=0;
|
|
||||||
for (String ip : ipArray) {
|
if(oldUser != null) {
|
||||||
userManageService.updateip(entity,ip,num,model,request);
|
//密码修改
|
||||||
num++;
|
if(oldUser != null && !StringUtil.isEmpty(entity.getUserPwd()) && !entity.getUserPwd().equals(oldUser.getUserPwd())) {
|
||||||
|
for (String ip : oldUser.getServerIp().split(",")) {
|
||||||
|
try {
|
||||||
|
if(!StringUtil.isEmpty(ip)) {
|
||||||
|
entity.setServerIp(oldUser.getServerIp());
|
||||||
|
entity.setUserPwd(entity.getUserPwd());
|
||||||
|
entity.setNewUserPwd(entity.getUserPwd());
|
||||||
|
userManageService.updatePwd(entity,ip);
|
||||||
}
|
}
|
||||||
UserManage user=userManageService.getUserById(String.valueOf(entity.getId()));
|
} catch (MaatConvertException e) {
|
||||||
if(user!=null){
|
logger.error("用户vpn密码修改失败",e);
|
||||||
String[] ips=user.getServerIp().split(",");
|
throw e;
|
||||||
String erorIp =userManageService.getMessageIp(ipArray, ips);
|
}catch (Exception e) {
|
||||||
if(!StringUtil.isEmpty(erorIp)){
|
logger.error("用户vpn密码修改失败",e);
|
||||||
errorType="create";
|
throw e;
|
||||||
errorIp=user.getUserName()+" "+erorIp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取需求新增的vpn ip
|
||||||
|
for (String oldIp : oldUser.getServerIp().split(",")) {
|
||||||
|
if(!StringUtil.isEmpty(oldIp) && !serverIp.contains(oldIp)) {
|
||||||
|
deleteIp+=oldIp+",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//获取需求删除的vpn ip
|
||||||
|
for (String newIp : serverIp.split(",")) {
|
||||||
|
if(!StringUtil.isEmpty(newIp) && !oldUser.getServerIp().contains(newIp)) {
|
||||||
|
addIp+=newIp+",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//新增用户vpnip
|
||||||
|
if(!StringUtil.isEmpty(addIp)){
|
||||||
|
for (String ip : addIp.split(",")) {
|
||||||
|
try {
|
||||||
|
if(!StringUtil.isEmpty(ip)) {
|
||||||
|
entity.setServerIp(oldUser.getServerIp()+ip+",");
|
||||||
|
entity.setUserName(oldUser.getUserName());
|
||||||
|
entity.setUserPwd(oldUser.getUserPwd());
|
||||||
|
userManageService.updateip(entity,ip);
|
||||||
|
addSuccessIp+=addSuccessIp+",";
|
||||||
|
}
|
||||||
|
} catch (MaatConvertException e) {
|
||||||
|
logger.error("用户vpn新增失败",e);
|
||||||
|
throw e;
|
||||||
|
}catch (Exception e) {
|
||||||
|
logger.error("用户vpn新增失败",e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//删除用户vpnip
|
||||||
|
if(!StringUtil.isEmpty(deleteIp)){
|
||||||
|
for (String ip : deleteIp.split(",")) {
|
||||||
|
try {
|
||||||
|
if(!StringUtil.isEmpty(ip)) {
|
||||||
|
entity.setServerIp(oldUser.getServerIp().replace(ip+",", ""));
|
||||||
|
userManageService.deleteip(entity,ip);
|
||||||
|
deleteSuccessIp+=deleteSuccessIp+",";
|
||||||
|
}
|
||||||
|
} catch (MaatConvertException e) {
|
||||||
|
logger.error("用户vpn删除失败",e);
|
||||||
|
throw e;
|
||||||
|
}catch (Exception e) {
|
||||||
|
logger.error("用户vpn删除失败",e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (MaatConvertException e) {
|
||||||
|
addMessage(redirectAttributes,"error","cgi_service_failed");
|
||||||
|
return "redirect:" + adminPath +"/maintenance/userManage/list?cgiError="+errorIp+"&errorType="+errorType;
|
||||||
|
} catch (Exception e) {
|
||||||
|
addMessage(redirectAttributes,"error","save_failed");
|
||||||
|
return "redirect:" + adminPath +"/maintenance/userManage/list?cgiError="+errorIp+"&errorType="+errorType;
|
||||||
|
}
|
||||||
return "redirect:" + adminPath +"/maintenance/userManage/list?cgiError="+errorIp+"&errorType="+errorType;
|
return "redirect:" + adminPath +"/maintenance/userManage/list?cgiError="+errorIp+"&errorType="+errorType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +301,7 @@ public class UserManageController extends BaseController{
|
|||||||
UserManage user=new UserManage();
|
UserManage user=new UserManage();
|
||||||
IpReuseIpCfg ipReuseIpCfg=ipReuseIpCfgService.getIpByIp(ip);
|
IpReuseIpCfg ipReuseIpCfg=ipReuseIpCfgService.getIpByIp(ip);
|
||||||
//根据ip调用接口获取数据
|
//根据ip调用接口获取数据
|
||||||
Map<String,String> map=userManageService.getUser(ip,userName, request);
|
Map<String,String> map=userManageService.getUser(ip,userName);
|
||||||
if(ipReuseIpCfg!=null ){
|
if(ipReuseIpCfg!=null ){
|
||||||
map.put("serverIp", ipReuseIpCfg.getDestIpAddress());
|
map.put("serverIp", ipReuseIpCfg.getDestIpAddress());
|
||||||
userManageList.add(map);
|
userManageList.add(map);
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import com.nis.domain.configuration.IpPortCfg;
|
|||||||
import com.nis.domain.configuration.UserManage;
|
import com.nis.domain.configuration.UserManage;
|
||||||
import com.nis.domain.configuration.template.IpMultiplexPolicyTemplate;
|
import com.nis.domain.configuration.template.IpMultiplexPolicyTemplate;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
@@ -147,9 +148,21 @@ public class IpMultiplexController extends CommonController {
|
|||||||
// 获取用户信息 地址池信息
|
// 获取用户信息 地址池信息
|
||||||
List<UserManage> users = userManageService.findUsers();
|
List<UserManage> users = userManageService.findUsers();
|
||||||
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
||||||
|
List<IpAddrPoolCfg> addrPoolsNew=new ArrayList<>();
|
||||||
|
for (IpAddrPoolCfg addrPool : addrPools) {
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("addr_pool_id", addrPool.getAddrPoolId());
|
||||||
|
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
||||||
|
Map<String, Object> resultMap=ConfigServiceUtil.getCGIInfo(url, Constants.IP_NUM_GET, params);
|
||||||
|
if(!StringUtil.isEmpty(resultMap)
|
||||||
|
&& !StringUtil.isEmpty(resultMap.get("num"))
|
||||||
|
&& Integer.parseInt(resultMap.get("num").toString()) > 0) {
|
||||||
|
addrPoolsNew.add(addrPool);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
model.addAttribute("users", users);
|
model.addAttribute("users", users);
|
||||||
model.addAttribute("addrPools", addrPools);
|
model.addAttribute("addrPools", addrPoolsNew);
|
||||||
model.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
model.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
||||||
return "/cfg/manipulation/ipmulitiplex/snatPolicyForm2";
|
return "/cfg/manipulation/ipmulitiplex/snatPolicyForm2";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -443,6 +443,6 @@
|
|||||||
<select id="findAddrPoolCfg" resultMap="addrPoolMap">
|
<select id="findAddrPoolCfg" resultMap="addrPoolMap">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="addrPoolColumns"/>,r.ADDR_POOL_NAME
|
<include refid="addrPoolColumns"/>,r.ADDR_POOL_NAME
|
||||||
FROM ip_reuse_addr_pool r WHERE r.is_valid !=-1
|
FROM ip_reuse_addr_pool r WHERE r.is_audit=1
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
#{serverIp,jdbcType=VARCHAR},
|
#{serverIp,jdbcType=VARCHAR},
|
||||||
#{userType,jdbcType=VARCHAR},
|
#{userType,jdbcType=VARCHAR},
|
||||||
#{isValid,jdbcType=INTEGER},
|
#{isValid,jdbcType=INTEGER},
|
||||||
0,
|
1,
|
||||||
#{creatorId,jdbcType=INTEGER},
|
#{creatorId,jdbcType=INTEGER},
|
||||||
#{createTime,jdbcType=TIMESTAMP},
|
#{createTime,jdbcType=TIMESTAMP},
|
||||||
#{editorId,jdbcType=INTEGER},
|
#{editorId,jdbcType=INTEGER},
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ import com.nis.domain.configuration.AppPolicyCfg;
|
|||||||
import com.nis.domain.configuration.CfgIndexInfo;
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
import com.nis.domain.configuration.UserManage;
|
import com.nis.domain.configuration.UserManage;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.httpclient.HttpClientUtil;
|
|
||||||
import com.nis.web.dao.configuration.AppCfgDao;
|
import com.nis.web.dao.configuration.AppCfgDao;
|
||||||
import com.nis.web.dao.configuration.IpCfgDao;
|
import com.nis.web.dao.configuration.IpCfgDao;
|
||||||
import com.nis.web.dao.configuration.UserManageDao;
|
import com.nis.web.dao.configuration.UserManageDao;
|
||||||
@@ -77,50 +77,55 @@ public class UserManageService extends BaseService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void saveip(UserManage entity,String ips,Model model, HttpServletRequest request){
|
public void saveip(UserManage entity,String ip)throws Exception{
|
||||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
userManageDao.insert(entity);
|
||||||
SqlSession batchSqlSession = null;
|
|
||||||
try {
|
|
||||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
|
||||||
UserManage user=userManageDao.getUserByLoginName(entity.getUserName());
|
|
||||||
if(user==null){
|
|
||||||
entity.setServerIp(ips);
|
|
||||||
((UserManageDao) batchSqlSession.getMapper(UserManageDao.class)).insert(entity);
|
|
||||||
}else{
|
|
||||||
user.setServerIp(user.getServerIp()+","+ips);
|
|
||||||
((UserManageDao) batchSqlSession.getMapper(UserManageDao.class)).update(user);
|
|
||||||
}
|
|
||||||
//cgi接口添加
|
//cgi接口添加
|
||||||
//循环调用接口增加
|
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
params.put("server_ip", ips);
|
params.put("cmd", Constants.NTC_IP_REUSE_USER_CREATE);
|
||||||
|
params.put("server_ip", ip);
|
||||||
params.put("user_name", entity.getUserName());
|
params.put("user_name", entity.getUserName());
|
||||||
params.put("user_pwd", entity.getUserPwd());
|
params.put("user_pwd", entity.getUserPwd());
|
||||||
String url =Constants.IP_REUSE_CALL_CGI_URL+ Constants.NTC_IP_REUSE_USER_CREATE ;
|
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
||||||
String recv = HttpClientUtil.getCGI(url, params, request);
|
String recv = ConfigServiceUtil.getCGI(url, params);
|
||||||
if (StringUtils.isNotBlank(recv)) {
|
|
||||||
Map<String, String> map = new HashMap<String, String>();
|
|
||||||
map = (Map<String, String>) JSON.parse(recv);
|
|
||||||
String error = map.get("error");
|
|
||||||
if (!StringUtil.isEmpty(error)) {
|
|
||||||
batchSqlSession.rollback();
|
|
||||||
} else {
|
|
||||||
batchSqlSession.commit();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
|
||||||
if (batchSqlSession != null) {
|
|
||||||
batchSqlSession.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void updateip(UserManage entity,String ips,int num,Model model, HttpServletRequest request){
|
public void updatePwd(UserManage entity,String ip){
|
||||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
userManageDao.update(entity);
|
||||||
|
//密码修改
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("cmd",Constants.NTC_IP_REUSE_USER_PASSWORD);
|
||||||
|
params.put("server_ip", ip);
|
||||||
|
params.put("user_name", entity.getUserName());
|
||||||
|
params.put("user_pwd", entity.getUserName());
|
||||||
|
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
||||||
|
String recv = ConfigServiceUtil.getCGI(url, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void deleteip(UserManage entity,String ip){
|
||||||
|
userManageDao.update(entity);
|
||||||
|
//循环调用接口删除
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("cmd",Constants.NTC_IP_REUSE_USER_DELETE);
|
||||||
|
params.put("server_ip", ip);
|
||||||
|
params.put("user_name", entity.getUserName());
|
||||||
|
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
||||||
|
String recv = ConfigServiceUtil.getCGI(url, params);
|
||||||
|
}
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void updateip(UserManage entity,String ip){
|
||||||
|
userManageDao.update(entity);
|
||||||
|
//cgi接口添加
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("cmd", Constants.NTC_IP_REUSE_USER_CREATE);
|
||||||
|
params.put("server_ip", ip);
|
||||||
|
params.put("user_name", entity.getUserName());
|
||||||
|
params.put("user_pwd", entity.getUserPwd());
|
||||||
|
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
||||||
|
String recv = ConfigServiceUtil.getCGI(url, params);
|
||||||
|
|
||||||
|
/*SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||||
SqlSession batchSqlSession = null;
|
SqlSession batchSqlSession = null;
|
||||||
try {
|
try {
|
||||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||||
@@ -132,9 +137,10 @@ public class UserManageService extends BaseService{
|
|||||||
for(String ip :ipArray){
|
for(String ip :ipArray){
|
||||||
//循环调用接口删除
|
//循环调用接口删除
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("cmd",Constants.NTC_IP_REUSE_USER_DELETE);
|
||||||
params.put("server_ip", ip);
|
params.put("server_ip", ip);
|
||||||
params.put("user_name", olduser.getUserName());
|
params.put("user_name", olduser.getUserName());
|
||||||
Map<String,String> map=getUrl(params,Constants.NTC_IP_REUSE_USER_DELETE,request);
|
Map<String,String> map=getUrl(params);
|
||||||
//返回处理
|
//返回处理
|
||||||
}
|
}
|
||||||
entity.setServerIp(ips);
|
entity.setServerIp(ips);
|
||||||
@@ -147,11 +153,12 @@ public class UserManageService extends BaseService{
|
|||||||
// cgi接口添加
|
// cgi接口添加
|
||||||
// 循环调用接口增加
|
// 循环调用接口增加
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("cmd", Constants.NTC_IP_REUSE_USER_CREATE);
|
||||||
params.put("server_ip", ips);
|
params.put("server_ip", ips);
|
||||||
params.put("user_name", entity.getUserName());
|
params.put("user_name", entity.getUserName());
|
||||||
params.put("user_pwd", entity.getUserPwd());
|
params.put("user_pwd", entity.getUserPwd());
|
||||||
String url = Constants.IP_REUSE_CALL_CGI_URL + Constants.NTC_IP_REUSE_USER_CREATE;
|
String url = Constants.IP_REUSE_CALL_CGI_URL;
|
||||||
String recv = HttpClientUtil.getCGI(url, params, request);
|
String recv = ConfigServiceUtil.getCGI(url, params);
|
||||||
if (StringUtils.isNotBlank(recv)) {
|
if (StringUtils.isNotBlank(recv)) {
|
||||||
Map<String, String> map = new HashMap<String, String>();
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
map = (Map<String, String>) JSON.parse(recv);
|
map = (Map<String, String>) JSON.parse(recv);
|
||||||
@@ -162,21 +169,21 @@ public class UserManageService extends BaseService{
|
|||||||
batchSqlSession.commit();
|
batchSqlSession.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (MaatConvertException e) {
|
||||||
e.printStackTrace();
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
if (batchSqlSession != null) {
|
if (batchSqlSession != null) {
|
||||||
batchSqlSession.close();
|
batchSqlSession.close();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Map<String,String> getUrl(Map<String, Object> params,String urlType,HttpServletRequest request){
|
public Map<String,String> getUrl(Map<String, Object> params){
|
||||||
Map<String,String> map=new HashMap<String,String>();
|
Map<String,String> map=new HashMap<String,String>();
|
||||||
try{
|
try{
|
||||||
String url =Constants.IP_REUSE_CALL_CGI_URL+ urlType ;
|
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
||||||
String recv = HttpClientUtil.getCGI(url, params, request);
|
String recv = com.nis.util.ConfigServiceUtil.getCGI(url, params);
|
||||||
if (StringUtils.isNotBlank(recv)) {
|
if (StringUtils.isNotBlank(recv)) {
|
||||||
map=(Map<String,String>)JSON.parse(recv);
|
map=(Map<String,String>)JSON.parse(recv);
|
||||||
}
|
}
|
||||||
@@ -187,14 +194,15 @@ public class UserManageService extends BaseService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//根据vpn服务器ip获取用户vpn服务器ip信息
|
//根据vpn服务器ip获取用户vpn服务器ip信息
|
||||||
public Map<String,String> getUser(String serverIp,String userName,HttpServletRequest request){
|
public Map<String,String> getUser(String serverIp,String userName){
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("cmd", Constants.NTC_IP_REUSE_USER_GET);
|
||||||
params.put("server_ip", serverIp);
|
params.put("server_ip", serverIp);
|
||||||
params.put("user_name", userName);
|
params.put("user_name", userName);
|
||||||
Map<String,String> map=new HashMap<String,String>();
|
Map<String,String> map=new HashMap<String,String>();
|
||||||
try{
|
try{
|
||||||
String url =Constants.IP_REUSE_CALL_CGI_URL+ Constants.NTC_IP_REUSE_USER_GET ;
|
String url =Constants.IP_REUSE_CALL_CGI_URL;
|
||||||
String recv = HttpClientUtil.getCGI(url, params, request);
|
String recv = ConfigServiceUtil.getCGI(url, params);
|
||||||
if (StringUtils.isNotBlank(recv)) {
|
if (StringUtils.isNotBlank(recv)) {
|
||||||
map=(Map<String,String>)JSON.parse(recv);
|
map=(Map<String,String>)JSON.parse(recv);
|
||||||
}
|
}
|
||||||
@@ -214,37 +222,22 @@ public class UserManageService extends BaseService{
|
|||||||
* @param ids compileIds
|
* @param ids compileIds
|
||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void delete(Integer isValid,String ids,HttpServletRequest request){
|
public void delete(Integer isValid,UserManage entity,String ip,boolean lastIp){
|
||||||
try{
|
UserManage user=new UserManage();
|
||||||
String[] idArray = ids.split(",");
|
user.setId(entity.getId());
|
||||||
List<UserManage> userList=new ArrayList<UserManage>();
|
if(!lastIp) {
|
||||||
for(String id :idArray){
|
user.setServerIp(user.getServerIp().replace(ip+",", ""));
|
||||||
UserManage entity = new UserManage();
|
}else {
|
||||||
entity=userManageDao.getUserById(id);
|
user.setIsValid(-1);
|
||||||
if(entity!=null){
|
|
||||||
userList.add(entity);
|
|
||||||
}
|
}
|
||||||
entity.setId(Long.valueOf(id));
|
userManageDao.update(user);
|
||||||
entity.setIsValid(isValid);
|
//cgi接口删除用户vpnip
|
||||||
entity.setEditorId(UserUtils.getUser().getId());
|
|
||||||
entity.setEditTime(new Date());
|
|
||||||
userManageDao.update(entity);
|
|
||||||
}
|
|
||||||
//cgi接口删除旧数据
|
|
||||||
for (int i = 0; i < userList.size(); i++) {
|
|
||||||
String[] ipArray = userList.get(i).getServerIp().split(",");
|
|
||||||
for(String ip :ipArray){
|
|
||||||
//循环调用接口删除
|
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("cmd", Constants.NTC_IP_REUSE_USER_DELETE);
|
||||||
params.put("server_ip", ip);
|
params.put("server_ip", ip);
|
||||||
params.put("user_name",userList.get(i).getUserName());
|
params.put("user_name", entity.getUserName());
|
||||||
Map<String,String> map=getUrl(params,Constants.NTC_IP_REUSE_USER_DELETE,request);
|
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
||||||
//返回处理
|
String recv = ConfigServiceUtil.getCGI(url, params);
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("查询失败", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<UserManage> findUsers() {
|
public List<UserManage> findUsers() {
|
||||||
|
|||||||
@@ -565,4 +565,6 @@ userPasswordSet=UserPasswordSet
|
|||||||
userDelete=UserDelete
|
userDelete=UserDelete
|
||||||
userGet=UserGet
|
userGet=UserGet
|
||||||
userList=UserList
|
userList=UserList
|
||||||
ip_reuse_call_cgi_url=http://192.168.11.137:8090/command/?cmd=
|
ip_reuse_call_cgi_url=http://192.168.11.137:8090/command
|
||||||
|
ipNumGet=IpNumGet
|
||||||
|
allIpGet=AllIpGet
|
||||||
@@ -463,7 +463,8 @@ var resetIndex = function(){
|
|||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
|
<input name="isAreaEffective" type="hidden" value="0">
|
||||||
|
<%-- <%@include file="/WEB-INF/include/form/areaInfo.jsp"%> --%>
|
||||||
<br>
|
<br>
|
||||||
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -50,10 +50,9 @@
|
|||||||
if(audit == 1){
|
if(audit == 1){
|
||||||
// $.getJSON(requestUrl,function(data,status){});
|
// $.getJSON(requestUrl,function(data,status){});
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:'get',
|
|
||||||
timeout:15000,// 超时时间
|
timeout:15000,// 超时时间
|
||||||
url:requestUrl+addrPoolId,
|
data:{"addrPoolId":addrPoolId,"cmd":"IpNumGet"},
|
||||||
dataType:'jsonp',
|
url:"${ctx}/maintenance/ipMultiplexPoolCfg/getCGIInfo",
|
||||||
async:true,
|
async:true,
|
||||||
success:function(data,status){
|
success:function(data,status){
|
||||||
if(status == "success"){
|
if(status == "success"){
|
||||||
@@ -79,20 +78,19 @@
|
|||||||
function getInfo(obj){
|
function getInfo(obj){
|
||||||
var addrPoolId = $(obj).attr("addrPoolId");
|
var addrPoolId = $(obj).attr("addrPoolId");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:'get',
|
timeout:15000,// 超时时间
|
||||||
url:'http://192.168.11.137:8090/command/?cmd=AllIpGet&addr_pool_id='+addrPoolId,
|
data:{"addrPoolId":addrPoolId,"cmd":"AllIpGet"},
|
||||||
dataType:'jsonp',
|
url:"${ctx}/maintenance/ipMultiplexPoolCfg/getCGIInfo",
|
||||||
async:true,
|
async:true,
|
||||||
success:function(data,status){
|
success:function(data,status){
|
||||||
//var dataArr = [];
|
|
||||||
var dataArr = data.candidate_ip;
|
var dataArr = data.candidate_ip;
|
||||||
var html = ""
|
var html = ""
|
||||||
html = "<div style='width:98%;overflow: auto;margin-top: 10px;height: 300px;margin-left: 1%;margin-right: 1%;'>"
|
html = "<div style='width:98%;overflow: auto;margin-top: 10px;height: 300px;margin-left: 1%;margin-right: 1%;'><br>"
|
||||||
html+="<table class='table table-bordered table-condensed text-nowrap' style='width: 100%;'>";
|
html+="<table class='table table-bordered table-condensed text-nowrap' style='width: 100%;'>";
|
||||||
html+="<tbody>";
|
html+="<tbody>";
|
||||||
if(dataArr.length == 0){
|
if(dataArr.length == 0){
|
||||||
html+="<tr>";
|
html+="<tr>";
|
||||||
html+="<td>("+"<spring:message code="nothing"/>"+")</td>";
|
html+="<td>("+"<spring:message code="no_data"/>"+")</td>";
|
||||||
html+="</tr>";
|
html+="</tr>";
|
||||||
}
|
}
|
||||||
for(i=0;i<dataArr.length;i++){
|
for(i=0;i<dataArr.length;i++){
|
||||||
@@ -104,6 +102,13 @@
|
|||||||
html+="</table>";
|
html+="</table>";
|
||||||
html+="</div>";
|
html+="</div>";
|
||||||
top.$.jBox(html,{width: $(document).width()*0.4,height: 380,persistent: false,title:"<spring:message code="available_ip"/>", buttons:{"<spring:message code="close"/>":true}});
|
top.$.jBox(html,{width: $(document).width()*0.4,height: 380,persistent: false,title:"<spring:message code="available_ip"/>", buttons:{"<spring:message code="close"/>":true}});
|
||||||
|
},
|
||||||
|
complete:function(XMLHttpRequest,status){
|
||||||
|
if(status=="timeout"){
|
||||||
|
$(td).html(timeout);
|
||||||
|
}else if(status !="success"){
|
||||||
|
$(td).html(failed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ var saveIp=function(){
|
|||||||
value="${user.serverIp}" labelName="user.serverIp"
|
value="${user.serverIp}" labelName="user.serverIp"
|
||||||
notAllowSelectParent="true" enableSearch="true"
|
notAllowSelectParent="true" enableSearch="true"
|
||||||
notAllowSelectRoot="true" checkedPS="ps" unCheckedPS="ps"
|
notAllowSelectRoot="true" checkedPS="ps" unCheckedPS="ps"
|
||||||
labelValue="${user.serverIp}" title="vpn_ip"
|
labelValue="${fn:substring(user.serverIp,0,(fn:length(user.serverIp)-1)) }" title="vpn_ip"
|
||||||
url="/maintenance/userManage/treeData?isLeafShow=false&cfgType=3&specific=true" extId="0"
|
url="/maintenance/userManage/treeData?isLeafShow=false&cfgType=3&specific=true" extId="0"
|
||||||
checked="true" cssClass="form-control required" />
|
checked="true" cssClass="form-control required" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -239,12 +239,13 @@
|
|||||||
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.id}" isValid="${cfg.isValid}" value="0" >
|
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.id}" isValid="${cfg.isValid}" value="0" >
|
||||||
</td>
|
</td>
|
||||||
<td>${indexCfg.userName }</td>
|
<td>${indexCfg.userName }</td>
|
||||||
<td class="no_substr" title="${indexCfg.serverIp }"><a href="javascript:dictDetail('${indexCfg.serverIp}','${indexCfg.userName}')">
|
<c:set var="serverIp" value="${fn:substring(indexCfg.serverIp,0,(fn:length(indexCfg.serverIp)-1)) }"></c:set>
|
||||||
<c:if test="${fn:length(indexCfg.serverIp)>28}">
|
<td class="no_substr" title="${serverIp }"><a href="javascript:dictDetail('${serverIp}','${indexCfg.userName}')">
|
||||||
${fn:substring(indexCfg.serverIp,0,20)}..
|
<c:if test="${fn:length(serverIp)>28}">
|
||||||
|
${fn:substring(serverIp,0,20)}..
|
||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${fn:length(indexCfg.serverIp)<=28}">
|
<c:if test="${fn:length(serverIp)<=28}">
|
||||||
${indexCfg.serverIp }
|
${serverIp }
|
||||||
</c:if>
|
</c:if>
|
||||||
</a></td>
|
</a></td>
|
||||||
<td>${indexCfg.remarks }</td>
|
<td>${indexCfg.remarks }</td>
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
value="${user.serverIp}" labelName="user.serverIp"
|
value="${user.serverIp}" labelName="user.serverIp"
|
||||||
notAllowSelectParent="true" enableSearch="true"
|
notAllowSelectParent="true" enableSearch="true"
|
||||||
notAllowSelectRoot="true" checkedPS="ps" unCheckedPS="ps"
|
notAllowSelectRoot="true" checkedPS="ps" unCheckedPS="ps"
|
||||||
labelValue="${user.serverIp}" title="vpn_ip"
|
labelValue="${fn:substring(user.serverIp,0,(fn:length(user.serverIp)-1)) }" title="vpn_ip"
|
||||||
url="/maintenance/userManage/treeData?isLeafShow=false&cfgType=3&specific=true" extId="0"
|
url="/maintenance/userManage/treeData?isLeafShow=false&cfgType=3&specific=true" extId="0"
|
||||||
checked="true" cssClass="form-control required" />
|
checked="true" cssClass="form-control required" />
|
||||||
</div>
|
</div>
|
||||||
@@ -123,9 +123,15 @@
|
|||||||
<form:input path="userName" htmlEscape="false" maxlength="50"
|
<form:input path="userName" htmlEscape="false" maxlength="50"
|
||||||
readonly="true" class="required form-control" />
|
readonly="true" class="required form-control" />
|
||||||
</c:if> --%>
|
</c:if> --%>
|
||||||
|
<c:if test="${!(empty user.id)}">
|
||||||
|
<form:input path="userName" readonly="true" htmlEscape="false" maxlength="50"
|
||||||
|
class="required form-control" />
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${empty user.id}">
|
||||||
<form:input path="userName" htmlEscape="false" maxlength="50"
|
<form:input path="userName" htmlEscape="false" maxlength="50"
|
||||||
class="required form-control" />
|
class="required form-control" />
|
||||||
|
</c:if>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div for="userName"></div>
|
<div for="userName"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user