2018-06-13 10:18:06 +08:00
|
|
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
|
|
|
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<title><spring:message code="${cfgName}"></spring:message></title>
|
|
|
|
|
|
|
|
|
|
<style type="text/css">
|
|
|
|
|
.boxSolid {
|
|
|
|
|
border: 1px solid #eeeeee
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(document)
|
|
|
|
|
.ready(
|
|
|
|
|
function() {
|
2018-08-31 16:31:50 +08:00
|
|
|
$(".glyphicon-plus").first().click();
|
|
|
|
|
$(".boxSolid .glyphicon-remove").first().addClass("hidden");
|
2018-06-13 10:18:06 +08:00
|
|
|
$(".action").on("change", function() {
|
|
|
|
|
$("#serviceId").val($(this).attr("serviceId"));
|
|
|
|
|
$("#protocolId").val($(this).attr("protocolId"));
|
2018-08-26 15:17:15 +08:00
|
|
|
var action=$("input[name='action']:checked").val();
|
|
|
|
|
switchAction(action);
|
2018-06-13 10:18:06 +08:00
|
|
|
});
|
|
|
|
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
|
|
|
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
|
|
|
|
$("#cfgFrom").validate(
|
|
|
|
|
{
|
|
|
|
|
errorPlacement : function(error, element) {
|
|
|
|
|
$(element).parents(".form-group").find(
|
|
|
|
|
"div[for='"
|
|
|
|
|
+ element.attr("name")
|
|
|
|
|
+ "']").append(error);
|
|
|
|
|
},
|
|
|
|
|
submitHandler : function(form) {
|
|
|
|
|
//loading('onloading...');
|
|
|
|
|
var flag = true;
|
|
|
|
|
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
|
|
|
|
if($(".boxSolid").length ==$(".boxSolid.hidden").length){
|
|
|
|
|
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//代表所有区域都隐藏了,提示必须增加个区域信息
|
|
|
|
|
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
|
|
|
|
|
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
|
|
|
|
|
if($("#areaIp").hasClass("hidden")) $("#areaIsp").find(".glyphicon-plus").click();
|
|
|
|
|
top.$.jBox.tip("<spring:message code='one_more_area'/>", "<spring:message code='info'/>");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
|
|
|
|
|
if($(this).val()==''){
|
|
|
|
|
$(this).parents(".form-group").find(
|
|
|
|
|
"div[for='"
|
|
|
|
|
+ $(this).attr("name")
|
|
|
|
|
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
2018-08-07 13:55:19 +08:00
|
|
|
});
|
|
|
|
|
//keywords非空校验完成校验二进制字符串
|
2018-08-26 15:17:15 +08:00
|
|
|
$(".boxSolid:visible").find("select[name$='isHexbin']").each(function(){
|
2018-08-07 13:55:19 +08:00
|
|
|
var isHexbin=$(this).val();
|
|
|
|
|
if(isHexbin == 1){ //十六进制
|
|
|
|
|
var keywords=$("input[name$='"+$(this).attr("name").replace("isHexbin","cfgKeywords")+"']").val();
|
2018-09-13 18:14:38 +08:00
|
|
|
keywords=keywords.replace("***and***","")
|
|
|
|
|
if(keywords != ''){
|
2018-08-07 15:40:53 +08:00
|
|
|
if(!(/^([0-9|a-f|A-F]*)$/.test(keywords))){
|
|
|
|
|
$(this).parents(".boxSolid").find(
|
|
|
|
|
"div[for='"
|
|
|
|
|
+ $(this).attr("name").replace("isHexbin","cfgKeywords")
|
|
|
|
|
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.hexCheck+"</label>");
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
2018-08-07 13:55:19 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2018-06-13 10:18:06 +08:00
|
|
|
if(flag){
|
|
|
|
|
//将disable属性的元素删除
|
|
|
|
|
$(".disabled").each(function(){
|
|
|
|
|
$(this).remove();
|
|
|
|
|
});
|
|
|
|
|
$("input[name$='exprType']").attr("disabled",false);
|
2018-08-15 09:16:10 +08:00
|
|
|
loading('onloading...');
|
2018-06-13 10:18:06 +08:00
|
|
|
form.submit();
|
2018-08-07 13:55:19 +08:00
|
|
|
}else{
|
|
|
|
|
return;
|
2018-06-13 10:18:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
errorContainer : "#messageBox",
|
|
|
|
|
});
|
|
|
|
|
//业务内容增加
|
|
|
|
|
/* $("span[title='add']").on("click", function() {
|
|
|
|
|
$(".ipPort0").removeClass("hidden");
|
|
|
|
|
}); */
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//业务窗口打开
|
|
|
|
|
var addContent = function(obj, contentClassName) {
|
|
|
|
|
var showDiv = $(obj).parent().parent().next();
|
|
|
|
|
$(showDiv).removeClass("hidden").removeClass(
|
|
|
|
|
"disabled");
|
|
|
|
|
/* $("."+contentClassName+"0").find("input,select").each(function(){
|
|
|
|
|
$(this).removeAttr("disabled");
|
|
|
|
|
}); */
|
|
|
|
|
$(obj).addClass("hidden");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//业务窗口关闭
|
|
|
|
|
var delContent = function(contentClassName, addBtnClassName) {
|
|
|
|
|
$("." + contentClassName).addClass("hidden").addClass("disabled");
|
|
|
|
|
/* $("."+contentClassName).find("input,select").each(function(){
|
|
|
|
|
$(this).attr("disabled","true");
|
|
|
|
|
}); */
|
|
|
|
|
$("." + addBtnClassName).removeClass("hidden");
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
|
|
|
|
|
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
|
|
|
|
|
<div class="page-content">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<div class="portlet box blue">
|
|
|
|
|
<div class="portlet-title">
|
|
|
|
|
<div class="caption">
|
|
|
|
|
<i class="fa fa-gift"></i>
|
|
|
|
|
<c:if test="${empty _cfg.cfgId}">
|
|
|
|
|
<spring:message code="add"></spring:message>
|
|
|
|
|
</c:if>
|
|
|
|
|
<c:if test="${not empty _cfg.cfgId}">
|
|
|
|
|
<spring:message code="edit"></spring:message>
|
|
|
|
|
</c:if>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="portlet-body form">
|
|
|
|
|
<!-- BEGIN FORM-->
|
|
|
|
|
<form id="cfgFrom" action="${ctx}/ntc/other/saveXmppCfg"
|
|
|
|
|
method="post" class="form-horizontal">
|
|
|
|
|
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
|
|
|
|
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
|
|
|
|
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
|
|
|
|
<input type="hidden" id="serviceId" name="serviceId"
|
|
|
|
|
value="${_cfg.serviceId}">
|
|
|
|
|
|
|
|
|
|
<div class="form-body">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="control-label col-md-3"><spring:message
|
|
|
|
|
code="config_describe" /></label>
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<input class="form-control" type="text" name="cfgDesc"
|
|
|
|
|
value="${_cfg.cfgDesc}">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2018-08-26 15:17:15 +08:00
|
|
|
<div class="col-md-6">
|
2018-06-13 10:18:06 +08:00
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="control-label col-md-3"><spring:message
|
|
|
|
|
code="action" /></label>
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<c:forEach items="${serviceList}" var="service"
|
|
|
|
|
varStatus="satus">
|
2018-08-26 15:17:15 +08:00
|
|
|
<label class="radio-inline">
|
|
|
|
|
<c:if test="${_cfg.functionId eq service.functionId}">
|
|
|
|
|
<input type="radio" name="action"
|
|
|
|
|
serviceId="${service.serviceId }"
|
|
|
|
|
protocolId="${service.protocolId }"
|
|
|
|
|
value="${service.action }" class="required action"
|
|
|
|
|
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
|
|
|
|
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
|
|
|
|
<c:if test="${dict.itemCode eq service.action }">
|
|
|
|
|
<spring:message code="${dict.itemValue }"/>
|
|
|
|
|
</c:if>
|
|
|
|
|
</c:forEach>
|
2018-06-13 10:18:06 +08:00
|
|
|
</c:if>
|
|
|
|
|
</label>
|
2018-08-26 15:17:15 +08:00
|
|
|
</c:forEach>
|
|
|
|
|
</div>
|
2018-06-13 10:18:06 +08:00
|
|
|
<div for="action"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2018-08-24 11:45:35 +08:00
|
|
|
<!-- dolog begin-->
|
2018-08-26 15:17:15 +08:00
|
|
|
<div class="row doLog">
|
2018-08-24 11:45:35 +08:00
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
|
|
|
|
|
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
|
|
|
|
<c:choose>
|
|
|
|
|
<c:when test="${dict.itemCode eq _cfg.doLog}">
|
|
|
|
|
<label class="radio-inline">
|
|
|
|
|
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
|
|
|
|
|
</label>
|
|
|
|
|
</c:when>
|
|
|
|
|
<c:otherwise>
|
|
|
|
|
<label class="radio-inline">
|
|
|
|
|
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
|
|
|
|
|
</label>
|
|
|
|
|
</c:otherwise>
|
|
|
|
|
</c:choose>
|
|
|
|
|
|
|
|
|
|
</c:forEach>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- dolog end-->
|
|
|
|
|
|
2018-06-13 10:18:06 +08:00
|
|
|
<c:set var="ipCfgIndex" value="0"></c:set>
|
2018-08-26 15:17:15 +08:00
|
|
|
<c:set var="subscribeIndex" value="0"></c:set>
|
2018-06-13 10:18:06 +08:00
|
|
|
<c:set var="complexCfgIndex" value="0"></c:set>
|
|
|
|
|
<c:forEach items="${regionList}" var="region" varStatus="status">
|
|
|
|
|
<c:if test="${region.regionType eq 1 }">
|
|
|
|
|
<!--ip info-->
|
|
|
|
|
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
|
|
|
|
<h4 class="form-section">
|
|
|
|
|
<spring:message code="${region.configRegionValue}" />
|
|
|
|
|
<small> <span
|
|
|
|
|
class="glyphicon glyphicon-plus ${tabName}Add"
|
|
|
|
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
|
|
|
|
</h4>
|
|
|
|
|
<c:set var="cfgName" value="ipPortList[${ipCfgIndex}]"></c:set>
|
|
|
|
|
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></c:set> --%>
|
|
|
|
|
<c:choose>
|
|
|
|
|
<c:when test="${fn:length(_cfg.ipPortList)>0 and ipCfgIndex<fn:length(_cfg.ipPortList) }">
|
|
|
|
|
<c:forEach items="${_cfg.ipPortList}" var="ipPort">
|
|
|
|
|
<c:if test="${region.configRegionValue eq ipPort.cfgType }">
|
|
|
|
|
<div class="row boxSolid ${tabName}${status.index}">
|
|
|
|
|
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
|
|
|
|
|
</div>
|
|
|
|
|
<c:set var="ipCfgIndex" value="${ipCfgIndex+1}"></c:set>
|
|
|
|
|
</c:if>
|
|
|
|
|
</c:forEach>
|
|
|
|
|
</c:when>
|
|
|
|
|
<c:otherwise>
|
|
|
|
|
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
|
|
|
|
|
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
|
|
|
|
|
</div>
|
|
|
|
|
<c:set var="ipCfgIndex" value="${ipCfgIndex+1 }"></c:set>
|
|
|
|
|
</c:otherwise>
|
|
|
|
|
</c:choose>
|
|
|
|
|
<!--/ip info-->
|
|
|
|
|
</c:if>
|
2018-08-24 11:45:35 +08:00
|
|
|
<c:if test="${region.regionType eq 2 }">
|
2018-08-26 15:17:15 +08:00
|
|
|
<c:if test="${region.configServiceType eq 'subscribe_id' }">
|
|
|
|
|
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
2018-08-24 11:45:35 +08:00
|
|
|
<h4 class="form-section">
|
|
|
|
|
<spring:message code="${region.configRegionValue}" />
|
|
|
|
|
<small> <span
|
|
|
|
|
class="glyphicon glyphicon-plus ${tabName}Add"
|
|
|
|
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
|
|
|
|
</h4>
|
2018-08-26 15:17:15 +08:00
|
|
|
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${subscribeIndex}]"></c:set>
|
2018-08-24 11:45:35 +08:00
|
|
|
<c:choose>
|
|
|
|
|
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
|
|
|
|
|
<c:set var="isBreak" value="false" ></c:set>
|
|
|
|
|
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
|
|
|
|
|
<c:choose>
|
|
|
|
|
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
|
2018-08-26 15:17:15 +08:00
|
|
|
<div class="row ${tabName}${status.index}">
|
2018-08-24 11:45:35 +08:00
|
|
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
|
|
|
|
</div>
|
|
|
|
|
<c:set var="isBreak" value="true" ></c:set>
|
2018-08-26 15:17:15 +08:00
|
|
|
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
|
2018-08-24 11:45:35 +08:00
|
|
|
</c:when>
|
|
|
|
|
</c:choose>
|
|
|
|
|
</c:forEach>
|
|
|
|
|
<c:if test="${!isBreak}">
|
2018-08-26 15:17:15 +08:00
|
|
|
<div class="row ${tabName}${status.index} hidden disabled">
|
2018-08-24 11:45:35 +08:00
|
|
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
|
|
|
|
</div>
|
2018-08-26 15:17:15 +08:00
|
|
|
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
|
2018-08-24 11:45:35 +08:00
|
|
|
</c:if>
|
|
|
|
|
</c:when>
|
|
|
|
|
<c:otherwise>
|
2018-08-26 15:17:15 +08:00
|
|
|
<div class="rows ${tabName}${status.index} hidden disabled">
|
2018-08-24 11:45:35 +08:00
|
|
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
|
|
|
|
</div>
|
2018-08-26 15:17:15 +08:00
|
|
|
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
|
2018-08-24 11:45:35 +08:00
|
|
|
</c:otherwise>
|
|
|
|
|
</c:choose>
|
2018-08-26 15:17:15 +08:00
|
|
|
</c:if>
|
2018-08-24 11:45:35 +08:00
|
|
|
</c:if>
|
|
|
|
|
|
|
|
|
|
|
2018-06-13 10:18:06 +08:00
|
|
|
<c:if test="${region.regionType eq 3 }">
|
|
|
|
|
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
|
|
|
|
<h4 class="form-section">
|
|
|
|
|
<spring:message code="${region.configRegionValue}" />
|
|
|
|
|
<small> <span
|
|
|
|
|
class="glyphicon glyphicon-plus ${tabName}Add"
|
|
|
|
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
|
|
|
|
</h4>
|
|
|
|
|
<c:set var="cfgName" value="domainList[${complexCfgIndex}]"></c:set>
|
|
|
|
|
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></c:set> --%>
|
|
|
|
|
<c:choose>
|
|
|
|
|
<c:when test="${fn:length(_cfg.domainList)>0}">
|
|
|
|
|
<c:set var="isBreak" value="false" ></c:set>
|
2018-08-19 15:55:27 +08:00
|
|
|
<c:forEach items="${_cfg.domainList}" var="cfg">
|
2018-06-13 10:18:06 +08:00
|
|
|
<c:choose>
|
2018-08-19 15:55:27 +08:00
|
|
|
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
|
2018-06-13 10:18:06 +08:00
|
|
|
<div class="row boxSolid ${tabName}${status.index}">
|
|
|
|
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
|
|
|
|
</div>
|
|
|
|
|
<c:set var="isBreak" value="true" ></c:set>
|
|
|
|
|
<c:set var="complexCfgIndex" value="${complexCfgIndex+1 }"></c:set>
|
|
|
|
|
</c:when>
|
|
|
|
|
</c:choose>
|
|
|
|
|
</c:forEach>
|
|
|
|
|
<c:if test="${!isBreak}">
|
|
|
|
|
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
|
|
|
|
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
|
|
|
|
</div>
|
|
|
|
|
<c:set var="complexCfgIndex" value="${complexCfgIndex+1 }"></c:set>
|
|
|
|
|
</c:if>
|
|
|
|
|
</c:when>
|
|
|
|
|
<c:otherwise>
|
|
|
|
|
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
|
|
|
|
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
|
|
|
|
</div>
|
|
|
|
|
<c:set var="complexCfgIndex" value="${complexCfgIndex+1 }"></c:set>
|
|
|
|
|
</c:otherwise>
|
|
|
|
|
</c:choose>
|
|
|
|
|
</c:if>
|
|
|
|
|
</c:forEach>
|
|
|
|
|
<br>
|
|
|
|
|
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
|
|
|
|
|
<br>
|
|
|
|
|
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
|
|
|
|
|
<div class="form-actions">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-offset-3 col-md-8">
|
|
|
|
|
<button id="save" type="submit" class="btn green">
|
|
|
|
|
<spring:message code="submit" />
|
|
|
|
|
</button>
|
|
|
|
|
<button id="cancel" type="button" class="btn default">
|
|
|
|
|
<spring:message code="cancel" />
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-6"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
<!-- END FORM-->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|